A method for electricity spot market trading based on blockchain technology

CN116797229BActive Publication Date: 2026-08-11国网河北省电力有限公司营销服务中心 +2
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-19
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

现实情况中售电公司为了谋求更高利益或用户在签约之后考虑降低成本会导致实际交易额和合同交易额不同,从而可能导致出现违约风险

Benefits of technology

[0041]本申请实施例,在PBFT共识机制的基础上,整个交易过程中都是通过各方的共识和智能合约进行验证的,从而可以看到交易的完整痕迹,不会被篡改;同时对违约交易者增加了等待时间,通过给违约交易者分配不同的属性,使其在电力交易中受到一定的限制,有效应对了由于违约所带来的风险问题;在应对现货价格波动上,通过将参与者主观风险偏好考虑到拍卖阶段过程中,能够有效防止价格波动过大。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116797229B_ABST
    Figure CN116797229B_ABST
Patent Text Reader

Abstract

This application relates to the field of electricity market trading technology and provides a method for electricity spot market trading based on blockchain technology. The method includes: trader i sending an order for purchasing or selling electricity to a node; based on the PBFT consensus mechanism adopted by the electricity trading blockchain platform, the regulator selects an endorsement node and a sorting node for the order information; the endorsement node queries trader i's previous transaction record to determine the additional waiting time added to the order information in this transaction; based on the trading rules and the subjective risk preferences of trader i and trader j, a transaction order is formed, and a transaction contract is generated; the endorsement node verifies the transaction information based on the smart contract and settles the transaction amount; after verifying the transaction information, the sorting node adds a new block to the blockchain; the new block contains the transaction information. This method can address the risks of transaction default and spot price fluctuations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of application technology of electricity market transactions, and in particular relates to a method for electricity spot market transactions based on blockchain technology. Background Technology

[0002] Current research on blockchain-based electricity spot market transactions focuses relatively little on the risk of default in the market. This is because, unlike general commodity trading, electricity trading contracts are typically signed before the actual execution of the transaction. In reality, electricity sales companies seeking higher profits or users considering cost reductions after signing the contract can lead to discrepancies between the actual transaction amount and the contract amount, potentially resulting in default risk. Furthermore, spot prices are influenced by operating costs and subjective risk preferences, leading to price instability and spot price volatility risk. Therefore, there is an urgent need to establish an effective default management mechanism in electricity spot market transactions to address transaction default risk, and to construct a mechanism to mitigate spot price volatility during the auction phase of the transaction process. Summary of the Invention

[0003] To overcome the problems existing in related technologies, this application provides a method for electricity spot market trading based on blockchain technology, which can cope with the risks of transaction default and spot price fluctuations.

[0004] This application is achieved through the following technical solution:

[0005] In the first aspect, the embodiments of this application provide a method for trading electricity spot market based on blockchain technology, including: trader i sends order information for purchasing or selling electricity to a node, and based on the PBFT consensus mechanism adopted by the electricity trading blockchain platform, the regulator selects the endorsing node and sorting node for the order information;

[0006] The endorsing node queries the record of trader i's last transaction information and determines the additional waiting time for the order information in this transaction based on the record of the last transaction information;

[0007] Based on the trading rules and the subjective risk preferences of trader i and trader j, trading order information is generated, and a trading contract is produced; the trading order information includes the optimal trading volume and the price of the trading volume;

[0008] The endorsing node verifies the transaction information based on the smart contract and settles the transaction amount; after verifying the transaction information, the sorting node adds a new block to the blockchain; the new block contains the transaction information.

[0009] In one possible implementation of the first aspect, the electricity trading blockchain platform employs the PBFT consensus mechanism, including:

[0010] Trader i's client initiates a consensus request to the master node;

[0011] The master node publishes a consensus request to other nodes;

[0012] Other nodes publish consensus requests to each other and execute the process of preparing and submitting consensus requests to the power trading blockchain platform;

[0013] All nodes will return the execution results to the client.

[0014] In one possible implementation of the first aspect, based on the PBFT consensus mechanism adopted by the power trading blockchain platform, the regulator selects the endorsement nodes and sorting nodes for order information, including:

[0015] Based on the PBFT consensus mechanism adopted by the power trading blockchain platform, regulators select endorsement nodes and sorting nodes according to the influence and credit record of trader i who sends a trading order to the endorsement node. The endorsement node is responsible for monitoring the transaction information corresponding to the order information; the sorting node is used to receive information on other successful transactions from other nodes and arrange all transaction information into a predetermined sequence.

