Blockchain-based power sale transaction data traceability method and system

By collecting and fusing multi-source data and optimizing blockchain processing using deep learning and adaptive consensus algorithms, the problem of unreasonable allocation of green electricity trading data resources has been solved, achieving efficient and reliable traceability and data verification.

CN121304199BActive Publication Date: 2026-03-24BEIJING LUOHE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-29
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing technologies, when processing green electricity trading data, suffer from fixed consensus mechanisms that lead to unreasonable resource allocation, low efficiency in processing high-concurrency real-time trading records and low-frequency historical data, and a lack of data authenticity assessment, which increases the complexity of traceability and verification.

Method used

The system collects electricity sales transaction data and power grid operation data from multiple sources, generates environmental feature fingerprints and aligns them with timestamps, uses a deep learning model to bind trust labels, and combines adaptive consensus algorithms and lightweight encryption algorithms to dynamically adjust the blockchain consensus strategy, and differentiates between hot and cold data for differentiated processing.

Benefits of technology

It enables efficient and reliable traceability of green electricity trading data, improves data quality and the credibility of traceability results, optimizes blockchain resource allocation, and ensures the immutability and transparent verification of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121304199B_ABST
    Figure CN121304199B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of blockchains, and provides a blockchain-based electricity sale transaction data tracing method and system, which are used to solve the problems of low credibility and poor auditing efficiency of green electricity transaction data tracing in the prior art. The method comprises the following steps: firstly, collecting power market transaction data, power grid operation data and new energy environment state data; generating feature fingerprints based on the environment data, and aligning and fusing the transaction and power grid data in time sequence; analyzing the time sequence data by using a deep learning model and generating a credibility label, which is bound with the environment fingerprint to form a comprehensive data package; adopting a self-adaptive consensus algorithm to dynamically determine a blockchain consensus strategy according to the data package access frequency and perform packaging processing; finally, generating data fingerprints by using a lightweight encryption algorithm and storing the data fingerprints in the blockchain to realize the verifiable tracing of the electricity transaction data. The application improves the credibility and auditing efficiency of green electricity transaction data tracing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of blockchain technology, and in particular to a blockchain-based method and system for tracing electricity sales transaction data. Background Technology

[0002] With the large-scale integration of distributed renewable energy into the electricity market, green electricity trading is becoming increasingly frequent. This type of trading data is characterized by diverse sources, varying frequencies, and close coupling with the physical environment. Market participants urgently need a technological means to ensure the authenticity and reliability of trading records and to efficiently verify the source of electricity, thereby guaranteeing the reliability of green electricity consumption certificates and meeting regulatory requirements and market transparency needs.

[0003] Currently, one targeted solution is to use a fixed consensus mechanism to uniformly store all electricity transaction data on the blockchain. This solution first aggregates various transaction information, then uses a standard hash algorithm to generate data digests, and finally stores the data records through a pre-defined blockchain node network. The data stored on the blockchain is considered immutable and can be queried and verified by authorized parties.

[0004] When dealing with massive amounts of electricity trading data with diverse characteristics, this scheme's fixed data processing and consensus model lacks flexibility. Using the same processing flow for high-concurrency real-time transaction records and low-frequency historical archive data leads to inefficient allocation of system resources, potentially affecting the timeliness of processing high-value data. Furthermore, the scheme lacks a pre-assessment of the data's reliability, placing evidence storage and authenticity verification entirely behind the blockchain, increasing the complexity of traceability and verification. Summary of the Invention

[0005] This application provides a blockchain-based method and system for tracing electricity sales transaction data, which addresses the problems of low credibility and poor auditing efficiency in the existing technology for tracing green electricity transaction data.

[0006] To address the aforementioned technical problems, firstly, this application provides a blockchain-based method for tracing electricity sales transaction data, comprising:

[0007] Collect electricity sales transaction data from multiple sources, power grid operation data, and physical environment status data related to new energy power generation. The multiple sources include the wholesale electricity market and the retail electricity market.

[0008] Based on the physical environment status data, an environmental feature fingerprint is generated, and the electricity sales transaction data and the power grid operation data are aligned and merged according to the timestamp to form a time series data set with a unified time reference.

[0009] Real-time analysis is performed on the time series data set by using a deep learning anomaly detection model to generate a data credibility label, the environment feature fingerprint and the data credibility label are bound to form a comprehensive data package to be stored as evidence;

[0010] An adaptive consensus algorithm is used to dynamically determine a consensus strategy of a blockchain according to an access frequency of the comprehensive data package to be stored as evidence, and the comprehensive data package to be stored as evidence is packaged into blocks based on the consensus strategy;

[0011] A lightweight encryption algorithm is used to perform a hash operation on the packaged comprehensive data package to generate a unique data fingerprint, and the unique data fingerprint and the comprehensive data package to be stored as evidence are stored on the blockchain, and the blockchain is used for verifiable traceability of the electricity trading data.

[0012] Optionally, the adaptive consensus algorithm is used to dynamically determine a consensus strategy of a blockchain according to an access frequency of the comprehensive data package to be stored as evidence, and the comprehensive data package to be stored as evidence is packaged into blocks based on the consensus strategy, including:

[0013] Real-time access requests for the comprehensive data package to be stored as evidence are obtained;

[0014] Based on the real-time access requests, an access frequency of the comprehensive data package to be stored as evidence within a sliding time window is calculated;

[0015] Based on the access frequency and the comprehensive data package to be stored as evidence, a consensus strategy parameter is generated in combination with a reinforcement learning agent;

[0016] Based on the consensus strategy parameter, the comprehensive data package to be stored as evidence is split into a hot data package and a cold data package;

[0017] A first type of consensus strategy is selected for the hot data package, and a second type of consensus strategy is selected for the cold data package;

[0018] Based on the first type of consensus strategy and the second type of consensus strategy, the hot data package and the cold data package are verified and packaged, and the packaged hot data package and the packaged cold data package are combined to obtain a packaged comprehensive data package.

[0019] Optionally, the consensus strategy parameter is generated in combination with a reinforcement learning agent based on the access frequency and the comprehensive data package to be stored as evidence, including:

[0020] Real-time state indicators of the blockchain are collected;

[0021] The state indicators, the access frequency, and a data size of the comprehensive data package to be stored as evidence are normalized to form a multi-dimensional state vector;

[0022] inputting the multi-dimensional state vector into the reinforcement learning agent, performing a nonlinear transformation on the multi-dimensional state vector through a policy network of the reinforcement learning agent, and generating a probability distribution based on the transformed multi-dimensional state vector;

[0023] adopting a random sampling strategy to select a target consensus parameter combination from the probability distribution, and taking the target consensus parameter combination as a consensus strategy parameter.

[0024] Optionally, the packaged comprehensive data packet is subjected to a hash operation using a lightweight encryption algorithm to generate a unique data fingerprint, including:

[0025] obtaining a binary data stream of the packaged comprehensive data packet;

[0026] preprocessing the binary data stream using an initialization vector defined in the lightweight encryption algorithm;

[0027] segmenting the preprocessed data stream into a plurality of data blocks of fixed length, wherein a data block at the end that does not meet the length is padded using a preset padding rule to make the data block at the end meet the fixed length;

[0028] performing a hash calculation on the first data block to obtain a corresponding initial hash value, and after obtaining the initial hash value, taking the first data block as a previous data block and taking the second data block as a current data block;

[0029] mixing the initial hash value of the previous data block with the binary data stream of the current data block, performing a hash calculation on the current data block based on the mixing result to obtain a corresponding initial hash value, and after obtaining the initial hash value, updating the current data block to the previous data block and updating the next data block of the current data block to the current data block, and iteratively performing the mixing, hash calculation, and updating operations until all data blocks are processed, and taking the initial hash value of the last data block as a target hash value;

[0030] performing compression and conversion operations on the target hash value to generate a unique data fingerprint.

[0031] Optionally, the unique data fingerprint and the comprehensive data packet to be stored on the blockchain are stored on the blockchain, and the verifiable traceability of the electricity sales transaction data is performed based on the blockchain, including:

[0032] binding the unique data fingerprint with the identity of the corresponding comprehensive data packet to be stored to generate an index entry in the form of a key-value pair;

[0033] collecting all index entries to construct an index mapping table, packaging the index mapping table to form a storage record;

[0034] submitting the evidence record to a blockchain, encapsulating into a new block after consensus of nodes in the blockchain, and connecting the new block to a main chain of the blockchain;

[0035] receiving a traceability request for target electricity sales transaction data on the main chain of the blockchain, and parsing the traceability request to obtain a target identity;

[0036] According to the target identity, the index mapping table is queried on the blockchain to locate the associated unique data fingerprint, and the unique data fingerprint is taken as a reference fingerprint;

[0037] Based on the same query condition, the current data is obtained, and based on the current data, a verification fingerprint is calculated;

[0038] The reference fingerprint is compared with the verification fingerprint to generate a traceability verification result.

[0039] Optionally, the real-time analysis of the time series data set by using the deep learning anomaly detection model generates a data credibility label, including:

[0040] The data of different dimensions in the time series data set is input into a deep learning anomaly detection model, and the influence weight of the data of different dimensions at a specific time point is calculated by using an attention mechanism through the hidden layer of the deep learning anomaly detection model. Based on the influence weight, the data of different dimensions is weighted and fused to obtain a fused feature sequence;

