Green electricity transaction recording method and system based on improved consensus algorithm

By improving the consensus algorithm to evaluate the contribution and difficulty coefficient of nodes in the green electricity trading system, dynamically adjusting weights, and electing accounting nodes to package blocks, the problem of single data processing in the existing green electricity trading system is solved, and more efficient and fair green electricity trading management is achieved.

CN120952779APending Publication Date: 2025-11-14STATE GRID BLOCKCHAIN TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510954913.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-11
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Existing green electricity trading systems lack the ability to process behavioral data of specific nodes in the energy system when dealing with cross-chain data, and the on-chain data has a single dimension, resulting in insufficient automation of transaction management.

Method used

An improved consensus algorithm is adopted to determine the contribution of a node by its power generation, storage capacity, and discharge capacity. The weight is adjusted by combining historical contribution and grid status. The node contribution factor and difficulty coefficient are dynamically evaluated, candidate accounting nodes are elected and voted on, and finally the target accounting node packages and records the blocks.

Benefits of technology

It enables multi-dimensional evaluation of node contributions, optimizes the supply and demand balance of the power trading system, improves the transparency, fairness and efficiency of the trading system, and incentivizes nodes to actively participate in green electricity trading.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120952779A_ABST
    Figure CN120952779A_ABST
Patent Text Reader

Abstract

The invention provides a green electricity transaction recording method and system based on an improved consensus algorithm. The method comprises the following steps: determining the contribution degree of each node in the current period based on the generating capacity, the electricity storage capacity and the discharge capacity of each node in the green electricity transaction system in the current period; based on the contribution degree of each node in the current period and the contribution degree of each node in the previous period, determining a contribution factor of each node in the current period; determining a difficulty coefficient of the period based on the contribution factor of the period; determining a plurality of candidate accounting nodes in each node; voting in the plurality of candidate bookkeeping nodes based on the contribution factor of each candidate bookkeeping node in the current period to obtain a target bookkeeping node; and carrying out block packaging and recording on transaction data corresponding to the green electricity transaction record request through the target accounting node. According to the embodiment of the invention, the data in each node is dynamically adjusted based on the multi-dimensional contribution evaluation, and the nodes are guided to actively participate in power generation or power storage so as to optimize the balance of power supply and demand in the power transaction system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of green electricity trading technology, and in particular to a green electricity trading recording method and system based on an improved consensus algorithm. Background Technology

[0002] In an era of actively addressing climate change and vigorously advocating for sustainable development, renewable energy, with its clean, environmentally friendly, and sustainable characteristics, is receiving increasing attention. As a key measure to promote the efficient use of renewable energy, green electricity trading is gradually being integrated into and becoming a core component of the electricity market.

[0003] While existing technologies involve processing transaction data through nodes to automate carbon emission reduction management in industrial parks, they still have certain limitations. These limitations mainly lie in their processing of cross-chain data, lack of processing of behavioral data of specific nodes in the energy system, and the single dimension of on-chain data. Summary of the Invention

[0004] This invention provides a method and system for recording green electricity transactions based on an improved consensus algorithm, which can solve at least one of the above-mentioned technical problems.

[0005] According to one aspect of the present invention, a method for recording green electricity transactions based on an improved consensus algorithm is provided, comprising:

[0006] In response to the green electricity trading record request of the green electricity trading system, based on the power generation, storage capacity and discharge of each node in the green electricity trading system in this cycle, the contribution of each node in this cycle is determined, and based on the contribution of each node in this cycle and the contribution of each node in the previous cycle, the contribution factor of each node in this cycle is determined.

[0007] Based on the contribution factor of each node in this cycle, the difficulty coefficient of this cycle is determined;

[0008] Based on the comparison between the contribution factor of each node in this period and the difficulty coefficient of this period, multiple candidate accounting nodes are determined among each node.

[0009] Based on the contribution factor of each candidate accounting node in this period, a vote is taken among the candidate accounting nodes to obtain the target accounting node;

[0010] The target ledger node packages and records the transaction data corresponding to the green electricity transaction record request into blocks.

[0011] According to another aspect of the present invention, a green electricity transaction recording device based on an improved consensus algorithm is provided, comprising:

[0012] The first determining module is used to respond to the green electricity trading record request of the green electricity trading system, and to determine the contribution of each node in the current cycle based on the power generation, storage capacity and discharge capacity of each node in the green electricity trading system in the current cycle, and to determine the contribution factor of each node in the current cycle based on the contribution of each node in the current cycle and the contribution of each node in the previous cycle.