[0016] In one possible implementation of the first aspect, the endorsing node queries the record of trader i's previous transaction information, and determines the additional waiting time added to the order information in this transaction based on the record of the previous transaction information, including:

[0017] The endorsing node queries the record of trader i's last transaction information to verify whether trader i defaulted last time;

[0018] If trader i defaulted last time, the waiting time for trader i's order information in this transaction will be increased; the defaulting trader can only select an order to trade after the waiting time has ended or after all non-defaulting traders have selected their orders;

[0019] If trader i did not default last time, then orders will be selected and traded in the order they were sent.

[0020] If trader i defaulted last time and then selects an order, the waiting time for trader i will be zero, and the corresponding penalty cost will be applied to the current order.

[0021] In one possible implementation of the first aspect, transaction order information is formed based on transaction rules and the subjective risk preferences of trader i and trader j, and a transaction contract is generated, including:

[0022] The price of the traded electricity is determined based on the subjective risk preferences of trader i and trader j;

[0023] The optimal trading volume is selected based on the transaction rule of minimizing the seller's costs; the seller is trader i or trader j;

[0024] Trader i sends the price of the trading volume and the optimal trading volume to trader j to generate a trading contract.

[0025] In one possible implementation of the first aspect, the expression for the objective function of cost minimization is:

[0026]

[0027] The expression for the power balance constraint of the objective function is as follows:

[0028]

[0029] Where f represents the seller's cost; This represents the interaction cost between traders and the power grid. This represents the interaction cost between the seller and the buyer; T is the total time period of the transaction; t is the current time period of the transaction. Let t be the purchase price of electricity from the grid during the time period t. Let t represent the amount of electricity purchased from the power grid during the t-th time period; Let be the electricity price sold to the grid during time period t; Electricity sold to the power grid; Let t be the electricity price sold by the seller during the t-th time period; The electricity sold by the seller to the buyer during time period t. Different constant values ​​are used during peak, off-peak, and stable periods of electricity consumption.

[0030] In one possible implementation of the first aspect, the endorsing node verifies the transaction information based on a smart contract, including:

[0031] Endorsing nodes use smart contracts to identify defaulters and tally the amount of electricity in default; smart contracts are used to automatically execute transactions and record transaction information.

[0032] If a trader defaults in an electricity transaction and the defaulted electricity amount exceeds the threshold set by the smart contract, the electricity bill settlement in the smart contract will be triggered, and the transaction contract will be executed automatically.

[0033] According to the information from the automatically executed transaction contract, the transaction information will be updated and synchronized to all nodes in the blockchain.

[0034] In one possible implementation of the first aspect, the endorsing node identifies defaulters and counts the defaulted electricity amount by invoking a smart contract, including:

[0035] The electricity bill settlement monitoring program of the smart contract on each node of the blockchain obtains the electricity signal of the smart meter at a preset frequency; each trader is equipped with a smart meter, and the electricity statistics include power generation, transmission and consumption.

[0036] The endorsing node collects electricity statistics based on the electricity signal, identifies defaulters, and tallies the defaulted electricity volume.

[0037] In one possible implementation of the first aspect, the endorsing node verifies the transaction information based on a smart contract, and also includes:

[0038] If a default occurs due to a program error or equipment malfunction on the electricity trading blockchain platform, the regulator will compensate the trader based on the amount of electricity defaulted.

[0039] Secondly, embodiments of this application provide a computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the electricity spot market trading method based on blockchain technology as described in any of the first aspects above.

[0040] The beneficial effects of the embodiments in this application compared with the prior art are:

[0041] In this embodiment, based on the PBFT consensus mechanism, the entire transaction process is verified through consensus among all parties and smart contracts, thus revealing the complete traces of the transaction and preventing tampering. Simultaneously, a waiting period is added for defaulting traders, and by assigning different attributes to defaulting traders, their participation in electricity trading is subject to certain restrictions, effectively addressing the risks associated with default. Regarding spot price fluctuations, by incorporating participants' subjective risk preferences into the auction process, excessive price volatility can be effectively prevented.

[0042] It is understandable that the beneficial effects of the second aspect mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here.

[0043] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this specification. Attached Figure Description

[0044] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0045] Figure 1This is a schematic flowchart of a method for trading electricity spot market based on blockchain technology provided in an embodiment of this application;

[0046] Figure 2 An architecture diagram of a blockchain-based electricity spot market trading method provided in one embodiment of this application;

[0047] Figure 3 This is a schematic diagram of a transaction process provided in an embodiment of this application;

[0048] Figure 4 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation

[0049] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0050] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0051] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0052] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0053] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0054] The phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this application specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0055] The electricity market mainly includes the medium- and long-term market, the spot market, the ancillary services market, and the capacity market. The spot market is a crucial link in the electricity market system, playing a fundamental supporting role in the openness, competition, and orderly operation of the electricity market, and is also key to coordinating market transactions and system security. National policies and market principles require the electricity spot market to emphasize real-time transactions and autonomy, namely, autonomous, intelligent, and partially decentralized transactions. Simultaneously, it must prevent transaction data from being tampered with or accessed by third-party intruders, ensuring data confidentiality. Blockchain, with its intelligent, autonomous, tamper-proof, highly secure, and transparent characteristics, is well-suited to electricity spot market transactions in terms of operation, topology, and security protection, and can effectively support the construction and protection of the electricity spot trading market.

[0056] Blockchain is a distributed data network system, named so because blocks are grouped into a chain. In a blockchain, all traders distribute and store historical data in the form of blocks. A blockchain is also considered an open ledger where all online transactions are recorded, and each trader is allowed to connect, send, or verify transactions. Therefore, blockchain has three characteristics: data integrity, security, and decentralization. Combining blockchain with electricity spot market trading can ensure the immutability of recorded assets, power generation, and consumption data, effectively addressing risks to safe operation. Electricity trading under a blockchain is executed automatically under smart contracts without third-party intervention and is scalable to various trading scenarios.

[0057] Based on the need to address safety operation risks, as well as the default risks and spot price fluctuation risks mentioned in the background technology, this application provides a blockchain-based electricity spot market trading method that can address safety operation risks, transaction default risks, and spot price fluctuation risks.

[0058] To enable those skilled in the art to better understand the present invention, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the accompanying drawings and specific implementation methods.

[0059] Figure 1This is a flowchart illustrating a blockchain-based electricity spot market trading method according to an embodiment of this application. (Refer to...) Figure 1 The method for trading electricity spot market based on blockchain technology includes:

[0060] In step 101, trader i sends an order for purchasing or selling electricity to the node. Based on the PBFT consensus mechanism adopted by the power trading blockchain platform, the regulator selects the endorsing node and the sorting node for the order information.

[0061] For example, the transaction process is divided into six stages: order placement, default inquiry, auction stage, transaction execution, transaction verification, and payment stage. The entire electricity spot market transaction process needs to be completed based on nodes, consensus mechanisms, smart contracts, and transaction rules.

[0062] Step 101 belongs to the order sending stage.

[0063] For example, depending on the role of each node in blockchain electricity trading, nodes can include traders and regulators / regulatory bodies. Traders can include power grids, electricity retailers, and users, such as... Figure 2 As shown in the diagram. Energy flow represents electricity trading, and information flow represents information exchange.

[0064] In this system, users act as buyers, while electricity retailers act as either sellers or buyers, depending on whether there is surplus supply or additional demand. The regulator is the blockchain's certificate authority, responsible for identity registration, certificate issuance, and certificate revocation within the blockchain. It is also responsible for regulatory policy development, infrastructure maintenance, and handling of emergencies, ensuring the long-term operation of the blockchain-based electricity spot market.

[0065] Specifically, in the blockchain-based electricity spot market trading mechanism, each node has a unique ID, along with a private key and a public key. The ID serves as the identity for electricity transactions, while the private and public keys are used for information encryption.

[0066] For example, the private key is held by the transactor and regulator themselves and is used for digital signatures and decryption, while the public key can be used by each node in the blockchain for encryption and authentication.

[0067] A consensus mechanism is the process by which all members or network transactors of a blockchain reach an agreement on the correct state of data on the network. It ensures that all transactors share identical data, preventing malicious actors from manipulating it. Different blockchain implementations follow different consensus mechanisms. A consensus mechanism satisfies both security and liveness requirements. Ensuring consistency among transactors means that each input sequence produces a corresponding output sequence on each block; that is, if a block receives a series of identical transactions, then the same state change should occur on each block.

[0068] The power trading blockchain platform of this invention adopts PBFT as a consensus mechanism. In terms of process, PBFT is equivalent to two votes, because it not only votes on the proposal but also confirms the result.

[0069] Specifically, the power trading blockchain platform adopts the PBFT consensus mechanism, which includes: trader i's client initiating a consensus request to the master node; the master node publishing the consensus request to other nodes; other nodes publishing consensus requests to each other and executing the process of preparing and submitting the consensus request to the power trading blockchain platform; and all nodes returning the execution results to the client.

[0070] For example, the master node is the node responsible for this transaction, and the other nodes are all nodes except the master node.

