Blockchain-based smart grid data security sharing and quality evaluation method

By leveraging blockchain technology and smart contracts to achieve secure data sharing and quality assessment in smart grids, the problems of insufficient transparency in secure data sharing and incomplete quality assessment in smart grids have been solved, thereby improving the security and reliability of power grid data utilization and promoting the continuous supply of high-quality data.

CN122333436APending Publication Date: 2026-07-03NANJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610795841.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-04
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing technologies in smart grids suffer from insufficient transparency in data security sharing, low traceability, and incomplete assessment of dataset quality, leading to low grid stability and low data utilization efficiency.

Method used

A blockchain-based data security sharing method is adopted, which initializes the data through a key distribution center, stores the encrypted data in blocks in the IPFS decentralized system, uses smart contracts for access control, and combines a dataset evaluation method based on label reordering to generate quality reports and incentivize the provision of high-quality data.

Benefits of technology

It has enabled secure and reliable sharing and efficient quality assessment of smart grid data, reduced the risk of data tampering, improved the refined management and control capabilities of power grid data utilization and the reliability of analysis results, and promoted the continuous supply of high-quality data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122333436A_ABST
    Figure CN122333436A_ABST
Patent Text Reader

Abstract

This invention discloses a blockchain-based method for secure data sharing and quality assessment in smart grids, belonging to the field of data security sharing technology. The method includes: system initialization and user registration, where a key distribution center distributes keys and blockchain addresses to data owners, researchers, and a quality assessment platform; data collection and uploading, where data owners encrypt datasets, generate content identifiers in blocks, store them in IPFS, and upload the stored information to the blockchain to form trusted evidence; smart contracts and access control, setting access policies and issuing access tokens to verified researchers to obtain the dataset; dataset quality assessment, generating and providing feedback on a quality report by combining label reordering, correlation coefficient testing, and performance evaluation testing; and a reward mechanism, allocating reputation values ​​and rewards to data owners based on dataset quality. This invention achieves secure and trusted data sharing and scientific quality assessment, promoting the continuous provision of high-quality data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data security sharing technology, specifically to a blockchain-based method for data security sharing and quality assessment in smart grids. Background Technology

[0002] In smart grids, the integration and trading of distributed energy resources are becoming increasingly frequent. The power industry has accumulated a vast amount of data across various stages, including generation, transmission, transformation, distribution, consumption, and dispatch. Therefore, secure data sharing and quality assessment are crucial in operational processes. For example, a Canadian power company's grid data transmission and storage were compromised by hackers, damaging its systems and encrypted files and threatening grid stability and security. Furthermore, in another region, low-quality datasets during peak hours prevented the dispatch center from accurately assessing grid load, leading dispatchers to make incorrect decisions based on inaccurate data. This resulted in power shortages in some areas and power surpluses in others, wasting power resources and potentially causing grid instability. Based on these scenarios, it is clear that strengthening data security management and sharing mechanisms is essential, and the quality assessment of power datasets urgently needs to be addressed.

[0003] Currently, two solutions have been proposed to address the data security sharing and quality assessment issues in smart grids. One is a distributed data security sharing technology that divides power data into multiple parts and stores them across multiple nodes, replicating the same data on different nodes to ensure that data copies on other nodes remain available even if one node fails. Algorithms and protocols ensure consistency of data copies across different nodes during updates, including the use of consistent hashing algorithms and distributed locks to coordinate data update operations between different nodes. The other solution is RankVote, a dataset quality assessment method based on ranking and voting. This method evaluates classification datasets by considering the relative ranking relationships between labels. First, labels are ranked according to a certain standard (such as relevance or importance). Then, for each sample, a voting mechanism is used to determine the final classification result based on its label ranking. Finally, the performance of the classification dataset is evaluated by comparing the predicted results with the true labels.

[0004] However, existing technologies have the following problems and drawbacks: Distributed data security sharing technologies use encryption to protect data privacy, but this limits data transparency; they record the data flow process through logs, but their traceability is low; they support decentralized data storage and management, but rely on centralized servers or institutions for management, making data susceptible to single points of failure or malicious attacks. Ranking-based voting dataset quality assessment methods only consider the correctness of individual labels, ignoring the relative order between labels. Errors in a single label can have a significant impact on the overall assessment result, making the quality assessment rather one-sided. Summary of the Invention

[0005] The technical problem to be solved by this invention is to overcome the shortcomings of the prior art and design a blockchain-based smart grid data security sharing and quality assessment method to achieve secure and reliable data sharing and scientific quality assessment, and promote the continuous provision of high-quality data.

[0006] To solve the above problems, the present invention adopts the following technical solution:

[0007] This invention proposes a blockchain-based method for secure data sharing and quality assessment in smart grids, comprising the following steps:

[0008] S1. The key distribution center initializes, authenticates data owners, researchers, and quality assessment platforms participating in smart grid data sharing, distributes private and public key pairs, and generates corresponding blockchain addresses. The data owners include data providers on the generation side, transmission side, distribution side, and consumption side, as well as data providers for grid dispatching operations. The researchers include data users who conduct load forecasting, fault diagnosis, anomaly detection, demand response analysis, and dispatch optimization tasks.

