CN112613861A - Electric power pre-sale transaction method, device and system based on alliance chain - Google Patents

Electric power pre-sale transaction method, device and system based on alliance chain Download PDF

Info

Publication number
CN112613861A
CN112613861A CN202011507155.6A CN202011507155A CN112613861A CN 112613861 A CN112613861 A CN 112613861A CN 202011507155 A CN202011507155 A CN 202011507155A CN 112613861 A CN112613861 A CN 112613861A
Authority
CN
China
Prior art keywords
transaction
power
node
electric power
power transaction
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.)
Granted
Application number
CN202011507155.6A
Other languages
Chinese (zh)
Other versions
CN112613861B (en
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
Jiaxing Power Supply Co of State Grid Zhejiang Electric Power Co Ltd
Original Assignee
Beijing University of Posts and Telecommunications
Jiaxing Power Supply Co of State Grid Zhejiang 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, Jiaxing Power Supply Co of State Grid Zhejiang Electric Power Co Ltd filed Critical Beijing University of Posts and Telecommunications
Priority to CN202011507155.6A priority Critical patent/CN112613861B/en
Publication of CN112613861A publication Critical patent/CN112613861A/en
Application granted granted Critical
Publication of CN112613861B publication Critical patent/CN112613861B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/22Payment schemes or models
    • G06Q20/223Payment schemes or models based on the use of peer-to-peer networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3823Payment protocols; Details thereof insuring higher security of transaction combining multiple encryption tools for a transaction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • G06Q20/4014Identity check for transactions
    • G06Q20/40145Biometric identity checks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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

Landscapes

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

Abstract

One or more embodiments of the present specification provide an electric power pre-sale transaction method based on an alliance chain, which performs electric power transaction in an electric power transaction system including a block chain network by signing an electric power transaction order that includes a signature approved by a first terminal device and a second terminal device corresponding to the first terminal device for the electric power transaction order, that is, the first terminal device and the second terminal device complete the signature of the transaction order in advance before power generation or power utilization, so as to reach the electric power transaction order in advance; when power generation or power utilization is achieved, trading can be directly carried out according to the power trading order, and trading speed and trading efficiency are improved. Meanwhile, the power production and sale person on the upper chain can sell the residual power after the power consumption per se in the block chain power grid, so that the waste of the residual power is avoided, and the power supply and demand balance in the power grid is promoted; in addition, the transaction time among the terminal devices can be distributed, the pressure of the power transaction system during the peak time of power utilization is reduced, more time can be provided for a power grid company to manage and schedule power, and the balance of supply and demand of the power is further promoted.

Description

Electric power pre-sale transaction method, device and system based on alliance chain
Technical Field
One or more embodiments of the present specification relate to the technical field of internet of things, and in particular, to a power pre-sale transaction method, device, and system based on a federation chain.
Background
With the development of scientific technology, a power grid is developing towards intellectualization, openness and marketization, and a block chain is used as a novel bottom-layer communication technology and is realized as a non-tamper distributed system; the method has high conformity with the development direction of the power grid, and emphasizes the characteristics of decentralization, intellectualization, publicity, marketization and the like. If the blockchain technique can be applied to the smart grid, many existing problems can be solved, for example: (1) by utilizing the non-tamper property of the data of the block chain, the accurate data of each link such as power production, data acquisition, power transaction, power utilization condition and the like can be effectively recorded, so that the accurate data can be traced and searched in future when needed; (2) by utilizing the distributed characteristic of the block chain technology, the participation degree of a third party in the traditional energy trading is reduced, and the decentralization and marketization of the power resource trading circulation are promoted; (3) the block chain technology can effectively reduce trust cost and establish a distrust-free supply and demand balance system of a producer and a consumer; (4) the distributed storage and encryption technology of the block chain protects data privacy and safety to a great extent and also enhances the robustness of the power grid in resisting external network attacks.
Some current blockchain studies are mostly focused on such things as: public links, such as bitcoin and ether houses, are completely open networks, have slow speed in trading and achieving consensus, and are difficult to meet the instantaneous requirements of power trading; for example, in a private chain, the read-write authority of a private block chain network is completely controlled by an organization or an individual, which is not in line with the development direction of decentralization of the current power grid, and also hinders the marketization and intelligent development of power resource trading.
In addition, some consumers in the traditional electric power energy market are gradually transformed into producers and sellers (mainly consuming energy and having a certain electricity and energy production means, and generally generating electricity by using renewable energy sources, such as solar energy and wind energy), and the participation of such energy sources in electric power trading is gradually becoming the main development trend of the electric power market. If the original ways of uniform pricing, centralized scheduling and central settlement are adopted for electric power transaction, the problems of low transaction efficiency, unbalanced supply and demand, resource waste and the like can be caused.
Disclosure of Invention
In view of this, one or more embodiments of the present disclosure provide a power pre-sale transaction method based on a federation chain, so as to solve the problems of low transaction efficiency, unbalanced supply and demand, and resource waste of the current power transaction system.
In view of the above, one or more embodiments of the present specification provide a alliance-chain-based power pre-sale transaction method, where the method is applied to a blockchain network in a power transaction system, the blockchain network includes a peer node and a sorting node, the peer node includes an endorsement node and a billing node, and the method includes:
the endorsement node receives an electric power transaction order sent by a first terminal device, and returns a first electric power transaction option corresponding to the electric power transaction order to the first terminal device, so that the first terminal device determines the target electric power transaction according to the first electric power transaction option; the trade order comprises signatures approved by the first terminal equipment and second terminal equipment corresponding to the first terminal equipment for the electric power trade order;
the sequencing node receives the target power transaction and generates a target block according to transaction data corresponding to the target power transaction;
and the accounting node receives the target block, verifies the target block, and updates the target block to an account book of the block chain network if the target block passes verification.
Optionally, before the step of receiving, by the endorsement node, the power trade order sent by the first terminal device, the method further includes:
the endorsement node receives an electric power transaction request sent by a first terminal device, wherein the electric power transaction request comprises electric power transaction value information of an electric power unit and gap electric quantity data or residual electric quantity data, and the gap electric quantity data or the residual electric quantity data are electric quantity data obtained by prediction according to historical electric quantity data and historical electric quantity data in a preset time period on a block chain;
and if the unit electric power transaction value information and the gap electric quantity or the residual electric quantity meet preset conditions, the endorsement node returns a second electric power transaction option corresponding to the electric power transaction request to the first terminal equipment, so that the first terminal equipment determines the electric power transaction order according to the second electric power transaction option and sends the electric power transaction order to the endorsement node.
Optionally, if the unit electricity transaction value information and the gap electricity quantity or the remaining electricity quantity satisfy a preset condition, the endorsement node returns a second electricity transaction option corresponding to the electricity transaction request to the first terminal device, so that the first terminal device determines the electricity transaction order according to the second electricity transaction option and sends the electricity transaction order to the endorsement node, where the method includes:
if the power transaction request is a power purchase request and the unit power transaction value corresponding to the power transaction request is greater than or equal to the unit power transaction value of a power sale order in a sale queue, the endorsement node returns a second power transaction option corresponding to the power transaction request to the first terminal device, so that the first terminal device determines the first power transaction order according to the second power transaction option, determines the power transaction order according to the first power transaction order and sends the power transaction order to the endorsement node; the second transaction option comprises a plurality of electric power transactions and signatures of endorsement nodes, and transaction electric quantities corresponding to the electric power transactions are respectively smaller values of purchase electric quantities or sale electric quantities corresponding to the electric power transactions;
if the power transaction request is a power selling request and the unit power transaction value corresponding to the power transaction request is less than or equal to the unit power transaction value of a power purchase order in a purchase queue, the endorsement node returns a second power transaction option corresponding to the power transaction request to the first terminal device, so that the first terminal device determines the first power transaction order according to the second power transaction option, determines the power transaction order according to the first power transaction order and sends the power transaction order to the endorsement node; the second transaction option comprises a plurality of electric power transactions and signatures of endorsement nodes, and transaction electric quantity corresponding to the electric power transactions is the smaller value of purchase electric quantity or sale electric quantity corresponding to the electric power transactions respectively.
Optionally, after the step of returning the second power transaction option corresponding to the power transaction request to the first terminal device by the endorsement node, the method further includes:
if the transaction electric quantity is smaller than the selling electric quantity or the purchasing electric quantity, the endorsement node acquires the shortage electric quantity which is the difference value between the transaction electric quantity and the selling electric quantity or the purchasing electric quantity, and generates a first electric power transaction request according to the shortage electric quantity;
if the unit electric power transaction value corresponding to the first electric power transaction request meets a preset condition, the endorsement node returns a third electric power transaction option corresponding to the first electric power transaction request to the first terminal equipment, so that the first terminal equipment determines the second electric power transaction order according to the third electric power transaction option;
the endorsement node updates the power trading order to obtain the updated power trading order, wherein the updated power trading order comprises the first power trading order and the second power trading order.
Optionally, the sorting node includes a main sorting node and an auxiliary sorting node, and the sorting node receives the target power transaction and generates a target block according to transaction data corresponding to the target power transaction, including:
the sequencing node receives the target power transaction and determines a main sequencing node and a plurality of auxiliary sequencing nodes through drawing lots;
the master sequencing node generates a preselected block according to the target power transaction, the preselected block comprising a signature of the master sequencing node;
the auxiliary sorting nodes receive the preselected block and judge whether the preselected block passes the verification of the auxiliary sorting nodes;
if the preselected block passes the verification of the auxiliary sequencing node, the auxiliary sequencing node returns a signature to the main sequencing node, and a target block is generated according to the transaction data corresponding to the target electric power transaction;
and if the preselected block fails to pass the verification of the auxiliary sorting node, returning to execute the steps that the sorting node receives the target power transaction and determines a main sorting node and a plurality of auxiliary sorting nodes through drawing lots.
Optionally, the sorting node receives the target power transaction, and determines a main sorting node and an auxiliary sorting node through drawing lots, including:
the sequencing nodes receive the target power transaction, acquire the transaction participation degree corresponding to each sequencing node, and generate the main sequencing node according to the transaction participation degree through drawing lots;
arranging the transaction participation degrees except the main sequencing node in the nodes with the preset number of digits in the sequencing nodes, and drawing lots to determine the auxiliary sequencing node;
the method comprises the steps that the probability of drawing lots is positively correlated with the transaction participation degree, and the transaction participation degree is determined by the calculation power contributed by nodes, the storage unit contributed by the nodes, the continuous online consensus participation time of the nodes, the historical transaction amount of the terminal equipment corresponding to the nodes, and the transaction amount of the terminal equipment corresponding to the latest block in the block chain network.
Optionally, the auxiliary sorting nodes receive the preselected block, and determine whether the preselected block passes the verification of the auxiliary sorting nodes; if the verification of the auxiliary sorting node is passed, the auxiliary sorting node returns a signature to the main sorting node, and generates a target block according to the transaction data corresponding to the target power transaction, including:
the auxiliary sorting nodes receive the preselected block, judge whether the preselected block passes the verification of the auxiliary sorting nodes or not, and return a signature to the main sorting node if the transaction data corresponding to the preselected block passes the verification;
if the signature number of the auxiliary sorting node received by the main sorting node meets a preset value, the main sorting node broadcasts the preselected block and the signature corresponding to the preselected block to non-main sorting nodes in the sorting nodes; and the non-main sequencing node in the sequencing nodes receives the preselected block and the signature corresponding to the preselected block, and verifies the signature corresponding to the preselected block to obtain a target block after verification is passed.
Optionally, the method further includes: the accounting node receives a first request sent aiming at the target power transaction, the accounting node judges the type of the first traceability request, if the first traceability request is a verification traceability request, a uplink traceability result of the target power transaction is returned to the terminal equipment, and the uplink traceability result is used for reflecting whether the target power transaction is uplink or not; if the first tracing request is a transaction information query tracing request, returning a transaction tracing result of the target power transaction to the terminal device, wherein the transaction tracing result is used for reflecting transaction information corresponding to the target power transaction; or,
the accounting node receives a second traceability request sent aiming at the target electric power transaction, the second traceability request is a supervision traceability request, the accounting node determines the authority of a terminal device according to the second traceability request, acquires the transaction information corresponding to the target electric power transaction and corresponding to the authority, and returns the transaction information corresponding to the target electric power transaction to the terminal device.
One or more embodiments of the present specification provide an electric power pre-sale transaction apparatus based on a federation chain, wherein the apparatus is applied to a blockchain network in an electric power transaction system, the blockchain network includes a peer node and a sorting node, the peer node includes an endorsement node and a billing node, and the method includes:
the sending unit is used for controlling the endorsement node to receive an electric power transaction order sent by a first terminal device and returning a first electric power transaction option corresponding to the electric power transaction order to the first terminal device, so that the first terminal device determines the target electric power transaction according to the first electric power transaction option; the trade order comprises signatures approved by the first terminal equipment and second terminal equipment corresponding to the first terminal equipment for the electric power trade order;
the generation unit is used for controlling the sequencing node to receive the target power transaction and generating a target block according to transaction data corresponding to the target power transaction;
and the updating unit is used for controlling the accounting node to receive the target block, verifying the target block, and updating the target block to an account book of the block chain network if the target block passes verification.
One or more embodiments of the present specification provide an electric power pre-sale transaction system based on a federation chain, where the system includes a blockchain network and a plurality of terminal devices connected to the blockchain network, where the plurality of terminal devices includes at least a first terminal device and a second terminal device, where the blockchain network includes a peer node and a sorting node, and the peer node includes an endorsement node and a billing node;
the terminal device is used for responding to a request sending instruction and sending an electric power trading order to an endorsement node in the block chain network, wherein the trading order comprises signatures approved by the first terminal device and a second terminal device corresponding to the first terminal device for the electric power trading order;
the endorsement node in the block chain network is used for receiving an electric power transaction order sent by a first terminal device and returning a first electric power transaction option corresponding to the electric power transaction order to the first terminal device, so that the first terminal device determines the target electric power transaction according to the first electric power transaction option;
a sorting node in the block chain network, configured to control the sorting node to receive the target power transaction, and generate a target block according to transaction data corresponding to the target power transaction
And the accounting node in the block chain network is used for controlling the accounting node to receive the target block, verifying the target block, and updating the target block to an account book of the block chain network if the target block passes verification.
As can be seen from the above description, the electric power pre-sale transaction method based on alliance chain provided by one or more embodiments of the present specification can be applied to a blockchain network in an electric power transaction system, where the blockchain network includes peer nodes and sorting nodes, and the peer nodes include endorsement nodes and accounting nodes; the endorsement node receives an electric power transaction order sent by a first terminal device, and returns a first electric power transaction option corresponding to the electric power transaction order to the first terminal device, so that the first terminal device determines the target electric power transaction according to the first electric power transaction option; (ii) a The trade order comprises signatures approved by the first terminal equipment and second terminal equipment corresponding to the first terminal equipment for the electric power trade order; the sequencing node receives the target power transaction and generates a target block according to transaction data corresponding to the target power transaction; and the accounting node receives the target block, verifies the target block, and updates the target block to an account book of the block chain network if the target block passes verification. In this way, the electric power transaction order which comprises the signatures approved by the first terminal equipment and the second terminal equipment corresponding to the first terminal equipment is subjected to electric power transaction in the electric power transaction system comprising the block chain network, namely the first terminal equipment and the second terminal equipment complete the signature of the transaction order in advance before power generation or power utilization, so that the electric power transaction order for electric power pre-sale/purchase is achieved, and when power generation or power utilization is achieved, the transaction can be directly carried out according to the electric power transaction order, so that the transaction speed and the transaction efficiency are improved; meanwhile, the power production and sale person on the upper chain can sell the residual power after the power consumption per se in the block chain power grid, so that the waste of the residual power is avoided, and the power supply and demand balance in the power grid is promoted; in addition, the transaction time among the terminal devices can be distributed, the pressure of the power transaction system during the peak time of power utilization is reduced, more time can be provided for a power grid company to manage and schedule power, and the balance of supply and demand of the power is further promoted.
Drawings
In order to more clearly illustrate one or more embodiments or prior art solutions of the present specification, the drawings that are needed in the description of the embodiments or prior art will be briefly described below, and it is obvious that the drawings in the following description are only one or more embodiments of the present specification, and that other drawings may be obtained by those skilled in the art without inventive effort from these drawings.
Fig. 1 is a schematic diagram illustrating a hierarchical layer of a blockchain network according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a alliance-chain-based electric power pre-sale transaction method according to an embodiment of the present invention;
fig. 3 is a schematic flow chart of another alliance-chain-based electric power pre-sale transaction method according to an embodiment of the present invention;
fig. 4 is a schematic flow chart illustrating the traceability of the electric pre-sale transaction system based on the alliance chain according to an embodiment of the present invention;
fig. 5 is a schematic flowchart illustrating a registration authentication process of a power pre-sale transaction system based on a federation chain according to an embodiment of the present invention;
fig. 6 is a schematic diagram illustrating an exemplary flow of a power pre-sale transaction method of a alliance chain according to an embodiment of the present invention;
fig. 7 is another exemplary flowchart of a power pre-sale transaction method of a alliance chain according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a alliance-chain-based electric pre-sale transaction apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of promoting a better understanding of the objects, aspects and advantages of the present disclosure, reference is made to the following detailed description taken in conjunction with the accompanying drawings.
It is to be noted that unless otherwise defined, technical or scientific terms used in one or more embodiments of the present specification should have the ordinary meaning as understood by those of ordinary skill in the art to which this disclosure belongs. The use of "first," "second," and similar terms in one or more embodiments of the specification is not intended to indicate any order, quantity, or importance, but rather is used to distinguish one element from another. The word "comprising" or "comprises", and the like, means that the element or item listed before the word covers the element or item listed after the word and its equivalents, but does not exclude other elements or items. The terms "connected" or "coupled" and the like are not restricted to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "upper", "lower", "left", "right", and the like are used merely to indicate relative positional relationships, and when the absolute position of the object being described is changed, the relative positional relationships may also be changed accordingly.
The inventor researches and discovers that part of consumers in the traditional energy market are gradually transformed into producers and sellers (mainly consuming energy and possessing a certain capacity means, and generally generating electricity by using renewable energy sources, such as solar energy and wind energy), and the participation of such energy sources in electric power trading is gradually becoming the mainstream development trend of the electric power market. If the original ways of uniform pricing, centralized scheduling and central settlement are adopted for electric power transaction, the problems of low transaction efficiency, unbalanced supply and demand, resource waste and the like can be caused.
Therefore, the invention provides an electric power pre-sale transaction method based on an alliance chain, which can be applied to a block chain network in an electric power transaction system, wherein the block chain network comprises peer nodes and a sequencing node, and the peer nodes comprise endorsement nodes and accounting nodes; the endorsement node receives an electric power transaction order sent by a first terminal device, and returns a first electric power transaction option corresponding to the electric power transaction order to the first terminal device, so that the first terminal device determines the target electric power transaction according to the first electric power transaction option; the trade order comprises signatures approved by the first terminal equipment and second terminal equipment corresponding to the first terminal equipment for the electric power trade order; the sequencing node receives the target power transaction and generates a target block according to transaction data corresponding to the target power transaction; and the accounting node receives the target block, verifies the target block, and updates the target block to an account book of the block chain network if the target block passes verification. In this way, the electric power transaction order of electric power pre-sale/purchase is achieved by carrying out electric power transaction in the electric power transaction system comprising the block chain network by the signature which comprises the signature of the first terminal equipment and the signature which is approved by the second terminal equipment corresponding to the first terminal equipment to the electric power transaction order, namely, the signature of the transaction order is completed in advance before the first terminal equipment and the second terminal equipment generate or use electricity; when power generation or power utilization is achieved, trading can be directly carried out according to the power trading order, and trading speed and trading efficiency are improved. Meanwhile, the power production and sale person on the upper chain can sell the residual power after the power consumption per se in the block chain power grid, so that the waste of the residual power is avoided, and the power supply and demand balance in the power grid is promoted; in addition, the transaction time among the terminal devices can be distributed, the pressure of the power transaction system during the peak time of power utilization is reduced, more time can be provided for a power grid company to manage and schedule power, and the balance of supply and demand of the power is further promoted.
It should be noted that the block chain network described in the present invention is an alliance chain network (i.e. an alliance chain), and the alliance chain network is an authorized block chain, and only receives nodes that are authenticated by identity to join the network, so that the security of the power data and the transaction information can be effectively ensured, and the achievement of consensus in the alliance chain is simpler and more efficient, and the requirement of the instantaneity of the power transaction can be met. Meanwhile, the authority of each node in the alliance chain is different, and the requirement of various roles in the current power grid system is met.
In an embodiment, as shown in fig. 1, a hierarchical diagram of a blockchain network is shown, the blockchain network in this embodiment may be divided into five layers, which are a physical device layer, a data layer, a network layer, a technology layer, and a service layer. These five layers will be described separately below.
And the physical equipment layer is positioned at the bottommost layer of the block chain network and comprises an intelligent electric meter for measuring and recording electric power data, various user operation nodes, block chain terminal equipment for hosting accounts, various power generation equipment (photovoltaic equipment, wind power equipment and thermal power equipment), energy storage equipment and the like.
And the data layer is used for storing data mainly comprising electricity utilization and power generation data, electricity transaction data and the like. The electricity consumption data mainly refers to the electricity consumption information of various users in the network, and the data can be automatically uploaded through an intelligent ammeter; the record of the power generation data comprises information such as power generation types (light energy power generation, wind energy power generation, hydroelectric power generation, thermal power generation and the like), power generation amount, daily power generation efficiency curves and the like; the electric power transaction comprises electric power transaction parties, transaction price and electric quantity. All data is packed by the sequencing node and then uplinked, and recorded in the block chain to form data information which cannot be tampered.
And the network layer consists of a plurality of distributed nodes. The nodes jointly form a P2P network, a Gossip protocol is adopted to carry out data transmission and positioning perception among the nodes, and a gPC framework is used to realize an interface calling function.
A technical layer comprising:
the identity authentication technology ensures that a user who joins the electric power transaction network has a certain trust basis, and simultaneously determines that a participant has various permissions in the blockchain network according to the identity;
a policy, a set of rules that define how to make decisions and achieve specific goals, is the mechanism of infrastructure management;
a distributed ledger storing critical fact information about power business objects, current values of object attributes, and transaction histories that lead to these current values;
the nodes are basic constituent elements of the block chain electric power transaction network, bear accounts and intelligent contracts, are more classified in the electric power network, and have specific authority and work;
consensus, which is simply a probabilistic consistency algorithm, which finally ensures the consistency of the ledger with a high probability, thus ensuring that the sorted blocks are consistent and correct;
intelligent contract techniques to define executable logic for generating new transactions to be added to the ledger.
The service layer is located at the uppermost layer of the whole network architecture, and comprises a plurality of services provided by the blockchain network of the power system, such as the most basic billing service, for recording power transaction information or important power data. The identity authentication service is used for determining the identity of the power grid participant and enhancing the trust foundation. The policy service can define a power grid management mechanism to help a manager to better control the operation state of the network. The intelligent contract service helps users to better write power trading contracts applicable to specific scenarios. The permission service is used for distributing different permissions to different power grid users.
It should be noted that the roles in the power market mainly include: consumers, electricity producers, production and marketing, electricity market operators (including transportation and system operators, distribution system operators, electricity traders, etc.), end customers, etc. For simplicity, whether it is the end customer or the producer or supplier, it can be classified as a node in the grid blockchain, each type of node differing in the application it needs to invoke. The electricity market operator, whichever function is performed, may act as the manager of the blockchain network. The user's identity needs to be translated via the MSP (member service provider) into a specific role in the network to define the corresponding authority. The validity of the CAs is defined in the MSP, and users who issue digital certificates by these valid CAs are eligible to join the network. The MSP can also distinguish digital certificates with different rights issued by digital certificate authorities at different levels and define their rights in the channels and networks. At the same time, the MSP can also identify the specific identities of the different participants in the respective channels or networks, such as administrator identities.
The user needs to register in the power transaction system to complete role positioning, specifically, referring to fig. 5, the registration and authentication step mainly includes the following sub-steps:
the power grid users use an asymmetric encryption algorithm, such as an RSA or ECC algorithm, to generate public and private key pairs, the private keys being kept by the users themselves.
According to the self condition (whether the user is a power generator, a power consumer or a production and marketing person), the user puts forward a corresponding identity application to a Certificate Authority (CA), and provides a previously generated public key and related certification to the certification authority. For example, a user who wants to apply for the identity of a producer and a seller needs to provide proof that power can be generated and proof of the manner of power generation (thermal power generation, renewable energy power generation, etc.). If the certification is approved, the certificate authority issues a digital certificate to the user, and the certificate contains the personal information and the public key of the user and signature information of the CA. The personal information includes the true identity of the user, the power generation address, the power utilization address, the character location in the power market, the power generation manner (renewable energy power generation or non-renewable energy power generation), and the like. And a public-private key pair required by asymmetric encryption is also issued to the user at the same time, and the public key of the user is bound with the digital certificate and then is issued to the whole network.
After obtaining the valid digital certificate, the user converts the identity information into role positioning in the network through the MSP, and creates a corresponding node to join the network. After joining the network, the digital certificate and public key are published to other participants in the network to indicate their identity.
The power market operator, as an administrator of the entire power blockchain network, may define federations and create channels, but has no direct control over the policies running within each federation and channel. In addition, the electric power market operator creates a plurality of nodes to join in each channel to participate in management and transaction.
In combination with role classification in the power market, sorting nodes, mutual correspondence of different functions to be executed by nodes in a block chain network, type of a coalition chain node and role classification in the power market, the types of the nodes in the power grid block chain are mainly classified into the following types:
and (3) light node: nodes which do not store any block data and contract information need to be connected with other nodes for contract calling when a transaction is to be initiated or historical information is inquired. Users without sufficient computing power and storage capacity can participate in the operation of the power blockchain network by operating a light node.
Peer nodes (peers): the nodes participating in maintaining the block account book data are one of the basic components of the network. Peer nodes can also be classified into endorsement nodes, accounting nodes, etc. according to their functions. The endorsement node is responsible for responding to the application of a common user for calling the intelligent contract and simulating the transaction to verify the feasibility of the transaction so as to realize the endorsement strategy. Endorsement nodes are generally operated by large-scale users, large-scale manufacturers, market operators, power grid companies and other participants with a certain degree of competence, firstly because the users have enough competence to endorse, and secondly, the credibility of the users is higher. The accounting node only participates in maintaining block account book data, and users with storage capacity can operate the accounting node.
Sequencing nodes: the method mainly provides sequencing service, does not participate in transaction content, packages the transaction into blocks according to a predefined rule, and does not need permission for the nodes. Wherein, the capable organization or the individual can run the sequencing node to participate in the sequencing service.
So far, the above node types have been introduced. It should also be introduced that the transaction intelligence contracts are primarily used to define the transaction mechanism. The endorsement policy is actually a management rule, transaction in the power transaction block chain network needs endorsement (simulation operation) through endorsement nodes, and each intelligent contract has a special endorsement policy which specifies which endorsement nodes are required for endorsement and signature when the intelligent contract is called for transaction. Alternative endorsement policies are AND, OR AND any combination thereof, for example AND (Org1, Org2) requires that the endorsement node in Org1 AND the endorsement node in Org2 both endorse AND attach a signature to the transaction; OR (Org1, Org2) requires one of the endorsement nodes in Org1 OR Org2 to endorse and sign. Any combination of them can be AND (OR (Org1, Org2), Org3) etc., AND the endorsement policy can be adjusted according to the actual transaction situation.
It should be noted that, in this embodiment, according to the node function and the corresponding authority, in the intelligent power grid block chain network, all peer nodes may be deployed and managed by a power grid operator. The method how to implement power transaction by using endorsement nodes, sequencing nodes and peer nodes in the block chain network will be described in detail below.
The technical solution of the embodiments of the present invention is described in detail below with reference to the accompanying drawings.
Referring to fig. 2, a coalition chain-based power pre-sale transaction method in an embodiment of the present invention is shown, where the method is applied to a blockchain network in a power transaction system, where the blockchain network includes peer nodes and a sorting node, and the peer nodes include an endorsement node and a billing node, and the method includes:
s301: the endorsement node receives an electric power transaction order sent by a first terminal device, and returns a first electric power transaction option corresponding to the electric power transaction order to the first terminal device, so that the first terminal device determines the target electric power transaction according to the first electric power transaction option; the trade order comprises signatures approved by the first terminal device and a second terminal device corresponding to the first terminal device for the electric power trade order.
In this embodiment, when a user needs to perform power transaction, for example, power transaction such as power purchase and power sale, the user a may send a power transaction order to the endorsement node deployed with the intelligent contract through the second terminal device, where the transaction order includes a signature approved by the first terminal device and the second terminal device corresponding to the first terminal device for the power transaction order, that is, the power transaction order is a transaction order that is previously completed before power consumption or power generation and is signed, and is similar to a pre-sale order. The endorsement node receives an electric power transaction order sent by a first terminal device, and returns a first electric power transaction option corresponding to the electric power transaction order to the first terminal device, wherein the first electric power transaction option comprises a plurality of electric power transactions and signatures of the endorsement node, and a user B selects and determines a final target electric power transaction from the plurality of electric power transactions by receiving the returned first electric power transaction option through the first terminal device, namely selects and determines the electric power transaction needing to be traded. Therefore, the electric power trading order is achieved in advance, when power generation or power utilization is achieved, trading can be directly carried out in the block chain network according to the electric power trading order, and the trading speed and the trading efficiency are improved.
The first terminal device and the second terminal device are both trusted terminals in the block chain network. The specific structure of the specific terminal device may be an electronic device according to the present invention (see fig. 9).
Before the step of S301, the alliance-chain-based power pre-sale transaction method further includes:
the endorsement node receives an electric power transaction request sent by a first terminal device, wherein the electric power transaction request comprises electric power transaction value information of an electric power unit and gap electric quantity data or residual electric quantity data, and the gap electric quantity data or the residual electric quantity data are electric quantity data obtained by prediction according to historical electric quantity data and historical electric quantity data in a preset time period on a block chain;
and if the unit electric power transaction value information and the gap electric quantity or the residual electric quantity meet preset conditions, the endorsement node returns a second electric power transaction option corresponding to the electric power transaction request to the first terminal equipment, so that the first terminal equipment determines the electric power transaction order according to the second electric power transaction option and sends the electric power transaction order to the endorsement node.
In this embodiment, a user a predicts, according to historical power generation amount data and historical power consumption amount data within a preset time period recorded on a block chain, gap power amount data or remaining power amount data within the preset time period; the user A sends an electric power transaction request containing gap electric quantity data or residual electric quantity data and electric power transaction value information of an electric power unit to the endorsement node through the second terminal device; and the endorsement node determines a second power transaction option according to the type of the power transaction request and the unit power transaction value information based on the intelligent contract, and returns the second power transaction option containing the endorsement signature to the first terminal equipment after endorsement signature. The second power transaction option comprises a plurality of power transaction orders and signatures of endorsement nodes, and the user B receives the plurality of power transaction orders included in the returned second power transaction option through the first terminal device and selects and determines a final target power transaction order. The preset time period may be a certain time period, a day or several days in a day, for example, the preset time is 18:00-22:00 in a day, and the preset time period may be specifically selected and set according to requirements. For example, the gap power data or the residual power data of 18:00-22:00 in the next day or the next day is predicted by the historical power generation data and the historical power consumption data of 18:00-22:00 in the previous day or the previous days or even longer; and the user provides an electric power transaction request in the electric power transaction system through the first terminal equipment based on the secondary predicted gap electric quantity data or residual electric quantity data.
Specifically, the endorsement node receives a power transaction request received for the first terminal device, the power transaction request having different types, divided into a purchase power request and a sell power request. Judging the type of the power transaction request, if the power transaction request is a power purchase request, and the unit power transaction value corresponding to the power transaction request is greater than or equal to the unit power transaction value of the power sale order in the sale queue; the endorsement node returns a second power transaction option corresponding to the power transaction request to the first terminal device, so that the first terminal device determines a first power transaction order according to the second power transaction option, determines a power transaction order according to the first power transaction order, and sends the power transaction order to the endorsement node; the second transaction option comprises a plurality of electric power transactions and signatures of endorsement nodes, and the transaction electric quantity corresponding to the electric power transactions is the smaller value of the purchase electric quantity or the sale electric quantity corresponding to the electric power transactions respectively. And the user B determines the power transaction order according to the second power transaction option through the first terminal equipment and signs, and the first terminal equipment sends the power transaction order carrying the signature to the sequencing node.
If the power transaction request is a power selling request and the unit power transaction value corresponding to the power transaction request is less than or equal to the unit power transaction value of the power purchase order in the purchase queue, the endorsement node returns a second power transaction option corresponding to the power transaction request to the first terminal device, so that the first terminal device determines a first power transaction order according to the second power transaction option, determines a power transaction order according to the first power transaction order and sends the power transaction order to the endorsement node; the second transaction option comprises a plurality of electric power transactions and signatures of endorsement nodes, and the transaction electric quantity corresponding to the electric power transactions is the smaller value of the purchase electric quantity or the sale electric quantity corresponding to the electric power transactions respectively. And the user B determines the power transaction order according to the second power transaction option through the first terminal equipment and signs, and the first terminal equipment sends the power transaction order carrying the signature to the sequencing node.
Since the power transaction request is random in the matching and pairing process, the purchase power amount corresponding to the purchase power transaction request and the selling power amount corresponding to the selling power request generally occur. Specifically, if the transaction electric quantity is smaller than the selling electric quantity or the purchasing electric quantity, the endorsement node acquires the shortage electric quantity, the shortage electric quantity is a difference value between the transaction electric quantity and the selling electric quantity or the purchasing electric quantity, and generates a first electric power transaction request according to the shortage electric quantity; if the unit electric power transaction value corresponding to the first electric power transaction request meets the preset condition, the endorsement node returns a third electric power transaction option corresponding to the first electric power transaction request to the first terminal device, so that the first terminal device determines a second electric power transaction order according to the third electric power transaction option; updating the power trading order to obtain an updated power trading order, and sending the updated power trading order to the endorsement node; wherein the updated power trade orders comprise a first power trade order and a second power trade order. Specifically, for the preset conditions, when the power transaction request is a power purchase request, the preset conditions are: the unit electric power transaction value corresponding to the electric power transaction request is greater than or equal to the unit electric power transaction value of the electric power selling order in the selling queue; when the electricity trading request is a power selling request, the unit electricity trading value corresponding to the electricity trading request is smaller than or equal to the unit electricity trading value of the electricity purchasing orders in the purchasing queue.
Specifically, the power resources are purchased and sold in advance (power trade orders) before power generation and power consumption/power consumption, that is, the power trade orders are fulfilled in advance, and the traded power of the power trade orders can be predicted according to historical power generation quantity data and historical power consumption quantity data in a preset time period; for example, the electricity sold is: α (predicted power generation amount — predicted power consumption amount), where α is a constant. The historical power generation amount and power consumption amount data recorded on the block chain can be used for predicting and determining the power selling amount or the power purchasing amount. For the electricity producer and seller, the electricity quantity to be sold or purchased in the preset time period can be determined according to alpha (predicted electricity production-predicted electricity consumption), the predicted electricity production in the preset time period (such as in one day) is determined according to the historical electricity production in the preset time period, and the predicted electricity consumption is determined according to the historical electricity consumption in the preset time period. For the power consumer, the historical power generation amount is 0, and the purchase power amount at the preset time is the predicted power consumption amount predicted according to the historical power consumption amount. The benefit of advancing the transaction based on prediction is: most small-sized electricity production and marketing people do not have enough electric energy storage equipment, electricity produced by the users is almost completely wasted except for self consumption, if pre-sale is carried out in advance according to the pre-measured quantity, a trade order is achieved in advance, the redundant electric energy can be utilized and directly transmitted to electricity buying users, resources are saved, and benefits are provided for the users. Meanwhile, the power transmission route can be planned in advance according to the transaction order, the load of a power grid is reduced, and the network load during the peak time of electricity purchase is relieved. The preset time period may be a time period of a day, a day or several days. The unit electric power transaction value referred by the invention can be the transaction unit price of electric power, for example, the price corresponding to each degree of electricity; the unit electricity transaction value information may be unit price information.
The two parties of the transaction can make a power transaction request according to the self needs, and the power transaction request can contain information such as the electric quantity to be purchased or sold, the price of unit electric quantity, whether the electric quantity is green energy power generation or not, a user address, an order ID, time, user identity and the like. The power transaction requests can be divided into power purchase power transaction requests and power sale power transaction requests, and the two power transaction requests are stored in different queues (a sales order queue and a purchase order queue) according to the order of price priority and time priority. The power transaction requests of the sales order queue (selling queue) are sorted from low to high according to prices, and the purchase order queue (purchasing queue) is sorted from high to low according to prices on the contrary; and if the electric power transaction requests with the same price are received, the green energy power generation entrusting sheet is in front, and the rest of the green energy power generation entrusting sheets are sorted according to the order pressing time. And if the electricity purchasing unit electricity trading value corresponding to the electricity trading request is larger than or equal to the unit electricity trading value of the electricity selling orders in the selling queue, automatically matching the trading orders. The transaction electric quantity in the transaction order is a smaller value of the purchase electric quantity or the sale electric quantity of the two parties in the electric power transaction order, and the price can be an average value of prices marked in a plurality of electric power transaction orders. The electricity trading request of the party with larger electricity purchasing or selling amount still exists, but the electricity amount in the trading order is subtracted from the electricity amount, and after the trading order is determined, the two parties exchange money and goods according to the order requirement to complete the trading.
Various users decide to pre-purchase or pre-sell electric quantity according to self prediction (the sale or purchase quantity sets a lower limit to prevent the malicious bill swiping of the users), can establish unit electric power transaction value (electric power transaction unit price) by taking an existing order in a network as a reference, and then generate an electric power transaction request through an intelligent contract. The pre-selling power amount corresponding to the power transaction request may be slightly lower than the predicted remaining power amount, and the purchasing power amount corresponding to the power transaction request may be slightly higher than the predicted gap power amount. If the power transaction request applied before is not satisfied, the user identity information can be used for applying to cancel the power transaction request and clearing the quotation information.
The electric power pre-sale transaction method based on the alliance chain adopts a continuous bidding transaction mode, and the electric power transaction request of the user and the unit electric power transaction value information included in the electric power transaction request meet the preset conditions, so that the transaction can be completed in time. After the electric power transaction request is on line, the type of the electric power transaction request is judged, and if the electric power transaction request is purchased, the unit electric power transaction value corresponding to the electric power transaction request is compared with the unit electric power transaction value of the first electric power transaction request in the selling queue. If the unit electric power transaction value is higher than the unit electric power transaction value of the first electric power transaction request in the selling queue, automatically matching a transaction order, and signing the generated transaction order by both transaction parties to take effect formally; if the unit electric power transaction value is lower than that of the first electric power transaction request in the selling queue, the unit electric power transaction value is compared with that of other electric power transaction requests in the selling queue until the transaction request with the proper price is matched, and the matching is achieved. Similarly, if the electricity trading request is a selling electricity trading request, the unit electricity trading value corresponding to the electricity trading request is compared with the unit electricity trading value of the first electricity trading request in the purchase queue, and if the unit electricity trading value is lower than the unit electricity trading value of the first electricity trading request in the selling queue, a trading order (electricity trading order) is automatically matched.
Usually, the selling and purchasing power amounts of the two power transaction requests are not equal, the transaction power amount in the transaction order is the smaller value of the power amounts in the two power transaction requests, and the rest part is continuously matched or continuously hung (continuously generating the power transaction requests).
Specifically, if the transaction electric quantity is smaller than the selling electric quantity or the purchasing electric quantity, the endorsement node acquires the shortage electric quantity, wherein the shortage electric quantity is a difference value between the transaction electric quantity and the selling electric quantity or the purchasing electric quantity, and generates a first electric power transaction request according to the shortage electric quantity; and if the unit electric power transaction value corresponding to the first electric power transaction request meets a preset condition, the endorsement node returns a third electric power transaction option corresponding to the first electric power transaction request to the first terminal device, so that the first terminal device determines the second electric power transaction order according to the third electric power transaction option. The endorsement node updates the electric power transaction order to obtain an updated electric power transaction order; wherein the updated power trade orders comprise a first power trade order and a second power trade order. If the transaction electric quantity corresponding to the second electric power transaction order has the shortage electric quantity, other electric power transaction requests are generated again, and a new transaction order is achieved through cooperation of the endorsement node, the first terminal device and the second terminal device until the previous time of power generation or power consumption (electricity consumption) or no shortage electric quantity exists any more.
For example, referring to fig. 3 specifically, the power prediction is prepared, and various users predict the power generation and power consumption of the next day (preset time period) according to the historical power generation and power consumption data recorded on the block chain, and calculate an approximate power gap amount (gap power data) or a power remaining amount (remaining power data).
Entrust the order (the electric power trade requests) to surf the net, cancel; determining pre-purchase or pre-sale electric quantity according to the prediction of own electric power gap quantity (gap electric quantity data) or electric power surplus (surplus electric quantity data) by various users, setting a lower limit for sale or purchase quantity, and aminAnd (a) setting the minimum value of the electric quantity required to be sold or purchased, preventing a user from maliciously swiping a bill, and avoiding unnecessary load of the system. The method comprises the steps of establishing unit electric power transaction value by taking an existing order (an electric power transaction order or an electric power transaction request) in a network as a reference; in addition, the unit electric power transaction value is set to be an upper limit, and p is less than pmaxThen, a consignment order (power transaction request) is generated by the smart contract. Based on the actual power production and power consumption, to avoid the seller producing less power than the transaction power in the pre-agreed transaction order, the pre-sold power may be set to be slightly lower than the predicted remaining power Ssell<Spre(ii) a The power purchasing party is a just-in-demand party, and the purchasing power can be set to be slightly higher than the predicted gap power B in order to avoid that the predicted purchasing power is lower than the actually required powerpre<Bbuy
For example, the selling threshold may be set to:
α(Ssell=α*Spre,(0<α<1));
the purchase threshold is:
β(Bbuy=β*Bpre,(1<β<1.5))。
if the requested order (power transaction request) is not satisfied, the requested order (power transaction request) can be cancelled by using the authority corresponding to the user identity information, and the quotation information is cleared.
The method adopts a matching mode of continuous bidding, and a user can complete a transaction immediately as long as a transaction condition is met, such as a preset condition (unit price condition and the like) is met. After the entrusting order (power transaction request) is on line, judging the type of the entrusting order (power transaction request) firstly, if the entrusting order (power purchase request) is purchased, comparing the unit power transaction value with the unit power transaction value of the first order (power sale order) in the sale queue, if the unit power transaction value is higher than the unit power transaction value of the first order (power sale order) in the sale queue, automatically matching the transaction order, and generating the transaction order which can be formally validated only by signing of two transaction parties. Similarly, if the order is a selling order (power selling request), the unit power transaction value of the order is compared with the unit power transaction value of the first order (power purchase order) in the purchase queue, and if the unit power transaction value is lower than the unit power transaction value of the first order (power purchase order) in the selling queue, the transaction order is automatically matched. Usually, the selling and purchasing electric quantities of the two orders (electric power trading orders) are not equal, the trading electric quantity in the trading order is the minimum value of the electric quantities in the two orders, and the rest part is continuously matched or hung.
The trade order formally takes effect after being signed by both parties, and settlement is carried out according to the actual power transmission quantity when the electricity is used for generating electricity. If the electricity seller cannot provide enough electricity, the remaining part of the electricity is purchased from the power grid company to the electricity purchaser (assuming that the unit electricity sold by the power grid company has a relatively high transaction value). After the requirements of the electricity purchasing party are met, the two transaction parties sign again to confirm that the money is settled, and the electricity purchasing party pays corresponding money. The payment is divided into two parts, one part of the payment is used for paying the internet fee of the power grid company, and the other part of the payment is transferred to the account of the power selling party. And finally, judging whether the transaction electric energy is renewable green electric energy, if so, issuing corresponding currency to be rewarded to the power selling party according to a subsidy policy, and finishing the transaction.
The electric power utilization system has the advantages that the bottom of the electric power utilization system is balanced, if the fact that the purchased electric quantity is insufficient or surplus electric quantity exists on the same day, the electric power utilization system can conduct bottom-in-the-way transaction with a power grid company, the power grid company guarantees balance of supply and demand in the whole power grid coverage range through purchasing surplus electric power resources and floating electric power gaps, and waste of the electric power resources is avoided. In the bottom-entering trading stage, the real-time trading is carried out by adopting the pricing of the power grid company, namely the electric power trading value of the trading unit is determined and the electric power transmission is carried out as soon as the trading is achieved.
S302: and the sequencing node receives the target power transaction and generates a target block according to the transaction data corresponding to the target power transaction.
The consensus method of the block chain is to solve the problem of how multiple participants agree on certain operations (such as block generation) in a distributed scenario and how to solve the problem of mutual trust between nodes on the premise of decentralization. Traditional public chain consensus mechanisms such as PoW, PoS, DPoS, etc. are not suitable for use in blockchain power grid systems. A common PBFT consensus mechanism in a federation chain, that is, a practical byzantine fault-tolerant algorithm, needs all nodes to participate in consensus together, easily causes problems of high communication complexity, poor expansibility, excessive delay when a network is unstable, and the like, and is not suitable for being directly applied to a power grid system. Some improved methods for limiting based on reputation threshold are prone to low node aggressiveness and centralization problems. And for the power grid, the coverage range is relatively wide, a large number of nodes are needed to participate in maintenance and management, and a single organization is difficult to undertake. And various nodes in the power grid are authenticated and have certain trust foundation. Therefore, the invention provides an improved alliance chain consensus scheme based on transaction participation and random drawing election. In this embodiment, the sorting nodes include a main sorting node and an auxiliary sorting node, and both the main sorting node and the auxiliary sorting node are determined by random election of lots. The drawing can be performed by verifying a random function (VRF), and design and adjustment are performed by combining the transaction participation degree of each node, wherein the probability of the middle drawing and the transaction participation degree form a positive correlation relationship, namely the higher the transaction participation degree is, the higher the probability of the middle drawing is.
The transaction participation degree is determined according to the five aspects of calculation power and a storage unit of the current node contributing to the whole block chain network, recent transaction participation condition, historical transaction participation condition and continuous stable online time.
The normalized transaction engagement formula for a sort node is as follows (theta in the formula)1,θ2,θ3,θ4Can be set according to actual conditions, but satisfies theta1234=1):
Figure BDA0002845257690000161
Wherein,
Figure BDA0002845257690000162
is the ratio of the calculated force contributed by the node to the total calculated force;
Figure BDA0002845257690000163
is the ratio of the memory cell contributed by the node to the total memory cell;
Figure BDA0002845257690000164
the ratio of the time that the node is continuously and stably online and participates in consensus to the total network operation time is obtained;
Figure BDA0002845257690000165
is the ratio of the historical transaction amount of the user providing the ranking node to the total transaction amount in the network;
Figure BDA0002845257690000166
the latest transaction participation condition of the user who provides the sequencing node is the ratio of the transaction amount of the corresponding terminal equipment in the latest block in the block chain network and the transaction total amount of the whole block.
The embodiment provides a consensus method, and a specific consensus process is shown in fig. 7. And randomly selecting a main sequencing node according to the transaction participation degree through drawing lots, arranging the transaction participation degrees except the main sequencing node in nodes with preset digits in the sequencing nodes, drawing lots through a verification random function, and randomly determining the auxiliary sequencing node according to the transaction participation degrees. The remaining sort nodes except the primary sort node and the secondary sort node are defined as following sort nodes. For example, a certain number of auxiliary sorting nodes are randomly extracted from the nodes with the transaction degrees arranged in the front preset percentage except the main sorting node, the preset percentage may be 50%, 60%, and the like, and may be specifically set according to actual conditions. All running sequencing nodes which are added into the sequencing service can participate in drawing lots, and the probability of drawing lots in the drawing lots and the transaction participation degree are in positive correlation. The transaction participation is determined by the calculation power contributed by the node, the storage unit contributed by the node, the continuous online consensus duration of the node, the historical transaction amount of the terminal equipment corresponding to the node and the transaction limit of the terminal equipment corresponding to the latest block in the block chain network, and the transaction participation (Pi) is obtained according to a normalized transaction participation formula.
The primary sort node generates a preselected block according to the target power transaction, the preselected block including a signature of the primary sort node, and sends the preselected block including the signature to the secondary sort node.
And a plurality of auxiliary sorting nodes receive the preselected block and judge whether the preselected block passes the verification of the plurality of auxiliary sorting nodes.
And if the preselected block passes the verification of the auxiliary sorting node, the auxiliary sorting node returns a signature to the main sorting node, and a target block is generated according to the transaction data corresponding to the target power transaction. At this point, the block is successfully generated, the master sort node sends the target block to other sort nodes, and all the sort nodes broadcast the target block to the billing nodes connected to the target block.
Specifically, if the signature number of the auxiliary sorting node received by the main sorting node meets a preset value, the preselected block is considered to pass the verification of the auxiliary sorting node. And the main sequencing node broadcasts the preselected block and the signature corresponding to the preselected block to non-main sequencing nodes (other sequencing nodes except the main sequencing node) in the sequencing nodes, and the non-main sequencing nodes in the sequencing nodes receive the preselected block and the signature corresponding to the preselected block and verify the signature corresponding to the preselected block to obtain a target block after verification. The preset value here may be a preset ratio of the auxiliary sorting node, that is, the preselected block is considered to pass the verification of the auxiliary sorting node, such as two thirds, three fifths, and the like, or may be a specific preset value, which may be specifically set according to the requirement.
And if the preselected block fails to pass the verification of the auxiliary sorting node, returning to execute the step that the sorting node receives the target power transaction and determining a main sorting node and a plurality of auxiliary sorting nodes through drawing lots. Thereby recycling the above steps again.
S303: and the accounting node receives the target block, verifies the target block, and updates the target block to an account book of the block chain network if the target block passes verification.
In this embodiment, after the accounting node receives the target block, the target block is connected to the end of the block chain, the endorsement signature of each transaction in the block is verified and checked, if the endorsement signature meets the requirement for the endorsement signature in the endorsement policy, the target block is added to the end of the block chain to form a non-falsifiable record, the transaction result is applied to the world state, the transaction result is updated to the account book of the block chain network, and if the transaction result does not meet the requirement, the operation of updating the world state is not performed. The ranking nodes may then be rewarded according to the reward distribution settings.
Specifically, a reward and punishment mechanism is executed; in the consensus process, if the sequencing node is disconnectedThe actions of sending or passing malicious blocks, against correct blocks, etc. are considered abnormal, and the abnormal sorting node is prohibited from participating in the consensus sorting service for a period of time, so that the abnormal sorting node
Figure BDA0002845257690000171
(the ratio of the time that the node is continuously on line and participates in consensus to the total time the network is running) becomes smaller and it becomes more difficult to compete out of blocks. Normal nodes will receive a reward that is a number of tokens used in the trading system, the primary sort node may receive 30% of the reward, the correctly verified secondary sort node may equally divide 30% of the reward, and the remaining 40% of the reward is equally divided by the other normal following sort nodes. The rewards are issued to the associated nodes of the users to which the ranking nodes belong, and certainly, the reward distribution proportion can be adjusted according to the actual situation.
The consensus mechanism provided by the embodiment has the advantages that decentralization of the whole network is ensured, and the excessive concentration of the accounting right is prevented; meanwhile, the accuracy of accounting is guaranteed, all legal transactions can be linked up, and malicious nodes are eliminated; and a reward mechanism is introduced to arouse the enthusiasm of the users for participating in consensus, so that the safety and the efficiency of the system are improved.
Step S303 further includes: the method comprises the steps that a billing node receives a first traceability request sent aiming at the target power transaction, the billing node judges the type of the first traceability request, if the first traceability request is a verification traceability request, a uplink traceability result of the target power transaction is returned to terminal equipment, and the uplink traceability result is used for reflecting whether the target power transaction is uplink or not; if the first tracing request is a transaction information query tracing request, returning a transaction tracing result of the target power transaction to the terminal device, wherein the transaction tracing result is used for reflecting transaction information corresponding to the target power transaction; or,
the accounting node receives a second traceability request sent aiming at the target electric power transaction, the second traceability request is a supervision traceability request, the accounting node determines the authority of a terminal device according to the second traceability request, acquires the transaction information corresponding to the target electric power transaction and corresponding to the authority, and returns the transaction information corresponding to the target electric power transaction to the terminal device.
Specifically, the tracing request can be divided into a transaction supervision tracing request (second tracing request) of a supervision department and tracing requests (first tracing request) of various users, and the flow of the two tracing requests is described below.
Referring to fig. 4, the transaction supervision traceability request flow of the supervision department: the method comprises the steps that a transaction supervision department obtains a digital certificate issued by a CA, the digital certificate is added into a block chain network of an electric power transaction system by using an administrator identity, the highest inquiry authority is obtained, after each block is generated, the supervision department supervises each transaction in the block chain network based on terminal equipment, and sends a second tracing request (supervision tracing request), an accounting node determines the authority of the terminal equipment according to the second tracing request, and the accounting node obtains transaction information corresponding to the target electric power transaction corresponding to the authority and returns the transaction information corresponding to the target electric power transaction to the terminal equipment. The supervision department can judge whether malicious transactions exist according to transaction information (such as information of identities, addresses, transaction electric quantity, unit electric quantity price and the like of two transaction parties) corresponding to the target electric power transaction; if the transaction is finished with the extremely low or high transaction unit electric power transaction value or the transaction total electric quantity is abnormal, the monitoring mechanism monitors both parties participating in the transaction, and if the fact that a certain user has illegal behaviors such as malicious bill swiping and monopolistic competition can be determined, punishment is carried out on the user.
Tracing processes of various users: most users are ordinary users who maintain the light nodes, the light nodes cannot store the block content, only the information of the block header is recorded, and the query needs to be requested from other whole nodes. The method can be divided into verification query and detail query according to different queries. The verification query can verify whether the transaction is correctly recorded on the blockchain, and the detail query is the specific transaction detail required to query the target power transaction.
The light node user sends a first tracing request to all connected nodes based on the terminal equipment, wherein the first tracing request is divided into a verification query request (verification tracing request) and a detail query (transaction information query tracing request), the verification query request only needs to provide a transaction ID to be queried, and the detail query also needs to provide a corresponding identity certificate.
And after receiving the query request, the whole node (accounting node) replies according to the request. The accounting node judges the type of the first tracing request, if the first tracing request is a verification query request, the first tracing request is a verification tracing request, and a chaining tracing result of the target power transaction is returned to the terminal equipment, wherein the chaining tracing result is used for reflecting whether the target power transaction is chained or not. Specifically, according to the MerkleTree calculation process, other hash values required for calculating the merklee root are returned to the inquirer (terminal device). And the light node verifies after receiving the reply message. If only whether the transaction is recorded in the block is verified, only the calculation is carried out by using other hash values provided by the full node (accounting node) according to the Merkle root calculation process, and if the result is the same as the Merkle root in the block header, the transaction is correctly recorded in the block.
If the inquiry is detail inquiry (transaction information inquiry tracing request), firstly, the identity of an inquirer needs to be verified, if the inquirer is a participant of the transaction and has enough authority, a transaction tracing result of the target electric power transaction is returned to the terminal equipment, and the transaction tracing result is used for reflecting the transaction information corresponding to the target electric power transaction, namely all transaction information corresponding to the target electric power transaction which can be packaged by the inquirer (terminal equipment) through a public key of the inquirer is returned; and the specific transaction information can be obtained by decrypting the returned information by using the private key of the user.
The alliance-chain-based electric power pre-sale transaction method of the present invention will now be described in detail with reference to fig. 6.
Specifically, step 1: the power trading method comprises the steps that a power trading user sends a trading order (a power trading request for buying or selling power) to a plurality of endorsement nodes through a client (a client of terminal equipment), the endorsement nodes receiving the trading order call intelligent contracts to conduct simulated trading, a trading suggestion (a first power trading option) response is generated, and the signature of the endorsement nodes is attached; the simulated transaction result is not directly applied to an account book, only the generated transaction suggestion (first power transaction option) is returned to the client for being viewed by a user, namely the first power transaction option is returned to the client for being viewed by the user, and the user determines the target power transaction based on the terminal device according to the first power transaction option.
Step 2: after receiving the endorsement nodes meeting the required number in the endorsement policy and returning the transaction suggestions (first power transaction options) containing endorsement node signatures, the user client determines the target power transaction according to the first power transaction options based on the terminal equipment, and sends the confirmed and signed target power transaction containing the transaction proposals (power transaction orders) and the transaction integrals (first power transaction options) of all transaction suggestion responses to the sequencing node for sequencing and packaging.
And step 3: after receiving a certain number of transactions (target electric power transactions), the sequencing node packs all transactions in a period of time into blocks (target blocks) according to a fixed sequence according to the setting in the consensus mechanism; and sends these blocks to all nodes with accounting functions (accounting nodes).
And 4, step 4: after receiving a block (target block), the accounting node connects the block to the tail of a block chain, verifies the endorsement signature of each transaction in the block, and updates the target block to an account book of the block chain network and applies a transaction result to a world state if the endorsement signature meets the requirement of the endorsement signature in an endorsement policy (the target block passes verification); if the requirement for endorsement signature in the endorsement policy is not met (target block verification fails), the operation of updating the world state is not performed.
And 5: and after the accounting book is updated, the accounting node informs the user that the transaction generates the non-falsifiable record. At this time, the user can connect to the accounting node through the client to inquire, the transaction is recorded in the block, and the world state is correspondingly updated to show that the transaction is successfully completed.
Corresponding to the above-mentioned electric power pre-sale transaction method based on alliance chain, an embodiment of the present invention provides an electric power pre-sale transaction device based on alliance chain, the structure of which is shown in fig. 8, the device is applied to a blockchain network in an electric power transaction system, the blockchain network includes a peer node and a sorting node, the peer node includes an endorsement node and an accounting node, and the method includes:
a sending unit 601, configured to control the endorsement node to receive an electric power transaction order sent by a first terminal device, and return a first electric power transaction option corresponding to the electric power transaction order to the first terminal device, so that the first terminal device determines the target electric power transaction according to the first electric power transaction option; the trade order comprises signatures approved by the first terminal equipment and second terminal equipment corresponding to the first terminal equipment for the electric power trade order;
a generating unit 602, configured to control the sorting node to receive the target power transaction, and generate a target block according to transaction data corresponding to the target power transaction;
an updating unit 603, configured to control the accounting node to receive the target block, verify the target block, and update the target block to an account book of the blockchain network if the target block passes verification.
Optionally, the sending unit 601 is further configured to:
the endorsement node receives an electric power transaction request sent by a first terminal device, wherein the electric power transaction request comprises unit electric power transaction value information and gap electric quantity data or residual electric quantity data, and the gap electric quantity data or the residual electric quantity data are electric quantity data obtained by prediction according to historical electric quantity production data and historical electric quantity consumption data in a preset time period on a block chain;
and if the unit electric power transaction value information and the gap electric quantity or the residual electric quantity meet preset conditions, the endorsement node returns a second electric power transaction option corresponding to the electric power transaction request to the first terminal equipment, so that the first terminal equipment determines the electric power transaction order according to the second electric power transaction option and sends the electric power transaction order to the endorsement node.
Optionally, the sending unit 601 is specifically configured to:
if the power transaction request is a power purchase request and the unit power transaction value corresponding to the power transaction request is greater than or equal to the unit power transaction value of a power sale order in a sale queue, the endorsement node returns a second power transaction option corresponding to the power transaction request to the first terminal device, so that the first terminal device determines the first power transaction order according to the second power transaction option, determines the power transaction order according to the first power transaction order and sends the power transaction order to the endorsement node; the second transaction option comprises a plurality of electric power transactions and signatures of endorsement nodes, and transaction electric quantities corresponding to the electric power transactions are respectively smaller values of purchase electric quantities or sale electric quantities corresponding to the electric power transactions;
if the power transaction request is a power selling request and the unit power transaction value corresponding to the power transaction request is less than or equal to the unit power transaction value of a power purchase order in a purchase queue, the endorsement node returns a second power transaction option corresponding to the power transaction request to the first terminal device, so that the first terminal device determines the first power transaction order according to the second power transaction option, determines the power transaction order according to the first power transaction order and sends the power transaction order to the endorsement node; the second transaction option comprises a plurality of electric power transactions and signatures of endorsement nodes, and transaction electric quantity corresponding to the electric power transactions is the smaller value of purchase electric quantity or sale electric quantity corresponding to the electric power transactions respectively.
Optionally, the sending unit 601 is specifically configured to:
if the transaction electric quantity is smaller than the selling electric quantity or the purchasing electric quantity, the endorsement node acquires the shortage electric quantity which is the difference value between the transaction electric quantity and the selling electric quantity or the purchasing electric quantity, and generates a first electric power transaction request according to the shortage electric quantity;
if the unit electric power transaction value corresponding to the first electric power transaction request meets a preset condition, the endorsement node returns a third electric power transaction option corresponding to the first electric power transaction request to the first terminal equipment, so that the first terminal equipment determines the second electric power transaction order according to the third electric power transaction option;
the endorsement node updates the power trading order to obtain the updated power trading order, wherein the updated power trading order comprises the first power trading order and the second power trading order.
The sorting nodes include a main sorting node and an auxiliary sorting node, both the main sorting node and the auxiliary sorting node are determined by random election with lots, and the generating unit 602 is specifically configured to:
the sequencing node receives the target power transaction and determines a main sequencing node and a plurality of auxiliary sequencing nodes through drawing lots;
the master sequencing node generates a preselected block according to the target power transaction, the preselected block comprising a signature of the master sequencing node;
the auxiliary sorting nodes receive the preselected block and judge whether the preselected block passes the verification of the auxiliary sorting nodes;
if the preselected block passes the verification of the auxiliary sequencing node, the auxiliary sequencing node returns a signature to the main sequencing node, and a target block is generated according to the transaction data corresponding to the target electric power transaction;
and if the preselected block fails to pass the verification of the auxiliary sorting node, returning to execute the steps that the sorting node receives the target power transaction and determines a main sorting node and a plurality of auxiliary sorting nodes through drawing lots.
Optionally, the generating unit 602 is specifically configured to:
the sequencing nodes receive the target power transaction, acquire the transaction participation degree corresponding to each sequencing node, and generate the main sequencing node according to the transaction participation degree through drawing lots;
arranging the transaction participation degrees except the main sequencing node in the nodes with the preset number of digits in the sequencing nodes, and drawing lots to determine the auxiliary sequencing node;
the method comprises the steps that the probability of drawing lots is positively correlated with the transaction participation degree, and the transaction participation degree is determined by the calculation power contributed by nodes, the storage unit contributed by the nodes, the continuous online consensus participation time of the nodes, the historical transaction amount of the terminal equipment corresponding to the nodes, and the transaction amount of the terminal equipment corresponding to the latest block in the block chain network.
Optionally, the generating unit 602 is specifically configured to:
the auxiliary sorting nodes receive the preselected block, judge whether the preselected block passes the verification of the auxiliary sorting nodes or not, and return a signature to the main sorting node if the transaction data corresponding to the preselected block passes the verification;
if the signature number of the auxiliary sorting node received by the main sorting node meets a preset value, the main sorting node broadcasts the preselected block and the signature corresponding to the preselected block to non-main sorting nodes in the sorting nodes; and the non-main sequencing node in the sequencing nodes receives the preselected block and the signature corresponding to the preselected block, and verifies the signature corresponding to the preselected block to obtain a target block after verification is passed.
The electric power pre-sale transaction device based on the alliance chain further comprises a source tracing module, wherein the source tracing module is used for:
the accounting node receives a first tracing request sent aiming at the target power transaction, the accounting node judges the type of the first tracing request, if the first tracing request is a verification tracing request, a uplink tracing result of the target power transaction is returned to the terminal equipment, and the uplink tracing result is used for reflecting whether the target power transaction is uplink or not; if the first tracing request is a transaction information query tracing request, returning a transaction tracing result of the target power transaction to the terminal device, wherein the transaction tracing result is used for reflecting transaction information corresponding to the target power transaction; or,
the accounting node receives a second traceability request sent aiming at the target electric power transaction, the second traceability request is a supervision traceability request, the accounting node determines the authority of a terminal device according to the second traceability request, acquires the transaction information corresponding to the target electric power transaction and corresponding to the authority, and returns the transaction information corresponding to the target electric power transaction to the terminal device.
The apparatus of the foregoing embodiment is used to implement the corresponding method in the foregoing embodiment, and has the beneficial effects of the corresponding method embodiment, which are not described herein again.
In this embodiment, corresponding to the above alliance chain-based electric power pre-sale transaction method, the present invention further provides an alliance chain-based electric power pre-sale transaction system for electric power transaction, where the system includes a blockchain network and a plurality of terminal devices connected to the blockchain network, where the plurality of terminal devices at least include a first terminal device and a second terminal device, where the blockchain network includes a peer node and a sorting node, and the peer node includes an endorsement node and an accounting node;
the terminal device is used for responding to a request sending instruction and sending an electric power trading order to an endorsement node in the block chain network, wherein the trading order comprises signatures approved by the first terminal device and a second terminal device corresponding to the first terminal device for the electric power trading order;
the endorsement node in the block chain network is used for receiving an electric power transaction order sent by a first terminal device and returning a first electric power transaction option corresponding to the electric power transaction order to the first terminal device, so that the first terminal device determines the target electric power transaction according to the first electric power transaction option;
the sorting node in the block chain network is used for controlling the sorting node to receive the target power transaction and generating a target block according to transaction data corresponding to the target power transaction;
and the accounting node in the block chain network is used for controlling the accounting node to receive the target block, verifying the target block, and updating the target block to an account book of the block chain network if the target block passes verification.
The system further comprises:
the registration authentication module is used for sending a digital certificate and a public and private key pair to the terminal equipment, converting the identity information into roles in a blockchain network and determining the corresponding authority of the digital certificate through MSP based on the digital certificate, and determining the roles of various users in the network and the access authority of resources and information;
the monitoring and tracing module is used for controlling the accounting node to receive a first tracing request sent aiming at the target power transaction, the accounting node judges the type of the first tracing request, if the first tracing request is a verification tracing request, a chaining tracing result of the target power transaction is returned to the terminal equipment, and the chaining tracing result is used for reflecting whether the target power transaction is chained; if the first tracing request is a transaction information query tracing request, returning a transaction tracing result of the target power transaction to the terminal device, wherein the transaction tracing result is used for reflecting transaction information corresponding to the target power transaction; or, the accounting node receives a second tracing request sent for the target power transaction, the second tracing request is a supervision tracing request, the accounting node determines the authority of the terminal device according to the second tracing request, acquires the transaction information corresponding to the target power transaction and corresponding to the authority, and returns the transaction information corresponding to the target power transaction to the terminal device.
The system of the foregoing embodiment is used to implement the corresponding method in the foregoing embodiment, and has the beneficial effects of the corresponding method embodiment, which are not described herein again.
The technical carrier involved in payment in the embodiments of the present specification may include Near Field Communication (NFC), WIFI, 3G/4G/5G, POS machine card swiping technology, two-dimensional code scanning technology, barcode scanning technology, bluetooth, infrared, Short Message Service (SMS), Multimedia Message (MMS), and the like, for example.
The biometric features related to biometric identification in the embodiments of the present specification may include, for example, eye features, voice prints, fingerprints, palm prints, heart beats, pulse, chromosomes, DNA, human teeth bites, and the like. Wherein the eye pattern may include biological features of the iris, sclera, etc.
It should be noted that the method of one or more embodiments of the present disclosure may be performed by a single device, such as a computer or server. The method of the embodiment can also be applied to a distributed scene and completed by the mutual cooperation of a plurality of devices. In such a distributed scenario, one of the devices may perform only one or more steps of the method of one or more embodiments of the present disclosure, and the devices may interact with each other to complete the method.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
For convenience of description, the above devices are described as being divided into various modules by functions, and are described separately. Of course, the functionality of the modules may be implemented in the same one or more software and/or hardware implementations in implementing one or more embodiments of the present description.
Fig. 9 shows a schematic diagram of a specific hardware structure of an electronic device provided in this embodiment, where the device may include: a processor 1010, a memory 1020, an input/output interface 1030, a communication interface 1040, and a bus 1050. Wherein the processor 1010, memory 1020, input/output interface 1030, and communication interface 1040 are communicatively coupled to each other within the device via bus 1050.
The processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits, and is configured to execute related programs to implement the technical solutions provided in the embodiments of the present disclosure.
The Memory 1020 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, or the like. The memory 1020 may store an operating system and other application programs, and when the technical solution provided by the embodiments of the present specification is implemented by software or firmware, the relevant program codes are stored in the memory 1020 and called to be executed by the processor 1010.
The input/output interface 1030 is used for connecting an input/output module to input and output information. The i/o module may be configured as a component in a device (not shown) or may be external to the device to provide a corresponding function. The input devices may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices may include a display, a speaker, a vibrator, an indicator light, etc.
The communication interface 1040 is used for connecting a communication module (not shown in the drawings) to implement communication interaction between the present apparatus and other apparatuses. The communication module can realize communication in a wired mode (such as USB, network cable and the like) and also can realize communication in a wireless mode (such as mobile network, WIFI, Bluetooth and the like).
Bus 1050 includes a path that transfers information between various components of the device, such as processor 1010, memory 1020, input/output interface 1030, and communication interface 1040.
It should be noted that although the above-mentioned device only shows the processor 1010, the memory 1020, the input/output interface 1030, the communication interface 1040 and the bus 1050, in a specific implementation, the device may also include other components necessary for normal operation. In addition, those skilled in the art will appreciate that the above-described apparatus may also include only those components necessary to implement the embodiments of the present description, and not necessarily all of the components shown in the figures.
Computer-readable media of the present embodiments, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, is limited to these examples; within the spirit of the present disclosure, features from the above embodiments or from different embodiments may also be combined, steps may be implemented in any order, and there are many other variations of different aspects of one or more embodiments of the present description as described above, which are not provided in detail for the sake of brevity.
In addition, well-known power/ground connections to Integrated Circuit (IC) chips and other components may or may not be shown in the provided figures, for simplicity of illustration and discussion, and so as not to obscure one or more embodiments of the disclosure. Furthermore, devices may be shown in block diagram form in order to avoid obscuring the understanding of one or more embodiments of the present description, and this also takes into account the fact that specifics with respect to implementation of such block diagram devices are highly dependent upon the platform within which the one or more embodiments of the present description are to be implemented (i.e., specifics should be well within purview of one skilled in the art). Where specific details (e.g., circuits) are set forth in order to describe example embodiments of the disclosure, it should be apparent to one skilled in the art that one or more embodiments of the disclosure can be practiced without, or with variation of, these specific details. Accordingly, the description is to be regarded as illustrative instead of restrictive.
While the present disclosure has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those of ordinary skill in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic ram (dram)) may use the discussed embodiments.
It is intended that the one or more embodiments of the present specification embrace all such alternatives, modifications and variations as fall within the broad scope of the appended claims. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of one or more embodiments of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (10)

