Power transaction method based on side chain technology and hybrid continuous two-way auction
By employing sidechain technology and a hybrid continuous two-way auction approach for electricity trading, the problems of excessive main chain load and the impact of user credibility have been solved, achieving efficient, secure, and fair electricity trading, reducing operating costs, and incentivizing trustworthy behavior.
Patent Information
- Application Number
- CN202511082912.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-04
- Publication Date
- 2025-11-18
AI Technical Summary
In existing blockchain-based smart contract power trading models, the main chain is overloaded, the uncertainty of distributed energy output causes the power generation and consumption to deviate from the agreement, the failure of both parties to execute the contract increases operating costs, user credit affects transaction security and service quality, and the processing of massive amounts of data brings security and cost issues.
The power trading method adopts sidechain technology and hybrid continuous two-way auction. By combining the main chain and sidechain, the burden on the main chain is reduced. Credit value assessment and PoI consensus mechanism are introduced to optimize transaction efficiency and fairness. IPFS cluster is used to store data and economic incentive mechanism is implemented.
Reduce the burden on the main chain, improve system efficiency, increase data access speed, enhance transaction security and fairness, suppress default behavior, and increase the economic benefits of user credit scores.
Smart Images

Figure CN120975822A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power technology, specifically relating to a power trading method based on sidechain technology and hybrid continuous two-way auction. Background Technology
[0002] While existing blockchain-based smart contract electricity trading models have improved trading efficiency and reduced attack risks, they have not fully addressed the issue of excessive main chain load. The uncertainty of distributed energy output, the profit-driven nature of market participants, and the flexibility of transactions in existing models lead to deviations in actual power generation and consumption from the agreement. When either party fails to fulfill the agreement, the power grid must purchase excess electricity at the grid connection price or sell the shortage at the retail price, increasing operating costs and hindering the local consumption of distributed energy. Therefore, this patented solution proposes introducing sidechain technology in conjunction with the electricity market to alleviate the burden on the main chain and optimize the overall system performance.
[0003] Compared to traditional centralized trading methods, existing approaches are insufficiently profitable and fail to adequately consider the impact of user credit. User creditworthiness plays a crucial role in the allocation of electricity resources, directly affecting transaction security and service quality. A user's breach of contract can negatively impact the immediate electricity needs of others. Therefore, this patent proposes a continuous two-way auction mechanism based on credit value to improve the efficiency and fairness of electricity trading.
[0004] In current electricity market transactions, handling massive amounts of data presents a dual challenge: data security and cost. The primary task is to ensure data security, preventing unauthorized access and cyberattacks, and especially protecting consumer personal information. Furthermore, with the continuous increase in data volume, the search for more cost-effective storage solutions becomes urgent; for example, using distributed storage technologies such as IPFS can effectively reduce storage costs. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention provides a power trading method based on sidechain technology and hybrid continuous two-way auctions, thereby resolving the issues in the prior art. The technical solution adopted by this invention is as follows:
[0006] A power trading method based on sidechain technology and hybrid continuous two-way auctions includes the following steps:
[0007] Step 1: Construct an electricity trading model based on sidechain technology;
[0008] Step 2: Conduct electricity trading based on a dual-chain structure;
[0009] Step 3: Hybrid continuous two-way auction.
[0010] Furthermore, in step 1, the electricity trading model includes a main chain as the user's blockchain and a side chain as the electricity seller's blockchain, with the main chain and side chain connected through a regulatory node controlled by a third-party regulatory authority.
[0011] The electricity trading model also includes a smart contract layer and a data storage layer; the data storage layer is used to store user data, electricity sales data, intrinsic data, and transaction data; the smart contract layer sets up data storage smart contracts, on-chain transaction smart contracts, and access control smart contracts.
[0012] Furthermore, step 2 includes:
[0013] Step 2.1, User Registration:
[0014] In the sidechain, users participate as nodes, registering and uploading their data to the data storage layer before transactions; the smart contract layer verifies user data and manages access permissions.
[0015] Step 2.2, publish your electricity purchase request:
[0016] After registration, users publish their electricity purchase requests, including expected electricity consumption and time periods, to the power provider nodes on the sidechain through the main chain's regulatory nodes. After verification by the regulatory nodes, the requests are broadcast to the power supply nodes on the main chain. The power supply nodes assess whether they can meet the electricity purchase request based on their capacity and pricing, and send the detailed information of the electricity they can provide to the user node that made the request through the regulatory nodes. After receiving the power supply details, the user selects a suitable power supply node to confirm the transaction, and then both parties agree on the power supply amount, time, and cost.
[0017] Step 2.3, Generate and store transaction data:
[0018] After both parties confirm the transaction details, the transaction process is initiated. A transaction data file is generated based on the agreed details. The transaction data file includes the basic information of the electricity purchaser, the basic information of the electricity sales node, the transaction time, the transaction volume, and the transaction price. The generated detailed data file will be submitted to the regulatory node for review and stored in the regulatory node by the smart contract layer.
[0019] Step 2.4, Transaction Execution and Data Management:
[0020] After review by the regulatory node, the two parties conduct electricity transactions according to the agreed transaction details and transmit electricity through the distribution network according to the transaction time and amount specified in the agreement. The seller collects electricity fees from users through smart meters. After the electricity transmission is completed, a transaction detail data file is generated based on the actual amount of electricity transmitted and the transmission time, and submitted to the regulatory node for review. After confirmation, the data will be stored in the IPFS cluster.
[0021] Furthermore, step 3 includes:
[0022] Step 3.1, Credit Assessment:
[0023] After the transaction is completed, the smart contract layer evaluates the participants' creditworthiness, including the user's historical credit and the current transaction completion rate; the transaction completion ratio will be determined by the number of successful transactions and the transaction volume. In the x-th transaction matching result, user k has multiple transaction objects, and its object set is v. m Where m = {1, 2, ..., M}, and the transaction records of k are... in, For users k and v m The transaction status, For users k and v m Completed transaction volume; User k's credit score calculation formula is:
[0024]
[0025] in, Let α be the integrity index of user k after the xth round of transactions; α is the historical weight. For users k and t m Completed transaction volume; V k,x For user k, the total transaction volume published in session x; Let N represent the transaction status of user k; N represents the total number of counterparties in user k's previous transactions.
[0026] In a hybrid continuous two-way auction electricity transaction, the formula for calculating the combined value for both the buyer and seller is as follows:
[0027]
[0028] in, The comprehensive value for user k as the electricity purchaser; The comprehensive value for electricity seller k; and These are the quoted prices when user k acts as both the electricity buyer and the electricity seller, respectively; I k The integrity index of user k's transactions;
[0029] Step 3.2, Matching process:
[0030] A hybrid continuous two-way auction is adopted, in which the information of both parties is sorted according to composite value, bid, and credit, and the highest buyer's composite value wins. and the lowest seller composite value The process begins by determining whether a transaction has occurred. If the buyer's optimal composite value exceeds the seller's, a transaction is completed at the average price of both bids. The transaction continues until the buyer's optimal composite value is no longer higher than the seller's. The smart contract layer then adjusts the bids of users who failed to find a match and updates the transaction information until all pre-arranged matches are completed. Users who fail to complete a transaction in the market will trade directly with the main grid. The transaction price and quantity for each successfully matched user in each round will be determined according to the following formula:
[0031]
[0032] in, The price quoted by electricity buyer K; The price quoted by electricity seller J; The transaction quantities submitted by electricity buyer k and electricity seller j are respectively: the transaction price for electricity buyer k and electricity seller j is P. k,j ; Trading volume is Q k,j ;
[0033] Step 3.3, Equilibrium-based pricing strategy:
[0034] The system employs a pricing strategy based on market equilibrium values, automatically adjusting user prices according to the previous market equilibrium value. When market demand exceeds supply, the maximum transaction volume is determined by the seller's price; otherwise, it is determined by the buyer's price.
[0035] By adjusting the bids for the current round based on the equilibrium value of the previous round, the optimal matching for individuals and the maximum matching degree for the whole are achieved. The steps for adjusting bids are as follows:
[0036] Step 3.31: Based on the equilibrium value of the previous round, obtain the comprehensive value for the next round. The expression for step 3.31 is:
[0037]
[0038] Step 3.32: The current quote is derived by reverse induction of the user's credit score. The expression for step 3.32 is:
[0039]
[0040] Among them, O k (n+1) is the (n+1)th comprehensive matching value for user k; I k For users, the k-integrity index; The quoted price when user k is the electricity buyer; The price quoted when user k is the electricity seller.
[0041] Furthermore, step 3 also includes:
[0042] Step 3.4, Integrity Risk Reward and Punishment Mechanism Based on PoI Recognition Mechanism:
[0043] The algorithm for each user to compete for the right to record transactions in blocks is as follows:
[0044]
[0045] In the formula, H(·) represents the hash function; R k The root hash of all transactions by user k in the market; r k D is the random number that user k needs to find; D is the system's default base difficulty level; I k This represents the integrity index of user k;
[0046] Based on the algorithm for competing for block recording rights among users, user k first packages all of its transaction data, generates a complete list of transaction records, and calculates the root hash value R of the transaction data based on this list. k This serves as a summary of the current transaction record; subsequently, user k searches for a random number r that satisfies equation (6) through enumeration. k When it is discovered that there is When equation (6) is true, the consensus for this round is considered successful, meaning the user gains the right to record transactions, records the random number and root hash in the block, and broadcasts the packaged block to the entire network. Finally, when the other users receive the block broadcast by user k, they verify the user's integrity index I according to equation (6). k With random number r k The block is checked to see if it meets the difficulty requirements and whether the transaction data contained in the block is consistent with the local storage, i.e., whether the root hash matches, to verify the legality of the PoI and the correctness of the transaction data contained in the block. If the verification passes, the block will be added to the blockchain ledger, confirming it as the accounting result of a valid round of transactions in the current market. The user will then receive a reward of all transaction fees in the block to compensate for their resource consumption and obtain corresponding economic benefits. If the verification fails, the block will be rejected by the network.
[0047] After introducing the Proof-of-Installation (PoI) mechanism in a two-way electricity market, if there are N users participating in the transaction in the network, the probability that a certain user will obtain the right to record the current block is expressed as:
[0048]
[0049] In the formula p k The probability of user k obtaining the right to record the current block is given. The difficulty coefficient of a user obtaining the right to record the current block is related to their integrity score. The higher the integrity score, the greater the probability of a user obtaining the right to record the block and the higher the expected value of the reward.
[0050] The present invention has the following beneficial effects:
[0051] (1) By integrating sidechain technology into the power trading system, the functions of the main chain can be expanded, and frequent or typical trading activities can be migrated to the sidechain, which not only reduces the burden on the main chain, but also enhances the overall efficiency of the system.
[0052] (2) Compared with traditional centralized trading, the continuous two-way auction trading mechanism can bring higher economic benefits. Under this mechanism, the trading is based on the user's bid to allocate electricity resources, and the user's credit is the core of the trading;
[0053] (3) Implementing an IPFS cluster for data storage, compared with conventional data storage methods, this approach can improve data access speed while reducing overhead;
[0054] (4) A PoI consensus mechanism is adopted, which links the integrity index with the income. Users with high integrity have a higher probability of obtaining the right to record transactions, while users who default have a lower income due to a lower credit score. This forms an economic incentive of "rewarding those who keep their promises and harming those who break their promises" and suppresses the motivation to default. Attached Figure Description
[0055] Figure 1 This is a schematic diagram of the overall framework of the present invention.
[0056] Figure 2 This is a schematic diagram of the overall technical solution for the three-dimensional display portion of the present invention. Detailed Implementation
[0057] The following will be based on embodiments of the present invention. Figures 1-2 The technical solutions in the embodiments of the present invention will be clearly and completely described. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Unless otherwise specified, the technical means used in the embodiments are conventional means well known to those skilled in the art.
[0058] The overall architecture of the power trading system in this invention refers to Figure 1 The details are as follows:
[0059] In the transaction model, the data storage layer is responsible for storing all relevant data, including user profiles, sales data, and transaction records, as well as the system's own data, such as the database content of the transaction system. To reduce storage overhead, the model uses an IPFS cluster to store this information. Compared to traditional storage methods, this approach not only reduces costs but also improves data download efficiency.
[0060] The smart contract layer is the core of the transaction model's operation, with key functions of each layer executed through smart contracts. This includes smart contracts responsible for data storage, on-chain transaction processing, and access control. Specifically, the data storage smart contract is responsible for automatically saving and uploading transaction-generated data to the IPFS cluster, and for querying and managing the data; while the on-chain transaction smart contract is responsible for handling the transaction flow between users and electricity sellers, ensuring smooth transaction execution. In the smart contract layer, both the electricity seller and buyer need to submit a contract and confirm transaction details. Both parties will submit their actual electricity generation and consumption information to the smart meter, then settle transaction fees and grid access fees, and finally update the credit scores of both parties.
[0061] The trading model is a hybrid continuous two-way auction, in which the main power grid controls line dispatching, safety reviews, and the supply and demand balance of the electricity market. Users submit their demands to the trading market, and a clearing result is generated under the market matching mechanism. Finally, a smart contract completes the transfer of user assets, ensuring the fairness and transparency of the transaction.
[0062] This invention uses economic incentives to encourage both parties in a transaction to maintain their creditworthiness. The credit index of each party affects the difficulty of obtaining the right to record transactions in the blockchain; users with high credit indexes have a way to gain additional benefits by competing for this right. The market state is updated based on transaction information and smart contract rules. The first entity to successfully obtain the right to record transactions publicly shares the new state across the entire network. After verification by other entities, the new state takes effect, and the first entity to successfully obtain the right to record transactions receives a reward.
[0063] This invention proposes a power trading method based on sidechain technology and hybrid continuous bidirectional auction, comprising the following steps:
[0064] Step 1: Construct an electricity trading model based on sidechain technology:
[0065] Sidechain technology, as one of the key innovations in the blockchain field, forms a dual-chain architecture by combining a main chain and sidechains. This structure relies on a two-way anchoring mechanism to support the free flow of data between the main chain and sidechains. The introduction of sidechains extends the capabilities of the main chain, allowing frequently occurring transactions to be migrated to the sidechain. This not only reduces the burden on the main chain but also enhances the overall efficiency of the system, making it very suitable for building electricity trading models. In this sidechain-based electricity trading model, the dual-chain structure includes a main chain as the user blockchain and a sidechain as the electricity seller's blockchain. The nodes of the main chain are managed by the electricity buyers and are called user nodes; while the nodes of the sidechain are managed by the electricity sellers and are called electricity seller nodes. The two are connected through regulatory nodes controlled by a third-party regulatory authority. This layout (as shown in the image) Figure 2(As shown) it facilitates the exchange of transaction information between the main chain and side chains, and makes it easier for regulatory agencies to monitor energy transactions. Compared to a single-chain structure, the combination of the main chain and side chains not only reduces system load but also improves operational efficiency.
[0066] Step 2, Electricity trading process based on a dual-chain structure:
[0067] Step 2.1, User registration on the blockchain:
[0068] In the sidechain system managed by the power sector, users participate as nodes, requiring registration and uploading of their data to their respective nodes before a transaction. This on-chain operation allows both parties in a power transaction to monitor information flow in real time, effectively solving trust issues in power trading by leveraging the inherent properties of blockchain, such as data immutability and decentralization. A smart contract layer is used to verify user data and manage access permissions, enhancing the confidentiality of personal information. User account information includes personal details, electricity purchase address, transaction details, balance, and a credit score based on electricity purchase history.
[0069] Step 2.2, publish your electricity purchase request:
[0070] After registering, user nodes can publish their electricity purchase requests, including expected electricity consumption and time periods, to the power provider nodes on the sidechain through the main chain's regulatory nodes. These requests, verified by the regulatory nodes, are then broadcast to the power supply nodes on the main chain. The power supply nodes assess their capacity and pricing to determine if they can meet these requests and send detailed information about their power supply to the requesting user nodes via the regulatory nodes. Upon receiving the power supply details, users can select a suitable power supply node to confirm the transaction, and then both parties agree on the specific power supply volume, time, and fees. This dual-chain transaction structure effectively reduces system load and strengthens oversight of electricity transactions through regulatory nodes, preventing illegal activities and ensuring the legality and transparency of transactions.
[0071] Step 2.3, Generate and store transaction data:
[0072] Once both parties confirm the transaction details, the transaction process can begin, and a transaction data file will be generated based on the agreed-upon details. This file includes basic information about the electricity purchaser, basic information about the electricity sales node, transaction time, transaction volume, and transaction price. The generated detailed data file will be submitted to the regulatory node for review and stored on the regulatory node by a data storage smart contract.
[0073] Step 2.4, Transaction Execution and Data Management:
[0074] Through the review of regulatory nodes, both parties can conduct electricity transactions according to the agreed transaction details and transmit electricity through the distribution network according to the transaction time and amount specified in the agreement. The seller collects electricity fees from users through smart meters. After the electricity transmission is completed, a transaction detail data file is generated based on the actual transmitted electricity amount and transmission time, and submitted to the regulatory node for review. After confirmation, this data is stored in the IPFS cluster. Compared with traditional cloud server storage models, the IPFS off-chain storage solution has higher data transmission efficiency and enhances data privacy and security through hash-based access. The system updates user credit information based on the transaction behavior of user nodes. The entire trading platform can rate users based on their credit status; users with good credit can receive rewards, while users with poor credit need to pay a certain percentage of fines.
[0075] Due to the characteristics of blockchain, it offers high privacy and security. In the transaction model, stored transaction information is tamper-proof and traceable, while the transaction process is open and transparent, allowing users to intuitively track the entire process. This transaction information and results are stored in the IPFS cluster via smart contracts, unaffected by external factors. The introduction of sidechain technology lowers the overall load and improves operational efficiency, making it more suitable for handling high user volumes and loads in electricity trading scenarios. Furthermore, credit assessment based on user purchasing behavior and the implementation of reward and punishment mechanisms better incentivize user participation in electricity purchasing activities, reducing node defaults and ensuring the performance and rationality of the entire electricity trading process.
[0076] Step 3, Hybrid Continuous Two-Way Auction:
[0077] Step 3.1, Credit Assessment:
[0078] In the distributed electricity trading market, a user's credit score is quantified through their trading behavior, effectively representing their trading history. After a transaction concludes, the smart contract evaluates the participants' creditworthiness, including their historical credit and the completion rate of the current transaction. Particularly in hybrid continuous two-way auctions, where many-to-one transaction matching may occur, it is necessary to comprehensively consider the transaction completion status of the user and multiple parties.
[0079] This invention introduces a fusion integrity model based on historical values and actual completion rates. The transaction completion rate is determined by the number and volume of successful transactions by the user. In the x-th transaction matching result, user k has multiple transaction objects, and the set of these objects is t. m , where m = {1, 2, ..., M}. The transaction record is... The formula for calculating user k's integrity index is as follows:
[0080]
[0081] In the formula, Let be the integrity index of user k after the xth round of transactions; α is the historical weight, since the historical integrity index has important reference significance, therefore α is used; For users k and t m Completed transaction volume; V k,x For user k, the total transaction volume published in session x; is the transaction status of user k, used to measure whether a successful match has been completed (1 for success, 0 otherwise); N is the total number of counterparties in user k's previous round of transactions.
[0082] This model exhibits strong dynamic adaptability and integration. As the number of transactions increases, user behavior, whether preferential or fraudulent, will be readjusted by the evaluation system. To prevent power loss or economic damage caused by discrepancies between the power generation or consumption during transactions and the smart contract stipulations, the formula incorporates... As part of the contract completion rate and integrity index evaluation, the overall completion rate is comprehensively assessed.
[0083] In hybrid continuous two-way auction electricity trading, the formula for calculating the combined value for the buyer and seller in each round of bidding is as follows:
[0084]
[0085] In the formula: The comprehensive value for user k as the electricity purchaser; The comprehensive value for electricity seller k; and These are the quoted prices when user k acts as both the electricity buyer and the electricity seller, respectively; I k The integrity index of user k's transactions.
[0086] Step 3.2, Matching process:
[0087] Hybrid continuous two-way auction is a many-to-many trading method that allows participants to continuously adjust their bids within a certain period of time to achieve the optimal match between buyers and sellers, thereby completing the transaction. In this trading mechanism, the information of the trading parties is sorted according to their comprehensive value, bid, and credit. A transaction is triggered when the buyer's optimal comprehensive value is higher than the seller's optimal comprehensive value, and the transaction price is the arithmetic mean of the bids of both parties. The transaction continues until the buyer's optimal comprehensive value is no higher than the seller's optimal comprehensive value. Subsequently, the smart contract will correct the bids of users who failed to match and iteratively update the transaction information sequence until all preset matching items are completed. Unmatched users in the market clearing will automatically form a trading contract with the main grid. The transaction price and transaction volume of each successfully matched market participant are determined according to formula (3).
[0088]
[0089] In formula (3): The price quoted by electricity buyer K; The price quoted by electricity seller J; The transaction quantities submitted by electricity buyer k and electricity seller j are respectively: the transaction price for electricity buyer k and electricity seller j is P. k,j ; Trading volume is Q k,j .
[0090] Step 3.3, Equilibrium-based pricing strategy:
[0091] In hybrid two-way auction markets, participants struggle to make optimal bidding decisions in dynamic markets because they cannot access each other's bids and credit information in real time. To address this, a market equilibrium-based bidding strategy can be employed. This strategy automatically adjusts user bids based on the market's prior equilibrium value to enhance individual returns. When market demand exceeds supply, the maximum transaction volume is determined by the seller's bid; conversely, it is determined by the buyer's bid. To achieve Q... i,j Maximizing the match requires achieving the best and most complete match possible within the user's reserved price range. This is done by adjusting the current round's bid based on the equilibrium value of the previous round, aiming to achieve optimal matching for individuals and maximum overall matching accuracy. The specific steps for adjusting bids follow the principles described above.
[0092] Step 3.31: Based on the equilibrium value from the previous round, obtain the comprehensive value for the next round. The expression for Step 3.31 is:
[0093]
[0094] Step 3.32: The current quote is derived by reverse induction from the user's credit score. The expression for Step 3.32 is:
[0095]
[0096] Among them: O k (n+1) is the (n+1)th comprehensive matching value for user k; I k For users, the k-integrity index; The quoted price when user k is the electricity buyer; The price quoted when user k is the electricity seller.
[0097] Step 3.4, Integrity Risk Reward and Punishment Mechanism Based on PoI Recognition Mechanism:
[0098] Based on the user integrity assessment indicators proposed above, a reward and punishment mechanism can be established for users in transactions, increasing the cost of default for market participants and providing appropriate compensation to users with high integrity indices, so as to guide both parties in the transaction to weigh the pros and cons when calculating benefits, consciously fulfill the transaction contract, and abide by the transaction order. This paper improves the PoW consensus mechanism and proposes an integrity reward and punishment mechanism based on the PoI (Proof of Integrity) consensus mechanism, in which the risk of transaction integrity is controlled. Under this mechanism, the algorithm for the competitive block accounting rights of each user is shown in Equation (6):
[0099]
[0100] In the formula, H(·) represents the hash function; R k The root hash of all transactions by user k in the market; r k D is the random number that user k needs to find; D is the system's default base difficulty level; I k This represents the integrity index of user k.
[0101] Under the accounting right competition algorithm proposed in equation (6), the rules for a user to obtain the accounting right are as follows: User k first packages all of its transaction data, generates a complete list of transaction records, and calculates the root hash value R of the transaction data based on the list. k This serves as a summary of the current transaction record. Subsequently, user k searches for a random number r that satisfies equation (6) through enumeration. k When it is discovered that there is When equation (6) holds true, the consensus for this round is considered successful, meaning the user gains the right to record transactions, records the random number and root hash in the block, and broadcasts the packaged block to the entire network. Finally, when the other users receive the block broadcast by user k, they verify the user's integrity index I according to equation (6). k With random number r k The block is then evaluated to determine if it meets the difficulty requirements and to further verify if the transaction data contained within it matches local storage. This involves confirming the root hash matches, validating the PoI's legitimacy, and verifying the correctness of the transaction data within the block. If the verification passes, the block is officially added to the blockchain ledger, confirming it as a record of a valid round of transactions in the current market. Users receive a reward equal to all transaction fees in that block to compensate for their resource consumption and gain corresponding economic benefits. If the verification fails, the block is rejected by the network.
[0102] In a two-way electricity market, after the introduction of the PoI mechanism, if there are N users participating in the transaction in the network, the probability that a certain user obtains the right to record the current block can be expressed by equation (7):
[0103]
[0104] In the formula p k The probability that user k will obtain the right to record the current block.
[0105] As can be seen from equation (7), the difficulty coefficient for a user to obtain the right to record transactions in the current block is related to their integrity score. The higher the integrity score, the greater the probability of obtaining the right to record transactions and the higher the expected value of the return. This can achieve the effect of rewarding high-integrity subjects and punishing low-integrity subjects, thereby controlling the integrity risk of market transactions.
[0106] This invention employs a PoI consensus mechanism, which links integrity index with rewards. Users with high integrity have a higher probability of obtaining the right to record transactions, while users who default have lower rewards due to a decrease in their credit score. This creates an economic incentive of "rewarding those who keep their promises and harming those who break their promises," thereby suppressing the motivation to default.
[0107] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Any modifications, alterations, substitutions, or variations made by those skilled in the art to the technical solutions of the present invention without departing from the spirit of the present invention shall fall within the protection scope defined by the claims of the present invention.
Claims
1. A power trading method based on sidechain technology and hybrid continuous bidirectional auction, characterized in that, Includes the following steps: Step 1: Construct an electricity trading model based on sidechain technology; Step 2: Conduct electricity trading based on a dual-chain structure; Step 3: Hybrid continuous two-way auction.
2. The power trading method based on sidechain technology and hybrid continuous bidirectional auction as described in claim 1, characterized in that, In step 1, the electricity trading model includes a main chain that serves as the user's blockchain and a side chain that serves as the electricity seller's blockchain. The main chain and the side chain are connected through a regulatory node controlled by a third-party regulatory authority. The electricity trading model also includes a smart contract layer and a data storage layer; the data storage layer is used to store user data, electricity sales data, intrinsic data, and transaction data; the smart contract layer sets up data storage smart contracts, on-chain transaction smart contracts, and access control smart contracts.
3. The power trading method based on sidechain technology and hybrid continuous bidirectional auction according to claim 2, characterized in that, Step 2 includes: Step 2.1, User Registration: In the sidechain, users participate as nodes, registering and uploading their data to the data storage layer before transactions; the smart contract layer verifies user data and manages access permissions. Step 2.2, publish your electricity purchase request: After registration, users publish their electricity purchase requests, including expected electricity consumption and time periods, to the power provider nodes on the sidechain through the main chain's regulatory nodes. After verification by the regulatory nodes, the requests are broadcast to the power supply nodes on the main chain. The power supply nodes assess whether they can meet the electricity purchase request based on their capacity and pricing, and send the detailed information of the electricity they can provide to the user node that made the request through the regulatory nodes. After receiving the power supply details, the user selects a suitable power supply node to confirm the transaction, and then both parties agree on the power supply amount, time, and cost. Step 2.3, Generate and store transaction data: After both parties confirm the transaction details, the transaction process is initiated. A transaction data file is generated based on the agreed details. The transaction data file includes the basic information of the electricity purchaser, the basic information of the electricity sales node, the transaction time, the transaction volume, and the transaction price. The generated detailed data file will be submitted to the regulatory node for review and stored in the regulatory node by the smart contract layer. Step 2.4, Transaction Execution and Data Management: After review by the regulatory node, the two parties conduct electricity transactions according to the agreed transaction details and transmit electricity through the distribution network according to the transaction time and amount specified in the agreement. The seller collects electricity fees from users through smart meters. After the electricity transmission is completed, a transaction detail data file is generated based on the actual amount of electricity transmitted and the transmission time, and submitted to the regulatory node for review. After confirmation, the data will be stored in the IPFS cluster.
4. The power trading method based on sidechain technology and hybrid continuous bidirectional auction according to claim 3, characterized in that, Step 3 includes: Step 3.1, Credit Assessment: After the transaction is completed, the smart contract layer evaluates the participants' creditworthiness, including the user's historical credit and the current transaction completion rate; the transaction completion ratio will be determined by the number of successful transactions and the transaction volume. In the x-th transaction matching result, user k has multiple transaction objects, and its object set is v. m Where m = {1, 2, ..., M}, and the transaction records of k are... in, For users k and v m The transaction status, For users k and v m Completed transaction volume; User k's credit score calculation formula is: in, Let α be the integrity index of user k after the xth round of transactions; α is the historical weight. For users k and t m Completed transaction volume; V k,x For user k, the total transaction volume published in session x; Let N represent the transaction status of user k; N represents the total number of counterparties in user k's previous transactions. In a hybrid continuous two-way auction electricity transaction, the formula for calculating the combined value for both the buyer and seller is as follows: in, The comprehensive value for user k as the electricity purchaser; The comprehensive value for electricity seller k; and These are the quoted prices when user k acts as both the electricity buyer and the electricity seller, respectively; I k The integrity index of user k's transactions; Step 3.2, Matching process: A hybrid continuous two-way auction is adopted, in which the information of both parties is sorted according to composite value, bid, and credit, and the highest buyer's composite value wins. and the lowest seller composite value The process begins by determining whether a transaction has occurred. If the buyer's optimal composite value exceeds the seller's, a transaction is completed at the average price of both bids. The transaction continues until the buyer's optimal composite value is no longer higher than the seller's. The smart contract layer then adjusts the bids of users who failed to find a match and updates the transaction information until all pre-arranged matches are completed. Users who fail to complete a transaction in the market will trade directly with the main grid. The transaction price and quantity for each successfully matched user in each round will be determined according to the following formula: in, The price quoted by electricity buyer K; The price quoted by electricity seller J; The transaction quantities submitted by electricity buyer k and electricity seller j are respectively: the transaction price for electricity buyer k and electricity seller j is P. k,j ; Trading volume is Q k,j ; Step 3.3, Equilibrium-based pricing strategy: The system employs a pricing strategy based on market equilibrium values, automatically adjusting user prices according to the previous market equilibrium value. When market demand exceeds supply, the maximum transaction volume is determined by the seller's price; otherwise, it is determined by the buyer's price. By adjusting the bids for the current round based on the equilibrium value of the previous round, the optimal matching for individuals and the maximum matching degree for the whole are achieved. The steps for adjusting bids are as follows: Step 3.31: Based on the equilibrium value of the previous round, obtain the comprehensive value for the next round. The expression for step 3.31 is: Step 3.32: The current quote is derived by reverse induction of the user's credit score. The expression for step 3.32 is: Among them, O k (n+1) is the (n+1)th comprehensive matching value for user k; I k For users, the k-integrity index; The quoted price when user k is the electricity buyer; The price quoted when user k is the electricity seller.
5. The power trading method based on sidechain technology and hybrid continuous bidirectional auction according to claim 4, characterized in that, Step 3 also includes: Step 3.4, Integrity Risk Reward and Punishment Mechanism Based on PoI Recognition Mechanism: The algorithm for each user to compete for the right to record transactions in blocks is as follows: In the formula, H(·) represents the hash function; R k The root hash of all transactions by user k in the market; r k D is the random number that user k needs to find; D is the system's default base difficulty level; I k This represents the integrity index of user k; Based on the algorithm for competing for block recording rights among users, user k first packages all of its transaction data, generates a complete list of transaction records, and calculates the root hash value R of the transaction data based on this list. k This serves as a summary of the current transaction record; subsequently, user k searches for a random number r that satisfies equation (6) through enumeration. k When it is discovered that there is When equation (6) is true, the consensus for this round is considered successful, meaning the user gains the right to record transactions, records the random number and root hash in the block, and broadcasts the packaged block to the entire network. Finally, when the other users receive the block broadcast by user k, they verify the user's integrity index I according to equation (6). k With random number r k The block is checked to see if it meets the difficulty requirements and whether the transaction data contained in the block is consistent with the local storage, i.e., whether the root hash matches, to verify the legality of the PoI and the correctness of the transaction data contained in the block. If the verification passes, the block will be added to the blockchain ledger, confirming it as the accounting result of a valid round of transactions in the current market. The user will then receive a reward of all transaction fees in the block to compensate for their resource consumption and obtain corresponding economic benefits. If the verification fails, the block will be rejected by the network. After introducing the Proof-of-Installation (PoI) mechanism in a two-way electricity market, if there are N users participating in the transaction in the network, the probability that a certain user will obtain the right to record the current block is expressed as: In the formula p k The probability of user k obtaining the right to record the current block is given. The difficulty coefficient of a user obtaining the right to record the current block is related to their integrity score. The higher the integrity score, the greater the probability of obtaining the right to record the block and the higher the expected value of the reward.
Citation Information
Patent Citations
Virtual power plant transaction mechanism based on main-side chain structure
CN115511627A