[0013] The second determining module is used to determine the difficulty coefficient of the current period based on the contribution factor of each node in the current period.

[0014] The third determining module is used to determine multiple candidate accounting nodes among the nodes based on the comparison results between the contribution factor of each node in the current period and the difficulty coefficient of the current period.

[0015] The voting module is used to vote among the multiple candidate accounting nodes based on the current period contribution factor of each candidate accounting node to obtain the target accounting node;

[0016] The recording module is used to package and record the transaction data corresponding to the green electricity transaction record request into blocks through the target accounting node.

[0017] By employing the technical solution of this invention, in response to the green electricity trading record request of the green electricity trading system, the contribution of each node in the current cycle is determined based on its power generation, storage, and discharge. The contribution factor of each node in the current cycle is determined by comparing its contribution in the current cycle with that in the previous cycle. Based on the contribution factor of each node in the current cycle, the difficulty coefficient of each node in the current cycle is determined. By comparing the contribution factor and difficulty coefficient of each node in the current cycle, multiple candidate accounting nodes are determined from among the nodes. Voting is then conducted among the multiple candidate accounting nodes based on the contribution factor in the current cycle, and the target accounting node selected by the vote packages and records the transaction data corresponding to the green electricity trading record request into blocks. Therefore, this embodiment of the invention can dynamically adjust the data in each specific node based on multi-dimensional contribution evaluation, guiding nodes to actively participate in power generation or storage to optimize the balance of power supply and demand in the power trading system.

[0018] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0019] The accompanying drawings are provided for a better understanding of this solution and do not constitute a limitation of the invention. Wherein:

[0020] Figure 1This is a flowchart of a green electricity transaction recording method based on an improved consensus algorithm according to an embodiment of the present invention;

[0021] Figure 2 This is a sub-flowchart of a green electricity transaction recording method based on an improved consensus algorithm according to an embodiment of the present invention;

[0022] Figure 3 This is another sub-flowchart of a green electricity transaction recording method based on an improved consensus algorithm according to an embodiment of the present invention;

[0023] Figure 4 This is a structural block diagram of a green electricity transaction recording device based on an improved consensus algorithm according to an embodiment of the present invention;

[0024] Figure 5 This is a block diagram of an electronic device used to implement the methods of embodiments of the present invention. Detailed Implementation

[0025] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0026] Figure 1 This is a flowchart of a green electricity transaction recording method based on an improved consensus algorithm according to an embodiment of the present invention, as follows: Figure 1 As shown, the method includes the following steps S110-S150.

[0027] S110, in response to the green electricity trading record request of the green electricity trading system, based on the power generation, storage capacity and discharge capacity of each node in the green electricity trading system in this cycle, determine the contribution of each node in this cycle, and based on the contribution of each node in this cycle and the contribution of each node in the previous cycle, determine the contribution factor of each node in this cycle.

[0028] A green electricity transaction record request refers to a request initiated by a user (such as a power plant, energy storage device, or electricity consumer) in a green electricity transaction, aiming to query or obtain green electricity transaction records and related data within a specific period. This request typically includes information such as user authentication, the query time range, and the type of data to be queried.

[0029] In one embodiment, the green electricity transaction record request can be initiated by calling a request interface or through a smart contract. To ensure the transparency, fairness, and traceability of green electricity transaction records, the green electricity trading system responds to users' green electricity transaction record requests and determines the contribution of each node in a specified period based on data such as power generation, storage capacity, and discharge capacity of each node within that period.

[0030] Specifically, in some embodiments, S110 determines the contribution of each node in the current cycle based on the power generation, storage capacity, and discharge capacity of each node in the green electricity trading system, including the following steps:

[0031] Based on the grid status of the node in this cycle, determine the generation weight, energy storage weight, and discharge weight of the node in this cycle.

[0032] Based on the node's power generation weight, energy storage weight, and discharge weight in this cycle, the node's power generation, energy storage, and discharge in this cycle are weighted and summed to obtain the node's contribution in this cycle.

[0033] The grid status refers to the operational status of power generation, energy storage, and electricity consumption within a specific period, including power surplus, power shortage, and stable states. Power generation weight indicates the relative importance of a node's power generation behavior under a specific grid status. Energy storage weight indicates the importance of energy storage behavior under a specific grid status. Discharge weight indicates the importance of energy storage device discharge behavior when grid demand is high. Contribution refers to the quantitative measurement of a single node's comprehensive contribution to the green electricity trading system within a specific period, calculated by weighting data from power generation, energy storage, and electricity consumption.