[0009] S2. The data owner collects and integrates the smart grid operation dataset, which includes one or more of the following: load data, voltage data, current data, power data, distributed energy output data, equipment status data, fault alarm data, and dispatch instruction data. The dataset is then encrypted and divided into multiple data blocks. Each data block generates a content identifier through hash calculation and is stored in the IPFS decentralized storage system. The data owner uploads the IPFS storage address, dataset name, and creation time of the dataset to the blockchain network and generates trustworthy storage information.

[0010] S3. Access permissions for the dataset are set through a smart contract. Researchers initiate access requests to the dataset uploaded by the data owner according to the task requirements. After verifying the researcher's access permissions, the smart contract generates an access token. The researcher then uses the access token to retrieve the complete dataset from the IPFS storage system.

[0011] S4. A classification dataset evaluation method based on label rearrangement is adopted, wherein the labels include one or more of the following: load status label, fault type label, abnormal event label, equipment operating status label, and scheduling response result label. The dataset quality is evaluated by combining correlation coefficient test and performance evaluation test, a quality report is generated, and the evaluation results are fed back to the data owner and researchers.

[0012] S5. Assign reputation values ​​and rewards to data providers based on dataset quality to incentivize the provision of high-quality datasets.

[0013] Preferably, in step S1, the number of data sets is provided. The owner and researchers who intend to access the dataset must provide the following information to complete registration and obtain a unique global identity within the system:

[0014] ;

[0015] in, This refers to a user's trusted contact information, including email address, phone number, and social media accounts; This indicates user attributes, such as data owner, researcher, This indicates the user's name. It is the password for access; at the same time, a pseudonym is generated for each registered user. This indicates that registered users are submitting their actual identity to the system in a secure manner. And select As a hash key, a unique pseudonym identity is calculated. :

[0016] ;

[0017] in, Indicated by Secure hashing of the hash key. This is the valid time interval for the pseudonym identity. , Stored in a member list, Choose a random number It is its secret value and cannot be tampered with by anyone;

[0018] After the encryption algorithm is initialized, the key distribution center generates a unique private key for each legitimate data owner, researcher, and quality assessment platform. public key pair After verifying the identity, the key distribution center adds the attribute information to the corresponding set and uses the public key. Assign corresponding blockchain addresses Once the data owner or researcher participates in a specific transaction, the information is transferred. Generate a signature for authentication.

[0019] Preferably, step S2 specifically includes the following steps:

[0020] Assign a preset keyword to the uploaded dataset, obtain the hash value of the keyword through hash calculation, and encrypt the dataset using the AES encryption algorithm with the hash value as the key to generate an encrypted dataset;

[0021] The encrypted dataset is divided into multiple data blocks of different sizes. Each data block is hashed to generate a content identifier containing corresponding content information. The data blocks containing the content identifiers are distributed and stored on various nodes in the IPFS network, while the original dataset file retains the corresponding content identifier information of each data block.

[0022] On the IPFS proxy side, an access tree is generated according to the defined access policy. After returning the storage index hash value and ciphertext of the encrypted dataset, the data owner selects a random number to calculate and obtain the key password.

[0023] The data owner uploads the storage address, dataset number, dataset name, and creation time of the dataset in IPFS to the blockchain network, and generates the trusted evidence information through hash calculation.

[0024] Preferably, generating the encrypted dataset specifically includes the following steps:

[0025] The storage index hash value and ciphertext of the encrypted dataset After returning, select a random number. And perform the following calculations:

[0026] ;

[0027] in, and This represents the publicly available group elements selected during the system initialization phase; All are key ciphertext The composition parameters in; and Indicates the initial ciphertext The parameters that make up the ciphertext; This indicates accessing the secret value corresponding to the polynomial at the root node of the tree. and This indicates the system's default security hash function; and This represents the master key parameter generated during the system initialization phase; This refers to the symmetric key or session key used to protect the access key to the smart grid operation dataset.

[0028] After that, the key password was obtained. :

[0029] ;

[0030] in, Represents public parameters related to access policies; This represents the access tree generated according to the access policy; Represents a visit tree Attribute nodes in; Represents attribute nodes The corresponding polynomial takes values ​​at zeros; and Represents access to tree attribute nodes The corresponding ciphertext composition parameters.

[0031] Preferably, the trusted evidence information is calculated according to the following formula:

[0032] ;

[0033] ;

[0034] in, This represents the on-chain registration information of the smart grid operation dataset; This indicates the storage address of the smart grid operation dataset in the IPFS decentralized storage system; Indicates the dataset number; Indicates the dataset name; Indicates the dataset creation time; This indicates the stored evidence information to be signed; This represents the address of the data owner (DO) in the blockchain network; This represents the timestamp indicating when the data owner uploaded the dataset and generated the evidence storage information; This shows the unsigned storage information generated by the data owner (DO). This indicates the access structure or signature auxiliary parameter corresponding to the data owner DO; This indicates the private key generated by the data owner (DO) based on their identity or distributed by a key distribution center; Indicates signature operation; This indicates the storage signature generated after the stored evidence information is signed; This indicates that the finally generated credible evidence information is used to prove that the smart grid operation dataset was uploaded by the corresponding data owner, and is used for subsequent data access, quality assessment, reward settlement and accountability.

[0035] Preferably, in step S3, the data owner formulates an access policy based on the attribute set at the time of registration, constructs an interference attribute set as an obfuscation mechanism, selects a subset of attributes from it to form an interference policy, and integrates the interference policy into the correct access policy through Boolean equivalence substitution to obtain the final access policy.

