Energy data sharing method and device based on alliance chain and medium

Through the energy data sharing method based on alliance chain, combined with a trusted execution environment and IPFS, homomorphic encryption and dynamic watermark algorithms are used to solve the data security and sharing process tracking problems in the energy data management system, and the security sharing and supervision throughout the life cycle is realized, which improves the credibility and traceability of data.

CN120567462APending Publication Date: 2025-08-29ZHONGDIANTOU GUANGXI JINZISHAN WIND POWER DEV CO LTD +1
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202510663578.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-22
Publication Date
2025-08-29

AI Technical Summary

Technical Problem

The existing energy data management system has vulnerabilities in data security, ownership definition and trustworthiness sharing, and it is difficult to achieve full-process trustworthiness guarantees. It lacks fine-grained access control and sharing process tracking capabilities, which hinders the release of the value of energy data and the coordinated development under the "dual carbon" goal.

Method used

The energy data sharing method based on alliance chain is adopted, and data encryption and labeling is carried out through a trusted execution environment (TEE) and IPFS, and homomorphic encryption technology and dynamic watermark algorithms are used to achieve the full life cycle of data secure sharing and traceability.

Benefits of technology

A secure sharing system covering the entire life cycle of data has been built to prevent data tampering risks, realize accurate traceability of shared traces and real-time supervision of illegal behaviors, and solve the problems of trustworthy guarantees and process traceability in energy data sharing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120567462A_ABST
    Figure CN120567462A_ABST
Patent Text Reader

Abstract

The invention relates to an alliance chain-based energy data sharing method and device, and a medium, and the method comprises the steps: collecting and preprocessing energy data based on a TEE, encrypting the data in the TEE, uploading the data to an IPFS, generating a hash value, and binding a data owner identifier; when the verification request is responded, integrity verification, numerical value verification and other operations are executed, and an encryption result is generated and returned to the demand side. After verification is passed, copyright information is embedded according to a data type matching watermarking algorithm, the IPFS is re-encrypted and uploaded, and a shared hash value is obtained. And storing the hash value and the decryption key into the block chain through the consensus node of the alliance chain, and transmitting the hash value and the decryption key to the demand side. And after the demand side decrypts and obtains the data, extracting the watermark and comparing the watermark with the on-chain parameters for verification. According to the method, sharing and verification of the data in an encryption state are ensured, privacy protection and use controllability are considered, and the problems of data leakage, tampering and ownership tracing in traditional sharing are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of blockchain technology and energy data management, and specifically to an energy data sharing method, device and medium based on an alliance chain. Background Art

[0002] In recent years, as the global energy system accelerates its transformation toward digitalization and intelligentization, energy industry data has experienced explosive growth. From generating unit operating parameters and dynamic load monitoring of transmission networks to user behavior analysis and real-time bidding data in energy trading markets, the generation and aggregation of massive amounts of multi-source, heterogeneous data have become a core element supporting energy system optimization, market mechanism improvement, and green, low-carbon transformation. However, the contradiction between the highly dispersed and sensitive nature of energy data and the need for cross-party sharing has become increasingly prominent, and existing technological systems face severe challenges in data security, ownership definition, and trusted sharing.

[0003] Currently, energy data management generally adopts a centralized architecture, relying on a single data center for data collection and sharing. This model has significant vulnerability defects: centralized storage nodes are susceptible to network attacks (such as DDoS attacks, data tampering attacks, etc.) or hardware failures, which can damage the integrity and availability of critical energy data, thereby threatening the stable operation of the power system. The ransomware attack suffered by Colonial Pipeline Company in the United States in 2021 exposed the fatal flaws of the centralized architecture. At the same time, there is a lack of an effective ownership identification mechanism in the data sharing process. In the event of data leakage or quality disputes, it is difficult to quickly trace the source of the data and clarify the responsibility, which seriously hinders the market circulation of energy data.

[0004] In terms of data security technology, while traditional encryption methods can ensure the security of the transmission process, they cannot meet the privacy computing needs of multi-party collaboration scenarios. For example, when power grid companies and new energy companies conduct cross-domain data joint analysis, the interaction of plaintext data may lead to the leakage of commercial secrets, while conventional encryption methods limit the computability of the data. In addition, existing watermarking technologies mostly use fixed-strength embedding strategies, which are difficult to adapt to the diverse characteristics of energy data (such as structured meter data and unstructured equipment vibration data). This makes it difficult to balance watermark robustness and data availability, and it is impossible to effectively achieve full-cycle tracking of data flow.

[0005] While existing patented blockchain data sharing solutions enhance data tamper resistance through distributed ledgers, they fail to address the issue of data source credibility. Sensor data can be vulnerable to man-in-the-middle attacks during the collection phase due to device firmware vulnerabilities, leading to a vicious cycle of "garbage in, garbage out" after contaminated data is uploaded to the blockchain. Other solutions employ federated learning for privacy protection, but these approaches overlook the unique spatiotemporal correlations of energy data and struggle to address data consistency challenges arising from changes in distribution network topology.