1. A power pre-sale transaction method based on a alliance chain is applied to a blockchain network in a power transaction system, wherein the blockchain network comprises peer nodes and a sequencing node, the peer nodes comprise endorsement nodes and accounting nodes, and the method comprises the following steps: the endorsement node receives an electric power transaction order sent by a first terminal device, and returns a first electric power transaction option corresponding to the electric power transaction order to the first terminal device, so that the first terminal device determines the target electric power transaction according to the first electric power transaction option; the trade order comprises signatures approved by the first terminal equipment and second terminal equipment corresponding to the first terminal equipment for the electric power trade order;
the sequencing node receives the target power transaction and generates a target block according to transaction data corresponding to the target power transaction;
and the accounting node receives the target block, verifies the target block, and updates the target block to an account book of the block chain network if the target block passes verification.
2. A alliance-chain based power pre-sale transaction method according to claim 1, wherein prior to the step of the endorsement node receiving the power transaction order sent for the first terminal device, the method further comprises:
the endorsement node receives an electric power transaction request sent by a first terminal device, wherein the electric power transaction request comprises unit electric power transaction value information and gap electric quantity data or residual electric quantity data, and the gap electric quantity data or the residual electric quantity data are electric quantity data obtained by prediction according to historical electric quantity production data and historical electric quantity consumption data in a preset time period on a block chain;
and if the unit electric power transaction value information and the gap electric quantity or the residual electric quantity meet preset conditions, the endorsement node returns a second electric power transaction option corresponding to the electric power transaction request to the first terminal equipment, so that the first terminal equipment determines the electric power transaction order according to the second electric power transaction option and sends the electric power transaction order to the endorsement node.
3. The alliance-chain-based electric power pre-sale transaction method according to claim 2, wherein if the unit electric power transaction value information and the gap electric quantity or the remaining electric quantity meet preset conditions, the endorsement node returns a second electric power transaction option corresponding to the electric power transaction request to the first terminal device, so that the first terminal device determines the electric power transaction order according to the second electric power transaction option and sends the electric power transaction order to the endorsement node, and the method comprises the following steps:
if the power transaction request is a power purchase request and the unit power transaction value corresponding to the power transaction request is greater than or equal to the unit power transaction value of a power sale order in a sale queue, the endorsement node returns a second power transaction option corresponding to the power transaction request to the first terminal device, so that the first terminal device determines the first power transaction order according to the second power transaction option, determines the power transaction order according to the first power transaction order and sends the power transaction order to the endorsement node; the second transaction option comprises a plurality of electric power transactions and signatures of endorsement nodes, and transaction electric quantities corresponding to the electric power transactions are respectively smaller values of purchase electric quantities or sale electric quantities corresponding to the electric power transactions;
if the power transaction request is a power selling request and the unit power transaction value corresponding to the power transaction request is less than or equal to the unit power transaction value of a power purchase order in a purchase queue, the endorsement node returns a second power transaction option corresponding to the power transaction request to the first terminal device, so that the first terminal device determines the first power transaction order according to the second power transaction option, determines the power transaction order according to the first power transaction order and sends the power transaction order to the endorsement node; the second transaction option comprises a plurality of electric power transactions and signatures of endorsement nodes, and transaction electric quantity corresponding to the electric power transactions is the smaller value of purchase electric quantity or sale electric quantity corresponding to the electric power transactions respectively.
4. A alliance-chain-based power pre-sale transaction method according to claim 3, wherein after the step of the endorsement node returning to the first terminal device a second power transaction option corresponding to the power transaction request, the method further comprises:
if the transaction electric quantity is smaller than the selling electric quantity or the purchasing electric quantity, the endorsement node acquires the shortage electric quantity which is the difference value between the transaction electric quantity and the selling electric quantity or the purchasing electric quantity, and generates a first electric power transaction request according to the shortage electric quantity;
if the unit electric power transaction value corresponding to the first electric power transaction request meets a preset condition, the endorsement node returns a third electric power transaction option corresponding to the first electric power transaction request to the first terminal equipment, so that the first terminal equipment determines the second electric power transaction order according to the third electric power transaction option;
the endorsement node updates the power trading order to obtain the updated power trading order, wherein the updated power trading order comprises the first power trading order and the second power trading order.
5. The alliance-chain-based power pre-sale transaction method according to claim 1, wherein the sequencing nodes comprise a main sequencing node and an auxiliary sequencing node, the sequencing nodes receive the target power transaction and generate a target block according to transaction data corresponding to the target power transaction, and the method comprises the following steps:
the sequencing node receives the target power transaction and determines a main sequencing node and a plurality of auxiliary sequencing nodes through drawing lots;
the master sequencing node generates a preselected block according to the target power transaction, the preselected block comprising a signature of the master sequencing node;
the auxiliary sorting nodes receive the preselected block and judge whether the preselected block passes the verification of the auxiliary sorting nodes;
if the preselected block passes the verification of the auxiliary sequencing node, the auxiliary sequencing node returns a signature to the main sequencing node, and a target block is generated according to the transaction data corresponding to the target electric power transaction;
and if the preselected block fails to pass the verification of the auxiliary sorting node, returning to execute the steps that the sorting node receives the target power transaction and determines a main sorting node and a plurality of auxiliary sorting nodes through drawing lots.
6. The alliance-chain-based power pre-sale transaction method, wherein the sequencing node receives the target power transaction, and determines a primary sequencing node and a secondary sequencing node through drawing lots, and comprises the following steps:
the sequencing nodes receive the target power transaction, acquire the transaction participation degree corresponding to each sequencing node, and generate the main sequencing node according to the transaction participation degree through drawing lots;
arranging the transaction participation degrees except the main sequencing node in the nodes with the preset number of digits in the sequencing nodes, and drawing lots to determine the auxiliary sequencing node;
the method comprises the steps that the probability of drawing lots is positively correlated with the transaction participation degree, and the transaction participation degree is determined by the calculation power contributed by nodes, the storage unit contributed by the nodes, the continuous online consensus participation time of the nodes, the historical transaction amount of the terminal equipment corresponding to the nodes, and the transaction amount of the terminal equipment corresponding to the latest block in the block chain network.
7. A alliance chain based power pre-sale transaction method according to claim 5, wherein the number of auxiliary sorting nodes receives the preselected block, judges whether the preselected block passes the verification of the number of auxiliary sorting nodes; if the verification of the auxiliary sorting node is passed, the auxiliary sorting node returns a signature to the main sorting node, and generates a target block according to the transaction data corresponding to the target power transaction, including:
the auxiliary sorting nodes receive the preselected block, judge whether the preselected block passes the verification of the auxiliary sorting nodes or not, and return a signature to the main sorting node if the transaction data corresponding to the preselected block passes the verification;
if the signature number of the auxiliary sorting node received by the main sorting node meets a preset value, the main sorting node broadcasts the preselected block and the signature corresponding to the preselected block to non-main sorting nodes in the sorting nodes; and the non-main sequencing node in the sequencing nodes receives the preselected block and the signature corresponding to the preselected block, and verifies the signature corresponding to the preselected block to obtain a target block after verification is passed.
8. A federation chain-based electric power up-sell transaction method as claimed in claim 1, the method further comprising:
the accounting node receives a first tracing request sent aiming at the target power transaction, the accounting node judges the type of the first tracing request, if the first tracing request is a verification tracing request, a uplink tracing result of the target power transaction is returned to the terminal equipment, and the uplink tracing result is used for reflecting whether the target power transaction is uplink or not; if the first tracing request is a transaction information query tracing request, returning a transaction tracing result of the target power transaction to the terminal device, wherein the transaction tracing result is used for reflecting transaction information corresponding to the target power transaction; or,
the accounting node receives a second traceability request sent aiming at the target electric power transaction, the second traceability request is a supervision traceability request, the accounting node determines the authority of a terminal device according to the second traceability request, acquires the transaction information corresponding to the target electric power transaction and corresponding to the authority, and returns the transaction information corresponding to the target electric power transaction to the terminal device.
9. An electric power pre-sale transaction device based on a alliance chain is applied to a blockchain network in an electric power transaction system, wherein the blockchain network comprises peer nodes and a sequencing node, the peer nodes comprise an endorsement node and a billing node, and the method comprises the following steps:
the sending unit is used for controlling the endorsement node to receive an electric power transaction order sent by a first terminal device and returning a first electric power transaction option corresponding to the electric power transaction order to the first terminal device, so that the first terminal device determines the target electric power transaction according to the first electric power transaction option; the trade order comprises signatures approved by the first terminal equipment and second terminal equipment corresponding to the first terminal equipment for the electric power trade order;
the generation unit is used for controlling the sequencing node to receive the target power transaction and generating a target block according to transaction data corresponding to the target power transaction;
and the updating unit is used for controlling the accounting node to receive the target block, verifying the target block, and updating the target block to an account book of the block chain network if the target block passes verification.
10. The electric power pre-sale transaction system based on the alliance chain is characterized by comprising a blockchain network and a plurality of terminal devices connected with the blockchain network, wherein the plurality of terminal devices at least comprise a first terminal device and a second terminal device, the blockchain network comprises a peer-to-peer node and a sequencing node, and the peer-to-peer node comprises an endorsement node and a bookkeeping node;
the terminal device is used for responding to a request sending instruction and sending an electric power trading order to an endorsement node in the block chain network, wherein the trading order comprises a signature approved by the first terminal device and a second terminal device corresponding to the first terminal device for the electric power trading order;
the endorsement node in the block chain network is used for receiving an electric power transaction order sent by a first terminal device and returning a first electric power transaction option corresponding to the electric power transaction order to the first terminal device, so that the first terminal device determines the target electric power transaction according to the first electric power transaction option;
the sorting node in the block chain network is used for controlling the sorting node to receive the target power transaction and generating a target block according to transaction data corresponding to the target power transaction;
and the accounting node in the block chain network is used for controlling the accounting node to receive the target block, verifying the target block, and updating the target block to an account book of the block chain network if the target block passes verification.
CN202011507155.6A 2020-12-18 2020-12-18 Electric power pre-selling transaction method, device and system based on alliance chain Active CN112613861B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011507155.6A CN112613861B (en) 2020-12-18 2020-12-18 Electric power pre-selling transaction method, device and system based on alliance chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011507155.6A CN112613861B (en) 2020-12-18 2020-12-18 Electric power pre-selling transaction method, device and system based on alliance chain