[0071] Specifically, based on the PBFT consensus mechanism adopted by the power trading blockchain platform, regulators select endorsement nodes and sorting nodes for order information. This includes: based on the PBFT consensus mechanism adopted by the power trading blockchain platform, regulators select endorsement nodes and sorting nodes according to the influence and credit record of trader i who sends the trading order to the endorsement node; wherein, the endorsement node is responsible for monitoring the transaction information corresponding to the order information; the sorting node is used to receive information on other successful transactions from other nodes and arrange all transaction information into a predetermined sequence.

[0072] In one embodiment, taking trader i sending electricity sales order information to a node as an example, using relevant prediction methods combined with users' historical electricity consumption records, trader i publishes its electricity sales volume and sends the electricity sales information to the endorsing node, as follows:

[0073]

[0074] Among them, issue sell This indicates that the message is for an electricity purchase order; issuer i Represents trader i's ID; number represents trader i's order number; P i sell (t) represents the electricity volume to be sold by trader i; time is the execution time; The initial target selling price is represented by equation (8), which can be calculated as the selling price of seller i in the first round.

[0075] In one embodiment, when trader i needs additional electricity, taking the example of trader i sending an order to the node to purchase electricity, the information format is as follows:

[0076]

[0077] Among them, issue buy This indicates that this message is for an electricity purchase order; P i buy (t) represents the amount of electricity that trader i wants to purchase. The initial target purchase price is represented by equation (9), which can be calculated as the purchase price of buyer j in the first round.

[0078] For example, each transaction is verified through consensus among all parties. After being authenticated and obtaining a specific identity ID from the trading platform, traders can interact anonymously with each other on the blockchain trading platform. In addition to significant characteristics such as decentralization, transparency, verification, and immutability, it also guarantees privacy and security at any given time, effectively reducing the risk of security risks.

[0079] In step 102, the endorsing node queries the record of the previous transaction information of trader i, and determines the waiting time added to the order information in this transaction based on the record of the previous transaction information.

[0080] Step 102 is the default inquiry stage.

[0081] Specifically, the endorsing node queries the record of trader i's previous transaction information, and determines the additional waiting time for the order information in this transaction based on the record of the previous transaction information. This includes: the endorsing node queries the record of trader i's previous transaction information and checks whether trader i defaulted in the previous transaction.

[0082] If trader i defaulted last time, the waiting time for trader i's order information in this transaction will be increased; the defaulting trader can only select an order to trade after the waiting time has ended or after all non-defaulting traders have selected their orders.

[0083] If trader i did not default last time, then orders will be selected and traded in the order they were sent.

[0084] If trader i defaulted last time and then selects an order, the waiting time for trader i will be zero, and the corresponding penalty cost will be applied to the current order.

[0085] For example, if trader i defaulted in the previous transaction, trader i will increase the waiting time in this transaction. The endorsing node will generate trader i's waiting time W based on the amount of electricity trader i defaulted in the previous transaction. i The defaulting trader i is waiting for W. i Trader i can only select an order after all non-defaulting traders have selected their orders, or after all non-defaulting traders have selected their orders. If trader i defaults but wants to select an order at the same time as non-defaulting traders, trader i has no waiting time but will be subject to a penalty. The penalty amount is calculated using equation (3), and this penalty cost is reflected in the payment stage.

[0086] Penalty Cost The expression is:

[0087]

[0088] in, This represents the amount of electricity traded by trader i that was defaulted on in the last transaction, i.e., the difference between the agreed-upon amount and the actual amount traded. Indicates the penalty coefficient; This indicates the price of the last transaction.

[0089] For example, the aforementioned penalty costs Pay while waiting to select your order.

[0090] For example, waiting time and penalty costs are added to defaulting traders. Waiting time refers to the time spent in power trading, which is restricted by assigning different attributes to defaulting traders, with different values ​​given to traders of different credit ratings. The value of W depends on the amount of electricity defaulted in the previous transaction; the more electricity defaulted, the larger the value of W. The penalty cost complements the waiting time and prevents defaulters from using price adjustments to increase order priority, effectively addressing the risks associated with default.

[0091] In step 103, transaction order information is generated based on the transaction rules and the subjective risk preferences of trader i and trader j, and a transaction contract is generated; the transaction order information includes the optimal transaction volume and the price of the transaction volume.

[0092] Step 103 is part of the auction stage.

[0093] Specifically, based on the trading rules and the subjective risk preferences of traders i and j, trading order information is generated, and a trading contract is produced. This includes: determining the price of the trading electricity volume based on the subjective risk preferences of traders i and j; selecting the optimal trading electricity volume based on the trading rules of cost minimization; and sending the price of the trading electricity volume and the optimal trading electricity volume to trader j to generate the trading contract.

