A blockchain technology-based electric energy billing system and method thereof

CN122948565APending Publication Date: 2026-10-20NINGXIA HUADIAN YONGLI POWER GENERATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611112134.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-24
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

[0006]为解决上述区块链应用存在瓶颈,适配性不足的技术问题,本发明提供了如下技术方案:

Benefits of technology

[0060]本发明通过全新的模块化架构设计、优化的区块链共识机制、分级加密隐私防护、可拓展智能合约体系及全流程闭环追溯机制,大幅提升电能量计费的精准度、安全性、透明性与高效性,适配各类新型电力交易场景。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This invention discloses a blockchain-based electricity billing system and method, belonging to the field of electricity billing technology. First, it collects raw electricity data from multiple sources, performs data integrity verification and standardization, and encrypts sensitive information. Then, based on the encrypted data set, it completes multi-node deployment and consensus configuration of the consortium blockchain, generates block information, and synchronizes data across all nodes for on-chain storage. Next, based on the on-chain data, it generates signals and on-chain credentials, deploys a smart contract for billing rules, retrieves corresponding data to execute contract billing calculations, and generates and stores the billing results. Based on this, this invention significantly improves the accuracy, security, transparency, and efficiency of electricity billing through a novel modular architecture design, optimized blockchain consensus mechanism, hierarchical encryption privacy protection, scalable smart contract system, and a full-process closed-loop traceability mechanism, making it suitable for various new electricity trading scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electricity billing technology, specifically to an electricity billing system and method based on blockchain technology. Background Technology

[0002] Traditional electricity billing systems heavily rely on centralized institutions such as power supply companies and power trading centers to complete the entire process of data collection, aggregation, accounting, and fee settlement, resulting in several inherent shortcomings: First, the problem of data silos is prominent, with user electricity consumption data, distributed energy generation data, and grid electricity price data belonging to different systems, leading to data synchronization delays, inconsistent standards, and a high risk of billing discrepancies; second, centralized data storage is easily tampered with or lost, data integrity cannot be guaranteed, and tracing billing disputes is difficult; third, billing rules are largely manually entered and adjusted, leading to human intervention, lack of transparency, and inconsistent implementation, resulting in insufficient credibility of billing; fourth, the settlement process is cumbersome, relying on manual verification and offline reconciliation, resulting in long settlement cycles, low efficiency, and an inability to meet the real-time settlement needs of market-based electricity trading.

[0003] Currently, some existing technologies have applied blockchain to electricity billing scenarios, but they generally suffer from the following drawbacks:

[0004] 1. Most solutions adopt traditional fixed consensus mechanisms with fixed node consensus efficiency. When faced with massive power time-series data and high-frequency trading scenarios, the throughput is insufficient, which can easily lead to data congestion and high latency. In addition, the consensus energy consumption is high and the operation and maintenance costs are high.

[0005] 2. The privacy protection mechanism is imperfect, and most of them use single encryption processing, which cannot distinguish between sensitive data and public data. Either over-encryption leads to waste of computing power, or insufficient encryption causes leakage of user privacy. Summary of the Invention

[0006] To address the bottlenecks and insufficient adaptability of the aforementioned blockchain applications, this invention provides the following technical solution:

[0007] An electricity billing system based on blockchain technology, comprising:

[0008] The multi-source data acquisition and preprocessing module acquires raw electrical energy data from multiple sources, performs data integrity verification and standardization processing, encrypts sensitive information, and outputs an encrypted data set.

[0009] The blockchain consortium chain deployment and data upload module includes a multi-node deployment unit, a consensus mechanism configuration unit, a block information generation unit, and a data synchronization and upload unit.

[0010] The multi-node deployment unit deploys multi-role nodes to build a consortium blockchain architecture, and each node has independent accounting permissions and data access permissions, outputting the consortium blockchain node topology and permission allocation list;

[0011] The consensus mechanism configuration unit, based on the consortium blockchain node topology and permission allocation list output by the multi-node deployment unit, adopts a dynamic group consensus mechanism to divide all nodes into several groups, selects a core node in each group to be responsible for consensus verification, sets a consensus threshold, and outputs consensus mechanism parameters and operating rules.

[0012] The block information generation unit, based on the encrypted data set output by the multi-source data acquisition and preprocessing module and the consensus mechanism parameters and operating rules output by the consensus mechanism configuration unit, sorts the encrypted data by timestamp, generates block data, calculates the hash value of the current block, and outputs complete block information.

[0013] The data synchronization and on-chain unit, based on the complete block information output by the block information generation unit, verifies it through the consensus mechanism and synchronizes the block to all nodes of the consortium chain, completing the data on-chain storage; and each node synchronously updates its local ledger, generates a data on-chain certificate, and outputs a data on-chain completion signal and on-chain certificate.

[0014] The blockchain-based smart billing calculation module, based on the data on-chain completion signal and on-chain certificate output by the blockchain consortium chain deployment and data on-chain module, completes the deployment of the billing rule smart contract, retrieves the corresponding data to execute the contract billing calculation, generates and stores the billing result, and outputs the billing result storage completion signal.

[0015] The billing result feedback and closed-loop settlement module, based on the billing result storage completion signal output by the blockchain-based smart billing calculation module, completes the result decryption push and user confirmation verification, triggering the smart contract to execute fund settlement.

[0016] As a preferred embodiment of the electricity billing system based on blockchain technology described in this invention, the multi-source data acquisition and preprocessing module includes:

[0017] The multi-source data acquisition unit collects user electricity consumption data, distributed energy generation data, and grid electricity price data, and outputs a multi-source raw data set.

[0018] The data integrity verification unit, based on the multi-source raw data set output by the multi-source data acquisition unit, uses a hash algorithm to encrypt each piece of data, generates a data hash value, compares it with the preset raw data baseline hash value, and outputs a valid data set that has passed the verification.

[0019] The data standardization processing unit, based on the valid data set output by the data integrity verification unit, unifies the data format, units and encoding rules, extracts fields, and outputs a standardized data list;

[0020] The privacy data encryption unit, based on the standardized data list output by the data standardization processing unit, uses a homomorphic encryption algorithm to encrypt sensitive user information, generates encrypted data, and outputs the encrypted data set.