Publications (2)

Publication Number Publication Date
CN112613861A true CN112613861A (en) 2021-04-06
CN112613861B CN112613861B (en) 2024-02-02

Family

ID=75240668

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011507155.6A Active CN112613861B (en) 2020-12-18 2020-12-18 Electric power pre-selling transaction method, device and system based on alliance chain

Country Status (1)

Country Link
CN (1) CN112613861B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113505336A (en) * 2021-07-01 2021-10-15 昆明电力交易中心有限责任公司 Renewable energy power consumption tracing system and method based on block chain technology
CN113554437A (en) * 2021-09-17 2021-10-26 边缘智能研究院南京有限公司 Transaction platform based on block chain
CN114612017A (en) * 2022-05-11 2022-06-10 南京师范大学 Resource replacement method for distributed energy based on block chain
CN115204852A (en) * 2022-09-19 2022-10-18 广州海颐软件有限公司 Power transaction multi-market collaborative management system and method based on block chain technology

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108830711A (en) * 2018-05-07 2018-11-16 国网浙江省电力有限公司嘉兴供电公司 A kind of energy internet business account book management method and system based on block chain
WO2019114128A1 (en) * 2017-12-13 2019-06-20 深圳壹账通智能科技有限公司 Block chain transaction block processing method, electronic device and readable storage medium
CN110458541A (en) * 2019-07-26 2019-11-15 阿里巴巴集团控股有限公司 Object permutation method and device based on block chain
US20200013025A1 (en) * 2018-07-06 2020-01-09 International Business Machines Corporation Conditional deferred transactions for blockchain
CN111047319A (en) * 2019-09-03 2020-04-21 腾讯科技(深圳)有限公司 Transaction processing method of block chain network and block chain network
CN111461890A (en) * 2020-04-21 2020-07-28 上海积成能源科技有限公司 Distributed power generation transaction system and method based on multiple prediction and block chain technologies
US20200374133A1 (en) * 2018-02-14 2020-11-26 Huawei Technologies Co., Ltd. Blockchain generation method and system, and related device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019114128A1 (en) * 2017-12-13 2019-06-20 深圳壹账通智能科技有限公司 Block chain transaction block processing method, electronic device and readable storage medium
US20200374133A1 (en) * 2018-02-14 2020-11-26 Huawei Technologies Co., Ltd. Blockchain generation method and system, and related device
CN108830711A (en) * 2018-05-07 2018-11-16 国网浙江省电力有限公司嘉兴供电公司 A kind of energy internet business account book management method and system based on block chain
US20200013025A1 (en) * 2018-07-06 2020-01-09 International Business Machines Corporation Conditional deferred transactions for blockchain
CN110458541A (en) * 2019-07-26 2019-11-15 阿里巴巴集团控股有限公司 Object permutation method and device based on block chain
CN111047319A (en) * 2019-09-03 2020-04-21 腾讯科技(深圳)有限公司 Transaction processing method of block chain network and block chain network
CN111461890A (en) * 2020-04-21 2020-07-28 上海积成能源科技有限公司 Distributed power generation transaction system and method based on multiple prediction and block chain technologies

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
WEIJUN ZHENG 等: "Fog Computing enabled Smart Grid Blockchain Architecture and Performance Optimization with DRL Approach", 《ICCSNT》 *
王德文;柳智权;: "基于智能合约的区域能源交易模型与实验测试", 电网技术 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113505336A (en) * 2021-07-01 2021-10-15 昆明电力交易中心有限责任公司 Renewable energy power consumption tracing system and method based on block chain technology
CN113554437A (en) * 2021-09-17 2021-10-26 边缘智能研究院南京有限公司 Transaction platform based on block chain
CN114612017A (en) * 2022-05-11 2022-06-10 南京师范大学 Resource replacement method for distributed energy based on block chain
CN114612017B (en) * 2022-05-11 2022-08-12 南京师范大学 Resource replacement method for distributed energy based on block chain
CN115204852A (en) * 2022-09-19 2022-10-18 广州海颐软件有限公司 Power transaction multi-market collaborative management system and method based on block chain technology
CN115204852B (en) * 2022-09-19 2022-11-29 广州海颐软件有限公司 Power transaction multi-market collaborative management system and method based on block chain technology