[0006] With the deepening of energy market reform, new business scenarios such as cross-regional power trading and distributed energy aggregation have put forward higher requirements for data sharing. The existing technical system has obvious deficiencies in the following core links: (1) There is a lack of a trustworthy guarantee mechanism for the entire process from data collection, processing to storage; (2) The granularity of data ownership marking is coarse and cannot support fine-grained access control and benefit distribution; (3) The sharing process tracking capability is weak, making it difficult to quickly locate and deal with data abuse. These problems have seriously restricted the release of the value of energy data and hindered the coordinated development of the energy internet under the "dual carbon" goal. Summary of the Invention

[0007] The present invention provides an energy data sharing method, device and medium based on alliance chain, which aims to solve the technical problems existing in the energy data sharing process, such as the risk of easy tampering, the untraceability of sharing traces and the difficulty in supervising illegal sharing behavior.

[0008] To achieve the above objectives, the first aspect of the present invention provides an energy data sharing method based on a consortium chain, comprising the following steps:

[0009] Collect energy data through a collection device in a trusted execution environment, pre-process the collected energy data, and add a data device tag containing the device type and unique identification code;

[0010] Encrypting the preprocessed energy data in the trusted execution environment, uploading the encrypted data to IPFS, and obtaining a hash value of the encrypted data in IPFS;

[0011] The encrypted data uploaded to IPFS is marked as owner-controlled, an identifier containing the data owner's identification information is generated, and the identifier is associated with the IPFS hash value.

[0012] Responding to the verification request from the data demander, performing a verification operation on the encrypted data based on homomorphic encryption technology, generating an encrypted verification result and returning it to the data demander;

[0013] When the verification is passed, the watermark algorithm is matched according to the data type, the watermark information is embedded in the encrypted data to generate shared data, and then it is re-encrypted and uploaded to IPFS to obtain the corresponding shared data hash value;

[0014] The shared data hash value and the corresponding decryption key are stored in the blockchain through the alliance chain consensus node, and the shared data hash value and decryption key are transmitted to the data demander;

[0015] The data demander obtains the shared data from IPFS based on the decryption key, extracts the watermark information and compares and verifies it with the watermark parameters stored in the blockchain;

[0016] The entire process from sharing request initiation, data verification, shared data transmission to data acquisition is recorded on the alliance chain to complete energy data sharing.

[0017] Furthermore, the generation of the data device tag includes:

[0018] In a trusted execution environment, through authorized trusted applications, the device type, device model, unique identification code and production batch information are bound to the collected energy data and then encrypted to form tamper-proof label data.

[0019] Furthermore, the watermark algorithm matching includes:

[0020] Perform data entropy analysis on the encrypted data to calculate the information entropy value of each field. The information entropy value calculation formula is:

[0021] H=-∑(p(x)*log2(p(x)))

[0022] Among them, H represents information entropy, p(x) represents the probability of occurrence of data values ​​in the field;

[0023] Determine the data type based on a preset empirical threshold: if the overall information entropy value is lower than the empirical threshold, it is determined to be structured data; if it is higher than the empirical threshold, it is determined to be unstructured data;

[0024] For structured data, a watermark algorithm based on discrete fields is selected to embed watermark information into the discrete data field;

[0025] For unstructured data, choose a watermark algorithm based on frequency domain transformation or neural network model to embed the watermark information into the frequency domain features or hidden layer features of the data;

[0026] Adjust watermark embedding parameters based on data security level: divide energy data into three levels: very important, important, and general, and dynamically set watermark embedding strength and position according to the level;

[0027] Combined with the historical sharing records of the data demander, if the data demander has a record of illegal behavior, the watermark embedding redundancy and encryption complexity will be increased;

[0028] The key, embedding position coordinates and strength parameters of the selected watermark algorithm are stored in the blockchain through a smart contract and bound to the data hash value and the identity information of the sharing party.

[0029] Furthermore, the method of transmitting the shared data hash value and decryption key to the data requester includes:

[0030] The data providing account combines the decryption key with the hash address of the shared data on IPFS to generate a transmission data packet;

[0031] Digitally sign the transmission data packet using the identity private key of the data providing account to obtain a signed data packet;

[0032] Bind the signed data packet to the public key of the account providing the data to form an encrypted transmission packet, and encrypt it using the public key of the verification node;

[0033] Upload the encrypted transmission package to the alliance chain system, triggering the smart contract to verify the sharing permissions and signature validity of the data provided by the account;

[0034] After verification, the consortium chain system pushes the encrypted transmission package to the data demander, who then uses his or her own private key to decrypt the transmission package and obtain the signed data package and public key.

[0035] The data demander uses the identity public key to verify the integrity of the signed data packet. After the verification is passed, the decryption key and IPFS hash address are extracted to complete the transmission of the shared data hash value and decryption key.

[0036] Furthermore, the verification method for extracting watermark information and comparing it with the watermark parameters stored in the blockchain includes:

[0037] The data demander extracts watermark feature information from the received shared data using at least one algorithm in a preset watermark feature extraction algorithm library, wherein the algorithm includes one or more combinations of discrete cosine transform frequency domain analysis and convolutional neural network model feature recognition;

[0038] Initiate a watermark parameter query request to the consortium chain, and obtain the corresponding watermark generation algorithm key, embedding position coordinates, and embedding strength value from the blockchain smart contract based on the shared data hash value;

[0039] Compare the extracted watermark feature information with the watermark parameters stored in the blockchain and calculate the feature matching degree:

[0040] If the matching degree is higher than the preset threshold, it is determined that the data has not been tampered with and the source is legitimate;