[0041] Based on the fused feature sequence, the context dependency relationship in the time dimension is identified through a long short-term memory network unit of the deep learning anomaly detection model, and based on the context dependency relationship, a dynamic mode feature reflecting the normal behavior rule of power transaction is constructed;

[0042] The dynamic mode feature is compared with a normal power transaction mode feature library in the deep learning anomaly detection model for similarity;

[0043] According to the similarity comparison result, a probability value belonging to a normal transaction mode is calculated by using a softmax function;

[0044] The probability value is quantified as a credibility score, and the credibility score is converted into a binary data credibility label according to a preset credibility threshold.

[0045] Optionally, the environment feature fingerprint is generated based on the physical environment state data, and the electricity sales transaction data and the power grid operation data are aligned and fused according to the time stamp to form a time series data set with a unified time reference, including:

[0046] combining data representing different physical quantities in the physical environment state data to form feature data corresponding to the environment state;

[0047] performing compressed representation processing on the feature data to generate an environment feature fingerprint;

[0048] establishing a unified time axis for the electricity sale transaction data and the power grid operation data, the time axis taking a preset minimum time interval as a reference unit;

[0049] aggregating data of the electricity sale transaction data and the power grid operation data within the same reference unit into a data unit;

[0050] arranging all the data units in chronological order to form a time series data set.

[0051] In a second aspect, the present application provides a blockchain-based electricity sale transaction data traceability system, comprising:

[0052] a collection module configured to collect electricity sale transaction data, power grid operation data, and physical environment state data associated with new energy power generation from a multi-source market, the multi-source market including a power wholesale market and a retail market;

[0053] a generation module configured to generate an environment feature fingerprint based on the physical environment state data, and align and fuse the electricity sale transaction data and the power grid operation data according to timestamps to form a time series data set with a unified time reference;

[0054] an analysis module configured to perform real-time analysis on the time series data set using a deep learning anomaly detection model to generate a data credibility label, bind the environment feature fingerprint and the data credibility label, and form a comprehensive data package to be stored as evidence;

[0055] a determination module configured to dynamically determine a consensus strategy of a blockchain based on an access frequency of the comprehensive data package to be stored as evidence using an adaptive consensus algorithm, and perform block packaging processing on the comprehensive data package to be stored as evidence based on the consensus strategy;

[0056] a calculation module configured to perform hash operation on the packaged comprehensive data package using a lightweight encryption algorithm to generate a unique data fingerprint, store the unique data fingerprint and the comprehensive data package to be stored as evidence on the blockchain, and perform verifiable traceability of the electricity sale transaction data based on the blockchain.

[0057] In a third aspect, the present application provides an electronic device, comprising:

[0058] a memory configured to store a computer program;

[0059] A processor is configured to implement the steps of the blockchain-based electricity sale transaction data traceability method according to the first aspect.

[0060] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and the computer program is configured to implement the steps of the blockchain-based electricity sale transaction data traceability method according to the first aspect when executed by a processor.

[0061] In the present application, a blockchain-based electricity sale transaction data traceability method is provided, which comprises the following steps: collecting electricity sale transaction data, power grid operation data and physical environment state data associated with new energy power generation from a multi-source market, wherein the multi-source market comprises a power wholesale market and a retail market; based on the physical environment state data, generating an environment feature fingerprint, and aligning and fusing the electricity sale transaction data and the power grid operation data according to timestamps to form a time series data set with a unified time reference; using a deep learning anomaly detection model to analyze the time series data set in real time to generate a data credibility label, binding the environment feature fingerprint and the data credibility label to form a comprehensive data package to be stored as evidence; using an adaptive consensus algorithm, dynamically determining a consensus strategy of a blockchain according to an access frequency of the comprehensive data package to be stored as evidence, and based on the consensus strategy, performing block packaging processing on the comprehensive data package to be stored as evidence; using a lightweight encryption algorithm, performing a hash operation on the packaged comprehensive data package to generate a unique data fingerprint, and storing the unique data fingerprint and the comprehensive data package to be stored as evidence on the blockchain, and performing verifiable traceability of the electricity sale transaction data based on the blockchain.

[0062] The technical scheme provided by the present application has the following beneficial effects:

[0063] The present application widens the coverage of data sources, provides a complete data basis for subsequent traceability analysis, establishes the association between power transactions and physical environments, improves the dimension and accuracy of traceability information, realizes intelligent evaluation of data quality, enhances the reliability of traceability results, enriches the information content of a single data package, creates conditions for subsequent differentiated processing, optimizes the allocation of blockchain resources, improves the processing efficiency of high-value data, reduces the computational overhead under the premise of ensuring security, ensures the economic efficiency of the storage process, and finally realizes the non-tamperability and transparent verification of transaction records, and guarantees the credibility of the traceability process.

[0064] Further, the present application further calculates the data package access frequency in real time, introduces a reinforcement learning agent to generate dynamic strategy parameters, and accordingly distinguishes hot data and cold data for different types of data packages, and finally completes differentiated packaging processing by matching different consensus strategies for different types of data packages.

[0065] And the process enables the blockchain system to intelligently perceive data value and real-time status, and to precisely allocate computing resources, thereby balancing data processing efficiency and system operation economy as a whole.

[0066] These aspects or other aspects of the present application will be more apparent in the following description of the embodiments. BRIEF DESCRIPTION OF DRAWINGS

[0067] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor under the premise of the drawings.

[0068] Figure 1 A flowchart of a blockchain-based electricity sale transaction data traceability method provided by an embodiment of the present application;

[0069] Figure 2 A specific implementation schematic diagram of a blockchain-based electricity sale transaction data traceability method provided by an embodiment of the present application;

[0070] Figure 3 A structural schematic diagram of a blockchain-based electricity sale transaction data traceability system provided by an embodiment of the present application. DETAILED DESCRIPTION

[0071] Currently, in the field of blockchain storage and traceability of green power transaction data, the existing scheme usually adopts a unified processing flow to deal with all transaction data. This "one-size-fits-all" mode exposes inherent limitations when facing a mixed scene of high-frequency real-time transactions and low-frequency historical data: system resources are difficult to flexibly allocate according to data value, and transaction records with high timeliness requirements may be delayed in chain due to queuing; at the same time, data lacks intelligent evaluation of its authenticity before being chained, making subsequent traceability verification completely dependent on post-chain checking, increasing the complexity and uncertainty of the overall process.

[0072] In view of the above limitations, the present application proposes a blockchain-based electricity sales transaction data traceability method. The core of this method is to introduce an intelligent evaluation link before data is chained, to pre-judge the credibility of the data, and to dynamically adjust the consensus mechanism of the blockchain according to the heat of data access. Specifically, the scheme fuses power transaction data and corresponding physical environment characteristics, and uses a deep learning model for anomaly analysis to assign a credibility label to the data. Then, according to the real-time access frequency of the data packet, it adaptively selects a fast or high-security blockchain consensus channel. This method realizes the transition from "uniform processing" to "on-demand optimization", ensuring the fast storage of high-value data, and improving the overall quality of traceable data through pre-intelligent screening, thereby ensuring traceability while improving system processing efficiency and resource utilization rationality.

[0073] To enable those skilled in the art to better understand the present application scheme, the present application will be further described in detail below in combination with the drawings and specific embodiments. Obviously, the described embodiments are only part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of the present application.

[0074] The core of the present application is to provide a blockchain-based electricity sales transaction data traceability method, and a specific implementation process of the method is shown in Figure 1 The method comprises:

[0075] Step 101: Collect electricity sales transaction data, power grid operation data, and physical environment state data associated with new energy power generation from multi-source markets, including power wholesale and retail markets.

[0076] In step 101, the electricity sales transaction data of the multi-source market refers to the records of buying and selling electricity collected from different power trading platforms. These data include the size of the transaction, the exact time of the transaction, the identity information of the buyer and seller, and the label identifying the type of power source such as green power certificate. Power grid operation data refers to technical parameters generated during stable operation of the power grid. These data include the voltage on the line and the frequency of the current. Physical environment state data refers to natural condition measurements directly related to the operating state of new energy power generation equipment such as photovoltaic panels or wind turbines. These data include the intensity of light and the size of wind speed.

[0077] In the embodiments of the present application, the three types of data are collected by sensors and data interfaces deployed in the electricity trading system, the grid dispatching center and the new energy power generation site. First, the transaction records are obtained from the database interfaces of the electricity wholesale market and the retail market, then the real-time operation parameters are read from the grid monitoring system, and the physical environment state readings are collected through the environmental sensors installed at the power generation site. Finally, these data from different sources are collected together to prepare for subsequent processing.

[0078] For example, in the electricity market of region A, the system obtains a transaction record of 50 megawatt-hours of electricity sold by photovoltaic power station B at noon from the wholesale market database, and a record of 10 megawatt-hours of green electricity purchased by user C from the retail market. At the same time, the system reads that the grid frequency in this region is 50.02 Hz and the voltage is 220 kV from the grid dispatching center, and collects the physical environment state data of 800 watts per square meter of light intensity and 2 meters per second of wind speed from the light intensity sensor and wind speed sensor at the site of power station B. All these data are successfully collected by the system.

[0079] Step 102: Based on the physical environment state data, generate an environment feature fingerprint, and align and fuse the electricity selling transaction data and the grid operation data according to the time stamp to form a time series data set with a unified time reference.

[0080] In step 102, the environment feature fingerprint represents a value or code that can succinctly represent the comprehensive state of the environment at that moment after being calculated from multiple physical environment state data. The time series data set represents a collection of data points arranged in chronological order, where each data point corresponds to a unified time label and contains a snapshot of multiple data at that moment.