[0036] Upon receiving an access request, the smart contract calculates an access private key based on the researcher's registered attributes and selects a random number for attribute verification. After successful verification, the researcher uses their private key to obtain an encrypted access private key and determines the access expiration date. Both the encrypted access private key and the expiration date are uploaded to the blockchain.

[0037] If the researcher's access request is confirmed by the data owner, trusted storage information indicating that access has been granted is generated as evidence of the traceability of subsequent transaction information; the IPFS storage address hash of the complete dataset is sent to the researcher through a secure channel, and the researcher uses this hash to retrieve the complete dataset from the IPFS storage system.

[0038] Preferably, the access private key is calculated using the following formula:

[0039] ;

[0040] Wherein, SK represents the access private key corresponding to the accessing user, which is used to decrypt the encrypted access private key or the encrypted dataset. All are access private keys The composition parameters in; Represents the generators in a group; and This represents the master key parameter generated during the system initialization phase; This represents the random number selected by the system during the private key generation process for this access; This represents the group elements that are publicly disclosed during the system initialization phase. This represents the set of attributes of the user being accessed; Represents a set of attributes The first in One attribute; and Used for matching with attribute nodes in the access policy and for key decryption; Used for user attribute information verification.

[0041] Preferably, in step S4, the evaluation dataset is divided into multiple groups according to the specific categories that the labels need to be classified into; the label rearrangement ratio is set to 1%, 5%, 10%, 25% and 50%, and data samples from each group are extracted sequentially from each labeling ratio, and the feature values ​​of the samples from other groups are randomly exchanged to generate a new dataset.

[0042] The Spearman correlation coefficient was used as the evaluation index for correlation coefficient testing, and classification accuracy was used as the standardized performance index for performance evaluation testing.

[0043] Preferably, the Spearman correlation coefficient calculation method includes the following steps:

[0044] Assume the evaluation dataset consists of n samples, and the observed values ​​of the feature variable X and the labeled variable Y are represented as follows: and The corresponding levels are determined as follows:

[0045] ;

[0046] in, Represents the sequence of characteristic variables The grade sequence is obtained by converting according to numerical size or preset sorting rules; Represents a sequence of labeled variables The level sequence is obtained by converting according to the label level or preset sorting rules;

[0047] The Spearman correlation coefficient between features and labels is calculated as follows:

[0048] ;

[0049] in, For sample size, Indicates the first Feature variables of each sample rank and label variable The difference in rank, This represents the sum of squared rank differences for each sample;

[0050] The correlation coefficient between features and labels is calculated multiple times under different label rearrangement ratios, ensuring that the datasets used in each calculation have the same label rearrangement percentage but different arrangement orders. By generating t datasets with different arrangement orders under this specific percentage, the corresponding Spearman correlation coefficients are obtained. Calculate their average value as the final correlation coefficient:

[0051] ;

[0052] in, Representing features and labels Spearman correlation coefficient between them This represents the total number of features in the evaluation dataset that participate in the quality assessment. These features include one or more of the following: load value, voltage value, current value, power value, distributed energy output value, equipment status quantity, and fault alarm quantity.

[0053] Preferably, in step S5, all data owners have the same initial reputation value; the reputation value is determined by two factors: the data owner's historical performance before the current task and its performance in the current task; the data owner receives a corresponding reward based on its reputation value.

[0054] The present invention, by adopting the above technical solution, has the following beneficial effects:

[0055] (1) This invention applies blockchain, smart contracts and IPFS decentralized storage system to the smart grid operation data sharing process, and encrypts, blocks, stores on-chain evidence and off-chain multi-source grid data such as load data, voltage data, current data, power data, fault alarm data and dispatch instruction data, thereby realizing secure sharing and reliable traceability of smart grid data among multiple entities, and reducing the risk of data being tampered with, deleted, forged or leaked in the traditional centralized data management method.

[0056] (2) This invention uses smart contracts to verify the data access requests of researchers, and incorporates the researcher's identity attributes, business task type, data access scope and access validity period into the access control conditions. This makes the data access process correspond to smart grid business tasks such as load forecasting, fault diagnosis, anomaly detection, demand response analysis and scheduling optimization, and avoids the grid operation data being obtained by irrelevant subjects or subjects that do not meet the business requirements, thereby improving the refined management and control capabilities in the smart grid data sharing process.

[0057] (3) This invention uses a classification dataset quality assessment method based on label rearrangement to conduct correlation coefficient tests and performance evaluation tests on smart grid operation datasets. It can determine whether the dataset is suitable for tasks such as load forecasting, fault diagnosis, anomaly detection and scheduling optimization based on the correspondence between grid operation characteristics and business labels. This avoids low-quality data from directly entering the grid business model training or decision calculation process, and improves the reliability of the smart grid analysis results.

[0058] (4) This invention combines the dataset quality assessment results with reputation value and reward mechanism to incentivize data owners based on dataset quality, historical data contribution and current grid business task suitability, so that data providers on the generation side, transmission side, distribution side, consumption side and dispatch side can continuously provide high-quality data, which is conducive to forming a multi-party data collaboration and sharing mechanism and a continuous supply mechanism of high-quality data in smart grid. Attached Figure Description

[0059] Figure 1 This invention relates to a flowchart of a blockchain-based smart grid data security sharing and quality assessment method.