Also Published As

Publication number Publication date
CN112613861B (en) 2024-02-02

Similar Documents

Publication Publication Date Title
Kirli et al. Smart contracts in energy systems: A systematic review of fundamental approaches and implementations
Aggarwal et al. A consortium blockchain-based energy trading for demand response management in vehicle-to-grid
Bao et al. A survey of blockchain applications in the energy sector
Thukral Emergence of blockchain-technology application in peer-to-peer electrical-energy trading: A review
Miglani et al. Blockchain for Internet of Energy management: Review, solutions, and challenges
Subramanian Decentralized blockchain-based electronic marketplaces
Andoni et al. Blockchain technology in the energy sector: A systematic review of challenges and opportunities
Sun et al. Blockchain-enhanced high-confidence energy sharing in internet of electric vehicles
Yap et al. Blockchain technology for distributed generation: A review of current development, challenges and future prospect
CN112613861B (en) Electric power pre-selling transaction method, device and system based on alliance chain
Said A decentralized electricity trading framework (DETF) for connected EVs: A blockchain and machine learning for profit margin optimization
Afzal et al. Role of blockchain technology in transactive energy market: A review
Teng et al. A comprehensive review of energy blockchain: Application scenarios and development trends
Shi et al. Integration of blockchain and auction models: A survey, some applications, and challenges
CN108830711A (en) A kind of energy internet business account book management method and system based on block chain
WO2018034828A1 (en) Techniques for transaction management
CN111402043A (en) Internet of vehicles data transaction method based on block chain
Ren et al. A novel authentication scheme based on edge computing for blockchain-based distributed energy trading system
Liu et al. Blockchain-enabled renewable energy certificate trading: A secure and privacy-preserving approach
Chen et al. SmartStore: A blockchain and clustering based intelligent edge storage system with fairness and resilience
Karandikar et al. Transactive energy on hyperledger fabric
Barbhaya et al. Etradechain: blockchain-based energy trading in local energy market (lem) using modified double auction protocol
Ye et al. An anonymous and fair auction system based on blockchain
Li et al. Secure electronic ticketing system based on consortium blockchain
Wang et al. Cooperative management of an emission trading system: a private governance and learned auction for a blockchain approach

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
GR01 Patent grant
GR01 Patent grant