[0081] In the embodiments of the present application, the collected physical environment state data is first combined and compressed through a specific calculation method such as principal component analysis to generate a simplified environment feature fingerprint. Then, the system establishes a unified time axis for the electricity selling transaction data and the grid operation data, taking the minimum time unit such as one minute as the reference, and pairs and combines the transaction data such as power and price with the grid data such as voltage and frequency within the same minute to form a data unit representing the comprehensive situation of that minute. Finally, all data units within a continuous time period are arranged in chronological order to form a time series data set.

[0082] For example, continuing the previous example, the system generates an environmental feature fingerprint from the two pieces of physical environmental state data collected at photovoltaic power plant B, i.e., the 800-watt-per-square-meter light intensity and the 2-meter-per-second wind speed, by performing a calculation to combine them. The system then creates a time axis with a minimum unit of 1 minute and integrates all of the transaction power data, price data, and grid frequency and voltage data that occurred during the 12:00 minute into a data unit. This operation is performed for each of the 10 minutes from 12:00 to 12:10, and the 10 data units are finally arranged in chronological order to form the required time-series data set. This set and the environmental feature fingerprint 725 are passed to the next step.

[0083] Step 103: Real-time analysis of the time-series data set using a deep learning anomaly detection model to generate a data credibility label, binding the environmental feature fingerprint and the data credibility label to form a comprehensive data package to be stored.

[0084] In step 103, the data credibility label represents a label output by a deep learning model after analyzing a set of data to indicate the degree to which the data is considered to be real and reliable, such as “credible” or “unreliable”.

[0085] In the embodiments of the present application, the time-series data set generated in the previous step is input into a pre-trained deep learning anomaly detection model. The model analyzes the temporal variation of the data and compares it with the learned normal power transaction pattern to calculate the probability that the data belongs to the normal pattern. Subsequently, the probability value is converted into a specific data credibility label. Finally, the newly generated data credibility label is attached to the time-series data set together with the environmental feature fingerprint generated in step 102 to form a comprehensive data package to be stored.

[0086] For example, continuing the previous example, the system inputs the time-series data set containing the transaction and grid data of power plant B from 12:00 to 12:10 into the deep learning model. The model calculates that the probability that the data pattern is normal is 0.92. The system quantifies this probability value as 92 points, and since it is higher than the pre-set threshold of 60 points, it assigns a “credible” data credibility label to it. Subsequently, the system binds the “credible” label to the environmental feature fingerprint 725 to the time-series data set to form a new comprehensive data package to be stored.

[0087] Step 104: Using an adaptive consensus algorithm, dynamically determining the consensus strategy of the blockchain based on the access frequency of the comprehensive data package to be stored, and performing block packaging processing on the comprehensive data package to be stored based on the consensus strategy.

[0088] In step 104, the access frequency refers to the number of times a data packet is queried or requested within a certain time period, reflecting the popularity or attention of the data. The consensus strategy refers to the rules followed by the nodes in the blockchain network to reach consensus on a batch of data, including how many nodes to participate, how many rounds of verification to conduct, etc.

[0089] In the embodiments of the present application, first, the number of times the comprehensive data packet to be stored is accessed within a certain time window is monitored, and the access frequency is calculated. Then, the access frequency and the current status of the blockchain network, such as the number of nodes, network delay, etc., are input into a reinforcement learning agent. The agent will decide a set of optimal consensus strategy parameters based on these information, such as the number of nodes recommended to participate in verification. Then, the system classifies the data packets into hot data packets that need to be processed quickly or cold data packets that need to be processed with high security according to these parameters, and assigns appropriate consensus channels to them. Finally, the nodes in the blockchain network verify the data packets according to the specified strategy and package them into blocks to be chained.

[0090] For example, continuing the previous example, the system monitors that the comprehensive data packet about power station B to be stored has been accessed 150 times in the last 10 minutes, and calculates that its access frequency is 15 times per minute. Combined with the current network status, the reinforcement learning agent judges that this is a high-frequency access, and outputs the consensus strategy parameters as a minimum of 8 nodes participating in verification. Therefore, the system marks this data packet as a hot data packet and assigns it to a fast consensus channel. The blockchain nodes complete verification and packaging according to this strategy.

[0091] Step 105: A lightweight encryption algorithm is used to perform a hash operation on the packaged comprehensive data packet to generate a unique data fingerprint. The unique data fingerprint and the comprehensive data packet to be stored are stored on the blockchain, and the verifiable traceability of the electricity trading data is performed based on the blockchain.

[0092] In step 105, the unique data fingerprint represents a fixed-length, unique string summary obtained by performing a cryptographic hash algorithm on the data packet. Any minor changes to the original data will cause the fingerprint to change greatly.

[0093] In the embodiments of the present application, first, a lightweight encryption algorithm is used to process the binary content of the packaged comprehensive data packet, including dividing it into blocks and iteratively performing hash calculation, to finally generate a fixed-length unique data fingerprint. Then, the fingerprint is bound with the identity of the data packet and submitted to the blockchain network. After node consensus, the fingerprint is permanently recorded on the blockchain. When traceability is needed, the system finds the stored fingerprint on the chain as a reference according to the query conditions, and recalculates the fingerprint of the current data for comparison, to verify whether the data has been tampered with since it was stored.

[0094] For example, continuing the previous example, the system performs a hash operation on the packaged data packet about power station B, generating a unique data fingerprint such as "a1b2c3d4e5". After binding this fingerprint with the data packet ID "TX001", it is stored on the chain. A week later, the user queries the transaction, and the system obtains "a1b2c3d4e5" as the reference fingerprint from the chain, and recalculates the transaction data fingerprint in the current database. If the calculation result is still "a1b2c3d4e5", it is determined that the data has not been tampered with, and the traceability verification is passed.

[0095] The method provides a richer traceability background for power transaction data by collecting data from multiple sources and fusing physical environment information. The use of deep learning for pre-intelligent evaluation improves the initial quality of the data on the chain. The adaptive consensus mechanism is used to allocate blockchain resources differently according to the heat of different data, optimizing the overall efficiency of the system. Finally, through the use of cryptographic fingerprints and blockchain storage, the data is ensured to be tamper-proof and verifiable. The entire process works together to ultimately achieve efficient, reliable, and transparent traceability of green power transaction data.

[0096] To further improve the efficiency and intelligence level of blockchain processing power transaction data, in some embodiments, step 104: the adaptive consensus algorithm is used to dynamically determine the consensus strategy of the blockchain according to the access frequency of the comprehensive data packet to be stored, and based on the consensus strategy, the comprehensive data packet to be stored is processed by block packaging, as shown in Figure 2 , which includes:

[0097] Step 201: Obtain the real-time access request of the comprehensive data packet to be stored.

[0098] In step 201, real-time access request refers to an operation instruction issued by a user or system application program at a certain time to view or call the content of a specific comprehensive data packet to be stored.

[0099] In the embodiments of the present application, the system continuously monitors and records all queries or calls to different comprehensive data packets to be stored, and generates a real-time access request record containing data packet identity information and a time point every time such an operation occurs.

[0100] Step 202: Calculate the access frequency of the comprehensive data packet to be stored within a sliding time window based on the real-time access request.

[0101] In the embodiments of the present application, the system maintains an access record queue for each comprehensive data package to be stored. When calculating the access frequency, the system counts the number of records in the queue within a fixed time window before the current time point, and divides this number by the window duration to obtain the average number of accesses per unit time, i.e. the access frequency. The specific implementation process is that the system maintains an access record queue for each comprehensive data package to be stored, which records all query or call requests for the data package in the recent period of time in chronological order. The sliding time window refers to a fixed duration time period that moves backward continuously, for example, a window of 10 minutes. When calculating the frequency, the system will check this queue in real time, count the total number of access requests recorded within 10 minutes before the current time point, and then divide this total number by the window duration of 10 minutes to obtain the result, which is the access frequency of the data package at the current time, with the unit being times per minute. In a specific example, assuming that the current time is 14:30:00, the system needs to calculate the access frequency of data package A, it checks the access record queue of data package A and finds that there are 150 access records within 10 minutes from 14:20:01 to 14:30:00, then the access frequency of data package A is 150 divided by 10 minutes, which is 15 times per minute.

[0102] Step 203: generating consensus strategy parameters based on the access frequency and the comprehensive data package to be stored, combined with a reinforcement learning agent.

[0103] In step 203, the consensus strategy parameters refer to a set of operation instruction values output by the reinforcement learning agent for specifically configuring the blockchain consensus process, such as the minimum number of nodes participating in consensus verification.

[0104] In the embodiments of the present application, the system combines the access frequency calculated in step 202, the size of the comprehensive data package to be stored, and the real-time state information of the current blockchain network such as the number of online nodes into a state vector. Input this state vector into a pre-trained reinforcement learning agent, the policy network inside the agent will analyze and decide based on the input information, and output a set of consensus strategy parameters most suitable for the current situation.

[0105] Step 204: splitting the comprehensive data package to be stored into hot data packages and cold data packages based on the consensus strategy parameters.

[0106] In step 204, the hot data package refers to the comprehensive data package to be stored that is determined to have a high access frequency and needs to be processed quickly in priority. The cold data package refers to the comprehensive data package to be stored that is determined to have a low access frequency and is suitable for high security but can be processed slowly.