[0060] Figure 2 This is a schematic diagram illustrating the specific process of dataset label rearrangement involved in this invention. Detailed Implementation

[0061] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings.

[0062] Example 1: Reference Figure 1This invention provides a blockchain-based method for secure data sharing and quality assessment in smart grids. The method consists of five parts: system initialization and user registration, data acquisition and uploading, smart contracts and access control, dataset quality assessment, and a reward mechanism. In system initialization and user registration, the Key Distribution Center (KDC) initializes the system, authenticates and manages the identities of all participants (including data owners (DOs), researchers (RAs), and the quality assessment platform (DEs), distributes private and public key pairs, and generates corresponding blockchain addresses. In data acquisition and uploading, the data owner encrypts the smart grid operation dataset, including one or more types of data such as load data, voltage data, current data, power data, distributed energy output data, equipment status data, fault alarm data, and dispatch instruction data, and divides it into multiple data blocks. Each data block generates a CID (Content Identifier) ​​through hash calculation and stores it in the IPFS (InterPlanetary File System) decentralized storage system. The DO uploads the dataset's CID, IPFS address, dataset name, and creation time to the blockchain network and generates trustworthy storage information to ensure the traceability of the stored data. In smart contracts and access control, access permissions are set for datasets. Researchers (RAs) can initiate access requests to datasets provided by data owners based on specific power grid business task requirements. The system verifies the RA's access permissions and generates an access token according to the access policy set by the Data Provider (DO). The RA can then obtain the complete dataset from the IPFS storage system using the access token for subsequent power grid business model training or optimization calculations. A label-rearranged classification dataset evaluation method is provided for dataset evaluation. The quality evaluation method includes two parts: correlation coefficient testing and performance evaluation testing. The correlation coefficient test is used to evaluate the correlation strength between features and labels, while the performance evaluation test is used to evaluate the dataset's performance on machine learning models. This part can generate a quality evaluation report based on the evaluation results and feed the results back to the RA and DO. Finally, in the reward mechanism, the system assigns corresponding reputation values ​​and rewards to DOs based on the quality of the datasets they provide. The reputation value reflects the DO's performance in providing the dataset; high-quality datasets will receive higher reputation values ​​and rewards to incentivize data providers on the generation, transmission, distribution, consumption, and dispatch sides to continuously provide high-quality smart grid operation data.

[0063] The blockchain-based method for secure sharing and quality assessment of multi-party collaborative data includes the following steps:

[0064] Step 1: The key distribution center initializes itself, performs identity verification and real-name management for data owners (DO), researchers (RA), and the quality assessment platform (DE), distributes private and public key pairs, and generates corresponding blockchain addresses.

[0065] S101: The DO (Department of Operations) providing the smart grid operation dataset and the RA (Regulator) seeking to acquire the dataset must provide the following information to complete registration and obtain a unique global system identity. , specifically as formula (1):

[0066] (1)

[0067] in, This refers to a user's trusted contact information, which could be their email address, phone number, or social media account. This represents user attributes, such as RA or DO. This indicates the user's name. That's the password for access.

[0068] S102: Simultaneously, the system will generate a pseudonym for each registered user to ensure their true identity. Here, This indicates that registered users are submitting their actual identity to the system in a secure manner. And select As a hash key, calculate your own unique pseudonym identity according to equation (2). :

[0069] (2)

[0070] in, Indicated by Secure hashing of the hash key. This is the valid time interval for the pseudonym identity, and then... , Stored in the system's member list, Choose a random number It serves as its secret value and is not allowed to be tampered with by anyone.

[0071] S103: KDC is an authoritative third-party organization responsible for generating a unique private key for each legitimate participating user after completing the initialization process in the encryption algorithm. public key pair Specifically, it includes the following steps:

[0072] S1031: Let and They are two prime numbers of the same order. The group, among which It is a prime number addition group, It is a prime number The multiplication group. group with the group Mapping between and meet the following conditions:

[0073] S1032: Bilinear: For all and all , It is bilinear if the case described in equation (3) exists:

[0074]

[0075] (3)

[0076]

[0077] S1033: Non-generating: Mapping: Not All pairs in the middle are converted to The identity in them exists in the following fact: if yes A generator, then yes A generator.

[0078] S1034: Computable: for any There is a calculation Highly efficient algorithms.

[0079] S1035: When a bilinear mapping satisfies the above three properties, it is an allowable bilinear mapping. Therefore, this embodiment defines the following two secure cryptographic hash functions, including equation (4) and equation (5):

[0080] (4)

[0081] (5)

[0082] S1036: DO selects a random number And generate a private key Then calculate a public key. Generate the public / private key pair for DO. .

[0083] S1037: RA selects a random number. And generate a private key Calculate and generate the public and private key pair for RA. .

[0084] S104: Then verify whether the user's ID is valid, add its attribute information to the corresponding set, and use the public key. Assign corresponding blockchain addresses .once Participating in a specific transaction involves the transmission of information. Generate a signature to ensure the integrity and authentication of the information.

[0085] S1041: If equation (6) is true, then authentication is successful:

[0086] (6)

[0087] in, Indicates identity by pseudonym The mapped identity public parameters; Indicates the first A registered user from the identity space The secret value selected; and Indicates the relationship with the first Hash verification parameters related to the transaction messages of each registered user; Indicates the first A random number selected by each registered user during the signature process; This represents the system master key parameters generated by the key distribution center during the system initialization phase; This represents the identity verification parameters generated from the user's secret value; Indicates that it is generated by random numbers The generated signature contains random commitment parameters.

[0088] Step two, the data owner (DO) encrypts the smart grid operation dataset and divides it into multiple data blocks.

[0089] Each data block generates a content identifier through hash calculation and is stored in the IPFS decentralized storage system. DO uploads information such as the dataset's CID, IPFS address, dataset name, and creation time to the blockchain network and generates trustworthy storage information to ensure the traceability of stored data.

[0090] S201: To ensure the privacy of the dataset, a pre-determined keyword is first assigned to the uploaded dataset DS. Subsequently, H(w) is obtained through hash calculation, using the key as... Encrypted datasets generated by the AES encryption algorithm .

[0091] S202: Encrypted Dataset Data blocks of different sizes , ... Each data block generates a Content Identifier (CID) containing corresponding content information through hash calculation, as shown in equations (7) and (8):

[0092] (7)

[0093] (8)

[0094] S203: Data blocks containing CIDs are distributed and stored across various nodes in the IPFS network, while the original dataset file retains the corresponding CID information for each block. At the IPFS proxy end, an access tree is generated according to the defined access policy A. .

[0095] S204: Assumption This represents visiting nodes in the tree, starting from the root node. Begin by assigning a polynomial to each node, from top to bottom. In the process of defining a polynomial, it is assumed that... The highest number of terms is indicated; additionally, a secret number is randomly selected using an algorithm. to satisfy Then, according to the definition in equation (9), a random access tree is selected. Other nodes :

[0096] (9)

[0097] express Visit the parent node index in the tree. Then, randomly select... The coefficients of the other terms are used to construct the other polynomials for this node. The encrypted ciphertext of the dataset DS is as described in equation (10):

[0098] (10)

[0099] S205: Encrypt the storage index hash value and ciphertext of the dataset. Returned to the system. Received. Then, the system selects a random number. And calculate according to the following formula:

[0100] (11)

[0101] S206: Then, the key cipher is obtained according to the following formula. :

[0102] (12)

[0103] S207: After DO stores the dataset content in IPFS, it should return the IPFS storage address according to the following formula. Uploaded to the blockchain network:

[0104] (13)

[0105] S208: Generate trusted storage information according to equation (14) to ensure the traceability of stored data:

[0106] (14)

[0107] Step three: Researchers (RAs) initiate access requests to the smart grid operation dataset provided by the data owner (DO) based on the specific requirements of the power grid business tasks. The system verifies the RA's access permissions and generates an access token according to the access policy set by the DO. The RA then uses the access token to retrieve the complete dataset from the IPFS storage system and trains machine learning models for smart grid business operations.

[0108] S301: First, access permissions for the dataset are set. The access policy P is determined by the DO based on the attribute set used during user registration. Simultaneously, the DO constructs a set of perturbation attributes M as an obfuscation mechanism, selecting a subset of attributes from this set to form corresponding perturbation strategies. By employing Boolean equivalent substitution, the interference strategy is... Integrate into the correct access policy In the middle, thus obtaining As the final access strategy.

[0109] S302: Then, upon receiving the corresponding dataset access request, the system will calculate the corresponding access private key based on the characteristics of various user registration types. First, choose a random number. ,calculate The user's attributes have been successfully verified. Similarly, for each attribute, a corresponding random number is selected. Used to calculate the private key of the corresponding user. Reference formula (15):

[0110] (15)

[0111] Wherein, SK represents the access private key corresponding to the accessing user, which is used to decrypt the encrypted access private key or the encrypted dataset. All are access private keys The composition parameters in; Represents the generators in a group; and This represents the master key parameter generated during the system initialization phase; This represents the random number selected by the system during the private key generation process for this access; This represents the group elements that are publicly disclosed during the system initialization phase. This represents the set of attributes of the user being accessed; Represents a set of attributes The first in One attribute; and Used for matching with attribute nodes in the access policy and for key decryption; Used for user attribute information verification.

[0112] S303: Subsequently, the dataset visitor uses the key Get And determine the deadline for user access. Finally, Both the dataset and the deadline are uploaded to the blockchain. Users who initiate dataset access requests query relevant information by calling the corresponding smart contract interface on the blockchain and obtain it through pre-registration. To retrieve and decrypt The required private key.

[0113] S304: The RA initiates an access request to the dataset provided by the DO based on the specific requirements of the power grid business machine learning task, referring to formula (16):

[0114] (16)

[0115] Among them, blockchain account address This corresponds to the DO that uploaded the dataset, while This indicates the blockchain account address of the RA requesting access to the dataset. Additionally, Represents the attribute identifier of RA. This indicates the time when the researcher initiated the request to access this dataset.

[0116] S3041: It should be noted that this request also uses the private key distributed by the KDC. For those who come to sign, refer to (17):

[0117] (17)

[0118] S3042: where This is an access structure specific to the ciphertext, which forms the trusted storage information for the researcher's access to the dataset, as shown in equation (18):

[0119] (18)

[0120] S3043: Next, RA is the dataset The established trusted access information will be securely transmitted to the corresponding DO.

[0121] S305: If the RA that initiates this access request receives confirmation from the DO, then the trusted storage information indicating that the DO has granted access will be initially generated as evidence of the traceability of subsequent transaction information, see formula (19):

[0122]

[0123] (19)

[0124]

[0125] S306: Send the IPFS storage address hash of the complete dataset to RA through a secure channel to generate trusted storage information sent by the hash address, referencing formula (20):

[0126] (20)

[0127] S307: When the system receives a request for the complete dataset through the IPFS storage address, it authenticates the user's access rights, the RA obtains access rights to the dataset, and performs privacy-preserving calculations, as shown in equation (21):

[0128] (twenty one)

[0129] Step four: Design the dataset quality assessment module. First, the dataset is relabeled, then its correlation coefficient and performance evaluation are calculated, and these are used as the dataset quality assessment results.

[0130] S401: The specific process of label rearrangement is as follows: Figure 2 As shown, the evaluation dataset is divided into groups 1, 2, 3, ... n according to the specific categories that the labels need to be classified. During the evaluation process, the proportion of labels that need to be sorted is set to 1%, 5%, 10%, 25%, and 50%. Subsequently, data samples from each group are extracted sequentially from the above label proportions, and the feature values ​​of samples from other groups are randomly swapped to generate a new dataset.

[0131] S402: High-quality classification datasets should exhibit a clear correspondence between their features and labels, with a strong positive correlation indicating the effectiveness of the features in interpreting or predicting the labels. To evaluate this correspondence, the Spearman correlation coefficient is used as an evaluation metric for correlation coefficient testing.

[0132] S403: Assume the evaluation dataset consists of n samples, and the feature variables are... and labeled variables The observed values ​​are respectively expressed as and The corresponding levels are determined as shown in equation (22):

[0133] (twenty two)

[0134] S404: The Spearman correlation coefficient between features and labels is calculated using the following formula:

[0135] (twenty three)

[0136] in, For sample size, Indicates the first Feature variables of each sample rank and label variable The difference in rank, This represents the sum of squared rank differences for each sample.

[0137] S4041: Calculate the correlation coefficient between features and labels multiple times under different label rearrangement ratios, ensuring that the dataset used in each calculation has the same label rearrangement percentage, but the order of arrangement is different. This is achieved by generating [databases] at this specific percentage. For datasets with different arrangement orders, the corresponding Spearman correlation coefficients were obtained. The average value is calculated as the final correlation coefficient using the following formula:

[0138] (twenty four)

[0139] in, Representing features and labels The Spearman correlation coefficient between them.

[0140] S4042: Evaluate the percentage of label alignment for each feature in the dataset (1%, 5%, 10%, 25%, and 50%), and the correlation coefficient between the feature and the label. In high-quality datasets, label disruptions that break the inherent correspondence between features and labels can lead to reduced statistical correlation, see Equation (25):

[0141] (25)

[0142] S405: However, simply observing the change in feature correlation coefficients before and after label swapping does not lead to the conclusion that features are less correlated with labels after reordering. To address this issue, accuracy is used as a standardized performance metric for subsequent evaluation. First, the accuracy M on three classic classifiers (KNN, SVM, DT, and RF) is calculated using the original dataset as a performance coefficient. Similar to the correlation coefficient, different label reordering ratios and different rankings are used to generate... A dataset was used to test accuracy and obtain the corresponding performance coefficients. The average of these obtained performance coefficients is considered the final performance coefficient for that alignment ratio. The specific formula is as follows:

[0143] (26)

[0144] S406: Performance Specifications The results were obtained when the label replacement percentages were 1%, 5%, 10%, 25%, and 50%, respectively. For high-quality datasets with strong correlations between features and labels, it can be observed that the correlation between features and labels decreases as the label replacement rate increases. In addition, the performance metrics were comprehensively quantified, as shown in equation (27):

[0145] (27)

[0146] S407: The contribution of each feature to the model performance degradation should also be calculated. This can be achieved by assigning weights to each feature. Its related degree of degradation The products are added together to approximate the result, as shown in equation (28):

[0147] (28)

[0148] S408: If a significant decrease in correlation is observed corresponding to a large contribution of features to the decline in model performance, this suggests that the underlying cause of the decreased correlation coefficient—namely, the deterioration of dataset quality—can be attributed to the loss of alignment between features and random labels. Therefore, it can be inferred that there is a strong positive correlation between the labels and features of the original dataset, highlighting high-quality encoded correspondences.

[0149] Step 5: The system assigns a corresponding reputation score and reward to the DO based on the quality of the dataset provided. The reputation score reflects the DO's performance in providing the dataset; higher-quality datasets will receive higher reputation scores and rewards.

[0150] S501: Reputation score reflects the user's performance in completing the task. In this invention, the following evaluation criteria are provided:

[0151] S5011: Increase Reputation Value: If DO provides quality The dataset quality exceeds the system's set standards. As the number of high-quality dataset submissions increases, dataset providers will gain higher reputation scores.

[0152] S5012: Reputation Degradation: If a DO accepts a task sent by the system but uploads a dataset unrelated to the task, or the content of the dataset is suspected of being illegal, appropriate measures will be taken; if a DO repeatedly provides datasets below quality standards when requested, necessary measures will be taken; if a DO repeatedly engages in malicious pricing, providing datasets significantly higher than advertised... The price, and its account will be terminated after committing this misconduct more than 3 times.

[0153] S502: Initially, all users have equal reputation values, which are determined by two main factors: the performance of the data object (DO) before the current task and its performance in the current task. The historical reputation value of the dataset provider is represented by equation (29):

[0154] (29)

[0155] Among them, variables This represents the cumulative value of the dataset provided by DO before executing the task, while This represents the total value of all datasets in the system, and uses their ratios to quantify historical reputation values.

[0156] S503: On the other hand, Represents the reputation value of the dataset specifically used for this task, as shown in equation (30):

[0157] (30)

[0158] S504: Wherein, It is a random constant; for high-quality datasets, its value is 1, otherwise it is 0. This represents the value relevant to the current dataset. The user's reputation score for each task. The calculation method is as follows:

[0159] (31)

[0160] S504: Final reputation value is ,in For the number of evil deeds, This represents the ratio of the two parts. Data providers can receive rewards based on their reputation scores to incentivize them to continuously provide high-quality datasets, ultimately achieving secure data sharing.

[0161] Through the aforementioned reputation score calculation method, the system can simultaneously consider the data provider's historical contributions and current task performance. For data providers who consistently provide high-quality smart grid operation datasets over a long period, their historical reputation score and current task reputation score can jointly improve their final reputation score, thereby increasing their reward level. For data providers who upload low-quality datasets or engage in malicious behavior, the index term will decrease the overall reputation score as the number of malicious behaviors (t) increases, leading to a decline in their credibility level and reward level in subsequent data sharing tasks. Therefore, the system can prevent low-quality data, irrelevant data, and malicious pricing behavior from entering the smart grid data sharing process, encouraging data providers on the generation, transmission, distribution, consumption, and dispatch sides to continuously provide high-quality datasets, thereby improving the data foundation reliability of power grid business models such as load forecasting, fault diagnosis, anomaly detection, and dispatch optimization.

[0162] The program code used to implement the methods of this application may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0163] The specific implementation schemes described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific implementation schemes of the present invention and are not intended to limit the scope of the present invention. Any equivalent changes and modifications made by those skilled in the art without departing from the concept and principles of the present invention should fall within the scope of protection of the present invention.