[0021] As a preferred embodiment of the blockchain-based electricity billing system described in this invention, the blockchain-based intelligent billing calculation module includes:

[0022] The billing rules on-chain unit converts the billing rules into smart contract code, and after being reviewed and confirmed by multiple nodes, it is deployed to the blockchain. At the same time, the smart contract has built-in trigger conditions and outputs the address of the deployed smart contract and the details of the rules.

[0023] The data precision retrieval unit, based on the smart contract address and rule details of the billing rule on-chain unit, calls the data on-chain completion signal and on-chain certificate output by the blockchain consortium chain deployment and data on-chain module through the smart contract. According to the user ID and billing cycle, it retrieves the corresponding user's encrypted electricity consumption data, electricity price data, and power generation data. At the same time, it restores non-sensitive data through decryption algorithms and outputs user data and electricity price rules that match the current billing cycle.

[0024] The smart contract billing unit, based on user data and electricity price rules that match the current billing cycle output by the data precision retrieval unit, triggers the smart contract to automatically execute billing calculations and outputs electricity billing calculation results and billing process logs.

[0025] The billing anomaly adaptive correction unit, based on the electricity billing calculation results and billing process logs output by the smart contract billing unit, automatically compares the historical billing data of the same period, the billing benchmarks of the same type of users and preset thresholds, identifies billing anomalies, and automatically retrieves user data and electricity price rules to complete the anomaly correction and generate correction logs, and outputs the corrected electricity billing calculation results.

[0026] The billing result storage unit generates a billing result certificate based on the electricity billing calculation result and billing process log output by the smart contract billing unit. The certificate is then encrypted, stored on the blockchain, and simultaneously pushed to the corresponding user node and power supply node, outputting a billing result storage completion signal.

[0027] As a preferred embodiment of the electricity billing system based on blockchain technology described in this invention, the billing result feedback and closed-loop settlement module includes:

[0028] The result decryption and push unit is based on the billing result storage completion signal output by the blockchain-based smart billing calculation module. User nodes decrypt the certificate with their own private keys to obtain their current electricity bill details and billing basis. The power supply node obtains the billing results of all users and outputs the result push completion signal.

[0029] The user confirms the verification unit. Based on the result decryption push unit output, the user pushes the completion signal, checks their own electricity consumption data and billing results. If the confirmation is correct, the user submits the confirmation information. If there is any objection, the user submits the objection application and relevant supporting materials, and the user confirmation result is output.

[0030] The intelligent automatic settlement unit, based on the user confirmation result output by the user confirmation verification unit, triggers a settlement instruction through a smart contract. It then links with a financial settlement institution via a cross-chain gateway to automatically transfer electricity fees from the user's bound account to the power supplier's account, and outputs a settlement completion signal and settlement voucher.

[0031] The settlement anomaly intelligent backtracking unit, based on the settlement completion signal and settlement voucher output by the intelligent automatic settlement unit, the smart contract monitors the settlement status in real time. If a settlement problem is detected, it automatically retrieves the original data, billing result storage and settlement logs on the chain, traces the root cause of the anomaly, triggers the adaptive remediation mechanism, and outputs the anomaly handling result.

[0032] The settlement end-to-end evidence storage unit, based on the settlement completion signal and settlement voucher output by the intelligent automatic settlement unit, encrypts the settlement data and stores it on the blockchain, and pushes it to all relevant nodes simultaneously, while generating a full-process traceability report.

[0033] A method for billing electricity based on blockchain technology includes the following steps:

[0034] S1, Multi-source data acquisition and preprocessing: Acquire raw data of electrical energy from multiple sources, complete data integrity verification and standardization processing, encrypt sensitive information, and output the encrypted data set;

[0035] S2, Blockchain Consortium Chain Deployment and Data On-Chain:

[0036] S21, Multi-node Deployment: Deploy multi-role nodes to build a consortium blockchain architecture, with each node having independent accounting and data access permissions, and outputting the consortium blockchain node topology and permission allocation list;

[0037] S22, Consensus Mechanism Configuration: Based on the consortium blockchain node topology and permission allocation list output by S21, a dynamic group consensus mechanism is adopted to divide all nodes into several groups. Each group selects a core node to be responsible for consensus verification. At the same time, a consensus threshold is set, and consensus mechanism parameters and operating rules are output.

[0038] S23, Block Information Generation: Based on the encrypted data set output by S1 and the consensus mechanism parameters and operating rules output by S22, the encrypted data is sorted by timestamp to generate block data, and the hash value of the current block is calculated to output complete block information.

[0039] S24, Data Synchronization on Chain: Based on the complete block information output by S23, after verification through the consensus mechanism, the block is synchronized to all nodes of the consortium chain to complete the data on-chain storage; and each node synchronously updates its local ledger, generates a data on-chain certificate, and outputs a data on-chain completion signal and on-chain certificate.

[0040] S3, based on blockchain smart billing calculation: Based on the data on-chain completion signal and on-chain certificate output by S2, the billing rule smart contract is deployed, and the corresponding data is retrieved to execute the contract billing calculation, generate and store the billing result, and output the billing result storage completion signal.

[0041] S4, Billing Result Feedback and Closed-Loop Settlement: Based on the billing result notarization completion signal output by S3, the result decryption push and user confirmation verification are completed, triggering the smart contract to execute fund settlement.

[0042] As a preferred embodiment of the electricity billing method based on blockchain technology described in this invention, the specific steps of step S1 are as follows:

[0043] S11, Multi-source data acquisition: Collects user electricity consumption data, distributed energy generation data, and grid electricity price data, and outputs a multi-source raw data set;

[0044] S12, Data Integrity Verification: Based on the multi-source raw data set output by S11, a hash algorithm is used to encrypt each piece of data to generate a data hash value, which is compared with the preset raw data baseline hash value, and a valid data set that has passed the verification is output.

[0045] S13, Data Standardization Processing: Based on the valid data set output by S12, standardize the data format, units and encoding rules, extract fields, and output a standardized data list;

[0046] S14, Privacy Data Encryption: Based on the standardized data list output by S13, homomorphic encryption algorithm is used to encrypt sensitive user information, generate encrypted data, and output the encrypted data set.