[0034] Specifically, when the power grid experiences a power generation surplus, the system encourages nodes to store excess electricity by increasing the weight of energy storage behavior. In this case, the system may increase rewards for energy storage resources or provide higher incentives for energy storage. For example, on a night with abundant wind resources, wind farms may be operating at full capacity, but industrial and residential electricity demand may be low, potentially leading to a power generation surplus.

[0035] When the power grid experiences a power shortage, the system incentivizes energy storage devices to supply power to the grid by increasing the electricity consumption weight of discharge behavior. In this case, the system can use smart contracts to set higher discharge rewards to encourage energy storage devices to provide power, helping to alleviate the power shortage problem. For example, during the hot summer months, the extensive use of air conditioning and other cooling equipment leads to a sharp increase in electricity load, while power generation capacity cannot keep up, resulting in a power shortage.

[0036] When the power grid is in a stable state, the system encourages more green electricity production by optimizing the generation weights of power generation behavior. At this time, the system can optimize the allocation of power generation resources, promote the use of renewable energy, and reduce dependence on traditional energy sources. For example, during normal office hours on weekdays, industrial and commercial electricity consumption is relatively stable, and power generation equipment can operate stably, so the power grid is in a stable state.

[0037] As the green electricity trading market develops and changes, the power grid status will continue to fluctuate. Based on the power grid status of each node in this cycle, determining the generation weight, energy storage weight, and discharge weight of each node in this cycle enables the green electricity trading system to have adaptive capabilities. It can adjust the weights in real time according to the actual situation to adapt to different operating scenarios, thereby improving the overall performance of the green electricity trading system and its ability to cope with complex situations.

[0038] Specifically, the expression for calculating contribution is as follows:

[0039] MWCF total =w gen ·C gen +w store ·C store +w release ·C release

[0040] Among them, w gen For power generation weight; w store For energy storage weight; w release As the weighting factor for electricity consumption, C gen For power generation; C store For stored electricity; C release This represents electricity consumption.

[0041] For example, suppose the behavioral data of a certain accounting node in a green electricity trading system during this period is as follows: power generation w gen The energy storage capacity is 1000 megawatt-hours (W). store The power consumption is 200 megawatt-hours (W). release It is 800 megawatt-hours. Meanwhile, the power generation weight C gen The energy storage weight C is 0.5. store The value is 0.3, and the electricity weight C release The value is 0.2. The process for calculating the contribution of this period is as follows:

[0042] Energy storage contribution = 0.5 × 1000 = 500; Energy consumption contribution = 0.3 × 200 = 60; Energy consumption contribution = 0.2 × 800 = 160; Contribution for this cycle = 500 + 60 + 160 = 720.

[0043] By assigning different weights to power generation, energy storage, and electricity consumption, the importance of each factor in the green electricity trading system can be comprehensively considered, thus enabling a more scientific and accurate assessment of the contributions of participating nodes. This avoids the one-sidedness of assessments based on a single indicator, making the evaluation results more consistent with reality. Furthermore, setting reasonable weights can guide participating nodes to adopt behaviors more conducive to the overall operation of the system in green electricity trading. For example, appropriately increasing the weight of power generation can incentivize power generation companies to increase green electricity production; increasing the weight of energy storage helps promote the construction and effective utilization of energy storage facilities; and adjusting the weight of electricity consumption can guide users to use electricity rationally and optimize the energy consumption structure.

[0044] Furthermore, in some embodiments, based on the grid state of the node in this cycle, the generation weight, energy storage weight, and discharge weight of the node in this cycle are determined, specifically including the following steps:

[0045] Based on the power grid status of the node in this cycle and the power grid status in the previous cycle, determine the power grid status change information;

[0046] Based on the power grid state change information, the generation weight, energy storage weight, and discharge weight of the node in the previous cycle are adjusted to obtain the generation weight, energy storage weight, and discharge weight of the node in the current cycle.

[0047] The green electricity trading system is divided into multiple trading cycles based on specific time intervals, with multiple nodes trading electricity within each cycle. Grid state change information refers to the changes in the grid's state between the previous and current cycles. This information reflects the dynamic changes in grid operation, such as fluctuations in electricity demand, differences between generation and load, and the charging and discharging status of energy storage devices. These changes determine how the system adjusts the generation, storage, and discharging weights of each node. For example, if the grid was in a state of overgeneration in the previous cycle but experiences a power shortage in the current cycle, it indicates a change in grid state requiring appropriate adjustments. Conversely, if the grid may have stored a significant amount of electricity in the previous cycle, it may require more discharge to address the power shortage in the current cycle, which is also part of the grid state change. Furthermore, seasonal changes, weather variations, or other external factors leading to a surge or decrease in electricity consumption can also cause changes in grid state.

