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

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

Info

Publication number
CN112613861B
CN112613861B CN202011507155.6A CN202011507155A CN112613861B CN 112613861 B CN112613861 B CN 112613861B CN 202011507155 A CN202011507155 A CN 202011507155A CN 112613861 B CN112613861 B CN 112613861B
Authority
CN
China
Prior art keywords
power
transaction
node
power transaction
nodes
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.)
Active
Application number
CN202011507155.6A
Other languages
Chinese (zh)
Other versions
CN112613861A (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

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)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Economics (AREA)
  • Public Health (AREA)
  • Human Resources & Organizations (AREA)
  • Marketing (AREA)
  • Primary Health Care (AREA)
  • Tourism & Hospitality (AREA)
  • General Health & Medical Sciences (AREA)
  • Water Supply & Treatment (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

One or more embodiments of the present disclosure provide a federation chain-based electric power pre-sale trading method, in which an electric power trade order is made in an electric power trade system including a blockchain network by signing an electric power trade order that includes signatures approved by the first terminal device and a second terminal device corresponding to the first terminal device for the electric power trade order, that is, the first terminal device and the second terminal device complete signatures of the trade order in advance before generating or using electricity, so as to reach the electric power trade order in advance; when the power generation or the power utilization is completed, the transaction can be directly carried out according to the power transaction order, and the transaction speed and the transaction efficiency are improved. Meanwhile, as the uplink power producer can sell the residual electric quantity after self-power consumption in the block chain power grid, the waste of the residual electric quantity 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 dispersed, the pressure of the power transaction system in the power utilization peak is reduced, more time can be given to a power grid company for power management and scheduling, and the supply and demand balance of power is further promoted.

Description

Electric power pre-selling transaction method, device and system based on alliance chain
Technical Field
One or more embodiments of the present disclosure relate to the technical field of internet of things, and in particular, to a method, a device and a system for electric power pre-selling transaction based on a alliance chain.
Background
With the development of science and technology, the power grid is developing towards intellectualization, openness and marketization, and the blockchain is used as an emerging bottom communication technology and is realized as a non-tamperable distributed system; the method has high degree of agreement with the development direction of the power grid, and emphasizes the characteristics of decentralization, intellectualization, publicization, marketization and the like. If the blockchain technique can be applied to a smart grid, many existing problems can be solved, such as: (1) The data of the block chain is not tamper-resistant, so that accurate data of all links such as power production, data acquisition, power transaction, power consumption condition and the like can be effectively recorded, and can be traced and searched when needed in the future; (2) The distributed characteristic of the blockchain technology is utilized, so that the participation degree of a third party in the traditional energy transaction is reduced, and the decentralization and marketization of the electric power resource transaction circulation are promoted; (3) The block chain technology can effectively reduce trust cost and establish a trust-removing supply-demand balance system of a producer and a consumer; (4) The distributed storage and encryption technology of the block chain protects the data privacy and safety to a great extent and also enhances the robustness of the power grid against external network attacks.
Some blockchain studies currently focus on, for example: public chains, such as bitcoin and ethernet, are fully open networks, and the speed of transaction and consensus is slow, so that the instantaneous requirements of power transaction are difficult to meet; and if the read-write authority of the private block chain network is completely controlled by a certain organization or person, the current development direction of power grid decentralization is not met, and the marketization and intelligent development of power resource transaction are also hindered.
In addition, some consumers in the traditional electric energy market are gradually transformed into producers (mainly consuming energy and simultaneously having a certain electricity capacity means, generally using renewable energy sources to generate electricity, such as solar energy and wind energy), and the participation of such energy sources in electric power trade is gradually becoming the main trend of the electric energy market. If the original unified pricing, centralized dispatching and central settlement modes are adopted for power transaction, the problems of low transaction efficiency, unbalanced supply and demand, resource waste and the like are caused.
Disclosure of Invention
In view of the foregoing, an objective of one or more embodiments of the present disclosure is to provide a coalition chain-based power pre-sale transaction method 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 method of federation-chain-based power pre-sale transaction, the method being applied to a blockchain network in a power transaction system, the blockchain network including peer nodes and ordering nodes, the peer nodes including endorsement nodes and billing nodes, the method comprising:
the endorsement node receives a power transaction order sent by a first terminal device and returns a first power transaction option corresponding to the power transaction order to the first terminal device, so that the first terminal device determines a target power transaction according to the first power transaction option; the transaction order comprises a signature approved by the first terminal equipment and the second terminal equipment corresponding to the first terminal equipment for the electric power transaction 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 the account book of the blockchain network if the target block passes the verification.
Optionally, before the step of receiving, by the endorsement node, the power trade order sent for the first terminal device, the method further includes:
the endorsement node receives a power transaction request sent by a first terminal device, wherein the power transaction request comprises power unit power transaction value information and gap power quantity data or residual power quantity data, and the gap power quantity data or the residual power quantity data is power quantity data predicted according to historical power generation quantity data and historical power consumption quantity data in a preset time period on a blockchain;
and if the unit power transaction value information and the gap electric quantity or the residual electric quantity meet preset conditions, 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 power transaction order according to the second power transaction option and sends the power transaction order to the endorsement node.
Optionally, if the unit power transaction value information and the notch electric quantity or the residual electric quantity meet preset conditions, 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 power transaction order according to the second power transaction option, and sends the power transaction order to the endorsement node, including:
If the power transaction request is a purchase power 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 sales order in the sales 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 power transaction option comprises a plurality of power transactions and a signature of an endorsement node, and transaction electric quantity corresponding to the plurality of power transactions is respectively a smaller value of purchase electric quantity or sale electric quantity corresponding to the power transactions;
if the power transaction request is a selling power request and the unit power transaction value corresponding to the power transaction request is smaller 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 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 power transaction option comprises a plurality of power transactions and a signature of an endorsement node, and transaction electric quantity corresponding to the plurality of power transactions is respectively a smaller value of purchase electric quantity or sale electric quantity corresponding to the power transactions.
Optionally, after the step of returning, by the endorsement node, the second power transaction option corresponding to the power transaction request to the first terminal device, the method further includes:
if the transaction electric quantity is smaller than the sales electric quantity or the purchase electric quantity, the endorsement node acquires an absence electric quantity, wherein the absence electric quantity is a difference value between the transaction electric quantity and the sales electric quantity or the purchase electric quantity, and a first electric power transaction request is generated according to the absence electric quantity;
if the unit power transaction value corresponding to the first power transaction request meets a preset condition, the endorsement node returns a third power transaction option corresponding to the first power transaction request to the first terminal device, so that the first terminal device determines the second power transaction order according to the third power transaction option;
and the endorsement node updates the electric power trade order to obtain an updated electric power trade order, wherein the updated electric power trade order comprises the first electric power trade order and the second electric power trade order.
Optionally, the sorting node includes a main sorting node and an auxiliary sorting node, 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 nodes receive the target power transaction, and a main sequencing node and a plurality of auxiliary sequencing nodes are determined through drawing;
the master ordering node generates a pre-selected block according to the target power transaction, the pre-selected block including a signature of the master ordering node;
the auxiliary sorting nodes all 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 generates a target block according to transaction data corresponding to the target power transaction;
and if the preselected block fails to pass the verification of the auxiliary sequencing node, returning to execute the step that the sequencing node receives the target power transaction, and determining a main sequencing node and a plurality of auxiliary sequencing nodes through drawing.
Optionally, the sorting node receives the target power transaction, determines a main sorting node and an auxiliary sorting node through drawing, and includes:
the sequencing nodes receive the target power transactions, acquire transaction participation degrees corresponding to each sequencing node, and generate the master sequencing nodes according to the transaction participation degree lottery;
In the nodes of the sorting nodes, except the main sorting node, the transaction participation degree is ranked in the node with the preset bit number, and the auxiliary sorting node is determined by drawing;
the trade participation degree is determined by the calculation power contributed by the node, the storage unit contributed by the node, the continuous online time length of the node participating in consensus, the historical trade amount of the terminal equipment corresponding to the node and the trade amount of the terminal equipment corresponding to the latest block in the block chain network.
Optionally, the plurality of auxiliary sorting nodes receive the pre-selected block, and judge whether the pre-selected block passes the verification of the plurality 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 transaction data corresponding to the target power transaction, including:
the auxiliary sorting nodes all receive the pre-selected blocks, judge whether the pre-selected blocks pass the verification of the auxiliary sorting nodes, and return a signature to the main sorting nodes if the transaction data corresponding to the pre-selected blocks pass the verification;
If the number of the signatures of the auxiliary sorting nodes received by the main sorting node meets a preset value, the main sorting node broadcasts the pre-selected block and the signature corresponding to the pre-selected block to non-main sorting nodes in the sorting nodes; the non-master sequencing nodes in the sequencing nodes receive the pre-selected blocks and the signatures corresponding to the pre-selected blocks, verify the signatures corresponding to the pre-selected blocks, and obtain target blocks after verification.
Optionally, the method further comprises: the billing node receives a first request sent for the target power transaction, the billing node judges the type of the first tracing request, and 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, wherein 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 inquiry tracing request, and a transaction tracing result of the target power transaction is returned to the terminal equipment, wherein the transaction tracing result is used for reflecting transaction information corresponding to the target power transaction; or alternatively, the first and second heat exchangers may be,
The billing node receives a second tracing request sent for the target power transaction, wherein the second tracing request is a supervision tracing request, determines the authority of the terminal equipment according to the second tracing request, acquires transaction information corresponding to the target power transaction corresponding to the authority, and returns the transaction information corresponding to the target power transaction to the terminal equipment.
One or more embodiments of the present specification provide a coalition chain-based electric power pre-sale transaction apparatus, wherein the apparatus is applied to a blockchain network in an electric power transaction system, the blockchain network including peer nodes and ordering nodes, the peer nodes including endorsement nodes and billing nodes, the method comprising:
the transmission unit is used for controlling the endorsement node to receive the power transaction order transmitted by the first terminal equipment and returning a first power transaction option corresponding to the power transaction order to the first terminal equipment so that the first terminal equipment can determine a target power transaction according to the first power transaction option; the transaction order comprises a signature approved by the first terminal equipment and the second terminal equipment corresponding to the first terminal equipment for the electric power transaction 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 and verify the target block, and if the target block passes the verification, updating the target block to the account book of the blockchain network.
One or more embodiments of the present disclosure provide a coalition chain-based electric power pre-sale transaction system, which is characterized in that the system includes a blockchain network and a plurality of terminal devices connected with the blockchain network, wherein 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 equipment is used for responding to a request sending instruction and sending a power transaction order to an endorsement node in the blockchain network, wherein the transaction order comprises signatures approved by the first terminal equipment and a second terminal equipment corresponding to the first terminal equipment for the power transaction order;
An endorsement node in the blockchain network is used for receiving a power transaction order sent by a first terminal device and returning a first power transaction option corresponding to the power transaction order to the first terminal device so that the first terminal device can determine a target power transaction according to the first power transaction option;
a sequencing node in the blockchain network, configured to control the sequencing 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 blockchain network is used for controlling the accounting node to receive the target block and verify the target block, and if the target block passes the verification, the target block is updated to the account book of the blockchain network.
From the foregoing, it can be seen that one or more embodiments of the present disclosure provide a method for a alliance chain-based power pre-sale transaction, which can be applied to a blockchain network in a power transaction system, where the blockchain network includes peer nodes and ordering nodes, and the peer nodes include an endorsement node and an accounting node; the endorsement node receives a power transaction order sent by a first terminal device and returns a first power transaction option corresponding to the power transaction order to the first terminal device, so that the first terminal device determines the target power transaction according to the first power transaction option; the method comprises the steps of carrying out a first treatment on the surface of the The transaction order comprises a signature approved by the first terminal equipment and the second terminal equipment corresponding to the first terminal equipment for the electric power transaction 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 the account book of the blockchain network if the target block passes the verification. In this way, through the electric power trade order which includes the signature approved by the first terminal equipment and the second terminal equipment corresponding to the first terminal equipment, electric power trade is carried out in the electric power trade system which includes the blockchain network, namely, the first terminal equipment and the second terminal equipment complete the signature of the trade order in advance before generating or using electricity, so as to achieve the electric power trade order of electric power pre-sale/purchase, and when generating or using electricity, trade can be carried out directly according to the electric power trade order, thereby improving the trade speed and trade efficiency; meanwhile, as the uplink power producer can sell the residual electric quantity after self-power consumption in the block chain power grid, the waste of the residual electric quantity 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 dispersed, the pressure of the power transaction system in the power utilization peak is reduced, more time can be given to a power grid company for power management and scheduling, and the supply and demand balance of power is further promoted.
Drawings
For a clearer description of one or more embodiments of the present description or of the solutions of the prior art, the drawings that are necessary for the description of the embodiments or of the prior art will be briefly described, it being apparent that the drawings in the description below are only one or more embodiments of the present description, from which other drawings can be obtained, without inventive effort, for a person skilled in the art.
FIG. 1 is a hierarchical schematic diagram of a blockchain network according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method for power pre-sale transaction based on a alliance chain according to an embodiment of the present invention;
FIG. 3 is a flowchart of another method for power pre-sale transaction based on a alliance chain according to an embodiment of the present invention;
fig. 4 is a schematic flow chart of a monitoring and tracing of an electric power pre-sale transaction system based on a alliance chain according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart of a registration authentication of a power pre-sale transaction system based on a alliance chain according to an embodiment of the present invention;
FIG. 6 is a schematic diagram illustrating an exemplary flow of a method for a alliance chain power pre-sale transaction according to an embodiment of the present invention;
FIG. 7 is a schematic diagram illustrating another example of a method for power pre-sale transaction of a alliance chain according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of a power pre-selling transaction device based on a alliance chain 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 purposes of promoting an understanding of the principles and advantages of the disclosure, reference will now be made to the embodiments illustrated in the drawings and specific language will be used to describe the same.
It is noted that unless otherwise defined, technical or scientific terms used in one or more embodiments of the present disclosure should be taken in a general sense as understood by one of ordinary skill in the art to which the present disclosure pertains. The use of the terms "first," "second," and the like in one or more embodiments of the present description does not denote any order, quantity, or importance, but rather the terms "first," "second," and the like are used to distinguish one element from another. The word "comprising" or "comprises", and the like, means that elements or items preceding the word are included in the element or item listed after the word and equivalents thereof, but does not exclude other elements or items. The terms "connected" or "connected," and the like, are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "upper", "lower", "left", "right", etc. are used merely to indicate relative positional relationships, which may also be changed when the absolute position of the object to be described is changed.
The inventor researches find that part of consumers in the traditional energy market are gradually transformed into producers (mainly consuming energy and simultaneously having a certain energy generating means, generally generating electricity by using renewable energy sources, such as solar energy and wind energy), and that the participation of such energy sources in electric power trade is gradually becoming the main development trend of the electric power market. If the original unified pricing, centralized dispatching and central settlement modes are adopted for power transaction, the problems of low transaction efficiency, unbalanced supply and demand, resource waste and the like are caused.
Therefore, the invention provides a alliance chain-based electric power pre-selling transaction method which can be applied to a blockchain network in an electric power transaction system, wherein the blockchain network comprises peer nodes and ordering nodes, and the peer nodes comprise endorsement nodes and accounting nodes; the endorsement node receives a power transaction order sent by a first terminal device and returns a first power transaction option corresponding to the power transaction order to the first terminal device, so that the first terminal device determines the target power transaction according to the first power transaction option; the transaction order comprises a signature approved by the first terminal equipment and the second terminal equipment corresponding to the first terminal equipment for the electric power transaction 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 the account book of the blockchain network if the target block passes the verification. In this way, the signature of the first terminal equipment and the signature of the approval of the second terminal equipment corresponding to the first terminal equipment are included, so that the electric power transaction is carried out in the electric power transaction system comprising the blockchain network, namely, the signature of the transaction order is finished in advance before the first terminal equipment and the second terminal equipment generate or use electricity, and the electric power transaction order of electric power pre-sale/purchase is achieved; when the power generation or the power utilization is completed, the transaction can be directly carried out according to the power transaction order, and the transaction speed and the transaction efficiency are improved. Meanwhile, as the uplink power producer can sell the residual electric quantity after self-power consumption in the block chain power grid, the waste of the residual electric quantity 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 dispersed, the pressure of the power transaction system in the power utilization peak is reduced, more time can be given to a power grid company for power management and scheduling, and the supply and demand balance of power is further promoted.
It should be noted that, the blockchain network described in the present invention is a coalition chain network (i.e. coalition chain), the coalition chain network is used as an authorized blockchain, only the nodes after identity authentication are received to join the network, so that the security of the electric power data and the transaction information can be effectively ensured, and the achievement of the identity in the coalition chain is more concise and efficient, and the instantaneous requirement of the electric power transaction can be satisfied. Meanwhile, the rights of various nodes in the alliance chain are different, so that the requirements of various roles in the current power grid system are met.
In one embodiment, as shown in fig. 1, a hierarchical schematic diagram of a blockchain network may be divided into five layers, namely a physical device layer, a data layer, a network layer, a technology layer and a service layer. These five layers are described next separately.
The physical equipment layer is positioned at the bottommost layer of the blockchain network and comprises intelligent electric meters for measuring and recording electric power data, various user operation nodes, blockchain terminal equipment for hosting an account book, various power generation equipment (photovoltaic, wind power and thermal power generation equipment), energy storage equipment and the like.
And the data layer is used for storing data mainly comprising electricity consumption and generation data, electric power transaction data and the like. The power consumption data mainly refer to power consumption information of various users in the network, and the data can be automatically uploaded through the intelligent electric meter; the record of the power generation data comprises information such as power generation type (light energy power generation, wind energy power generation, hydroelectric power generation, thermal power generation and the like), power generation amount, daily power generation efficiency curve and the like; the power transaction comprises two power transaction parties, a transaction price and an electric quantity. All data are packaged through the sequencing nodes and then are uplinked and recorded in the blockchain, so that data information which cannot be tampered is formed.
And the network layer consists of a plurality of distributed nodes. The nodes together form a P2P network, the Gossip protocol is adopted to carry out data transmission and positioning sensing among the nodes, and the gRPC framework is used to realize the interface calling function.
A technical layer comprising:
an identity authentication technology ensures that a user joining a power transaction network has a certain trust basis, and determines that a participant has various rights in a blockchain network according to the identity;
policies, which are a set of rules defining how to make decisions and to achieve specific goals, are mechanisms of infrastructure management;
a distributed ledger storing important fact information about the electronic business objects, current values of the object attributes, and transaction histories resulting in these current values;
nodes are basic constituent elements of a blockchain power transaction network, bear accounts and intelligent contracts, are classified more in the power network, and each node has specific authority and work;
consensus, simply stated, probability consistency algorithms, which ultimately ensure the consistency of the ledger with a high probability, thus ensuring that the ordered blocks are consistent and correct;
Smart contract technology for defining executable logic for generating new transactions to be added to an ledger.
The service level is the uppermost layer of the overall network architecture, including a plurality of services provided by the blockchain network of the power system, such as the most basic billing services, 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 basis. The policy service may define a grid management mechanism that helps the manager to better control the operational state of the network. The smart contract service helps users better write power trade contracts that are applicable to a particular scenario. The rights service is used to assign different rights to different grid users.
It should be noted that, roles in the power market mainly include: consumers, power producers, power market operators (including transportation and system operators, distribution system operators, power traders, etc.), end customers, and the like. The simplification considerations, whether it be the end customer or the producer or the supplier, can be categorized as nodes in the grid blockchain, with the various types of nodes differing in the applications they need to invoke. And the power market operator, whichever function is performed, can be counted as a manager of the blockchain network. The identity of the user needs to be translated via the MSP (membership service provider) to a specific role in the network in order to clarify the corresponding responsibilities. The validity of CAs is defined in the MSP and users issued digital certificates by these valid CAs are entitled to join the network. The MSP can also distinguish digital certificates of different rights issued by different levels of digital certificate issuing authorities and define their rights in channels and networks. At the same time, the MSP may also identify the specific identities, e.g., administrator identities, of the different participants in the corresponding channels or networks.
The user needs to register in the electric power transaction system to complete the role positioning, specifically, referring to fig. 5, the registration authentication step mainly includes the following sub-steps:
grid users use asymmetric encryption algorithms, such as RSA or ECC algorithms, to generate public-private key pairs, the private keys being kept by the users themselves.
The user, depending on his own situation (whether the electric power producer, electric power consumer, or electric producer), presents a corresponding identity application to a certificate authority CA (certificate authority, CA for short) and provides the public key and the related certificate generated before to the certification authority. For example, a user who wants to apply for the identity of a producer, he needs to provide proof that power can be generated, and proof of the way in which power is generated (thermal power generation, renewable energy generation, etc.). If the certification verification is passed, the certificate issuing organization issues a digital certificate to the user, wherein the certificate contains personal information and 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 consumption address, the role positioning in the power market, the power generation mode (renewable energy power generation or non-renewable energy power generation), and the like. Public and private key pairs required by asymmetric encryption are also issued to users at the same time, and public keys of the users are bound with digital certificates and then issued to the whole network.
After the user obtains the effective digital certificate, the identity information is converted into the role positioning in the network through the MSP, and the corresponding node is created 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 there is no direct control over the policies that operate within each federation and channel. In addition, the power market operator creates multiple nodes to participate in management and transactions in each channel.
In combination with role classification in the power market, ordering nodes, mutual correspondence of different functions required to be executed by the nodes in the blockchain network, alliance link point types and role classification in the power market, the node types in the power grid blockchain are mainly divided into the following classes:
light node: nodes that do not store any block data and contract information need to connect with other nodes to make contract calls in order to initiate transactions or query history information. Users that do not have sufficient computing power and storage capacity can participate in the operation of the power blockchain network by operating one light node.
Peer node (peers): the nodes participating in the maintenance of the block account data are one of the basic components of the network. Peer nodes may also be classified as endorsement nodes, billing nodes, etc. according to their functionality. The endorsement node is responsible for responding to the application of the intelligent contract called by the common user and performing simulated transaction to verify the feasibility of the transaction so as to realize the endorsement policy. The endorsement node is generally operated by large users, large manufacturers, market operators, power grid companies and other participants with calculation conditions, firstly, because the users have enough calculation power to endorse, and secondly, the reliability of the users is higher. The accounting node only participates in maintaining the block ledger data, and all users with storage capability can operate the accounting node.
Sorting nodes: the method mainly provides ordering service, does not participate in transaction contents, packages the transaction into blocks according to a predefined rule, and does not need permission. Wherein a competent organization or individual may run the ranking nodes to participate in the ranking service.
The above node types have been described as being complete. It should also be noted that the transaction intelligence contracts are primarily intended to define transaction mechanisms. An endorsement policy is effectively a management rule that requires endorsing (simulated running) through endorsing nodes in a power transaction blockchain network, each smart contract having a specific endorsing policy that specifies which endorsing nodes are required to endorse and sign to invoke the smart contract for transactions. Alternative endorsement strategies are AND, OR, AND any combination thereof, e.g., AND (Org 1, org 2) is to endorse AND sign transactions requiring both the endorsement node in Org1 AND the endorsement node in Org 2; OR (Org 1, org 2) requires one of the endorsement node in Org1 OR the endorsement node in Org2 to endorse and sign. Any combination of these can be AND (OR (Org 1, org2, org 3) OR the like, 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 smart grid blockchain network, peer nodes may be all deployed and managed by the grid operator. A method of how to utilize endorsement nodes, ordering nodes, and peer nodes in a blockchain network to effect power transactions will be described in detail below.
The following describes the technical scheme of the embodiment of the present invention in detail with reference to the accompanying drawings.
Referring to fig. 2, there is shown a federation chain-based power pre-sale transaction method applied to a blockchain network in a power transaction system, the blockchain network including peer nodes and a ranking node, the peer nodes including an endorsement node and an accounting node, the method including:
s301: the endorsement node receives a power transaction order sent by a first terminal device and returns a first power transaction option corresponding to the power transaction order to the first terminal device, so that the first terminal device determines the target power transaction according to the first power transaction option; the transaction order comprises signatures approved by the first terminal equipment and the second terminal equipment corresponding to the first terminal equipment for the electric power transaction order.
In this embodiment, when a user needs to perform a power transaction, for example, needs to purchase power, sell power, and the like, the user a may send a power transaction order to the endorsement node where the intelligent contract has been deployed 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 pre-agreed and signed before power consumption or power generation, similar to a pre-sales order. The endorsement node receives a power trade order sent by the first terminal equipment and returns a first power trade option corresponding to the power trade order to the first terminal equipment, wherein the first power trade option comprises a plurality of power trades and the signature of the endorsement node, the user B receives the returned first power trade option through the first terminal equipment, and the final target power trade is selected and determined from the plurality of power trades, namely the power trade needing to be traded is selected and determined. Therefore, the electric power trade order is achieved in advance, and when power generation or power utilization is achieved, trade can be directly conducted in the blockchain network according to the electric power trade order, so that trade speed and trade efficiency are improved.
The first terminal equipment and the second terminal equipment 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).
Prior to the step of step S301, the alliance chain-based electric power pre-sale transaction method further includes:
the endorsement node receives a power transaction request sent by a first terminal device, wherein the power transaction request comprises power unit power transaction value information and gap power quantity data or residual power quantity data, and the gap power quantity data or the residual power quantity data is power quantity data predicted according to historical power generation quantity data and historical power consumption quantity data in a preset time period on a blockchain;
and if the unit power transaction value information and the gap electric quantity or the residual electric quantity meet preset conditions, 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 power transaction order according to the second power transaction option and sends the power transaction order to the endorsement node.
In this embodiment, in a preset time period recorded on the blockchain, the user a predicts and obtains gap electric quantity data or residual electric quantity data in the preset time period through historical electric quantity data and historical electric quantity data; the user A sends a power transaction request containing gap power data or residual power data and power unit power transaction value information to an endorsement node through a 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 endorsing the endorsement signature. The second power transaction option comprises a plurality of power transaction orders and a signature of an endorsement node, and the user B receives the returned plurality of power transaction orders contained in the second power transaction option through the first terminal equipment and selects and determines a final target power transaction order. The preset time period may be a certain time period in one day, one day or a plurality of days, for example, the preset time period is 18:00-22:00 in one day, and the preset time period may be specifically selected and set according to requirements. For example, the historical electricity generation amount data and the historical electricity consumption amount of the period of 18:00-22:00 which is the period of the previous day or the previous days or even longer are predicted to obtain the gap electricity amount data or the residual electricity amount data of 18:00-22:00 in the open day or the following days; and the user puts forward a power transaction request in the power transaction system through the first terminal equipment based on the secondary predicted gap power data or the residual power data.
Specifically, the endorsement node receives power transaction requests received for the first terminal device, the power transaction requests being of different types, and being divided into purchase power requests and sale power requests. Judging the type of the power transaction request, if the power transaction request is a purchase power 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 sales order in the sales 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 power transaction option comprises a plurality of power transactions and a signature of an endorsement node, and transaction electric quantity corresponding to the plurality of power transactions is respectively a smaller value of purchase electric quantity or sale electric quantity corresponding to the power transactions. And the user B determines the power transaction order according to the second power transaction option through the first terminal equipment and signs the power transaction order, and the first terminal equipment sends the power transaction order carrying the signature to the sequencing node.
If the power transaction request is a selling power request and the unit power transaction value corresponding to the power transaction request is smaller 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 power transaction option comprises a plurality of power transactions and a signature of an endorsement node, and transaction electric quantity corresponding to the plurality of power transactions is respectively a smaller value in purchase electric quantity or sale electric quantity corresponding to the power transactions. And the user B determines the power trade order according to the second power trade option through the first terminal equipment, signs the power trade order, and the first terminal equipment sends the power trade order carrying the signature to the sequencing node.
Because the power transaction requests have randomness in the matching pairing process, the situation that the purchase power corresponding to the power transaction requests and the sale power corresponding to the sale power requests are purchased generally occurs. Specifically, if the transaction electric quantity is smaller than the sales electric quantity or the purchase electric quantity, the endorsement node acquires an absence electric quantity, wherein the absence electric quantity is a difference value between the transaction electric quantity and the sales electric quantity or the purchase electric quantity, and generates a first electric power transaction request according to the absence electric quantity; if the unit power transaction value corresponding to the first power transaction request meets a preset condition, the endorsement node returns a third power transaction option corresponding to the first power transaction request to the first terminal device, so that the first terminal device determines a second power transaction order according to the third power transaction option; updating the power trade order to obtain an updated power trade order, and sending the updated power trade order to an endorsement node; wherein the updated power trade orders include a first power trade order and a second power trade order. Specifically, when the power transaction request is a purchase power request, the preset conditions are as follows: the unit power trading value corresponding to the power trading request is greater than or equal to the unit power trading value of the power selling order in the selling queue; when the power transaction request is a selling power request, the unit power transaction value corresponding to the power transaction request is smaller than or equal to the unit power transaction value of the power purchase order in the purchase queue.
Specifically, the electric power resource is purchased and sold in advance (electric power trade order) before electric power is produced and consumed, namely, the electric power trade order is achieved in advance, and the electric quantity traded by the electric power trade order can be predicted according to the historical electric quantity data and the historical electric power consumption data in a preset time period; for example, the amount of electricity sold is: α (predicted power generation amount-predicted power consumption amount), where α is a constant. The historical power generation amount and power consumption data recorded on the blockchain can be utilized to predict and determine the sales power amount or the purchase power amount. For the power producer, the required power amount for sale or purchase in the preset time period can be determined according to alpha (predicted power amount-predicted power consumption) and the predicted power amount in the preset time period (such as in one day) is determined according to the historical power amount in the preset time period, and the predicted power consumption is determined according to the historical power consumption in the preset time period. For the power consumer, the historical power generation amount is 0, and the purchase power of the preset time is the predicted power consumption according to the historical power consumption prediction. The benefits of advancing transactions based on predictions are: most small-sized power producers and sellers do not have enough electric energy storage equipment, almost all electricity generated by users is wasted except self consumption, if the users are pre-sold according to the pre-measured quantity in advance, the transaction orders are pre-made, the redundant electric energy can be utilized and directly transmitted to electricity buying users, so that resources are saved, and benefits are provided for the users. Meanwhile, the power transmission route can be planned in advance according to the trade order, so that the load of a power grid is reduced, and the network load during electricity purchasing peaks is relieved. The preset time period may be a time period in one day, one day or several days. The unit power trading value referred to by the invention can be the trading unit price of the power, for example, the price corresponding to each degree of power; the unit power trading value information may be unit price information.
The transaction double parties can put forward a power transaction request according to the self demand, and the power transaction request can comprise the information of the electric quantity which is required to be purchased or sold, the price of the unit electric quantity, whether green energy is used for generating electricity, the user address, the order ID, the time, the user identity and the like. The power transaction requests can be divided into a power purchase power transaction request and a power selling power transaction request, and the two power transaction requests are stored in different queues (a sales order queue and a buying order queue) according to the order of priority of price and time. The power transaction requests of the sales queues (sales queues) are ordered from low to high according to the price, and the buying queues (buying queues) are ordered from high to low according to the price; and if the power transaction requests with the same price are received, the green energy power generation order is in front, and the rest orders according to the order time. And if the electricity purchase unit electricity trading value corresponding to the electricity trading request is greater than or equal to the unit electricity trading value of the electricity selling order in the selling queue, automatically matching the trading order. The trade power in the trade order is the smaller value of the power purchased or sold by both parties in the power trade order, alternatively the price may be the average of the marked prices in the plurality of power trade orders. The electric power transaction request of the party with larger electricity purchasing or selling quantity still exists, but the electric quantity can be subtracted from the electric quantity in the transaction order, and after the transaction order is determined, the two parties of the transaction exchange money and goods according to the order requirement, so that the transaction is completed.
Various users can decide pre-purchase or pre-sale electric quantity (lower limit is set for sale or purchase quantity, malicious bill swiping of the users is prevented) according to self prediction, and unit electric power transaction value (electric power transaction unit price) can be formulated according to the existing order in the network as a reference, and then an intelligent contract is used for generating an electric power transaction request. The pre-sold power corresponding to the power transaction request may be slightly lower than the predicted remaining power, and the purchased power corresponding to the power transaction request may be slightly higher than the predicted gap power. If the power transaction request applied before is not satisfied, the user identity information can be used for applying for canceling the power transaction request, and the quotation information is cleared.
The alliance chain-based power pre-selling transaction method of the embodiment adopts a continuous bidding transaction mode, and a user can conduct instant transaction when a power transaction request comprises unit power transaction value information meeting preset conditions. After the power transaction request is on the internet, the type of the power transaction request is judged first, and if the power transaction request is purchased, the unit power transaction value corresponding to the power transaction request is compared with the unit power transaction value of the first power transaction request in the sales queue. If the unit power trading value is higher than the unit power trading value of the first power trading request in the sales queue, automatically matching the generated trading order, and signing by the trading parties to form a formal effect; if the unit power trading value is lower than the unit power trading value of the first power trading request in the sales queue, the unit power trading value is compared with the unit power trading values of other power trading requests in the sales queue until the unit power trading value is matched with the trading request with proper price, namely the unit power trading value is matched. Similarly, if the unit power transaction value corresponding to the power transaction request is the sales power transaction request, the unit power transaction value corresponding to the power transaction request is compared with the unit power transaction value of the first power transaction request in the purchase queue, and if the unit power transaction value is lower than the unit power transaction value of the first power transaction request in the sales queue, a transaction order (power transaction order) is automatically matched.
Typically the sales and purchase amounts of the two power trade requests are not equal, the trade amount in the trade order is a smaller value of the amount of power in the two power trade requests, and the remainder continues to match or continue to place a bill (continue to generate power trade requests).
Specifically, if the transaction electric quantity is smaller than the sales electric quantity or the purchase electric quantity, acquiring the shortage electric quantity by the endorsement node, wherein the shortage electric quantity is the difference value between the transaction electric quantity and the sales electric quantity or the purchase electric quantity, and generating a first electric power transaction request according to the shortage electric quantity; and if the unit power transaction value corresponding to the first power transaction request meets a preset condition, returning a third power transaction option corresponding to the first power transaction request to the first terminal equipment by the endorsement node so that the second power transaction order is determined by the first terminal equipment according to the third power transaction option. The endorsement node updates the electric power trade order to obtain an updated electric power trade order; wherein the updated power trade orders include a first power trade order and a second power trade order. If the transaction electric quantity corresponding to the second electric power transaction order is according to the old electricity shortage, 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 moment of power generation or electricity consumption (electricity consumption) or no electricity shortage exists.
For example, referring specifically to fig. 3, the power prediction preparation is performed, 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 blockchain, and calculate the approximate power gap amount (gap power data) or the power remaining amount (remaining power data).
The order (power transaction request) is accessed to the internet and withdrawn; various users decide pre-purchase or pre-sale electricity quantity according to the prediction of own electricity gap quantity (gap electricity quantity data) or electricity residual quantity (residual electricity quantity data), and the sale or purchase quantity sets a lower limit, a min And < a, namely setting the minimum value of the required selling or purchasing electricity quantity, preventing users from maliciously ordering, and avoiding unnecessary load quantity of the system. Formulating a unit power trade value based on an existing order (power trade order or power trade request) in the network as a reference; in addition, the unit power trading value is set to be the upper limit, and p is less than p max An order (power transaction request) is then generated by the smart contract. Based on actual power production and power consumption, to avoid that the amount of electricity produced by the seller at the time of power trade is lower than the amount of electricity in the trade order entered in advance, the pre-sold amount of electricity may be set to be slightly lower than the predicted remaining amount S sell <S pre The method comprises the steps of carrying out a first treatment on the surface of the The purchasing power is just the demand, and in order to avoid that the predicted purchasing power is lower than the actually required power, the purchasing power can be set to be slightly higher than the predicted gap power B pre <B buy
For example, the sales threshold may be set as:
α(S sell =α*S pre ,(0<α<1));
the purchase threshold is:
β(B buy =β*B pre ,(1<β<1.5))。
if the request is not satisfied with the previously applied order (power transaction request), the user identity information corresponding authority can be utilized to apply the order (power transaction request) of the revocation application, and the quotation information can be cleared.
The continuous bidding matching mode is adopted, and the user's order form (power transaction request) can be immediately met as long as meeting conditions, such as meeting preset conditions (unit price conditions and the like), are met. After the order (power transaction request) is connected to the internet, the type of the order (power transaction request) is judged, if the order (power transaction request) is purchased, the unit power transaction value is compared with the unit power transaction value of the first order (power sales order) in the sales queue, if the unit power transaction value is higher than the unit power transaction value of the first order (power sales order) in the sales queue, the transaction order is automatically matched, and the generated transaction order can be formally validated only by signing both sides of the transaction. Similarly, if the order is a sales order (power sales request), the unit power trading value is compared with the unit power trading value of the first order (power purchase order) in the purchase queue, and if the unit power trading value is lower than the unit power trading value of the first order (power purchase order) in the sales queue, the transaction order is automatically matched. Usually the sales and purchase amounts of two orders (power trade orders) are not equal, the trade amount in the trade order is the minimum of the amounts in the two orders, and the remainder continues to match or continues to hang.
The transaction order takes effect formally after being signed by both parties, and the settlement is carried out according to the actual power transmission quantity until the day of power generation and power consumption. If the seller is unable to provide sufficient power, the purchase of the remainder of the power from the grid company by the seller is provided to the purchaser (assuming the unit power trading value sold by the grid company is relatively high). After the requirements of the electricity purchasing party are met, the transaction party signs again to confirm to carry out money settlement, and the electricity purchasing party pays corresponding goods. The goods money is divided into two parts, one part of the goods money is used for paying the network passing fee of the power grid company, and the other part of the goods money is transferred into the account of the electricity seller. And finally, judging whether the transaction electric energy is renewable green electric energy or not, and if the transaction electric energy is renewable green electric energy, issuing corresponding currency rewards to the electricity seller according to the subsidy policy, and completing the transaction.
The power grid company can conduct bottom-closing transaction if the electricity consumption is found to be insufficient in purchased electricity or residual electricity exists on the same day, and the power grid company ensures supply and demand balance in the whole power grid coverage range through purchasing residual power resources and trowelling power gaps, so that waste of the power resources is avoided. In the spam stage, the pricing of the grid company is used for real-time transaction, namely, the value of the transaction unit power transaction is determined, and the power transmission is carried out once the transaction is achieved.
S302: and the sequencing node receives the target power transaction and generates a target block according to transaction data corresponding to the target power transaction.
The consensus method of the blockchain is to solve the problem of how to agree on some operations (such as generation of blocks) by multiple participants in a distributed scenario and how to solve the problem of mutual trust among nodes on the premise of decentralization. Conventional common chain consensus mechanisms such as PoW, poS, DPoS are not suitable for use in blockchain grid systems. The common PBFT consensus mechanism in the alliance chain, namely the practical Bayesian fault tolerance algorithm, needs all nodes to participate in consensus, easily causes the problems of higher communication complexity, poor expansibility, over-high delay of unstable network and the like, and is also not suitable for being directly applied to a power grid system. Some improved methods of limiting based on reputation thresholds in turn tend to lead to node aggressiveness and centralization issues. And for the power grid, the coverage range is relatively wide, a large number of nodes are required to participate in maintenance and management, and a single organization is hard to bear. And all nodes in the power grid are authenticated, so that a certain trust basis is provided. Therefore, the invention provides an improved alliance chain consensus scheme based on transaction participation and random lottery election. In this embodiment, the sorting nodes include a primary sorting node and a secondary sorting node, each of which is determined by random election of a drawing. The drawing can be carried out by verifying a random function (verifiable random function, VRF), and design adjustment is carried out by combining the transaction participation degree of each node, wherein the probability of the drawing is in positive correlation with the transaction participation degree, namely, the higher the transaction participation degree is, the higher the probability of the drawing is.
The transaction participation degree is determined according to the calculation power and storage unit of the current node contributing to the whole blockchain network, the latest transaction participation condition, the historical transaction participation condition and the continuous stable online time.
Normalized transaction engagement for a ranking node is formulated as follows (θ in the formulation 1 ,θ 2 ,θ 3 ,θ 4 Can be set according to practical conditions, but satisfy theta 1234 =1):
Wherein,
is the ratio of the calculated force contributed by the node to the total calculated force;
is the ratio of the storage units contributed by the node to the total storage units;
the ratio of the time of continuous and stable online nodes and the total running time of the network;
providing a ratio of the historical transaction amount of the user of the ordering node to the total transaction amount in the network;
the latest transaction participation condition of the user of the ordering node is provided, namely, the ratio of the transaction amount of the corresponding terminal equipment in the latest block in the block chain network to the total transaction amount of the whole block.
The present embodiment provides a consensus method, and a specific consensus process is shown in fig. 7. And drawing a lottery and randomly selecting a main ordering node according to the transaction participation degree, wherein the transaction participation degree except the main ordering node in the ordering nodes is arranged in the node with the preset bit number, drawing the lottery by a verification random function, and randomly determining the auxiliary ordering node according to the transaction participation degree. The remaining sorting nodes, which define the division of the primary sorting node and the secondary sorting node, are defined as following sorting nodes. If a certain number of auxiliary sorting nodes are randomly extracted from the nodes with the transaction degree row except the main sorting nodes at the front preset percentage, the preset percentage can be 50%, 60% and the like, and the auxiliary sorting nodes can be specifically set according to actual conditions. All sequencing nodes running and joining the sequencing service can participate in the drawing, and the probability of the drawing and the transaction participation degree are in positive correlation. The transaction participation degree is determined by the calculation force contributed by the node, the storage unit contributed by the node, the continuous online and consensus time length of the node, the historical transaction amount of the terminal equipment corresponding to the node and the transaction amount of the terminal equipment corresponding to the latest block in the blockchain network, and the transaction participation degree (Pi) is obtained specifically according to a normalized transaction participation degree formula.
The master ordering node generates a pre-selected block from the target power transaction, the pre-selected block including a signature of the master ordering node, and sends the pre-selected block including the signature to the auxiliary ordering node.
And 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 transaction data corresponding to the target power transaction. At this time, the block generation is successful, the master sorting node sends the target block to other sorting nodes, and all sorting nodes broadcast the target block to the accounting nodes connected with the target block.
Specifically, if the number of signatures of the auxiliary sorting nodes received by the main sorting node meets a preset value, the preselected block is considered to pass the verification of the auxiliary sorting nodes. The master sorting node broadcasts the preselected block and the signature corresponding to the preselected block to non-master sorting nodes (sorting nodes except the master sorting node) in the sorting nodes, and the non-master sorting nodes in the sorting 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 proportion of the auxiliary sorting nodes, that is, the preselected block is considered to pass the verification of the auxiliary sorting nodes, for example, two-thirds, three-fifths, or 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 sequencing nodes, returning to execute the step that the sequencing nodes receive the target power transaction, and determining a main sequencing node and a plurality of auxiliary sequencing nodes through drawing. Thereby recirculating the above steps.
S303: and the accounting node receives the target block, verifies the target block, and updates the target block to the account book of the blockchain network if the target block passes the verification.
In this embodiment, after receiving the target block, the accounting node connects the target block to the end of the blockchain, verifies and checks the endorsement signature of each transaction in the block, adds the target block to the end of the blockchain if the endorsement signature meets the requirements in the endorsement policy, forms a tamper-proof record, applies the transaction result to the world state, updates the world state to the account book of the blockchain network, and does not perform the operation of updating the world state if the transaction result is not met. The ranking nodes may then be rewarded according to a rewards distribution setting.
Specifically, a punishment mechanism is performed; in the consensus process, if the ordering node is disconnected, sent or passed through malicious blocks, anti-correct blocks and other actions are regarded as abnormal, the abnormal ordering node is forbidden to participate in the consensus ordering service in a period of time, so the abnormal ordering node (the ratio of the time that the node is continuously stable online and participates in the consensus to the total time the network is running) will become smaller and competing out the block will become more difficult. Normal nodes will receive rewards, which are tokens used in a number of transaction systems, the primary ordering node may receive 30% of the rewards, and the properly verified secondary ordering node may bisect 30%The remaining 40% of the rewards are bisected by the other normal following ordering nodes. These rewards are issued to the associated nodes of the users to which the sorting nodes belong, and of course, the proportion of rewards distribution can be readjusted according to the actual situation.
The consensus mechanism provided by the embodiment has the advantages that the decentralization of the whole network is ensured, and the excessive concentration of the accounting right is prevented; meanwhile, the accuracy of accounting is ensured, all legal transactions can be uplink, and malicious nodes are eliminated; and a reward mechanism is introduced to excite the enthusiasm of users to participate in consensus, so that the safety and the efficiency of the system are improved.
The step of S303 further includes: the billing node receives a first tracing request sent for the target power transaction, the billing node judges the type of the first tracing request, and 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 inquiry tracing request, a transaction tracing result of the target power transaction is returned to the terminal equipment, wherein the transaction tracing result is used for reflecting transaction information corresponding to the target power transaction; or alternatively, the first and second heat exchangers may be,
The billing node receives a second tracing request sent for the target power transaction, wherein the second tracing request is a supervision tracing request, determines the authority of the terminal equipment according to the second tracing request, acquires transaction information corresponding to the target power transaction corresponding to the authority, and returns the transaction information corresponding to the target power transaction to the terminal equipment.
Specifically, the tracing requests can be divided into transaction supervision tracing requests (second tracing requests) of supervision departments and tracing requests (first tracing requests) 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 transaction supervision department obtains a digital certificate issued by the CA, adds the digital certificate into a blockchain network of the electric power transaction system by using the identity of an administrator, obtains the highest query authority, monitors each transaction in each block based on terminal equipment after each block is generated, sends a second traceability request (supervision traceability request), and the accounting node determines the authority of the terminal equipment according to the second traceability request, 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 transaction exists according to transaction information corresponding to the target power transaction (such as information according to the identity, address, transaction electric quantity, unit electric quantity price and the like of two transaction parties); if the transaction is carried out with extremely low or extremely high transaction unit power transaction value or the transaction total electric quantity is abnormal, the supervision and management mechanism monitors the two parties involved in the transaction, and if the user can be determined to have illegal behaviors such as malicious bill swiping, monopoly competition and the like, the user can be punished.
Tracing flow of various users: most users are ordinary users maintaining the light nodes, the light nodes can not store the block content, only record the information of the block head, and the light nodes need to request inquiry from other full nodes. The verification query and the detail query can be classified according to the query. The verification query can verify whether the transaction is correctly recorded on the blockchain, and the detail query is specific transaction details of the target power transaction.
The light node user sends a first tracing request to all connected nodes based on the terminal equipment, the first tracing request is divided into two types of verification query requests (verification tracing requests) and detail query (transaction information query tracing requests), the verification query requests only need to provide transaction IDs needing to be queried, and the detail query also needs to provide corresponding identity certificates.
After receiving the query request, the full node (accounting node) replies according to the request. And the billing node judges the type of the first tracing request, if the type of the first tracing request is the verification query request, namely the verification tracing request, returns a uplink tracing result of the target power transaction to the terminal equipment, wherein the uplink tracing result is used for reflecting whether the target power transaction is uplink or not. Specifically, according to the MerkleTree calculation process, other hash values required by the Merkle root are returned to the inquirer (terminal equipment) for calculation. And after receiving the reply information, the light node performs verification. If only verifying whether the transaction is recorded in the block, it is only necessary to calculate with 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, it is indicated that the transaction is correctly recorded in the block.
If the details are inquired (transaction information inquiry traceability request), firstly, the identity of the inquirer needs to be verified, if the inquirer is a participant of the transaction and the authority is enough, the transaction traceability result of the target power transaction is returned to the terminal equipment, and the transaction traceability result is used for reflecting the transaction information corresponding to the target power transaction, namely, all transaction information corresponding to the target power transaction which can be packaged by the public key of the inquirer (terminal equipment) is returned to the inquirer; and decrypting the returned information by using the private key of the user to obtain specific transaction information.
The method for electric power pre-selling transaction based on alliance chain according to the present invention will be described by way of example, and specific reference is made to fig. 6.
Specifically, step 1: the electric power transaction user sends transaction orders (electric power transaction requests for purchasing or selling electric power) to a plurality of endorsement nodes through a client (a client of a terminal device), and the endorsement nodes which receive the transaction orders call intelligent contracts to simulate transactions, generate transaction suggestion (a first electric power transaction option) responses and attach signatures of the endorsement nodes; the simulated transaction result is not directly applied to the account book, the generated transaction advice (first power transaction option) is returned to the client side for viewing by the user, namely the first power transaction option is returned to the client side for viewing by the user, and the user determines the target power transaction according to the first power transaction option based on the terminal equipment.
Step 2: after receiving the transaction advice (first power transaction option) containing the endorsement node signature and returning the endorsement nodes meeting the number required in the endorsement policy, the user client determines the target power transaction based on the terminal equipment according to the first power transaction option, and sends the confirmed and signed target power transaction containing the transaction proposal (power transaction order) and the transaction entirety (first power transaction option) of all transaction advice responses to the ordering node for ordering and packaging.
Step 3: after receiving a certain number of transactions (target power transactions), the sequencing node packs all transactions within a period of time into blocks (target blocks) according to a setting in a consensus mechanism; and sends these blocks to all nodes with accounting functions (accounting nodes).
Step 4: after receiving a block (target block), the accounting node connects the block to the end of a blockchain, verifies (validates) the endorsement signature of each transaction in the block, and if the requirements for the endorsement signature in the endorsement policy are met (the target block validates and passes), the accounting node updates the target block to the ledger of the blockchain network, and applies the transaction result to the world state; if the requirements for endorsement signatures in the endorsement policy are not met (target block verification is not passed), no operation is performed to update the world state.
Step 5: after the accounting node has updated the ledger, it will inform the user that the transaction has generated a non-tamperable record. At this point, the user may connect to the billing node via the client to query, the transaction is recorded in the block, and the world state is updated accordingly, indicating that the transaction was completed successfully.
Corresponding to the above-mentioned electricity pre-selling transaction method based on the alliance chain, the embodiment of the invention provides an electricity pre-selling transaction device based on the alliance chain, the structure is shown in fig. 8, the device is applied to a blockchain network in an electricity transaction system, the blockchain network comprises peer nodes and ordering nodes, the peer nodes comprise endorsement nodes and accounting nodes, and the method comprises:
a sending unit 601, configured to control the endorsement node to receive a power transaction order sent by a first terminal device, and return a first power transaction option corresponding to the power transaction order to the first terminal device, so that the first terminal device determines the target power transaction according to the first power transaction option; the transaction order comprises a signature approved by the first terminal equipment and the second terminal equipment corresponding to the first terminal equipment for the electric power transaction 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;
and the updating unit 603 is configured to control the accounting node to receive the target block, verify the target block, and update the target block to the ledger of the blockchain network if the target block passes the verification.
Optionally, the sending unit 601 is further configured to:
the endorsement node receives a power transaction request sent by a first terminal device, wherein the power transaction request comprises unit power transaction value information and gap power quantity data or residual power quantity data, and the gap power quantity data or the residual power quantity data is power quantity data predicted according to historical power generation quantity data and historical power consumption quantity data in a preset time period on a blockchain;
and if the unit power transaction value information and the gap electric quantity or the residual electric quantity meet preset conditions, 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 power transaction order according to the second power transaction option and sends the power transaction order to the endorsement node.
Optionally, the sending unit 601 is specifically configured to:
if the power transaction request is a purchase power 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 sales order in the sales 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 power transaction option comprises a plurality of power transactions and a signature of an endorsement node, and transaction electric quantity corresponding to the plurality of power transactions is respectively a smaller value of purchase electric quantity or sale electric quantity corresponding to the power transactions;
if the power transaction request is a selling power request and the unit power transaction value corresponding to the power transaction request is smaller 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 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 power transaction option comprises a plurality of power transactions and a signature of an endorsement node, and transaction electric quantity corresponding to the plurality of power transactions is respectively a smaller value of purchase electric quantity or sale electric quantity corresponding to the power transactions.
Optionally, the sending unit 601 is specifically configured to:
if the transaction electric quantity is smaller than the sales electric quantity or the purchase electric quantity, the endorsement node acquires an absence electric quantity, wherein the absence electric quantity is a difference value between the transaction electric quantity and the sales electric quantity or the purchase electric quantity, and a first electric power transaction request is generated according to the absence electric quantity;
if the unit power transaction value corresponding to the first power transaction request meets a preset condition, the endorsement node returns a third power transaction option corresponding to the first power transaction request to the first terminal device, so that the first terminal device determines the second power transaction order according to the third power transaction option;
and the endorsement node updates the electric power trade order to obtain an updated electric power trade order, wherein the updated electric power trade order comprises the first electric power trade order and the second electric power trade order.
The sorting nodes include a main sorting node and an auxiliary sorting node, the main sorting node and the auxiliary sorting node are determined by random election of a drawing, and the generating unit 602 is specifically configured to:
The sequencing nodes receive the target power transaction, and a main sequencing node and a plurality of auxiliary sequencing nodes are determined through drawing;
the master ordering node generates a pre-selected block according to the target power transaction, the pre-selected block including a signature of the master ordering node;
the auxiliary sorting nodes all 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 generates a target block according to transaction data corresponding to the target power transaction;
and if the preselected block fails to pass the verification of the auxiliary sequencing node, returning to execute the step that the sequencing node receives the target power transaction, and determining a main sequencing node and a plurality of auxiliary sequencing nodes through drawing.
Optionally, the generating unit 602 is specifically configured to:
the sequencing nodes receive the target power transactions, acquire transaction participation degrees corresponding to each sequencing node, and generate the master sequencing nodes according to the transaction participation degree lottery;
In the nodes of the sorting nodes, except the main sorting node, the transaction participation degree is ranked in the node with the preset bit number, and the auxiliary sorting node is determined by drawing;
the trade participation degree is determined by the calculation power contributed by the node, the storage unit contributed by the node, the continuous online time length of the node participating in consensus, the historical trade amount of the terminal equipment corresponding to the node and the trade 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 pre-selected blocks, judge whether the pre-selected blocks pass the verification of the auxiliary sorting nodes, and return a signature to the main sorting nodes if the transaction data corresponding to the pre-selected blocks pass the verification;
if the number of the signatures of the auxiliary sorting nodes received by the main sorting node meets a preset value, the main sorting node broadcasts the pre-selected block and the signature corresponding to the pre-selected block to non-main sorting nodes in the sorting nodes; the non-master sequencing nodes in the sequencing nodes receive the pre-selected blocks and the signatures corresponding to the pre-selected blocks, verify the signatures corresponding to the pre-selected blocks, and obtain target blocks after verification.
The electric power pre-selling transaction device based on the alliance chain further comprises a tracing module, wherein the tracing module is used for:
the billing node receives a first tracing request sent for the target power transaction, the billing node judges the type of the first tracing request, and 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, wherein the uplink tracing result is used for reflecting whether the target power transaction is uplink; if the first tracing request is a transaction information inquiry tracing request, a transaction tracing result of the target power transaction is returned to the terminal equipment, wherein the transaction tracing result is used for reflecting transaction information corresponding to the target power transaction; or alternatively, the first and second heat exchangers may be,
the billing node receives a second tracing request sent for the target power transaction, wherein the second tracing request is a supervision tracing request, determines the authority of the terminal equipment according to the second tracing request, acquires transaction information corresponding to the target power transaction corresponding to the authority, and returns the transaction information corresponding to the target power transaction to the terminal equipment.
The device of the foregoing embodiment is configured to implement the corresponding method in the foregoing embodiment, and has the beneficial effects of the corresponding method embodiment, which is not described herein.
In this embodiment, corresponding to the above-mentioned electricity pre-selling transaction method based on the alliance chain, the present invention further provides an electricity pre-selling transaction system based on the alliance chain, where the system includes a blockchain network and a plurality of terminal devices connected to the blockchain network, and 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 an accounting node;
the terminal equipment is used for responding to a request sending instruction and sending a power transaction order to an endorsement node in the blockchain network, wherein the transaction order comprises signatures approved by the first terminal equipment and a second terminal equipment corresponding to the first terminal equipment for the power transaction order;
an endorsement node in the blockchain network is used for receiving a power transaction order sent by a first terminal device and returning a first power transaction option corresponding to the power transaction order to the first terminal device so that the first terminal device can determine the target power transaction according to the first power transaction option;
The sequencing node in the blockchain network 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 accounting node in the blockchain network is used for controlling the accounting node to receive the target block and verify the target block, and if the target block passes the verification, the target block is updated to the account book of the blockchain network.
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 identity information into roles in a blockchain network and determining rights corresponding to the digital certificate through MSP based on the digital certificate, and determining the roles of various users in the network and the access rights to resources and information according to the roles and the rights;
the monitoring and tracing module is used for controlling the billing node to receive a first tracing request sent for the target power transaction, the billing node judges the type of the first tracing request, and 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; if the first tracing request is a transaction information inquiry tracing request, a transaction tracing result of the target power transaction is returned to the terminal equipment, 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, wherein the second tracing request is a supervision tracing request, determines the authority of the terminal equipment according to the second tracing request, acquires transaction information corresponding to the target power transaction corresponding to the authority, and returns the transaction information corresponding to the target power transaction to the terminal equipment.
The system of the foregoing embodiment is configured to implement the corresponding method in the foregoing embodiment, and has the beneficial effects of the corresponding method embodiment, which is not described herein.
The technical carriers involved in payment in the embodiments of the present disclosure may include, for example, near field communication (Near Field Communication, NFC), WIFI, 3G/4G/5G, POS machine card swiping technology, two-dimensional code scanning technology, bar code scanning technology, bluetooth, infrared, short message (Short Message Service, SMS), multimedia message (Multimedia Message Service, MMS), and the like.
The biological features involved in the biological recognition in the embodiments of the present specification may include, for example, eye features, voiceprints, fingerprints, palmprints, heartbeats, pulses, chromosomes, DNA, human tooth bites, and the like. Wherein the eye pattern may include biological features of the iris, sclera, etc.
It should be noted that the methods of one or more embodiments of the present description 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 is completed by mutually matching a plurality of devices. In the case of such a distributed scenario, one of the devices may perform only one or more steps of the methods of one or more embodiments of the present description, the devices interacting with each other to accomplish the methods.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can 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 are also possible or may be advantageous.
For convenience of description, the above devices are described as being functionally divided into various modules, respectively. Of course, the functions of each module may be implemented in one or more pieces of software and/or hardware when implementing one or more embodiments of the present description.
Fig. 9 shows a schematic hardware structure of a specific 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 processor 1010, memory 1020, input/output interface 1030, and communication interface 1040 implement communication connections therebetween within the device via a bus 1050.
The processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit ), microprocessor, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc. for executing relevant programs to implement the technical solutions provided in the embodiments of the present disclosure.
The Memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory ), static storage device, dynamic storage device, or the like. Memory 1020 may store an operating system and other application programs, and when the embodiments of the present specification are implemented in software or firmware, the associated program code is stored in memory 1020 and executed by processor 1010.
The input/output interface 1030 is used to connect with an input/output module for inputting and outputting information. The input/output module may be configured as a component in a device (not shown) or may be external to the device to provide corresponding functionality. Wherein the input devices may include a keyboard, mouse, touch screen, microphone, various types of sensors, etc., and the output devices may include a display, speaker, vibrator, indicator lights, etc.
Communication interface 1040 is used to connect communication modules (not shown) to enable communication interactions of the present device with other devices. The communication module may implement communication through a wired manner (such as USB, network cable, etc.), or may implement communication through a wireless manner (such as mobile network, WIFI, bluetooth, etc.).
Bus 1050 includes a path for transferring information between components of the device (e.g., processor 1010, memory 1020, input/output interface 1030, and communication interface 1040).
It should be noted that although the above-described device only shows processor 1010, memory 1020, input/output interface 1030, communication interface 1040, and bus 1050, in an implementation, the device may include other components necessary to achieve proper operation. Furthermore, it will be understood by those skilled in the art that the above-described apparatus may include only the components necessary to implement the embodiments of the present description, and not all the components shown in the drawings.
The computer readable media of the present embodiments, including both permanent and non-permanent, removable and non-removable media, may be used to 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 storage media for a computer 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, which can be used to store information that can be accessed by a computing device.
Those of ordinary skill in the art will appreciate that: the discussion of any of the embodiments above is merely exemplary and is not intended to suggest that the scope of the disclosure, including the claims, is limited to these examples; combinations of features of the above embodiments or in different embodiments are also possible within the spirit of the present disclosure, steps may be implemented in any order, and there are many other variations of the different aspects of one or more embodiments described above which are not provided in detail for the sake of brevity.
Additionally, well-known power/ground connections to Integrated Circuit (IC) chips and other components may or may not be shown within the provided figures, in order to simplify the illustration and discussion, and so as not to obscure one or more embodiments of the present description. Furthermore, the apparatus may be shown in block diagram form in order to avoid obscuring the one or more embodiments of the present description, and also in view of the fact that specifics with respect to implementation of such block diagram apparatus are highly dependent upon the platform within which the one or more embodiments of the present description are to be implemented (i.e., such 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 in nature and not as restrictive.
While the present disclosure has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of those embodiments will be apparent to those skilled in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
The present disclosure is intended to embrace all such alternatives, modifications and variances which fall within the broad scope of the appended claims. Any omissions, modifications, equivalents, improvements, and the like, which are within the spirit and principles of the one or more embodiments of the disclosure, are therefore intended to be included within the scope of the disclosure.

Claims (9)

1. A alliance chain-based power pre-sale transaction method, wherein the method is applied to a blockchain network in a power transaction system, the blockchain network comprising peer nodes and ordering nodes, the peer nodes comprising endorsement nodes and accounting nodes, the method comprising: the endorsement node receives a power transaction order sent by a first terminal device and returns a first power transaction option corresponding to the power transaction order to the first terminal device, so that the first terminal device determines a target power transaction according to the first power transaction option; the transaction order comprises a signature approved by the first terminal equipment and the second terminal equipment corresponding to the first terminal equipment for the electric power transaction order;
The sequencing node receives the target power transaction and generates a target block according to transaction data corresponding to the target power transaction;
the accounting node receives the target block and verifies the target block, and if the target block passes the verification, the target block is updated to an account book of the blockchain network;
the sorting node comprises a main sorting node and an auxiliary sorting node, the sorting node receives the target power transaction and generates a target block according to transaction data corresponding to the target power transaction, and the sorting node comprises:
the sequencing nodes receive the target power transaction, and a main sequencing node and a plurality of auxiliary sequencing nodes are determined through drawing;
the master ordering node generates a pre-selected block according to the target power transaction, the pre-selected block including a signature of the master ordering node;
the auxiliary sorting nodes all 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 generates a target block according to transaction data corresponding to the target power transaction;
And if the preselected block fails to pass the verification of the auxiliary sequencing node, returning to execute the step that the sequencing node receives the target power transaction, and determining a main sequencing node and a plurality of auxiliary sequencing nodes through drawing.
2. The alliance chain-based power pre-sale transaction method of claim 1, wherein prior to the step of the endorsement node receiving a power transaction order sent for a first terminal device, the method further comprises:
the endorsement node receives a power transaction request sent by a first terminal device, wherein the power transaction request comprises unit power transaction value information and gap power quantity data or residual power quantity data, and the gap power quantity data or the residual power quantity data is power quantity data predicted according to historical power generation quantity data and historical power consumption quantity data in a preset time period on a blockchain;
and if the unit power transaction value information and the gap electric quantity or the residual electric quantity meet preset conditions, 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 power transaction order according to the second power transaction option and sends the power transaction order to the endorsement node.
3. The alliance chain-based power pre-sale transaction method according to claim 2, wherein if the unit power transaction value information and the gap power or the residual power meet a preset condition, 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 power transaction order according to the second power transaction option, and sends the power transaction order to the endorsement node, which comprises:
if the power transaction request is a purchase power 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 sales order in the sales 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 power transaction option comprises a plurality of power transactions and a signature of an endorsement node, and transaction electric quantity corresponding to the plurality of power transactions is respectively a smaller value of purchase electric quantity or sale electric quantity corresponding to the power transactions;
If the power transaction request is a selling power request and the unit power transaction value corresponding to the power transaction request is smaller 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 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 power transaction option comprises a plurality of power transactions and a signature of an endorsement node, and transaction electric quantity corresponding to the plurality of power transactions is respectively a smaller value of purchase electric quantity or sale electric quantity corresponding to the power transactions.
4. A alliance chain-based power pre-sale transaction method according to claim 3 and wherein said endorsement node returns to said first terminal device a second power transaction option corresponding to said power transaction request, said method further comprising:
if the transaction electric quantity is smaller than the sales electric quantity or the purchase electric quantity, the endorsement node acquires an absence electric quantity, wherein the absence electric quantity is a difference value between the transaction electric quantity and the sales electric quantity or the purchase electric quantity, and a first electric power transaction request is generated according to the absence electric quantity;
If the unit power transaction value corresponding to the first power transaction request meets a preset condition, the endorsement node returns a third power transaction option corresponding to the first power transaction request to the first terminal device, so that the first terminal device determines the second power transaction order according to the third power transaction option;
and the endorsement node updates the electric power trade order to obtain an updated electric power trade order, wherein the updated electric power trade order comprises the first electric power trade order and the second electric power trade order.
5. The coalition chain based power pre-sale transaction method of claim 1, wherein the ordering node receives the target power transaction, determines a primary ordering node and a secondary ordering node by drawing, comprising:
the sequencing nodes receive the target power transactions, acquire transaction participation degrees corresponding to each sequencing node, and generate the master sequencing nodes according to the transaction participation degree lottery;
in the nodes of the sorting nodes, except the main sorting node, the transaction participation degree is ranked in the node with the preset bit number, and the auxiliary sorting node is determined by drawing;
The trade participation degree is determined by the calculation power contributed by the node, the storage unit contributed by the node, the continuous online time length of the node participating in consensus, the historical trade amount of the terminal equipment corresponding to the node and the trade amount of the terminal equipment corresponding to the latest block in the block chain network.
6. The coalition chain based power pre-sale transaction method of claim 1, wherein said plurality of auxiliary ordering nodes receive said preselected block and determine if said preselected block passes verification by said plurality of auxiliary ordering 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 transaction data corresponding to the target power transaction, including:
the auxiliary sorting nodes all receive the pre-selected blocks, judge whether the pre-selected blocks pass the verification of the auxiliary sorting nodes, and return a signature to the main sorting nodes if the transaction data corresponding to the pre-selected blocks pass the verification;
if the number of the signatures of the auxiliary sorting nodes received by the main sorting node meets a preset value, the main sorting node broadcasts the pre-selected block and the signature corresponding to the pre-selected block to non-main sorting nodes in the sorting nodes; the non-master sequencing nodes in the sequencing nodes receive the pre-selected blocks and the signatures corresponding to the pre-selected blocks, verify the signatures corresponding to the pre-selected blocks, and obtain target blocks after verification.
7. The alliance chain-based power pre-sale transaction method of claim 1, further comprising:
the billing node receives a first tracing request sent for the target power transaction, the billing node judges the type of the first tracing request, and 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, wherein the uplink tracing result is used for reflecting whether the target power transaction is uplink; if the first tracing request is a transaction information inquiry tracing request, a transaction tracing result of the target power transaction is returned to the terminal equipment, wherein the transaction tracing result is used for reflecting transaction information corresponding to the target power transaction; or alternatively, the first and second heat exchangers may be,
the billing node receives a second tracing request sent for the target power transaction, wherein the second tracing request is a supervision tracing request, determines the authority of the terminal equipment according to the second tracing request, acquires transaction information corresponding to the target power transaction corresponding to the authority, and returns the transaction information corresponding to the target power transaction to the terminal equipment.
8. A coalition chain-based electric power pre-sale transaction device, the device being applied to a blockchain network in an electric power transaction system, the blockchain network comprising peer nodes and ordering nodes, the peer nodes comprising endorsement nodes and billing nodes, the device comprising:
the transmission unit is used for controlling the endorsement node to receive the power transaction order transmitted by the first terminal equipment and returning a first power transaction option corresponding to the power transaction order to the first terminal equipment so that the first terminal equipment can determine a target power transaction according to the first power transaction option; the transaction order comprises a signature approved by the first terminal equipment and the second terminal equipment corresponding to the first terminal equipment for the electric power transaction 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;
the sorting nodes comprise a main sorting node and an auxiliary sorting node, the generating unit is also used for,
the sequencing nodes receive the target power transaction, and a main sequencing node and a plurality of auxiliary sequencing nodes are determined through drawing;
The master ordering node generates a pre-selected block according to the target power transaction, the pre-selected block including a signature of the master ordering node;
the auxiliary sorting nodes all 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 generates a target block according to transaction data corresponding to the target power transaction;
if the preselected block fails to pass the verification of the auxiliary sequencing node, returning to execute the step that the sequencing node receives the target power transaction, and determining a main sequencing node and a plurality of auxiliary sequencing nodes through drawing;
and the updating unit is used for controlling the accounting node to receive the target block and verify the target block, and if the target block passes the verification, updating the target block to the account book of the blockchain network.
9. The electric power pre-selling 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 terminal devices at least comprise a first terminal device and a second terminal device, the blockchain network comprises peer nodes and ordering nodes, and the peer nodes comprise endorsement nodes and accounting nodes;
The terminal equipment is used for responding to a request sending instruction and sending a power transaction order to an endorsement node in the blockchain network, wherein the transaction order comprises signatures approved by the first terminal equipment and a second terminal equipment corresponding to the first terminal equipment for the power transaction order;
an endorsement node in the blockchain network is used for receiving a power transaction order sent by a first terminal device and returning a first power transaction option corresponding to the power transaction order to the first terminal device so that the first terminal device can determine a target power transaction according to the first power transaction option;
the sequencing node in the blockchain network 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;
wherein the ordering nodes comprise a primary ordering node and a secondary ordering node, the ordering nodes in the blockchain network are further used for,
receiving the target power transaction, and determining a main sequencing node and a plurality of auxiliary sequencing nodes through drawing;
the master ordering node generates a pre-selected block according to the target power transaction, the pre-selected block including a signature of the master ordering node;
The auxiliary sorting nodes all 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 generates a target block according to transaction data corresponding to the target power transaction;
if the preselected block fails to pass the verification of the auxiliary sequencing node, returning to execute the step that the sequencing node receives the target power transaction, and determining a main sequencing node and a plurality of auxiliary sequencing nodes through drawing;
and the accounting node in the blockchain network is used for controlling the accounting node to receive the target block and verify the target block, and if the target block passes the verification, the target block is updated to the account book of the blockchain network.
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 CN112613861A (en) 2021-04-06
CN112613861B true 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)

