Transaction electric quantity statistics and traceability method and device based on smart contract
By deploying transaction power statistics and traceability intelligent contracts on the alliance chain system, classification and transformation of power transaction contracts, the problem of low power statistics and traceability efficiency of electricity is solved, and the efficiency and accuracy of power statistics and traceability have been realized. Power power generation of power.
Patent Information
- Application Number
- CN202411267356.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2025-01-28
AI Technical Summary
When facing a wide variety of transaction types, a large number of transaction entities and complex transaction relationships, how to efficiently conduct electricity statistics and power traceability is a technical problem that needs to be solved urgently.
By deploying transaction power statistics and traceability smart contracts on the alliance chain system, obtaining various electricity transaction contracts to be statistical, classified as conventional transaction contracts, pre -transfer transaction contracts and deviation transaction contracts, and in the transaction contract and deviation transaction contract in advance The seller's transaction power and transaction relationship was transferred to the buyer, converted into a conventional trading contract, and statistical trading power and traceable electricity.
Reduce the types of electricity transaction contracts that need to be handled, simplify the transaction relationship, eliminate the interference of complex business logic, improve the efficiency of power statistics and power traceability, and calculate the balance distribution power. Difference between quantity.
Smart Images

Figure CN119379431A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of information technology and power trading, and in particular to a method and device for counting and tracing transaction electricity based on smart contracts. Background Art
[0002] In the statistical work of traded electricity, there are many types of market-based electricity transactions. Specifically, according to the trading cycle, it can be divided into annual transactions, medium- and long-term transactions, daily transactions, time-sharing transactions, spot transactions, etc.; according to the way of conducting transactions, it can be divided into centralized transactions, listed transactions, bilateral negotiation transactions, agency (power purchase) transactions, advance transfer transactions, deviation transactions, etc.; according to the generation method of the electricity traded electricity, it can be divided into thermal power transactions, hydropower transactions, etc. In the statistical work of medium- and long-term trading electricity, there are many market-based electricity trading entities and complex trading relationships. The trading entities specifically include power sales companies, power generation enterprises (power plants), power users, etc.; the trading relationships specifically include power sales companies purchasing electricity from power plants, power users purchasing electricity from power plants, power users purchasing electricity from power sales companies, power users purchasing electricity from another power user, and power sales companies purchasing electricity from another power sales company. In the face of a wide variety of transaction types, a large number of trading entities and complex trading relationships, how to efficiently conduct electricity statistics and electricity traceability is a technical problem that needs to be solved urgently. Summary of the invention
[0003] In view of this, the present application provides a method and device for transaction electricity statistics and traceability based on smart contracts, the main purpose of which is to improve the efficiency of electricity statistics and electricity traceability.
[0004] According to the first aspect of the present application, a transaction power statistics and traceability method based on a smart contract is provided, and a transaction power statistics and traceability smart contract is deployed on the constructed alliance chain system, including:
[0005] Obtain each power transaction contract to be counted;
[0006] Classifying the various power transaction contracts to obtain various original conventional transaction contracts, various prior transfer transaction contracts and various deviation transaction contracts;
[0007] Sequentially transferring the transaction quantity and transaction relationship of the seller in each of the prior transfer transaction contracts and each of the deviation transaction contracts to the buyer, so as to convert each of the prior transfer transaction contracts and each of the deviation transaction contracts into each of the regular transaction contracts;
[0008] The converted conventional transaction contracts and the original conventional transaction contracts are used as the conventional transaction contracts to be processed, and based on the transaction electricity in the conventional transaction contracts to be processed, the total transaction electricity and the traceable electricity corresponding to the conventional transaction contracts to be processed are determined respectively;
[0009] Based on the traceable electricity quantity, the balanced distribution electricity quantity corresponding to the corresponding conventional trading contract is calculated.
[0010] According to the second aspect of the present application, a transaction power statistics and traceability device based on a smart contract is provided, and a transaction power statistics and traceability smart contract is deployed on the constructed alliance chain system, and the device includes:
[0011] An acquisition unit, used for acquiring each power transaction contract to be counted;
[0012] A classification unit, used to classify the various power transaction contracts to obtain various original conventional transaction contracts, various prior transfer transaction contracts and various deviation transaction contracts;
[0013] A conversion unit, used to sequentially transfer the transaction quantity and transaction relationship of the seller in each of the prior transfer transaction contracts and each of the deviation transaction contracts to the buyer, so as to convert each of the prior transfer transaction contracts and each of the deviation transaction contracts into each of the regular transaction contracts;
[0014] A determination unit, configured to use each converted conventional transaction contract and each original conventional transaction contract as each conventional transaction contract to be processed, and determine the total transaction electricity and the traceable electricity corresponding to each conventional transaction contract to be processed respectively based on the transaction electricity in each conventional transaction contract to be processed;
[0015] The calculation unit is used to calculate the balanced distribution electricity corresponding to the corresponding conventional trading contract based on the traceable electricity.
[0016] According to the third aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned transaction electricity statistics and traceability method based on smart contracts is implemented.
[0017] According to the fourth aspect of the present application, an electronic device is provided, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein when the processor executes the program, the above-mentioned transaction electricity statistics and traceability method based on smart contracts is implemented.
[0018] By means of the above technical scheme, the present application provides a method and device for counting and tracing the transaction electricity based on smart contracts, by classifying each power transaction contract into a conventional transaction contract, a prior transfer transaction contract and a deviation transaction contract, and transferring the transaction electricity and transaction relationship of the seller in the prior transfer transaction contract and the deviation transaction contract to the buyer, that is, after converting into a conventional transaction contract, the transaction electricity and the traceable electricity are counted, which can reduce the types of power transaction contracts that need to be processed, simplify the transaction relationship, and thus simplify the electricity statistics and traceability process, eliminate the interference of complex business logic on electricity statistics and traceability, and thus improve the efficiency of electricity statistics and electricity traceability. In addition, by calculating the balanced distribution of electricity, the present application can reasonably allocate the part of the power generation enterprise's online electricity that exceeds the actual electricity consumption, thereby solving the problem of the difference between the power generation enterprise's online electricity and the actual electricity consumption.
[0019] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0021] Figure 1 A flow chart of a method for counting and tracing transaction power based on a smart contract provided in an embodiment of the present application is shown;
[0022] Figure 2 A schematic diagram of the process of the transaction electricity statistics and traceability smart contract method provided in an embodiment of the present application is shown;
[0023] Figure 3 A schematic diagram of the process of inputting raw data provided by an embodiment of the present application is shown;
[0024] Figure 4 A schematic diagram of the process of querying contract information provided by an embodiment of the present application is shown;
[0025] Figure 5 A schematic diagram of the distribution process of grid-connected electricity of a power generation enterprise provided in an embodiment of the present application is shown;
[0026] Figure 6 A schematic diagram of the distribution process of the actual power consumption (settlement power consumption) of a user provided in an embodiment of the present application is shown;
[0027] Figure 7A schematic diagram of a calculation process for balancing and distributing power provided in an embodiment of the present application is shown;
[0028] Figure 8 A schematic diagram of the structure of a transaction electricity quantity statistics and traceability device based on a smart contract provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0029] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0030] Faced with a wide variety of transaction types, a large number of trading entities and complex trading relationships, how to efficiently conduct electricity statistics and electricity traceability is a technical problem that needs to be solved urgently.
[0031] Based on this, the embodiment of the present invention provides a transaction electricity statistics and traceability method based on smart contracts, such as Figure 1 As shown, a transaction power statistics and traceability smart contract is deployed on the constructed alliance chain system. The method includes:
[0032] Step 101: Obtain each power transaction contract to be counted.
[0033] Among them, each power trading contract to be counted is a power trading contract that needs to be counted within a preset statistical period. The preset statistical period can be set according to actual business needs. For example, if the electricity data is set to be counted in months, each power trading contract to be counted is the power trading contract involved in the current statistical month. In addition, the power trading contract includes transaction information such as the seller, buyer, transaction name, transaction volume, transaction price (yuan / KWh), and transaction time. The transaction names include annual listing transactions for power grid companies to purchase electricity, annual centralized transactions, bilateral transactions, small hydropower sales company agency transactions, thermal power agency transactions, medium- and long-term listing transactions for power grid companies to purchase electricity, hydropower agency transactions, user-side pre-contract transfer transactions, power generation company-side pre-transfer transactions, user-side bilateral negotiated transactions for electricity, power generation company-side bilateral negotiated transactions for deviation electricity, user-side deviation electricity listing transactions, power generation company-side deviation electricity listing transactions, etc.
[0034] The embodiment of the present invention is mainly applicable to the statistics and traceability of annual power trading volume and trading volume. The execution subject of the embodiment of the present invention is a device or equipment capable of performing statistics and traceability of trading volume, such as a server.
[0035] For the embodiment of the present invention, in order to perform electricity statistics and electricity source tracing, it is necessary to obtain each electricity trading contract to be counted, for example, to obtain each electricity trading contract of the current statistical month (September). The embodiment of the present invention performs transaction electricity statistics based on transaction information and transaction contracts. Specifically, (seller, buyer, transaction name) can be used as the unique identifier of a contract, for example, (power sales company 001, user 001, transaction name 001), (power generation enterprise 001, user 001, transaction name 001), (power sales company 001, power sales company 002, transaction name 001), (power generation enterprise 001, power sales company 002, transaction name 001), (user 001, user 002, transaction name 001), etc.
[0036] Step 102: Classify the various power trading contracts to obtain various original conventional trading contracts, various prior transfer trading contracts and various deviation trading contracts.
[0037] Among them, the original conventional transaction contract is for users or power sales companies to purchase electricity from power generation enterprises. The prior transfer transaction contract and the deviation transaction contract are both power transactions on the user side and power generation enterprise side. Specifically, the power transaction on the user side is a power transaction in which both the seller and the buyer are users or power sales companies, and the power transaction on the power generation enterprise side is a power transaction in which both the seller and the buyer are power generation enterprises.
[0038] For the embodiment of the present invention, after obtaining each power trading contract, the power trading contracts can be classified in turn according to the time sequence of the medium- and long-term power transactions, and the power trading contracts can be classified into original conventional trading contracts, ex ante transfer trading contracts, and deviation trading contracts. Specifically, the trading contracts whose transaction types are user-side ex ante contract transfer transactions and power generation enterprise-side ex ante transfer transactions in the various power trading contracts are determined as the various ex ante transfer trading contracts; the trading contracts whose transaction types are user-side electricity bilateral negotiation transactions, power generation enterprise-side deviation electricity bilateral negotiation transactions, user-side deviation electricity listing transactions, and power generation enterprise-side deviation electricity listing transactions in the various power trading contracts are determined as the various deviation trading contracts; the trading contracts whose transaction types are power grid enterprise agency electricity purchase annual listing transactions, annual centralized transactions, bilateral transactions, small hydropower sales company agency transactions, thermal power agency transactions, power grid enterprise agency electricity purchase medium- and long-term listing transactions, and hydropower agency transactions in the various power trading contracts are determined as the various original conventional trading contracts.
[0039] After classification, the above-mentioned transaction contracts are processed in the corresponding processing order, which is the original regular transaction contract, the prior transfer transaction contract and the deviation transaction contract.
[0040] The embodiment of the present invention classifies medium- and long-term power transaction contracts into conventional transaction contracts, prior transfer transaction contracts, and deviation transaction contracts, and sequentially processes different types of medium- and long-term power transaction contracts based on these types, thereby reducing the types of power transaction contracts that need to be processed. On the premise of ensuring the correctness of the power statistics results, the power statistics process is simplified, the complexity of the processing process is reduced, and the interference of complex business logic on power statistics is eliminated.
[0041] Step 103: sequentially transfer the transaction electricity and transaction relationship of the seller in each of the prior transfer transaction contracts and each of the deviation transaction contracts to the buyer, so as to convert each of the prior transfer transaction contracts and each of the deviation transaction contracts into each of the regular transaction contracts.
[0042] The embodiment of the present invention takes the original conventional transaction contract as the basic data, and processes the user-side power transaction and the power transaction on the power generation enterprise side respectively, that is, the seller's traded electricity in the prior transfer transaction contract and the deviation transaction contract is allocated to the corresponding conventional power transaction contract according to the proportion of the seller's transaction contract electricity, thereby transferring the transaction electricity and the transaction relationship to the buyer.
[0043] For the above process, step 103 specifically includes: determining the original conventional transaction contracts related to the sellers in each of the prior transfer transaction contracts and each of the deviation transaction contracts; calculating the proportion of the transaction electricity in the original conventional transaction contract related to the seller; allocating the transaction electricity in each of the prior transfer transaction contracts and each of the deviation transaction contracts to the original conventional transaction contract or the new conventional transaction contract related to the buyer according to the proportion of the transaction electricity in the original conventional transaction contract related to the seller; and determining the allocated original conventional transaction contract or the new conventional transaction contract related to the buyer as the converted conventional transaction contracts.
[0044] Specifically, for the convenience of subsequent electricity statistics, the embodiment of the present invention simplifies the transaction contract information into (seller, buyer, regular transaction / pre-transfer transaction / deviation transaction, transaction electricity (yuan / KWh)), that is, before counting the electricity data, the embodiment of the present invention pre-processes the transaction contract data to remove information such as the transaction name, transaction price, and transaction time. When performing subsequent statistics, the embodiment of the present invention uses (seller, buyer) as the unique identifier for electricity statistics.
[0045] For example, the transaction information of a certain prior transfer transaction contract is (user 001, user 002, prior transfer transaction, transaction electricity Q). There are two original regular transaction contracts related to the seller (user 001), namely (power generation enterprise 001, user 001, regular transaction, transaction electricity Q1) and (power generation enterprise 002, user 001, regular transaction, transaction electricity Q2). Then, the transaction electricity is allocated according to the proportion of transaction electricity Q1 and transaction electricity Q2, and the following two transactions are generated: (power generation enterprise 001, user 002, regular transaction, transaction electricity Q×Q1 / (Q1+Q2)) and (power generation enterprise 002, user 002, regular transaction, transaction electricity Q×Q2 / (Q1+Q2)).
[0046] It should be noted that if, during the processing of a prior transfer transaction or a deviation transaction, the buyer has a transaction contract with the seller corresponding to the allocated transaction power, or the seller has a transaction contract with the buyer corresponding to the allocated transaction power, the transaction power is directly assigned to the power result in the prior transfer transaction or deviation transaction processing plus the transaction power of the existing transaction contract as the new transaction power of the transaction contract. Following the above example, if there is an original conventional transaction contract (power generation enterprise 001, user 002, conventional transaction, transaction power Q3), the new transaction power corresponding to the transaction is Q3+Q×Q1 / (Q1+Q2).
[0047] If, during the processing of a prior transfer transaction or a deviation transaction, the buyer does not have a transaction contract with the seller corresponding to the allocated transaction power, or the seller does not have a transaction contract with the buyer corresponding to the allocated transaction power, a new transaction contract is created, and the transaction power of the transaction contract is assigned to the power result during the prior transfer transaction or the deviation transaction. Following the above example, if there is no original conventional transaction contract between power generation enterprise 002 and user 002, a new conventional transaction contract is created (power generation enterprise 002, user 002, conventional transaction, transaction power Q×Q2 / (Q1+Q2)).
[0048] After processing the prior transfer transactions and deviation transactions, the transaction names of all transactions are "regular transactions". At this time, the embodiment of the present invention can simplify the transaction contract information used for electricity statistics to (seller, buyer, transaction electricity).
[0049] The embodiment of the present invention realizes the abstraction of the transaction relationship by abstracting the complex transaction relationship into a transaction contract in which one buyer corresponds to one seller, and ensures that the transaction relationship can be retained in the process of electricity statistics, which is convenient for the subsequent processing of the prior transfer transaction contract and the deviation transaction contract. In addition, the embodiment of the present invention can eliminate the transaction relationship between power users and power users or power sales companies, power sales companies and power users or power sales companies, and power generation enterprises and power generation enterprises through the processing of prior transfer transaction contracts and deviation transaction contracts, and process the transaction relationship as a transaction relationship between power users or power sales companies and power generation enterprises, thereby simplifying the transaction relationship.
[0050] Step 104: The converted conventional transaction contracts and the original conventional transaction contracts are used as the conventional transaction contracts to be processed, and based on the transaction electricity in the conventional transaction contracts to be processed, the total transaction electricity and the traceable electricity corresponding to the conventional transaction contracts to be processed are determined respectively.
[0051] Among them, the format of each pending regular transaction contract is (seller, buyer, transaction electricity), the seller is the power generation enterprise, and the buyer is the power user or power sales company.
[0052] For the embodiment of the present invention, the total transaction electricity can be calculated by adding up the transaction electricity in each conventional transaction contract to be processed. At the same time, the traceable electricity corresponding to each conventional transaction contract to be processed can be determined based on the transaction electricity in each conventional transaction contract to be processed. For this process, step 104 specifically includes: based on the transaction electricity in each conventional transaction contract to be processed, respectively calculating the actual electricity consumption and online electricity corresponding to each conventional transaction contract to be processed; based on the actual electricity consumption, online electricity and transaction electricity corresponding to each conventional transaction contract to be processed, determining the traceable electricity corresponding to each conventional transaction contract to be processed.
[0053] When calculating the actual electricity consumption corresponding to each pending conventional transaction contract, obtain the actual electricity consumption within the preset statistical period; determine the various first target conventional transaction contracts involved in the buyer of each pending conventional transaction contract in the pending conventional transaction contracts; calculate the first sum of the transaction electricity in each first target conventional transaction contract; calculate the proportion of the transaction electricity in each pending conventional transaction contract to the first sum; calculate the actual electricity consumption corresponding to each pending conventional transaction contract based on the proportion of the transaction electricity in each pending conventional transaction contract to the first sum, and the actual electricity consumption within the preset statistical period. The specific formula is as follows:
[0054] Actual electricity consumption (settlement electricity consumption) = actual electricity consumption within the preset statistical period × transaction electricity in a single transaction contract / the first sum of transaction electricity in each first target conventional transaction contract involved by the buyer
[0055] When calculating the online power corresponding to each pending conventional transaction contract, obtain the actual online power within the preset statistical period; determine the various second target conventional transaction contracts involved by the seller of each pending conventional transaction contract in the pending conventional transaction contracts; calculate the second sum of the transaction power in each second target conventional transaction contract; calculate the proportion of the transaction power in each pending conventional transaction contract to the second sum; calculate the online power corresponding to each pending conventional transaction contract based on the proportion of the transaction power in each pending conventional transaction contract to the second sum and the actual online power within the preset statistical period. The specific formula is as follows:
[0056] Online electricity = actual online electricity within the preset statistical period × transaction electricity in a single transaction contract / the second sum of transaction electricity in each second target conventional transaction contract involved by the seller
[0057] Furthermore, after calculating the actual power consumption and grid-connected power corresponding to each pending conventional transaction contract, compare the actual power consumption, grid-connected power, and transaction power, and take the minimum value of the three as the traceable power for each pending conventional transaction contract. The specific formula is as follows:
[0058] Traceable electricity = min (traded electricity, actual electricity consumption, online electricity)
[0059] Step 105: Calculate the balanced distribution electricity corresponding to the corresponding conventional trading contract based on the traceable electricity.
[0060] For the embodiment of the present invention, in order to calculate the balanced distributed electricity, step 105 specifically includes: determining each power generation enterprise and each user / power sales company involved in each of the pending conventional transaction contracts; calculating the proportion of remaining electricity of each of the power generation enterprises; calculating the untraced electricity corresponding to each of the pending conventional transaction contracts based on the actual electricity consumption and traceable electricity corresponding to each of the pending conventional transaction contracts; calculating the total untraced electricity of the pending conventional transaction contracts in which each user / power sales company is a seller among the users / power sales companies based on the untraced electricity corresponding to each of the pending conventional transaction contracts; calculating the balanced distributed electricity of the conventional transaction contracts related to each user / power sales company and each power generation enterprise based on the total untraced electricity of each user / power sales company and the proportion of remaining electricity of each power generation enterprise.
[0061] When calculating the proportion of surplus electricity of each power generation enterprise among various power generation enterprises, first calculate the sum of traceable electricity of pending regular transaction contracts involving each power generation enterprise as a seller, and the grid-connected electricity of each power generation enterprise; then subtract the grid-connected electricity of each power generation enterprise from the sum of traceable electricity to obtain the surplus electricity of each power generation enterprise; then calculate the sum of surplus electricity of each power generation enterprise based on the surplus electricity of each power generation enterprise; finally, calculate the proportion of surplus electricity of each power generation enterprise based on the surplus electricity of each power generation enterprise and the sum of surplus electricity. The specific formula is as follows:
[0062] The proportion of surplus electricity of power generation enterprises = the surplus electricity of power generation enterprises / the total surplus electricity of each power generation enterprise × 100%
[0063] After calculating the total untraceable electricity of each user / power sales company (buyer) and the remaining electricity ratio of each power generation enterprise (seller), locate the single transaction contract based on the buyer and seller, and calculate the balanced allocation electricity based on the total untraceable electricity and the remaining electricity ratio, and use the calculated balanced allocation electricity as the balanced allocation electricity of the transaction contract. The specific formula is as follows:
[0064] The balanced electricity distribution of a single transaction contract = the total untraceable electricity of the buyer × the proportion of the seller's remaining electricity.
[0065] It should be noted that if the seller and the buyer do not have a transaction contract but have a balanced allocation of electricity, a new transaction contract will be created and the balanced allocation of electricity of the transaction contract will be assigned the calculated balanced allocation of electricity.
[0066] The embodiment of the present invention reasonably distributes the portion of the power generation enterprise's grid-connected power that exceeds the actual power consumption of users (power users / power sales companies) through contract power tracing and balanced power distribution. It reasonably distributes the power generation enterprise's grid-connected power to users (power users / power sales companies) at the granularity of transaction contracts with reference to the power generation capacity of the power generation enterprise. The goal of allocating the power generation enterprise's grid-connected power to conventional transaction contracts can be achieved in two steps, which greatly improves the power tracing efficiency of transaction contracts and simplifies the logic of the power tracing process of transaction contracts.
[0067] In some embodiments, the transaction electricity statistics and transaction electricity traceability can be carried out in the form of smart contracts. Specifically, a consortium chain system is constructed, and a transaction electricity statistics and traceability smart contract is deployed on the consortium chain. When deploying the smart contract, write the transaction electricity statistics and traceability smart contract and conduct sufficient testing, initiate a smart contract chain request to put the transaction electricity statistics and traceability smart contract on the chain. Multiple nodes need to reach a consensus in the consortium chain system. After the consensus conditions are met, the smart contract is transferred to the "chained" state. After the smart contract installation process, the transaction electricity statistics and traceability smart contract is transferred to the "installation successful" state. After the smart contract deployment process, the transaction electricity statistics and traceability smart contract is transferred to the "deployment completed" state. When the "deployment completed" state is reached, the smart contract deployment process is completed.
[0068] It should be noted that an optional implementation method of the above-mentioned sufficient testing is to use multiple sets of simulated electricity trading data and electricity settlement data to run a test on the trading electricity statistics and traceability smart contract deployed in a test environment, and compare the results calculated by the trading electricity statistics and traceability smart contract with the data results pre-calculated using the above-mentioned multiple sets of simulated electricity trading data and electricity settlement data. If the two are consistent, it is determined that the tested trading electricity statistics and traceability smart contract has been fully tested.
[0069] It should be noted that the above-mentioned consensus reaching condition means that the number of consensus nodes in the alliance chain system that recognize the smart contract requested to be on the chain exceeds a certain proportion of the total number of consensus nodes in the alliance chain system that have voting rights for the smart contract. For example, the proportion is set to 50% or 2 / 3. Preferably, 50% is used as the setting proportion of the consensus reaching condition.
[0070] In addition, if the transaction electricity statistics and traceability smart contracts need to be adjusted according to the actual business scenario, the deployed smart contracts can be upgraded and the subsequent smart contract deployment process can be completed to deploy the transaction electricity statistics and traceability smart contracts for the new business scenario to the alliance chain system.
[0071] The embodiment of the present invention realizes the traceability of the electricity statistics process by using the transaction electricity statistics and traceability smart contract, so that the whole cycle can be traced. In addition, through the consensus protocol, it is guaranteed that only after the consent of multiple parties, the smart contract can be deployed to the alliance chain system to complete the electricity statistics and traceability, thereby ensuring the correctness, integrity, rationality and multi-party participation of the smart contract deployed to the alliance chain system.
[0072] In some embodiments, the transaction electricity statistics and traceability smart contract can also be split into multiple methods for implementation, and multiple data structures can be used to store original data, intermediate processing results, and final result data.
[0073] Specifically, the data structure of the smart contract for electricity trading statistics and traceability includes conventional electricity trading contracts, actual electricity consumption of users (settlement electricity), electricity consumption of power generation enterprises, electricity to be allocated by power generation enterprises, prior transfer trading contracts and deviation trading contracts. The smart contract method for electricity trading statistics and traceability includes inputting original data, querying contract information, prior transfer trading contracts / deviation trading contracts processing, power generation enterprise grid-connected electricity allocation, user actual electricity consumption (settlement electricity) allocation, contract traceability electricity allocation, and balanced allocation electricity calculation, such as Figure 2 As shown, the result of each of the above calculation processes or methods can be queried by calling the "Query Contract Information" method.
[0074] The conventional transaction contract data structure is used to store transaction contracts. The fields include transaction contract key value, buyer market number, seller market number, transaction electricity, actual electricity consumption (settlement electricity), online electricity, traceable electricity, balanced distribution electricity, etc. Among them, the four fields of transaction contract key value, buyer market number, seller market number, and transaction electricity are the data uploaded to the alliance chain system when the original data is entered. The remaining fields are the data that are continuously uploaded to the alliance chain system during the subsequent processing process. This can reduce the redundancy of the data uploaded to the alliance chain and improve the utilization efficiency of the data uploaded to the alliance chain.
[0075] The user's actual electricity consumption (settlement electricity) data structure is used to store the actual electricity consumption (settlement electricity) data of electricity users and power sales companies. The fields include electricity consumption key value, user's actual electricity consumption (settlement electricity), etc. This data structure completes data chaining in the alliance chain system when the original data is entered.
[0076] It should be noted that the transaction electricity statistics and traceability smart contract in the embodiment of the present invention does not distinguish between the user's actual electricity consumption and the user's settled electricity.
[0077] The power generation enterprise electricity data structure is used to store the original data, intermediate processing result data, and final result data of the power generation enterprise. The fields include the power generation enterprise's online power generation, traceable power generation, remaining power ratio, remaining power, etc. Among them, the online power generation is the original data, and the data is uploaded to the alliance chain system during the original data entry stage; the remaining fields are intermediate process data or result data generated in the subsequent processing process.
[0078] The data structure of the power generation enterprise's to-be-allocated electricity quantity is used to store the power plant numbers and the to-be-reallocated electricity quantity data used in the processing of prior transfer transaction contracts and deviation transaction contracts. The fields include the power plant number, to-be-reallocated electricity quantity data, etc.
[0079] The prior transfer transaction contract data structure is used to store the prior transfer transaction contract data. The fields include but are not limited to the prior transfer transaction contract key value, the buyer's market number, the seller's market number, and the transaction volume of the prior transfer transaction contract. All fields involved in this data structure are the original data that is uploaded to the alliance chain system during the original data entry stage.
[0080] The deviation trading contract data structure is used to store deviation trading contract data. The fields include the deviation trading contract key value, buyer market number, seller market number, trading volume of the deviation trading contract, etc. All fields involved in this data structure are the original data that is uploaded to the alliance chain system during the original data entry stage.
[0081] When entering the original data, the conventional power transaction contract, the actual power consumption of users (settlement power), the power generation enterprise's grid-connected power, the power generation enterprise's to-be-allocated power, the prior transfer transaction contract information, and the deviation transaction contract information are uploaded to the alliance chain system, such as Figure 3 As shown, the stub refers to the data stored in the alliance chain system.
[0082] When querying contract information, you can read and display the latest transaction contract information on the alliance chain system. Figure 4 As shown, by querying the contract information, the regular transaction contract information stored in the alliance chain system can be queried. The regular transaction contract information specifically includes the seller, buyer, transaction power, online power, user's actual power consumption (settlement power), balanced distribution power, etc. The stub refers to the data stored in the alliance chain system.
[0083] When processing prior transfer transaction contracts and deviation transaction contracts, the transaction electricity of the seller in the transaction contract is allocated to the buyer according to the actual situation based on the prior transfer transaction contract and the deviation transaction contract. Specifically, all transactions in which the seller participates in the transaction contract are read, and the proportion of the transaction electricity of each transaction contract in the total transaction electricity of all transaction contracts of the seller is calculated based on the transaction electricity of each transaction contract and the total transaction electricity of all transaction contracts of the seller. Then, the transaction electricity in the prior transfer transaction contract and the deviation transaction contract is allocated to the corresponding transaction contract in proportion (electricity proportion). If there is a transaction contract between the buyer and the seller, the electricity is added; if there is no transaction contract, a new transaction contract is created.
[0084] It should be noted that the pre-transfer transaction contract is carried out before the deviation transaction contract. Therefore, in the process of electricity statistics processing, the pre-transfer transaction contract needs to be processed first, and then the deviation transaction contract. In addition, in the process of processing the pre-transfer transaction contract, the order of processing the pre-transfer transaction contract will affect the proportion of the transaction electricity of a single transaction contract in the seller's transaction contract when processing a single pre-transfer transaction contract, and thus affect the processing result of the pre-transfer transaction contract.
[0085] Based on this, when processing a prior transfer transaction contract, the transaction electricity statistics and traceability smart contract sorts the prior transfer transaction contracts from large to small according to the transaction contract key value of the prior transfer transaction contract, and processes the prior transfer transaction contracts in the sorted order; similarly, the deviation transaction contract is processed in the same way.
[0086] It should be noted that both the prior transfer transaction contract and the deviation transaction contract have two types: the user side and the power generation enterprise side. The seller and the buyer of the prior transfer transaction contract and the deviation transaction contract on the user side are both power users or power sales companies, and the seller and the buyer of the prior transfer transaction contract and the deviation transaction contract on the power generation enterprise side are both power generation companies. That is, in the prior transfer transaction stage and the deviation transaction stage, only power users or power sales companies are allowed to transfer power resources with power users or power sales companies, or between power generation companies, and power resources are not allowed to be transferred between power generation companies and power users or power sales companies.
[0087] Since in conventional transaction contracts, power generation enterprises are sellers and power users and power sales companies are buyers, the prior transfer transaction contracts or deviation transaction contracts include two types of transaction contracts on the user side and the power generation enterprise side. In order to achieve the purpose of convenience and efficiency, the embodiments of the present invention use different methods to process the prior transfer transaction contracts and deviation transaction contracts when processing the two types of contracts.
[0088] During the processing process, since data can only be uploaded to the chain once a method is called, the prior transfer transaction contract and deviation transaction contract processing methods will uniformly upload the processing results to the alliance chain system after the entire processing process is completed.
[0089] When calculating the amount of electricity that a power generation enterprise has on-grid, Figure 5 As shown, according to the proportion of the transaction electricity in a single conventional transaction contract of a power generation enterprise in the total transaction electricity of all conventional transaction contracts of the power generation enterprise, the grid-connected electricity of the power generation enterprise within the preset statistical period is allocated to all conventional transaction contracts of the power generation enterprise, so as to complete the grid-connected electricity allocation of all power generation enterprises participating in the transaction within the preset statistical period.
[0090] When calculating the user's actual electricity consumption (settlement electricity), if Figure 6 As shown, according to the proportion of the transaction electricity in a single regular transaction contract of the power user / power sales company in the total transaction electricity of all regular transaction contracts of the power user / power sales company, the actual electricity consumption (settlement electricity) of the power user / power sales company is allocated to all regular transaction contracts of the power user / power sales company. In this way, the allocation of actual electricity consumption (settlement electricity) of all power users and power sales companies participating in the transaction within the preset statistical period is completed.
[0091] When calculating the contract traceability electricity, the smaller of the transaction electricity, actual electricity consumption (settlement electricity) allocation results, and online electricity allocation results of a single conventional transaction contract is taken, and the minimum value of the three is used as the contract traceability electricity of the conventional transaction contract. In this way, all conventional transaction contracts within the preset statistical period are traversed to complete the traceability electricity allocation of all conventional transaction contracts within the preset statistical period.
[0092] When calculating the balanced distribution of power, Figure 7 As shown, based on the untraceable settlement electricity of the buyer (power user / power sales company) of a single conventional transaction contract and the proportion of the remaining electricity of the seller (power generation enterprise) in the total remaining electricity of the power generation enterprise, the balanced allocation electricity of the conventional transaction contract is calculated. In this way, all conventional transaction contracts within the preset statistical period are traversed to complete the calculation of the balanced allocation electricity of all conventional transaction contracts within the preset statistical period.
[0093] The embodiment of the present invention provides a method for counting and tracing the transaction electricity based on smart contracts. By classifying each power transaction contract into a conventional transaction contract, a prior transfer transaction contract and a deviation transaction contract, and transferring the transaction electricity and transaction relationship of the seller in the prior transfer transaction contract and the deviation transaction contract to the buyer, that is, after converting into a conventional transaction contract, the transaction electricity and the traceable electricity are counted, which can reduce the types of power transaction contracts that need to be processed, simplify the transaction relationship, and thus simplify the electricity statistics and traceability process, eliminate the interference of complex business logic on electricity statistics and traceability, and thus improve the efficiency of electricity statistics and electricity traceability. In addition, the embodiment of the present invention can reasonably allocate the part of the power generation enterprise's online electricity that exceeds the actual electricity consumption by calculating the balanced distribution of electricity, thereby solving the problem of the difference between the power generation enterprise's online electricity and the actual electricity consumption.
[0094] Further, as Figure 1 The specific implementation of the method shown in the embodiment provides a transaction power statistics and traceability device based on smart contracts, such as Figure 8 As shown, the device includes: an acquisition unit 31, a classification unit 32, a conversion unit 33, a determination unit 34 and a calculation unit 35.
[0095] The acquisition unit 31 may be used to acquire various power transaction contracts to be counted.
[0096] The classification unit 32 can be used to classify the various power transaction contracts to obtain various original conventional transaction contracts, various prior transfer transaction contracts and various deviation transaction contracts.
[0097] The conversion unit 33 can be used to transfer the transaction electricity and transaction relationship of the seller in each of the prior transfer transaction contracts and each of the deviation transaction contracts to the buyer in turn, so as to convert each of the prior transfer transaction contracts and each of the deviation transaction contracts into each regular transaction contract.
[0098] The determination unit 34 can be used to take the converted conventional transaction contracts and the original conventional transaction contracts as the conventional transaction contracts to be processed, and based on the transaction electricity in the conventional transaction contracts to be processed, determine the total transaction electricity and the traceable electricity corresponding to the conventional transaction contracts to be processed.
[0099] The calculation unit 35 may be used to calculate the balanced distribution electricity corresponding to the corresponding conventional transaction contract based on the traceable electricity.
[0100] In some embodiments, the classification unit 32 can be specifically used to determine the transaction contracts whose transaction types are user-side ex ante contract transfer transactions and power generation enterprise-side ex ante transfer transactions among the various power trading contracts as the various ex ante transfer transaction contracts; determine the transaction contracts whose transaction types are user-side electricity bilateral negotiated transactions, power generation enterprise-side deviation electricity bilateral negotiated transactions, user-side deviation electricity listing transactions, and power generation enterprise-side deviation electricity listing transactions among the various power trading contracts as the various deviation transaction contracts; determine the transaction contracts whose transaction types are power grid enterprise agency electricity purchase annual listing transactions, annual centralized transactions, bilateral transactions, small hydropower sales company agency transactions, thermal power agency transactions, power grid enterprise agency electricity purchase medium- and long-term listing transactions, and hydropower agency transactions among the various power trading contracts as the various original conventional transaction contracts.
[0101] In some embodiments, the conversion unit 33 can be specifically used to determine the original conventional transaction contract related to the seller in each of the prior transfer transaction contracts and each of the deviation transaction contracts; calculate the proportion of transaction electricity in the original conventional transaction contract related to the seller; according to the proportion of transaction electricity in the original conventional transaction contract related to the seller, allocate the transaction electricity in each of the prior transfer transaction contracts and each of the deviation transaction contracts to the original conventional transaction contract or new conventional transaction contract related to the buyer; and determine the allocated original conventional transaction contract or the new conventional transaction contract related to the buyer as the converted conventional transaction contracts.
[0102] In some embodiments, the determining unit 34 may be specifically configured to add the transaction quantities in the respective conventional transaction contracts to be processed to obtain the total transaction quantity.
[0103] In some embodiments, the determination unit 34 includes: a first calculation module and a first determination module.
[0104] The first calculation module can be used to calculate the actual power consumption and the online power consumption corresponding to each of the pending conventional transaction contracts based on the transaction power in each of the pending conventional transaction contracts.
[0105] The first determination module may be configured to determine the traceable electricity corresponding to each of the pending conventional transaction contracts based on the actual electricity consumption, online electricity and transaction electricity corresponding to each of the pending conventional transaction contracts.
[0106] In some embodiments, the first calculation module can be specifically used to obtain actual electricity consumption within a preset statistical period; determine each first target conventional transaction contract involved in the buyer of each pending conventional transaction contract in the pending conventional transaction contracts; calculate the first sum of transaction electricity in each first target conventional transaction contract; calculate the proportion of transaction electricity in each pending conventional transaction contract to the first sum; calculate the actual electricity consumption corresponding to each pending conventional transaction contract based on the proportion of transaction electricity in each pending conventional transaction contract to the first sum and the actual electricity consumption within the preset statistical period.
[0107] In some embodiments, the first calculation module can also be specifically used to obtain the actual online power within a preset statistical period; determine the second target conventional transaction contracts involved in the seller of each of the pending conventional transaction contracts; calculate the second sum of the transaction power in each of the second target conventional transaction contracts; calculate the proportion of the transaction power in each of the pending conventional transaction contracts to the second sum; calculate the online power corresponding to each of the pending conventional transaction contracts based on the proportion of the transaction power in each of the pending conventional transaction contracts to the second sum and the actual online power within the preset statistical period.
[0108] In some embodiments, the calculation unit 35 includes: a second determination module and a second calculation module.
[0109] The second determination module may be used to determine each power generation enterprise and each user / power sales company involved in each conventional transaction contract to be processed.
[0110] The second calculation module can be used to calculate the proportion of remaining electricity of each power generation enterprise among the power generation enterprises.
[0111] The second calculation module can also be used to calculate the untraced electricity corresponding to each of the pending conventional transaction contracts based on the actual electricity consumption and traceable electricity corresponding to each of the pending conventional transaction contracts.
[0112] The second calculation module can also be used to calculate the total amount of untraceable electricity of the pending conventional transaction contracts in which each user / power sales company is a seller according to the untraceable electricity corresponding to each pending conventional transaction contract.
[0113] The second calculation module can also be used to calculate the balanced distribution electricity of the conventional trading contract related to each user / power sales company and each power generation enterprise based on the total untraceable electricity of each user / power sales company and the proportion of remaining electricity of each power generation enterprise.
[0114] In some embodiments, the second calculation module can be specifically used to calculate the total traceable electricity of the pending regular transaction contracts in which each of the power generation enterprises is a seller, and the online electricity of each power generation enterprise; subtract the online electricity of each power generation enterprise from the total traceable electricity to obtain the remaining electricity of each power generation enterprise; calculate the total remaining electricity of each power generation enterprise based on the remaining electricity of each power generation enterprise; calculate the proportion of remaining electricity of each power generation enterprise based on the remaining electricity of each power generation enterprise and the total remaining electricity.
[0115] In some embodiments, the device further comprises: a smart contract unit.
[0116] The smart contract unit can be used to conduct transaction electricity statistics and transaction electricity traceability by means of smart contracts.
[0117] It should be noted that for other corresponding descriptions of the functional units involved in the smart contract-based transaction power statistics and traceability device provided in the embodiment of the present invention, please refer to Figure 1 The corresponding description in will not be repeated here.
[0118] Based on the above Figure 1 The method shown in the embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned Figure 1 The transaction electricity statistics and traceability method based on smart contracts is shown.
[0119] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), including a number of instructions for enabling an electronic device (which can be a personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of the present application.
[0120] Based on the above Figure 1 The method shown, and Figure 8 In order to achieve the above-mentioned purpose, the embodiment of the present application also provides an electronic device, which can be a personal computer, a tablet computer, a server, or other network equipment, etc. The device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 The transaction electricity statistics and traceability method based on smart contracts is shown.
[0121] Optionally, the above-mentioned physical device may also include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.
[0122] Those skilled in the art will appreciate that the above-mentioned physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different arrangements of components.
[0123] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the above-mentioned physical device, and supports the operation of the information processing program and other software and / or programs. The network communication module is used to realize the communication between the components inside the storage medium, and the communication with other hardware and software in the information processing physical device.
[0124] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform, or by hardware.
[0125] The embodiment of the present invention classifies each power trading contract into a conventional trading contract, a pre-transfer trading contract and a deviation trading contract, and transfers the trading electricity and trading relationship of the seller in the pre-transfer trading contract and the deviation trading contract to the buyer, that is, after converting them into conventional trading contracts, the trading electricity and the traceable electricity are counted, which can reduce the types of power trading contracts that need to be processed, simplify the trading relationship, and thus simplify the electricity statistics and traceability process, eliminate the interference of complex business logic on electricity statistics and traceability, and thus improve the efficiency of electricity statistics and electricity traceability. In addition, the embodiment of the present invention can reasonably allocate the part of the power generation enterprise's online electricity that exceeds the actual electricity consumption by calculating the balanced distribution of electricity, thereby solving the problem of the difference between the power generation enterprise's online electricity and the actual electricity consumption.
[0126] Those skilled in the art will appreciate that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily necessary for implementing the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the description of the implementation scenario, or can be changed accordingly and located in one or more devices different from the present implementation scenario. The modules of the above-mentioned implementation scenario can be combined into one module, or can be further split into multiple submodules.
[0127] The above serial numbers of this application are only for description and do not represent the advantages and disadvantages of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of this application, but this application is not limited to them, and any changes that can be thought of by technicians in this field should fall within the scope of protection of this application.
Claims
1. A transaction electricity statistics and traceability method based on smart contracts, characterized in that: Deploy transaction power statistics and traceability smart contracts on the constructed alliance chain system, including: Obtain each power transaction contract to be counted; Classifying the various power transaction contracts to obtain various original conventional transaction contracts, various prior transfer transaction contracts and various deviation transaction contracts; Sequentially transferring the transaction quantity and transaction relationship of the seller in each of the prior transfer transaction contracts and each of the deviation transaction contracts to the buyer, so as to convert each of the prior transfer transaction contracts and each of the deviation transaction contracts into each of the regular transaction contracts; The converted conventional transaction contracts and the original conventional transaction contracts are used as the conventional transaction contracts to be processed, and based on the transaction electricity in the conventional transaction contracts to be processed, the total transaction electricity and the traceable electricity corresponding to the conventional transaction contracts to be processed are determined respectively; Based on the traceable electricity quantity, the balanced distribution electricity quantity corresponding to the corresponding conventional trading contract is calculated.
2. The method according to claim 1, characterized in that The classification of the power transaction contracts to obtain original conventional transaction contracts, prior transfer transaction contracts and deviation transaction contracts includes: Determine the transaction contracts whose transaction types are user-side prior contract transfer transactions and power generation enterprise-side prior transfer transactions among the power transaction contracts as the prior transfer transaction contracts; Determine the transaction contracts whose transaction types are user-side electricity bilateral negotiation transaction, power generation enterprise-side deviation electricity bilateral negotiation transaction, user-side deviation electricity listing transaction, and power generation enterprise-side deviation electricity listing transaction as the deviation transaction contracts; Determine the transaction contracts of the types of power transaction contracts, such as annual listing transaction for power purchase by power grid enterprises, annual centralized transaction, bilateral transaction, agency transaction for small hydropower sales companies, thermal power agency transaction, medium- and long-term listing transaction for power purchase by power grid enterprises, and hydropower agency transaction, as the original conventional transaction contracts; and / or The method further comprises: Smart contracts are used to count and trace the transaction volume.
3. The method according to claim 1, characterized in that The method of sequentially transferring the transaction quantity and transaction relationship of the seller in each of the prior transfer transaction contracts and each of the deviation transaction contracts to the buyer to convert each of the prior transfer transaction contracts and each of the deviation transaction contracts into each of the regular transaction contracts includes: Determine the original conventional transaction contracts related to the sellers in each of the prior transfer transaction contracts and each of the deviation transaction contracts; Calculate the proportion of traded electricity in the original conventional trading contract associated with the seller; Allocate the transaction electricity in each prior transfer transaction contract and each deviation transaction contract to the original conventional transaction contract or the new conventional transaction contract related to the buyer according to the proportion of the transaction electricity in the original conventional transaction contract related to the seller; The allocated original conventional transaction contract or the new conventional transaction contract related to the buyer is determined as each converted conventional transaction contract.
4. The method according to claim 1, characterized in that: Based on the transaction power in each of the conventional transaction contracts to be processed, the total transaction power is determined, including: Adding the transaction quantities in each of the pending conventional transaction contracts to obtain the total transaction quantity; and / or Based on the transaction power in each of the pending conventional transaction contracts, determining the traceable power corresponding to each of the pending conventional transaction contracts includes: Based on the transaction power in each of the pending conventional transaction contracts, respectively calculate the actual power consumption and the grid-connected power corresponding to each of the pending conventional transaction contracts; Based on the actual electricity consumption, online electricity and transaction electricity corresponding to each of the pending conventional transaction contracts, the traceable electricity corresponding to each of the pending conventional transaction contracts is determined.
5. The method according to claim 4, characterized in that Based on the transaction power in each of the conventional transaction contracts to be processed, calculating the actual power consumption corresponding to each of the conventional transaction contracts to be processed, including: Obtain the actual power consumption within the preset statistical period; Determining each first target conventional transaction contract involved by the buyer of each of the conventional transaction contracts to be processed; Calculating a first sum of transaction electricity in each of the first target conventional transaction contracts; Calculating the ratio of the transaction electricity volume in each of the pending conventional transaction contracts to the first total volume; Calculating the actual power consumption corresponding to each of the pending conventional transaction contracts according to the proportion of the transaction power in each pending conventional transaction contract to the first total and the actual power consumption within the preset statistical period; and / or Based on the transaction power in each of the pending conventional transaction contracts, the grid-connected power corresponding to each of the pending conventional transaction contracts is calculated, including Obtain the actual Internet power consumption within the preset statistical period; Determining each second target conventional transaction contract involved by the seller of each of the conventional transaction contracts to be processed; Calculating a second sum of the traded electricity in each of the second target conventional trading contracts; Calculating the ratio of the transaction electricity volume in each of the pending conventional transaction contracts to the second total; The online power corresponding to each of the pending regular transaction contracts is calculated based on the proportion of the transaction power in each pending regular transaction contract to the second total and the actual online power in the preset statistical period.
6. The method according to claim 4, characterized in that The calculating, based on the traceable electricity quantity, the balanced distribution electricity quantity corresponding to the corresponding conventional transaction contract comprises: Determine each power generation enterprise and each user / power sales company involved in each of the conventional transaction contracts to be processed; Calculate the proportion of surplus electricity of each power generation enterprise among the power generation enterprises; Calculate the untraceable electricity corresponding to each of the pending conventional transaction contracts according to the actual electricity consumption and traceable electricity corresponding to each of the pending conventional transaction contracts; According to the untraceable electricity corresponding to each of the pending conventional transaction contracts, calculate the total untraceable electricity of the pending conventional transaction contracts in which each user / power sales company in the aforementioned users / power sales companies is a seller; Based on the total untraceable electricity of each user / power sales company and the proportion of surplus electricity of each power generation enterprise, the balanced allocated electricity of the conventional transaction contracts related to each user / power sales company and each power generation enterprise is calculated.
7. The method according to claim 6, characterized in that The calculating the remaining electricity proportion of each power generation enterprise among the power generation enterprises comprises: Calculate the total traceable electricity of the pending conventional transaction contracts in which each power generation enterprise is a seller, and the grid-connected electricity of each power generation enterprise; Subtracting the grid-connected power of each power generation enterprise from the total traceable power to obtain the remaining power of each power generation enterprise; Calculating the total amount of remaining electricity of each power generation enterprise according to the remaining electricity of each power generation enterprise; The remaining power proportion of each power generation enterprise is calculated according to the remaining power of each power generation enterprise and the total remaining power.
8. A transaction electricity statistics and traceability device based on smart contracts, characterized in that: Deploy transaction power statistics and traceability smart contracts on the constructed alliance chain system, including: An acquisition unit, used for acquiring each power transaction contract to be counted; A classification unit, used to classify the various power transaction contracts to obtain various original conventional transaction contracts, various prior transfer transaction contracts and various deviation transaction contracts; A conversion unit, used to sequentially transfer the transaction quantity and transaction relationship of the seller in each of the prior transfer transaction contracts and each of the deviation transaction contracts to the buyer, so as to convert each of the prior transfer transaction contracts and each of the deviation transaction contracts into each of the regular transaction contracts; A determination unit, configured to use each converted conventional transaction contract and each original conventional transaction contract as each conventional transaction contract to be processed, and determine the total transaction electricity and the traceable electricity corresponding to each conventional transaction contract to be processed respectively based on the transaction electricity in each conventional transaction contract to be processed; The calculation unit is used to calculate the balanced distribution electricity corresponding to the corresponding conventional trading contract based on the traceable electricity.
9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.