[0041] If the matching degree is lower than the preset threshold, the traceability function in the smart contract is triggered to retrieve the historical version of the watermark parameters and related operation records stored in the blockchain;

[0042] Based on the differences between the historical versions of watermark parameters and the currently extracted features, the time nodes of data tampering and the types of tampering operations are analyzed, and a tampering traceability report is generated and stored in the blockchain.

[0043] Furthermore, the method for performing verification operations on encrypted data based on homomorphic encryption technology includes:

[0044] The data demander initiates a data verification request to the consortium chain system, specifying the encrypted data range to be verified and the verification type, which includes at least one of data integrity verification, numerical accuracy verification, or business compliance check;

[0045] After receiving the verification request, the data providing account calls the homomorphic encryption algorithm in the trusted execution environment, directly performs the ciphertext operation corresponding to the verification type on the encrypted data stored in IPFS, and generates an encryption verification result. The ciphertext operation includes homomorphic addition summation, homomorphic multiplication compliance calculation, or logical homomorphic condition judgment;

[0046] Encapsulate the encryption verification result and the corresponding homomorphic decryption key into a verification response packet, and transmit it to the data demander through the alliance chain system;

[0047] The data requester uses his / her own private key to decrypt the verification response packet and obtain the plaintext verification result;

[0048] If the verification result plaintext meets the preset accuracy threshold or compliance rules, the data verification is considered to have passed; otherwise, a data anomaly alarm is triggered, the sharing process is terminated, and the abnormal event is recorded in the blockchain.

[0049] Furthermore, the method of storing through the alliance chain consensus node includes:

[0050] The data provider account encapsulates the IPFS hash value of the shared data, the corresponding decryption key, and the associated identity public key information into an on-chain storage request package and submits it to the consortium chain system;

[0051] The management account acts as a consensus node to perform validity verification on the storage request package, including:

[0052] Verify whether the account providing the data has sharing permissions;

[0053] Verify that the binding relationship between the IPFS hash value and the decryption key matches;

[0054] Verify the legitimacy of the data owner's mark;

[0055] After verification, the alliance chain smart contract is triggered to generate a data storage transaction. The smart contract calls the consensus algorithm, and multiple management account nodes conduct multiple rounds of voting consensus on the storage transaction.

[0056] When the consensus nodes reach a majority consensus, the IPFS hash value, decryption key and identity public key information are written into the distributed ledger of the blockchain in the form of key-value pairs, and a record containing a timestamp, block height and storage node identifier is generated.

[0057] Furthermore, the method also includes an exception handling mechanism:

[0058] When a watermark comparison anomaly or a conflict in traceability records is detected:

[0059] Automatically call the smart contract to terminate the sharing rights of relevant data;

[0060] Locate the original data copy based on the identifier and perform integrity verification;

[0061] Generate an audit report containing abnormal operation nodes and update the consortium chain blacklist.

[0062] To achieve the above-mentioned purpose, the second aspect of the present invention provides an electronic device, including a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the energy data sharing method based on the alliance chain, and the processor is configured to execute the program stored in the memory.

[0063] To achieve the above-mentioned objectives, the third aspect of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, the steps of the energy data sharing method based on the alliance chain are executed.

[0064] Beneficial effects of the present invention:

[0065] Compared with existing technologies, the present invention provides a consortium chain-based energy data sharing method, device, and medium. By deeply integrating the Trusted Execution Environment (TEE) with consortium chain technology, it builds a secure sharing system covering the entire data lifecycle. At the data collection source, the TEE hardware-level isolation mechanism ensures tamper-proof and trusted preprocessing of raw data, and combines data device tags to achieve ownership tagging. Utilizing IPFS distributed storage and homomorphic encryption technology, it supports compliance verification in ciphertext while ensuring data storage reliability. Through the dynamic matching mechanism of the data watermarking algorithm, the watermark embedding strategy is intelligently adjusted according to the energy data type, forming a verifiable tamper-proof digital fingerprint. Relying on consortium chain smart contracts, key information such as watermark parameters and sharing traces is solidified on the chain, establishing a full-link supervision closed loop of "collection-encryption-labeling-verification-sharing-traceability". This solution not only prevents data tampering risks through a multi-level encryption system, but also achieves accurate tracing of sharing traces through watermark feature comparison and blockchain evidence storage. At the same time, the consortium chain consensus mechanism is used to provide real-time warnings and permission blocking for illegal sharing behaviors, effectively solving the problems of trustworthiness, process traceability, and regulatory disposal in energy data sharing. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments.

[0067] Figure 1 This is a flowchart of an energy data sharing method based on alliance chain disclosed in an embodiment of the present invention.

[0068] Figure 2 This is a flow chart of a data providing account to realize data sharing disclosed in an embodiment of the present invention.

[0069] Figure 3 This is a schematic diagram of the framework of a data watermark generation and verification mechanism disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0070] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0071] According to an embodiment of the present invention, it should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the following production method, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0072] like Figure 1 、 Figure 2 As shown, the present invention provides an energy data sharing method based on alliance chain, comprising the following steps:

[0073] Step S100: Collect energy data through a collection device in a trusted execution environment, pre-process the collected energy data, and add a data device tag containing a device type and a unique identification code;