Families Citing this family (4)

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

Citations (5)

* 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
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

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110163004B (en) * 2018-02-14 2023-02-03 华为技术有限公司 Block chain generation method, related equipment and system
US20200013025A1 (en) * 2018-07-06 2020-01-09 International Business Machines Corporation Conditional deferred transactions for blockchain

Patent Citations (5)

* 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
CN108830711A (en) * 2018-05-07 2018-11-16 国网浙江省电力有限公司嘉兴供电公司 A kind of energy internet business account book management method and system based on block chain
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
Fog Computing enabled Smart Grid Blockchain Architecture and Performance Optimization with DRL Approach;Weijun Zheng 等;《ICCSNT》;第1-5页 *
基于智能合约的区域能源交易模型与实验测试;王德文;柳智权;;电网技术(第06期);第2010-2019页 *

Also Published As

Publication number Publication date
CN112613861A (en) 2021-04-06

Similar Documents

Publication Publication Date Title
Thukral Emergence of blockchain-technology application in peer-to-peer electrical-energy trading: A review
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
CN112613861B (en) Electric power pre-selling transaction method, device and system based on alliance chain
Liu et al. Peer-to-peer electricity trading system: smart contracts based proof-of-benefit consensus protocol
Said A decentralized electricity trading framework (DETF) for connected EVs: A blockchain and machine learning for profit margin optimization
CN110335147A (en) A kind of digital asset Information Exchange System and method based on block chain
Zavodovski et al. DeCloud: Truthful decentralized double auction for edge clouds
US20080301055A1 (en) unified platform for reputation and secure transactions
Afzal et al. Role of blockchain technology in transactive energy market: A review
CN114401268A (en) Cross-link data sharing method, system, equipment and readable storage medium
CN116743768B (en) Method, apparatus, device and computer readable storage medium for trading computing power resources
Shi et al. Integration of blockchain and auction models: A survey, some applications, and challenges
CN111402043A (en) Internet of vehicles data transaction method based on block chain
Yahaya et al. Blockchain-based secure energy trading with mutual verifiable fairness in a smart community
CN113987080A (en) Block chain excitation method and device based on reputation consensus and related products
CN114358766A (en) Method, equipment and blockchain system for trading green electric certificates
CN114358969A (en) Green power confirmation method, green power confirmation equipment and computer readable storage medium
Liu et al. Blockchain-enabled renewable energy certificate trading: A secure and privacy-preserving approach
Wang et al. A privacy protection scheme for electricity transactions in the microgrid day-ahead market based on consortium blockchain
Barbhaya et al. Etradechain: blockchain-based energy trading in local energy market (lem) using modified double auction protocol
Karandikar et al. Transactive energy on hyperledger fabric
Huang et al. Profit sharing for data producer and intermediate parties in data trading over pervasive edge computing environments
Li et al. Secure electronic ticketing system based on consortium blockchain
Ye et al. An anonymous and fair auction system based on blockchain

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