[0107] In the embodiments of the present application, the system compares the consensus strategy parameter generated in step 203, such as the recommended minimum number of nodes, with the preset threshold value. If the parameter indicates that fewer nodes are required, the system classifies the corresponding comprehensive data package to be stored as a hot data package; if the parameter indicates that more nodes are required, it is classified as a cold data package.

[0108] Step 205: Select a first type of consensus strategy for the hot data package and a second type of consensus strategy for the cold data package.

[0109] In step 205, the first type of consensus strategy is a consensus rule designed for hot data packages, focusing on fast processing speed, characterized by requiring fewer nodes to participate in verification and simple verification rounds. The second type of consensus strategy is a consensus rule designed for cold data packages, focusing on security and reliability, characterized by requiring more nodes to participate in verification and a more rigorous verification process. The core difference between the first type of consensus strategy and the second type of consensus strategy lies in the different emphasis on processing speed and security (or fault tolerance). The first type of consensus strategy is a fast channel strategy designed for hot data packages, which prioritizes processing speed by reducing the number of nodes participating in consensus verification and simplifying the verification steps, for example, only a few core nodes in the network may be required to quickly reach an agreement to be packaged on the chain, but this sacrifices the degree of decentralization and attack resistance of the system to some extent. The second type of consensus strategy is a secure channel strategy designed for cold data packages, which focuses more on the security and tamper resistance of long-term data storage, so it requires more or even all nodes in the network to participate in a multi-round complex consensus verification process, which may slow down the processing speed, but greatly improves the security of the system and the credibility of the data. In short, the first type of strategy is "efficiency first", and the second type of strategy is "security first".

[0110] In the embodiments of the present application, according to the classification result of step 204, the system allocates the first type of consensus strategy to the data marked as a hot data package and sets a smaller number of required verification nodes and a shorter timeout time. At the same time, the second type of consensus strategy is allocated to the data marked as a cold data package, and a larger number of required verification nodes and a longer timeout time are set to ensure security.

[0111] Step 206: Based on the first type of consensus strategy and the second type of consensus strategy, verify and package the hot data package and the cold data package, combine the packaged hot data package and the packaged cold data package, and obtain the packaged comprehensive data package.

[0112] In step 206, verification and packaging refer to the process in which nodes in the blockchain network check the authenticity and integrity of the data package according to the specified consensus strategy, and encapsulate the data that passes the consensus into the blockchain data structure.

[0113] In the embodiments of the present application, after the nodes in the blockchain network receive the data packets and the corresponding consensus strategies, the hot data packets are respectively verified and packaged according to the first type of consensus strategy, and the cold data packets are verified and packaged according to the second type of consensus strategy. After the two types of data packets are packaged, they are combined into a complete block.

[0114] The following is a specific example:

[0115] After the foregoing embodiment, after the comprehensive data packet containing the 12:00-12:10 transaction and grid data of the photovoltaic power station B and being marked as trusted to be stored for evidence is formed, the system starts to perform adaptive consensus packaging processing. First, the system continuously monitors and obtains real-time access requests for the data packet, and records a total of 150 access requests in a 10-minute sliding time window from 12:05 to 12:15. Based on this, the access frequency is calculated, which is equal to the total number of access times divided by the window length, i.e. 150 divided by 10 minutes, resulting in an access frequency of 15 times per minute. Then the system normalizes the calculated access frequency 15 times per minute, the size of the data packet 5MB, and the current blockchain network state indicators including the length of the transaction queue to be processed 120, the average network broadcast delay 200 milliseconds, and the number of online verification nodes 25 to combine into a state vector. The normalization calculation is that each actual value is divided by its historical maximum value. Assuming that the historical maximum queue length is 1000, 120 divided by 1000 is 0.12, the historical maximum delay is 1000 milliseconds, 200 divided by 1000 is 0.2, the historical maximum number of nodes is 100, 25 divided by 100 is 0.25, the historical maximum access frequency is 100 times per minute, 15 divided by 100 is 0.15, and the historical maximum data volume is 100MB, 5 divided by 100 is 0.05. Finally, the state vector is obtained as [0.12, 0.2, 0.25, 0.15, 0.05]. The vector is input into the reinforcement learning agent, and the policy network inside the agent outputs the consensus strategy parameters as the recommended minimum number of nodes 8 and the maximum consensus waiting time 3 seconds. Based on these parameters, the system classifies the data packet as a hot data packet and selects the first type of consensus strategy, which requires at least 8 nodes to reach consensus within 3 seconds. The blockchain nodes verify and package the hot data packet according to this strategy. At the same time, the system adopts the second type of consensus strategy for another cold data packet with an access frequency of only 1 time per minute, requiring more nodes to participate in verification. Finally, the packaged hot data packet and the packaged cold data packet are combined into a complete packaged comprehensive data packet.

[0116] In the embodiments of the present application, the complete step scheme described above realizes the on-demand dynamic allocation of blockchain consensus resources by perceiving the data heat in real time and introducing intelligent decision-making, so that high-value hot data can be quickly processed, and low-frequency data enjoys higher security protection, thereby balancing the system processing efficiency and data storage reliability as a whole.

[0117] To further improve the accuracy and adaptability of consensus strategy parameter generation, in some embodiments, step 203: generating consensus strategy parameters based on the access frequency and the comprehensive data package to be stored, combined with a reinforcement learning agent, includes:

[0118] Step 301: Real-time collection of state indicators of the blockchain.

[0119] In step 301, the state indicators of the blockchain refer to a series of measurable numerical values reflecting the current operating conditions of the blockchain network, including the number of transactions waiting to be processed in the network, the average time delay of data propagation between network nodes, and the total number of currently online nodes that can participate in verification.

[0120] In the embodiments of the present application, the system obtains the current readings of the key state indicators such as the number of waiting transactions, network delay, and the number of online nodes by calling the application program interface of the blockchain node or directly listening to network communication.

[0121] Step 302: Normalizing the state indicators, the access frequency, and the data size of the comprehensive data package to be stored to form a multi-dimensional state vector.

[0122] In step 302, the multi-dimensional state vector is a mathematical vector composed of a plurality of normalized values arranged in order, which in this step represent different state indicators, access frequencies, and data package sizes, for collectively describing the current overall state of the system.

[0123] In the embodiments of the present application, the system divides the original values of each state indicator collected in step 301, the access frequency value calculated in step 202, and the data size value of the comprehensive data package to be stored by the respective pre-set historical maximum value or reasonable upper limit value, scales all these values to the range of zero to one, and then combines these scaled values in a predetermined order to form a multi-dimensional state vector.

[0124] Step 303: Inputting the multi-dimensional state vector into the reinforcement learning agent, performing nonlinear transformation on the multi-dimensional state vector through the policy network of the reinforcement learning agent, and generating a probability distribution based on the transformed multi-dimensional state vector.

[0125] In step 303, the probability distribution refers to a set of likelihood values output by the policy network of the reinforcement learning agent, which clearly indicates the probability size of selecting each possible consensus parameter combination under the given current system state.

[0126] In the embodiments of the present application, the system inputs the multi-dimensional state vector obtained in step 302 into the policy network of the reinforcement learning agent. The policy network is composed of a plurality of interconnected calculation layers, which performs a series of complex mathematical transformations, i.e. nonlinear transformations, on the input vector. Finally, at the output layer of the network, it calculates and outputs a corresponding probability value for each selectable consensus parameter combination, such as different combinations of node quantity and timeout time, and all these probability values constitute a complete probability distribution.

[0127] Step 304: selecting a target consensus parameter combination from the probability distribution by using a random sampling strategy, and taking the target consensus parameter combination as the consensus strategy parameter.

[0128] In step 304, the target consensus parameter combination refers to the specific consensus parameter combination finally selected from the probability distribution by the random sampling strategy, which will serve as the consensus strategy parameter guiding the subsequent blockchain packaging operation.

[0129] In the embodiments of the present application, the system uses the random sampling method according to the probability distribution generated in step 303, i.e. randomly selects a group of consensus parameter combinations according to the probability size of each option being selected. Once selected, the target consensus parameter combination is formally determined as the consensus strategy parameter and output for use in subsequent steps.

[0130] The following is a specific example:

[0131] After obtaining the state vector [0.12, 0.2, 0.25, 0.15, 0.05], the system inputs it into the reinforcement learning agent, and the policy network of the agent first performs nonlinear transformation on the input vector, and the first layer calculation can be represented as wherein represents the output vector of the first layer hidden unit, represents the weight matrix of the first layer, represents the input state vector [0.12, 0.2, 0.25, 0.15, 0.05], represents the bias vector of the first layer, represents the activation function, which uses the ReLU function here, and after a series of similar calculations, the probability distribution for different consensus parameter options is generated at the output layer. Assuming that the Softmax function is used at the output layer, the probability of the first option is wherein represents the first The probability that each parameter option is selected. Represents the output layer The input value of each node, This represents the total number of parameter options, and e is the natural constant. Represents all options Summation and normalization are performed. Assume the final output probability distribution of the policy network with respect to the number of nodes is the probability of option 5 nodes. =0.1, probability of 8 nodes in the option =0.65, probability of 10 nodes in the option =0.25, the probability distribution for the timeout parameter is the probability of option 2 seconds. =0.2, probability of option 3 seconds =0.7, probability of option 5 seconds =0.1, and then the system uses a random sampling strategy to generate a random number between 0 and 1. Regarding the number of nodes parameter, since 0.6 falls within the cumulative probability range... =0.1 and + =0.75, i.e., 0.1 < 0.6 ≤ 0.75, therefore the 8-node option is selected. Similarly, for the timeout parameter, random number... =0.15 falls on =0.2, i.e. 0.15≤0.2, so the 2-second option is selected. Finally, the target consensus parameter combination, i.e. the number of nodes (8) and the timeout time (2 seconds), is output as the consensus strategy parameters.