[0094] Specifically, the expression for the objective function of minimizing cost is:

[0095]

[0096] The expression for the power balance constraint of the objective function is:

[0097]

[0098] Where f represents the seller's cost; This represents the interaction cost between traders and the power grid. This represents the interaction cost between the seller and the buyer; T is the total time period of the transaction; t is the current time period of the transaction. Let t be the purchase price of electricity from the grid during the time period t. Let t represent the amount of electricity purchased from the power grid during the t-th time period; Let be the electricity price sold to the grid during time period t; Electricity sold to the power grid; Let t be the electricity price sold by the seller during the t-th time period; The electricity sold by the seller to the buyer during time period t. Different constant values ​​are used during peak, off-peak, and stable periods of electricity consumption.

[0099] For example, when a trader is a user, they can only participate in a transaction as a buyer. The values ​​are all 0.

[0100] In one embodiment, it is assumed that trader i is the seller and trader j is the buyer. The lowest selling price c i Sold back to grid price and its operating costs C i The restrictions, and the maximum purchase price l j Affected by the power grid sales price The impact of this, therefore, the operating cost C i and high purchase price j They are represented as follows:

[0101]

[0102]

[0103] At the start of the auction, traders have no knowledge of other traders and can only provide target prices based on their own subjective risk preferences. In the following iterations, traders will also refer to the highest or lowest auction prices of others. The iteration update process is as shown in equations (6) and (7).

[0104] Seller i's bidding strategy is expressed as:

[0105]

[0106] Buyer j's bidding strategy is expressed as:

[0107]

[0108] Among them, bid p,i (k) is the selling price of seller i in the kth round; bid p,max (k) represents the maximum bid price for all traders in round k; bid c,min (k) represents the lowest bid price for all traders in round k; τ i (k) represents the target price of seller i in round k; η i This represents the rate of revenue decline accepted by seller i, meaning that the more aggressively a seller lowers their bid, the more likely they are to complete the auction sooner. c,j (k) represents the purchase price of buyer j in round k; τ j (k) represents the target price of buyer j in round k; η j τ represents the rate of decrease in expenditure accepted by buyer j; where τ i (k) and τ j The value of (k) reflects the subjective risk preferences of traders i and j. In order to ensure the economic benefits of each trader and reflect the risk attitude of different clients towards their income loss, a risk factor r is defined to construct the target price τ.

[0109] r(k+1)=r(k)+ν[δ(k)-r(k)] (10)

[0110] Where r(k+1) represents the risk factor after adjustment in the (k+1)th round; r(k) represents the risk factor after adjustment in the kth round; ν∈(0,1) is the proportional coefficient; δ(k) represents the expected risk factor; since the electricity trading of this invention involves many small customers, the trading process usually leads to quite drastic price changes, therefore, it is only possible to use the historical market clearing price q b Weighted average to represent the equivalent price q e .

[0111]

[0112] Among them, a b B represents the weighting factor; B represents the total number of previous historical market clearings; b represents the number of historical market clearings; considering the updated risk factor (including client risk preference) and equivalent price, the target prices for intratrade transactions are represented as (12) and (13), respectively, which will be used to form the auction prices in formulas (8) and (9).

[0113]

[0114]

[0115] Where MAX is the highest auction price in the historical market clearing process; when the final selling price... equal to the final purchase price At this time, the transaction price c is formed. contract (t) indicates the end of the iteration, with both parties reaching a price consensus. Trader i then selects the optimal trading volume based on the trading rules, prioritizing cost minimization, and sends this information to trader j to generate a trading contract. The information is as follows:

[0116]

[0117] Among them, ID sellrequest This indicates that this is an auction listing; seller i Indicates the ID of seller i; buyer j Indicates the ID of buyer j; This represents the amount of electricity sold by seller i to buyer j. To prevent information tampering, the request information is encrypted using asymmetric encryption. After trader j receives and agrees to the request, the generated transaction contract will be presented in the form of a transaction block. The transaction block is represented as follows:

[0118] <buy,issuer i ,number,seller i buyer j ,c contract (t),Q contract (t)> (15) where buy indicates that this information is contract information; Q contract (t) represents the contracted electricity volume; c contract (t) represents the transaction price. Simultaneously, under the PBFT consensus mechanism, the sorting node adds a new block to the blockchain, signifying that a transaction has been completed.

[0119] For example, by taking participants' subjective risk preferences into account during the auction process, excessive price volatility can be effectively prevented.

