CN112132682A - Electric power transaction method, device and system based on block chain technology - Google Patents

Electric power transaction method, device and system based on block chain technology Download PDF

Info

Publication number
CN112132682A
CN112132682A CN202010796809.5A CN202010796809A CN112132682A CN 112132682 A CN112132682 A CN 112132682A CN 202010796809 A CN202010796809 A CN 202010796809A CN 112132682 A CN112132682 A CN 112132682A
Authority
CN
China
Prior art keywords
node
transaction
power transaction
block
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010796809.5A
Other languages
Chinese (zh)
Inventor
郑伟军
陈鼎
王文华
段军
梁樑
方景辉
吴国庆
唐锦江
应杰耀
魏翼飞
薛晨子
张勇
郭达
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing University of Posts and Telecommunications
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 CN202010796809.5A priority Critical patent/CN112132682A/en
Publication of CN112132682A publication Critical patent/CN112132682A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • 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/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • 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

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

Abstract

One or more embodiments of the present disclosure provide a power transaction method based on a blockchain technology, where a power grid blockchain and an edge computing network are combined with each other, and an edge server is a part of a blockchain node, so as to reduce deployment cost of the network, and meanwhile, due to abundant power resources owned by a power grid, the power grid can also be used as an exchange resource to perform resource replacement with the edge server node, so as to further reduce maintenance cost of the blockchain network. In addition, the transaction chain-linking process is divided into three stages of transaction endorsement, sequencing and verification, and different nodes play different roles, so that the parallel processing of the electric power transaction can be realized, and the transaction speed of the electric power transaction is improved. In addition, only authorized nodes in the blockchain network can join the network and modify the data, so that the privacy of the data can be ensured. Therefore, the method can reduce the cost of the block chain network on the premise of ensuring the privacy of data and the transaction speed.

Description