[0047] As a preferred embodiment of the electricity billing method based on blockchain technology described in this invention, the specific steps of step S3 are as follows:

[0048] S31, Billing Rules on the Blockchain: The billing rules are converted into smart contract code, and after being reviewed and confirmed by multiple nodes, they are deployed to the blockchain. At the same time, the smart contract has built-in trigger conditions and outputs the address of the deployed smart contract and the details of the rules.

[0049] S32, Precise Data Retrieval: Based on the smart contract address and rule details output by S31, the smart contract calls the data on-chain completion signal and on-chain certificate output by S2 to retrieve the corresponding user's encrypted electricity consumption data, electricity price data, and power generation data according to the user ID and billing cycle. At the same time, non-sensitive data is restored through decryption algorithm, and user data and electricity price rules matching the current billing cycle are output.

[0050] S33, Smart Contract Billing: Based on the user data and electricity price rules output by S32 that match the current billing cycle, the smart contract is triggered to automatically execute the billing calculation and output the electricity billing calculation result and billing process log;

[0051] S34, Adaptive Correction of Billing Anomalies: Based on the electricity billing calculation results and billing process logs output by S33, the smart contract automatically compares the historical billing data of the same period, the billing benchmarks of the same type of users and the preset thresholds to identify billing anomalies. At the same time, it automatically retrieves user data and electricity price rules, completes the anomaly correction and generates a correction log, and outputs the corrected electricity billing calculation results.

[0052] S35, Billing Result Evidence Storage: Based on the electricity billing calculation results and billing process logs output by S33, a billing result certificate is generated. The certificate is then encrypted and stored on the blockchain, and simultaneously pushed to the corresponding user node and power supply node. A billing result evidence storage completion signal is output.

[0053] As a preferred embodiment of the electricity billing method based on blockchain technology described in this invention, the specific steps of step S4 are as follows:

[0054] S41, Result Decryption Push: Based on the billing result storage completion signal output by S3, the user node decrypts the certificate with its own private key to obtain its own current electricity bill details and billing basis, and the power supply node obtains the billing results of all users and outputs the result push completion signal.

[0055] S42, User Confirmation Verification: Based on the result output by S41, the user pushes a completion signal, verifies their own electricity consumption data and billing results, and if the confirmation is correct, submits confirmation information; if there is any objection, the user submits an objection application and relevant supporting materials, and outputs the user confirmation result.

[0056] S43, Smart Automatic Settlement: Based on the user confirmation result output by S42, the smart contract triggers the settlement instruction, and through the cross-chain gateway, it links with the financial settlement institution to automatically transfer the electricity fee from the user's bound account to the power supplier's account, and outputs the settlement completion signal and settlement voucher;

[0057] S44, Intelligent Backtracking of Settlement Anomalies: Based on the settlement completion signal and settlement voucher output by S43, the smart contract monitors the settlement status in real time. If a settlement problem is detected, it automatically retrieves the original data, billing result certificate, and settlement logs on the chain, traces the root cause of the anomaly, triggers the adaptive remediation mechanism, and outputs the anomaly handling result.

[0058] S45, Settlement End-to-End Evidence Storage: Based on the settlement completion signal and settlement voucher output by S43, the settlement data is encrypted and stored on the blockchain, and simultaneously pushed to all relevant nodes, while generating a full-process traceability report.

[0059] Compared with existing technologies:

[0060] This invention significantly improves the accuracy, security, transparency, and efficiency of electricity billing through a novel modular architecture design, optimized blockchain consensus mechanism, hierarchical encryption privacy protection, scalable smart contract system, and full-process closed-loop traceability mechanism, making it suitable for various new electricity trading scenarios. Attached Figure Description

[0061] Figure 1 This is a schematic diagram of the overall framework of the present invention;

[0062] Figure 2 This is a schematic diagram of the multi-source data acquisition and preprocessing module framework of the present invention;

[0063] Figure 3 This is a schematic diagram of the blockchain consortium chain deployment and data on-chain module framework of the present invention;

[0064] Figure 4 This is a schematic diagram of the blockchain-based intelligent billing calculation module framework of the present invention;

[0065] Figure 5 This is a schematic diagram of the billing result feedback and closed-loop settlement module framework of the present invention. Detailed Implementation

[0066] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.

[0067] This invention provides an electricity billing system based on blockchain technology. Please refer to [link / reference]. Figure 1 ,include:

[0068] The multi-source data acquisition and preprocessing module acquires raw electrical energy data from multiple sources, performs data integrity verification and standardization processing, encrypts sensitive information, and outputs an encrypted data set.

[0069] The blockchain consortium chain deployment and data upload module, based on the encrypted data set output by the multi-source data acquisition and preprocessing module, completes the multi-node deployment and consensus configuration of the consortium chain, generates block information, completes the full-node synchronization and on-chain storage of data, and outputs the data upload completion signal and on-chain certificate.

[0070] The blockchain-based smart billing calculation module, based on the data on-chain completion signal and on-chain certificate output by the blockchain consortium chain deployment and data on-chain module, completes the deployment of the billing rule smart contract, retrieves the corresponding data to execute the contract billing calculation, generates and stores the billing result, and outputs the billing result storage completion signal.

[0071] The billing result feedback and closed-loop settlement module, based on the billing result storage completion signal output by the blockchain-based smart billing calculation module, completes the result decryption push and user confirmation verification, triggering the smart contract to execute fund settlement.

[0072] Please see Figure 2 The multi-source data acquisition and preprocessing module includes:

[0073] The multi-source data acquisition unit deploys hardware such as smart meters, distributed energy monitoring equipment, and power grid load acquisition terminals to simultaneously collect user electricity consumption data (electricity consumption, electricity consumption time period, electricity consumption type), distributed energy generation data (generation output, generation time period), and power grid price data (time-of-use pricing, tiered pricing, subsidy standards), and outputs a multi-source raw data set.

[0074] The data integrity verification unit, based on the multi-source raw data set output by the multi-source data acquisition unit, uses a hash algorithm to encrypt each piece of data, generates a data hash value, compares it with the preset raw data baseline hash value, removes abnormal data with mismatched hash values ​​(such as missing data or data tampering), and outputs a valid data set that has passed verification; at the same time, it records the acquisition time and device number of abnormal data for easy traceability later.