[0048] In the green electricity trading system, the weights from the previous cycle are dynamically adjusted based on the actual operating status of the power grid (e.g., power surplus, power shortage, or stable state). The aim is to ensure a balanced trading process, optimize the production, storage, and consumption of green electricity through flexible weight adjustments, respond to different grid demands, and maintain grid stability and efficient energy utilization.

[0049] For example, during periods of power surplus, generation activity may be weighted lower, while during periods of power shortage, generation activity may be weighted higher to encourage more electricity production. During periods of power surplus, the system increases the weight of energy storage to encourage nodes to store excess electricity, while during periods of power shortage, energy storage activity may be reduced or suspended to ensure priority power supply to loads. During periods of power shortage, the weight of discharge typically increases to support the grid's supply demand; while during periods of grid surplus, the weight of discharge decreases to avoid excessive consumption of energy storage.

[0050] Specifically, in some embodiments, such as Figure 2 As shown, in S110, the contribution factor of each node in the current period is determined based on its contribution in the current period and its contribution in the previous period, including the following steps:

[0051] S111, determine the historical contribution weight based on the ratio between the difficulty coefficient of the previous cycle and the difficulty coefficient of the current cycle;

[0052] S112, Determine the current contribution weight based on the historical contribution weight;

[0053] S113, based on the current contribution weight and the historical contribution weight, the contribution of each node in the current period and the contribution in the previous period are weighted and summed to obtain the contribution factor of each node in the current period.

[0054] Specifically, the historical contribution weight is obtained by comparing the difficulty coefficient of the previous cycle with that of the current cycle. This means the historical contribution weight can be dynamically adjusted based on the actual operation of the power grid to adapt to different grid conditions. For example, when the grid is experiencing overcapacity, the weight of current behavior on the contribution factor may be increased; conversely, during power shortages, historical performance may be more important. By comprehensively considering the impact of both historical and current behavior, sufficient rewards are given to nodes with excellent long-term performance, while the impact of current performance is not ignored.

[0055] Furthermore, the current contribution weight is calculated based on the historical contribution weights; specifically, the contribution weight for the current period is obtained by subtracting 1 from the historical contribution weights. The calculation expression for the contribution factor for this period is as follows:

[0056] MWCF final =α·MWCF history +(1-α)·MWCF current

[0057] Among them, MWCF final The contribution factor for this period; α is the weight of historical contribution; MWCF history Contribution to the previous cycle; MWCFcurrent Contribution to this cycle.

[0058] This embodiment, by comprehensively considering the contribution of nodes in the current and previous cycles and adjusting weights according to changes in grid conditions, can more reasonably evaluate the contribution factors of nodes. This process not only improves the fairness of contribution assessment but also enhances the adaptability of the grid to different operating states, contributing to more efficient power resource scheduling and optimization.

[0059] S120, Based on the contribution factor of each node in this cycle, determine the difficulty coefficient of this cycle.

[0060] In one embodiment, the average contribution factor of each node in the current period is taken to obtain the difficulty coefficient of the current period.

[0061] Specifically, a difficulty coefficient is generated based on the contribution factor in the current cycle within the blockchain via a smart contract, and then broadcast to the blockchain network. The expression for calculating the difficulty coefficient is as follows:

[0062]

[0063] Where D is the difficulty coefficient; N is the number of contributing factors in this cycle; MWCF final The contribution factor for this cycle is calculated to determine the difficulty coefficient. This not only allows for a reasonable assessment of the complexity of each accounting node in the accounting task, but also effectively adjusts resource allocation, optimizes the stability and operational efficiency of the green electricity trading system, and ensures that the system can still efficiently and fairly allocate accounting tasks in a dynamically changing environment.

[0064] In another embodiment, the difficulty coefficient of this cycle can be determined by taking the median of the contribution factors of each node in this cycle as the contribution factor of this cycle.

[0065] Specifically, the contribution factors of all nodes in the current cycle are sorted by size, and the median value is taken as the difficulty coefficient. For example, if the contribution factors of the five nodes in a certain cycle are 0.4, 0.55, 0.6, 0.75, and 0.9, then the median value is 0.6. Taking the median value is not affected by extreme values; if a node has an abnormally high contribution factor (e.g., 1.5), the median still stably reflects the mainstream level.