[0074] Within a trusted execution environment (TEE), data collection devices (such as sensors and smart meters) are connected and configured with the system. Once the TEE is configured, the collection devices collect data at a predetermined frequency and in a specific manner. During the data collection process, trusted applications within the TEE perform preliminary processing on the collected data, including data format conversion (converting raw data into a unified format for subsequent analysis), data cleaning, and the removal of noise and outliers.

[0075] After preliminary processing, energy data is tagged with a device tag before leaving the TEE. This tag contains a wealth of device-related information, such as the device type, model, unique identification code, and the production batch to which the device belongs.

[0076] Step S200: Encrypt the pre-processed energy data in the trusted execution environment, upload the encrypted data to IPFS, and obtain a hash value of the encrypted data in IPFS;

[0077] During the data encryption operation, the data owner can independently select an applicable encryption algorithm (such as symmetric encryption or asymmetric encryption) within the TEE based on actual security needs to encrypt the pre-processed energy data (including device tags). For example, the AES algorithm can be selected to encrypt the data to ensure that the data is always in a ciphertext state during transmission and storage. The encryption process is completely executed in the hardware isolation environment of the TEE. Key generation, algorithm calls, and other operations are all completed through authorized code to prevent external malicious programs from stealing keys or tampering with encryption logic. After encryption is completed, the data is directly uploaded to the distributed storage nodes of the InterPlanetary File System (IPFS) through the secure channel of the TEE. IPFS divides the encrypted data into multiple data blocks and generates a unique hash value (such as CID, content identifier) ​​based on the content addressing mechanism.

[0078] It is understandable that this step achieves high efficiency and risk resistance of data storage through the combination of encryption within TEE and IPFS distributed storage, avoiding the single point failure problem of traditional centralized storage.

[0079] Step S300: Mark the encrypted data uploaded to IPFS as the owner of the data, generate an identifier containing the data owner's identification information, and associate the identifier with the IPFS hash value;

[0080] After the encrypted data is uploaded to IPFS, a data owner mark is added to the data to clarify the data ownership. Specifically, the data owner (such as a power generation company, a power grid company, etc.) generates an identifier containing its unique identity information in the TEE, such as: company name (such as "XX Power Group"), company unified social credit code or industry identification code (such as the ID generated by the power grid company coding rules), data classification identification (such as "power generation data-real-time power"). The marking information is encrypted using digital signature technology to ensure the integrity and non-forgeability of the mark itself.

[0081] The generated data owner tag is bound one-to-one with the encrypted data hash value (CID) returned by IPFS to form an ownership-data association record, which is written into the blockchain distributed ledger through the consortium chain smart contract. The binding information of the data owner tag and the hash value is verified on the consortium chain through a multi-node consensus mechanism to ensure the authenticity of the association. Any subsequent modification of the tag or hash value must trigger an on-chain transaction and be reviewed by the management account node to avoid ownership disputes caused by single point failures of the centralized system or human operations.

[0082] Step S400: respond to the verification request of the data requester, perform a verification operation on the encrypted data based on homomorphic encryption technology, generate an encryption verification result and return it to the data requester;

[0083] User roles participating in the consortium chain-based data sharing and traceability system are divided into three categories: management accounts, data provider accounts, and cross-chain and data demand accounts. Management accounts are responsible for approving data users and cross-enterprise accounts that join the system and also serve as consensus nodes for the underlying consortium chain. Data provider accounts are accounts that upload energy data. Data demand accounts are accounts that share data with this enterprise from other enterprises.

[0084] When a data-demanding account requests verification of data uploaded by a data account, it initiates a verification request to the system. Upon receiving the verification request, the data-providing account verifies the pre-shared data using homomorphic encryption to verify its accuracy, integrity, and compliance. Using a homomorphic encryption algorithm, the data-providing account performs various verification operations on the data without decrypting the original data, and then feeds the encrypted verification results back to the data-demanding account. The data-demanding account decrypts the results using the corresponding decryption key. If the results indicate that all data indicators are normal, the data is confirmed to be reliable.

[0085] Step S500: After verification, the watermark algorithm is matched according to the data type, the watermark information is embedded in the encrypted data to generate shared data, which is then re-encrypted and uploaded to IPFS to obtain the corresponding shared data hash value;

[0086] After data verification, the encrypted data is watermarked and re-encrypted. Given the diverse sources of energy data, this paper designs a data type-adaptive, verifiable, and tamper-resistant data watermarking method. This method automatically matches the watermark embedding strength and location based on the energy data type, and combines blockchain technology to form a verifiable, tamper-resistant fingerprint, ensuring the security and integrity of energy data.

[0087] like Figure 3 ,The data watermark generation and verification process is as follows:

[0088] Step S501: Perform data entropy analysis on the encrypted data to calculate the information entropy value of each field. The information entropy value calculation formula is:

[0089] H=-∑(p(x)*log2(p(x)))

[0090] Where H represents information entropy, measured in bits, and is used to quantify the uncertainty of data or the expected value of the amount of information. The larger the entropy value, the higher the uncertainty of the data and the more information it contains. p(x) represents the probability of occurrence of a data value in a field. Log2(p(x)) represents a logarithmic operation with base 2, which converts the probability p(x) into information in bits. The smaller the probability p(x), the larger the absolute value of log2(p(x)). However, the overall formula converts it into a positive entropy value through the negative sign.