Claims

1. A method for secure data sharing and quality assessment in smart grids based on blockchain, characterized in that, Includes the following steps: S1. The key distribution center initializes itself, authenticates data owners, researchers, and quality assessment platforms participating in smart grid data sharing, distributes private and public key pairs, and generates corresponding blockchain addresses. S2. The data owner collects and integrates the smart grid operation dataset, encrypts the dataset and divides it into multiple data blocks. Each data block generates a content identifier through hash calculation and is then stored in the IPFS decentralized storage system. The data owner uploads the IPFS storage address, dataset name, and creation time of the dataset to the blockchain network to generate trustworthy storage information; S3. Access permissions for the dataset are set through a smart contract. Researchers initiate access requests to the dataset uploaded by the data owner according to the task requirements. After verifying the researcher's access permissions, the smart contract generates an access token. The researcher then uses the access token to retrieve the complete dataset from the IPFS storage system. S4. A classification dataset evaluation method based on label rearrangement is adopted. The labels include one or more of the following: load status label, fault type label, abnormal event label, equipment operating status label, and scheduling response result label. The dataset quality is evaluated by combining correlation coefficient test and performance evaluation test, a quality report is generated, and the evaluation results are fed back to the data owner and researchers. S5. Assign reputation values ​​and rewards to data providers based on dataset quality to incentivize the provision of high-quality datasets.