[0120] In step 104, the endorsing node verifies the transaction information based on the smart contract and settles the transaction amount; after verifying the transaction information, the sorting node adds a new block to the blockchain; the new block contains the transaction information.

[0121] Step 104 belongs to the transaction execution, transaction verification and payment stage.

[0122] For example, at a specified time, seller i, according to the transaction contract recorded in the blockchain, transfers the contracted electricity quantity Q. contract (t) is transferred to buyer j. The endorsing node collects statistical information from the smart meter to verify the transaction information using the smart contract.

[0123] After the transaction is executed, the smart meter will generate the following transaction data based on the statistics:

[0124] <redeem,issuer i number, buyer j Q redeem (t)> (16) where redeem indicates that this message is a redemption message; Q redeem (t)=min(Q contract (t),Q real (t)); Q redeem (t) represents the traded electricity volume; Q real (t) represents the actual electricity volume traded.

[0125] For example, if a trader defaults in an electricity transaction, the endorsing node calls a smart contract to find the defaulter and calculate the defaulted electricity volume. If the default is due to a program error or equipment malfunction on the trading platform, then the trading platform is the defaulter.

[0126] Specifically, the endorsing node verifies the transaction information based on a smart contract, including: the endorsing node calls the smart contract to find the defaulter and count the defaulted electricity volume; the smart contract is used to automatically execute the transaction and record the transaction information; if a trader defaults in the electricity transaction and the defaulted electricity volume exceeds the change threshold set by the smart contract, the electricity fee settlement in the smart contract will be triggered, and the transaction contract will be automatically executed; according to the information of the automatically executed transaction contract, the transaction information will be updated and synchronized to all nodes in the blockchain.

[0127] For example, a smart contract can be simply understood as a piece of code written on the blockchain. It is event-driven, has dynamic states, is recognized by multiple parties, and can automatically process on-chain information according to preset conditions. Using smart contract technology, the transaction execution rules are written into the smart contract in the form of programmable code. When the transaction contract is triggered, the content agreed in the transaction contract will be executed automatically without human intervention. The process of automatic execution of smart contracts and recording transaction information is as follows: (1) The smart meter will send the electricity status at regular intervals. The electricity bill settlement smart contract listening program on each node of the blockchain will acquire the electricity signal sent by the smart meter at a certain frequency. (2) When the change in electricity exceeds the change threshold set by the triggering contract, the electricity bill settlement smart contract will be triggered and the smart contract will be executed automatically. (3) According to the pre-set smart contract content, with the automatic execution of the smart contract, the electricity bill transaction information will be updated and synchronized to all nodes in the blockchain.

[0128] Specifically, the endorsing node uses smart contracts to identify defaulters and calculate the amount of electricity in default. This includes: the electricity bill settlement monitoring program of the smart contract on each node of the blockchain acquiring the electricity signal from the smart meter at a preset frequency; each trader is equipped with a smart meter, and the electricity statistics include power generation, transmission, and consumption; the endorsing node collects the electricity statistics based on the electricity signal, identifies defaulters, and calculates the amount of electricity in default.

[0129] For example, if a default record is generated due to a trader's breach of contract, it will produce the following trade statistics:

[0130] <default,issuer i ,number,user defaulter Q default (t)> (17) where default indicates that this message is a breach of contract message, user defaulter Indicates the ID of the defaulting trader; Q default (t) represents the defaulted electricity amount. After all transaction information has been verified, the sorting node adds a new block to the blockchain.

[0131] For example, if seller i transfers the contracted electricity quantity Q according to the transaction contract recorded in the blockchain... contract (t) The transfer to buyer j occurred after the specified time, or the amount of electricity transferred to buyer j was less than the contracted amount Q. contract (t) are all considered breaches of contract. If the buyer makes payment after the agreed deadline, the smart contract will be triggered, and the transaction contract will be executed automatically.

[0132] Specifically, the endorsing nodes verify the transaction information based on smart contracts, and also include: if a default is caused by a program error or equipment failure on the power trading blockchain platform, the regulator will compensate the trader according to the amount of electricity in default.

[0133] For example, the trading platform and equipment are established and managed by the regulator. Therefore, when a default occurs due to a malfunction of the trading platform or equipment, the regulator should compensate the trader based on the amount of money involved.

[0134] For example, if the transaction is not in default, the generated information is digitally signed. When the transaction information is signed by a predetermined number of endorsing nodes, it is considered a successful transaction and is sent to the sorting nodes. The sorting nodes' role is to receive successful transaction information from other nodes, arrange all the information into a defined sequence, and package them into blocks. Finally, they distribute the blocks to the nodes to update the blockchain.

