Method and apparatus for point-to-point power transaction consensus, and electronic device
By automatically selecting target transaction responders through a multi-indicator selection mechanism, the consensus process for point-to-point power transactions is simplified, consensus efficiency and data security are improved, a credit-oriented transaction system is constructed, and the problems of complexity and insufficient security of existing consensus algorithms are solved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA ELECTRIC POWER RESEARCH INSTITUTE CO LTD
- Filing Date
- 2025-10-17
- Publication Date
- 2026-06-09
AI Technical Summary
Existing peer-to-peer electricity trading consensus algorithms are complex and inefficient in the consensus process, and there is a security risk of node collusion, and the trust evaluation system is imperfect.
Through a multi-indicator selection mechanism, the target transaction responder with the highest matching degree with the electricity transaction demand information and constraints is automatically selected based on the electricity transaction demand information of the transaction demanders. All transaction responders compete on an equal footing, simplifying the consensus process and avoiding reliance on key nodes.
It improves consensus efficiency, enhances data security, simplifies the consensus process, enables flexible transaction matching, reduces the risk of node collusion, and builds a credit-oriented transaction system.
Smart Images

Figure CN122175684A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of power trading technology, and more specifically, relates to a method, apparatus, and electronic equipment for peer-to-peer power trading consensus. Background Technology
[0002] In related technologies, peer-to-peer (P2P) electricity trading has a certain foundation. In academic research, P2P electricity trading is mainly divided into fully-fledged P2P markets and community-based P2P markets. In a fully-fledged P2P market, users can directly negotiate prices and complete electricity transactions without central oversight. Community-based P2P markets, on the other hand, have individual communities as market participants, with community managers responsible for transactions within their communities and acting as intermediaries for communication between communities and higher-level networks.
[0003] In peer-to-peer electricity trading, security issues exist, including information leakage and tampering, lack of transparency in transaction information, and an imperfect trust evaluation system. Security solutions based on blockchain technology can ensure the authenticity, integrity, and full traceability of data during the electricity trading process through its trusted data sharing and peer-to-peer value transfer, thus promoting the standardized development of the peer-to-peer electricity trading market.
[0004] Reaching consensus in a blockchain system relies on a reliable consensus algorithm. This algorithm typically addresses which node initiates a proposal within a distributed system and how other nodes reach an agreement on that proposal. Due to differences in fault tolerance, node selection methods, and consistency levels, blockchain consensus algorithms can be categorized into election-based, proof-based, randomized, consortium-based, and hybrid types. However, existing consensus algorithms generally rely on competition or stake rules among blockchain nodes during the consensus process, resulting in a complex and inefficient consensus process. Summary of the Invention
[0005] The purpose of this application is to provide a method, apparatus, and electronic device for peer-to-peer electricity trading consensus, so as to simplify the consensus process of blockchain nodes and improve consensus efficiency.
[0006] A first aspect of this application provides a method for consensus on peer-to-peer electricity trading, comprising: In response to receiving multiple power trading demand information and constraints published by the power trading demand party, the system acquires multiple trading response information provided by the trading response party for the power trading; each of the multiple trading response information corresponds to the multiple power trading demand information. For the aforementioned electricity transaction, the following target transaction respondent matching operation is performed: For each transaction responder, the deviation value between each transaction response information and the corresponding information in the plurality of power transaction demand information is determined, thereby obtaining multiple deviation values for each transaction responder; Based on multiple deviation values of each transaction responder, an initial target responder is selected from the transaction responders; Determine the weights of multiple deviation values for each initial target responder; For each initial target responder, calculate the weighted sum of the weights of each deviation value and its corresponding deviation value among the multiple deviation values of the initial target responder to obtain the comprehensive deviation value of each initial target responder; A target transaction respondent is selected from the initial target respondents based on the comprehensive deviation value of each initial target respondent; In response to the consensus reached between the target transaction respondent and the transaction requester under the condition of satisfying the constraints, the consensus for completing this power transaction is determined.
[0007] A second aspect of this application provides an apparatus for peer-to-peer electricity trading consensus, comprising: The acquisition unit is configured to, in response to receiving multiple power trading demand information and constraints published by a power trading demand party, acquire multiple trading response information provided by a trading response party for the power trading; the multiple trading response information corresponds to the multiple power trading demand information respectively. The execution unit is configured to perform the following target transaction respondent matching operation for the power transaction: For each transaction responder, the deviation value between each transaction response information and the corresponding information in the plurality of power transaction demand information is determined, thereby obtaining multiple deviation values for each transaction responder; Based on multiple deviation values of each transaction responder, an initial target responder is selected from the transaction responders; Determine the weights of multiple deviation values for each initial target responder; For each initial target responder, calculate the weighted sum of the weights of each deviation value and its corresponding deviation value among the multiple deviation values of the initial target responder to obtain the comprehensive deviation value of each initial target responder; A target transaction respondent is selected from the initial target respondents based on the comprehensive deviation value of each initial target respondent; The determining unit is used to determine the completion of the electricity transaction consensus in response to the target transaction responder reaching a consensus with the transaction demander under the condition of satisfying the constraints.
[0008] A third aspect of this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of the method for peer-to-peer power trading consensus described above.
[0009] The beneficial effects of the method, apparatus, and electronic device for point-to-point power trading consensus provided in this application are as follows: based on the power trading demand information and constraints of the trading demand party, and based on multiple indicators, that is, multiple trading response information selection principles, the target trading response party with the highest matching degree with the power trading demand information can be automatically selected from the trading response parties. All trading response parties compete on an equal footing, without the need for the proof process and statistical process in the blockchain, which is more flexible, the consensus process is simpler, and the consensus efficiency is higher. Attached Figure Description
[0010] 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.
[0011] Figure 1a A flowchart illustrating a method for consensus on peer-to-peer electricity trading provided in an embodiment of this application; Figure 1b A schematic diagram of the consensus data preparation stage in the two-stage peer-to-peer electricity trading consensus mechanism provided in an embodiment of this application; Figure 1c A schematic diagram of the consensus data verification stage in the two-stage peer-to-peer power trading consensus mechanism provided in an embodiment of this application; Figure 1d This is a schematic diagram illustrating the on-chain operation of a peer-to-peer power trading block, provided in an embodiment of this application. Figure 2 A structural block diagram of an apparatus for peer-to-peer electricity trading consensus provided in an embodiment of this application; Figure 3 This is a schematic block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0012] 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.
[0013] In related technologies, peer-to-peer (P2P) electricity trading has a certain foundation. In academic research, P2P electricity trading is mainly divided into fully-fledged P2P markets and community-based P2P markets. In a fully-fledged P2P market, users can directly negotiate prices and complete electricity transactions without central oversight. Community-based P2P markets, on the other hand, have individual communities as market participants, with community managers responsible for transactions within their communities and acting as intermediaries for communication between communities and higher-level networks.
[0014] In peer-to-peer electricity trading, security issues exist, including information leakage and tampering, lack of transparency in transaction information, and an imperfect trust evaluation system. Security solutions based on blockchain technology can ensure the authenticity, integrity, and full traceability of data during the electricity trading process through its trusted data sharing and peer-to-peer value transfer, thus promoting the standardized development of the peer-to-peer electricity trading market.
[0015] Reaching consensus in a blockchain system relies on a reliable consensus algorithm. This algorithm typically addresses which node initiates a proposal within a distributed system and how other nodes reach a consensus on that proposal. Blockchain consensus algorithms differ in their fault tolerance, node selection methods, and levels of consistency. However, existing consensus algorithms generally rely on competition or stake rules among blockchain nodes during the consensus process, resulting in a complex and inefficient process. Blockchain consensus algorithms can be categorized into election-based, proof-based, randomized, consortium-based, and hybrid algorithms.
[0016] The proposed solution can flexibly select the target trading respondent with the highest matching degree based on multiple electricity trading demand information released by trading demanders, through a multi-index selection mechanism. In other words, this solution allows all trading respondents to compete equally based on different demands to find the optimal respondent, without requiring the proof and statistical processes of blockchain. This results in greater flexibility, a simpler consensus process, and higher consensus efficiency. Furthermore, the consensus mechanism in this application does not rely on key nodes, avoiding the security risks of node collusion and enhancing data security.
[0017] To make the objectives, technical solutions, and advantages of this application clearer, the following description will be provided in conjunction with the accompanying drawings and specific embodiments.
[0018] Please refer to Figure 1a , Figure 1a This is a flowchart illustrating a method for peer-to-peer electricity trading consensus provided in one embodiment of this application. This method can be executed by an energy trading platform. Optionally, the energy trading platform is built based on blockchain technology, specifically a decentralized electricity trading system. Such platforms, through smart contracts and distributed ledger technology, enable direct transactions between electricity supply and demand parties, eliminating the need for centralized dispatching by traditional power companies. The method may include the following steps S101-S103: S101. In response to receiving multiple power trading demand information and constraints published by the power trading demander, obtain multiple trading response information provided by the trading responseer for the power trading; the multiple trading response information corresponds to the multiple power trading demand information respectively. Optionally, the aforementioned electricity transaction can be either a transaction for purchasing electricity or a transaction for selling electricity.
[0019] Optionally, the aforementioned electricity trading demand information may be published by the trading demand party, specifically through broadcasting.
[0020] The transaction respondent is a potential party capable of transacting with the aforementioned transaction demander. For example, when the electricity transaction is a transaction to purchase electricity, the transaction demander is the buyer and the transaction respondent is the seller; when the electricity transaction is a transaction to sell electricity, the transaction demander is the seller and the transaction respondent is the buyer.
[0021] Optionally, the number of transaction responders can be one or more. When there are multiple transaction responders, the one with the highest credit score or credit rating will be given priority to respond.
[0022] The multiple electricity trading demand information includes: credit demand information, electricity demand information, and electricity price demand information; the multiple trading response information includes: credit response information, electricity response information, and electricity price response information. Specifically, credit demand information corresponds to credit response information, electricity demand information corresponds to electricity response information, and electricity price demand information corresponds to electricity price response information.
[0023] Optionally, if multiple parties with demand for electricity transactions are publishing their demand information, the party with the highest credit rating can be designated as the party whose demand needs to be met, that is, the party whose target transaction response needs to be confirmed. This party with demand will have priority in obtaining the right to publish block information.
[0024] S102. For the aforementioned power transaction, perform the target transaction respondent matching operation in steps S1021-S1025 as follows: S1021. For each transaction responder, determine the deviation value between each transaction response information and the corresponding information in the plurality of power transaction demand information to obtain multiple deviation values for each transaction responder. Optionally, the plurality of deviation values include: credit deviation value, electricity deviation value, and electricity price deviation value.
[0025] S1022. Based on multiple deviation values of each transaction responder, select an initial target responder from the transaction responders; Optionally, in the aforementioned S1022, the step of selecting an initial target responder from the transaction responders based on multiple deviation values of each transaction responder includes: When the electricity transaction is a transaction to purchase electricity, the transaction respondent with a non-negative deviation in both credit deviation and electricity deviation, and a non-positive deviation in electricity price, is selected as the initial target respondent. When the electricity transaction is an electricity sale transaction, the transaction respondent with both non-negative credit deviation and electricity price deviation values, and a non-positive electricity volume deviation value, is selected as the initial target respondent.
[0026] Optionally, the content published by the demand side may also include the lowest or highest acceptable threshold for each of the multiple electricity trading demand information, and the initial target responder must also meet the threshold requirement.
[0027] Optionally, the credit response information and credit demand information of the transaction respondent can be numerical values, such as ratings. These information can be used to indicate credit rating; the higher the value, the higher the credit rating. The credit deviation value of the transaction respondent refers to the difference between the credit response information and the credit demand information. A non-negative credit deviation value means that the transaction respondent's credit rating is not lower than the credit rating indicated by the credit demand information.
[0028] Optionally, the electricity response information and electricity demand information of the transaction responder can also be numerical values; the larger the value, the more electricity is consumed. The electricity deviation value of the transaction responder refers to the difference between the electricity response information and the electricity demand information of the transaction responder.
[0029] When electricity trading involves the purchase of electricity, the electricity demand information indicates the required electricity volume, and the electricity response information indicates the electricity volume that can be provided to the demander. The electricity deviation value of the responder is a non-negative deviation, meaning that the responder can provide the demander with no less than the required electricity volume indicated in the electricity demand information.
[0030] When electricity trading involves the sale of electricity, the electricity demand information indicates the amount of electricity currently available to the buyer, while the electricity response information indicates the required amount of electricity. A non-positive deviation in the electricity response value means that the respondent's required electricity is no greater than the amount of electricity available to the buyer as indicated by the electricity demand information.
[0031] Optionally, the electricity price response information and electricity price demand information of the transaction respondent can also be numerical values; the larger the value, the higher the electricity price. The electricity price deviation value of the transaction respondent refers to the deviation between the electricity price response information and the electricity price demand information of the transaction respondent.
[0032] When electricity trading involves the purchase of electricity, the electricity price response information indicates the current price of the electricity being sold, the electricity price demand information indicates the acceptable price, and the price deviation value of the trading respondent is a non-positive deviation, meaning that the current price of the trading respondent is not higher than the acceptable price indicated by the electricity price demand information.
[0033] When electricity trading involves the sale and purchase of electricity, the price response information indicates the acceptable price for the respondent, while the price demand information indicates the current price of the electricity being sold. The price deviation of the respondent is a non-negative deviation, meaning that the acceptable price indicated by the price response information is not lower than the current price of the electricity being sold, as indicated by the price demand information.
[0034] S1023. Determine the weights of multiple deviation values for each initial target responder; Optionally, the weights of multiple deviation values are summed to 1.
[0035] In some optional embodiments of this application, the weights of the plurality of deviation values include: credit deviation weights; determining the weights of the plurality of deviation values for each initial target responder includes: determining the credit deviation weight for each initial target responder; determining the credit deviation weight for each initial target responder includes: calculating the credit deviation weight for each initial target responder based on the initial credit deviation weight for each initial target responder, the reward variable of the credit weight, and the penalty variable of the credit weight.
[0036] Optionally, the data involved in the calculation of credit deviation weight can be data within a preset period of time, with the current time as the end time. This preset period of time can be flexibly set, such as 3 months.
[0037] Alternatively, the credit deviation weight can be determined through reward factors and penalty factors. Reward factors include system participation data and new energy consumption data, while penalty factors include the number of historical defaults.
[0038] In some optional embodiments of this application, calculating the credit deviation weight of each initial target responder based on the initial credit deviation weight, the reward variable of the credit weight, and the penalty variable of the credit weight may include the following steps S001-S002: S001. Sum the system participation data and new energy consumption information of each initial target responder to obtain the reward variable of credit weight for each initial target responder. Optionally, the system participation data and new energy consumption information of the i-th initial target responder are summed to obtain the reward variable of the credit weight of the i-th initial target responder, which is achieved through the following formula: in, Let be the reward variable representing the credit weight of the i-th initial target responder. For the user system engagement of the i-th initial target responder, For overall system participation, This refers to system participation data, which is the proportion of the initial target responder's system participation in the overall participation. For the renewable energy consumption data of the i-th initial target responder, For overall new energy consumption data, This refers to the proportion of the renewable energy consumption data of the i-th initial target responder in the total renewable energy consumption data.
[0039] In this application, i is any positive integer from 1 to M, and M refers to the number of initial target responders. The weights of multiple deviation values for each initial target responder are calculated in the same way.
[0040] S002. Calculate the credit deviation weight of each initial target responder based on the reward variable of the credit weight, the penalty variable of the credit weight, and the initial credit deviation weight.
[0041] The penalty variable for the credit weight of the i-th initial target responder can be determined by the following formula: Let be the penalty variable for the credit weight of the i-th initial target responder. The maximum penalty for breach of contract can be set to 0.2. Let be the historical number of defaults of the i-th initial target responder. The default penalty growth rate can be set to 0.3.
[0042] Optionally, the credit deviation weight of the i-th initial target responder can be calculated based on the reward variable of the credit weight, the penalty variable of the credit weight, and the initial credit deviation weight, using the following formula: in, As the initial credit deviation weight, is the credit bias weight of the i-th initial target responder.
[0043] In some optional embodiments of this application, the weights of the plurality of deviation values include: power deviation weights. Determining the weights of the plurality of deviation values for each initial target responder includes: determining the power deviation weight of each initial target responder. Determining the power deviation weight of each initial target responder includes: calculating the power deviation weight of each initial target responder based on the initial power deviation weight of each initial target responder, adjustment sensitivity, real-time power supply-demand ratio, and power supply-demand balance ratio.
[0044] In some optional embodiments of this application, the power deviation weight of the i-th initial target responder is calculated based on the initial power deviation weight, adjustment sensitivity, real-time power supply-demand ratio, and power supply-demand balance ratio of the i-th initial target responder, which can be achieved by the following formula: in, The weight of the power deviation for the i-th initial target responder. Let the initial power deviation weight be the i-th initial target responder. To adjust the sensitivity, it can be set to 2.0. Let be the real-time power supply-demand ratio for the i-th initial target responder. Let be the power supply and demand balance ratio of the i-th initial target responder.
[0045] Optionally, the data involved in the calculation of the electricity deviation weight is data from the transaction period.
[0046] In some optional embodiments of this application, the weights of the plurality of deviation values include: electricity price deviation weights; determining the weights of the plurality of deviation values for each initial target responder includes: determining the electricity price deviation weight for each initial target responder; determining the electricity price deviation weight for each initial target responder includes: calculating the electricity price deviation weight for each initial target responder based on the initial electricity price deviation weight for each initial target responder and the real-time supply-demand ratio of electricity.
[0047] Optionally, the electricity price deviation weight of the i-th initial target responder can be calculated based on the initial electricity price deviation weight and the real-time supply-demand ratio of electricity, using the following formula: Let the electricity price deviation weight be the i-th initial target responder. Let be the real-time power supply-demand ratio for the i-th initial target responder. The initial electricity price deviation weight is the weight of the i-th initial target response party.
[0048] S1024. For each initial target responder, calculate the weighted sum of the weights of each deviation value and the corresponding deviation value among the multiple deviation values of the initial target responder, and obtain the comprehensive deviation value of each initial target responder. Optionally, for the i-th initial target responder, the weighted sum of the weights of each deviation value and its corresponding deviation value among the multiple deviation values of the initial target responder is calculated to obtain the comprehensive deviation value of the i-th initial target responder, which can be achieved by the following formula: Let be the overall deviation value of the i-th initial target response. Let be the credit deviation value of the i-th initial target responder. Let be the power deviation value of the i-th initial target responder. Let be the electricity price deviation value for the i-th initial target responder. Let be the credit bias weight of the i-th initial target responder. The weight of the power deviation for the i-th initial target responder. The weight of the electricity price deviation for the i-th initial target responder.
[0049] S1025. Select a target transaction respondent from the initial target respondents based on the comprehensive deviation value of each initial target respondent; In some optional embodiments of this application, in S1025, selecting a target transaction responder from the initial target responders based on the comprehensive deviation value of each initial target responder includes: selecting the initial target responder with the smallest comprehensive deviation value as the target transaction responder.
[0050] The initial target responder with the smallest overall deviation value is the responder whose matching degree between multiple transaction response information and multiple power transaction demand information is the highest.
[0051] In some optional embodiments of this application, after selecting a target transaction respondent from the initial target respondents based on the comprehensive deviation value of each initial target respondent, the method further includes the following steps S01-S02: S01. Verify the target transaction responder matching operation at least once; S02. Upon successful verification, broadcast the target transaction respondent matching result at a set time interval to confirm that the transaction requester and the transaction respondent have no objection to the target transaction respondent matching result; the target transaction respondent matching result includes: the target transaction respondent information of the power transaction.
[0052] Optionally, the target transaction respondent information can be identity information that can uniquely identify the target transaction respondent.
[0053] S103. In response to the target transaction responder reaching a consensus with the transaction demander under the condition of satisfying the constraints, the consensus for completing this power transaction is determined.
[0054] In some optional embodiments of this application, the constraints include: a time constraint, wherein the consensus reached between the target transaction responder and the transaction demander under the condition of satisfying the constraints, and the consensus to complete the current power transaction, includes: the consensus reached between the target transaction responder and the transaction demander within the time constraint, and the consensus to complete the current power transaction.
[0055] Optionally, the aforementioned time constraint may specifically refer to the duration, which can be set to 2-10 minutes. If a transaction consensus is not reached under the time constraint, the transaction will be postponed to the next party with the next electricity transaction demand, based on the order in which the electricity transaction demand information was written.
[0056] It should be noted that the determination of whether the target transaction responder has reached a consensus with the transaction requester within the time constraint can also be carried out by detecting according to a preset cycle, and the detection frequency can be set as needed.
[0057] In this application, in order to better combine with the actual market situation, the weights of multiple deviation values can be flexibly adjusted to dynamically select the target transaction responder. Each weight is calculated based on market demand and supply, which makes it more flexible.
[0058] The beneficial effects of the method, apparatus, and electronic device for point-to-point power trading consensus provided in this application are as follows: based on the power trading demand information and constraints of the trading demand party, and based on multiple indicators, that is, multiple trading response information selection principles, the target trading response party with the highest matching degree with the power trading demand information can be automatically selected from the trading response parties. All trading response parties compete on an equal footing, without the need for the proof process and statistical process in the blockchain, which is more flexible, the consensus process is simpler, and the consensus efficiency is higher.
[0059] The following section, in conjunction with images, further illustrates the scheme of this application; for details, please refer to [link / reference]. Figure 1b and Figure 1c As shown, the method for consensus in peer-to-peer electricity trading provided in this application can be divided into two main stages: consensus data preparation and consensus data verification. In the consensus data preparation stage, all nodes can act as transaction requesters and submit multiple electricity transaction request information and constraints. In some cases, transaction requesters can also submit the lowest or highest acceptable threshold for each of the multiple electricity transaction request information. All nodes can have the same weight, and priority writing rights are determined according to time order. However, if more than two nodes issue electricity transaction request information at the same time, block writing permissions can be determined based on the nodes' past credit scores. Simultaneously, other nodes, acting as transaction responseers, write demand matching information, i.e., transaction response information. A comprehensive deviation value matching calculation is performed, and the target transaction responseer with the smallest comprehensive deviation value is selected, enabling optimal matching between buyers and sellers, thus completing the consensus data preparation stage. During the consensus data verification phase, the platform identifies the best-matching parties and conducts an initial network-wide broadcast. If there are no objections, a second network-wide broadcast verification is triggered. After both verifications, if no transaction nodes raise objections and the transaction constraints are met, the transaction is confirmed as completed, and the block information is uploaded to the blockchain. The broadcast content is the target transaction respondent matching result mentioned earlier. This result can include: electricity transaction demand information, target transaction respondent information, and the minimum comprehensive deviation value. Figure 1b and Figure 1c In this context, T1 represents the duration of the consensus data preparation phase, T2 represents the duration of the consensus data verification phase, and T1 + T2 refers to the total time for the block to be uploaded to the blockchain. The total duration of the consensus data preparation and verification phases, within the stated time constraint, indicates that the target transaction responder and the transaction requester have reached a consensus within the stated time constraint. The blockchain upload process can be found in [link to relevant documentation]. Figure 1d As shown.
[0060] Optionally, during the consensus data verification phase, the platform can first identify the target transaction respondent. After identifying the target transaction respondent, it initiates a first network-wide broadcast and checks if any transaction nodes have objections. If so, manual verification is performed, and consensus verification is triggered again. If not, the platform initiates a second network-wide broadcast and checks if other transaction nodes have objections. If so, manual verification is performed, and consensus verification is triggered again. If not, the transaction is confirmed, and the on-chain operation is completed. Optionally, each transaction node may include the transaction requester and each transaction respondent.
[0061] In some optional embodiments of this application, the parameters involved in this application can be divided and valued in combination with the actual business characteristics of power trading. The parameters are divided into three types: basic parameters, penalty parameters, and adjustment parameters. The basic parameters are the initial electricity price deviation weight, the initial electricity volume deviation weight, and the initial credit deviation weight.
[0062] To establish a credit-based evaluation system, the initial credit deviation weight is set relatively high. Penalty parameters are primarily based on user default variable formulas, including the maximum penalty value for default and the penalty growth rate. Adjustment parameters include overall system participation and overall renewable energy consumption data, as well as the adjustment sensitivity in the electricity deviation weight calculation formula. Parameter data covers dynamic adjustment across three dimensions: credit, electricity volume, and electricity price. Specific parameter data descriptions and values are shown in Table 2.
[0063] Table 2 Parameter Data Description Considering the differentiated behavior of the transaction responders, differentiated data simulations were conducted based on user system participation, renewable energy consumption data, and historical default counts. The assignment of values for credit scores, negative deviation variables in electricity consumption, and positive deviation variables in transaction prices were determined by combining user behavior analysis. Assuming that transaction intentions are submitted simultaneously and the overall market supply-demand ratio is consistent (set to 0.9), the market supply exceeds market demand. Data for the three transaction responders are shown in Table 3.
[0064] Table 3 User Data Table of Transaction Respondents After the data preparation was completed, the data was input for calculation and verification according to the dynamic consensus algorithm described above. The verification process data is shown in Table 4. The calculated comprehensive deviation value of the transaction responder was 1.0851 < 4.7731 < 8.986, and the best score was achieved by transaction responder 1.
[0065] Table 4. Verification Process of Simulated Data from Transaction Respondents Data validation, through a complete process of parameter assignment, weight calculation, and comprehensive deviation value determination, verified the logical rationality of the algorithm in a multi-user competitive scenario. Transaction responder 1, due to high participation, high absorption, and low default rate, had a high credit weight and low negative deviation in credit score. Although it had a high positive deviation variable in transaction price, its overall score was still the best. Transaction responder 3, due to low participation, low absorption, and high default rate, had a high negative deviation in credit score. Although it had no positive deviation variable in transaction price, its overall score was the lowest. This reflects the credit-oriented principle of the system design and verifies the effectiveness of the algorithm in incentivizing positive behavior and punishing default behavior. It guides users to restrain their default behavior, improving the impact of credit score on the success of electricity transactions. Simultaneously, in a supply and demand fluctuation scenario, electricity energy and price are dynamically adjusted with market changes, conforming to market orientation and business logic.
[0066] In this application's scheme, demand can be issued through nodes, time constraints can be set, two window periods can be established, and the system can broadcast twice across the network to confirm the matching of producers and sellers and complete the on-chain operation. The proposed priority block writing right based on the credit score of the transaction demander contributes to the construction of a credit system for the peer-to-peer electricity trading market.
[0067] This application's solution balances security and efficiency. Transaction requesters can initiate requests based on their own business operations and set time constraints. The credit score of the requester determines the priority for writing matching information. The consensus mechanism does not rely on key nodes, avoiding the security risk of node collusion. The consensus algorithm uses an objective function (the function used to calculate deviation values) for optimization, a simple and easy-to-operate method that maximizes the interests of both producers and sellers. Its scoring indicators and time constraints can be dynamically adjusted according to market supply and demand and the transactioner's own business situation. The credit score of the transaction party is a key element in the scoring, promoting on-chain autonomy, balancing transaction security and timeliness, and ensuring the maximization of the interests of both parties.
[0068] The beneficial effects of the method, apparatus, and electronic device for point-to-point power trading consensus provided in this application are as follows: based on the power trading demand information and constraints of the trading demand party, and based on multiple indicators, that is, multiple trading response information selection principles, the target trading response party with the highest matching degree with the power trading demand information can be automatically selected from the trading response parties. All trading response parties compete on an equal footing, without the need for the proof process and statistical process in the blockchain, which is more flexible, the consensus process is simpler, and the consensus efficiency is higher.
[0069] Corresponding to the method for consensus in peer-to-peer electricity trading in the above embodiments, Figure 2 This is a structural block diagram of an apparatus for peer-to-peer electricity trading consensus provided in one embodiment of this application. For ease of explanation, only the parts relevant to the embodiment of this application are shown. References Figure 2The device for consensus on peer-to-peer electricity trading includes: The acquisition unit 21 is used to acquire multiple transaction response information provided by the transaction responder for the power transaction in response to receiving multiple power transaction demand information and constraints published by the power transaction demander; the multiple transaction response information corresponds to the multiple power transaction demand information respectively; Execution unit 22 is configured to perform the following target transaction respondent matching operation for the power transaction: For each transaction responder, the deviation value between each transaction response information and the corresponding information in the plurality of power transaction demand information is determined, thereby obtaining multiple deviation values for each transaction responder; Based on multiple deviation values of each transaction responder, an initial target responder is selected from the transaction responders; Determine the weights of multiple deviation values for each initial target responder; For each initial target responder, calculate the weighted sum of the weights of each deviation value and its corresponding deviation value among the multiple deviation values of the initial target responder to obtain the comprehensive deviation value of each initial target responder; A target transaction respondent is selected from the initial target respondents based on the comprehensive deviation value of each initial target respondent; The determining unit 23 is used to determine the completion of the consensus for this power transaction in response to the target transaction responder reaching a consensus with the transaction demander under the condition of satisfying the constraints.
[0070] Optionally, the plurality of electricity trading demand information includes: credit demand information, electricity demand information, and electricity price demand information; the plurality of trading response information includes: credit response information, electricity response information, and electricity price response information; the plurality of deviation values includes: credit deviation value, electricity deviation value, and electricity price deviation value; the step of selecting an initial target responder from the trading responders based on the plurality of deviation values of each trading responder includes: When the electricity transaction is a transaction to purchase electricity, the transaction respondent with a non-negative deviation in both credit deviation and electricity deviation, and a non-positive deviation in electricity price, is selected as the initial target respondent. When the electricity transaction is an electricity sale transaction, the transaction respondent with both non-negative credit deviation and electricity price deviation values, and a non-positive electricity volume deviation value, is selected as the initial target respondent.
[0071] Optionally, the weights of the plurality of deviation values include: credit deviation weights; determining the weights of the plurality of deviation values for each initial target responder includes: determining the credit deviation weight for each initial target responder; determining the credit deviation weight for each initial target responder includes: calculating the credit deviation weight for each initial target responder based on the initial credit deviation weight for each initial target responder, the reward variable of the credit weight, and the penalty variable of the credit weight.
[0072] Optionally, the weights of the plurality of deviation values include: power deviation weights. Determining the weights of the plurality of deviation values for each initial target responder includes: determining the power deviation weight for each initial target responder. Determining the power deviation weight for each initial target responder includes: calculating the power deviation weight for each initial target responder based on the initial power deviation weight, adjustment sensitivity, real-time power supply-demand ratio, and power supply-demand balance ratio of each initial target responder.
[0073] Optionally, the weights of the plurality of deviation values include: electricity price deviation weights; determining the weights of the plurality of deviation values for each initial target responder includes: determining the electricity price deviation weight for each initial target responder; determining the electricity price deviation weight for each initial target responder includes: calculating the electricity price deviation weight for each initial target responder based on the initial electricity price deviation weight for each initial target responder and the real-time supply-demand ratio of electricity.
[0074] Optionally, selecting the target transaction respondent from the initial target respondents based on the comprehensive deviation value of each initial target respondent includes: selecting the initial target respondent with the smallest comprehensive deviation value as the target transaction respondent.
[0075] Optionally, after selecting a target transaction respondent from the initial target respondents based on the comprehensive deviation value of each initial target respondent, the device is further configured to: perform at least one verification on the target transaction respondent matching operation; Upon successful verification, the target transaction respondent matching result is broadcast at set time intervals to confirm that neither the transaction requester nor the transaction respondent has any objection to the target transaction respondent matching result; the target transaction respondent matching result includes: the target transaction respondent information of the power transaction.
[0076] Optionally, the constraints include a time constraint. The step of reaching a consensus with the transaction demander in response to the target transaction responder meeting the constraints and determining the completion of the power transaction consensus includes: reaching a consensus with the transaction demander within the time constraint and determining the completion of the power transaction consensus.
[0077] See Figure 3 , Figure 3 This is a schematic block diagram of an electronic device provided according to an embodiment of this application. Figure 3 The electronic device 300 in this embodiment may include one or more processors 301, one or more input devices 302, one or more output devices 303, and one or more memories 304. The processors 301, input devices 302, output devices 303, and memories 304 communicate with each other via a communication bus 305. The memories 304 store computer programs, including program instructions. The processors 301 execute the program instructions stored in the memories 304. Specifically, the processors 301 are configured to invoke the program instructions to perform the functions of each module / unit in the above-described device embodiments, for example... Figure 2 The functions of the acquisition unit 21, execution unit 22, and determination unit 23 are shown.
[0078] It should be understood that, in the embodiments of this application, the processor 301 may be a central processing unit (CPU), or it may be 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 may be a microprocessor or any conventional processor.
[0079] Input device 302 may include a touchpad, a fingerprint sensor (for collecting the user's fingerprint information and fingerprint orientation information), a microphone, etc., and output device 303 may include a display (LCD, etc.), a speaker, etc.
[0080] The memory 304 may include read-only memory and random access memory, and provides instructions and data to the processor 301. A portion of the memory 304 may also include non-volatile random access memory. For example, the memory 304 may also store device type information.
[0081] In specific implementations, the processor 301, input device 302, and output device 303 described in the embodiments of this application can execute the implementation methods described above in the embodiments of this application, or they can execute the implementation methods of the electronic devices described in the embodiments of this application, which will not be repeated here.
[0082] In another embodiment of this application, a computer-readable storage medium is provided. This computer-readable storage medium stores a computer program, which includes program instructions. When executed by a processor, the program instructions implement all or part of the processes in the methods described above. Alternatively, the computer program can instruct related hardware to complete the process. 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 any entity or device capable of carrying computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, 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, etc.
[0083] The computer-readable storage medium can be an internal storage unit of the electronic device in any of the foregoing embodiments, such as a hard disk or memory of the electronic device. The computer-readable storage medium can also be an external storage device of the electronic device, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the electronic device. Furthermore, the computer-readable storage medium can include both internal and external storage units of the electronic device. The computer-readable storage medium is used to store computer programs and other programs and data required by the electronic device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
[0084] This application provides a computer program product, which includes computer-executable instructions or a computer program. The computer-executable instructions or computer program are stored in a computer-readable storage medium. The processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the method described in this application.
[0085] 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, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. 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 implementations should not be considered beyond the scope of this application.
[0086] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the electronic devices and units described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0087] In the several embodiments provided in this application, it should be understood that the disclosed electronic devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units 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 an indirect coupling or communication connection through some interfaces or units, or it may be an electrical, mechanical, or other form of connection.
[0088] 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 the embodiments of this application, depending on actual needs.
[0089] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0090] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for consensus in peer-to-peer electricity trading, characterized in that, include: In response to receiving multiple power trading demand information and constraints published by the power trading demand party, the system acquires multiple trading response information provided by the trading response party for the power trading; each of the multiple trading response information corresponds to the multiple power trading demand information. For the aforementioned electricity transaction, the following target transaction respondent matching operation is performed: For each transaction responder, the deviation value between each transaction response information and the corresponding information in the plurality of power transaction demand information is determined, thereby obtaining multiple deviation values for each transaction responder; Based on multiple deviation values of each transaction responder, an initial target responder is selected from the transaction responders; Determine the weights of multiple deviation values for each initial target responder; For each initial target responder, calculate the weighted sum of the weights of each deviation value and its corresponding deviation value among the multiple deviation values of the initial target responder to obtain the comprehensive deviation value of each initial target responder; A target transaction respondent is selected from the initial target respondents based on the comprehensive deviation value of each initial target respondent; In response to the consensus reached between the target transaction respondent and the transaction requester under the condition of satisfying the constraints, the consensus for completing this power transaction is determined.
2. The method according to claim 1, characterized in that, The multiple electricity trading demand information includes: credit demand information, electricity demand information, and electricity price demand information; the multiple trading response information includes: credit response information, electricity response information, and electricity price response information; the multiple deviation values include: credit deviation value, electricity deviation value, and electricity price deviation value; the selection of an initial target responder from the trading responders based on the multiple deviation values of each trading responder includes: When the electricity transaction is a transaction to purchase electricity, the transaction respondent with a non-negative deviation in both credit deviation and electricity deviation, and a non-positive deviation in electricity price, is selected as the initial target respondent. When the electricity transaction is an electricity sale transaction, the transaction respondent with both non-negative credit deviation and electricity price deviation values, and a non-positive electricity volume deviation value, is selected as the initial target respondent.
3. The method according to claim 2, characterized in that, The weights of the multiple deviation values include: credit deviation weights; determining the weights of the multiple deviation values for each initial target responder includes: determining the credit deviation weight for each initial target responder; determining the credit deviation weight for each initial target responder includes: The credit deviation weight of each initial target responder is calculated based on the initial credit deviation weight, the reward variable of the credit weight, and the penalty variable of the credit weight.
4. The method according to claim 2, characterized in that, The weights of the plurality of deviation values include: a power deviation weight; determining the weights of the plurality of deviation values for each initial target responder includes: determining the power deviation weight for each initial target responder; determining the power deviation weight for each initial target responder includes: The power deviation weight of each initial target responder is calculated based on the initial power deviation weight, adjustment sensitivity, real-time power supply-demand ratio, and power supply-demand balance ratio of each initial target responder.
5. The method according to claim 2, characterized in that, The weights of the plurality of deviation values include: electricity price deviation weight; the weights for determining the plurality of deviation values for each initial target responder include: determining the electricity price deviation weight for each initial target responder; the determination of the electricity price deviation weight for each initial target responder includes: The electricity price deviation weight of each initial target responder is calculated based on the initial electricity price deviation weight and the real-time supply-demand ratio of electricity.
6. The method according to any one of claims 1 to 5, characterized in that, The selection of a target transaction respondent from the initial target respondents based on the comprehensive deviation value of each initial target respondent includes: The initial target responder with the smallest overall deviation value is selected as the target transaction responder.
7. The method according to claim 1, characterized in that, After selecting a target transaction respondent from the initial target respondents based on the comprehensive deviation value of each initial target respondent, the method further includes: The matching operation for the target transaction responder shall be verified at least once; Upon successful verification, the target transaction respondent matching result is broadcast at set time intervals to confirm that neither the transaction requester nor the transaction respondent has any objection to the target transaction respondent matching result; the target transaction respondent matching result includes: the target transaction respondent information of the power transaction.
8. The method according to claim 1, characterized in that, The constraints include: a time constraint, wherein the response is that the target transaction responder reaches a consensus with the transaction demander under the condition that the constraints are met, and determines to complete the consensus on this power transaction, including: In response to the consensus reached between the target transaction respondent and the transaction requester within the time constraint, the consensus for completing this power transaction is determined.
9. An apparatus for consensus in peer-to-peer electricity trading, characterized in that, include: The acquisition unit is configured to, in response to receiving multiple power trading demand information and constraints published by a power trading demand party, acquire multiple trading response information provided by a trading response party for the power trading; the multiple trading response information corresponds to the multiple power trading demand information respectively. The execution unit is configured to perform the following target transaction respondent matching operation for the power transaction: For each transaction responder, the deviation value between each transaction response information and the corresponding information in the plurality of power transaction demand information is determined, thereby obtaining multiple deviation values for each transaction responder; Based on multiple deviation values of each transaction responder, an initial target responder is selected from the transaction responders; Determine the weights of multiple deviation values for each initial target responder; For each initial target responder, calculate the weighted sum of the weights of each deviation value and its corresponding deviation value among the multiple deviation values of the initial target responder to obtain the comprehensive deviation value of each initial target responder; A target transaction respondent is selected from the initial target respondents based on the comprehensive deviation value of each initial target respondent; The determining unit is used to determine the completion of the electricity transaction consensus in response to the target transaction responder reaching a consensus with the transaction demander under the condition of satisfying the constraints.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 8.