2. The method according to claim 1, characterized in that, In step S1, the data of the dataset is provided. The owner and researchers who intend to access the dataset must provide the following information to complete registration and obtain a unique global identity within the system: ; in, This refers to a user's trusted contact information, including email address, phone number, and social media accounts; This indicates user attributes, such as data owner, researcher, This indicates the user's name. It is the password for access; at the same time, a pseudonym is generated for each registered user. This indicates that registered users are submitting their actual identity to the system in a secure manner. And select As a hash key, it is used to calculate a unique pseudonym identity. : ; in, Indicated by Secure hashing of the hash key. This is the valid time interval for the pseudonym identity. , Stored in a member list, Choose a random number It is its secret value and cannot be tampered with by anyone; After the encryption algorithm is initialized, the key distribution center generates a unique private key for each legitimate data owner, researcher, and quality assessment platform. public key pair After verifying the identity, the key distribution center adds the attribute information to the corresponding set and uses the public key. Assign corresponding blockchain addresses Once the data owner or researcher participates in a specific transaction, the information is transferred. Generate a signature for authentication.

3. The method according to claim 1, characterized in that, Step S2 specifically includes the following steps: Assign a preset keyword to the uploaded dataset, obtain the hash value of the keyword through hash calculation, and encrypt the dataset using the AES encryption algorithm with the hash value as the key to generate an encrypted dataset; The encrypted dataset is divided into multiple data blocks of different sizes. Each data block is hashed to generate a content identifier containing corresponding content information. The data blocks containing the content identifiers are distributed and stored on various nodes in the IPFS network, while the original dataset file retains the corresponding content identifier information of each data block. On the IPFS proxy side, an access tree is generated according to the defined access policy. After returning the storage index hash value and ciphertext of the encrypted dataset, the data owner selects a random number to calculate and obtain the key password. The data owner uploads the storage address, dataset number, dataset name, and creation time of the dataset in IPFS to the blockchain network, and generates the trusted evidence information through hash calculation.