[0091] Step S502: Determine the data type based on a preset empirical threshold: if the overall information entropy value is lower than the empirical threshold, determine it as structured data; if it is higher than the empirical threshold, determine it as unstructured data;

[0092] Step S503: For structured data, a watermark algorithm based on discrete fields is selected to embed watermark information into the discrete data fields;

[0093] Step S504: For unstructured data, a watermark algorithm based on frequency domain transformation or neural network model is selected to embed the watermark information into the frequency domain features or hidden layer features of the data;

[0094] Step S505: Adjust watermark embedding parameters according to data security level: divide energy data into three levels: very important, important, and general, and dynamically set watermark embedding strength and position according to the level;

[0095] Step S506: Combine the historical sharing records of the data demander and increase the watermark embedding redundancy and encryption complexity if the data demander has a record of illegal behavior;

[0096] Step S507: The key, embedding position coordinates and strength parameters of the selected watermark algorithm are stored in the blockchain through a smart contract and bound to the data hash value and the identity information of the sharing party.

[0097] In the data watermark generation and verification process, structured data refers to data types with clearly defined formats and logical relationships (such as tabular data such as meter readings and energy transaction records in relational databases). Its fields are arranged in a fixed pattern and can be located by rows and columns. They exhibit numerical or discrete characteristics and have low information entropy. Unstructured data refers to data types without a fixed format or pattern (such as device log text, sensor vibration waveforms, power grid topology maps, etc.). They contain complex forms such as free text, time series signals, images, or videos, have high information entropy, and are difficult to directly parse through traditional databases. The difference between the two directly affects watermark embedding strategies: structured data uses discrete field watermarking algorithms (such as modifying the low-order bits of specific numerical fields), while unstructured data relies on frequency domain transformations (such as DCT coefficient modification) or deep learning models (such as CNN feature layer perturbations) to achieve watermark embedding, ensuring a balance between watermark robustness and data availability.

[0098] In step S505, energy data is divided into three levels: very important, important, and general data; very important data includes marketing data, transaction data, etc.; important data includes customer account, code, etc.; general data includes date, location, and other information.

[0099] In step S507, the watermark generation algorithm key, embedding position coordinates and other information are stored together with the data file hash value in the blockchain smart contract and associated with the data provider and the demander. The method of associating the watermark parameters with the data file includes: binding the watermark algorithm key, embedding position coordinates and embedding strength value with the hash value generated after the data file is stored in IPFS to form a watermark parameter-data hash mapping relationship; establishing a multi-dimensional association index between the mapping relationship and the data provider identifier and the data demander identifier through the smart contract, and storing it in the alliance chain distributed ledger; when performing watermark verification, querying the smart contract according to the hash value of the data file to be verified, obtaining the corresponding watermark parameter set for comparison, so that the corresponding parameters can be found by the hash value during verification.

[0100] Compared with traditional watermarking methods, the present invention accurately distinguishes structured and unstructured data through an intelligent classification algorithm based on information entropy, breaking through the limitation of poor adaptability of traditional fixed-intensity watermarks to heterogeneous data, and improving the watermark concealment while ensuring data availability through a differentiated strategy of discrete field perturbation and frequency domain feature embedding; secondly, a dynamic watermark parameter system is constructed in combination with blockchain smart contracts, and through security level classification (such as the use of 3-level redundant watermarks for transaction data) and violation linkage (implementing a two-factor encrypted watermark for blacklisted demanders), the watermark strength is accurately matched with security requirements, reducing the data distortion rate compared to traditional static watermarks; finally, relying on deep learning models and blockchain evidence storage to form a double verification closed loop, data tampering can be detected in real time and traced back to the operation node, which improves the efficiency of traditional manual watermark detection.

[0101] Step S600: The shared data hash value and the corresponding decryption key are stored in the blockchain through the alliance chain consensus node, and the shared data hash value and decryption key are transmitted to the data requester;

[0102] The data provider account combines the hash value (CID) of the shared data on IPFS with the corresponding decryption key to generate a plaintext transmission data packet. Subsequently, the data provider account digitally signs the data packet using its own private key to generate a signed data packet.

[0103] After the signature data package is bound to the public key of the data provider account, the complete data package is encrypted using the public key of the verification node to form an encrypted transmission package. The encrypted transmission package is submitted to the management account node through the consortium chain system, triggering the smart contract to automatically verify the sharing permissions and operational compliance of the data provider account. The management account acts as a consensus node and performs multi-dimensional verification of the submitted storage request:

[0104] 1. Verify whether the account providing the data has sharing permissions (for example, check whether the account is not on the blacklist);

[0105] 2. Verify that the binding relationship between the IPFS hash value and the decryption key matches (e.g. verify data integrity through hash reverse lookup);

[0106] 3. Verify the legitimacy of the data owner’s mark (such as checking the associated ownership record on the blockchain).

[0107] After verification, the smart contract invokes a consensus algorithm, with multiple management account nodes conducting multiple rounds of voting on the storage transaction. Once a majority consensus is reached, the hash value, decryption key, and public key are written to the blockchain's distributed ledger as key-value pairs. This generates a record containing a timestamp, block height, and storage node identifier. The consortium chain system then pushes the encrypted transmission package to the data requester, who decrypts the package using their private key to obtain the signed data packet and the public key of the account providing the data.