[0075] The data standardization processing unit, based on the valid data set output by the data integrity verification unit, unifies the data format, unit, and coding rules. It standardizes the electricity consumption unit to "kWh" and the electricity price unit to "yuan / kWh". It also extracts core fields such as user ID, data collection time, data type, and value, and outputs a standardized data list. At the same time, it classifies and stores the data for easy retrieval later.

[0076] The privacy data encryption unit, based on the standardized data list output by the data standardization processing unit, uses homomorphic encryption algorithms to encrypt sensitive user information (such as user ID, electricity address, and specific electricity consumption), generating encrypted data, retaining the plaintext format of non-sensitive data (such as public electricity price and power generation time), and outputting the encrypted data set.

[0077] Please see Figure 3 The blockchain consortium blockchain deployment and data on-chain module includes:

[0078] The multi-node deployment unit deploys nodes representing various roles, including power suppliers, users, regulatory agencies, financial settlement institutions, and distributed energy operators, to build a consortium blockchain architecture. Each node has independent accounting and data access permissions. Among them, regulatory nodes have full data access permissions to supervise the entire billing process, while user nodes can only access their own relevant data, thus achieving hierarchical permission management and outputting the consortium blockchain node topology and permission allocation list.

[0079] The consensus mechanism configuration unit, based on the consortium blockchain node topology and permission allocation list output by the multi-node deployment unit, adopts a dynamic group consensus mechanism, dividing all nodes into several groups. Each group selects a core node to be responsible for consensus verification. A decay factor is introduced to dynamically reduce redundant consensus rounds according to network load, thereby improving the efficiency of data upload to the blockchain. At the same time, a consensus threshold is set. Data upload to the blockchain can only be completed when more than 80% of the nodes confirm that the data is valid. The consensus mechanism parameters and operating rules are output.

[0080] The block information generation unit, based on the encrypted data set output by the multi-source data acquisition and preprocessing module and the consensus mechanism parameters and operating rules output by the consensus mechanism configuration unit, sorts the encrypted data by timestamp to generate block data. Each block contains a block header (timestamp, hash value of the previous block, and consensus node signature) and a block body (encrypted data and data hash value). It also calculates the hash value of the current block and outputs complete block information.

[0081] The data synchronization and on-chain unit, based on the complete block information output by the block information generation unit, verifies it through the consensus mechanism and synchronizes the block to all nodes of the consortium chain, completing the data on-chain storage; and each node synchronously updates its local ledger to ensure data consistency across all nodes, while generating a data on-chain certificate (including block hash value, on-chain time, and node signature), and outputting a data on-chain completion signal and on-chain certificate.

[0082] Please see Figure 4 The blockchain-based smart billing module includes:

[0083] The billing rules on-chain unit converts billing rules such as tiered electricity pricing, time-of-use pricing, distributed energy subsidies, and penalties for breach of contract into smart contract code. After being reviewed and confirmed by multiple nodes, it is deployed to the blockchain. At the same time, the smart contract has built-in trigger conditions (such as electricity consumption time period, electricity consumption threshold, and subsidy standard) that cannot be modified arbitrarily. It outputs the address of the deployed smart contract and the details of the rules.

[0084] The data precision retrieval unit, based on the smart contract address and rule details of the billing rule on-chain unit, calls the data on-chain completion signal and on-chain certificate output by the blockchain consortium chain deployment and data on-chain module through the smart contract. According to the user ID and billing cycle, it retrieves the corresponding user's encrypted electricity consumption data, electricity price data, and power generation data. At the same time, it restores non-sensitive data through decryption algorithms and outputs user data and electricity price rules that match the current billing cycle.

[0085] The smart contract billing unit, based on user data and electricity price rules that match the current billing cycle output by the data precision retrieval unit, triggers the smart contract to automatically execute billing calculations: it differentiates time-of-use electricity prices according to the electricity consumption period, determines the tiered electricity price level according to the electricity consumption, calculates the subsidy amount by combining distributed energy generation data, deducts the penalty fee for breach of contract (if any), generates the user's current electricity bill details (including electricity consumption, electricity price, subsidy, and total electricity bill), and outputs the electricity bill calculation results and billing process log;

[0086] The billing anomaly adaptive correction unit, based on the electricity billing calculation results and billing process logs output by the smart contract billing unit, automatically compares the billing data of the same period in history, the billing benchmarks of the same type of users and preset thresholds to identify billing anomalies (such as incorrect electricity price application or subsidy calculation deviations) without manual intervention. At the same time, it automatically retrieves user data and electricity price rules, completes the anomaly correction and generates correction logs, outputs the corrected electricity billing calculation results, ensures billing accuracy, and records the anomalies and corrections on the blockchain for evidence storage, providing a basis for subsequent verification.

[0087] The billing result storage unit generates a billing result certificate based on the electricity billing calculation result and billing process log output by the smart contract billing unit. The certificate includes information such as user ID, billing period, electricity amount, billing basis, and smart contract signature. The certificate is encrypted and stored on the blockchain, and simultaneously pushed to the corresponding user node and power supply node, and outputs a billing result storage completion signal.

[0088] Please see Figure 5 The billing result feedback and closed-loop settlement module includes:

[0089] The result decryption and push unit, based on the billing result storage completion signal output by the blockchain-based intelligent billing calculation module, allows user nodes to decrypt the certificate using their own private keys to obtain their current electricity bill details and billing basis, while the power supply node obtains the billing results for all users. The electricity bill details are pushed to users through channels such as APP, SMS, and web pages, along with a link to the billing rules for easy user verification, and the result push completion signal is output.

[0090] The user confirms the verification unit. Based on the result decryption push unit output, the user pushes the completion signal, checks their own electricity consumption data and billing results. If the confirmation is correct, the user submits confirmation information (including user signature and confirmation time). The confirmation information is encrypted and stored on the blockchain. If there is any objection, the user submits an objection application and relevant supporting materials. The system automatically triggers the regulatory node to intervene and verify, and outputs the user confirmation result.