4. The method according to claim 3, characterized in that, The generation of the encrypted dataset specifically includes the following steps: The storage index hash value and ciphertext of the encrypted dataset After returning, select a random number. And perform the following calculations: ; in, and This represents the publicly available group elements selected during the system initialization phase; All are key ciphertext The composition parameters in; and Indicates the initial ciphertext The parameters that make up the ciphertext; This indicates accessing the secret value corresponding to the polynomial at the root node of the tree. and This indicates the system's default security hash function; and This represents the master key parameter generated during the system initialization phase; This refers to a symmetric key or session key used to protect access to smart grid operation datasets; The key password is obtained according to the following formula. : ; in, Represents public parameters related to access policies; This represents the access tree generated according to the access policy; Represents a visit tree Attribute nodes in; Represents attribute nodes The corresponding polynomial takes values ​​at zeros; and Represents access to tree attribute nodes The corresponding ciphertext composition parameters.

5. The method according to claim 3, characterized in that, The trusted evidence information is calculated according to the following formula: ; ; in, This represents the on-chain registration information of the smart grid operation dataset; This indicates the storage address of the smart grid operation dataset in the IPFS decentralized storage system; Indicates the dataset number; Indicates the dataset name; Indicates the dataset creation time; This indicates the stored evidence information to be signed; This represents the address of the data owner (DO) in the blockchain network; This represents the timestamp indicating when the data owner uploaded the dataset and generated the evidence storage information; This shows the unsigned storage information generated by the data owner (DO). This indicates the access structure or signature auxiliary parameter corresponding to the data owner DO; This indicates the private key generated by the data owner (DO) based on their identity or distributed by a key distribution center; Indicates signature operation; This indicates the storage signature generated after the stored evidence information is signed; This indicates that the finally generated credible evidence information is used to prove that the smart grid operation dataset was uploaded by the corresponding data owner, and is used for subsequent data access, quality assessment, reward settlement and accountability.