[0066] S130, based on the comparison results between the current period contribution factor and the current period difficulty coefficient of each node, multiple candidate accounting nodes are determined among each node.

[0067] Specifically, in some embodiments, S130 includes the following steps:

[0068] If the contribution factor of the first node in the current period is greater than the difficulty coefficient of the current period, the first node is determined as the candidate accounting node.

[0069] If the contribution factor of the second node in the current period is less than the difficulty coefficient in the current period, then the second node is determined not to be the candidate accounting node.

[0070] Specifically, all nodes within this cycle calculate their own contribution factor for this cycle and compare it with the difficulty coefficient. Nodes with a contribution factor greater than the difficulty coefficient are selected as candidate accounting nodes. The accounting declarations of all candidate accounting nodes are broadcast through the blockchain network. These declarations include the following: the node's MWCF... final Value; MWCF final Proof of value (including past transaction records and transaction times already recorded on the blockchain); verifiable behavioral data of each ledger node (such as power generation, energy storage, and discharge data); and digital signatures corresponding to each candidate ledger node.

[0071] For example, assuming a difficulty coefficient of 80, there are 5 nodes in the green electricity trading system this cycle: Node A, Node B, Node C, Node D, and Node E. Node A's contribution factor for this cycle is 80; Node B's is 65; Node C's is 90; Node D's is 60; and Node E's is 75. By comparing the contribution factor of each node with the difficulty coefficient, nodes with contribution factors greater than the difficulty coefficient are selected as candidate accounting nodes. Therefore, Nodes A, C, and E are the candidate accounting nodes. Nodes B and D are not candidate accounting nodes because their contribution factors are less than the difficulty coefficient.

[0072] By comparing contribution factors and difficulty coefficients, node selection can be based on their actual contribution, avoiding excessive favoritism towards certain nodes or over-concentration of accounting tasks, thus ensuring fairness. Furthermore, through smart contracts that automatically calculate and dynamically adjust difficulty coefficients and contribution factors, the system can adapt to grid load fluctuations, preventing nodes from being overburdened and ensuring the stable operation of the grid.

[0073] S140, based on the current period contribution factor of each of the candidate accounting nodes, a vote is taken among the multiple candidate accounting nodes to obtain the target accounting node.

[0074] Specifically, in some embodiments, such as Figure 3 As shown, S140 includes the following steps:

[0075] S141, control each node to vote for the candidate accounting node with the largest contribution factor in the current period among the multiple candidate accounting nodes based on the contribution factor of each candidate accounting node in the current period, and obtain the voting results of each node.

[0076] S142, based on the voting results of each node, determine the candidate accounting node with the highest number of votes as the target accounting node.

[0077] Specifically, each candidate ledger node is ranked according to its contribution factor for the current period. Each node votes for the candidate ledger node with the largest contribution factor (i.e., the best contribution). The voting mechanism involves each node casting its vote based on the candidate ledger node's contribution factor. The basis for node voting is the size of each candidate node's contribution factor within the current period; the larger the contribution factor, the higher the probability of the candidate node being selected. The number of votes received by each candidate node is counted and ranked, and the candidate node with the highest number of votes is selected as the target ledger node. If multiple nodes have the same number of votes, the system can set rules (such as prioritizing the node with the larger contribution factor, or through further voting) to break the tie.

[0078] For example, suppose there are three candidate ledger nodes, X, Y, and Z, and their contribution factors for this period are as follows: Node X: contribution factor 800MWh, Node Y: contribution factor 1000MWh, Node Z: contribution factor 900MWh. Since Node Y has the largest contribution factor, each node will vote for Node Y. Assume these three nodes participate in the vote, and the voting results are as follows: Node X votes for Node Y (largest contribution factor); Node Y votes for itself (largest contribution factor); Node Z votes for Node Y (largest contribution factor). Therefore, Node Y receives 3 votes, while Node X and Node Z each receive 0 votes. Therefore, Node Y is the target ledger node.

[0079] By ranking and voting based on contribution factors, the system ensures that the most contributing nodes receive priority in recording transactions. The entire election process is open, transparent, and fair. Furthermore, since the right to record transactions is elected based on contribution factors, this incentivizes nodes to provide more support for grid operation (such as power generation, energy storage, and power discharge), promoting the sustainable development of the green electricity trading system.

[0080] In one embodiment, to ensure the legitimacy and accuracy of candidate accounting nodes, after broadcasting the accounting declarations of all candidate accounting nodes through the blockchain network, all on-chain nodes verify their own accounting declarations. This verification process follows a series of strict verification rules to ensure that only nodes that meet the requirements are retained in the candidate accounting node list and ultimately obtain the right to record transactions. The verification rules are as follows:

[0081] (1) Verify the MWCF statement final Matching Behavioral Data. Verify that the data in the candidate accounting node's accounting statement is consistent with its behavioral data (such as historical power generation, storage capacity, and consumption). This rule ensures that candidate accounting nodes have not misrepresented or tampered with their historical behavioral data. For example, if node A declares its contribution factor as 500, but its historical power generation is 200 MWh, historical storage capacity is 100 MWh, and historical consumption is 150 MWh, then it must be verified whether these data are reasonable and consistent with the contribution factor recorded in the accounting statement. If these data are reasonable and consistent with the contribution factor recorded in the accounting statement, it means that it matches the behavioral data; otherwise, it does not match. Incompatible statements are invalid.

[0082] (2)MWCF final The verification process checks whether the proof data provided by the candidate ledger node matches the historical records stored on the blockchain. This step ensures that the data provided by the candidate ledger node is consistent with the system records, preventing data tampering. For example, if node B provides some power generation data as proof, the system will check whether this data matches the historical power generation records stored on the blockchain. If they do not match, the candidate ledger node's claim will be considered invalid.

[0083] (3) Verify digital signatures. Verify the digital signatures in the accounting statements of candidate ledger nodes to ensure that the statements are issued by genuine, legitimate nodes and have not been tampered with. Digital signatures are generated using public-key cryptography; only nodes with the correct private key can generate valid signatures. For example, each candidate ledger node attaches a digital signature to its accounting statement, and all on-chain nodes will verify the digital signature using the candidate ledger node's public key. If the digital signature is invalid, the candidate ledger node's statement will be removed.

[0084] In summary, accounting nodes whose accounting statements pass the above verification rules (1), (2), and (3) remain in the candidate list, awaiting subsequent voting or decision. If any verification fails, the accounting node will be removed from the list of candidate accounting nodes.

[0085] S150, the target ledger node packages and records the transaction data corresponding to the green electricity transaction record request into blocks.

[0086] Specifically, the target ledger node is selected and granted the right to record transactions based on the voting results. It is responsible for packaging the green electricity transaction records for the current period and generating a new block for recording. Green electricity transaction data includes, but is not limited to: electricity transaction data (such as power generation, electricity consumption, and electricity storage) and system reward data (such as reward tokens and node contributions). During the block packaging process, accounting rules must be met. That is, the total power generation (including power discharge) should equal the total power discharge (including electricity consumption and electricity storage). The total system rewards and the rewards received by the nodes must also be consistent. After generating the new block, the target ledger node saves the new block along with the contribution data of all participating nodes and the system reward distribution records. The target ledger node broadcasts the packaged new block to all nodes through the blockchain network, ensuring that all users can access and verify the content of the new block. Simultaneously, after receiving the new block, all nodes verify it according to the following verification rules: First, verify whether the transaction data within the block is complete, meets the requirements of the blockchain protocol, and confirms that the data has not been tampered with. Second, verify that the contribution data declared by the node in the new block is consistent with its voting and accounting rights information to ensure the correctness of the contribution data. Third, the verified node adds the new block to the local chain and updates the local ledger data to ensure the immutability of the blockchain.

[0087] Furthermore, the green electricity trading system incentivizes nodes based on the information recorded in new blocks. Specifically, nodes that successfully gain the right to record transactions will receive a certain number of tokens as a reward. The amount of the reward is determined based on the node's contribution to the blockchain system, its power generation, energy storage, and other data. For example, nodes that contribute more to power generation can receive more rewards.

[0088] The reward distribution method is based on the information recorded in the new block. The system will automatically execute the smart contract to distribute rewards to the nodes that have obtained the right to record transactions. The rewards include tradable assets such as tokens. Each node's reward will be sent directly to its preset wallet address to ensure the transparency and real-time nature of the rewards.

[0089] The green electricity trading system ensures transparency, fairness, and incentives through blockchain technology, voting mechanisms, and a reward system. By evaluating the contribution of ledger nodes, packaging and broadcasting blockchain blocks, and automating reward distribution via smart contracts, the system effectively promotes the trading and sustainable development of green electricity. Simultaneously, the decentralized nature and smart contract mechanism of the green electricity trading system enhance trading efficiency and system security.

[0090] Figure 4 This is a structural block diagram of a green electricity transaction recording device based on an improved consensus algorithm according to an embodiment of the present invention.