[0091] The intelligent automatic settlement unit, based on the user confirmation result output by the user confirmation verification unit, triggers a settlement instruction through a smart contract. It then links with a financial settlement institution via a cross-chain gateway to automatically transfer electricity fees from the user's bound account to the power supplier's account. For distributed energy users, the subsidy amount is transferred to the user's account simultaneously. After settlement is completed, a settlement voucher (including settlement amount, settlement time, and transaction details) is generated, and a settlement completion signal and settlement voucher are output.

[0092] The settlement anomaly intelligent backtracking unit, based on the settlement completion signal and settlement voucher output by the intelligent automatic settlement unit, monitors the settlement status in real time through smart contracts. If settlement failure, abnormal fund transfer, or other issues are detected, it automatically retrieves the original data, billing result evidence, and settlement logs on the blockchain to trace the root cause of the anomaly (such as incorrect account information or cross-chain linkage failure). It also pushes anomaly alerts to relevant nodes and triggers adaptive remediation mechanisms (such as re-transfer or information verification), outputs the anomaly handling results, ensures the integrity of the settlement closed loop, and records the backtracking and handling on the blockchain to improve settlement reliability.

[0093] The settlement end-to-end evidence storage unit, based on the settlement completion signal and settlement voucher output by the intelligent automatic settlement unit, encrypts the settlement data and stores it on the blockchain, and simultaneously pushes it to all relevant nodes (users, power suppliers, regulatory agencies, and financial institutions), forming a complete closed loop of "data collection-on-chain-billing-settlement"; at the same time, it generates a full-process traceability report, which includes data, operation records and signature information of each link, to facilitate subsequent supervision and verification.

[0094] A method for billing electricity based on blockchain technology includes the following steps:

[0095] S1, Multi-source data acquisition and preprocessing: Acquire raw data of electrical energy from multiple sources, complete data integrity verification and standardization processing, encrypt sensitive information, and output the encrypted data set;

[0096] The specific steps of S1 are as follows:

[0097] S11, Multi-source data acquisition: Deploy hardware such as smart meters, distributed energy monitoring equipment, and power grid load acquisition terminals to simultaneously collect user electricity consumption data (electricity consumption, electricity consumption time period, electricity consumption type), distributed energy generation data (generation output, generation time period), and power grid price data (time-of-use price, tiered price, subsidy standard), and output a multi-source raw data set.

[0098] S12, Data Integrity Verification: Based on the multi-source raw data set output by S11, a hash algorithm is used to encrypt each piece of data to generate a data hash value. This hash value is then compared with the preset raw data baseline hash value. Abnormal data with mismatched hash values ​​(such as missing or tampered data) is removed, and a valid data set that has passed the verification is output. At the same time, the collection time and device number of abnormal data are recorded for easy traceability later.

[0099] S13, Data Standardization Processing: Based on the valid data set output by S12, the data format, unit and coding rules are unified. The electricity consumption unit is unified to "kWh" and the electricity price unit is unified to "yuan / kWh". Core fields such as user ID, data collection time, data type and value are extracted and a standardized data list is output. At the same time, the data is classified and stored for easy retrieval later.

[0100] S14, Privacy Data Encryption: Based on the standardized data list output by S13, homomorphic encryption algorithm is used to encrypt sensitive user information (such as user ID, electricity address, and specific electricity consumption) to generate encrypted data, while retaining the plaintext format of non-sensitive data (such as public electricity price and power generation time period) and outputting the encrypted data set.

[0101] S2, Blockchain Consortium Chain Deployment and Data On-Chain: Based on the encrypted data set output by S1, complete the multi-node deployment and consensus configuration of the consortium chain, generate block information, complete the full-node synchronization and on-chain storage of data, and output the data on-chain completion signal and on-chain certificate;

[0102] The specific steps of S2 are as follows:

[0103] S21, Multi-node deployment: Deploy nodes with multiple roles such as power suppliers, users, regulatory agencies, financial settlement institutions, and distributed energy operators to build a consortium blockchain architecture. Each node has independent accounting and data access permissions. Among them, regulatory nodes have full data access permissions to supervise the entire billing process, while user nodes can only access their own relevant data, realizing hierarchical permission management and outputting the consortium blockchain node topology and permission allocation list.

[0104] S22, Consensus Mechanism Configuration: Based on the consortium blockchain node topology and permission allocation list output by S21, a dynamic group consensus mechanism is adopted, dividing all nodes into several groups. Each group selects a core node to be responsible for consensus verification. A decay factor is introduced to dynamically reduce redundant consensus rounds according to network load, thereby improving the efficiency of data upload to the blockchain. At the same time, a consensus threshold is set. Data upload to the blockchain can only be completed when more than 80% of the nodes confirm that the data is valid. Consensus mechanism parameters and operating rules are output.

[0105] S23, Block Information Generation: Based on the encrypted data set output by S1 and the consensus mechanism parameters and operating rules output by S22, the encrypted data is sorted by timestamp to generate block data. Each block contains a block header (timestamp, hash value of the previous block, and consensus node signature) and a block body (encrypted data and data hash value). The hash value of the current block is calculated, and complete block information is output.

[0106] S24, Data Synchronization on Chain: Based on the complete block information output by S23, after verification through the consensus mechanism, the block is synchronized to all nodes of the consortium chain to complete the data on-chain storage; and each node synchronously updates its local ledger to ensure data consistency across all nodes, while generating a data on-chain certificate (including block hash value, on-chain time, and node signature), and outputting a data on-chain completion signal and on-chain certificate.

[0107] S3, based on blockchain smart billing calculation: Based on the data on-chain completion signal and on-chain certificate output by S2, the billing rule smart contract is deployed, and the corresponding data is retrieved to execute the contract billing calculation, generate and store the billing result, and output the billing result storage completion signal.

[0108] The specific steps of S3 are as follows:

[0109] S31, Billing rules on the blockchain: Billing rules such as tiered electricity pricing, time-of-use pricing, distributed energy subsidies, and penalties for breach of contract are converted into smart contract code and deployed to the blockchain after being reviewed and confirmed by multiple nodes. At the same time, the smart contract has built-in trigger conditions (such as electricity consumption period, electricity consumption threshold, and subsidy standard) that cannot be modified at will, and outputs the address of the deployed smart contract and the details of the rules.