6. The method according to claim 1, characterized in that, In step S3, the data owner formulates an access policy based on the attribute set at the time of registration, constructs a set of interfering attributes as an obfuscation mechanism, selects a subset of attributes from the set to form an interfering policy, and integrates the interfering policy into the correct access policy through Boolean equivalence substitution to obtain the final access policy. Upon receiving an access request, the smart contract calculates the access private key based on the attributes registered by the researcher and selects a random number for attribute verification. After successful verification, the researcher uses their private key to obtain an encrypted access private key and determines the access expiration date; both the encrypted access private key and the expiration date are uploaded to the blockchain. If the researcher's access request is confirmed by the data owner, trusted storage information indicating that access has been granted is generated as evidence of the traceability of subsequent transaction information. The IPFS storage address hash of the complete dataset is sent to the researchers via a secure channel, and the researchers use this hash to retrieve the complete dataset from the IPFS storage system.

7. The method according to claim 6, characterized in that, The access private key is calculated using the following formula: ; Wherein, SK represents the access private key corresponding to the accessing user, which is used to decrypt the encrypted access private key or the encrypted dataset. All are access private keys The composition parameters in; Represents the generators in a group; and This represents the master key parameter generated during the system initialization phase; This represents the random number selected by the system during the private key generation process for this access; This represents the group elements that are publicly disclosed during the system initialization phase. This represents the set of attributes of the user being accessed; Represents a set of attributes The first in One attribute; and Used for matching with attribute nodes in the access policy and for key decryption; Used for user attribute information verification.

8. The method according to claim 1, characterized in that, In step S4, the evaluation dataset is divided into multiple groups according to the specific categories that the labels need to be classified into; the label rearrangement ratio is set to 1%, 5%, 10%, 25% and 50%, and data samples from each group are extracted sequentially from each labeling ratio, and the feature values ​​of the samples from other groups are randomly exchanged to generate a new dataset. The Spearman correlation coefficient was used as the evaluation index for correlation coefficient testing, and classification accuracy was used as the standardized performance index for performance evaluation testing.

9. The method according to claim 8, characterized in that, The Spearman correlation coefficient calculation method includes the following steps: Assume the evaluation dataset consists of n samples, and the observed values ​​of the feature variable X and the labeled variable Y are represented as follows: and The corresponding levels are determined as follows: ; in, Represents the sequence of characteristic variables The grade sequence is obtained by converting according to numerical size or preset sorting rules; Represents a sequence of labeled variables The level sequence is obtained by converting according to the label level or preset sorting rules; The Spearman correlation coefficient between features and labels is calculated as follows: ; in, For sample size, Indicates the first Feature variables of each sample rank and label variable The difference in rank, This represents the sum of squared rank differences for each sample; The correlation coefficient between features and labels is calculated multiple times under different label rearrangement ratios, ensuring that the datasets used in each calculation have the same label rearrangement percentage but different arrangement orders. By generating t datasets with different arrangement orders under this specific percentage, the corresponding Spearman correlation coefficients are obtained. Calculate their average value as the final correlation coefficient: ; in, Representing features and labels Spearman correlation coefficient between them This represents the total number of features in the evaluation dataset that participate in the quality assessment. These features include one or more of the following: load value, voltage value, current value, power value, distributed energy output value, equipment status quantity, and fault alarm quantity.

10. The method according to claim 1, characterized in that, In step S5, all data owners have the same initial reputation value; the reputation value is determined by two factors: the data owner's historical performance before the current task and its performance in the current task; the data owner receives a corresponding reward based on its reputation value.