Electric power transaction method, device and system based on block chain technology
Technical Field
One or more embodiments of the present specification relate to the field of internet of things technology, and in particular, to a power transaction method, device, and system based on a blockchain technology.
Background
With the development of scientific Technology, smart grids, as a necessary trend of future grid development, are integrated by highly robust Information and Communication Technology (ICT) aiming to secure the power demand of consumers by minimizing costs, waste of resources and environmental impact. The blockchain is a bottom information technology of a non-falsifiable distributed system, and the smart grid based on marketization, distributed energy and energy internet is built with strong internal consistency, so that decentralization, autonomy, marketization and intellectualization are emphasized. In a smart grid, if the blockchain can be effectively used, many practical problems can be solved, for example: establishing a distrusted supply and demand system for producers and consumers in an emerging power market, and providing an efficient and safe solution for marketized operation of distributed energy; the characteristics of non-falsification and traceability of block chain data storage ensure the accuracy of power data acquisition and ensure the traceability of each link in a power cycle; the distributed characteristic ensures the robustness of the power grid against network attacks.
The existing power grid block chain research is mainly based on the existing consensus mechanism and the existing public chain, such as bitcoin and ether house, the data on the chain is completely disclosed, the confirmation time of a single transaction is long, and the requirements on the privacy and the transaction instantaneity of the power data are not met. Decentralized, safe and stable operation of the public chain requires the deployment of a large number of distributed devices with sufficient computing power and storage unit support, entailing significant costs for the grid operators and users.
Therefore, there is a need for a power transaction method that can reduce the cost of the blockchain network and ensure the privacy of data and the transaction speed.
Disclosure of Invention
In view of this, one or more embodiments of the present disclosure provide a power trading method based on a blockchain technique, so as to reduce the cost of a blockchain network while ensuring privacy of data and trading speed.
In view of the above, one or more embodiments of the present specification provide a power transaction method based on a blockchain technology, where the method is applied to a blockchain network in a power transaction system based on a blockchain technology, the blockchain network includes endorsement nodes, edge server nodes, and peer nodes, where an edge server node of all the edge server nodes is a sorting node, and the method includes:
the endorsement node receives an electric power transaction request sent by the terminal equipment and returns an electric power transaction option corresponding to the electric power transaction request to the terminal equipment, so that the terminal equipment determines a target electric power transaction according to the electric power transaction option;
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 peer node verifies the target block, and if the target block passes the verification, the peer node updates the target block to an account book of the block chain network.
Optionally, the block chain network stores an authority database, where the authority database stores authority information of a trusted terminal; the endorsement node receives an electric power transaction request sent by the terminal equipment and returns an electric power transaction option corresponding to the electric power transaction request to the terminal equipment, so that the terminal equipment determines a target electric power transaction according to the electric power transaction option, and the method comprises the following steps:
the endorsement node receives a power transaction request sent by aiming at the terminal equipment, wherein the power transaction request comprises a user digital certificate of the terminal equipment and request transaction data;
the endorsement node determines the authority information of the terminal equipment according to the user digital certificate of the terminal equipment;
the endorsement node judges whether the terminal equipment is a trusted terminal or not according to the authority information of the terminal equipment and the authority database;
if the terminal equipment is a trusted terminal, the endorsement node determines an electric power transaction option corresponding to the electric power transaction request according to the request transaction data; wherein the power transaction options include a number of power transactions and signatures of the endorsement nodes;
and the endorsement node returns the power transaction option to the terminal equipment, so that the terminal equipment determines a target power transaction according to the power transaction option and sends the target power transaction to the edge server node.
Optionally, the sorting node receives the target power transaction, and generates a target block according to transaction data corresponding to the target power transaction, including
Determining at least one edge server node as a sequencing node according to the contribution weight respectively corresponding to each edge server node;
the sequencing node packs transaction data corresponding to the target power transaction to generate a target block, and broadcasts the target block to each peer node through each edge server node in the block chain network; wherein the target tile comprises a signature of the sorting node.
Optionally, the edge server nodes are all unauthenticated nodes; determining at least one edge server node as a sequencing node according to the contribution weight corresponding to each edge server node, including:
randomly drawing lots according to the contribution weights respectively corresponding to the edge server nodes, and taking the selected node subset as a sequencing node, wherein the sequencing node with the highest priority executes the step of packaging the transaction data corresponding to the target power transaction to generate a target block, and the target block is broadcasted to each peer node; wherein the target block further comprises a drawing result of the random drawing;
the method further comprises the following steps: and if the target block is updated to the account book of the block chain network, the sequencing node with the highest priority obtains the block same as the target block.
Optionally, before the sorting node performs a packing process on the transaction data corresponding to the target power transaction to generate a target block, and broadcasts the target block to each peer node through each edge server node in the block chain network, the method further includes:
the sequencing node determines the block outlet time of the target block according to the transaction quantity, the preset minimum interval time and the preset maximum interval time;
correspondingly, the step of the sorting node performing packaging processing on the transaction data corresponding to the target power transaction to generate a target block, and broadcasting the target block to each peer node through each edge server node in the block chain network includes:
when a preset block condition is met, the sequencing node packs transaction data corresponding to the target power transaction to generate a target block, and broadcasts the target block to each peer node through each edge server node in the block chain network;
wherein the block discharging condition comprises: and reaching the block-out time of the target block, or reaching the block-out time of the target block, wherein the loop ratio of the block-out time interval between the target block and the previous block is greater than the noise tolerance.
Optionally, the peer nodes include an anchor node and a verification node; the peer node verifies the target block, and if the target block passes verification, the peer node updates the target block to an account book of the blockchain network, including:
for each peer node, the anchor node of the peer node receives a target block sent by the corresponding edge server node of the peer node, and forwards the target block to a verification node of the peer node;
the verification node determines a transaction validity result of the target block and sends the transaction validity result and the signature of the verification node to other peer nodes respectively;
and if the number of the transaction validity results obtained by the peer node is greater than or equal to the preset number, determining that the target block passes verification, and updating the target block to an account book of the block chain network.
Optionally, the determining, by the verification node, a transaction validity result of the target block includes:
and the verification node determines the transaction validity result of the target block according to the signature of the sequencing node of the target block, the drawing and signing result, the user digital certificate and the signature of the endorsement node.
Optionally, the method further includes:
and the peer node feeds back the uplink notification aiming at the target power transaction to the terminal equipment through the endorsement node.
One or more embodiments of the present specification provide an apparatus for power transaction based on blockchain technology, where the apparatus is applied to a blockchain network in a power transaction system based on blockchain technology, and the blockchain network includes endorsement nodes, edge server nodes, and peer nodes, where an edge server node of all the edge server nodes is a sorting node, and the apparatus includes:
the sending unit is used for controlling the endorsement node to receive the power transaction request sent by the terminal equipment and returning a power transaction option corresponding to the power transaction request to the terminal equipment, so that the terminal equipment determines a target power transaction according to the power transaction option;
the generation unit is used for controlling the sequencing node to receive the target power transaction and generating a target block according to the transaction data corresponding to the target power transaction;
and the updating unit is used for controlling the peer node to verify the target block, and updating the target block to an account book of the block chain network if the target block passes the verification.
One or more embodiments of the present specification provide a power transaction system based on a blockchain technology, where the power transaction system based on the blockchain technology includes a number of terminal devices and a blockchain network, where the blockchain network includes endorsement nodes, edge server nodes, and peer nodes, where an edge server node of all edge server nodes is a sorting node;
the terminal equipment is used for responding to a power transaction request sent by a request sending instruction to an endorsement node in the block chain network;
the endorsement node in the block chain network is used for receiving the power transaction request sent by the terminal equipment and returning a power transaction option corresponding to the power transaction request to the terminal equipment, so that the terminal equipment determines a target power transaction according to the power transaction option;
the sorting node in the block chain network is used for receiving the target electric power transaction and generating a target block according to the transaction data corresponding to the target electric power transaction;
and the peer node in the block chain network is used for verifying the target block, and updating the target block to an account book of the block chain network if the target block passes verification.
As can be seen from the above description, the power transaction method based on the blockchain technology provided in one or more embodiments of the present specification may be applied to a blockchain network in a power transaction system based on the blockchain technology, where the blockchain network includes endorsement nodes, edge server nodes, and peer nodes, where an edge server node of all the edge server nodes is a sorting node; the endorsement node receives an electric power transaction request sent by the terminal equipment and returns an electric power transaction option corresponding to the electric power transaction request to the terminal equipment, so that the terminal equipment determines a target electric power transaction according to the electric power transaction option; 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 peer node verifies the target block, and if the target block passes the verification, the peer node updates the target block to an account book of the block chain network. Therefore, because the edge server in the edge computing network is close to the terminal equipment and can provide natural computing power and storage unit support for the maintenance of the network, the invention combines the block chain of the power grid and the edge computing network, and takes the edge server as one part of the block chain nodes, thereby reducing the deployment cost of the network. In addition, the invention divides the transaction chain-linking process into three stages of transaction endorsement, sequencing and verification, and different nodes play different roles, thereby realizing the parallel processing of the electric power transaction and improving the transaction speed of the electric power transaction. In addition, only authorized nodes in the blockchain network can join the network and modify the data, so that the privacy of the data can be ensured. In summary, the power transaction method based on the blockchain technology provided by the invention can reduce the cost of the blockchain network on the premise of ensuring the privacy of data and the transaction speed.
Drawings
In order to more clearly illustrate one or more embodiments or prior art solutions of the present specification, the drawings that are needed in the description of the embodiments or prior art will be briefly described below, and it is obvious that the drawings in the following description are only one or more embodiments of the present specification, and that other drawings may be obtained by those skilled in the art without inventive effort from these drawings.
Fig. 1 is a schematic diagram illustrating a hierarchical layer of a blockchain network according to an embodiment of the present invention;
fig. 2 is a block chain network structure according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a power transaction method based on a block chain technique according to an embodiment of the present invention;
FIG. 4 is a block diagram of an exemplary application scenario provided in an embodiment of the present invention;
fig. 5 is a flowchart illustrating a power transaction method based on a blockchain technique according to an embodiment of the present invention;
FIG. 6 is a block diagram of an exemplary application scenario provided in an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electric power transaction apparatus based on a block chain technique according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of promoting a better understanding of the objects, aspects and advantages of the present disclosure, reference is made to the following detailed description taken in conjunction with the accompanying drawings.
It is to be noted that unless otherwise defined, technical or scientific terms used in one or more embodiments of the present specification should have the ordinary meaning as understood by those of ordinary skill in the art to which this disclosure belongs. The use of "first," "second," and similar terms in one or more embodiments of the specification is not intended to indicate any order, quantity, or importance, but rather is used to distinguish one element from another. The word "comprising" or "comprises", and the like, means that the element or item listed before the word covers the element or item listed after the word and its equivalents, but does not exclude other elements or items. The terms "connected" or "coupled" and the like are not restricted to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "upper", "lower", "left", "right", and the like are used merely to indicate relative positional relationships, and when the absolute position of the object being described is changed, the relative positional relationships may also be changed accordingly.
The inventor finds that the existing power grid block chain researches are based on the existing consensus mechanism and the existing public chain, such as bitcoin and ether house, the data on the chain is completely disclosed, the confirmation time of a single transaction is long, and the requirements on the privacy of the power data and the transaction instantaneity are not met. Decentralized, safe and stable operation of the public chain requires the deployment of a large number of distributed devices with sufficient computing power and storage unit support, entailing significant costs for the grid operators and users. Therefore, there is a need for a power transaction method that can reduce the cost of the blockchain network and ensure the privacy of data and the transaction speed.
Therefore, the invention provides an electric power transaction method based on a blockchain technology, which can be applied to a blockchain network in an electric power transaction system based on the blockchain technology, wherein the blockchain network comprises endorsement nodes, edge server nodes and peer nodes, and one edge server node in all the edge server nodes is a sequencing node; the endorsement node receives an electric power transaction request sent by the terminal equipment and returns an electric power transaction option corresponding to the electric power transaction request to the terminal equipment, so that the terminal equipment determines a target electric power transaction according to the electric power transaction option; 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 peer node verifies the target block, and if the target block passes the verification, the peer node updates the target block to an account book of the block chain network. Therefore, because the edge server in the edge computing network is close to the terminal equipment and can provide natural computing power and storage unit support for the maintenance of the network, the invention combines the block chain of the power grid and the edge computing network, and takes the edge server as one part of the block chain nodes, thereby reducing the deployment cost of the network. In addition, the invention divides the transaction chain-linking process into three stages of transaction endorsement, sequencing and verification, and different nodes play different roles, thereby realizing the parallel processing of the electric power transaction and improving the transaction speed of the electric power transaction. In addition, only authorized nodes in the blockchain network can join the network and modify the data, so that the privacy of the data can be ensured. In summary, the power transaction method based on the blockchain technology provided by the invention can reduce the cost of the blockchain network on the premise of ensuring the privacy of data and the transaction speed.
It should be noted that the blockchain network in the present invention may be an alliance chain network combined with edge computing, where an alliance chain is more suitable for an electric power system, and the alliance chain is an authorized blockchain, and only authorized nodes can join the network, so that privacy of data and transaction speed can be better ensured.
In one embodiment, as shown in fig. 1, the blockchain network in this embodiment may be divided into four layers, namely a data layer, a network layer, a policy layer and an application layer. These four layers will be described separately below.
The data layer (The data layer) stores data in The smart grid, which are mainly power related data, such as power consumption and power generation data, and power transaction data. The power consumption data mainly refers to power consumption information of various users in the network, and can be automatically uploaded through an intelligent electric meter; the power generation data comprises information such as power generation resource types, power generation capacity and power pricing; the electric power transaction comprises electric power transaction parties, transaction price and electric quantity. Different data is recorded in the block chain by the packed uplink, and data information which cannot be tampered is generated.
The network layer (The network layer) defines The network and topology of The smart grid, and The blockchain is used as The underlying information technology and is usually modeled as a distributed peer-to-peer network. The network nodes may include user equipment, operator deployment nodes, edge server nodes (fog nodes), and the like, and different devices belong to different organizations or units, and have different roles in the blockchain network. The topological structure refers to the book structure in popular terms, and the book is a chain structure stored in a block form, for example, compared with the Hyper Fabric structure, channels (channels) and world states (world) are increased.
The channel (channel) is a main communication mechanism in the Fabric, alliance members can create different channels according to needs, a plurality of channels can exist in a network, one channel can contain any number of organizations, only the organization contained in the channel can read data of a channel block, and the channel block interacts with other organizations in the channel. The channel is similar to a small block chain network and has a dedicated channel account book. Once a channel is created, as if it were completely out of the network, only the organization specified in the channel configuration (channel configuration) can make modifications to the content of the channel, i.e. the channel blockchain, and any changes in the main network cannot affect it. The channel provides a mechanism for isolating different tissues, and one tissue can have a channel inside the tissue; and a mechanism for cooperation among organizations is also provided, and different organizations can cooperate to create a channel to carry out communication among the organizations and share data. In the smart grid, different channels can be created according to different regions and different market types. For example, a power transaction channel of a residential area, only the users and the power grid operators in the residential area can read the power transaction information in the channel or initiate a transaction. The power privacy of users is protected, nearby consumption of distributed energy is realized, the channel limits the generation of trans-regional unrealistic power transaction, and the utilization efficiency of power resources is improved. On the other hand, the small-scale channel has lower requirements on computing power and storage units, so that the cost for deploying the intelligent power grid block chain network in a large scale is reduced. The electric power transaction can be divided into two types of spot transaction and contract transaction according to different periods of the electric power transaction. The spot transaction can be divided into day-ahead transaction, time-ahead transaction and real-time transaction; and the contract trade is classified into futures, options, forward contract trade, etc. The requirements of different transaction cycles on transaction confirmation time are different, the transaction quantity in the same time period is different, and the participating organization members are different. The arrangement of the channel provides more fit and customization service possibility for electric power trading markets with different trading types. It is further emphasized that the channels provide isolation and cooperation mechanisms among different organizations, in actual use, different channels can be created according to actual needs, each channel has a dedicated channel account book, only authorized nodes have authority to write and read data, and in the smart grid, different channels can be created according to different areas and different market transaction types, so that not only can the power data of users be protected, resource consumption be realized nearby, but also the network scale of the block chain can be reduced, and the cost is reduced.
The current states of all power grid user accounts are stored in the world state and presented in a database mode, the terminal equipment can inquire, write and delete state information by calling an intelligent contract, and a user can modify the information of the world state but cannot modify transaction records stored in a block chain. The blockchain can be regarded as storing change information of each world state. The blockchain stores all transaction information that once written cannot be tampered with. The world state database provides a rich operator set, and can effectively perform storage and state retrieval. The terminal can query, write and delete the state information by calling the intelligent contract. However, it should be noted that the terminal can modify the information of the world state, but the corresponding authority cannot modify the data recorded in the blockchain. It is emphasized that the world state stores key-value pair information involved in the transaction, and may use level db or CouchDB, where level db is the Fabric default built-in database and CouchDB is the optional third party database.
The policy layer may include various rule definitions involved in network operation and management. Besides the consensus mechanism, incentive mechanism and privacy policy that must be involved in the normal operation of the blockchain network, network management policies are also included. Unlike public links such as bitcoin or EtherFang, the management strategy of the block link is fixed at any time, if modification is needed, branching processing is carried out after community voting, the network management means of the block link is more flexible and convenient, and organization members with management authority can carry out network administration, such as modification and update of access control authority management of block data, modification of channel configuration and modification and update of endorsement strategy.
The application layer (The application layer) implements different functions mainly by means of programmable smart contracts. In the alliance chain, chain codes are used for grouping and deploying related intelligent contracts, and meanwhile, the chain codes can also be used for compiling an underlying system. According to the characteristics of the smart grid, applications such as power trading, power storage unit leasing and the like can be deployed, and the applications can be compiled and deployed according to specific needs.
Next, the block chain network structure will be described with reference to fig. 2, and fig. 2 is a specific block structure of the block chain network. The basic unit of a block chain network is a block, and a block is generally composed of three parts: a block header (header), block data (block data), and metadata (metadata). The blocks are connected by a parent block hash stored in the block header.
The block header may include three parts of data, namely, a block number (block number), a current block hash (current block hash), and a parent block hash (previous block header hash). The block number is: the first block of each chain is called a Genesis block (Genesis block), the blocks of which are numbered 0 and the following blocks are numbered incrementally. The current block hash is: performing hash operation on all transaction contents in the block by using the current block hash, and storing the hash operation in a block header; it should be noted that storing data by means of a hash function not only enables compression of data but also guarantees non-tamper-ability of data. The nature of the hash function makes the gap between the output summary information even with slightly different raw information. Therefore, if a malicious user slightly changes a certain transaction in the block, the change is obviously reflected on the hash value. Parent block hashing: and after the block header of the parent block is subjected to hash operation, storing the obtained hash value in the current block header. The block chain realizes the connection between the blocks by the above mode.
The block data is mainly ordered transaction contents, and each transaction mainly comprises a transaction header (header), a signature (signature), proposal contents (proposal), a response (response) and endorsement information (endorsings). Wherein, the transaction head: mainly some basic information about the transaction, such as the name of the execution chain code (chaincode) and the corresponding version number (version). Signature: the signature is identification information signed by a secret key when a user initiates a transaction, and only a private key unique to the user can be generated, so that the signature can be used for identity verification. The proposal content is as follows: the proposal content is to encode the input parameters of the user into the intelligent contract so as to create the update of the ledger; when the user applies for calling the intelligent contract, the proposal provides a series of necessary input parameters, and can generate a new ledger state by combining the world state. Responding: as an output of the intelligent contract, when the transaction verification is successfully executed without error, it can be directly used for updating the world state. Endorsement information: the transaction initiated by the terminal needs to be approved by one or more endorsement nodes according to an endorsement policy, and if the endorsement nodes endorse the transaction, a message with a signature is returned to the user; and the user node collects all endorsement information returned by the endorsement node and writes the endorsement information into transaction content.
The metadata includes a digital certificate and creator information of the block, and the block verification node writes a valid/invalid judgment field of a transaction included in the block into a metadata field. Notably, the chunk hash only computes all transaction content, not including the metadata portion.
Next, various types of nodes in the blockchain network will be described.
It should be noted that the roles in the power market mainly include: a producer, a supplier, an electricity market operator (including transportation and system operators, distribution system operators, electricity traders, etc.), an end customer, etc. For simplicity, whether it is the end customer or the producer or supplier, it can be classified as a node in the grid blockchain, each type of node differing in the application it needs to invoke. The electricity market operator, whichever function is performed, may act as the manager of the blockchain network. Specifically, in this embodiment, the nodes in the power grid blockchain may be mainly classified into the following categories:
1. light nodes (light nodes)
The terminal device is a light node (light nodes) in the block chain network and can also be directly called as a user node (client nodes), the common terminal device does not have enough computing power and a storage unit for supporting the block chain network, the block data is not stored, but the intelligent contract can be called to the connected endorsement node.
2. Peer node (peer nodes)
Nodes participating in the maintenance of block ledger data may be referred to as peer nodes (peers). Peer nodes are one of the fundamental components of a blockchain network, they possess a copy of the chunk data, and are the carrier of the intelligent contract. Peer nodes can be divided into endorsement nodes, verification nodes and anchor nodes according to the functions performed by the peer nodes:
1) endorsement node (conducting peer)
The endorsement node is mainly responsible for responding to the application of the intelligent contract called by the terminal equipment. The endorsement node will only respond to user nodes that are within its coverage and have access rights. Different organizations may deploy respective endorsement nodes, while there may be multiple endorsement nodes within an organization. When the terminal equipment applies for calling the intelligent contract, the endorsement node corresponding to the endorsement organization can be selected according to the endorsement strategy. The endorsement policy is defined by an endorsement organization for different intelligent contracts when the nodes are deployed. The specific functions of the endorsement node include:
(1) and deploying the intelligent contract, wherein the terminal equipment is connected with the endorsement node to call the intelligent contract deployed on the endorsement node. The method comprises the following steps that authority limit is called, an endorsement node maintains a related authority list (the list content can be an approved certificate authority or a trusted organization list), the endorsement node judges the authority of a connected user by verifying a digital certificate of the user, and only the user meeting the authority requirement can call an intelligent contract of the user, such as inquiry of block data, initiation of electric power transaction and the like;
(2) realizing an endorsement policy (endorsement policy), wherein a series of endorsement nodes are required for signing when a terminal device initiates a transaction, the endorsement nodes receive a transaction application initiated by the terminal device, simulate the transaction on the nodes, and return feedback information with the signature if the transaction application is correct;
(3) endorsements responsible for a particular type of transaction: channel configuration transactions (channel configuration transactions). The network operator, i.e. the manager of the tunnel, changes the configuration of the tunnel by initiating a tunnel configuration transaction. Similar to other transactions, the endorsement node verifies the authority of the transaction initiator, and if the authority is confirmed to be correct, the transaction is processed according to a normal transaction flow: and confirming whether the initiator of the transaction has the related authority, and packaging and adding the configured transaction into the block after confirming that the configured transaction is correct. The configuration information is information which is consistent with negotiation for all members and comprises a fixed strategy, an access control list and other related information; the channel configuration transaction is set to realize flexible configuration of the intelligent power grid block chain.
2) Verification node (Validating peer)
The verification node is a randomly selected node for verifying the validity of the new block transaction. And after the anchor node forwards the new blocks to be verified, which are sequenced by the sequencing node, to the verification node, the verification node judges the transaction validity in the blocks. And the nodes write the validity/invalidity into the metadata of the block, all verification nodes independently verify the transaction validity, carry out signature after verification is finished, and send the verified block to all peer nodes.
3) Anchor node (Anchor peer)
The anchor node is mainly used for cross organization/channel communication, and if a peer node of a certain organization needs to communicate with peer nodes of other organizations, the peer node can pass through the anchor node. An organization may define zero or more anchor nodes as desired.
3. Sequencing node (Ordering nodes)
Different from the peer nodes which deploy the intelligent contracts, some special nodes which do not deploy the intelligent contracts and do not judge the transaction contents of the users can be called as sequencing nodes.
The sequencing node mainly provides sequencing service, the terminal device sends the transaction signed by the endorsement node to the corresponding sequencing node, and the sequencing node packages the received transaction according to the sequence and the block-out speed defined by the consensus mechanism. The number and position of the sequencing nodes are more centralized than the endorsement nodes are closer to the terminal equipment.
So far, the above node types have been introduced. It should also be introduced that the above-mentioned smart contract (smart contract) defines transaction rules recognized between different organizations through executable code, and a user initiates a transaction by calling the smart contract deployed on a node, and the generated transaction is recorded in a blockchain. The programmability of smart contracts opens up many new possibilities for business transactions. Organizations may design intelligent contracts that meet business needs as needed. Meanwhile, the intelligent contract can be automatically executed, and is more efficient and labor-saving than a manual commercial transaction process. The intelligent contract management transaction chain code (chain code) may manage the intelligent contract in the following manner: multiple intelligent contracts can be defined in the same chain code, and all intelligent contract endorsement policies in the same chain code are the same.
It should be noted that, in this embodiment, according to the node function and the corresponding authority, in the intelligent power grid block chain network, all peer nodes may be deployed and managed by a power grid operator; the sorting node which does not need the authority and can not modify the block content can be used as the edge server. The following describes how to implement the power transaction method by using endorsement nodes, a sorting node with an edge server node as a peer node in a blockchain network.
The technical solution of the embodiments of the present invention is described in detail below with reference to the accompanying drawings.
Referring to fig. 3, a power transaction method based on a blockchain technology in an embodiment of the present invention is shown, where the method is applied to a blockchain network in a power transaction system based on a blockchain technology, where the blockchain network includes endorsement nodes, edge server nodes, and peer nodes, where an edge server node in all the edge server nodes is a sorting node, and the method includes:
s301: the endorsement node receives an electric power transaction request sent by the terminal equipment and returns an electric power transaction option corresponding to the electric power transaction request to the terminal equipment, so that the terminal equipment determines a target electric power transaction according to the electric power transaction option.
In this embodiment, when a user needs to perform a power transaction, for example, a power transaction such as purchasing power, the user may send a power transaction request to an endorsement node where an intelligent contract is deployed through a terminal device. Wherein the power transaction request can comprise request transaction data of power transaction required by a user and a user digital certificate of the terminal device; the request transaction data may be understood as parameter data required in the power transaction, such as required amount of power, maximum amount of power quote, etc.; and the user digital certificate of the terminal device may be understood as a verification digital certificate for determining the rights of the terminal device.
Next, the authentication digital certificate of the terminal device will be described in detail. The identity of a user node (i.e. a terminal device) in a power grid has complexity, for example, the identity of the user node may be a common user, a production sales user, or a power trader node, etc., and power selling is different from other users, so that the near consumption of power is required to be realized as far as possible, the transmission consumption is reduced, and power in different areas may be charged by different power distributors. The identities of different participants (i.e. different terminal devices) can be identified in the intelligent grid blockchain network by verifying digital certificates (digital certificates). The authentication digital certificate is issued by a Certificate Authority (CA) that is authorized by the consortium. The verification digital certificate can contain identity attribute information of a user corresponding to the terminal equipment, and meanwhile, the public key and the digital certificate can be distributed together and information is disclosed in the blockchain network. The certificate authority may bind the participant's certificate and public key by way of a signature. That is, verifying the digital certificate determines the access rights of different roles to resources and information in the blockchain network. The identity information of a participant in the blockchain network includes not only an identity ID, but also an organization subordinate to the participant, a specific organization unit (such as a department), a role played in the organization, whether a special identity exists, and the like. Member Service Providers (MSPs) define which certificate authorities are active, wherein different certificate authorities may issue certificates of different rights, and the MSPs are likewise capable of identifying in which channels the certificates issued by them are in particular active; the MSP not only lists the active members of the network or channel, but also identifies the specific identities of the different device terminals in the corresponding organization, such as administrator identities, sub-organizers, etc. At the same time, verifying the digital certificate may also support identifying a list of identities that have been discarded. Wherein, MSP can be divided into local MSP and channel MSP: the local MSP defines management and participation authorities for the nodes, for example, the peer nodes are managed by which corresponding organization, and the equipment terminals belonging to which organization can call intelligent contracts on the endorsement nodes; the channel MSP realizes the authority management of the channel, each organization in the channel must be included in the channel MSP to realize the legal identity of the organization members (namely, each user terminal), and each peer node and sequencing node in the channel store the duplicate file of the channel MSP to ensure the realization of the consensus mechanism. The MSP at the local level handles private resource and identity management, while the channel or network level focuses more on network management. An organization may have a corresponding MSP, or may include multiple MSPs according to business needs. For example, an electric network operator in a certain area is responsible for assigning an approved certificate authority to all equipment terminals in the coverage area, and only a certificate issued by the assigned certificate authority has authority to join an electric network block chain in which the operator is responsible for operation; and the roles of the edge servers are uniformly set and managed according to the MSP file. The identity strategy ensures the reasonable and legal existence of different roles in the network, simultaneously limits the roles and the authorities of different physical entities, effectively maintains the operation of the network and simultaneously improves the safety of the network.
In this embodiment, after receiving the power transaction request sent by the terminal device, the endorsement node may return a power transaction option corresponding to the power transaction request to the terminal device, so that the terminal device determines the target power transaction according to the power transaction option.
In an implementation manner, the block chain network stores an authority database, where the authority database stores authority information of a trusted terminal, and it can be understood that, if the authority information of a device terminal is in the authority database, it can be said that the terminal device is a trusted terminal in the block chain network. As shown in fig. 4, the endorsement node may first receive a power transaction request sent for the terminal device, where the power transaction request includes a user digital certificate of the terminal device and request transaction data. Then, the endorsement node may determine the authority information of the terminal device according to the user digital certificate of the terminal device. Then, the endorsement node may determine whether the terminal device is a trusted terminal according to the permission information of the terminal device and the permission database, for example, when the permission information identical to the permission information of the terminal device is stored in the permission database, the terminal device may be considered as a trusted terminal, otherwise, if the permission information identical to the permission information of the terminal device is not stored in the permission database, the terminal device may be considered as a trusted terminal, and at this time, the endorsement node directly returns rejection information to the terminal device. Then, if the terminal device is a trusted terminal, the endorsement node may determine an electric power transaction option corresponding to the electric power transaction request according to the request transaction data, where the electric power transaction option includes a plurality of electric power transactions and a signature of the endorsement node, and it should be noted that, if the terminal device is a trusted terminal, the endorsement node may add the signature of the endorsement node to the electric power transaction option after determining the electric power transaction option corresponding to the electric power transaction request according to the request transaction data, so as to perform subsequent verification. Finally, the endorsement node may return the power transaction option to the terminal device, so that the terminal device determines a target power transaction according to the power transaction option, that is, selects one power transaction option from a plurality of power transactions of the power transaction option as the target power transaction, where the plurality of power transactions of the power transaction option include a power transaction matched with the power transaction request and other power transactions. After the terminal equipment determines the target power transaction, all endorsement nodes can independently simulate the transaction aiming at the target power transaction, and select whether to sign the target power transaction, namely the endorsement nodes determine whether to accept or refuse to endorse the transaction, and return the result of signing or not to the terminal equipment; it should be noted that the terminal device needs to wait for the feedback of all endorsement nodes, and if the endorsement selection node satisfies the endorsement policy (for example, the endorsement selection node satisfies more than half of the endorsement selection nodes) in all feedback results, the terminal device can continue the transaction, and if not, the transaction is invalid, and the transaction fails; if the terminal device can continue to trade, the terminal device can send the collected feedback of all endorsement nodes to the corresponding edge server node.
Next, as illustrated in fig. 5, it is assumed that a user sends a power transaction request to an endorsement node connected thereto and deploying a smart contract, through a terminal device, where the power transaction request includes a highest price quote and a required power amount input or selected by the user. After receiving the electric power transaction request, the endorsement node may determine authority information of the terminal device according to the user digital certificate of the terminal device, and determine whether the terminal device is a trusted terminal according to the authority information of the terminal device and the authority database, for example, the endorsement node may verify whether the user digital certificate of the terminal device has an authority to invoke the intelligent contract according to a local MSP file by the endorsement node according to a local MSP file; if the terminal device is a trusted terminal, that is, the terminal device has an authority to invoke an intelligent contract, the endorsement node may determine an electric power transaction option corresponding to the electric power transaction request according to the request transaction data, for example, the endorsement node queries an electric power selling condition of the current electric power market, including information of the existing electric power selling user, the electric power selling price, the electric power selling amount and the like, according to the query result and parameters (highest price and required electric quantity) in the electric power transaction request, and determines an electric power transaction scheme (that is, electric power transaction) matched with the parameters in the electric power transaction request; then, the endorsement node may return the power transaction option (i.e., the power transaction matching the power transaction request and other power transactions) to the terminal device, so that the terminal device may determine a target power transaction according to the power transaction option, and send the target power transaction to the edge server node, for example, the endorsement node outputs a query result list and the power transaction option matching a parameter in the power transaction request to the terminal device, and the user may select the endorsement node to output the power transaction through the terminal device, or may select another power vendor (i.e., other power transactions) in the query result, determine the power vendor, i.e., input a quote after determining the target power transaction, and initiate the power transaction. After the terminal equipment determines the power selling party, all endorsement nodes can independently simulate transactions aiming at the power selling party, and select whether to sign the power transactions of the power selling party, namely the endorsement nodes determine whether to accept or refuse to endorse the transactions, and return the result of signing or not to the terminal equipment; it should be noted that the terminal device needs to wait for the feedback of all endorsement nodes, if the endorsement nodes selected from all feedback results need to satisfy more than half of the number of all endorsement nodes, the terminal device can continue to trade with the electricity seller, and if not, the trade is invalid, and the trade fails; if the terminal device can continue to transact with the electricity seller, the terminal device can send the collected feedback of all endorsement nodes to the corresponding edge server node.
S302: and the sequencing node receives the target power transaction and generates a target block according to the transaction data corresponding to the target power transaction.
In this embodiment, since the sequencing service is provided by an edge server deployed by a non-operator, and when the edge server contributes computing power and a storage unit, the edge server only packages transactions in the network, stores the ledger data, but does not verify transaction contents, and does not involve change of block contents, the transaction can be completed even if the edge server is not authorized, and transaction execution and verification functions requiring authority are executed by power grid deployment nodes (such as a peer node and an endorsement node). In this way, one of all the edge server nodes may be a sorting node, and the blockchain network in this embodiment may include an unauthorized edge server node, that is, the edge server is not authenticated in this embodiment. That is, the nodes in the blockchain network may be divided into unauthorized edge server nodes and authenticated grid deployed nodes (such as peer nodes and endorsement nodes). It should be noted that, in the consensus mechanism of the conventional block chain, one node needs to be responsible for the whole process of transaction verification, sorting and packaging broadcast, and in the power grid block chain combined with edge calculation, the transaction uplink process in the conventional block chain is divided into three stages of transaction execution, verification and sorting, and tasks in the three stages are distributed to different nodes, so that parallel processing of transactions can be realized; therefore, the deployment and maintenance cost of the block chain network can be saved, the processing speed of network transaction can be improved by parallel processing, in addition, the coverage area of the power grid is wide, the cost of deploying all nodes independently is overhigh, the win-win situation of exchanging node resources with power can be realized by combining the edge server with the advantages of natural computing power and storage, and the purpose of reducing the cost is achieved.
Although the edge server node is not authenticated, the 'contribution degree' is defined as a weight for measuring the loyalty of the edge server from the network security consideration. In combination with the consideration of the actual market characteristics of the power grid transaction, the transaction amount has larger difference along with different time periods, and in combination with the design that the channel configuration in the Fabric can be changed by the configuration transaction, the parameters such as the block-out time and the block volume of the block can be modified according to the actual market transaction amount, so that the flexible scalability of the block is realized, and the network maintenance cost is reduced. Therefore, in this embodiment, one implementation manner of S302 may be: firstly, determining at least one edge server node as a sequencing node according to the contribution weight respectively corresponding to each edge server node; then, the sequencing node packages transaction data corresponding to the target power transaction to generate a target block, and broadcasts the target block to each peer node through each edge server node in the block chain network; wherein the target tile comprises a signature of the sorting node. It is emphasized that the peer nodes in the blockchain network are mainly deployed and authorized by the grid operator, and the identity of each peer node may be different, but all the block data is stored for transaction endorsement and block verification.
The edge server nodes form all sequencing nodes, and the sequencing nodes are only responsible for packaging the received transaction contents to generate a new block, so that the block contents cannot be changed. The fog nodes which actually execute the sorting task are selected according to the contribution degree and the random drawing method, and the number of the sorting nodes required by each round is determined by a network management role, namely a power grid operator. That is, the edge server nodes are all unauthenticated nodes; the step of determining at least one edge server node as a ranking node according to the contribution weight corresponding to each edge server node may include:
randomly drawing lots according to the contribution weights respectively corresponding to the edge server nodes, and taking the selected node subset as a sequencing node, wherein the sequencing node with the highest priority executes the step of packaging the transaction data corresponding to the target power transaction to generate a target block, and the target block is broadcasted to each peer node; wherein the target block further comprises a drawing result of the random drawing.
It should be noted that, in this implementation, all edge server nodes perform random drawing according to the contribution weights, and the selected node subset is referred to as a ranking node, where the edge server node with the highest priority may be used as the ranking node for performing the ranking task. In the traditional BFT algorithm, the selection result of leader is public for all nodes having voting right, thus increasing the possibility that the network is attacked by DoS. In SPoC, randomness is realized through a Verifiable Random Function (VRF), and fairness in the election process is realized through a linear superposition characteristic of binomial distribution. The VRF is similar to a random oracle, provided that the non-interactive zero knowledge proof, the ranking node can locally generate a random number and generate a corresponding zero knowledge proof. And other edge server nodes can verify the random number according to public information such as the random number, zero knowledge certificate and public key output by the terminal equipment. The drawing scheme is designed by combining the contribution degrees of the nodes, and the larger the contribution degree of the edge server node is, the larger the probability of being drawn is.
The Contribution (Contribution) is determined according to the computing power of the edge server node to the block chain and the proportion of the storage unit to all its resources, the number of tokens owned (i.e. the incentive obtained by the packet block or other measures after joining the network), and then the Contribution of the edge server node f can be expressed as:
Figure BDA0002625935400000191
wherein:
Figure BDA0002625935400000192
computing unit c of block chain network contributed by edge server nodefAnd a memory cell pfAccount for all its computing power CfAnd a memory cell PfSpecific gravity of (a);
Figure BDA0002625935400000193
mfindicating the number of tokens owned by the node, Mmax、MminAll edge server nodes are owned the most value of the token. The above items are comprehensively used for measuring the loyalty of the nodes to the block chain network, and the credibility of the nodes with higher values is higher.
And in the drawing process based on the VRF function, a subset of all the edge server nodes is randomly selected according to the weight of each edge server node. The whole process is realized, each edge server node independently carries out independent drawing in local, and any other equipment or node cannot know the drawing result before actively publishing and publishing the drawing result, namely, cannot know whether the edge server node is selected or not; after the edge server node publishes the drawing result, other nodes of the system can verify the drawing result by combining the public information, and the process does not need the private key information of the edge server node; the participating edge server nodes can only calculate the drawing result after the drawing starts, and cannot calculate in advance, so that the roles of the edge server nodes cannot be predicted in advance; the drawing process is completely fair; the probability of the edge server node being selected is in direct proportion to the contribution of the whole system, so that the Sybil attack can be resisted.
In addition, the channel manager comprehensively considers the security performance and the maintenance cost of the network, and can flexibly determine the number of the selected sequencing nodes. The mode that the block is generated by the sequencing node and copied to the following node greatly simplifies the accounting process; meanwhile, the security of the network is greatly improved in a VRF-based local drawing and signing mode, nobody can predict the next round of main sequencing node in advance, and the malicious node cannot lock an attack object in advance; and finally, the channel configuration is flexibly adjusted according to the network condition, so that the verification speed of the block is improved, and the bandwidth and the storage resource can be saved to the greatest extent.
It should be noted that, before the sorting node performs a packaging process on the transaction data corresponding to the target power transaction to generate a target block, and broadcasts the target block to each peer node through each edge server node in the block chain network, the method may further include:
and the sequencing node determines the block outlet time of the target block according to the transaction quantity, the preset minimum interval time and the preset maximum interval time.
In this embodiment, the channel manager may modify the out-blocking time of the target block through a channel configuration transaction (channel configuration). The block-out time can be determined according to the interval time between blocks, wherein the interval time needs to be dynamically adjusted according to the actual transaction situation of the electric power, the block-out interval time is shortened in the peak period of the transaction, the block-out interval time is prolonged in the valley period of the transaction, and the system resources are saved to the maximum extent under the condition that the pursuit of the user for the transaction confirmation speed is met. In an implementation manner, the block time may be determined by combining the actual transaction amount and the block time out interval [ minimum interval time (min _ interval), maximum interval time (max _ interval) ] set by the system, where an adjustment formula of the block time is as follows:
Figure BDA0002625935400000201
wherein block _ interval is the block-out time of the target block, min _ interval is the minimum interval time, max _ interval is the maximum interval time, and transaction _ num is the transaction number. Therefore, in the embodiment, a scalable mechanism is provided, and the scalable mechanism can dynamically adjust the block output time of the target block according to the real-time transaction quantity, so that system resources are saved on the premise of meeting the transaction confirmation timeliness.
Correspondingly, the step of the sorting node performing packaging processing on the transaction data corresponding to the target power transaction to generate a target block, and broadcasting the target block to each peer node through each edge server node in the block chain network includes:
when a preset block condition is met, the sequencing node packs transaction data corresponding to the target power transaction to generate a target block, and broadcasts the target block to each peer node through each edge server node in the block chain network;
wherein the block discharging condition comprises: the block-out time of the target block is reached, or the block-out time of the target block is reached, and the loop ratio of the block-out time interval between the target block and the previous block is greater than the noise tolerance
In view of stability, the block extraction time does not need to be changed every time a new target block is generated. The channel management organization involved in the channel requires a predetermined noise margin. As shown in the following formula (1), the manager will configure the transaction by initiating the channel only if the loop ratio of the inter-block time between the target block and the previous block adjacent to the target block is greater than the noise tolerance,
Figure BDA0002625935400000211
wherein the content of the first and second substances,
Figure BDA0002625935400000212
block _ interval, which is the ring ratio of the inter-block time of the target block and the previous block adjacent to the target blocknewBlock _ interval, the block out time of the target blockoldIs the block out time of the previous block adjacent to the target block. It should be noted that the change information for the block, such as the channel allocation transaction, is generated by the channel allocation transaction in a unified manner. And the corresponding endorsement node verifies the transaction, and after the transaction is confirmed to be correct, the sequencing node generates a new block according to new interval time.
It should be noted that, the determination process that the loop ratio of the block-out time interval between the target block and the previous block is greater than the noise margin may be: the time interval between the block output time of the target block and the block output time of the previous block can be determined, then the time interval is used as the block output time interval between the target block and the previous block, and then the ring ratio of the block output time interval is judged to be larger than the noise tolerance.
It should be further emphasized that, after the sorting node generates the target block, the sorting node may send the target block to the edge server nodes in all the block chain networks, and after the other edge server nodes verify the target block, the other edge server nodes send response signals to the sorting node, where the response signals include verification results of the other edge server nodes on the target block, and only after the verification results of the edge server nodes greater than or equal to the preset number are valid, the target block is forwarded to the peer node by the sorting node, which may be referred to as a secondary handshake process.
S303: and the peer node verifies the target block, and if the target block passes the verification, the peer node updates the target block to an account book of the block chain network.
In this embodiment, after acquiring the target block, each peer node may verify the acquired target block, and if the target block passes the verification, the peer node may update the target block to the account book of the blockchain network.
In one implementation, each peer node may include an anchor node and a verification node; the peer node verifying the target block, and if the target block passes the verification, updating the target block to an account book of the blockchain network, which may include the following steps:
step a: for each peer node, the anchor node of the peer node receives the target block sent by its corresponding edge server node, and forwards the target block to the verification node of the peer node.
Step b: and the verification node determines the transaction validity result of the target block and respectively sends the transaction validity result and the signature of the verification node to other peer nodes.
Step c: and if the number of the transaction validity results obtained by the peer node is greater than or equal to the preset number, determining that the target block passes verification, and updating the target block to an account book of the block chain network.
As shown in fig. 4 and 6, the verified target block is broadcast by each sorting node (i.e., edge server node) and forwarded to the anchor node in the peer nodes of different organizations, the anchor node is responsible for communication between organizations or between peer nodes and edge server nodes, and the anchor node may be responsible for forwarding all peer nodes within an organization by the target block. After receiving the target block, a verification node in the peer-to-peer nodes verifies the transaction validity of the target block and determines the transaction validity result of the target block, and in one mode, the verification node can extract and extract the transaction validity result according to the signature of the sequencing node of the target blockSigning results, user digital certificates, signatures of endorsement nodes, determining transaction validity results of the target blocks, for example, a way of verifying the target blocks by a verification node performing a verification function includes: a) checking the identity of the sequencing node, wherein the checking comprises the signature, the drawing result and the certification information of the sequencing node
Figure BDA0002625935400000221
Checking; b) and (3) transaction verification is carried out in the target block: whether the user digital certificate is valid, whether the endorsement signature meets the endorsement policy requirement and whether the transaction content is valid. After the validation node finishes the validity/invalidity judgment of all transactions in the target block, namely after the transaction validity result of the target block is determined, the transaction validity result of the target block is stored in the metadata of the block and added with the signature of the validation node, and then the validation node broadcasts the target block comprising the signature of the validation node and the transaction validity result of the target block to all peer nodes:<propose,block,sig>. If the number of the transaction validity results obtained by the peer node is greater than or equal to the preset number, determining that the target block passes verification, and updating the target block to an account book of the block chain network; for example, after receiving the target block sent by the verifying node, the peer node may verify the signature of the verifying node in the target block, and if the peer node receives block information broadcast by more than 2/3 verifying nodes and the signatures are verified to be correct, the peer node links the target block. The verification nodes are initially randomly determined by a power grid operator, then randomly elected and generated after fixed blocks are spaced, and the number and the alternation time are determined by network management personnel; specifically, the verification node is obtained by each round of random election, and the validity of a target block can be acknowledged by other peer nodes only after the signature of at least 2/3 verification nodes is obtained.
As can be seen from the above description, the power transaction method based on the blockchain technology provided in one or more embodiments of the present specification may be applied to a blockchain network in a power transaction system based on the blockchain technology, where the blockchain network includes endorsement nodes, edge server nodes, and peer nodes, where an edge server node of all the edge server nodes is a sorting node; the endorsement node receives an electric power transaction request sent by the terminal equipment and returns an electric power transaction option corresponding to the electric power transaction request to the terminal equipment, so that the terminal equipment determines a target electric power transaction according to the electric power transaction option; 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 peer node verifies the target block, and if the target block passes the verification, the peer node updates the target block to an account book of the block chain network. Therefore, because the edge server in the edge computing network is close to the terminal equipment and can provide natural computing power and storage unit support for the maintenance of the network, the invention combines the block chain of the power grid and the edge computing network, and takes the edge server as one part of the block chain nodes, thereby reducing the deployment cost of the network. In addition, the invention divides the transaction chain-linking process into three stages of transaction endorsement, sequencing and verification, and different nodes play different roles, thereby realizing the parallel processing of the electric power transaction and improving the transaction speed of the electric power transaction. In addition, only authorized nodes in the blockchain network can join the network and modify the data, so that the privacy of the data can be ensured. In summary, the power transaction method based on the blockchain technology provided by the invention can reduce the cost of the blockchain network on the premise of ensuring the privacy of data and the transaction speed.
It should be noted that, in an implementation manner, after the S303, the method may further include: and if the target block is updated to the account book of the block chain network, the sequencing node with the highest priority obtains the block same as the target block.
In this embodiment, the target block that the sorting node can generate in its own period will be broadcast to the entire network, and if the block is successfully uplink-linked, the sorting node will get the same block reward, i.e. the same block as the target block; the following node is not responsible for packaging the transaction content and passively receives the block data transmitted by the sequencing node. That is, if the target tile is verified and successfully linked, the edge server node that completed the sorting task (i.e., the sorting node) will receive the corresponding tile prize.
Specifically, the types of nodes in the intelligent power grid block chain network are different, and the organizations to which the nodes belong are also different. The light nodes, or clients, are mainly common users of the power grid, including two roles of consumers and production consumers, and the nodes of the type automatically join the network by installing the smart power grid and initiate transactions through the connected endorsement nodes. The electric network operator deploys all endorsement nodes, and the endorsement nodes are responsible for verification of transactions and block verification. And the sequencing node is divided into two parts: most of the edge servers are not authenticated, and the edge servers exchange power resources by contributing computing power and a storage unit. The incentive mechanism of the block chain network mainly refers to block reward, and each time a target block is packed by a sorting node obtained by random drawing, a quota of block reward can be obtained. All incentives can be implemented as tokens (tokens) in a blockchain that can be used to purchase power resources, to some extent, to meet the power needs of the server. That is, in the present embodiment, under the condition that different authority nodes exist in the blockchain network is fully considered, the common identification mechanism divides the transaction uplink process into three stages of transaction endorsement, sorting and verification, and different nodes complete different tasks in the process, so that parallel processing of transactions is realized; unauthorized edge server nodes only provide computing power and storage units, and have no change authority on block data, so that the safety of the block chain network is ensured; in addition, the node plays a role in the block chain network and is not fixed, and the sequencing node carries out random encryption election by an unauthorized node according to the contribution degree to the network and the verification node according to the calculation power so as to enhance the network robustness; and the scalable mechanism dynamically adjusts the block output time according to the real-time transaction quantity, and saves system resources on the premise of meeting the transaction confirmation timeliness.
In an implementation manner of this embodiment, after S303, the method may further include:
and the peer node feeds back the uplink notification aiming at the target power transaction to the terminal equipment through the endorsement node.
After the peer node links the target block, the peer node may feed back a linked notification for the target power transaction to a terminal device connected to the peer node through the endorsement node, so as to notify a user that the transaction is linked in effect.
In fig. 2, ('c-c') are respectively represented as:
firstly, a user initiates a transaction by calling an intelligent contract deployed in a corresponding endorsement node based on terminal equipment, and the transaction content needs to be sent to all endorsement nodes specified in an endorsement strategy;
the endorsement node independently simulates the transaction, signs after no error, and returns the transaction after endorsement to the terminal equipment;
the terminal equipment collects all endorsement node feedbacks and sends the transaction meeting the endorsement policy (endsegment policy) to the edge server node;
transmitting the to-be-linked transaction in the edge server node, and carrying out local drawing, election and sequencing by the edge server node; the node which successfully draws the label, namely the sequencing node, packages the transaction content in the interval time and adds the identity information (namely the signature) of the sequencing node and the drawing result;
the sequencing node sends the target block to all edge server nodes;
after most edge server nodes receive the target block, verify the identity of the sequencing node and respond, the target block is valid and is sent to the anchor nodes connected with the edge server nodes, and the anchor nodes synchronize the block to other peer nodes in the organization;
and seventhly, verifying the transaction content in the new block by a verification node in the peer node, and updating the block into the account book after no error exists.
It should be further noted that, in the present embodiment, there are multiple types of nodes in the blockchain network: the identities of the endorsement node, the verification node, the anchor node and other peer nodes with different functions, the edge server node, the sequencing node and the management node of the channel or the network have corresponding physical entities, and the roles are separated logically, but in practice, one physical entity may simultaneously assume a plurality of roles, that is, one terminal or server may simultaneously serve as at least one of the endorsement node, the verification node, the anchor node, the edge server node, the sequencing node and the management node of the channel or the network.
It is also emphasized that the federation chain is open only to organizations or members whose identities are approved, and its channel structure enables even competing organizations to coexist in the same blockchain network, while ensuring privacy of transaction information. All data on the channel, including transaction information, member information, and channel information, is not visible to any network user without permission.
In addition to the channel mechanism, in this embodiment, for the organization subset in the same channel, the Fabric provides a private data collection (private data collection) function, which allows the organization subset to encrypt the transaction data without creating a new channel. The encrypted data is no longer transmitted through the sequencing node but through the gossip protocol in the authorized peer node. The data of the chain is the hash value of the encrypted data, and the nodes with the corresponding data and the key can endorse and verify the encrypted transaction, so that the privacy of the data is ensured, and the non-tamper-proof property of the encrypted transaction after verification is also ensured. The private data set provides a method for encrypted transmission of information under the condition of reducing the overhead of creating a channel and maintaining the channel.
In this embodiment, corresponding to the above power transaction method based on the blockchain technology, the present invention further provides a power transaction system based on the blockchain technology for power transaction, where the power transaction system based on the blockchain technology includes a plurality of terminal devices and a blockchain network, where the blockchain network includes endorsement nodes, edge server nodes, and peer nodes, and an edge server node of all the edge server nodes is a sorting node;
the terminal equipment is used for responding to a power transaction request sent by a request sending instruction to an endorsement node in the block chain network;
the endorsement node in the block chain network is used for receiving the power transaction request sent by the terminal equipment and returning a power transaction option corresponding to the power transaction request to the terminal equipment, so that the terminal equipment determines a target power transaction according to the power transaction option;
the sorting node in the block chain network is used for receiving the target electric power transaction and generating a target block according to the transaction data corresponding to the target electric power transaction;
and the peer node in the block chain network is used for verifying the target block, and updating the target block to an account book of the block chain network if the target block passes verification.
Wherein the block chain network stores a permission database; the authority database stores authority information of a trusted terminal; the endorsement node receives an electric power transaction request sent by the terminal equipment and returns an electric power transaction option corresponding to the electric power transaction request to the terminal equipment, so that the terminal equipment determines a target electric power transaction according to the electric power transaction option, and the method comprises the following steps:
the endorsement node receives a power transaction request sent by aiming at the terminal equipment, wherein the power transaction request comprises a user digital certificate of the terminal equipment and request transaction data;
the endorsement node determines the authority information of the terminal equipment according to the user digital certificate of the terminal equipment;
the endorsement node judges whether the terminal equipment is a trusted terminal or not according to the authority information of the terminal equipment and the authority database;
if the terminal equipment is a trusted terminal, the endorsement node determines an electric power transaction option corresponding to the electric power transaction request according to the request transaction data; wherein the power transaction options include a number of power transactions and signatures of the endorsement nodes;
and the endorsement node returns the power transaction option to the terminal equipment, so that the terminal equipment determines a target power transaction according to the power transaction option and sends the target power transaction to the edge server node.
The sequencing node receives the target power transaction and generates a target block according to the transaction data corresponding to the target power transaction, wherein the target block comprises
Determining at least one edge server node as a sequencing node according to the contribution weight respectively corresponding to each edge server node;
the sequencing node packs transaction data corresponding to the target power transaction to generate a target block, and broadcasts the target block to each peer node through each edge server node in the block chain network; wherein the target tile comprises a signature of the sorting node.
The edge server nodes are all unauthenticated nodes; determining at least one edge server node as a sequencing node according to the contribution weight corresponding to each edge server node, including:
randomly drawing lots according to the contribution weights respectively corresponding to the edge server nodes, and taking the selected node subset as a sequencing node, wherein the sequencing node with the highest priority executes the step of packaging the transaction data corresponding to the target power transaction to generate a target block, and the target block is broadcasted to each peer node; wherein the target block further comprises a drawing result of the random drawing;
the sequencing node is further specifically configured to: and if the target block is updated to the account book of the block chain network, the sequencing node with the highest priority obtains the block same as the target block.
The sequencing node is further specifically configured to: determining the block outlet time of the target block according to the transaction quantity, and the preset minimum interval time and the preset maximum interval time;
correspondingly, the sorting node is further specifically configured to: when a preset block condition is met, the sequencing node packs transaction data corresponding to the target power transaction to generate a target block, and broadcasts the target block to each peer node through each edge server node in the block chain network;
wherein the block discharging condition comprises: and reaching the block-out time of the target block, or reaching the block-out time of the target block, wherein the loop ratio of the block-out time interval between the target block and the previous block is greater than the noise tolerance.
Wherein the peer nodes comprise an anchor node and a verification node; the peer node is specifically configured to:
for each peer node, the anchor node of the peer node receives a target block sent by the corresponding edge server node of the peer node, and forwards the target block to a verification node of the peer node;
the verification node determines a transaction validity result of the target block and sends the transaction validity result and the signature of the verification node to other peer nodes respectively;
and if the number of the transaction validity results obtained by the peer node is greater than or equal to the preset number, determining that the target block passes verification, and updating the target block to an account book of the block chain network.
Wherein the verifying node determines a transaction validity result of the target block, comprising:
and the verification node determines the transaction validity result of the target block according to the signature of the sequencing node of the target block, the drawing and signing result, the user digital certificate and the signature of the endorsement node.
Optionally, the peer node is further configured to: and the peer node feeds back the uplink notification aiming at the target power transaction to the terminal equipment through the endorsement node.
Corresponding to the above-mentioned power transaction method based on the blockchain technology, an embodiment of the present invention provides a power transaction apparatus based on the blockchain technology, the structure of which is shown in fig. 7, the apparatus is applied to a blockchain network in a power transaction system based on the blockchain technology, the blockchain network includes endorsement nodes, edge server nodes and peer nodes, wherein an edge server node of all the edge server nodes is a sorting node, the apparatus includes:
a sending unit 701, configured to control the endorsement node to receive an electric power transaction request sent for the terminal device, and return an electric power transaction option corresponding to the electric power transaction request to the terminal device, so that the terminal device determines a target electric power transaction according to the electric power transaction option;
a generating unit 702, configured to control the sorting node to receive, for the target power transaction, a target block according to transaction data corresponding to the target power transaction;
an updating unit 703 is configured to control the peer node to verify the target block, and update the target block to an account book of the blockchain network if the target block passes verification.
Optionally, the block chain network stores an authority database, where the authority database stores authority information of a trusted terminal; the sending unit 701 is specifically configured to:
the endorsement node receives a power transaction request sent by aiming at the terminal equipment, wherein the power transaction request comprises a user digital certificate of the terminal equipment and request transaction data;
the endorsement node determines the authority information of the terminal equipment according to the user digital certificate of the terminal equipment;
the endorsement node judges whether the terminal equipment is a trusted terminal or not according to the authority information of the terminal equipment and the authority database;
if the terminal equipment is a trusted terminal, the endorsement node determines an electric power transaction option corresponding to the electric power transaction request according to the request transaction data; wherein the power transaction options include a number of power transactions and signatures of the endorsement nodes;
and the endorsement node returns the power transaction option to the terminal equipment, so that the terminal equipment determines a target power transaction according to the power transaction option and sends the target power transaction to the edge server node.
Optionally, the generating unit 702 is specifically configured to:
determining at least one edge server node as a sequencing node according to the contribution weight respectively corresponding to each edge server node;
the sequencing node packs transaction data corresponding to the target power transaction to generate a target block, and broadcasts the target block to each peer node through each edge server node in the block chain network; wherein the target tile comprises a signature of the sorting node.
Optionally, the edge server nodes are all unauthenticated nodes; the generating unit 702 is specifically configured to:
randomly drawing lots according to the contribution weights respectively corresponding to the edge server nodes, and taking the selected node subset as a sequencing node, wherein the sequencing node with the highest priority executes the step of packaging the transaction data corresponding to the target power transaction to generate a target block, and the target block is broadcasted to each peer node; wherein the target block further comprises a drawing result of the random drawing;
the apparatus further comprises a reward unit for: and if the target block is updated to the account book of the block chain network, the sequencing node with the highest priority obtains the block same as the target block.
Optionally, the apparatus further includes a time determining unit, configured to:
the sequencing node determines the block outlet time of the target block according to the transaction quantity, the preset minimum interval time and the preset maximum interval time;
accordingly, the generating unit 702 is specifically configured to:
when a preset block condition is met, the sequencing node packs transaction data corresponding to the target power transaction to generate a target block, and broadcasts the target block to each peer node through each edge server node in the block chain network;
wherein the block discharging condition comprises: and reaching the block-out time of the target block, or reaching the block-out time of the target block, wherein the loop ratio of the block-out time interval between the target block and the previous block is greater than the noise tolerance.
Optionally, the peer nodes include an anchor node and a verification node; the updating unit 703 is specifically configured to:
for each peer node, the anchor node of the peer node receives a target block sent by the corresponding edge server node of the peer node, and forwards the target block to a verification node of the peer node;
the verification node determines a transaction validity result of the target block and sends the transaction validity result and the signature of the verification node to other peer nodes respectively;
and if the number of the transaction validity results obtained by the peer node is greater than or equal to the preset number, determining that the target block passes verification, and updating the target block to an account book of the block chain network.
Optionally, the updating unit 703 is specifically configured to:
and the verification node determines the transaction validity result of the target block according to the signature of the sequencing node of the target block, the drawing and signing result, the user digital certificate and the signature of the endorsement node.
Optionally, the apparatus further includes a feedback unit, configured to:
and the peer node feeds back the uplink notification aiming at the target power transaction to the terminal equipment through the endorsement node.
The technical carrier involved in payment in the embodiments of the present specification may include Near Field Communication (NFC), WIFI, 3G/4G/5G, POS machine card swiping technology, two-dimensional code scanning technology, barcode scanning technology, bluetooth, infrared, Short Message Service (SMS), Multimedia Message (MMS), and the like, for example.
The biometric features related to biometric identification in the embodiments of the present specification may include, for example, eye features, voice prints, fingerprints, palm prints, heart beats, pulse, chromosomes, DNA, human teeth bites, and the like. Wherein the eye pattern may include biological features of the iris, sclera, etc.
It should be noted that the method of one or more embodiments of the present disclosure may be performed by a single device, such as a computer or server. The method of the embodiment can also be applied to a distributed scene and completed by the mutual cooperation of a plurality of devices. In such a distributed scenario, one of the devices may perform only one or more steps of the method of one or more embodiments of the present disclosure, and the devices may interact with each other to complete the method.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
For convenience of description, the above devices are described as being divided into various modules by functions, and are described separately. Of course, the functionality of the modules may be implemented in the same one or more software and/or hardware implementations in implementing one or more embodiments of the present description.
The apparatus of the foregoing embodiment is used to implement the corresponding method in the foregoing embodiment, and has the beneficial effects of the corresponding method embodiment, which are not described herein again.
Fig. 8 is a schematic diagram illustrating a more specific hardware structure of an electronic device according to this embodiment, where the electronic device may include: a processor 1010, a memory 1020, an input/output interface 1030, a communication interface 1040, and a bus 1050. Wherein the processor 1010, memory 1020, input/output interface 1030, and communication interface 1040 are communicatively coupled to each other within the device via bus 1050.
The processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits, and is configured to execute related programs to implement the technical solutions provided in the embodiments of the present disclosure.
The Memory 1020 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, or the like. The memory 1020 may store an operating system and other application programs, and when the technical solution provided by the embodiments of the present specification is implemented by software or firmware, the relevant program codes are stored in the memory 1020 and called to be executed by the processor 1010.
The input/output interface 1030 is used for connecting an input/output module to input and output information. The i/o module may be configured as a component in a device (not shown) or may be external to the device to provide a corresponding function. The input devices may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices may include a display, a speaker, a vibrator, an indicator light, etc.
The communication interface 1040 is used for connecting a communication module (not shown in the drawings) to implement communication interaction between the present apparatus and other apparatuses. The communication module can realize communication in a wired mode (such as USB, network cable and the like) and also can realize communication in a wireless mode (such as mobile network, WIFI, Bluetooth and the like).
Bus 1050 includes a path that transfers information between various components of the device, such as processor 1010, memory 1020, input/output interface 1030, and communication interface 1040.
It should be noted that although the above-mentioned device only shows the processor 1010, the memory 1020, the input/output interface 1030, the communication interface 1040 and the bus 1050, in a specific implementation, the device may also include other components necessary for normal operation. In addition, those skilled in the art will appreciate that the above-described apparatus may also include only those components necessary to implement the embodiments of the present description, and not necessarily all of the components shown in the figures.
Computer-readable media of the present embodiments, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, is limited to these examples; within the spirit of the present disclosure, features from the above embodiments or from different embodiments may also be combined, steps may be implemented in any order, and there are many other variations of different aspects of one or more embodiments of the present description as described above, which are not provided in detail for the sake of brevity.
In addition, well-known power/ground connections to Integrated Circuit (IC) chips and other components may or may not be shown in the provided figures, for simplicity of illustration and discussion, and so as not to obscure one or more embodiments of the disclosure. Furthermore, devices may be shown in block diagram form in order to avoid obscuring the understanding of one or more embodiments of the present description, and this also takes into account the fact that specifics with respect to implementation of such block diagram devices are highly dependent upon the platform within which the one or more embodiments of the present description are to be implemented (i.e., specifics should be well within purview of one skilled in the art). Where specific details (e.g., circuits) are set forth in order to describe example embodiments of the disclosure, it should be apparent to one skilled in the art that one or more embodiments of the disclosure can be practiced without, or with variation of, these specific details. Accordingly, the description is to be regarded as illustrative instead of restrictive.
While the present disclosure has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those of ordinary skill in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic ram (dram)) may use the discussed embodiments.
It is intended that the one or more embodiments of the present specification embrace all such alternatives, modifications and variations as fall within the broad scope of the appended claims. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of one or more embodiments of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (10)