[0110] S32, Precise Data Retrieval: Based on the smart contract address and rule details output by S31, the smart contract calls the data on-chain completion signal and on-chain certificate output by S2 to retrieve the corresponding user's encrypted electricity consumption data, electricity price data, and power generation data according to the user ID and billing cycle. At the same time, non-sensitive data is restored through decryption algorithm, and user data and electricity price rules matching the current billing cycle are output.

[0111] S33, Smart Contract Billing: Based on user data and electricity price rules output by S32 that match the current billing cycle, the smart contract is triggered to automatically execute billing calculations: time-of-use pricing is differentiated according to electricity consumption time periods, tiered pricing levels are determined according to electricity consumption, subsidy amounts are calculated in conjunction with distributed energy generation data, penalty fees for breach of contract (if any) are deducted, and a detailed electricity bill for the user in the current period (including electricity consumption, electricity price, subsidy, and total electricity bill) is generated. The electricity bill calculation results and billing process logs are output.

[0112] S34, Adaptive Correction of Billing Anomalies: Based on the electricity billing calculation results and billing process logs output by S33, the smart contract automatically compares historical billing data from the same period, billing benchmarks for similar users, and preset thresholds to identify billing anomalies (such as incorrect electricity price application or subsidy calculation deviations) without manual intervention. At the same time, it automatically retrieves user data and electricity price rules, completes anomaly correction, generates correction logs, and outputs the corrected electricity billing calculation results to ensure billing accuracy. Meanwhile, the anomaly and correction records are stored on the blockchain for evidence, providing a basis for subsequent verification.

[0113] S35, Billing Result Evidence Storage: Based on the electricity billing calculation results and billing process logs output by S33, a billing result certificate is generated, which includes information such as user ID, billing cycle, electricity billing amount, billing basis, and smart contract signature. At the same time, the certificate is encrypted and stored on the blockchain, and simultaneously pushed to the corresponding user node and power supply node, and outputs a billing result evidence storage completion signal.

[0114] S4, Billing Result Feedback and Closed-Loop Settlement: Based on the billing result notarization completion signal output by S3, the result decryption push and user confirmation verification are completed, triggering the smart contract to execute fund settlement;

[0115] The specific steps of S4 are as follows:

[0116] S41, Result Decryption Push: Based on the billing result storage completion signal output by S3, the user node decrypts the certificate with its own private key to obtain its own current electricity bill details and billing basis, and the power supply node obtains the billing results of all users; the electricity bill details are pushed to users through channels such as APP, SMS, and web pages, and a billing rule link is also pushed to facilitate user verification, and the result push completion signal is output.

[0117] S42, User Confirmation Verification: Based on the result output by S41, the user pushes a completion signal, verifies their own electricity consumption data and billing results, and if the confirmation is correct, submits confirmation information (including user signature and confirmation time). The confirmation information is encrypted and stored on the blockchain. If there is any objection, the user submits an objection application and relevant supporting materials. The system automatically triggers the regulatory node to intervene and verify, and outputs the user confirmation result.

[0118] S43, Smart Automatic Settlement: Based on the user confirmation result output by S42, the smart contract triggers the settlement instruction, and through the cross-chain gateway, it links with the financial settlement institution to automatically transfer electricity fees from the user's bound account to the power supplier's account; for distributed energy users, the subsidy amount is transferred to the user's account simultaneously. After the settlement is completed, a settlement voucher (including settlement amount, settlement time, and transaction details) is generated, and a settlement completion signal and settlement voucher are output.

[0119] S44, Intelligent Settlement Anomaly Backtracking: Based on the settlement completion signal and settlement voucher output by S43, the smart contract monitors the settlement status in real time. If settlement failure, abnormal fund transfer, or other issues are detected, the original data, billing result storage, and settlement logs on the blockchain are automatically retrieved to trace the root cause of the anomaly (such as incorrect account information or cross-chain linkage failure). Anomaly prompts are pushed to relevant nodes simultaneously, and an adaptive remediation mechanism (such as re-transfer or information verification) is triggered. The anomaly handling results are output to ensure the integrity of the settlement loop. At the same time, the backtracking and handling records are recorded on the blockchain to improve settlement reliability.

[0120] S45, end-to-end settlement evidence storage: Based on the settlement completion signal and settlement voucher output by S43, the settlement data is encrypted and stored on the blockchain, and simultaneously pushed to all relevant nodes (users, power suppliers, regulatory agencies, financial institutions), forming a complete closed loop of "data collection-on-chain-billing-settlement"; at the same time, a full-process traceability report is generated, which includes data, operation records and signature information of each link, which facilitates subsequent supervision and verification.

[0121] Although the present invention has been described above with reference to embodiments, various modifications can be made and components can be replaced with equivalents without departing from the scope of the invention. In particular, as long as there is no structural conflict, the features in the disclosed embodiments can be combined with each other in any manner. The lack of an exhaustive description of these combinations in this specification is merely for the sake of brevity and resource conservation. Therefore, the present invention is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.

Claims