[0135] During the payment phase, the trader bases the transaction on the actual electricity consumption data Q. redeem (t) Automatically liquidate the transaction amount C by invoking the smart contract. If no penalty cost is found... The transaction amount C is transferred from buyer j's account to seller i's account; otherwise, the actual cost C is calculated using equation (19). real C represents the funds paid by buyer j to seller i. Costs of fines paid to regulators.

[0136] C = Q redeem *c contract (18)

[0137]

[0138] In one embodiment, to more clearly describe the electricity spot market trading method based on blockchain technology, such as... Figure 3 As shown, the entire transaction process can be represented as follows: A trader sends an order; this order is for selling or purchasing electricity. The endorsing node checks the trader's default records to determine the increased waiting time. Traders reach an agreement through price iteration and cost minimization, completing the auction. Afterwards, the endorsing node checks again for any defaulting traders who have prematurely entered the transaction. If a defaulting trader has entered the transaction prematurely, the endorsing node incurs a penalty cost and then executes the transaction; otherwise, it executes the transaction directly. After the execution time has elapsed, the endorsing node checks whether the trader has fulfilled their agreement; otherwise, a new default record is generated for this transaction. Finally, the trader calls the smart contract to calculate the fees and automatically completes the payment.

[0139] As can be seen, this invention, based on a consensus mechanism and combined with smart contracts and other auxiliary technologies, provides a complete and tamper-proof record of transactions throughout the entire process. Each transaction is verified through consensus among all parties and predefined smart contracts. After authentication and obtaining a specific identity ID from the trading platform, traders can interact anonymously with each other on the blockchain trading platform. In addition to its significant characteristics such as decentralization, transparency, verifiability, and immutability, it also guarantees privacy and security at any given time, effectively reducing security risks.

[0140] Simultaneously, waiting time and penalty costs are added to defaulting traders. Waiting time refers to the restrictions imposed on defaulting traders in electricity trading by assigning them different attributes. Penalty costs complement the waiting time, preventing defaulters from using price adjustments to increase order priority, effectively addressing the risks associated with default.

[0141] In dealing with spot price fluctuations, this invention effectively prevents excessive price volatility by taking participants' subjective risk preferences into account during the auction process.

[0142] It should be understood that the sequence number of each step does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0143] Corresponding to the blockchain-based electricity spot market trading method in the above embodiments, this application also provides a terminal device, see [link to relevant documentation]. Figure 4 The terminal device 300 may include at least one processor 310 and a memory 320, wherein the memory 320 stores a computer program 321 that can run on the at least one processor 310, and the processor 310 executes the computer program to implement the steps in any of the above method embodiments, for example... Figure 1 Steps 101 to 103 in the illustrated embodiment.

[0144] For example, a computer program may be divided into one or more modules / units, one or more of which are stored in memory 320 and executed by processor 310 to complete this application. The one or more modules / units may be a series of computer program segments capable of performing specific functions, which describe the execution process of the computer program in terminal device 300.

[0145] Those skilled in the art will understand that Figure 4This is merely an example of a terminal device and does not constitute a limitation on the terminal device. It may include more or fewer components than shown, or combine certain components, or different components, such as input / output devices, network access devices, buses, etc.

[0146] The processor 310 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0147] The memory 320 can be an internal storage unit of the terminal device or an external storage device, such as a plug-in hard drive, a smart media card (SMC), a secure digital card (SD), or a flash card. The memory 320 is used to store the computer program and other programs and data required by the terminal device. The memory 320 can also be used to temporarily store data that has been output or will be output.

[0148] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0149] The electricity spot market trading method based on blockchain technology provided in this application embodiment can be applied to terminal devices such as computers, tablets, laptops, netbooks, and personal digital assistants (PDAs). This application embodiment does not impose any restrictions on the specific type of terminal device.

[0150] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in the various embodiments of the above-described blockchain-based electricity spot market trading method.

[0151] This application provides a computer program product that, when run on a mobile terminal, enables the mobile terminal to execute the steps described in the various embodiments of the blockchain-based electricity spot market trading method.