1. A power transaction method based on a blockchain technology is applied to a blockchain network in a power transaction system based on the blockchain technology, and the blockchain network comprises endorsement nodes, edge server nodes and peer nodes, wherein one edge server node in all the edge server nodes is a sequencing node, and the method comprises the following steps:
the endorsement node receives an electric power transaction request sent by the terminal equipment and returns an electric power transaction option corresponding to the electric power transaction request to the terminal equipment, so that the terminal equipment determines a target electric power transaction according to the electric power transaction option;
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 peer node verifies the target block, and if the target block passes the verification, the peer node updates the target block to an account book of the block chain network.
2. The electric power transaction method based on the block chain technology as claimed in claim 1, wherein the block chain network stores an authority database, wherein the authority database stores authority information of trusted terminals; the endorsement node receives an electric power transaction request sent by the terminal equipment and returns an electric power transaction option corresponding to the electric power transaction request to the terminal equipment, so that the terminal equipment determines a target electric power transaction according to the electric power transaction option, and the method comprises the following steps:
the endorsement node receives a power transaction request sent by aiming at the terminal equipment, wherein the power transaction request comprises a user digital certificate of the terminal equipment and request transaction data;
the endorsement node determines the authority information of the terminal equipment according to the user digital certificate of the terminal equipment;
the endorsement node judges whether the terminal equipment is a trusted terminal or not according to the authority information of the terminal equipment and the authority database;
if the terminal equipment is a trusted terminal, the endorsement node determines an electric power transaction option corresponding to the electric power transaction request according to the request transaction data; wherein the power transaction options include a number of power transactions and signatures of the endorsement nodes;
and the endorsement node returns the power transaction option to the terminal equipment, so that the terminal equipment determines a target power transaction according to the power transaction option and sends the target power transaction to the edge server node.
3. The power transaction method based on blockchain technology of claim 1, wherein the sorting node receives the target power transaction and generates a target block according to transaction data corresponding to the target power transaction, including
Determining at least one edge server node as a sequencing node according to the contribution weight respectively corresponding to each edge server node;
the sequencing node packs transaction data corresponding to the target power transaction to generate a target block, and broadcasts the target block to each peer node through each edge server node in the block chain network; wherein the target tile comprises a signature of the sorting node.
4. The power transaction method based on the blockchain technology of claim 3, wherein the edge server nodes are all unauthenticated nodes; determining at least one edge server node as a sequencing node according to the contribution weight corresponding to each edge server node, including:
randomly drawing lots according to the contribution weights respectively corresponding to the edge server nodes, and taking the selected node subset as a sequencing node, wherein the sequencing node with the highest priority executes the step of packaging the transaction data corresponding to the target power transaction to generate a target block, and the target block is broadcasted to each peer node; wherein the target block further comprises a drawing result of the random drawing;
the method further comprises the following steps: and if the target block is updated to the account book of the block chain network, the sequencing node with the highest priority obtains the block same as the target block.
5. The power transaction method based on the blockchain technology according to claim 3, wherein before the sorting node packages transaction data corresponding to the target power transaction to generate a target block, and broadcasts the target block to each peer node through each edge server node in the blockchain network, the method further comprises:
the sequencing node determines the block outlet time of the target block according to the transaction quantity, the preset minimum interval time and the preset maximum interval time;
correspondingly, the step of the sorting node performing packaging processing on the transaction data corresponding to the target power transaction to generate a target block, and broadcasting the target block to each peer node through each edge server node in the block chain network includes:
when a preset block condition is met, the sequencing node packs transaction data corresponding to the target power transaction to generate a target block, and broadcasts the target block to each peer node through each edge server node in the block chain network;
wherein the block discharging condition comprises: and reaching the block-out time of the target block, or reaching the block-out time of the target block, wherein the loop ratio of the block-out time interval between the target block and the previous block is greater than the noise tolerance.
6. The power transaction method based on blockchain technology of claim 5, wherein the peer nodes include an anchor node and a verification node; the peer node verifies the target block, and if the target block passes verification, the peer node updates the target block to an account book of the blockchain network, including:
for each peer node, the anchor node of the peer node receives a target block sent by the corresponding edge server node of the peer node, and forwards the target block to a verification node of the peer node;
the verification node determines a transaction validity result of the target block and sends the transaction validity result and the signature of the verification node to other peer nodes respectively;
and if the number of the transaction validity results obtained by the peer node is greater than or equal to the preset number, determining that the target block passes verification, and updating the target block to an account book of the block chain network.
7. The power transaction method based on blockchain technology as claimed in claim 6, wherein the verifying node determines the transaction validity result of the target block, comprising:
and the verification node determines the transaction validity result of the target block according to the signature of the sequencing node of the target block, the drawing and signing result, the user digital certificate and the signature of the endorsement node.
8. The method of claim 1, further comprising:
and the peer node feeds back the uplink notification aiming at the target power transaction to the terminal equipment through the endorsement node.
9. An electric power transaction device based on blockchain technology, which is applied to a blockchain network in an electric power transaction system based on blockchain technology, wherein the blockchain network comprises endorsement nodes, edge server nodes and peer nodes, wherein one edge server node in all the edge server nodes is a sequencing node, and the device comprises:
the sending unit is used for controlling the endorsement node to receive the power transaction request sent by the terminal equipment and returning a power transaction option corresponding to the power transaction request to the terminal equipment, so that the terminal equipment determines a target power transaction according to the power transaction option;
the generation unit is used for controlling the sequencing node to receive the target power transaction and generating a target block according to the transaction data corresponding to the target power transaction;
and the updating unit is used for controlling the peer node to verify the target block, and updating the target block to an account book of the block chain network if the target block passes the verification.
10. The electric power transaction system based on the blockchain technology is characterized by comprising a plurality of terminal devices and a blockchain network, wherein the blockchain network comprises endorsement nodes, edge server nodes and peer-to-peer nodes, and one edge server node in all the edge server nodes is a sequencing node;
the terminal equipment is used for responding to a power transaction request sent by a request sending instruction to an endorsement node in the block chain network;
the endorsement node in the block chain network is used for receiving the power transaction request sent by the terminal equipment and returning a power transaction option corresponding to the power transaction request to the terminal equipment, so that the terminal equipment determines a target power transaction according to the power transaction option;
the sorting node in the block chain network is used for receiving the target electric power transaction and generating a target block according to the transaction data corresponding to the target electric power transaction;
and the peer node in the block chain network is used for verifying the target block, and updating the target block to an account book of the block chain network if the target block passes verification.
CN202010796809.5A 2020-08-10 2020-08-10 Electric power transaction method, device and system based on block chain technology Pending CN112132682A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010796809.5A CN112132682A (en) 2020-08-10 2020-08-10 Electric power transaction method, device and system based on block chain technology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010796809.5A CN112132682A (en) 2020-08-10 2020-08-10 Electric power transaction method, device and system based on block chain technology