1. An electricity billing system based on blockchain technology, characterized in that, include: The multi-source data acquisition and preprocessing module acquires raw electrical energy data from multiple sources, performs data integrity verification and standardization processing, encrypts sensitive information, and outputs an encrypted data set. The blockchain consortium chain deployment and data upload module includes a multi-node deployment unit, a consensus mechanism configuration unit, a block information generation unit, and a data synchronization and upload unit. The multi-node deployment unit deploys multiple nodes, including power suppliers, ordinary users, distributed energy operators, energy storage service providers, virtual power plant management terminals, power regulatory agencies, and financial settlement institutions, to construct a multi-level permission-based consortium blockchain architecture. It adopts a hierarchical permission control mechanism: regulatory nodes have full data audit permissions, industry nodes have access permissions for business-related data, and ordinary users can only view their own billing data, implementing the principle of least privilege and preventing unauthorized data access. The consensus mechanism configuration unit innovatively adopts a dynamic grouping adaptive consensus mechanism, which differs from the traditional fixed consensus mode. It dynamically adjusts the number of groups, the number of core nodes, and the consensus rounds based on network load and data transaction volume. In low-load scenarios, it streamlines consensus nodes to reduce energy consumption, and in high-concurrency scenarios, it expands groups to increase throughput. At the same time, it sets a node consensus threshold to balance consensus security and on-chain efficiency, perfectly adapting to the high-frequency on-chain requirements of massive electricity time-series data. The block information generation unit sorts the encrypted power data in order according to millisecond-level timestamps, adds a data traceability fingerprint to the block body, and associates it with the collection device number, collection time, and preprocessing logs to achieve accurate traceability of each billing data; through chained hash iterative calculation, it ensures that the block data is tamper-proof; The multi-node deployment unit deploys multi-role nodes to build a consortium blockchain architecture, and each node has independent accounting permissions and data access permissions, outputting the consortium blockchain node topology and permission allocation list; The consensus mechanism configuration unit, based on the consortium blockchain node topology and permission allocation list output by the multi-node deployment unit, adopts a dynamic group consensus mechanism to divide all nodes into several groups, selects a core node in each group to be responsible for consensus verification, sets a consensus threshold, and outputs consensus mechanism parameters and operating rules. The block information generation unit, based on the encrypted data set output by the multi-source data acquisition and preprocessing module and the consensus mechanism parameters and operating rules output by the consensus mechanism configuration unit, sorts the encrypted data by timestamp, generates block data, calculates the hash value of the current block, and outputs complete block information. The data synchronization and on-chain unit, based on the complete block information output by the block information generation unit, verifies it through the consensus mechanism and synchronizes the block to all nodes of the consortium chain, completing the data on-chain storage; and each node synchronously updates its local ledger, generates a data on-chain certificate, and outputs a data on-chain completion signal and on-chain certificate. The blockchain-based smart billing calculation module, based on the data on-chain completion signal and on-chain certificate output by the blockchain consortium chain deployment and data on-chain module, completes the deployment of the billing rule smart contract, retrieves the corresponding data to execute the contract billing calculation, generates and stores the billing result, and outputs the billing result storage completion signal. The billing result feedback and closed-loop settlement module, based on the billing result storage completion signal output by the blockchain-based smart billing calculation module, completes the result decryption push and user confirmation verification, triggering the smart contract to execute fund settlement.

2. The electricity billing system based on blockchain technology according to claim 1, characterized in that, The multi-source data acquisition and preprocessing module includes: The multi-source data acquisition unit collects user electricity consumption data, distributed energy generation data, and grid electricity price data, and outputs a multi-source raw data set. It is compatible with multi-dimensional data such as conventional user electricity consumption, distributed photovoltaic / wind power generation, energy storage charging and discharging, virtual power plant aggregated electricity consumption, and spot market time-of-use electricity pricing, achieving full data coverage across all scenarios. The data integrity verification unit, based on the multi-source raw data set output by the multi-source data acquisition unit, uses a hash algorithm to encrypt each piece of data, generates a data hash value, compares it with the preset raw data baseline hash value, and outputs a valid data set that has passed the verification. At the same time, an abnormal data ledger was established to accurately record abnormal information such as missing, tampered, and delayed data, providing data support for subsequent source tracing and error correction. The data standardization processing unit, based on the valid data set output by the data integrity verification unit, unifies the data format, units and encoding rules, extracts fields, and outputs a standardized data list; The privacy data encryption unit, based on the standardized data list output by the data standardization processing unit, uses a homomorphic encryption algorithm to encrypt sensitive user information, generates encrypted data, and outputs the encrypted data set; A tiered encryption mechanism is adopted to provide high-strength encryption for core privacy data such as user identity information and electricity consumption details, while retaining public information such as public electricity prices and industry benchmark data in plaintext, thus balancing data privacy with the practicality of data sharing.

3. The electricity billing system based on blockchain technology according to claim 1, characterized in that, The blockchain-based smart billing module includes: The billing rules on-chain unit converts the billing rules into smart contract code, and after being reviewed and confirmed by multiple nodes, it is deployed to the blockchain. At the same time, the smart contract has built-in trigger conditions and outputs the address of the deployed smart contract and the details of the rules. The data precision retrieval unit, based on the smart contract address and rule details of the billing rule on-chain unit, calls the data on-chain completion signal and on-chain certificate output by the blockchain consortium chain deployment and data on-chain module through the smart contract. According to the user ID and billing cycle, it retrieves the corresponding user's encrypted electricity consumption data, electricity price data, and power generation data. At the same time, it restores non-sensitive data through decryption algorithms and outputs user data and electricity price rules that match the current billing cycle. The smart contract billing unit, based on user data and electricity price rules that match the current billing cycle output by the data precision retrieval unit, triggers the smart contract to automatically execute billing calculations and outputs electricity billing calculation results and billing process logs. The billing anomaly adaptive correction unit, based on the electricity billing calculation results and billing process logs output by the smart contract billing unit, automatically compares the historical billing data of the same period, the billing benchmarks of the same type of users and preset thresholds, identifies billing anomalies, and automatically retrieves user data and electricity price rules to complete the anomaly correction and generate correction logs, and outputs the corrected electricity billing calculation results. The billing result storage unit generates a billing result certificate based on the electricity billing calculation result and billing process log output by the smart contract billing unit. The certificate is then encrypted, stored on the blockchain, and simultaneously pushed to the corresponding user node and power supply node, outputting a billing result storage completion signal.

4. The electricity billing system based on blockchain technology according to claim 1, characterized in that, The billing result feedback and closed-loop settlement module includes: The result decryption and push unit is based on the billing result storage completion signal output by the blockchain-based smart billing calculation module. User nodes decrypt the certificate with their own private keys to obtain their current electricity bill details and billing basis. The power supply node obtains the billing results of all users and outputs the result push completion signal. The user confirms the verification unit. Based on the result decryption push unit output, the user pushes the completion signal, checks their own electricity consumption data and billing results. If the confirmation is correct, the user submits the confirmation information. If there is any objection, the user submits the objection application and relevant supporting materials, and the user confirmation result is output. The intelligent automatic settlement unit, based on the user confirmation result output by the user confirmation verification unit, triggers a settlement instruction through a smart contract. It then links with a financial settlement institution via a cross-chain gateway to automatically transfer electricity fees from the user's bound account to the power supplier's account, and outputs a settlement completion signal and settlement voucher. The settlement anomaly intelligent backtracking unit, based on the settlement completion signal and settlement voucher output by the intelligent automatic settlement unit, the smart contract monitors the settlement status in real time. If a settlement problem is detected, it automatically retrieves the original data, billing result storage and settlement logs on the chain, traces the root cause of the anomaly, triggers the adaptive remediation mechanism, and outputs the anomaly handling result. The settlement end-to-end evidence storage unit, based on the settlement completion signal and settlement voucher output by the intelligent automatic settlement unit, encrypts the settlement data and stores it on the blockchain, and pushes it to all relevant nodes simultaneously, while generating a full-process traceability report.