[0152] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographing device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0153] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0154] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0155] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0156] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0157] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method for power spot market transaction based on blockchain technology, characterized in that, include: Traders The order information of buying or selling electricity is sent to the node, and based on the PBFT consensus mechanism adopted by the electricity trading blockchain platform, the supervisor selects the endorsement node and the ordering node of the order information. The endorsement node queries the trader a record of a previous transaction, and determines the latency added to the order information in the current transaction based on the record of the previous transaction. Based on trading rules and traders and traders j The subjective risk preference forms the transaction order information and generates the transaction contract; the transaction order information includes the optimal transaction volume and the price of the transaction volume; The endorsing node verifies the transaction information based on a smart contract and settles the transaction amount; wherein, after verifying the transaction information, the sorting node adds a new block to the blockchain; the new block contains the transaction information; The power trading blockchain platform adopts the PBFT consensus mechanism, including: Traders The client initiates a consensus request to the master node; The master node publishes the consensus request to other nodes; Other nodes publish the consensus request to each other and perform the process of preparing and submitting the consensus request to the power trading blockchain platform; All nodes will return the execution results to the client. Based on the PBFT consensus mechanism adopted by the power trading blockchain platform, regulators select the endorsement nodes and sorting nodes for the order information, including: Based on the PBFT consensus mechanism adopted by the power trading blockchain platform, regulators base their decisions on the traders who send trading orders to the endorsing nodes. The system selects endorsement nodes and sorting nodes based on the influence and credit record of the order; wherein, the endorsement node is responsible for monitoring the transaction information corresponding to the order information; the sorting node is used to receive information on other successful transactions from other nodes and arrange all transaction information into a predetermined sequence; The endorsement node queries the trader. The record of the previous transaction information, based on which the additional waiting time for the order information in this transaction is determined, includes: The endorsement node queries the trader. The record of the last transaction information is used to verify the trader. Did you breach the contract last time? If the trader The previous default increased the number of the trader. i The order information mentioned herein refers to the waiting time in this transaction; defaulting traders can only select an order to trade after the waiting time has ended or after all non-defaulting traders have selected their orders; If the trader If there was no breach of contract last time, orders will be selected and traded in the order they were sent. If the trader The previous default occurred while selecting an order; at this time, the trader... i The increased waiting time is zero, and the corresponding penalty cost is applied to the current order; The basis is trading rules and traders. and traders j Subjective risk preferences form transaction order information and generate transaction contracts, including: Based on the trader and the aforementioned trader j The price of the traded electricity is determined by the subjective risk preference. The optimal trading volume is selected based on the transaction rule of minimizing the seller's costs; the seller is the trader. or the trader mentioned j ; The trader The price of the traded electricity volume and the optimal traded electricity volume are sent to the trader. j Generate a transaction contract; The endorsing node verifies the transaction information based on a smart contract, including: The endorsing node identifies defaulters and calculates the defaulted electricity volume by invoking a smart contract; the smart contract is used to automatically execute transactions and record transaction information. If a trader defaults in an electricity transaction and the defaulted electricity amount exceeds the change threshold set by the smart contract, the electricity bill settlement in the smart contract will be triggered, and the transaction contract will be executed automatically. According to the information from the automatically executed transaction contract, the transaction information will be updated and synchronized to all nodes in the blockchain.

2. The electricity spot market trading method based on blockchain technology as described in claim 1, characterized in that, The objective function for minimizing cost is expressed as: The expression for the power balance constraint of the objective function is as follows: in, Indicates the seller's cost; This represents the interaction cost between traders and the power grid. This represents the interaction costs between the seller and the buyer; The total time period for the transaction; The current time period of the transaction; For the first The price at which electricity is purchased from the power grid during a given time period; For the first Electricity purchased from the power grid during a specific time period; For the first The price of electricity sold to the grid during a specific time period; Electricity sold to the power grid; For the first The seller's electricity price during the specified time period; For the first During a given time period, the seller sells electricity to the buyer. , Different constant values ​​are used during peak, off-peak, and stable periods of electricity consumption.

3. The electricity spot market trading method based on blockchain technology as described in claim 1, characterized in that, The endorsing node identifies defaulters and calculates the amount of electricity defaulted by invoking a smart contract, including: The electricity bill settlement monitoring program of the smart contract on each node of the blockchain acquires the electricity signal of the smart meter at a preset frequency; each trader is equipped with the smart meter, and the electricity statistics include power generation, transmission and consumption. The endorsing node collects electricity statistics based on the electricity signal, identifies defaulters, and calculates the defaulted electricity amount.

4. The electricity spot market trading method based on blockchain technology as described in claim 1, characterized in that, The endorsement node verifies the transaction information based on a smart contract, and also includes: If a default occurs due to a program error or equipment malfunction on the electricity trading blockchain platform, the regulator will compensate the trader based on the amount of electricity defaulted.

5. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the electricity spot market trading method based on blockchain technology as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Block chain-based electric power market transaction method, electronic device and storage medium

    CN107392767A

  • Intelligent energy gateway for user-side microgrid power transaction

    CN110415093A