[0091] like Figure 4As shown, the green electricity transaction recording device based on the improved consensus algorithm may include:

[0092] The first determining module 510 is used to respond to the green electricity trading record request of the green electricity trading system, and to determine the contribution of each node in the current cycle based on the power generation, storage capacity and discharge capacity of each node in the green electricity trading system in the current cycle, and to determine the contribution factor of each node in the current cycle based on the contribution of each node in the current cycle and the contribution of each node in the previous cycle.

[0093] The second determining module 520 is used to determine the difficulty coefficient of the current period based on the current period contribution factor of each of the nodes.

[0094] The third determining module 530 is used to determine multiple candidate accounting nodes among the nodes based on the comparison results between the current period contribution factor and the current period difficulty coefficient of each node.

[0095] The voting module 540 is used to vote among the multiple candidate accounting nodes based on the current period contribution factor of each candidate accounting node to obtain the target accounting node.

[0096] The recording module 550 is used to package and record the transaction data corresponding to the green electricity transaction record request into blocks through the target accounting node.

[0097] In some embodiments, the first determining module 510 includes:

[0098] The first determining unit is used to determine the generation weight, energy storage weight and discharge weight of the node in this cycle based on the grid state of the node in this cycle.

[0099] The first weighted summation unit is used to perform a weighted summation of the power generation, energy storage, and discharge of the node in the current cycle based on the node's power generation weight, energy storage weight, and discharge weight in the current cycle, so as to obtain the node's contribution in the current cycle.

[0100] In some embodiments, the first determining module 510 further includes:

[0101] The second determining unit is used to determine power grid state change information based on the power grid state of the node in the current cycle and the power grid state in the previous cycle.

[0102] The adjustment unit is used to adjust the generation weight, energy storage weight, and discharge weight of the node in the previous cycle based on the power grid state change information, so as to obtain the generation weight, energy storage weight, and discharge weight of the node in the current cycle.

[0103] In some embodiments, the first determining module 510 further includes:

[0104] The third determining unit is used to determine the historical contribution weight based on the ratio between the difficulty coefficient of the previous cycle and the difficulty coefficient of the current cycle.

[0105] The fourth determining unit is used to determine the current contribution weight based on the historical contribution weight;

[0106] The first weighted summation unit is used to perform weighted summation on the contribution of each node in the current period and the contribution in the previous period based on the current contribution weight and the historical contribution weight, respectively, to obtain the contribution factor of each node in the current period.

[0107] In some embodiments, the second determining module 520 includes:

[0108] The averaging unit is used to average the contribution factors of each node in the current period to obtain the difficulty coefficient of the current period.

[0109] In some embodiments, the third determining module 530 includes:

[0110] The fifth determining unit is used to determine the first node as the candidate accounting node when the contribution factor of the first node in the current period is greater than the difficulty coefficient of the current period.

[0111] The sixth determining unit is used to determine that the second node is not the candidate accounting node if the contribution factor of the second node in the current period is less than the difficulty coefficient of the current period.

[0112] In some embodiments, the voting module 540 includes:

[0113] The control unit is used to control each of the nodes to vote on the candidate accounting node with the largest contribution factor in the current period among the multiple candidate accounting nodes based on the contribution factor of each candidate accounting node in the current period, so as to obtain the voting results of each node.

[0114] The seventh determining unit is used to determine the candidate accounting node with the highest number of votes as the target accounting node based on the voting results of each of the nodes.

[0115] The specific functions and examples of each module and submodule of the system in this embodiment of the invention can be found in the relevant descriptions of the corresponding steps in the above method embodiments, and will not be repeated here.

[0116] The acquisition, storage, and application of user personal information involved in the technical solution of this invention all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0117] According to embodiments of the present invention, the present invention also provides a system and a readable storage medium.

[0118] Figure 5 A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present invention is shown. Electronic device 800 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic device 800 may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0119] like Figure 5 As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. The RAM 803 may also store various programs and data required for the operation of the electronic device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0120] Multiple components in electronic device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of displays, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows electronic device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0121] The computing unit 801 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as the green electricity transaction recording method based on an improved consensus algorithm. For example, in some embodiments, the green electricity transaction recording method based on an improved consensus algorithm can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the green electricity transaction recording method based on an improved consensus algorithm described above can be performed. Alternatively, in other embodiments, computing unit 801 may be configured by any other suitable means (e.g., by means of firmware) to perform a green electricity transaction recording method based on an improved consensus algorithm.