[0132] In this embodiment, the above complete steps combine real-time network status with data characteristics and use an intelligent learning model for probabilistic decision-making, enabling the generated consensus strategy parameters to more accurately match the current system status, thereby improving the intelligence level and decision rationality of blockchain resource allocation.

[0133] To securely and efficiently generate unalterable data identities, in some embodiments, step 105: employing a lightweight encryption algorithm to perform a hash operation on the packaged comprehensive data packet to generate a unique data fingerprint, includes:

[0134] Step 401: Obtain the binary data stream of the packaged integrated data packet.

[0135] In step 401, the physical meaning of the "binary data stream" is that the "packaged integrated data packet" is represented and processed in the computer as a continuous binary sequence of 0 and 1 in the form of raw data. Its association with the "packaged integrated data packet" is that the "packaged integrated data packet" is a logical and user understandable data unit, while the "binary data stream" is the actual physical form of the data unit in the underlying computing and storage medium; it can be understood that the "packaged integrated data packet" is the content itself, and the "binary data stream" is the physical byte sequence that carries the content and can be directly operated by the computer, and all subsequent encryption and hash operation operations are directly performed at the physical level of the "binary data stream".

[0136] In the embodiment of the present application, the system reads the storage content of the packaged integrated data packet, and converts all byte information from the beginning to the end into a complete sequence composed of zeros and ones, that is, a binary data stream.

[0137] Step 402: Preprocessing the binary data stream using the initialization vector defined in the lightweight encryption algorithm.

[0138] In step 402, the initialization vector is a piece of random data predefined in the lightweight encryption algorithm, which is used to mix with the original data before the hash operation starts to increase the randomness and security of the operation result.

[0139] In the embodiment of the present application, the system calls the encryption algorithm library to obtain the preset initialization vector. Then the initialization vector and the starting part of the binary data stream obtained in step 401 are subjected to a mathematical operation called XOR, to complete the preprocessing of the data stream, so that the input of the subsequent hash calculation is more random.

[0140] Step 403: The preprocessed data stream is divided into multiple data blocks with fixed length, wherein the data block at the end not meeting the length is filled according to a preset filling rule to make the data block at the end not meeting the length reach the fixed length.

[0141] In step 403, the data block with fixed length refers to a piece of data obtained by cutting the preprocessed continuous data stream into fixed size fragments. The filling rule refers to an operation method of adding specific format data to the end of the last piece of data when the length of the last piece of data is insufficient to make it reach the predetermined length.

[0142] In the embodiments of the present application, the system cuts the preprocessed data stream into multiple segments of the same length from the beginning. If the remaining data is not enough to form a complete data block after cutting, a specific value byte is added at the end according to a preset rule, so that the length is consistent with other data blocks.

[0143] Step 404: Hash calculation is performed on the first data block to obtain a corresponding initial hash value. After obtaining the initial hash value, the first data block is regarded as a previous data block, and the second data block is regarded as a current data block.

[0144] In step 404, the initial hash value refers to a fixed-length digest value representing the content of the data block obtained by performing hash function calculation on a single data block.

[0145] In the embodiments of the present application, the system performs calculation on the first data block obtained in step 403 by applying a selected lightweight hash function, and outputs a fixed-length string, that is, an initial hash value. Subsequently, the system marks the first data block as a previous data block and marks the second data block as a current data block, so as to prepare for the next iteration calculation.

[0146] Step 405: The initial hash value of the previous data block is mixed with the binary data stream of the current data block, and hash calculation is performed on the current data block based on the mixing result to obtain a corresponding initial hash value. After obtaining the initial hash value, the current data block is updated as a previous data block, and the next data block of the current data block is updated as a current data block. The mixing, hash calculation, and updating operations are iteratively performed until all data blocks are processed, and the initial hash value of the last data block is taken as a target hash value.

[0147] In step 405, the target hash value refers to a unique fixed-length digest value representing the content of the entire original data packet, which is finally obtained by performing iteration hash calculation on all data blocks.

[0148] In the embodiments of the present application, the system splices the initial hash value corresponding to the previous data block obtained in step 404 with the original binary data of the current data block to form a new and longer mixed data. Then, hash calculation is performed again on the mixed data to obtain a new initial hash value. Next, the system updates the marks, sets the current data block just processed as a new previous data block, and sets the next data block thereof as a new current data block. The mixing, hash calculation, and updating operations are repeatedly performed until all data blocks are processed. Finally, the initial hash value left is the target hash value.

[0149] Step 406: Perform compression and conversion operation on the target hash value to generate a unique data fingerprint.

[0150] In step 406, the unique data fingerprint refers to a final short and unique string that can be used to identify and verify data after further length compression and format conversion of the target hash value.

[0151] In the embodiments of the present application, the system performs a truncation operation on the target hash value obtained in step 405, for example, only taking the first half of the bytes, and then converts it into a more compact text representation, for example, Base64 encoding, and finally outputs this string as a unique data fingerprint.

[0152] The following is a specific example:

[0153] In the embodiments, the system performs a hash operation on the packaged comprehensive data packet of photovoltaic power station B to generate a unique data fingerprint, which is packaged and has a size of 5 megabytes. First, the system reads the data packet to obtain its complete binary data stream, which contains 5x1024x1024x8 equal to 41943040 binary bits. Then, the system uses the initialization vector defined by the lightweight encryption algorithm, which is a 16-byte long preset random number, to perform bitwise XOR operation with the start of the binary data stream to complete preprocessing. Then, the preprocessed data stream is divided into multiple data blocks with a fixed length of 512 bytes. Since the total size of the data packet is 5 megabytes, i.e. 5x1024x1024 equal to 5242880 bytes, divided by 512 bytes, it is 10240 integral data blocks, which is exactly divisible, so no padding is required. Then, the first data block is subjected to SHA-256 hash calculation to obtain an initial hash value H1 with a length of 32 bytes. Then, the 512 bytes of raw data of the second data block are spliced with the 544 bytes of mixed data to obtain the initial hash value H2 by performing SHA-256 calculation on the mixed data. This process is iterated, and the hash value of the first data block is calculated. The hash value of the first data block is calculated. The hash value of the first data block is calculated. The hash value of the first data block is calculated. The hash value of the first data block is calculated. The hash value of the first data block is calculated. The hash value of the first data block is calculated. The hash value of the first data block is calculated. The hash value of the first data block is calculated. The hash value of the first data block is calculated. The hash value of the first data block is calculated. ​The original 512-byte binary data stream of the data block, the splicing operation represents connecting the front and back two pieces of data together, processing in turn until the 10240th data block, obtaining the final target hash value H10240, and finally the system performs compression and conversion operations on the target hash value, intercepts the first 16 bytes of H10240 and converts it through Base64 encoding, and finally generates a 24-character long string such as a1b2c3d4e5f6g7h8i9j0k1l2 as a unique data fingerprint.

[0154] In the embodiments of the present application, the above complete step scheme enhances randomness by introducing an initialization vector, enhances calculation feasibility by using block iteration hashing, and compresses and converts the final result, thereby generating a short, unique and irreversible data identity on the premise of ensuring the security strength of cryptography, thereby laying a solid foundation for subsequent blockchain storage and credible traceability.

[0155] In order to ensure the reliability of data storage and the feasibility of traceability verification, in some embodiments, step 105: the unique data fingerprint and the comprehensive data package to be stored are stored on the blockchain, and the traceable source of the electricity sales transaction data is based on the blockchain, including:

[0156] Step 501: binding the unique data fingerprint and the identity of the corresponding comprehensive data package to be stored to generate an index entry in the form of a key-value pair.

[0157] In step 501, the identity is a unique code assigned to each independent transaction record when the electricity sales transaction data of the multi-source market is initially collected, such as a transaction serial number or a combination code containing time, subject, etc. Its meaning is to uniquely refer to this specific electricity sales transaction data package in the system, and its function is similar to a person's identity card, which aims to ensure accurate positioning of the target data in all subsequent binding, querying and traceability links, and to avoid confusion. The index entry in the form of a key-value pair is a data structure in which the key is the identity of the comprehensive data package to be stored, and the value is the corresponding unique data fingerprint. Through this structure, the corresponding fingerprint can be quickly found through the identity.

[0158] In the embodiments of the present application, the system reads the identity of the comprehensive data package to be stored, such as the transaction number, and associates it with the unique data fingerprint generated in step 105, creating an index entry with the identity as the key and the unique data fingerprint as the value.

[0159] Step 502: collect all index entries to construct an index mapping table, package the index mapping table to form a storage record.

[0160] In step 502, the record storage record refers to a data unit prepared to be submitted to the blockchain, the core content of which contains an index mapping table composed of a plurality of index entries, which is used to establish a global mapping relationship between the identity and the data fingerprint.

[0161] In the embodiment of the present application, the system collects all the index entries generated for different data packets in step 501 together to construct a complete index mapping table. Then the index mapping table is formatted, packaged and packaged to form the final record storage record ready for chaining.