Publications (1)

Publication Number Publication Date
CN112132682A true CN112132682A (en) 2020-12-25

Family

ID=73851634

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010796809.5A Pending CN112132682A (en) 2020-08-10 2020-08-10 Electric power transaction method, device and system based on block chain technology

Country Status (1)

Country Link
CN (1) CN112132682A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112685789A (en) * 2021-03-12 2021-04-20 卓尔智联(武汉)研究院有限公司 Method and device for processing engineering cost data and alliance chain system
CN112995167A (en) * 2021-02-20 2021-06-18 国网冀北电力有限公司计量中心 Kafka mechanism-based power utilization information acquisition method, block chain network and user side
CN113034011A (en) * 2021-03-30 2021-06-25 广东电网有限责任公司 Power resource scheduling method and device, computer equipment and storage medium
CN113779607A (en) * 2021-09-16 2021-12-10 北京易华录信息技术股份有限公司 Industrial data asset management method, system and equipment
CN114202398A (en) * 2022-02-18 2022-03-18 深圳江行联加智能科技有限公司 Block chain-based power transaction method, device, equipment and storage medium
CN114338242A (en) * 2022-03-10 2022-04-12 广东省科技基础条件平台中心 Cross-domain single sign-on access method and system based on block chain technology
CN114745135A (en) * 2022-04-19 2022-07-12 西南石油大学 Block chain system for energy transaction based on V-raft consensus algorithm
CN114780968A (en) * 2022-06-23 2022-07-22 国网区块链科技(北京)有限公司 Intelligent contract upgrading method and device
CN114938706A (en) * 2022-01-28 2022-08-23 香港应用科技研究院有限公司 Method and equipment for data exchange between blockchain system and non-blockchain system
CN115115361A (en) * 2021-03-19 2022-09-27 富士通株式会社 Method and apparatus for processing blockchain transaction data and storage medium
CN117217848A (en) * 2023-11-08 2023-12-12 深圳海辰储能科技有限公司 Energy storage transaction method, device and storage medium
CN113779607B (en) * 2021-09-16 2024-06-07 北京易华录信息技术股份有限公司 Industrial data asset management method, system and equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109167763A (en) * 2018-08-16 2019-01-08 国网浙江省电力有限公司电力科学研究院 A kind of power industry electronic data security method and system based on block chain
CN109166037A (en) * 2018-07-25 2019-01-08 上海魅联信息技术有限公司 The common recognition method of block chain
CN110233868A (en) * 2019-04-20 2019-09-13 北京工业大学 A kind of edge calculations data safety and method for secret protection based on Fabric
CN111047319A (en) * 2019-09-03 2020-04-21 腾讯科技(深圳)有限公司 Transaction processing method of block chain network and block chain network
CN111106942A (en) * 2019-12-13 2020-05-05 南京邮电大学 Block chain credit mechanism based on AP-PBFT algorithm
CN111339550A (en) * 2020-02-01 2020-06-26 成都理工大学 Comment information credibility method based on block chain technology
CN111414373A (en) * 2020-03-18 2020-07-14 深圳市网心科技有限公司 Consensus method and consensus system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109166037A (en) * 2018-07-25 2019-01-08 上海魅联信息技术有限公司 The common recognition method of block chain
CN109167763A (en) * 2018-08-16 2019-01-08 国网浙江省电力有限公司电力科学研究院 A kind of power industry electronic data security method and system based on block chain
CN110233868A (en) * 2019-04-20 2019-09-13 北京工业大学 A kind of edge calculations data safety and method for secret protection based on Fabric
CN111047319A (en) * 2019-09-03 2020-04-21 腾讯科技(深圳)有限公司 Transaction processing method of block chain network and block chain network
CN111106942A (en) * 2019-12-13 2020-05-05 南京邮电大学 Block chain credit mechanism based on AP-PBFT algorithm
CN111339550A (en) * 2020-02-01 2020-06-26 成都理工大学 Comment information credibility method based on block chain technology
CN111414373A (en) * 2020-03-18 2020-07-14 深圳市网心科技有限公司 Consensus method and consensus system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
赵文婷;沈蒙;金智新;王盈森;李懿;: "区块链技术下的电力智能交易研究", 太原理工大学学报 *

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112995167A (en) * 2021-02-20 2021-06-18 国网冀北电力有限公司计量中心 Kafka mechanism-based power utilization information acquisition method, block chain network and user side
CN112995167B (en) * 2021-02-20 2023-05-26 国网冀北电力有限公司计量中心 Kafka mechanism-based electricity consumption information acquisition method, blockchain network and user terminal
CN112685789A (en) * 2021-03-12 2021-04-20 卓尔智联(武汉)研究院有限公司 Method and device for processing engineering cost data and alliance chain system
CN115115361A (en) * 2021-03-19 2022-09-27 富士通株式会社 Method and apparatus for processing blockchain transaction data and storage medium
CN113034011A (en) * 2021-03-30 2021-06-25 广东电网有限责任公司 Power resource scheduling method and device, computer equipment and storage medium
CN113779607A (en) * 2021-09-16 2021-12-10 北京易华录信息技术股份有限公司 Industrial data asset management method, system and equipment
CN113779607B (en) * 2021-09-16 2024-06-07 北京易华录信息技术股份有限公司 Industrial data asset management method, system and equipment
CN114938706A (en) * 2022-01-28 2022-08-23 香港应用科技研究院有限公司 Method and equipment for data exchange between blockchain system and non-blockchain system
CN114938706B (en) * 2022-01-28 2024-05-03 香港应用科技研究院有限公司 Method and apparatus for exchanging data between a blockchain system and a non-blockchain system
CN114202398A (en) * 2022-02-18 2022-03-18 深圳江行联加智能科技有限公司 Block chain-based power transaction method, device, equipment and storage medium
CN114338242A (en) * 2022-03-10 2022-04-12 广东省科技基础条件平台中心 Cross-domain single sign-on access method and system based on block chain technology
CN114745135A (en) * 2022-04-19 2022-07-12 西南石油大学 Block chain system for energy transaction based on V-raft consensus algorithm
CN114780968A (en) * 2022-06-23 2022-07-22 国网区块链科技(北京)有限公司 Intelligent contract upgrading method and device
CN117217848A (en) * 2023-11-08 2023-12-12 深圳海辰储能科技有限公司 Energy storage transaction method, device and storage medium
CN117217848B (en) * 2023-11-08 2024-01-26 深圳海辰储能科技有限公司 Energy storage transaction method, device and storage medium

