Electricity bill generation method, system and device based on green electricity transaction and medium
By generating unique environmental attribute identifiers and building a mapping relationship library, the problem of underestimation and mismatch of environmental rights in green electricity transactions has been solved, enabling accurate assessment and transparent display of rights and improving the traceability and compliance of bills.
Patent Information
- Application Number
- CN202511658050.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-13
- Publication Date
- 2026-02-24
AI Technical Summary
In existing technologies, the billing generation methods for green electricity transactions cannot accurately reflect the complex mapping relationship between physical electricity consumption and virtual environmental rights, resulting in the underestimation or mismatch of environmental rights, the lack of an effective mechanism for resolving rights conflicts, and insufficient transparency and traceability of billing information.
By generating unique environmental attribute identifiers, a mapping relationship library between physical electricity and virtual environmental rights is established. Multi-dimensional feature vectors are constructed for nonlinear feature fusion, a comprehensive competition factor is output, rights priority is sorted, and blockchain technology is used to generate tamper-proof on-chain certificates to achieve dynamic compensation and hierarchical display.
It ensures accurate and fair assessment of environmental rights, improves the transparency and traceability of billing, supports compliant management of green electricity trading, and adapts to market changes.
Smart Images

Figure CN121563504A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of green electricity trading technology, and specifically to a method, system, device, and medium for generating electricity bills based on green electricity trading. Background Technology
[0002] As the global energy structure transitions towards a low-carbon model, green electricity trading has become a crucial mechanism for promoting renewable energy development. Green electricity trading involves not only the transmission and delivery of physical electricity but also the virtual transfer of environmental rights, such as carbon emission rights and renewable energy certificates. Current technologies primarily rely on traditional electricity metering and billing models to generate bills for green electricity trading, calculating environmental rights value through simple linear aggregation. This lacks in-depth analysis of the complex mapping relationship between physical electricity and virtual environmental rights. For example, some systems use fixed weights to allocate environmental rights or determine ownership based on the order of transactions. While this simplifies the calculation process, it fails to accurately reflect the true environmental value of green electricity under different temporal and spatial conditions. Furthermore, current technologies are insufficient in handling the dynamic nature of environmental rights; once rights are allocated, adjustments are difficult to make based on subsequent transactions, causing billing information to lag behind market changes.
[0003] The shortcomings of existing technologies are mainly reflected in three aspects: First, the static nature of environmental rights allocation. Traditional methods cannot differentiate the value of rights based on dynamic parameters such as grid topology, transaction time granularity, and path efficiency, leading to the underestimation or misallocation of environmental rights for high-value green electricity. Second, the lack of an effective mechanism for resolving rights conflicts. When the same physical electricity volume corresponds to multiple virtual environmental rights, existing technologies cannot prioritize them by quantifying competition factors, which can easily lead to disputes over rights ownership. Third, insufficient transparency and traceability of billing information. Existing electricity bills usually only show the physical electricity volume and basic fees, lacking detailed records of the source, freezing status, and compensation mechanism of environmental rights, making it difficult for users to verify the authenticity and legality of the rights. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention provides a method, system, device and medium for generating electricity bills based on green electricity trading, in order to solve the problems in the prior art where the environmental rights of high-value green electricity are underestimated or misallocated, which easily leads to disputes over the ownership of rights, and where there is a lack of detailed records of the source, freezing status and compensation mechanism of environmental rights, making it difficult for users to verify the authenticity and legality of rights.
[0005] To address the aforementioned technical issues, a method for generating electricity bills based on green electricity trading is proposed, including: Based on the collected information, a unique environmental attribute identifier is generated, a mapping relationship library between physical electricity consumption and virtual environmental rights is established, and a multi-dimensional feature vector is constructed. Nonlinear feature fusion is performed to output a comprehensive competition factor. Based on the comprehensive competition factor, the virtual environmental rights of the same physical electricity consumption are prioritized, sovereign rights are retained, and the remaining virtual environmental rights are marked as frozen. Compensation instructions and compensation amounts are generated. The compensation amount is converted into carbon emission rights compensation amount, written to the blockchain, and an on-chain certificate hash value is generated. The unique environmental attribute identifier of sovereign rights and the on-chain certificate hash value of frozen rights are displayed hierarchically in the electricity bill. New transaction data is monitored in real time. When the correlation between a new transaction and existing physical electricity consumption exceeds a preset threshold, the comprehensive competition factor is recalculated, and the rights allocation and on-chain data are updated.
[0006] As a preferred embodiment of the electricity bill generation method based on green electricity trading described in this invention, the generation of a unique environmental attribute identifier includes: obtaining the topology information of the power grid transmission path, the time information and transaction type information of the green electricity trading contract, concatenating the topology information, time information and transaction type information to obtain a string, generating a unique environmental attribute identifier, and constructing a mapping relationship library based on the unique environmental attribute identifier, physical electricity consumption and virtual environmental rights.
[0007] As a preferred embodiment of the electricity bill generation method based on green electricity trading described in this invention, the output comprehensive competition factor includes: calculating green value concentration and spatiotemporal offset index based on transaction time granularity, grid path efficiency, time deviation and path hop difference; combining green value concentration and spatiotemporal offset index into a multi-dimensional feature vector; and performing nonlinear feature fusion on the multi-dimensional feature vector through a preset model to output the comprehensive competition factor.
[0008] As a preferred embodiment of the electricity bill generation method based on green electricity trading described in this invention, the priority sorting includes extracting all virtual environmental rights and comprehensive competition factors and transaction timestamps associated with the same physical electricity from the mapping relationship database; The comprehensive competitive factors are ranked in descending order, and the transaction timestamps are ranked in ascending order. The scores for descending and ascending rankings are combined to calculate the total priority score. Based on the total priority score, the virtual environment rights with the highest score are retained as sovereign rights, and the remaining virtual environment rights are marked as frozen. At the same time, a compensation instruction is generated.
[0009] As a preferred embodiment of the electricity bill generation method based on green electricity trading described in this invention, the generation of on-chain certificate hash value includes: calculating the difference between the environmental premium of frozen rights and the environmental premium of sovereign rights, obtaining the environmental premium difference, multiplying the environmental premium difference by the physical electricity to generate a compensation amount, introducing a conversion coefficient, and multiplying the compensation amount by the conversion coefficient to obtain the basic carbon emission right compensation amount. A dynamic adjustment factor is introduced to calculate the final carbon emission rights compensation amount. The unique environmental attribute identifier code of the frozen rights, the compensation amount, the carbon emission rights compensation amount and the conversion coefficient are prepared and concatenated into a string. The SHA-256 hash algorithm is used to generate a hash value for the string, and the hash value and data are written into the blockchain's offset pool to generate an on-chain credential hash value.
[0010] As a preferred embodiment of the electricity bill generation method based on green electricity trading described in this invention, the layered display includes: the environmental rights section of the electricity bill displays a unique environmental attribute identifier code of sovereign rights, with an additional hyperlink pointing to detailed source information of the rights; The compensation certificate section displays the on-chain certificate hashes of the frozen rights in a list format, with each item accompanied by a blockchain query link pointing to the data in the offset pool; The billing content is organized using a tree-like data structure. The top layer is the physical electricity consumption, the first sub-layer is the unique environmental attribute identifier of sovereign rights, and the second sub-layer is the on-chain certificate hash value of frozen rights.
[0011] As a preferred embodiment of the electricity bill generation method based on green electricity trading described in this invention, the update of rights allocation and on-chain data includes: capturing new physical electricity, virtual environment rights and transaction timestamps in real time through an interface; calculating the correlation score between new transactions and physical electricity; when the correlation score exceeds a preset threshold of 0.8, triggering a recalculation of the comprehensive competition factor; and updating the rights allocation based on the recalculation result; when the comprehensive competition factor of the new virtual environment rights is greater than the comprehensive competition factor of the current sovereign rights, marking the new rights as sovereign rights and downgrading the original sovereign rights to a frozen state; otherwise, marking the new rights as a frozen state. The formula for calculating the correlation score between new transactions and physical electricity consumption is expressed as follows: in, For relevance scoring, The coordinates of the topology nodes of the power grid transmission path for existing physical electrical quantities. The coordinates of the topology nodes for newly added physical electrical quantities. For existing transaction timestamps, To add a new transaction timestamp, The similarity coefficient for transaction type labels; For frozen rights, the environmental premium difference is calculated and converted into carbon emission rights compensation, a new on-chain certificate hash value is generated, and the updated sovereign rights identifier code and frozen rights hash value are pushed to the user interface in real time via WebSocket technology to refresh the electricity bill content.
[0012] The beneficial effects of this preferred technical solution are as follows: the tree structure and hyperlink design enable users to quickly locate and verify rights information, the hierarchical display avoids information overload, improves the readability and operability of bills, enhances user trust, facilitates regulatory auditing, and supports the compliant management of green electricity transactions.
[0013] As a preferred embodiment of the electricity bill generation system based on green electricity trading described in this invention, it is characterized by including an environmental attribute identification and mapping management module, a rights competition analysis and priority determination module, a compensation calculation and blockchain certificate module, and a bill generation and dynamic update module.
[0014] The environmental attribute identification and mapping management module is used to collect the topological node coordinates of the power grid transmission path, the timestamp of the green electricity transaction contract and the transaction type label, and perform standardized splicing. It then uses a hash algorithm to generate an immutable unique identifier and constructs a distributed storage mapping relationship library.
[0015] The rights competition analysis and priority determination module is used to calculate the green value concentration and spatiotemporal offset index based on the characteristics of transaction time granularity, power grid path efficiency, time deviation and path hop difference, and output a comprehensive competition factor through nonlinear fusion. Combined with the transaction timestamp, it performs dual-standard sorting to determine sovereign rights and frozen rights.
[0016] The compensation calculation and blockchain certificate module is used to calculate the environmental premium difference between frozen rights and sovereign rights, combine it with physical electricity and market parameters to convert it into carbon emission rights compensation amount, and use a hash algorithm to generate digital certificates to write to the blockchain.
[0017] The bill generation and dynamic update module is used to clearly display the sovereign rights identifier and the on-chain certificate of frozen rights in the bill using a hierarchical structure. By monitoring new transaction data in real time, it triggers rights recalculation and allocation updates based on correlation judgment, and uses WebSocket technology to dynamically refresh the bill content.
[0018] A computer device includes a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of a method for generating electricity bills based on green electricity trading.
[0019] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for generating electricity bills based on green electricity trading.
[0020] The beneficial effects of this invention are as follows: By generating unique environmental attribute identifiers and establishing a precise mapping database between physical electricity consumption and virtual environmental rights, this invention avoids the problem of duplicate marking of environmental attributes, providing a reliable data foundation for rights allocation; by constructing multi-dimensional feature vectors and performing nonlinear feature fusion calculations to determine comprehensive competition factors, it quantifies the spatiotemporal characteristics and value density of environmental rights under different trading mechanisms, ensuring the accuracy and fairness of rights assessment; and by prioritizing rights based on dual standards and marking their frozen status, combined with a dynamic compensation mechanism, it converts the environmental premium difference into carbon emission rights compensation, ensuring both the unique allocation of environmental benefits and reasonable compensation for frozen rights; by generating immutable on-chain certificates through blockchain technology, combined with a hierarchical tree-like billing structure, it improves the transparency of the compensation process and the traceability of billing information; and by monitoring new transaction data in real time and triggering a dynamic update mechanism, it can adapt to the fluctuations in the green electricity trading market, maintaining the accuracy of rights allocation and the real-time nature of billing content. Attached Figure Description
[0021] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a flowchart illustrating the overall process of generating electricity bills based on green electricity trading, as provided in one embodiment of the present invention.
[0023] Figure 2 The flowchart illustrates a system scheme for an electricity bill generation system based on green electricity trading, as provided in one embodiment of the present invention. Detailed Implementation
[0024] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0025] Example 1, referring to Figure 1As an embodiment of the present invention, a method for generating electricity bills based on green electricity trading is provided, comprising: S100: Based on the collected information, generate a unique environmental attribute identifier code, establish a mapping relationship library between physical electricity and virtual environmental rights, construct a multi-dimensional feature vector, perform nonlinear feature fusion, and output a comprehensive competition factor.
[0026] S200: Prioritize the virtual environmental rights of the same physical electricity based on the comprehensive competition factor, retain the sovereign rights, mark the remaining virtual environmental rights as frozen, and generate compensation instructions and compensation amounts.
[0027] S300: Convert the compensation amount into carbon emission rights compensation amount, write it into the blockchain, generate on-chain certificate hash value, and display the unique environmental attribute identifier code of sovereign rights and the on-chain certificate hash value of frozen rights in the electricity bill in a hierarchical manner.
[0028] S400: Real-time monitoring of new transaction data. When the correlation between a new transaction and existing physical electricity exceeds a preset threshold, it triggers a recalculation of the comprehensive competition factor and updates the equity allocation and on-chain data.
[0029] It should be noted that by generating unique environmental attribute identifiers and building a mapping relationship library, each environmental right is given a traceable digital identity card, ensuring the uniqueness and accuracy of the right. By constructing multi-dimensional feature vectors and nonlinear fusion models to output comprehensive competitive factors, dynamic and multi-dimensional quantitative evaluation of the value of environmental rights is realized. Through a priority ranking mechanism, the conflict problem of multiple rights corresponding to the same physical electricity is solved, ensuring market efficiency and fair transactions. Furthermore, through a hierarchical billing design, the complex rights relationships are presented intuitively to users, improving transparency and trust.
[0030] Example 2, refer to Figure 1 This is a second embodiment of the present invention, which provides a method for generating electricity bills based on green electricity trading, including: In this embodiment of the application, in step S100, generating a unique environmental attribute identifier includes steps S101 to S104: S101: Obtain three types of input data: the topology node coordinates of the power grid transmission path, the timestamp of the green electricity transaction contract, and the transaction type label, to lay the data foundation for subsequent processing; The first type of data is the topological node coordinates of the power grid transmission path, which represents the node positions that electrical energy passes through when it is transmitted in the power grid. The topological node coordinates of the power grid transmission path consist of a set of two-dimensional coordinates of the nodes. The position of each node is represented by the horizontal and vertical coordinates. The units can be latitude and longitude or positioning units defined within the power grid. The coordinates reflect the physical transmission path of electrical energy and are used to distinguish electrical energy from different power sources. The second type of data is the timestamp of the green electricity transaction contract, which records the specific time when the green electricity transaction occurred. It adopts the Unix timestamp format and is accurate to the second to ensure the accuracy of the transaction time attribute. The third type of data is the transaction type label, which is used to identify the type of transaction, such as long-term bilateral contracts, day-ahead spot markets, or real-time frequency adjustment ancillary services. These are represented by concise characters, such as "L" for "long-term contracts", "D" for "day-ahead spot markets", and "R" for "real-time ancillary services". The transaction type label reflects the category of the transaction mechanism, which makes it easier to distinguish the environmental rights characteristics under different transaction mechanisms.
[0031] S102: By concatenating the topology node coordinates, timestamps, and transaction type labels into a string according to a predetermined format, and then using the SHA-256 hash algorithm to convert the input string of arbitrary length into a fixed-length 256-bit hash value, a unique and tamper-proof environment attribute identifier is generated. S103: Clearly define physical electricity consumption and virtual environmental rights, and associate the generated unique environmental attribute identifier, physical electricity consumption, and virtual environmental rights to form a record.
[0032] S104: Records are stored in a distributed database to build a mapping relationship library, accurately matching physical electricity consumption with environmental attributes. This solves the problem of duplicate metering under multi-source data and provides solid technical support for subsequent rights priority determination and electricity bill generation.
[0033] In an optional implementation, in step S100, generating a unique environmental attribute identifier further includes using the SHA-3 hash algorithm to obtain the same topological node coordinates, timestamps, and transaction type labels, concatenating them into a string, generating an identifier using the SHA-3 hash algorithm (such as a variant of SHA-3-256), and storing the result in a relational database.
[0034] In another optional implementation, in step S100, generating a unique environmental attribute identifier may further include generating an identifier based on HMAC (Hash Message Authentication Code), calculating HMAC-SHA256 using a preset key and input data (topology node coordinates, timestamp, and transaction type label), generating an authenticated identifier, and authenticating it by attaching a timestamp with a digital signature.
[0035] In this embodiment of the application, step S100, the output of the comprehensive competitiveness factor includes steps S111 to S113: S111: Get the transaction time granularity in hours; get the power grid path efficiency, with a value range of 0 to 1; get the time deviation in hours; get the path hop difference, defined as the difference between the power grid path hops agreed in the transaction contract and the actual transmission path hops. S112: Calculate the green electricity value concentration and spatiotemporal offset index using data, expressed by the following formula: in, To increase the value concentration of green electricity For transaction time granularity, To take the natural logarithm of the transaction time granularity G, Let e be the power grid path efficiency, and e be the natural base. The spatiotemporal offset index, Due to time deviation, This represents the difference in the number of hops along the path.
[0036] S113: Combine green value concentration and spatiotemporal offset index into a two-dimensional feature vector. Perform nonlinear feature fusion on the multi-dimensional feature vector through the equity competition analysis model. Calculate the harmonic mean of the exponential function values of the negative values of green value concentration and spatiotemporal offset index. After normalizing the harmonic mean, take the arcsine value. If the arcsine value is greater than the preset threshold, it is retained as the comprehensive competition factor; otherwise, it is set to 0.
[0037] In an optional implementation, in step S100, the output comprehensive competitive factor further includes using principal component analysis (PCA) to perform feature fusion, collecting raw data on transaction time granularity, power grid path efficiency, time deviation, and path hop difference, standardizing the data, applying PCA to extract principal components (such as the first principal component as the comprehensive competitive factor), and adjusting the weights through variance explanation rate.
[0038] In another optional implementation, in step S100, the output comprehensive competitive factor may further include: performing feature fusion based on a random forest model, using transaction time granularity, power grid path efficiency, time deviation, and path hop difference as input features, training a random forest model (the number of trees is adjusted according to the amount of data), and using the weighted score of the output feature importance as the comprehensive competitive factor.
[0039] In this embodiment of the application, in step S200, the priority sorting includes steps S201 to S204: S201: Extract all virtual environmental rights, comprehensive competitive factors, and transaction timestamps associated with the same physical electricity quantity from the mapping relationship database; S202: A dual standard is used for sorting, with the comprehensive competition factor as the primary standard for descending order and the transaction timestamp as the secondary standard for ascending order. The total priority score is calculated using a weighted formula. The formula for calculating priority scores is as follows: in, For the rights and interests of the virtual environment Priority score, For the rights and interests of the virtual environment The corresponding comprehensive competitive factors, For the rights and interests of the virtual environment Transaction timestamp, for The values are sorted in descending order, with larger values ranking higher. The values of T are sorted in ascending order, with smaller values ranking higher. This is the amplification factor.
[0040] S203: After sorting, retain the virtual environmental rights with the highest total score as sovereign rights to ensure the uniqueness of environmental benefits, and mark the remaining rights as frozen to prevent reuse; S204: Generate a compensation instruction containing a unique identifier, content, and reason for freezing for each frozen right, and store it in a mapping database. This ensures fair and compliant distribution of rights and provides transparent and traceable data support for subsequent compensation calculations and billing.
[0041] In an optional implementation, in step S200, the priority ranking further includes ranking using a weighted linear combination method, assigning fixed weights (0.7 and 0.3) to the comprehensive competition factor and transaction timestamp, calculating weighted scores and ranking them, with the highest-scoring equity being designated as sovereign equity, and the remaining equity marked as frozen.
[0042] In another optional implementation, in step S200, the priority ranking may further include ranking based on TOPSIS (Top-Side Distance Method), using comprehensive competition factors and transaction timestamps as evaluation indicators, determining positive and negative ideal solutions, calculating the relative closeness of each right to the ideal solution, and retaining the highest value as the sovereign right after ranking by closeness.
[0043] In this embodiment of the application, in step S300, generating the on-chain credential hash value includes steps S301 to S303: S301: Calculate the difference between the environmental premium of frozen rights and the environmental premium of sovereign rights, obtain the environmental premium difference, multiply the environmental premium difference by the physical electricity to generate the compensation amount, introduce a conversion factor, and multiply the compensation amount by the conversion factor to obtain the basic carbon emission rights compensation amount.
[0044] S302: Introduce a dynamic adjustment factor, multiply the basic carbon emission right compensation amount by 1 and add the value of the dynamic adjustment factor to calculate the final carbon emission right compensation amount. Prepare the unique environmental attribute identifier code of the frozen rights, the compensation amount, the carbon emission right compensation amount and the conversion coefficient, and concatenate them into a string.
[0045] S303: Use the SHA-256 hash algorithm to generate a hash value for the string, and write the hash value and data into the blockchain's offset pool to generate an on-chain credential hash value.
[0046] In an optional implementation, in step S300, generating the on-chain certificate hash value further includes automatically executing compensation based on a smart contract. A smart contract is deployed on the Ethereum blockchain. After inputting frozen equity data and market parameters, the contract automatically calculates the compensation amount and carbon emission right compensation amount, generates a hash value, and records it to the on-chain event log.
[0047] In another optional implementation, in step S300, generating the on-chain certificate hash value further includes: combining the IPFS storage compensation data, uploading the compensation amount and carbon emission right compensation data to the IPFS network to obtain the content identifier (CID), concatenating the CID with the rights identifier code and using a hash algorithm to generate an on-chain hash, and writing the hash and CID into the blockchain.
[0048] Furthermore, in step S300, the layered display includes steps S311 to S313: S311: Display a unique environmental attribute identifier for sovereign rights in the environmental rights section of the electricity bill, using a high-contrast font, and attach a hyperlink to detailed source information for the rights.
[0049] S312: The on-chain certificate hashes of frozen rights are displayed in a list in the compensation certificate section, with each item accompanied by a blockchain query link pointing to the data in the offset pool.
[0050] S313: The billing content is organized using a tree-like data structure. The top layer is the physical electricity consumption, the first sub-layer is the unique environmental attribute identifier of sovereign rights, and the second sub-layer is the on-chain certificate hash value of frozen rights. The front-end visualization component supports users to expand or collapse the sub-layer information.
[0051] It should be noted that the input data used for generating and dynamically updating electricity bills includes, A1: The first type of data is a unique environmental attribute identifier for the main environmental benefit. Based on the comprehensive competition factor, the virtual environmental benefits are prioritized and then marked as a unique environmental attribute identifier for the main environmental benefit status, representing the main environmental benefit certificate corresponding to the physical electricity.
[0052] A2: The second type of data is the on-chain certificate hash value of the frozen rights. It is a unique identifier generated by encrypting the environmental premium difference of the frozen rights through a hash algorithm and writing it into the blockchain. It is used to display the compensation certificate of the frozen rights in the electricity bill.
[0053] A3: The third type of data is newly added transaction data, including the physical electricity volume, virtual environment rights, transaction timestamps, and transaction type tags of newly added green electricity transactions. It is captured from the green electricity transaction market and used to trigger the recalculation of comprehensive competition factors and the update of rights allocation.
[0054] In step S400, updating the equity allocation and on-chain data includes steps S401-S402: S401: Capture new physical electricity, virtual environment rights and transaction timestamps in real time through API interface, calculate the correlation score between new transactions and physical electricity, and trigger the recalculation of comprehensive competition factor when the correlation score exceeds the preset threshold of 0.8. Update the rights allocation based on the recalculation result. When the comprehensive competition factor of new virtual environment rights is greater than the comprehensive competition factor of current sovereign rights, mark the new rights as sovereign rights and downgrade the original sovereign rights to frozen status. Otherwise, mark the new rights as frozen status. The formula for calculating the correlation score between new transactions and physical electricity consumption is expressed as follows: in, For relevance scoring, The coordinates of the topology nodes of the power grid transmission path for existing physical electrical quantities. The coordinates of the topology nodes for newly added physical electrical quantities. For existing transaction timestamps, To add a new transaction timestamp, The similarity coefficient for transaction type labels; S402: For frozen rights, perform environmental premium difference calculation and convert it into carbon emission right compensation amount, generate new on-chain certificate hash value, and push the updated sovereign rights identifier code and frozen rights hash value to the user interface in real time through WebSocket technology to refresh the electricity bill content.
[0055] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
[0056] Example 3, referring to Figure 2 The third embodiment of the present invention provides an electricity bill generation system based on green electricity trading, including an environmental attribute identification and mapping management module, a rights competition analysis and priority determination module, a compensation calculation and blockchain certificate module, and a bill generation and dynamic update module.
[0057] The environmental attribute identification and mapping management module is used to collect the topological node coordinates of the power grid transmission path, the timestamp of the green electricity transaction contract and the transaction type label, and perform standardized splicing. It then uses a hash algorithm to generate an immutable unique identifier and constructs a distributed storage mapping relationship library.
[0058] The rights competition analysis and priority determination module is used to calculate the green value concentration and spatiotemporal offset index based on the characteristics of transaction time granularity, power grid path efficiency, time deviation and path hop difference, and output a comprehensive competition factor through nonlinear fusion. Combined with the transaction timestamp, it performs dual-standard sorting to determine sovereign rights and frozen rights.
[0059] The compensation calculation and blockchain certificate module is used to calculate the environmental premium difference between frozen rights and sovereign rights, combine it with physical electricity and market parameters to convert it into carbon emission rights compensation amount, and use a hash algorithm to generate digital certificates to write to the blockchain.
[0060] The bill generation and dynamic update module is used to clearly display the sovereign rights identifier and the on-chain certificate of frozen rights in the bill using a hierarchical structure. By monitoring new transaction data in real time, it triggers rights recalculation and allocation updates based on correlation judgment, and uses WebSocket technology to dynamically refresh the bill content.
[0061] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
[0062] Example 4, the fourth embodiment of the present invention, differs from the previous three embodiments in that: If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0063] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-including system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0064] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0065] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
Claims
1. A method for generating electricity bills based on green electricity trading, characterized in that: include, Based on the collected information, a unique environmental attribute identifier is generated, a mapping relationship library between physical electricity and virtual environmental rights is established, and a multi-dimensional feature vector is constructed. Nonlinear feature fusion is performed to output a comprehensive competitive factor. Based on comprehensive competition factors, the virtual environmental rights of the same physical electricity are prioritized, sovereign rights are retained, and the remaining virtual environmental rights are marked as frozen, and compensation instructions and compensation amounts are generated. The compensation amount is converted into carbon emission rights compensation amount, written into the blockchain, generating on-chain certificate hash values, and displayed in layers in the electricity bill as the unique environmental attribute identifier code of sovereign rights and the on-chain certificate hash values of frozen rights; Real-time monitoring of new transaction data; when the correlation between a new transaction and existing physical electricity exceeds a preset threshold, the comprehensive competition factor is recalculated, and the equity allocation and on-chain data are updated.
2. The method for generating electricity bills based on green electricity trading as described in claim 1, characterized in that: The process of generating a unique environmental attribute identifier includes obtaining the topology information of the power grid transmission path, the time information and transaction type information of the green electricity transaction contract, concatenating the topology information, time information and transaction type information to obtain a string, generating a unique environmental attribute identifier, and constructing a mapping relationship library based on the unique environmental attribute identifier, physical electricity volume and virtual environmental rights.
3. The method for generating electricity bills based on green electricity trading as described in claim 2, characterized in that: The output comprehensive competitive factor includes calculating green value concentration and spatiotemporal offset index based on transaction time granularity, power grid path efficiency, time deviation and path hop difference, combining green value concentration and spatiotemporal offset index into a multi-dimensional feature vector, and performing nonlinear feature fusion on the multi-dimensional feature vector through a preset model to output the comprehensive competitive factor.
4. The method for generating electricity bills based on green electricity trading as described in claim 3, characterized in that: The priority sorting includes extracting all virtual environmental rights and comprehensive competitive factors and transaction timestamps associated with the same physical electricity from the mapping relationship database; The comprehensive competitive factors are ranked in descending order, and the transaction timestamps are ranked in ascending order. The scores for descending and ascending rankings are combined to calculate the total priority score. Based on the total priority score, the virtual environment rights with the highest score are retained as sovereign rights, and the remaining virtual environment rights are marked as frozen. At the same time, a compensation instruction is generated.
5. The method for generating electricity bills based on green electricity trading as described in claim 4, characterized in that: The generation of on-chain certificate hash value includes calculating the difference between the environmental premium of frozen rights and the environmental premium of sovereign rights, obtaining the environmental premium difference, multiplying the environmental premium difference by the physical electricity to generate the compensation amount, introducing a conversion coefficient, and multiplying the compensation amount by the conversion coefficient to obtain the basic carbon emission right compensation amount. A dynamic adjustment factor is introduced to calculate the final carbon emission rights compensation amount. The unique environmental attribute identifier code of the frozen rights, the compensation amount, the carbon emission rights compensation amount and the conversion coefficient are prepared and concatenated into a string. The SHA-256 hash algorithm is used to generate a hash value for the string, and the hash value and data are written into the blockchain's offset pool to generate an on-chain credential hash value.
6. The method for generating electricity bills based on green electricity trading as described in claim 5, characterized in that: The layered display includes a unique environmental attribute identifier for sovereign rights displayed in the environmental rights section of the electricity bill, with an additional hyperlink pointing to detailed source information of the rights; The compensation certificate section displays the on-chain certificate hashes of the frozen rights in a list format, with each item accompanied by a blockchain query link pointing to the data in the offset pool; The billing content is organized using a tree-like data structure. The top layer is the physical electricity consumption, the first sub-layer is the unique environmental attribute identifier of sovereign rights, and the second sub-layer is the on-chain certificate hash value of frozen rights.
7. The method for generating electricity bills based on green electricity trading as described in claim 6, characterized in that: The updated rights allocation and on-chain data include capturing new physical electricity, virtual environment rights and transaction timestamps in real time through an interface, calculating the correlation score between new transactions and physical electricity, and triggering a recalculation of the comprehensive competition factor when the correlation score exceeds a preset threshold of 0.
8. The rights allocation is then updated based on the recalculation result. When the comprehensive competition factor of the new virtual environment rights is greater than the comprehensive competition factor of the current sovereign rights, the new rights are marked as sovereign rights and the original sovereign rights are downgraded to a frozen state. Otherwise, the new rights are marked as frozen. The formula for calculating the correlation score between new transactions and physical electricity consumption is expressed as follows: in, For relevance scoring, The coordinates of the topology nodes of the power grid transmission path for existing physical electrical quantities. The coordinates of the topology nodes for newly added physical electrical quantities. For existing transaction timestamps, To add a new transaction timestamp, The similarity coefficient for transaction type labels; For frozen rights, the environmental premium difference is calculated and converted into carbon emission rights compensation, a new on-chain certificate hash value is generated, and the updated sovereign rights identifier code and frozen rights hash value are pushed to the user interface in real time via WebSocket technology to refresh the electricity bill content.
8. An electricity bill generation system based on green electricity trading, employing the electricity bill generation method based on green electricity trading as described in any one of claims 1 to 7, characterized in that, It includes modules for environmental attribute identification and mapping management, rights competition analysis and priority determination, compensation calculation and blockchain voucher, and bill generation and dynamic update. The environmental attribute identification and mapping management module is used to collect the topological node coordinates of the power grid transmission path, the timestamp of the green electricity transaction contract and the transaction type label, and perform standardized splicing, and use a hash algorithm to generate an immutable unique identifier code to build a distributed storage mapping relationship library. The rights competition analysis and priority determination module is used to calculate the green value concentration and spatiotemporal offset index based on the characteristics of transaction time granularity, power grid path efficiency, time deviation and path hop difference, and output a comprehensive competition factor through nonlinear fusion. Combined with the transaction timestamp, it performs dual-standard sorting to determine sovereign rights and frozen rights. The compensation calculation and blockchain certificate module is used to calculate the environmental premium difference between frozen rights and sovereign rights, combine it with physical electricity and market parameters to convert it into carbon emission rights compensation amount, and use a hash algorithm to generate digital certificates and write them into the blockchain. The bill generation and dynamic update module is used to clearly display the sovereign rights identifier and the on-chain certificate of frozen rights in the bill using a hierarchical structure. By monitoring new transaction data in real time, it triggers rights recalculation and allocation updates based on correlation judgment, and uses WebSocket technology to dynamically refresh the bill content.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the electricity bill generation method based on green electricity trading as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the electricity bill generation method based on green electricity trading as described in any one of claims 1 to 7.