[0162] Step 503: submit the record storage record to the blockchain, and after the nodes in the blockchain reach a consensus, encapsulate it into a new block, and connect the new block to the main chain of the blockchain.

[0163] In step 503, the new block refers to a data unit in the blockchain data structure that has just passed the consensus verification of the network nodes, contains the record (in this scheme, it refers to the "record storage record") currently needing to be stored, and is about to be added to the chain. This data unit not only contains the record storage record itself, but also contains connection information such as timestamp, cryptographic hash value pointing to the previous block; its meaning can be understood as the latest page of a continuously written account that has been collectively recognized and stamped, once successfully added to the "main chain", the page record is considered tamper-proof.

[0164] In the embodiment of the present application, the system broadcasts the record storage record packaged in step 502 to the blockchain network. The nodes in the network verify and reach an agreement on the record according to the established consensus mechanism, encapsulate it with other transaction data into a new data block, and link the new data block to the end of the main chain of the blockchain, completing the record storage.

[0165] Step 504: receive the traceability request for the target electricity sale transaction data on the main chain of the blockchain, and parse the traceability request to obtain the target identity.

[0166] In step 504, the target electricity sale transaction data refers to a specific transaction record that needs to be traced, which is one or a group of data specified from the initial collection of multi-source market electricity sale transaction data. The multi-source market electricity sale transaction data is the original set containing all transaction records, and the specific electricity sale transaction data is a subset of the set that is targeted. The target identity refers to the identity information specified by the user in the traceability request to uniquely determine the to-be-verified electricity sale transaction data packet when performing traceability query.

[0167] In the embodiments of the present application, the system receives a user-submitted traceability request, parses the message content of the request, and extracts the specific transaction number or other unique identifier contained therein, which is the target identity.

[0168] Step 505: According to the target identity, the index mapping table is queried on the blockchain to locate the associated unique data fingerprint, and the unique data fingerprint is taken as the reference fingerprint.

[0169] In step 505, the reference fingerprint refers to the original data fingerprint that is previously stored on the blockchain and recognized as trustworthy, which will serve as the reference for comparison and verification.

[0170] In the embodiments of the present application, the system finds the index mapping table in the stored records on the blockchain according to the target identity obtained in step 504. By traversing and querying the mapping table, the unique data fingerprint associated with the target identity is found and read out as the reference fingerprint.

[0171] Step 506: Based on the same query condition, the current data is obtained, and based on the current data, the verification fingerprint is calculated.

[0172] In step 506, the same query condition refers to the consistent data identification information used when the specific electricity sales transaction data was previously stored on the blockchain, such as the unique transaction serial number or transaction timestamp of the transaction. The current data in the current data refers to the latest data copy corresponding to the specific electricity sales transaction data obtained by querying the original data source (such as the transaction database or power grid data platform) again at the moment of traceability verification. The verification fingerprint refers to the data fingerprint calculated again using the same algorithm process as when the data was stored, based on the latest transaction data obtained from the current database in real time according to the user query request.

[0173] In the embodiments of the present application, the system uses the same target identity as in step 504 as the query condition to retrieve the corresponding electricity sales transaction data package from the current transaction database or data source. Then, strictly following the hash operation process described in step 105, the data package is recalculated to obtain a new data fingerprint, which is the verification fingerprint.

[0174] Step 507: Comparing the reference fingerprint with the verification fingerprint generates a traceability verification result.

[0175] In step 507, the traceability verification result refers to the conclusion about whether the data has been tampered with since being stored, obtained by comparing whether the reference fingerprint and the verification fingerprint are consistent.

[0176] In the embodiments of the present application, the system compares the reference fingerprint obtained in step 505 with the verification fingerprint calculated in step 506 bit by bit. If the two fingerprints are exactly the same, a verification result that the data has not been tampered with is generated; if there is any difference, a verification result that the data may have been tampered with is generated.

[0177] The following is a specific example:

[0178] After the system generates the unique data fingerprint a1b2c3d4e5 of the photovoltaic power station B data packet, it binds it with the identity TX001 of the data packet to generate an index entry in the form of a key-value pair, the key of which is TX001 and the value is a1b2c3d4e5. Subsequently, the system collects all index entries including this entry to construct a complete index mapping table, serializes and packages the index mapping table to form a record of storage, and submits the record of storage to the blockchain network. After the network node verifies it according to the consensus mechanism, it encapsulates it into a new block with a height of 10086, and links the new block to the main chain of the blockchain to complete the storage. After a week, user D initiates a traceability request for transaction TX001, and the system receives and parses the request to obtain the target identity TX001. According to TX001, the system queries each block in the blockchain from the current block to the front until it finds the index mapping table in the block with a height of 10086 and locates the associated unique data fingerprint a1b2c3d4e5 as the reference fingerprint. At the same time, the system uses the same target identity TX001 as a query condition to obtain the latest data packet of the transaction from the current transaction database, and uses the same lightweight encryption algorithm and hash operation process as when the record is stored to recalculate the verification fingerprint of the latest data packet. The calculation process is that the data packet size is 5 megabytes, i.e. 5242880 bytes, which is divided into 10240 data blocks of 512 bytes, and the final hash value is obtained by iterative hash calculation. If the hash value is also a1b2c3d4e5 after Base64 encoding, the verification fingerprint is equal to a1b2c3d4e5. The system compares the reference fingerprint a1b2c3d4e5 with the verification fingerprint a1b2c3d4e5 character by character, and since they are exactly the same, the traceability verification result is that the data is real and has not been tampered with.

[0179] In the embodiments of the present application, the above complete step scheme realizes accurate positioning of the data fingerprint by establishing an on-chain index relationship, and constructs a complete and reliable verifiable traceability closed loop through off-chain real-time calculation and on-chain stored fingerprint comparison, effectively guaranteeing the authenticity and integrity of the electricity trading data.

[0180] In order to intelligently evaluate the credibility of the electricity trading data, in some embodiments, step 103: the deep learning anomaly detection model is used to analyze the time series data set in real time to generate a data credibility label, which includes:

[0181] Step 601: input data of different dimensions in the time series data set into a deep learning anomaly detection model, calculate influence weight of data of different dimensions at a specific time point through a hidden layer of the deep learning anomaly detection model by using an attention mechanism, and perform weighted fusion on data of different dimensions based on the influence weight to obtain a fused feature sequence.

[0182] In step 601, the specific time point herein does not refer to a pre-selected fixed time point, but refers to each independent time point dynamically focused on in succession in the continuous process of model processing the time series data set. It can be understood that when the model analyzes time series data, it processes one time point after another, and for the time point currently being processed, it is the "specific time point" at this moment; for example, when the model processes data of 12:00, 12:01, 12:02…, when it processes data of 12:01, 12:01 is the "specific time point" at this moment, and the attention mechanism calculates the importance weight of each dimension of data at this time. Therefore, "specific" is relative and flowing, which refers to the current time point for which the model calculates the attention weight. The fused feature sequence refers to a new time series data sequence that can highlight key information after weighted combination of data of different dimensions in the time series data set according to the importance of the data at each time point.

[0183] In the embodiment of the present application, the system inputs data of different dimensions representing transaction power, price curve, power grid frequency, etc. in the time series data set into the model. The hidden layer of the model automatically calculates the importance proportion of each dimension data to the overall judgment at each specific time point, i.e. the influence weight, through the attention mechanism. Then, the system adds data of different dimensions in proportion according to these weights to fuse into a new and unified feature sequence.

[0184] Step 602: identify context dependency in the time dimension based on the fused feature sequence through a long short-term memory network unit of the deep learning anomaly detection model, and construct a dynamic mode feature reflecting normal behavior rules of power transaction based on the context dependency.

[0185] In step 602, the dynamic mode feature refers to a comprehensive feature representation capable of describing the normal rules of power transaction data changing with time, which is extracted from the context dependency learned by the long short-term memory network unit from the fused feature sequence.

[0186] In the embodiments of the present application, the system inputs the fusion feature sequence obtained in step 601 into a long short-term memory network unit of the model. The unit analyzes the sequence step by step in time sequence, learns the correlation between data at different time points, i.e., the context dependency relationship. Based on the learned correlation, the unit constructs a comprehensive feature representing the normal power transaction behavior mode, i.e., a dynamic mode feature.

[0187] Step 603: Perform similarity comparison between the dynamic mode feature and the normal power transaction mode feature library in the deep learning anomaly detection model.

[0188] In step 603, the similarity comparison refers to a process of calculating the closeness between the dynamic mode feature of the to-be-detected data and the plurality of normal power transaction mode features pre-stored in the model.

[0189] In the embodiments of the present application, the system calculates the cosine similarity between the dynamic mode feature obtained in step 602 and each normal mode feature in the normal power transaction mode feature library in the model. The closer the cosine similarity value is to 1, the more similar the mode of the to-be-detected data is to the normal mode.

[0190] Step 604: According to the similarity comparison result, calculate a probability value of belonging to the normal transaction mode by using a softmax function.

[0191] In step 604, the probability value refers to a numerical value representing the possibility of the to-be-detected data belonging to the normal transaction mode, which is converted from the similarity comparison result by using the softmax function, and ranges between 0 and 1.

[0192] In the embodiments of the present application, the system inputs the cosine similarity values between the to-be-detected data and the most similar normal modes calculated in step 603 into the softmax function for calculation. The function converts the higher similarity values into higher probability values, and finally outputs a probability value representing the possibility of the normal mode.