[0122] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0123] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0124] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0125] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0126] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0127] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0128] It should be understood that the various forms of processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this invention can be achieved, and this is not limited herein.

[0129] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for recording green electricity transactions based on an improved consensus algorithm, characterized in that, include: In response to the green electricity trading record request of the green electricity trading system, based on the power generation, storage capacity and discharge of each node in the green electricity trading system in this cycle, the contribution of each node in this cycle is determined, and based on the contribution of each node in this cycle and the contribution of each node in the previous cycle, the contribution factor of each node in this cycle is determined. Based on the contribution factor of each node in this cycle, the difficulty coefficient of this cycle is determined; Based on the comparison between the contribution factor of each node in this period and the difficulty coefficient of this period, multiple candidate accounting nodes are determined among each node. Based on the contribution factor of each candidate accounting node in this period, a vote is taken among the candidate accounting nodes to obtain the target accounting node; The target ledger node packages and records the transaction data corresponding to the green electricity transaction record request into blocks.

2. The method according to claim 1, characterized in that, The contribution of each node in the green electricity trading system during the current cycle is determined based on the generation, storage, and discharge of each node in the current cycle, including: Based on the grid status of the node in this cycle, determine the generation weight, energy storage weight, and discharge weight of the node in this cycle. Based on the node's power generation weight, energy storage weight, and discharge weight in this cycle, the node's power generation, energy storage, and discharge in this cycle are weighted and summed to obtain the node's contribution in this cycle.

3. The method according to claim 2, characterized in that, The method for determining the generation weight, energy storage weight, and discharge weight of the node in this cycle based on the grid state of the node in this cycle includes: Based on the power grid status of the node in this cycle and the power grid status in the previous cycle, determine the power grid status change information; Based on the power grid state change information, the generation weight, energy storage weight, and discharge weight of the node in the previous cycle are adjusted to obtain the generation weight, energy storage weight, and discharge weight of the node in the current cycle.

4. The method according to claim 1, characterized in that, The determination of the contribution factor for each node in the current period based on its contribution in the current period and its contribution in the previous period includes: The historical contribution weight is determined based on the ratio between the difficulty coefficient of the previous cycle and the difficulty coefficient of the current cycle. Based on the historical contribution weights, determine the current contribution weight; Based on the current contribution weight and the historical contribution weight, the contribution of each node in the current period and the contribution in the previous period are weighted and summed to obtain the contribution factor of each node in the current period.

5. The method according to claim 1, characterized in that, The determination of the difficulty coefficient for the current period based on the contribution factors of each node in this period includes: The average contribution factor of each node in this cycle is taken to obtain the difficulty coefficient of this cycle.

6. The method according to claim 1, characterized in that, Based on the comparison results between the current period contribution factor and the current period difficulty coefficient of each of the nodes, multiple candidate accounting nodes are determined among the nodes, including: If the contribution factor of the first node in the current period is greater than the difficulty coefficient of the current period, the first node is determined as the candidate accounting node. If the contribution factor of the second node in the current period is less than the difficulty coefficient in the current period, then the second node is determined not to be the candidate accounting node.

7. The method according to claim 1, characterized in that, The process of voting among the candidate ledger nodes based on their contribution factors for the current period to obtain the target ledger node includes: Each node is controlled to vote on the candidate accounting node with the largest contribution factor in the current period among the multiple candidate accounting nodes, based on the contribution factor of each candidate accounting node in the current period, so as to obtain the voting results of each node. Based on the voting results of each node, the candidate accounting node with the highest number of votes is determined as the target accounting node.

8. A green electricity transaction recording device based on an improved consensus algorithm, characterized in that, include: The first determining module is used to respond to the green electricity trading record request of the green electricity trading system, and to determine the contribution of each node in the current cycle based on the power generation, storage capacity and discharge capacity of each node in the green electricity trading system in the current cycle, and to determine the contribution factor of each node in the current cycle based on the contribution of each node in the current cycle and the contribution of each node in the previous cycle. The second determining module is used to determine the difficulty coefficient of the current period based on the contribution factor of each node in the current period. The third determining module is used to determine multiple candidate accounting nodes among the nodes based on the comparison results between the contribution factor of each node in the current period and the difficulty coefficient of the current period. The voting module is used to vote among the multiple candidate accounting nodes based on the current period contribution factor of each candidate accounting node to obtain the target accounting node; The recording module is used to package and record the transaction data corresponding to the green electricity transaction record request into blocks through the target accounting node.

9. A green electricity transaction recording system based on an improved consensus algorithm, characterized in that, include: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.

10. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-7.