[0108] The data demander verifies the signed data packet using the public key of the account providing the data. If the signature verification passes, the IPFS hash value and decryption key are extracted. If the signature does not match or the data packet has been tampered with, an abnormality alarm is triggered and the sharing process is terminated. After verification, the data demander downloads the encrypted shared data from the distributed storage based on the IPFS hash value and decrypts it using the decryption key, ultimately obtaining the plaintext shared data with the watermark.

[0109] Step S700: The data requester obtains the shared data from IPFS based on the decryption key, extracts the watermark information, and compares and verifies it with the watermark parameters stored in the blockchain;

[0110] The data demander downloads the encrypted shared data through the distributed storage network based on the IPFS hash value obtained in the alliance chain system. Subsequently, the decryption key transmitted in step S600 (such as the AES key decrypted by the RSA private key) is used to decrypt the data to obtain the plaintext shared data with the watermark. The data demander calls the method in the preset watermark feature extraction algorithm library to extract the watermark feature information from the decrypted shared data. For example: structured data uses discrete field check bit parsing or redundant bit extraction; unstructured data uses discrete cosine transform (DCT) to extract frequency domain coefficient features, or uses a pre-trained convolutional neural network (CNN) model to identify hidden layer features; if the data provider uses a combined watermark (such as frequency domain + spatial domain dual embedding), it is necessary to combine multiple algorithms for collaborative extraction.

[0111] The data demander initiates a watermark parameter query request to the consortium chain and submits the hash value (CID) of the shared data to the smart contract. The smart contract retrieves the associated watermark parameter set stored in the blockchain based on the hash value, including: watermark generation algorithm key, embedding location coordinates, embedding strength value, data provider's identity public key and timestamp. The extracted watermark feature information is compared with the watermark parameters in the blockchain to calculate the feature matching degree. A preset matching degree threshold is set. If the actual matching degree is higher than the threshold, it is determined that the data has not been tampered with and the source is legitimate. If it is lower than the threshold, that is, when an abnormal matching degree is detected, the traceability function in the blockchain smart contract is called to retrieve the historical version of the watermark parameter (such as filtering change records by timestamp), analyze the tampering time node and operation type; based on the difference analysis results, an audit report containing the tampering location, the operator's identity (such as traceability through the associated public key) and a timestamp is generated, stored in the blockchain, and notified to the relevant regulators.

[0112] Step S800: Record the entire process from sharing request initiation, data verification, shared data transmission to data acquisition on the alliance chain to complete energy data sharing.

[0113] This step uses a consortium chain to establish a fully traceable data sharing and regulatory system. From the moment a data requester submits a sharing request, the consortium chain's distributed ledger begins recording key parameters, including timestamps, the operating entity's IP address, and watermark feature values. This includes: 1) the sharing request phase, which involves the data requester's account joining, identity verification of the management account, and authorization granting; 2) the verification phase, which involves homomorphic encryption verification of operational parameters, verification results, and interaction logs; 3) the transmission phase, which includes the IPFS hash address transmission path, digital signature verification, and encrypted package decryption logs; and 4) the data acquisition phase, which includes the watermark extraction algorithm version, feature comparison results, and usage permission declarations. Consortium chain nodes synchronize and store operation logs for each step in real time, forming an unalterable audit chain. The data sharing and traceability system incorporates a regular regulatory audit process. Through smart contracts, it automatically retrieves time series records from the blockchain, fully reconstructing the entire data lifecycle from acquisition to consumption. When an abnormal operation is detected (such as the watermark matching degree is lower than the threshold), the traceability function is immediately triggered to retrieve the watermark parameters of the historical version, and the tampering time node is analyzed in combination with the blockchain evidence. An audit report containing the abnormal operation subject, violation type and impact scope is generated, and the alliance chain blacklist is updated to terminate the relevant account permissions to achieve closed-loop supervision.

[0114] In this embodiment, utilizing a consortium chain and data sharing traceability system, the consortium chain begins recording every key step from the moment data sharing is initiated. Operations such as the data requesting account submitting a membership request, account management verification, and granting permissions are all recorded in detail on the consortium chain's distributed ledger. When the data provider receives the verification request and performs homomorphic encryption on the pre-shared data, these operations are also recorded, forming a complete pre-sharing trace. During the data sharing transmission phase, watermarked data is transmitted through the consortium chain's secure channel, and its transmission path, timestamp, and other information are recorded. After the recipient receives the data, the watermark information extraction and verification operations also leave a trace on the consortium chain. During the data usage phase, the recipient's analysis, processing, or application of the shared data based on their own permissions can also be traced through the consortium chain and the relevant information in the watermark. The data sharing traceability system has a regular data sharing regulatory audit process. Through watermarks and consortium chain records, the entire data process from initial collection to final use is tracked, ensuring transparency and controllability of the data sharing process. Any data misuse and other issues can be quickly identified and held accountable.

[0115] Preferably, the generation of the data device label includes: binding the device type, device model, unique identification code and production batch information with the collected energy data through an authorized trusted application in a trusted execution environment and then encrypting them to form tamper-proof label data.

[0116] Preferably, in step S400, the method for performing a verification operation on encrypted data based on homomorphic encryption technology includes:

[0117] Step S401: The data demander initiates a data verification request to the consortium chain system, specifying the encrypted data range to be verified and the verification type, where the verification type includes at least one of data integrity verification, numerical accuracy verification, or business compliance check.

[0118] Step S402: After receiving the verification request, the data providing account calls the homomorphic encryption algorithm in the trusted execution environment, directly performs the ciphertext operation corresponding to the verification type on the encrypted data stored in IPFS, and generates an encryption verification result. The ciphertext operation includes homomorphic addition summation, homomorphic multiplication compliance calculation, or logical homomorphic condition judgment;

[0119] Step S403: Encapsulate the encryption verification result and the corresponding homomorphic decryption key into a verification response packet, and transmit it to the data requester through the alliance chain system;

[0120] Step S404: The data requester uses its own private key to decrypt the verification response packet to obtain the plaintext verification result;

[0121] Step S405: If the verification result plaintext meets the preset accuracy threshold or compliance rules, the data verification is determined to be passed; otherwise, a data anomaly alarm is triggered, the sharing process is terminated, and the anomaly event is recorded in the blockchain.

[0122] Compared with the traditional method of verification after decryption, the method of performing verification operations on encrypted data based on homomorphic encryption technology, first, keeps the data encrypted throughout the verification process, avoids the risk of sensitive data being exposed in plain text during transmission and calculation, and breaks through the bottleneck of balancing data privacy protection and availability in the traditional verification process; second, it relies on a trusted execution environment and a consortium chain to build a trusted verification channel. The ciphertext calculation process is protected by hardware-level security, and the verification results are transmitted encrypted through the blockchain, which not only prevents man-in-the-middle attacks from tampering with the verification logic, but also ensures the auditability of the verification operation through on-chain evidence storage; third, it realizes automated closed-loop control of the verification process. When the verification result deviates from the compliance threshold, the smart contract automatically triggers the exception blocking mechanism and traces the risk node. Compared with the traditional exception handling mode with manual intervention, the response speed is improved.

[0123] Preferably, the method also includes an exception handling mechanism: when a watermark comparison anomaly or a conflict in the traceability record is detected: automatically calling the smart contract to terminate the sharing authority of the relevant data; locating the original data copy based on the identifier for integrity verification; generating an audit report containing abnormal operation nodes and updating the alliance chain blacklist.

[0124] According to another aspect of an embodiment of the present application, an electronic device is provided, including a processor and a memory, wherein the processor is configured to implement the steps of the method when executing a computer program stored in the memory.

[0125] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0126] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0127] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0128] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc. Various media that can store program codes.

[0129] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.

Claims

1. An energy data sharing method based on alliance chain, characterized in that: The steps include: Collect energy data through a collection device in a trusted execution environment, pre-process the collected energy data, and add a data device tag containing the device type and unique identification code; Encrypting the preprocessed energy data in the trusted execution environment, uploading the encrypted data to IPFS, and obtaining a hash value of the encrypted data in IPFS; The encrypted data uploaded to IPFS is marked as owner-controlled, an identifier containing the data owner's identification information is generated, and the identifier is associated with the IPFS hash value. Responding to the verification request from the data demander, performing a verification operation on the encrypted data based on homomorphic encryption technology, generating an encrypted verification result and returning it to the data demander; When the verification is passed, the watermark algorithm is matched according to the data type, the watermark information is embedded in the encrypted data to generate shared data, and then it is re-encrypted and uploaded to IPFS to obtain the corresponding shared data hash value; The shared data hash value and the corresponding decryption key are stored in the blockchain through the alliance chain consensus node, and the shared data hash value and decryption key are transmitted to the data demander; The data demander obtains the shared data from IPFS based on the decryption key, extracts the watermark information and compares and verifies it with the watermark parameters stored in the blockchain; The entire process from sharing request initiation, data verification, shared data transmission to data acquisition is recorded on the alliance chain to complete energy data sharing.

2. The energy data sharing method based on alliance chain according to claim 1 is characterized in that: The generation of the data device tag includes: In a trusted execution environment, through authorized trusted applications, the device type, device model, unique identification code and production batch information are bound to the collected energy data and then encrypted to form tamper-proof label data.

3. The energy data sharing method based on alliance chain according to claim 1 is characterized in that: The watermark algorithm matching includes: Perform data entropy analysis on the encrypted data to calculate the information entropy value of each field. The information entropy value calculation formula is: H=-∑(p(x)*log2(p(x))) Among them, H represents information entropy, p(x) represents the probability of occurrence of data values ​​in the field; Determine the data type based on a preset empirical threshold: if the overall information entropy value is lower than the empirical threshold, it is determined to be structured data; if it is higher than the empirical threshold, it is determined to be unstructured data; For structured data, a watermark algorithm based on discrete fields is selected to embed watermark information into the discrete data field; For unstructured data, choose a watermark algorithm based on frequency domain transformation or neural network model to embed the watermark information into the frequency domain features or hidden layer features of the data; Adjust watermark embedding parameters based on data security level: divide energy data into three levels: very important, important, and general, and dynamically set watermark embedding strength and position according to the level; Combined with the historical sharing records of the data demander, if the data demander has a record of illegal behavior, the watermark embedding redundancy and encryption complexity will be increased; The key, embedding position coordinates and strength parameters of the selected watermark algorithm are stored in the blockchain through a smart contract and bound to the data hash value and the identity information of the sharing party.

