Green power data multi-source heterogeneous convergence and tamper-proof accounting authentication method and system
By uniformly processing multi-source heterogeneous green power data and using elliptic curve cryptography algorithm and blockchain technology for digital signature and storage, data integration and security issues are solved, and the accuracy and transparency of green power accounting are achieved.
Patent Information
- Application Number
- CN202411656745.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-02-25
AI Technical Summary
It is difficult for the prior art to effectively integrate and analyze multi-source heterogeneous green power data, and the traditional centralized data storage method is prone to tampering and attacks, which affects the accuracy and credibility of the accounting results.
By obtaining data from green power production equipment, trading centers and scheduling data systems, performing unified formatting processing, digital signatures are generated using the elliptic curve cryptography algorithm, and a blockchain network is built based on distributed ledger technology to perform data verification and storage. At the same time, a deep learning model is used for data cleaning and abnormal detection, and a power balance model is established to calculate the actual consumption of green power.
The multi-source heterogeneous aggregation and standardized processing of green power data is realized, the credibility and security of data are improved, the accuracy and reliability of accounting are enhanced, and the transparency and traceability of the accounting process is realized through blockchain proof storage.
Smart Images

Figure CN119513931A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to electric power technology, and in particular to a method and system for green electric power data multi-source heterogeneous aggregation and tamper-proof accounting authentication. Background Art
[0002] Green power data comes from various sources and in different formats. Power production data, transaction data, and dispatch data are scattered in different systems, with different data formats and standards, which makes data integration and analysis difficult, affecting the accuracy and efficiency of accounting.
[0003] Secondly, traditional centralized data storage methods are vulnerable to tampering and attacks. Green power data is related to huge economic interests. A single data storage center cannot guarantee the authenticity and integrity of the data, and there is a risk of malicious tampering, which in turn affects the credibility of the accounting results.
[0004] Finally, the existing accounting methods lack intelligence and automation. Manual accounting is prone to errors and inefficient; simple statistical models cannot effectively process complex power system data and cannot accurately reflect the actual green power consumption situation, affecting the accuracy and reliability of the accounting results.
[0005] These problems have seriously restricted the development of green power accounting and certification, and there is an urgent need for a new method that can achieve multi-source heterogeneous data aggregation, tamper-proof storage, and intelligent accounting. Summary of the invention
[0006] The embodiments of the present invention provide a method and system for multi-source heterogeneous aggregation and tamper-proof accounting and authentication of green power data, which can solve the problems in the prior art.
[0007] According to a first aspect of the embodiments of the present invention, Provides green power data multi-source heterogeneous aggregation and tamper-proof accounting authentication methods, including: Acquire power production data from the metering and collection module of green power production equipment, acquire green power trading data from the power trading database of the power trading center, and acquire power dispatching data from the dispatching data system of the power grid dispatching center, format the power production data, the green power trading data and the power dispatching data according to a unified data structure standard, and generate a standardized green power data set; Using elliptic curve cryptography to generate a unique digital signature for each data record in the standardized green power data set, the digital signature and the corresponding data record form a data block, a blockchain network is constructed based on distributed ledger technology, a plurality of consensus nodes are set in the blockchain network, the plurality of consensus nodes verify the data block through the PBFT consensus mechanism, and the data block is added to the blockchain after the verification is passed; The standardized green power data set is extracted from the blockchain, and a deep learning model is used to perform data cleaning and anomaly detection on the standardized green power data set, and a power balance model including power generation, transmission loss and power consumption is established, and the actual green power consumption is calculated according to the power balance model, and a green power accounting report is generated, and the green power accounting report is digitally signed and uploaded to the blockchain network for evidence storage.
[0008] Using an elliptic curve cryptographic algorithm to generate a unique digital signature for each data record in the standardized green power data set, and combining the digital signature and the corresponding data record into a data block includes: The SECP256K1 elliptic curve is selected as the basic cryptographic algorithm. The curve equation of the SECP256K1 elliptic curve is y² = x³ + 7. The SECP256K1 elliptic curve has a base point G. The order of the base point G is n. Unique private keys sk are configured for green power production equipment, power trading center and power grid dispatching center respectively. The SHA-256 hash value h is calculated for the standardized data record. A random integer k is generated on the SECP256K1 elliptic curve using a deterministic random number generation scheme, wherein the value range of the random integer k is 1 to n-1. The base point G is used to calculate the point R=kG, and the x-coordinate value rx of the point R is obtained. The signature value s is calculated according to the signature equation s = k⁻¹(h + rx·sk) mod n, and the x-coordinate value rx and the signature value s are combined into a digital signature. Maintain a separate nonce counter for each data source node, and increase the corresponding nonce counter by 1 each time a digital signature is generated, and use the value of the nonce counter as an input parameter of the deterministic random number generation scheme; construct the data record with the digital signature as a leaf node of the Merkle tree, and the data record includes a timestamp, a data source identifier, original data content, the digital signature, and an associated hash value of the preceding data; The data records are grouped and the digital signatures are calculated simultaneously in a multi-threaded manner. The nodes at each layer of the Merkle tree are constructed in parallel in a pipeline manner. When new data records are added, only the affected tree node paths are recalculated using an incremental update algorithm. The statistical information of the accumulated power production, transaction volume, and dispatch volume in the current time window is recorded in the block header, a bloom filter is constructed for data verification, and the constructed data block is submitted to the blockchain network.
[0009] The data records are grouped and the digital signatures are calculated simultaneously in a multi-threaded manner, and the nodes of each layer of the Merkle tree are constructed in parallel in a pipeline manner. When new data records are added, only the affected tree node paths are recalculated using an incremental update algorithm, including: Divide the data records into multiple data groups according to the time segment, each of the data groups contains the data records in the complete time segment, create a thread pool corresponding to the number of processor cores, each processing thread in the thread pool is responsible for signature calculation of one of the data groups, each processing thread maintains an independent cryptographic computing context, and the cryptographic computing context includes an independent random number generator and an independent counter; Construct a three-level processing pipeline, where the first-level processing pipeline converts the signed data record into a leaf node of a tree structure and calculates the node hash value, the second-level processing pipeline performs parallel calculations on the middle-layer nodes in a bottom-up manner, and the third-level processing pipeline generates a root node and performs block integrity verification. The processing results of the three-level processing pipeline are respectively used as input information of the next-level processing pipeline; Construct a path cache table to record the path information from the leaf node to the root node. When a new data record is received, determine the insertion position of the new data record based on the path cache table, insert the new data record into the tree structure and recalculate the node hash value on the path from the insertion position to the root node; monitor the processing capacity and queue backlog status of the three-stage processing pipeline, and dynamically adjust the data grouping division strategy and the thread allocation scheme of the thread pool according to the processing capacity and the queue backlog status.
[0010] Building a blockchain network based on distributed ledger technology, setting multiple consensus nodes in the blockchain network, and verifying the data block through the PBFT consensus mechanism. After the verification, the data block is added to the blockchain, including: Deploy multiple consensus nodes in the blockchain network, configure node identifiers and digital certificates for the consensus nodes, the digital certificates contain node public key information, the consensus nodes establish a fully connected communication network through a point-to-point network protocol, and encrypt inter-node communication based on an asymmetric encryption algorithm; maintain an active node list, perform status detection on the consensus nodes, and remove faulty nodes from the active node list; The master node is determined according to the hash value size of the node identifier, and the master node is responsible for coordinating the consensus process. The data block submission node broadcasts the data block to the consensus node, and the consensus node verifies the block structure integrity of the data block; the master node sends a pre-prepared message containing a block summary, a view number, and a sequence number to other consensus nodes, and other consensus nodes verify the legitimacy of the view number, sequence number, and block summary of the pre-prepared message; The consensus nodes broadcast preparation messages to each other. Each consensus node confirms entering the preparation state after receiving more than a preset number of preparation messages. The consensus node broadcasts confirmation messages and submits the data block to the local ledger after receiving more than a preset number of confirmation messages. The key messages and node voting information in the consensus process are recorded to form a chain of evidence. When the failure of the master node is detected, the view switching protocol is triggered to select a new master node.
[0011] Establishing a power balance model including power generation, transmission loss and power consumption, calculating the actual amount of green power consumed according to the power balance model, generating a green power accounting report, digitally signing the green power accounting report and uploading it to the blockchain network for evidence storage, including: Collect real-time power generation data of wind farms and photovoltaic power stations, the real-time power generation data includes power generation unit output curve, power factor, power generation efficiency parameters, and establish a power generation side balance model based on the real-time power generation data; divide the transmission line into multiple metering sections, collect power data at the input and output ends of the metering sections, calculate theoretical line loss based on line impedance, conductor cross-sectional area, and transmission voltage parameters, and collect actual line loss data to establish a line loss correction model; collect operating parameters of power equipment, the operating parameters include rated power, power factor, and load rate, and establish a time-divided power load model; Constructing a power balance model for time windows, the power balance model for time windows calculates the total green power generation in each time window based on weather influence factors, equipment efficiency factors, and load fluctuation factors, deducts the actual line loss of the metering section to obtain the effective power available for consumption, and calculates the amount of green power actually consumed by the power consumption unit in combination with the time-divided power load model; A green power accounting report including power generation, transmission loss, consumption, calculation parameters and correction factors is generated. The power generation enterprise signs and confirms the power generation data in the green power accounting report. The power grid company signs and confirms the transmission loss data in the green power accounting report. The power user signs and confirms the consumption data in the green power accounting report. The green power accounting report and signature information are submitted to the blockchain network for verification and storage.
[0012] Constructing a power balance model for time windows, the power balance model for time windows calculates the total green power generation in each time window based on weather influence factors, equipment efficiency factors, and load fluctuation factors, deducting the actual line loss of the metering section to obtain the effective power available for consumption, and combining the time-divided power load model to calculate the actual green power consumed by the power unit, including: Divide 24 hours into multiple time windows with overlapping intervals, and the overlapping intervals are used for data smoothing; collect wind speed, wind direction, temperature, light intensity, and cloud cover data from meteorological stations, establish a mapping relationship between wind speed and power generation efficiency to obtain weather impact factors, establish equipment efficiency factors based on generator set conversion efficiency, inverter efficiency, and transformer loss parameters, and establish load fluctuation factors by analyzing the time series characteristics of historical load data; The rated power of the power generation unit is multiplied by the operating time to obtain the benchmark power generation, and the benchmark power generation is multiplied by the weather impact factor and the equipment efficiency factor to obtain the actual total green power generation within the time window; data from the electric energy metering devices at the head and end of the metering section of the transmission network are collected to calculate the actual loss, and the influence of weather conditions on line impedance is considered, and the metering section losses are accumulated to obtain the total transmission loss; The power-consuming equipment is divided into basic load, fluctuating load and temporary load according to the power consumption characteristics to establish a classification model, and the actual power demand within the time window is calculated in combination with the load fluctuation factor; the effective power available for consumption is obtained by deducting the total transmission loss from the actual total green power generation, and the amount of green power actually consumed by each power-consuming unit is calculated based on the power consumption priority and load distribution according to the effective power available for consumption; The collected data is checked for numerical range, rate of change, and correlation. When abnormal data is detected, historical data interpolation or adjacent measuring point data estimation method is used to correct the data. The deviation between the calculated results and the measured data is compared to adjust the model parameters and weight coefficients. When the difference between supply and demand exceeds the preset threshold, the demand response mechanism is triggered to achieve power balance.
[0013] According to a second aspect of the embodiments of the present invention, Provides a multi-source heterogeneous aggregation and tamper-proof accounting and authentication system for green power data, including: The first unit is used to obtain power production data from the metering and collection module of the green power production equipment, obtain green power trading data from the power trading database of the power trading center, and obtain power dispatching data from the dispatching data system of the power grid dispatching center, and format the power production data, the green power trading data and the power dispatching data according to a unified data structure standard to generate a standardized green power data set; The second unit is used to generate a unique digital signature for each data record in the standardized green power data set by using an elliptic curve cryptographic algorithm, form a data block with the digital signature and the corresponding data record, build a blockchain network based on distributed ledger technology, set multiple consensus nodes in the blockchain network, and the multiple consensus nodes verify the data block through a PBFT consensus mechanism, and add the data block to the blockchain after the verification is passed; The third unit is used to extract the standardized green power data set from the blockchain, use a deep learning model to perform data cleaning and anomaly detection on the standardized green power data set, establish a power balance model including power generation, transmission loss and power consumption, calculate the actual green power consumption according to the power balance model, generate a green power accounting report, digitally sign the green power accounting report and upload it to the blockchain network for evidence storage.
[0014] According to a third aspect of the embodiments of the present invention, An electronic device is provided, comprising: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the aforementioned method.
[0015] A fourth aspect of the embodiments of the present invention is: A computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the aforementioned method is implemented.
[0016] The beneficial effects of this application are as follows: 1. Improved data integrity and credibility: By obtaining green power related data from multiple sources and formatting them using a unified data structure standard, the comprehensiveness and consistency of the data are ensured. The unique digital signature is generated using the elliptic curve cryptographic algorithm, combined with blockchain technology and the PBFT consensus mechanism, which effectively prevents data from being tampered with and greatly improves the credibility and security of green power data.
[0017] 2. Improved calculation accuracy and reliability: A deep learning model is used to clean and detect anomalies in standardized green power data sets, and a power balance model that includes power generation, transmission losses, and power consumption is established, making the calculation of actual green power consumption more accurate. This method significantly improves the accuracy and reliability of green power accounting.
[0018] 3. Improved transparency and traceability of accounting process: The generated green power accounting report is digitally signed and uploaded to the blockchain network for evidence storage, making the accounting process transparent. This not only facilitates the relevant parties to query and verify the accounting results, but also ensures the traceability of the entire accounting process, which is conducive to effective supervision by regulatory agencies and provides reliable data support for green power transactions. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 A schematic diagram of the process of the multi-source heterogeneous aggregation and tamper-proof accounting and authentication method of green power data according to an embodiment of the present invention; Figure 2 It is a structural diagram of the green power data multi-source heterogeneous aggregation and tamper-proof accounting and authentication system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0021] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0022] Figure 1 FIG. 1 is a flow chart of a method for multi-source heterogeneous aggregation and tamper-proof accounting and authentication of green power data according to an embodiment of the present invention. Figure 1 As shown, the method includes: S101. Obtain power production data from the metering and collection module of the green power production equipment, obtain green power trading data from the power trading database of the power trading center, and obtain power dispatching data from the dispatching data system of the power grid dispatching center, format the power production data, the green power trading data and the power dispatching data according to a unified data structure standard, and generate a standardized green power data set; S102. Generate a unique digital signature for each data record in the standardized green power data set using an elliptic curve cryptographic algorithm, form a data block with the digital signature and the corresponding data record, build a blockchain network based on distributed ledger technology, set up multiple consensus nodes in the blockchain network, and the multiple consensus nodes verify the data block through a PBFT consensus mechanism, and add the data block to the blockchain after the verification is passed; S103. Extract the standardized green power data set from the blockchain, use a deep learning model to perform data cleaning and anomaly detection on the standardized green power data set, establish a power balance model that includes power generation, transmission loss and power consumption, calculate the actual green power consumption according to the power balance model, generate a green power accounting report, digitally sign the green power accounting report and upload it to the blockchain network for evidence storage.
[0023] The present invention provides a method for multi-source heterogeneous aggregation and tamper-proof accounting and authentication of green power data, and the specific implementation methods are as follows: First, obtain green power related data from different data sources. Specifically, obtain power production data from the metering and collection module of green power production equipment, such as the real-time power generation of wind turbines and the power generation efficiency of solar photovoltaic panels; obtain green power transaction data from the power transaction database of the power trading center, such as the transaction parties, transaction volume, transaction price, etc.; obtain power dispatch data from the dispatch data system of the power grid dispatch center, such as power grid load and transmission line status.
[0024] Then, the acquired heterogeneous data is standardized. The power production data, green power transaction data, and power dispatch data are formatted according to a unified data structure standard to generate a standardized green power data set. For example, a unified data structure containing fields such as data source, timestamp, data type, and value can be defined to map data from different sources to the structure.
[0025] Next, the elliptic curve cryptography algorithm is used to generate a unique digital signature for each data record in the standardized green power data set. Specifically, the ECDSA (Elliptic Curve Digital Signature Algorithm) algorithm can be used to sign the data using the private key to generate a signature pair consisting of r and s. The digital signature and the corresponding data record form a data block.
[0026] Then, a blockchain network is built based on distributed ledger technology. Multiple consensus nodes are set up in the blockchain network, such as power production enterprises, power grid companies, regulatory agencies, etc. These consensus nodes verify the data blocks through the PBFT (Practical Byzantine Fault Tolerance) consensus mechanism. The verification process includes checking the validity of digital signatures, the correctness of data formats, etc. After verification, the data block is added to the blockchain to form an unalterable data record.
[0027] Next, the standardized green power data set is extracted from the blockchain, and the deep learning model is used to clean the data and detect anomalies. The long short-term memory network (LSTM) model can be used to analyze time series data to detect outliers and missing data. The detected abnormal data is marked or removed to improve data quality.
[0028] Subsequently, a power balance model including power generation, transmission loss and power consumption is established. The model takes into account all aspects of green power production, transmission and consumption. The actual amount of green power consumed is calculated based on the power balance model. For example, if the wind farm generates 100MWh of power in a certain period of time and the transmission loss is 5MWh, the actual amount of green power consumed is 95MWh.
[0029] Finally, a green power accounting report is generated, including information such as green power production, transmission loss, and actual consumption. The accounting report is digitally signed using the same elliptic curve cryptographic algorithm as the data signature. The signed accounting report is uploaded to the blockchain network for evidence storage to ensure the authenticity and immutability of the report.
[0030] The beneficial effects of the method of the present invention include: 1. It realizes the unified aggregation and standardized processing of multi-source heterogeneous green power data, and improves the consistency and availability of data.
[0031] 2. The use of blockchain and cryptography technology ensures the authenticity and immutability of green electricity data, providing a reliable data foundation for green electricity accounting.
[0032] 3. Data cleaning and anomaly detection are performed through deep learning models, combined with power balance models for calculation, which improves the accuracy and reliability of green power consumption calculations.
[0033] In an optional implementation, using an elliptic curve cryptographic algorithm to generate a unique digital signature for each data record in the standardized green power data set, and combining the digital signature and the corresponding data record to form a data block includes: The SECP256K1 elliptic curve is selected as the basic cryptographic algorithm. The curve equation of the SECP256K1 elliptic curve is y² = x³ + 7. The SECP256K1 elliptic curve has a base point G. The order of the base point G is n. Unique private keys sk are configured for green power production equipment, power trading center and power grid dispatching center respectively. The SHA-256 hash value h is calculated for the standardized data record. A random integer k is generated on the SECP256K1 elliptic curve using a deterministic random number generation scheme, wherein the value range of the random integer k is 1 to n-1. The base point G is used to calculate the point R=kG, and the x-coordinate value rx of the point R is obtained. The signature value s is calculated according to the signature equation s = k⁻¹(h + rx·sk) mod n, and the x-coordinate value rx and the signature value s are combined into a digital signature. Maintain a separate nonce counter for each data source node, and increase the corresponding nonce counter by 1 each time a digital signature is generated, and use the value of the nonce counter as an input parameter of the deterministic random number generation scheme; construct the data record with the digital signature as a leaf node of the Merkle tree, and the data record includes a timestamp, a data source identifier, original data content, the digital signature, and an associated hash value of the preceding data; The data records are grouped and the digital signatures are calculated simultaneously in a multi-threaded manner. The nodes at each layer of the Merkle tree are constructed in parallel in a pipeline manner. When new data records are added, only the affected tree node paths are recalculated using an incremental update algorithm. The statistical information of the accumulated power production, transaction volume, and dispatch volume in the current time window is recorded in the block header, a bloom filter is constructed for data verification, and the constructed data block is submitted to the blockchain network.
[0034] This embodiment provides a method for generating a digital signature for green power data and constructing a block using an elliptic curve cryptographic algorithm. The specific steps are as follows: First, the SECP256K1 elliptic curve is selected as the basic cryptographic algorithm. The equation of the curve is y squared equals x cubed plus 7. There is a base point G on the curve, and its order is n. Unique private keys sk are configured for green power production equipment, power trading center, and power grid dispatching center. For example, private key 123456 can be configured for production equipment, private key 789012 can be configured for the trading center, and private key 345678 can be configured for the dispatching center.
[0035] Next, the SHA-256 hash value h is calculated for each standardized data record. For example, for the data record "2023-05-01 10:00:00, device 001, power generation 100kWh", the hash value h = a1b2c3d4... is calculated.
[0036] Then, a deterministic random number generation scheme is used to generate a random integer k, ranging from 1 to n-1. Specifically, the HMAC-DRBG algorithm can be used to generate k using the private key sk and the nonce counter value as the seed. For example, when the nonce value is 5, k = 98765 is generated.
[0037] Use base point G to calculate point R = kG and obtain the x-coordinate value rx of R. For example, calculate rx = def012...
[0038] The signature value s is calculated by multiplying the inverse of the signature equation s = k by (h plus rx times sk) modulo n. For example, s = 456789... is obtained.
[0039] Combine rx and s into a digital signature (rx, s).
[0040] A separate nonce counter is maintained for each data source node, and each time a signature is generated, the corresponding counter is incremented by 1. The nonce value is used as the input of the deterministic random number generation scheme.
[0041] The data records with digital signatures are constructed as leaf nodes of the Merkle tree. Each data record contains: timestamp, data source identifier, original data content, digital signature, and associated hash value of the previous data. For example: "2023-05-0110:00:00, device 001, power generation 100kWh, (rx,s), 0000..."
[0042] The digital signature is calculated in parallel using multi-threading to improve processing efficiency. For example, 8 threads can be started at the same time, and each thread is responsible for calculating the signature of a part of the data record.
[0043] Use pipeline method to build nodes of each layer of Merkle tree in parallel. For example, after the calculation of the first-level nodes is completed, the calculation of the second-level nodes will start immediately without waiting for all the first-level nodes to be calculated.
[0044] When new data records are added, an incremental update algorithm is used to recalculate only the affected tree node paths to avoid rebuilding the entire tree. For example, when a new leaf node is added, only the path from the leaf node to the root node needs to be updated.
[0045] The block header records the statistical information of the accumulated power production, transaction volume, and dispatch volume within the current time window (such as 1 hour). For example: "Total power generation: 10000kWh, total transaction volume: 9000kWh, total dispatch volume: 8500kWh".
[0046] Build a bloom filter for data verification and add the hash values of all data records to the filter. This allows you to quickly check whether a piece of data is likely to exist in a block.
[0047] Finally, the constructed data block is submitted to the blockchain network for consensus and storage.
[0048] The beneficial effects of this method include: 1. By using the elliptic curve cryptography algorithm to generate a digital signature, the authenticity and non-tamperability of the data are guaranteed, and the security and credibility of green power data are improved.
[0049] 2. The use of multi-threaded parallel computing and pipeline construction of Merkle trees significantly improves the efficiency of data processing and block generation, and is suitable for the rapid processing of large-scale real-time data.
[0050] 3. By using incremental update algorithm and bloom filter, the data update and query performance are optimized, the consumption of computing resources is reduced, and the scalability and practicality of the entire system are improved.
[0051] In an optional implementation, the data records are grouped and the digital signatures are calculated simultaneously in a multi-threaded manner, and the nodes of each layer of the Merkle tree are constructed in parallel in a pipeline manner. When a new data record is added, only the affected tree node paths are recalculated using an incremental update algorithm, including: Divide the data records into multiple data groups according to the time segment, each of the data groups contains the data records in the complete time segment, create a thread pool corresponding to the number of processor cores, each processing thread in the thread pool is responsible for signature calculation of one of the data groups, each processing thread maintains an independent cryptographic computing context, and the cryptographic computing context includes an independent random number generator and an independent counter; Construct a three-level processing pipeline, where the first-level processing pipeline converts the signed data record into a leaf node of a tree structure and calculates the node hash value, the second-level processing pipeline performs parallel calculations on the middle-layer nodes in a bottom-up manner, and the third-level processing pipeline generates a root node and performs block integrity verification. The processing results of the three-level processing pipeline are respectively used as input information of the next-level processing pipeline; Construct a path cache table to record the path information from the leaf node to the root node. When a new data record is received, determine the insertion position of the new data record based on the path cache table, insert the new data record into the tree structure and recalculate the node hash value on the path from the insertion position to the root node; monitor the processing capacity and queue backlog status of the three-stage processing pipeline, and dynamically adjust the data grouping division strategy and the thread allocation scheme of the thread pool according to the processing capacity and the queue backlog status.
[0052] This implementation provides an efficient blockchain data processing method. First, the data records are grouped by time segments, and each group contains records within a complete time segment. A thread pool corresponding to the number of processor cores is created, and each processing thread is responsible for the signature calculation of a data group and maintains an independent cryptographic calculation context, including an independent random number generator and counter. This can fully utilize the parallel computing capabilities of multi-core processors and improve the efficiency of signature calculation.
[0053] Next, a three-level processing pipeline is constructed. The first-level pipeline converts the signed data record into a leaf node of the tree structure and calculates the node hash value. In the specific implementation, hash algorithms such as SHA256 can be used to take the data record content and timestamp information as input to generate a fixed-length hash value as a leaf node. The second-level pipeline performs parallel calculations on the middle-layer nodes from bottom to top. The hash values of two adjacent child nodes can be concatenated and hashed again to obtain the hash value of the parent node. Multithreading is used to process nodes at the same layer at the same time to speed up the calculation. The third-level pipeline generates the root node and performs block integrity verification. The last two remaining node hash values are combined to obtain the root node hash, which is compared with the Merkle root recorded in the block header to verify data integrity. The processing results of the three-level pipeline are used as the input of the next level to form a continuous data stream.
[0054] To support incremental updates, a path cache table is built to record the path information from the leaf node to the root node. When a new data record is received, the insertion position is determined based on the path cache table, usually after the rightmost leaf node. The new record is inserted into the tree structure, and the node hash value on the path from the insertion position to the root node is recalculated. For example, if the insertion position is the 100th leaf node, the 100th leaf node, the 50th intermediate node, the 25th intermediate node, and so on need to be updated until the root node. This method avoids rebuilding the entire tree and improves update efficiency.
[0055] At the same time, the system monitors the processing capacity and queue backlog status of the three-stage processing pipeline. The average processing time and queue length of each stage of the pipeline can be counted. The data grouping strategy and thread allocation scheme are dynamically adjusted according to these indicators. For example, when it is found that the second-stage pipeline is processing slowly, the number of threads at that stage can be increased; when a data group is too large to cause processing delays, it can be split into smaller groups. This adaptive mechanism ensures the optimal performance of the system under different loads.
[0056] The beneficial effects of this method are mainly reflected in three aspects: 1. Significantly improve the processing efficiency of large-scale data. Through multi-threaded parallel signatures and pipelined parallel construction of Merkle trees, the computing power of multi-core processors is fully utilized, and the processing speed can be increased by several to dozens of times compared to traditional serial methods.
[0057] 2. Achieved efficient incremental updates. The use of path caching and local update algorithms avoids the overhead of frequently reconstructing the entire Merkle tree, allowing the system to quickly respond to the addition of new data and improve real-time performance.
[0058] 3. Good scalability and adaptability. By dynamically monitoring and adjusting processing strategies, the system can automatically optimize resource allocation according to actual load conditions and maintain efficient and stable performance in data processing tasks of different scales.
[0059] In an optional implementation, a blockchain network is constructed based on distributed ledger technology, a plurality of consensus nodes are set in the blockchain network, the plurality of consensus nodes verify the data block through the PBFT consensus mechanism, and after the verification, the data block is added to the blockchain, including: Deploy multiple consensus nodes in the blockchain network, configure node identifiers and digital certificates for the consensus nodes, the digital certificates contain node public key information, the consensus nodes establish a fully connected communication network through a point-to-point network protocol, and encrypt inter-node communication based on an asymmetric encryption algorithm; maintain an active node list, perform status detection on the consensus nodes, and remove faulty nodes from the active node list; The master node is determined according to the hash value size of the node identifier, and the master node is responsible for coordinating the consensus process. The data block submission node broadcasts the data block to the consensus node, and the consensus node verifies the block structure integrity of the data block; the master node sends a pre-prepared message containing a block summary, a view number, and a sequence number to other consensus nodes, and other consensus nodes verify the legitimacy of the view number, sequence number, and block summary of the pre-prepared message; The consensus nodes broadcast preparation messages to each other. Each consensus node confirms entering the preparation state after receiving more than a preset number of preparation messages. The consensus node broadcasts confirmation messages and submits the data block to the local ledger after receiving more than a preset number of confirmation messages. The key messages and node voting information in the consensus process are recorded to form a chain of evidence. When the failure of the master node is detected, the view switching protocol is triggered to select a new master node.
[0060] To build a blockchain network based on distributed ledger technology, you first need to deploy multiple consensus nodes. These nodes can be physical servers or virtual machine instances, and each node is assigned a unique node identifier, such as a 32-bit string generated using UUID. At the same time, a digital certificate is issued to each node, which contains the public key information of the node. For example, you can use the RSA algorithm to generate a 2048-bit public-private key pair, and embed the public key information in a digital certificate in X.509 format.
[0061] The nodes establish a fully connected communication network through P2P network protocols such as libp2p. When a node starts, it broadcasts its network address, and other nodes establish a connection after receiving it. Communication between nodes uses asymmetric encryption. The sender encrypts the message with the receiver's public key, and the receiver decrypts it with his own private key. This ensures the confidentiality of the communication.
[0062] The system maintains a list of active nodes and regularly performs heartbeat checks on the nodes in the list. For example, a ping message is sent to the node every 10 seconds. If there is no response for three consecutive times, the node is considered to be faulty and removed from the active list. When the node comes back online, it needs to rejoin the network and synchronize the latest status.
[0063] During the consensus process, the master node is first selected based on the SHA256 hash value of the node identifier. Assuming there are nodes A, B, and C, and their identifier hash values are 0xabc, 0x123, and 0xdef, respectively, node C will be selected as the master node. The master node is responsible for coordinating the consensus process, receiving transaction requests submitted by the client, packaging the transactions into blocks, and broadcasting them to other nodes.
[0064] After receiving the block, other consensus nodes first verify the structural integrity of the block, including whether the block header format, transaction list, etc. comply with the specifications. The master node then sends a pre-prepared message, which contains the block summary (such as the SHA256 hash value of the block header), the current view number (such as 0), and the sequence number of the block (such as the block height 100). Other nodes verify the legitimacy of the pre-prepared message and ensure that the view number is consistent with the current view. Figure 1 The sequence number is incremented and the block summary is consistent with the received block.
[0065] After verification, the node broadcasts a prepare message. When the node receives more than 2f+1 prepare messages (f is the number of faulty nodes that can be tolerated), it enters the prepare state and broadcasts a confirmation message. After the node receives more than 2f+1 confirmation messages, it can submit the block to the local ledger. During the whole process, the node will record the key messages and voting information received to form a chain of evidence for subsequent audits.
[0066] If the master node fails during the consensus process, such as the master node times out without sending a pre-prepare message, the view switching protocol is triggered. All nodes increase the view number and reselect a new master node based on the node identifier hash value to continue the consensus process.
[0067] The beneficial effects of this program include: 1. The multi-node consensus improves the system's fault tolerance and reliability, and enables it to continue to operate normally even when some nodes fail.
[0068] 2. Asymmetric encryption is used to protect inter-node communications, improving network security and preventing information from being eavesdropped or tampered with.
[0069] 3. The introduction of view switching mechanism can quickly restore system operation when the main node fails, improving the availability and continuity of the system.
[0070] In an optional implementation, a power balance model including power generation, transmission loss and power consumption is established, the actual amount of green power consumed is calculated according to the power balance model, a green power accounting report is generated, and the green power accounting report is digitally signed and uploaded to the blockchain network for evidence storage, including: Collect real-time power generation data of wind farms and photovoltaic power stations, the real-time power generation data includes power generation unit output curve, power factor, power generation efficiency parameters, and establish a power generation side balance model based on the real-time power generation data; divide the transmission line into multiple metering sections, collect power data at the input and output ends of the metering sections, calculate theoretical line loss based on line impedance, conductor cross-sectional area, and transmission voltage parameters, and collect actual line loss data to establish a line loss correction model; collect operating parameters of power equipment, the operating parameters include rated power, power factor, and load rate, and establish a time-divided power load model; Constructing a power balance model for time windows, the power balance model for time windows calculates the total green power generation in each time window based on weather influence factors, equipment efficiency factors, and load fluctuation factors, deducts the actual line loss of the metering section to obtain the effective power available for consumption, and calculates the amount of green power actually consumed by the power consumption unit in combination with the time-divided power load model; A green power accounting report including power generation, transmission loss, consumption, calculation parameters and correction factors is generated. The power generation enterprise signs and confirms the power generation data in the green power accounting report. The power grid company signs and confirms the transmission loss data in the green power accounting report. The power user signs and confirms the consumption data in the green power accounting report. The green power accounting report and signature information are submitted to the blockchain network for verification and storage.
[0071] The present invention provides a green power accounting method, and the specific implementation method is as follows: First, a power balance model including power generation, transmission loss and power consumption is established. This model collects real-time data and performs calculations to achieve accurate accounting of each link in the power system.
[0072] On the power generation side, real-time power generation data of wind farms and photovoltaic power stations are collected. These data include the output curve, power factor and power generation efficiency parameters of the power generation unit. Taking the wind farm as an example, parameters such as wind turbine speed, wind direction, wind speed, etc. can be collected, and the real-time power generation can be calculated in combination with the wind turbine power curve. For photovoltaic power stations, parameters such as light intensity, component temperature, and conversion efficiency are collected. Based on these real-time power generation data, a power generation side balance model is established. This model can accurately reflect the power generation situation in different time periods and provide basic data for subsequent power balance calculations.
[0073] In the transmission link, the transmission line is divided into multiple metering sections. Each section is equipped with an energy metering device to collect power data at the input and output ends. At the same time, the theoretical line loss is calculated based on parameters such as line impedance, conductor cross-sectional area, and transmission voltage. For example, a 110kV transmission line is 50km long, the conductor model is LGJ-240 / 30, and the theoretical line loss rate is about 3%. By comparing the actual line loss with the theoretical line loss, a line loss correction model is established. The model can dynamically adjust the line loss coefficient to improve the accuracy of transmission loss calculation.
[0074] On the electricity consumption side, the operating parameters of the electrical equipment are collected, including rated power, power factor and load rate. For example, the main electrical equipment of a factory includes motors, electric furnaces, etc., and their operating time, actual power and other data are collected separately. Based on these parameters, a time-divided electricity load model is established. This model can reflect the time distribution characteristics of the electricity load and provide a basis for the calculation of green power consumption.
[0075] Next, a power balance model for time windows is constructed. The model uses hours as the basic time unit, takes into account weather factors, equipment efficiency factors, and load fluctuation factors, and calculates the total green power generation in each time window. For example, in the period of 14:00-15:00, a wind farm actually generates 50MWh of power, taking into account wind speed changes and equipment efficiency. The actual line loss in the metering section is subtracted from the total power generation to obtain the effective amount of power that can be consumed. Combined with the time-based power load model, the amount of green power actually consumed by the power unit is calculated.
[0076] Based on the above calculation results, a green power accounting report is generated. The report contains detailed information such as power generation, transmission loss, consumption, calculation parameters and correction factors. In order to ensure the authenticity and credibility of the data, a multi-party signature mechanism is adopted. The power generation enterprise signs and confirms the power generation data in the report, the power grid company signs and confirms the transmission loss data, and the power user signs and confirms the consumption data.
[0077] Finally, the green power accounting report and signature information are submitted to the blockchain network. The blockchain network verifies the report to ensure data integrity and immutability. After verification, the accounting report is permanently stored on the blockchain, making the entire process of green power accounting traceable.
[0078] The beneficial effects of the present invention are mainly reflected in the following three aspects: 1. Improved accuracy of green power accounting: By establishing a comprehensive power balance model that includes power generation, transmission loss and power consumption, combined with real-time data collection and dynamic correction mechanism, the accuracy of green power accounting has been greatly improved.
[0079] 2. Enhanced transparency and credibility of the accounting process: The use of multi-party signature mechanism and blockchain evidence storage technology ensures the authenticity and non-tamperability of accounting data, effectively preventing data falsification and false reporting.
[0080] 3. The entire process of green electricity accounting is traceable: the accounting report is permanently stored on the blockchain, which is convenient for relevant parties to query and verify at any time, providing reliable data support for green electricity trading and carbon emission reduction accounting.
[0081] In an optional implementation, a power balance model for time windows is constructed, wherein the power balance model for time windows calculates the total green power generation in each time window based on weather influence factors, equipment efficiency factors, and load fluctuation factors, and subtracts the actual line loss of the metering section to obtain the effective power available for consumption. The calculation of the green power actually consumed by the power unit in combination with the time-divided power load model includes: Divide 24 hours into multiple time windows with overlapping intervals, and the overlapping intervals are used for data smoothing; collect wind speed, wind direction, temperature, light intensity, and cloud cover data from meteorological stations, establish a mapping relationship between wind speed and power generation efficiency to obtain weather impact factors, establish equipment efficiency factors based on generator set conversion efficiency, inverter efficiency, and transformer loss parameters, and establish load fluctuation factors by analyzing the time series characteristics of historical load data; The rated power of the power generation unit is multiplied by the operating time to obtain the benchmark power generation, and the benchmark power generation is multiplied by the weather impact factor and the equipment efficiency factor to obtain the actual total green power generation within the time window; data from the electric energy metering devices at the head and end of the metering section of the transmission network are collected to calculate the actual loss, and the influence of weather conditions on line impedance is considered, and the metering section losses are accumulated to obtain the total transmission loss; The power-consuming equipment is divided into basic load, fluctuating load and temporary load according to the power consumption characteristics to establish a classification model, and the actual power demand within the time window is calculated in combination with the load fluctuation factor; the effective power available for consumption is obtained by deducting the total transmission loss from the actual total green power generation, and the amount of green power actually consumed by each power-consuming unit is calculated based on the power consumption priority and load distribution according to the effective power available for consumption; The collected data is checked for numerical range, rate of change, and correlation. When abnormal data is detected, historical data interpolation or adjacent measuring point data estimation method is used to correct the data. The deviation between the calculated results and the measured data is compared to adjust the model parameters and weight coefficients. When the difference between supply and demand exceeds the preset threshold, the demand response mechanism is triggered to achieve power balance.
[0082] In order to realize the power balance model of time windows, 24 hours is first divided into multiple overlapping time windows, for example, every 4 hours is a window, and adjacent windows overlap for 1 hour. This division method can achieve smooth transition of data and avoid data jumps at the junction of time windows.
[0083] Next, collect real-time data from meteorological stations, including wind speed, wind direction, temperature, light intensity, and cloud cover. Based on historical data analysis, establish a mapping relationship between wind speed and wind power generation efficiency. For example, divide the wind speed into five intervals, corresponding to 80%, 90%, 95%, 98%, and 100% power generation efficiency. Similarly, establish a mapping relationship between light intensity and photovoltaic power generation efficiency. These mapping relationships constitute weather influencing factors.
[0084] For the equipment efficiency factor, the technical parameters of various power generation equipment are collected, such as the power curve of wind turbines, the conversion efficiency of photovoltaic panels, the efficiency of inverters, etc. By comprehensively considering these parameters, the comprehensive efficiency of equipment under different working conditions can be obtained. For example, the power generation efficiency of a certain type of wind turbine at a wind speed of 12m / s is 95%, the inverter efficiency is 98%, and the transformer efficiency is 99%, then the comprehensive efficiency of the equipment is 92.2%.
[0085] By analyzing the time series characteristics of historical load data, the load fluctuation factor is established. For example, for industrial users, the load may be higher from 8:00 to 18:00 on weekdays and lower at other times; while commercial users may have higher loads from 10:00 to 22:00. Based on these characteristics, a 24-hour load curve can be established to predict the load level in each time period.
[0086] In each time window, the benchmark power generation of each power generation unit is first calculated. Taking a 100kW wind turbine as an example, its benchmark power generation is 400kWh in a 4-hour time window. Then multiply the benchmark power generation with the weather impact factor and the equipment efficiency factor to get the actual green power generation. Assuming that the average wind speed during this period is 10m / s, the corresponding weather impact factor is 0.95, and the equipment efficiency factor is 0.922, the actual power generation is 400 * 0.95 * 0.922 = 350.36kWh.
[0087] For the calculation of transmission loss, first collect the data of the electric energy metering devices at the beginning and end of the metering section of the transmission network. For example, for a 10km long 35kV transmission line, the electric energy meter reading at the beginning is 10000kWh, and the reading at the end is 9950kWh, then the actual loss is 50kWh. Considering the impact of weather conditions on line impedance, such as the increase in temperature will increase line impedance, a temperature correction factor can be introduced. Assuming that the current temperature is 30℃, the line impedance increases by 2% compared to the standard temperature of 20℃, then the corrected loss is 51kWh. Perform similar calculations and accumulate them for each metering section of the entire transmission network to obtain the total transmission loss.
[0088] In terms of electricity demand forecasting, first divide the electricity equipment into three categories: basic load (such as lighting, refrigeration, etc.), fluctuating load (such as production equipment) and temporary load (such as special activity electricity). A classification model is established for each type of load, and the actual electricity demand is predicted in combination with the load fluctuation factor. For example, the basic load of an industrial park during the period of 14:00-18:00 on weekdays is 200kW, the fluctuating load is 300-500kW, and the temporary load is 0-100kW. Combined with the load fluctuation factor (0.9 for this period), it can be predicted that the actual electricity demand for this period is (200 + 400 + 50) * 0.9 = 585kW.
[0089] The total transmission loss is deducted from the actual total green power generation to obtain the effective amount of electricity available for consumption. Then, the actual amount of green electricity consumed is calculated based on the power consumption priority and load distribution of each power consumption unit. For example, the effective amount of electricity available for consumption in a certain period is 1000kWh, and there are three power consumption units A, B, and C. The priority decreases in turn, and the estimated power consumption is 500kWh, 400kWh, and 300kWh respectively. Then, 500kWh of electricity for unit A is prioritized, and the remaining 500kWh is distributed to B and C in proportion, that is, B actually consumes 285.7kWh and C actually consumes 214.3kWh.
[0090] To ensure data quality, multiple checks are performed on the collected data. First, a numerical range check is performed, such as wind speed data should be between 0-50m / s. Second, a change rate check is performed, such as the wind speed change between two adjacent sampling points should not exceed 5m / s. Finally, a correlation check is performed, such as the wind speed and power generation should be positively correlated. When abnormal data is detected, it can be corrected by using historical data interpolation or adjacent measurement point data estimation methods. For example, the wind speed data at a certain measurement point at 15:00 is abnormal, and it can be replaced by the average of the wind speeds at 14:00 and 16:00.
[0091] By comparing the deviation between the calculated results and the measured data, the model parameters and weight coefficients are continuously adjusted. For example, if the predicted power generation continues to be lower than the actual value, the weight of the weather factor can be appropriately increased. When the difference between supply and demand exceeds the preset threshold (such as 10%), the demand response mechanism is triggered. This may include notifying large users to reduce peak loads and fill valleys, starting emergency power generation equipment, and other measures to achieve power balance.
[0092] The beneficial effects of this technical solution are mainly reflected in three aspects: First, by constructing a power balance model with time windows, the production and consumption of green power can be predicted and managed more accurately. The design of overlapping time windows effectively solves the problem of data discontinuity at the junction of time nodes and improves the continuity and accuracy of the model.
[0093] Secondly, the weather factor, equipment efficiency factor and load fluctuation factor are introduced to comprehensively consider various factors affecting power balance. This multi-factor comprehensive analysis method greatly improves the accuracy and reliability of power balance prediction.
[0094] Finally, through real-time data collection, multiple data verification and dynamic model adjustment, the power balance model has strong adaptability and robustness. At the same time, the introduction of demand response mechanism provides an effective response measure for the imbalance of power supply and demand, further improving the stability and reliability of the power grid.
[0095] Figure 2Schematic diagram of the structure of the green power data multi-source heterogeneous aggregation and tamper-proof accounting and authentication system according to the present invention. Figure 2 As shown, the system comprises: The first unit is used to obtain power production data from the metering and collection module of the green power production equipment, obtain green power trading data from the power trading database of the power trading center, and obtain power dispatching data from the dispatching data system of the power grid dispatching center, and format the power production data, the green power trading data and the power dispatching data according to a unified data structure standard to generate a standardized green power data set; The second unit is used to generate a unique digital signature for each data record in the standardized green power data set by using an elliptic curve cryptographic algorithm, form a data block with the digital signature and the corresponding data record, build a blockchain network based on distributed ledger technology, set multiple consensus nodes in the blockchain network, and the multiple consensus nodes verify the data block through a PBFT consensus mechanism, and add the data block to the blockchain after the verification is passed; The third unit is used to extract the standardized green power data set from the blockchain, use a deep learning model to perform data cleaning and anomaly detection on the standardized green power data set, establish a power balance model including power generation, transmission loss and power consumption, calculate the actual green power consumption according to the power balance model, generate a green power accounting report, digitally sign the green power accounting report and upload it to the blockchain network for evidence storage.
[0096] According to a third aspect of the embodiments of the present invention, An electronic device is provided, comprising: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the aforementioned method.
[0097] A fourth aspect of the embodiments of the present invention is: A computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the aforementioned method is implemented.
[0098] The present invention may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present invention.
[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for multi-source heterogeneous aggregation and tamper-proof accounting and authentication of green power data, characterized in that: include: Acquire power production data from the metering and collection module of green power production equipment, acquire green power trading data from the power trading database of the power trading center, and acquire power dispatching data from the dispatching data system of the power grid dispatching center, format the power production data, the green power trading data and the power dispatching data according to a unified data structure standard, and generate a standardized green power data set; Using elliptic curve cryptography to generate a unique digital signature for each data record in the standardized green power data set, the digital signature and the corresponding data record form a data block, a blockchain network is constructed based on distributed ledger technology, a plurality of consensus nodes are set in the blockchain network, the plurality of consensus nodes verify the data block through the PBFT consensus mechanism, and the data block is added to the blockchain after the verification is passed; The standardized green power data set is extracted from the blockchain, and a deep learning model is used to perform data cleaning and anomaly detection on the standardized green power data set, and a power balance model including power generation, transmission loss and power consumption is established, and the actual green power consumption is calculated according to the power balance model, and a green power accounting report is generated, and the green power accounting report is digitally signed and uploaded to the blockchain network for evidence storage.
2. The method according to claim 1, characterized in that Using an elliptic curve cryptographic algorithm to generate a unique digital signature for each data record in the standardized green power data set, and combining the digital signature and the corresponding data record into a data block includes: The SECP256K1 elliptic curve is selected as the basic cryptographic algorithm. The curve equation of the SECP256K1 elliptic curve is y²= x³ + 7. The SECP256K1 elliptic curve has a base point G. The order of the base point G is n. Unique private keys sk are configured for green power production equipment, power trading center and power grid dispatching center respectively. The SHA-256 hash value h is calculated for the standardized data record. A random integer k is generated on the SECP256K1 elliptic curve using a deterministic random number generation scheme, wherein the value range of the random integer k is 1 to n-1. The base point G is used to calculate the point R=kG, and the x-coordinate value rx of the point R is obtained. The signature value s is calculated according to the signature equation s = k⁻¹(h + rx·sk) mod n, and the x-coordinate value rx and the signature value s are combined into a digital signature. Maintain a separate nonce counter for each data source node, and increase the corresponding nonce counter by 1 each time a digital signature is generated, and use the value of the nonce counter as an input parameter of the deterministic random number generation scheme; construct the data record with the digital signature as a leaf node of the Merkle tree, and the data record includes a timestamp, a data source identifier, original data content, the digital signature, and an associated hash value of the preceding data; The data records are grouped and the digital signatures are calculated simultaneously in a multi-threaded manner. The nodes at each layer of the Merkle tree are constructed in parallel in a pipeline manner. When new data records are added, only the affected tree node paths are recalculated using an incremental update algorithm. The statistical information of the accumulated power production, transaction volume, and dispatch volume in the current time window is recorded in the block header, a bloom filter is constructed for data verification, and the constructed data block is submitted to the blockchain network.
3. The method according to claim 2, characterized in that The data records are grouped and the digital signatures are calculated simultaneously in a multi-threaded manner, and the nodes of each layer of the Merkle tree are constructed in parallel in a pipeline manner. When new data records are added, only the affected tree node paths are recalculated using an incremental update algorithm, including: Divide the data records into multiple data groups according to the time segment, each of the data groups contains the data records in the complete time segment, create a thread pool corresponding to the number of processor cores, each processing thread in the thread pool is responsible for signature calculation of one of the data groups, each processing thread maintains an independent cryptographic computing context, and the cryptographic computing context includes an independent random number generator and an independent counter; Construct a three-level processing pipeline, where the first-level processing pipeline converts the signed data record into a leaf node of a tree structure and calculates the node hash value, the second-level processing pipeline performs parallel calculations on the middle-layer nodes in a bottom-up manner, and the third-level processing pipeline generates a root node and performs block integrity verification. The processing results of the three-level processing pipeline are respectively used as input information of the next-level processing pipeline; Construct a path cache table to record the path information from the leaf node to the root node. When a new data record is received, determine the insertion position of the new data record based on the path cache table, insert the new data record into the tree structure and recalculate the node hash value on the path from the insertion position to the root node; monitor the processing capacity and queue backlog status of the three-stage processing pipeline, and dynamically adjust the data grouping division strategy and the thread allocation scheme of the thread pool according to the processing capacity and the queue backlog status.
4. The method according to claim 1, characterized in that: Building a blockchain network based on distributed ledger technology, setting multiple consensus nodes in the blockchain network, and verifying the data block through the PBFT consensus mechanism. After the verification, the data block is added to the blockchain, including: Deploy multiple consensus nodes in the blockchain network, configure node identifiers and digital certificates for the consensus nodes, the digital certificates contain node public key information, the consensus nodes establish a fully connected communication network through a point-to-point network protocol, and encrypt inter-node communication based on an asymmetric encryption algorithm; maintain an active node list, perform status detection on the consensus nodes, and remove faulty nodes from the active node list; The master node is determined according to the hash value size of the node identifier, and the master node is responsible for coordinating the consensus process. The data block submission node broadcasts the data block to the consensus node, and the consensus node verifies the block structure integrity of the data block; the master node sends a pre-prepared message containing a block summary, a view number, and a sequence number to other consensus nodes, and other consensus nodes verify the legitimacy of the view number, sequence number, and block summary of the pre-prepared message; The consensus nodes broadcast preparation messages to each other. Each consensus node confirms entering the preparation state after receiving more than a preset number of preparation messages. The consensus node broadcasts confirmation messages and submits the data block to the local ledger after receiving more than a preset number of confirmation messages. The key messages and node voting information in the consensus process are recorded to form a chain of evidence. When the failure of the master node is detected, the view switching protocol is triggered to select a new master node.
5. The method according to claim 1, characterized in that Establishing a power balance model including power generation, transmission loss and power consumption, calculating the actual amount of green power consumed according to the power balance model, generating a green power accounting report, digitally signing the green power accounting report and uploading it to the blockchain network for evidence storage, including: Collect real-time power generation data of wind farms and photovoltaic power stations, the real-time power generation data includes power generation unit output curve, power factor, power generation efficiency parameters, and establish a power generation side balance model based on the real-time power generation data; divide the transmission line into multiple metering sections, collect power data at the input and output ends of the metering sections, calculate theoretical line loss based on line impedance, conductor cross-sectional area, and transmission voltage parameters, and collect actual line loss data to establish a line loss correction model; collect operating parameters of power equipment, the operating parameters include rated power, power factor, and load rate, and establish a time-divided power load model; Constructing a power balance model for time windows, the power balance model for time windows calculates the total green power generation in each time window based on weather influence factors, equipment efficiency factors, and load fluctuation factors, deducts the actual line loss of the metering section to obtain the effective power available for consumption, and calculates the amount of green power actually consumed by the power consumption unit in combination with the time-divided power load model; A green power accounting report including power generation, transmission loss, consumption, calculation parameters and correction factors is generated. The power generation enterprise signs and confirms the power generation data in the green power accounting report. The power grid company signs and confirms the transmission loss data in the green power accounting report. The power user signs and confirms the consumption data in the green power accounting report. The green power accounting report and signature information are submitted to the blockchain network for verification and storage.
6. The method according to claim 5, characterized in that Constructing a power balance model for time windows, the power balance model for time windows calculates the total green power generation in each time window based on weather influence factors, equipment efficiency factors, and load fluctuation factors, deducting the actual line loss of the metering section to obtain the effective power available for consumption, and combining the time-divided power load model to calculate the actual green power consumed by the power unit, including: Divide 24 hours into multiple time windows with overlapping intervals, and the overlapping intervals are used for data smoothing; collect wind speed, wind direction, temperature, light intensity, and cloud cover data from meteorological stations, establish a mapping relationship between wind speed and power generation efficiency to obtain weather impact factors, establish equipment efficiency factors based on generator set conversion efficiency, inverter efficiency, and transformer loss parameters, and establish load fluctuation factors by analyzing the time series characteristics of historical load data; The rated power of the power generation unit is multiplied by the operating time to obtain the benchmark power generation, and the benchmark power generation is multiplied by the weather impact factor and the equipment efficiency factor to obtain the actual total green power generation within the time window; data from the electric energy metering devices at the head and end of the metering section of the transmission network are collected to calculate the actual loss, and the influence of weather conditions on line impedance is considered, and the metering section losses are accumulated to obtain the total transmission loss; The power-consuming equipment is divided into basic load, fluctuating load and temporary load according to the power consumption characteristics to establish a classification model, and the actual power demand within the time window is calculated in combination with the load fluctuation factor; the effective power available for consumption is obtained by deducting the total transmission loss from the actual total green power generation, and the amount of green power actually consumed by each power-consuming unit is calculated based on the power consumption priority and load distribution according to the effective power available for consumption; The collected data is checked for numerical range, rate of change, and correlation. When abnormal data is detected, historical data interpolation or adjacent measuring point data estimation method is used to correct the data. The deviation between the calculated results and the measured data is compared to adjust the model parameters and weight coefficients. When the difference between supply and demand exceeds the preset threshold, the demand response mechanism is triggered to achieve power balance.
7. A green power data multi-source heterogeneous aggregation and tamper-proof accounting and authentication system, used to implement the method described in any one of claims 1 to 6, characterized in that: include: The first unit is used to obtain power production data from the metering and collection module of the green power production equipment, obtain green power trading data from the power trading database of the power trading center, and obtain power dispatching data from the dispatching data system of the power grid dispatching center, and format the power production data, the green power trading data and the power dispatching data according to a unified data structure standard to generate a standardized green power data set; The second unit is used to generate a unique digital signature for each data record in the standardized green power data set by using an elliptic curve cryptographic algorithm, form a data block with the digital signature and the corresponding data record, build a blockchain network based on distributed ledger technology, set multiple consensus nodes in the blockchain network, and the multiple consensus nodes verify the data block through a PBFT consensus mechanism, and add the data block to the blockchain after the verification is passed; The third unit is used to extract the standardized green power data set from the blockchain, use a deep learning model to perform data cleaning and anomaly detection on the standardized green power data set, establish a power balance model including power generation, transmission loss and power consumption, calculate the actual green power consumption according to the power balance model, generate a green power accounting report, digitally sign the green power accounting report and upload it to the blockchain network for evidence storage.
8. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.