[0193] Step 605: Quantize the probability value into a credibility score, and convert the credibility score into a binary data credibility label according to a preset credibility threshold.

[0194] In the embodiments of the present application, the system multiplies the probability value obtained in step 604 by 100 to convert it into a credibility score between 0 and 100. Then, the score is compared with a preset credibility threshold, for example, 60 points. If the score is greater than or equal to the threshold, a “credible” label is generated; otherwise, an “uncredible” label is generated.

[0195] The following is a specific example:

[0196] The system inputs the time-series data set of photovoltaic power station B from 12:00 to 12:10 into the deep learning anomaly detection model. This set contains 10 time points, each with data in three dimensions: transaction volume, price, and grid frequency. The model first calculates the influence weights of each dimension at the specific time point of 12:05 using the attention mechanism of the hidden layer. The calculation process is called attention score. ,in Representing the Attention scores in each dimension The weight matrix represents the query vector. The weight matrix represents the key vector. This represents the original data value of the i-th dimension at 12:05. The dimension of the key vector is 1 here, assuming the calculated transaction volume dimension score is... Price dimension score Frequency dimension score The weights are then calculated using the Softmax function. ,in Representing the The weights of each dimension, where e is a natural constant, are calculated by substituting the values. Similarly , The original values ​​of the three dimensions at 12:05 are weighted and fused to obtain the fused features for that time point. This process is repeated for all 10 time points to obtain the fused feature sequence. This sequence is then input into a Long Short-Term Memory (LSTM) network unit, which processes the sequence step by step and learns contextual dependencies, ultimately constructing a dynamic pattern feature F. F is then compared with patterns N1 and N2 in the normal feature library using cosine similarity. The cosine similarity calculation formula is... Similarity represents the degree of similarity. This represents the dynamic pattern feature vector output by the Long Short-Term Memory network. This represents the normal pattern vector in the normal feature library. Representative vector and dot product, Representative vector The length of the mold, Representative vector The modulus length, assuming it is calculated and The similarity is 0.92, and... The similarity between the two values ​​is 0.85. The probability value is calculated by inputting these two similarity values ​​[0.92, 0.85] into the Softmax function. The probability value 0.52 is quantified as a confidence score of 52 points. Since 52 points is lower than the preset threshold of 60 points, the system generates a data confidence label for the time series data set as untrusted.

[0197] In the embodiments of the present application, the complete step scheme described above focuses on key data dimensions through attention mechanism, captures time regularity through long short-term memory network, and quantitatively evaluates through similarity comparison with normal mode library, finally realizes the automation and intelligentization of the power transaction data confidence determination, and provides an important quality basis for subsequent data notarization.

[0198] In order to effectively fuse multi-source data and provide regular input for subsequent analysis, in some embodiments, step 102: based on the physical environment state data, an environment feature fingerprint is generated, and the electricity sales transaction data and the power grid operation data are aligned and fused according to the time stamp to form a time series data set with a unified time reference, including:

[0199] Step 701: combining data representing different physical quantities in the physical environment state data to form feature data corresponding to the environment state.

[0200] In step 701, the feature data refers to a combination of data representing the comprehensive environment state at that moment, which is formed by collecting various types of measurement values such as light intensity and wind speed in the physical environment state data.

[0201] In the embodiments of the present application, the system reads the values of all physical environment state data collected at a certain moment, arranges these values in a predetermined order, and forms a feature data containing multiple environmental elements.

[0202] Step 702: performing compression expression processing on the feature data to generate an environment feature fingerprint.

[0203] In the embodiments of the present application, the system applies principal component analysis algorithm to the feature data obtained in step 701. This algorithm calculates and retains the main components that can best distinguish different environment states, and discards the secondary components, thereby compressing the original feature data into a lower-dimensional and more concise value, i.e. the environment feature fingerprint.

[0204] Step 703: establishing a unified time axis for the electricity sales transaction data and the power grid operation data, the time axis taking a preset minimum time interval as a reference unit.

[0205] In step 703, the reference unit refers to the minimum time interval used when establishing a unified time axis for the electricity sales transaction data and the power grid operation data. All data will be aligned according to this interval.

[0206] In the embodiments of the present application, the system sets a minimum time granularity, for example, one minute, as a reference unit. Then, a continuous time axis from the start time to the end time is established with this reference unit as the scale.

[0207] Step 704: The data of the electricity sale transaction data and the grid operation data in the same reference unit is aggregated into a data unit.

[0208] In step 704, the data unit refers to all data points in the electricity sale transaction data and the grid operation data occurring in the same reference unit time interval are collected together to form a data package representing the overall situation of the time interval.

[0209] In the embodiments of the present application, for each reference unit time interval, for example, from 12:00 to 12:01, the system retrieves and collects all the electricity sale transaction data records and grid operation data records with time stamps falling within this interval, and merges them into a data unit along the time axis established in step 703.

[0210] Step 705: All the data units are arranged in time sequence to form a time series data set.

[0211] In the embodiments of the present application, the system arranges all the data units generated in step 704 in an ordered list according to the sequence of the time intervals they correspond to, and this list is the final time series data set.

[0212] The following is a specific example:

[0213] Based on the physical environment state data of photovoltaic power station B collected at 12:00, the light intensity of 800 watts per square meter and the wind speed of 2 meters per second, the system combines the two data representing different physical quantities to form the feature data [800, 2], performs compression expression processing on the feature data to generate the environment feature fingerprint, and adopts the principal component analysis algorithm whose first principal component is calculated as wherein represents the generated environment feature fingerprint value, the weight coefficient of the light intensity data is assumed to be 0.9, the light intensity data value is 800 units of watts per square meter, the weight coefficient of the wind speed data is assumed to be 0.1, the wind speed data value is 2 units of meters per second, and the formula is calculated as = 0.9 * 800 + 0.1 * 2 = 720 + 0.2 = 720.2, and after rounding, the environmental feature fingerprint is 720. Meanwhile, the system establishes a unified time axis for the power transaction data and the power grid operation data. The time axis takes 1 minute as the preset minimum time interval, i.e., the reference unit. For the reference unit from 12:00 to 12:01, the system aggregates the transaction data, including 50 megawatt hours of wholesale market power sales, 10 megawatt hours of retail market power purchases, and the power grid operation data, i.e., frequency 50.02 Hz and voltage 220 kV, into one data unit. This operation is repeated for each 1-minute reference unit from 12:01 to 12:10, and a total of 10 data units are obtained. Finally, the 10 data units are arranged in strict chronological order from the 12:00 unit to the 12:10 unit to form a time series data set. The time series data set is output together with the environmental feature fingerprint 720 for subsequent analysis.

[0214] In the embodiments of the present application, the complete step scheme described above retains the key information of the physical environment through the generation of the environmental feature fingerprint, and ensures the consistency of the multi-source data in the time dimension through the time axis alignment fusion, thereby preparing the standardized data with clear structure and complete information for subsequent intelligent analysis and blockchain notarization.

[0215] Figure 3 The structural diagram of a power transaction data traceability system based on a blockchain provided in the embodiments of the present application is shown in FIG. 1. The specific implementation part describes the following:

[0216] The acquisition module 31 is configured to acquire power transaction data, power grid operation data, and physical environment state data associated with new energy power generation from a multi-source market, wherein the multi-source market includes a power wholesale market and a retail market.

[0217] The generation module 32 is configured to generate an environmental feature fingerprint based on the physical environment state data, and align and fuse the power transaction data and the power grid operation data according to time stamps to form a time series data set with a unified time reference.

[0218] The analysis module 33 is configured to perform real-time analysis on the time series data set by using a deep learning anomaly detection model, generate a data credibility label, bind the environmental feature fingerprint and the data credibility label, and form a comprehensive data package to be notarized.

[0219] The determination module 34 is configured to dynamically determine a consensus strategy of the blockchain according to an access frequency of the comprehensive data package to be notarized by using an adaptive consensus algorithm, and perform block packaging processing on the comprehensive data package to be notarized based on the consensus strategy.

[0220] The operation module 35 is configured to perform hash operation on the packaged integrated data packet by using a lightweight encryption algorithm to generate a unique data fingerprint, store the unique data fingerprint and the integrated data packet to be stored on the blockchain, and perform verifiable tracing of the electricity sale transaction data based on the blockchain.

[0221] The blockchain-based electricity sale transaction data tracing system according to the embodiments of the present application is used to implement the foregoing blockchain-based electricity sale transaction data tracing method, and therefore the specific embodiments of the blockchain-based electricity sale transaction data tracing system can refer to the foregoing embodiments of the blockchain-based electricity sale transaction data tracing method, and the specific embodiments can refer to the descriptions of the respective embodiments, which will not be repeated here.

[0222] The present application also provides an electronic device, which comprises a memory for storing a computer program and a processor for executing the computer program to implement the steps of the blockchain-based electricity sale transaction data tracing method.

[0223] The present application also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the blockchain-based electricity sale transaction data tracing method.

[0224] In an exemplary embodiment, the computer readable storage medium can include, but is not limited to, a U disk, a read-only memory, a random access memory, a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.

[0225] The embodiments of the present application also provide a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the steps of the blockchain-based electricity sale transaction data tracing method.

[0226] The skilled person can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be realized by electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in general terms in the foregoing description. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0227] The above describes in detail a blockchain-based electricity sale transaction data traceability method and system, an electronic device, and a storage medium provided by the present application. The principles and implementation modes of the present application are described by applying specific examples. The above description of the embodiments is only used to help understand the method of the present application and its core idea. It should be pointed out that, for those skilled in the art, without departing from the principles of the present application, the present application can be improved and modified in several ways, and these improvements and modifications also fall within the protection scope of the present application.