Similar Documents

Publication Publication Date Title
CN112132682A (en) Electric power transaction method, device and system based on block chain technology
Zhu et al. Applications of distributed ledger technologies to the internet of things: A survey
CN109302415B (en) A kind of authentication method, block chain node and storage medium
Jesus et al. A survey of how to use blockchain to secure internet of things and the stalker attack
Shi et al. Blockchain‐based trusted data sharing among trusted stakeholders in IoT
Maroufi et al. On the convergence of blockchain and internet of things (iot) technologies
Salimitari et al. A survey on consensus methods in blockchain for resource-constrained IoT networks
Yeow et al. Decentralized consensus for edge-centric internet of things: A review, taxonomy, and research issues
Miraz Blockchain of things (BCoT): The fusion of blockchain and IoT technologies
Chen et al. Secure electricity trading and incentive contract model for electric vehicle based on energy blockchain
TWI717927B (en) Hybrid blockchain architecture with computing pool
CN110537346A (en) Safe decentralization domain name system
Ferrer-Gomila et al. A fair contract signing protocol with blockchain support
Hamdaoui et al. IoTShare: A blockchain-enabled IoT resource sharing on-demand protocol for smart city situation-awareness applications
Pradhan et al. A flexible permission ascription (FPA)-based blockchain framework for peer-to-peer energy trading with performance evaluation
Zafar et al. Integration of blockchain and Internet of Things: Challenges and solutions
Cao et al. Blockchain-empowered security and privacy protection technologies for smart grid
Dasu et al. Unchain your blockchain
Javed et al. Distributed ledger technologies for network slicing: A survey
Ghiro et al. Proof of networking: Can blockchains boost the next generation of distributed networks?
Gu et al. Autonomous resource request transaction framework based on blockchain in social network
Kumar et al. Front-End IoT application for the bitcoin based on proof of elapsed time (PoET)
Reyana et al. Blockchain for internet of things i
Dorri A scalable lightweight blockchain-based framework for IoT security and anonymity
Kumari et al. Design model for energy trading 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