5. A method for electricity billing based on blockchain technology, characterized in that, Includes the following steps: S1, Multi-source data acquisition and preprocessing: Acquire raw data of electrical energy from multiple sources, complete data integrity verification and standardization processing, encrypt sensitive information, and output the encrypted data set; S2, Blockchain Consortium Chain Deployment and Data On-Chain: S21, Multi-node Deployment: Deploy multi-role nodes to build a consortium blockchain architecture, with each node having independent accounting and data access permissions, and outputting the consortium blockchain node topology and permission allocation list; S22, Consensus Mechanism Configuration: Based on the consortium blockchain node topology and permission allocation list output by S21, a dynamic group consensus mechanism is adopted to divide all nodes into several groups. Each group selects a core node to be responsible for consensus verification. At the same time, a consensus threshold is set, and consensus mechanism parameters and operating rules are output. S23, Block Information Generation: Based on the encrypted data set output by S1 and the consensus mechanism parameters and operating rules output by S22, the encrypted data is sorted by timestamp to generate block data, and the hash value of the current block is calculated to output complete block information. S24, Data Synchronization on Chain: Based on the complete block information output by S23, after verification through the consensus mechanism, the block is synchronized to all nodes of the consortium chain to complete the data on-chain storage; and each node synchronously updates its local ledger, generates a data on-chain certificate, and outputs a data on-chain completion signal and on-chain certificate. S3, based on blockchain smart billing calculation: Based on the data on-chain completion signal and on-chain certificate output by S2, the billing rule smart contract is deployed, and the corresponding data is retrieved to execute the contract billing calculation, generate and store the billing result, and output the billing result storage completion signal. S4, Billing Result Feedback and Closed-Loop Settlement: Based on the billing result notarization completion signal output by S3, the result decryption push and user confirmation verification are completed, triggering the smart contract to execute fund settlement.

6. The electricity billing method based on blockchain technology according to claim 5, characterized in that, The specific steps of S1 are as follows: S11, Multi-source data acquisition: Collects user electricity consumption data, distributed energy generation data, and grid electricity price data, and outputs a multi-source raw data set; S12, Data Integrity Verification: Based on the multi-source raw data set output by S11, a hash algorithm is used to encrypt each piece of data to generate a data hash value, which is compared with the preset raw data baseline hash value, and a valid data set that has passed the verification is output. S13, Data Standardization Processing: Based on the valid data set output by S12, standardize the data format, units and encoding rules, extract fields, and output a standardized data list; S14, Privacy Data Encryption: Based on the standardized data list output by S13, homomorphic encryption algorithm is used to encrypt sensitive user information, generate encrypted data, and output the encrypted data set.

7. The electricity billing method based on blockchain technology according to claim 5, characterized in that, The specific steps of S3 are as follows: S31, Billing Rules on the Blockchain: The billing rules are converted into smart contract code, and after being reviewed and confirmed by multiple nodes, they are deployed to the blockchain. At the same time, the smart contract has built-in trigger conditions and outputs the address of the deployed smart contract and the details of the rules. S32, Precise Data Retrieval: Based on the smart contract address and rule details output by S31, the smart contract calls the data on-chain completion signal and on-chain certificate output by S2 to retrieve the corresponding user's encrypted electricity consumption data, electricity price data, and power generation data according to the user ID and billing cycle. At the same time, non-sensitive data is restored through decryption algorithm, and user data and electricity price rules matching the current billing cycle are output. S33, Smart Contract Billing: Based on the user data and electricity price rules output by S32 that match the current billing cycle, the smart contract is triggered to automatically execute the billing calculation and output the electricity billing calculation result and billing process log; S34, Adaptive Correction of Billing Anomalies: Based on the electricity billing calculation results and billing process logs output by S33, the smart contract automatically compares the historical billing data of the same period, the billing benchmarks of the same type of users and the preset thresholds to identify billing anomalies. At the same time, it automatically retrieves user data and electricity price rules, completes the anomaly correction and generates a correction log, and outputs the corrected electricity billing calculation results. S35, Billing Result Evidence Storage: Based on the electricity billing calculation results and billing process logs output by S33, a billing result certificate is generated. The certificate is then encrypted and stored on the blockchain, and simultaneously pushed to the corresponding user node and power supply node. A billing result evidence storage completion signal is output.

8. The electricity billing method based on blockchain technology according to claim 5, characterized in that, The specific steps of S4 are as follows: S41, Result Decryption Push: Based on the billing result storage completion signal output by S3, the user node decrypts the certificate with its own private key to obtain its own current electricity bill details and billing basis, and the power supply node obtains the billing results of all users and outputs the result push completion signal. S42, User Confirmation Verification: Based on the result output by S41, the user pushes a completion signal, verifies their own electricity consumption data and billing results, and if the confirmation is correct, submits confirmation information; if there is any objection, the user submits an objection application and relevant supporting materials, and outputs the user confirmation result. S43, Smart Automatic Settlement: Based on the user confirmation result output by S42, the smart contract triggers the settlement instruction, and through the cross-chain gateway, it links with the financial settlement institution to automatically transfer the electricity fee from the user's bound account to the power supplier's account, and outputs the settlement completion signal and settlement voucher; S44, Intelligent Backtracking of Settlement Anomalies: Based on the settlement completion signal and settlement voucher output by S43, the smart contract monitors the settlement status in real time. If a settlement problem is detected, it automatically retrieves the original data, billing result certificate, and settlement logs on the chain, traces the root cause of the anomaly, triggers the adaptive remediation mechanism, and outputs the anomaly handling result. S45, Settlement End-to-End Evidence Storage: Based on the settlement completion signal and settlement voucher output by S43, the settlement data is encrypted and stored on the blockchain, and simultaneously pushed to all relevant nodes, while generating a full-process traceability report.