Claims

1. A blockchain-based method for tracing electricity sales transaction data, characterized in that, include: Collect electricity sales transaction data from multiple sources, power grid operation data, and physical environment status data related to new energy power generation. The multiple sources include the wholesale electricity market and the retail electricity market. Based on the physical environment status data, an environmental feature fingerprint is generated, and the electricity sales transaction data and the power grid operation data are aligned and merged according to the timestamp to form a time series data set with a unified time reference. The time-series data set is analyzed in real time using a deep learning anomaly detection model to generate data credibility tags. The environmental feature fingerprint and the data credibility tags are then bound together to form a comprehensive data package to be stored. An adaptive consensus algorithm is adopted to dynamically determine the consensus strategy of the blockchain based on the access frequency of the comprehensive data packet to be stored. Based on the consensus strategy, the comprehensive data packet to be stored is processed into blocks. A lightweight encryption algorithm is used to perform hash operation on the packaged comprehensive data packet to generate a unique data fingerprint. The unique data fingerprint and the comprehensive data packet to be stored are stored on the blockchain, and verifiable traceability of electricity sales transaction data is carried out based on the blockchain. The method employs an adaptive consensus algorithm to dynamically determine the blockchain consensus strategy based on the access frequency of the comprehensive data packet to be stored. Based on this consensus strategy, the comprehensive data packet to be stored is then processed into blocks, including: Obtain the real-time access request for the comprehensive data packet to be stored; Based on the real-time access request, calculate the access frequency of the comprehensive data packet to be stored within the sliding time window; Based on the access frequency and the comprehensive data packet to be stored, consensus policy parameters are generated in conjunction with the reinforcement learning agent. Based on the consensus strategy parameters, the comprehensive data packet to be stored is split into hot data packets and cold data packets; A first consensus strategy is selected for the hot data packet, and a second consensus strategy is selected for the cold data packet; Based on the first type of consensus strategy and the second type of consensus strategy, the hot data packets and the cold data packets are verified and packaged. The packaged hot data packets and the packaged cold data packets are combined to obtain a packaged comprehensive data packet.

2. The blockchain-based electricity sales transaction data traceability method according to claim 1, characterized in that, The consensus policy parameters are generated based on the access frequency and the comprehensive data packet to be stored, combined with the reinforcement learning agent, including: Real-time collection of blockchain status indicators; The status indicators, the access frequency, and the data size of the comprehensive data packet to be stored are normalized to form a multi-dimensional status vector. The multidimensional state vector is input into the reinforcement learning agent, and a nonlinear transformation is performed on the multidimensional state vector through the policy network of the reinforcement learning agent. Based on the transformed multidimensional state vector, a probability distribution is generated. A random sampling strategy is used to select a target consensus parameter combination from the probability distribution, and the target consensus parameter combination is used as the consensus strategy parameter.

3. The blockchain-based electricity sales transaction data traceability method according to claim 1, characterized in that, The process employs a lightweight encryption algorithm to perform a hash operation on the packaged data packet, generating a unique data fingerprint, including: Obtain the binary data stream of the packaged composite data packet; The binary data stream is preprocessed using the initialization vector defined in the lightweight encryption algorithm. The preprocessed data stream is divided into multiple data blocks of fixed length. Data blocks that do not meet the length requirement at the end are padded using a preset padding rule so that the data blocks that do not meet the length requirement at the end reach the fixed length. Perform a hash calculation on the first data block to obtain the corresponding initial hash value. After obtaining the initial hash value, use the first data block as the previous data block and the second data block as the current data block. The initial hash value of the previous data block is mixed with the binary data stream of the current data block. Based on the mixing result, the current data block is hashed to obtain the corresponding initial hash value. After obtaining the initial hash value, the current data block is updated to the previous data block, and the next data block of the current data block is updated to the current data block. The mixing, hash calculation, and update operations are performed iteratively until all data blocks are processed. The initial hash value of the last data block is used as the target hash value. The target hash value is compressed and transformed to generate a unique data fingerprint.

4. The blockchain-based electricity sales transaction data traceability method according to claim 1, characterized in that, The step of storing the unique data fingerprint and the comprehensive data packet to be stored on the blockchain, and performing verifiable traceability of electricity sales transaction data based on the blockchain, includes: The unique data fingerprint is bound to the identity identifier of the corresponding comprehensive data packet to be stored, and an index entry in the form of key-value pairs is generated. All index entries are collected, an index mapping table is constructed, and the index mapping table is packaged to form a record of evidence storage; The evidence record is submitted to the blockchain, and after consensus among the nodes in the blockchain, it is encapsulated into a new block and the new block is connected to the main chain of the blockchain. Receive a traceability request for the target electricity sales transaction data on the main chain of the blockchain, and parse the traceability request to obtain the target identity identifier; Based on the target identity identifier, the index mapping table is traversed and queried on the blockchain to locate the associated unique data fingerprint, and the unique data fingerprint is used as the base fingerprint; The current data is obtained based on the same query conditions, and the verification fingerprint is calculated based on the current data. The baseline fingerprint is compared with the verification fingerprint to generate a source tracing verification result.

5. The blockchain-based electricity sales transaction data traceability method according to claim 1, characterized in that, The step of using a deep learning anomaly detection model to perform real-time analysis of the time-series data set and generate data credibility labels includes: The data of different dimensions in the time series dataset are input into the deep learning anomaly detection model. Through the hidden layer of the deep learning anomaly detection model, the influence weight of the data of different dimensions at a specific time point is calculated using the attention mechanism. Based on the influence weight, the data of different dimensions are weighted and fused to obtain the fused feature sequence. Using the long short-term memory network unit of the deep learning anomaly detection model, the contextual dependencies in the time dimension are identified based on the fused feature sequence. Based on the contextual dependencies, dynamic pattern features that reflect the normal behavior patterns of electricity trading are constructed. The dynamic pattern features are compared with the normal power trading pattern feature library in the deep learning anomaly detection model; Based on the similarity comparison results, the probability value of belonging to the normal transaction pattern is calculated using the softmax function; The probability value is quantified into a confidence score, and the confidence score is converted into a binary data confidence label according to a preset confidence threshold.

6. The blockchain-based electricity sales transaction data traceability method according to claim 1, characterized in that, Based on the physical environment state data, an environmental feature fingerprint is generated, and the electricity sales transaction data and the power grid operation data are aligned and fused according to timestamps to form a time-series data set with a unified time base, including: The data representing different physical quantities in the physical environment state data are combined to form feature data corresponding to the environment state; The feature data is compressed and expressed to generate an environmental feature fingerprint; A unified timeline is established for the electricity sales transaction data and the power grid operation data, with the timeline using a preset minimum time interval as the base unit; The electricity sales transaction data and the power grid operation data that are within the same benchmark unit are aggregated into a single data unit. All the data units are arranged in chronological order to form a time-series data set.

7. A blockchain-based electricity sales transaction data traceability system, characterized in that, include: The data acquisition module is used to collect electricity sales transaction data from multiple sources, power grid operation data, and physical environment status data related to new energy power generation. The multiple sources include the electricity wholesale market and the retail market. The generation module is used to generate environmental feature fingerprints based on the physical environment state data, and to align and merge the electricity sales transaction data with the power grid operation data according to the timestamps to form a time series data set with a unified time reference. The analysis module is used to perform real-time analysis on the time series data set using a deep learning anomaly detection model, generate data credibility tags, bind the environmental feature fingerprints and the data credibility tags to form a comprehensive data package to be stored. The determination module is used to dynamically determine the consensus strategy of the blockchain based on the access frequency of the comprehensive data packet to be stored using an adaptive consensus algorithm, and to perform block packaging processing on the comprehensive data packet to be stored based on the consensus strategy. The computing module is used to perform hash operations on the packaged comprehensive data packet using a lightweight encryption algorithm, generate a unique data fingerprint, store the unique data fingerprint and the comprehensive data packet to be stored on the blockchain, and perform verifiable traceability of electricity sales transaction data based on the blockchain. The method employs an adaptive consensus algorithm to dynamically determine the blockchain consensus strategy based on the access frequency of the comprehensive data packet to be stored. Based on this consensus strategy, the comprehensive data packet to be stored is then processed into blocks, including: Obtain the real-time access request for the comprehensive data packet to be stored; Based on the real-time access request, calculate the access frequency of the comprehensive data packet to be stored within the sliding time window; Based on the access frequency and the comprehensive data packet to be stored, consensus policy parameters are generated in conjunction with the reinforcement learning agent. Based on the consensus strategy parameters, the comprehensive data packet to be stored is split into hot data packets and cold data packets; A first consensus strategy is selected for the hot data packet, and a second consensus strategy is selected for the cold data packet; Based on the first type of consensus strategy and the second type of consensus strategy, the hot data packets and the cold data packets are verified and packaged. The packaged hot data packets and the packaged cold data packets are combined to obtain a packaged comprehensive data packet.

8. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the blockchain-based electricity sales transaction data traceability method as described in any one of claims 1 to 6 when executing the computer program.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, enables the implementation of the blockchain-based electricity sales transaction data traceability method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Green electricity transaction tracing method and system

    CN119784495A

  • Block chain-based computer batch data storage method and system

    CN119996433A