4. The energy data sharing method based on alliance chain according to claim 1 is characterized in that: The method of transmitting the shared data hash value and decryption key to the data requester includes: The data providing account combines the decryption key with the hash address of the shared data on IPFS to generate a transmission data packet; Digitally sign the transmission data packet using the identity private key of the data providing account to obtain a signed data packet; Bind the signed data packet to the public key of the account providing the data to form an encrypted transmission packet, and encrypt it using the public key of the verification node; Upload the encrypted transmission package to the alliance chain system, triggering the smart contract to verify the sharing permissions and signature validity of the data provided by the account; After verification, the consortium chain system pushes the encrypted transmission package to the data demander, who then uses his or her own private key to decrypt the transmission package and obtain the signed data package and public key. The data demander uses the identity public key to verify the integrity of the signed data packet. After the verification is passed, the decryption key and IPFS hash address are extracted to complete the transmission of the shared data hash value and decryption key.

5. The energy data sharing method based on alliance chain according to claim 1 is characterized in that: The verification method for extracting watermark information and comparing it with the watermark parameters stored in the blockchain includes: The data demander extracts watermark feature information from the received shared data using at least one algorithm in a preset watermark feature extraction algorithm library, wherein the algorithm includes one or more combinations of discrete cosine transform frequency domain analysis and convolutional neural network model feature recognition; Initiate a watermark parameter query request to the consortium chain, and obtain the corresponding watermark generation algorithm key, embedding position coordinates, and embedding strength value from the blockchain smart contract based on the shared data hash value; Compare the extracted watermark feature information with the watermark parameters stored in the blockchain and calculate the feature matching degree: If the matching degree is higher than the preset threshold, it is determined that the data has not been tampered with and the source is legitimate; If the matching degree is lower than the preset threshold, the traceability function in the smart contract is triggered to retrieve the historical version of the watermark parameters and related operation records stored in the blockchain; Based on the differences between the historical versions of watermark parameters and the currently extracted features, the time nodes of data tampering and the types of tampering operations are analyzed, and a tampering traceability report is generated and stored in the blockchain.

6. The energy data sharing method based on alliance chain according to claim 1 is characterized in that: Methods for performing verification operations on encrypted data based on homomorphic encryption technology include: The data demander initiates a data verification request to the consortium chain system, specifying the encrypted data range to be verified and the verification type, which includes at least one of data integrity verification, numerical accuracy verification, or business compliance check; After receiving the verification request, the data providing account calls the homomorphic encryption algorithm in the trusted execution environment, directly performs the ciphertext operation corresponding to the verification type on the encrypted data stored in IPFS, and generates an encryption verification result. The ciphertext operation includes homomorphic addition summation, homomorphic multiplication compliance calculation, or logical homomorphic condition judgment; Encapsulate the encryption verification result and the corresponding homomorphic decryption key into a verification response packet, and transmit it to the data demander through the alliance chain system; The data requester uses his / her own private key to decrypt the verification response packet and obtain the plaintext verification result; If the verification result plaintext meets the preset accuracy threshold or compliance rules, the data verification is considered to have passed; otherwise, a data anomaly alarm is triggered, the sharing process is terminated, and the abnormal event is recorded in the blockchain.

7. The energy data sharing method based on alliance chain according to claim 1 is characterized in that: Methods for storing data through consortium chain consensus nodes include: The data provider account encapsulates the IPFS hash value of the shared data, the corresponding decryption key, and the associated identity public key information into an on-chain storage request package and submits it to the consortium chain system; The management account acts as a consensus node to perform validity verification on the storage request package, including: Verify whether the account providing the data has sharing permissions; Verify that the binding relationship between the IPFS hash value and the decryption key matches; Verify the legitimacy of the data owner's mark; After verification, the alliance chain smart contract is triggered to generate a data storage transaction. The smart contract calls the consensus algorithm, and multiple management account nodes conduct multiple rounds of voting consensus on the storage transaction. When the consensus nodes reach a majority consensus, the IPFS hash value, decryption key and identity public key information are written into the distributed ledger of the blockchain in the form of key-value pairs, and a record containing a timestamp, block height and storage node identifier is generated.

8. The energy data sharing method based on alliance chain according to claim 1 is characterized in that: The method also includes an exception handling mechanism: When a watermark comparison anomaly or a conflict in traceability records is detected: Automatically call the smart contract to terminate the sharing rights of relevant data; Locate the original data copy based on the identifier and perform integrity verification; Generate an audit report containing abnormal operation nodes and update the consortium chain blacklist.

9. An electronic device comprising a memory and a processor, characterized in that: The memory is used to store a program that supports the processor to execute the energy data sharing method based on the alliance chain as described in any one of claims 1-8, and the processor is configured to execute the program stored in the memory.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the energy data sharing method based on the alliance chain according to any one of claims 1 to 8 are executed.

Citation Information

Cited By

  • Outgoing data management method and device, electronic equipment, storage medium and product

    CN121093320A

  • Dynamic double-layer hidden watermark and encryption binding file protection method and system based on deep learning

    CN121167755A

  • Method for extracting and parsing bitcoin transaction autonomy information

    US12626253B2

  • Method for extracting and parsing bitcoin transaction autonomy information

    US20250037124A1