Energy data trusted sharing method based on multi-block chain cooperation and improved consensus

By adopting multi-blockchain collaboration and improved consensus methods in energy data sharing, the problem of lack of access control and traceability in traditional energy data sharing is solved, and an efficient and secure data sharing environment is achieved.

CN119783064APending Publication Date: 2025-04-08ECONOMIC TECH RES INST OF STATE GRID HENAN ELECTRIC POWER
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202411861068.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

The lack of full-process access control in the traditional energy data sharing process leads to data abuse and confusion, and it is difficult to trace data theft.

Method used

We adopt a trusted and trusted energy data sharing method based on multi-blockchain collaboration and improved consensus, and through steps such as data chaining, fingerprint generation, data flow sharing, POBT+ consensus, data flow evidence storage, abnormal behavior identification and data flow traceability, a distributed trusted prevention and control environment is built to achieve flexible fine-grained access control and accountability for data abuse.

Benefits of technology

It improves the security environment during data sharing, realizes flexible and revocable fine-grained access control, completes accurate accountability for data overprivileges, and ensures efficient and secure in energy data sharing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119783064A_ABST
    Figure CN119783064A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of lightning arrester disassembly and assembly, and particularly relates to an energy data trusted sharing method based on multi-block chain cooperation and improved consensus. Comprising the following steps: S1, finishing on-chain and off-chain distributed storage of data in combination with an interstellar file system and a block Hash; s2, generating publishable data fingerprints by combining the smart contract and row data; s3, performing data flow sharing based on the publishable energy data of the block chain; s4, performing a consensus based on POBT +; s5, finishing the uplink evidence storage of the data circulation process by combining the smart contract; s6, carrying out abnormal behavior identification; s7, data circulation tracing is carried out; through the steps, access control and abuse responsibility investigation are realized in combination with attribute encryption and digital fingerprint technologies, construction of a security environment in the data sharing process is greatly improved, flexible and revocable fine-grained access control is realized, accurate responsibility investigation of unauthorized use of data is completed, and high efficiency and security in the energy data sharing process are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of trusted sharing of energy data, and specifically relates to a trusted sharing method of energy data based on multi-blockchain collaboration and improved consensus. Background Art

[0002] In the process of traditional energy data sharing, there is a lack of full-process access control for data, which leads to data abuse and confusion of ownership. At the same time, the tracing of data theft due to the lack of effective monitoring and evidence storage means also makes it difficult to prohibit current data abuse. Data access control, as a security measure, aims to ensure that only authorized users or entities can access specific data resources. Traditional access control is implemented based on a centralized architecture, including identity-based and encryption-based access control. These methods are difficult to adapt to the new challenges brought by the era of data elements due to their lack of fairness, efficiency and credibility. Traditional autonomous access control and identity-based access control rely on creating access control lists for everyone on the system, while mandatory access control is usually enforced by central administrators, which cannot ensure the credibility of the center and the problem of efficient data exchange. At the same time, traditional access control can only ensure security before prevention and control, and it is difficult to control the operation of users after obtaining the data. Therefore, finding an efficient and secure energy data sharing method suitable for the scenario of the arrival of the data element era to protect user privacy, realize flexible and fine-grained access control, give full play to data value and ensure data security is an urgent problem to be solved in the current research field. Summary of the invention

[0003] The purpose of the present invention is to overcome the shortcomings of the prior art and to provide a trusted energy data sharing method based on multi-blockchain collaboration and improved consensus, to improve the construction of a secure environment during data sharing, to achieve flexible and revocable fine-grained access control, to complete precise accountability for unauthorized use of data, and to ensure high efficiency and security in the energy data sharing process.

[0004] The purpose of the present invention is achieved by: a trusted energy data sharing method based on multi-blockchain collaboration and improved consensus, comprising the following steps:

[0005] S1. Upload data to the blockchain and combine the Interstellar File System and block hash to complete the distributed storage of data on and off the blockchain;

[0006] S2. Generate data fingerprints by combining smart contracts with row data to complete the generation of publishable data fingerprints;

[0007] S3. Energy data can be published based on blockchain for data circulation and sharing;

[0008] S4. Conduct consensus based on POBT+;

[0009] S5. Data transfer and evidence storage, by combining smart contracts to complete the on-chain evidence storage of the data transfer process;

[0010] S6. Identify abnormal behaviors;

[0011] S7. Trace data flow.

[0012] Furthermore, the step S1 includes:

[0013] (1) User registration and login: When registering, the user submits the user registration information. After successful authentication, the system uses the elliptic curve encryption algorithm to generate a public key, a private key and a user account for the user. The user identity information and the public and private key pair are uniquely bound, and the public and private key pair are uniquely bound to the user account. The user login is authenticated by the user account and password.

[0014] (2) Data upload: After the user successfully registers / logs in, the cultural resource file is uploaded through the resource upload module. The system saves the data resource file to the distributed file system IPFS and generates the storage address of the corresponding index link data;

[0015] (3) Data similarity comparison: Use a similarity comparison algorithm to compare the uploaded data file with the copyrighted data in the system. If the similarity is less than the threshold, the upload is allowed. Otherwise, the upload is rejected unless proof of copyright transfer can be provided.

[0016] (4) Data credibility verification: In order to ensure the authenticity and legality of the data, the language machine mechanism is used to complete the data legality and credibility authentication; for example, to obtain web data, it is necessary to hold a data source certificate; the data exchange process between the execution engine, users, external data sources and the language machine, unify or clearly distinguish the data interaction process for different data source types;

[0017] (5) Hash generation: After the file storage is completed, the SHA-256 algorithm is used to generate a resource content hash for the resource file. The resource-related information including the resource name, resource hash, timestamp, etc. is uploaded to the blockchain through the upload contract and synchronized to all nodes in the blockchain. The PBFT and other consensus algorithms are used to complete the verification and situation generation work.

[0018] (6) Encrypted storage: Use IPFS to store data. When uploading to IPFS nodes for storage, the nodes organize and store the files in blocks in the format of a Merkle directed acyclic graph. After storage, the file is represented by the root hash function of the Merkle directed acyclic graph. Users obtain files from the IPFS network in the form of DHT.

[0019] (7) Generate a certificate; Combine the verification results, user ID, time, HASH and other key information using the certificate contract to complete the generation of the copyright certificate. After the generation is completed, the certificate is verified by consensus on the chain and stored after verification.

[0020] Furthermore, the step S2 includes:

[0021] (1) Watermark embedding parameter selection

[0022] In the process of watermark grouping parameters, the GASA algorithm is first applied to obtain the key KS that is most suitable for database grouping. Then, some text data attribute columns in the database are selected (must be non-empty) to generate the primary key PK based on these text data. There are many methods to choose from for specific operations. Here, the text data is converted into hexadecimal and repeated until a primary key value of uniform length is generated. The length can be determined by the user, but it is necessary to ensure that the length of the primary key meets the guarantee condition of non-repetition. When extracting database watermarks, the primary key can be determined by determining which attribute columns and the generation method. The primary key will not be transmitted during the transmission process, saving storage space. At the same time, it avoids the problem that the watermark cannot be restored and cannot be confirmed due to malicious deletion of the primary key. Then, the key is applied to group the data in the database as follows;

[0023] n u =H(Ks|H(Ks|t u PK))modNg

[0024] Where n: in the context of a database, represents a unique identifier or data item associated with user u, such as a user ID or a hash value of a data record;

[0025] H: represents a hash function, which is used to generate the hash value of a data item to ensure the integrity and fast retrieval of the data;

[0026] Ks: represents a key or key seed, which is used to encrypt or sign sensitive data in the database;

[0027] t u : represents a timestamp or transaction ID associated with user u, used to record the creation or update time of the data item;

[0028] PK: stands for a public key, which is used to verify the origin or integrity of data in a multi-user environment;

[0029] Ng: represents a modulus, which is used to implement modular operations in the database, which may be used in some encryption algorithms or data grouping strategies;

[0030] After the grouping is completed, watermark generation is performed, including:

[0031] Loop through all groups to determine the embedded attribute column of the data watermark; combine the maximum value max[i] and the minimum value min[i] in the data to calculate the predicted value using the following formula:

[0032]

[0033] Calculate the prediction error (actual value v) to build a histogram,

[0034]

[0035] Calculate the new prediction error, combine the errors, complete the generation of the watermark attribute value, and then generate the result v' e , complete watermark embedding;

[0036]

[0037] (2) Watermark text addition and extraction

[0038] 1) Synonym identification: traverse the text and retrieve the prepared synonym database, if the word is MFS or SMFS, identify it as a synonym;

[0039] 2) Binary quantization: quantize the identified synonyms into binary sequences; if there are synonyms, obtain an n-bit synonym sequence Q;

[0040] 3) Compression: Q is compressed into a shorter m-bit binary sequence Q' by using adaptive binary arithmetic coding; thereby obtaining some redundant space to accommodate additional watermark information;

[0041] 4) Binarization of watermark information: The watermark information is converted into a binary sequence according to the ASCII value of its characters;

[0042] 5) Additional information estimation: In order to distinguish the compressed synonym sequence Q' from the watermark information M, when they are concatenated together and embedded into the text, their length is recorded and sent to the receiver;

[0043] 6) Embedded information generation: the additional information is connected in series with Q' and the watermark information M to form a complete embedded information S;

[0044] 7) Compare: Compare the embedded information S with the original synonym sequence Q to find mismatched values ​​at certain corresponding positions;

[0045] 8) Synonym replacement; for unmatched positions, the original synonym will be replaced by its synonym whose encoding value is equal to the embedded information bit; no replacement will be done for matching positions; when all embedded information bits are embedded, the watermarked text generation is complete; the watermarked text will be sent to the receiver, who can extract the watermark information and restore the original cover text without any distortion;

[0046] (3) Watermark tampering verification

[0047] In order to prevent malicious users from tampering with the watermark, when the system finds similar data, it will perform tampering detection based on the watermark information stored on the chain. That is, it will use the watermark generation algorithm and the relevant primary key to check whether the watermark of the data has been tampered with, determine the tampering location, and perform a chain comparison to ensure the security and uniqueness of the data.

[0048] Furthermore, the step S3 includes:

[0049] (1) Public chain sharing request: First, all data uploaded are stored on the public chain; users can only make data sharing requests on the chain after completing identity verification; when a user initiates a sharing request, the sharing contract will first query the penalty block to find out whether the user has malicious behavior in sharing; if not, the contract selects the owner of the data that the user requests to share and the mortgage certificate to initiate a message for sharing; when the data owner agrees to share, the requesting user and the sharing user are sent to the private chain sharing contract for sharing;

[0050] (2) Establishment of shared private chain: When calling a private contract for sharing, first query the user address to establish a link, and then call the script of the hyperledger to establish the private chain; there are only nodes of the two parties and the regulatory agency, which prevents other users from understanding user data information and realizes secure data sharing;

[0051] (3) Exchange certificates and store them on the chain; when the owner agrees to the applicant's request, the exchange contract automatically completes the data copyright transfer and sends the data storage address, password and other information to the applicant; at the same time, the transaction user's flow time, data hash, transaction hash, etc. are generated into a certificate and stored on the chain;

[0052] (4) After the evidence is stored, the exchange is completed and the certificate is automatically generated; when the exchange certificate is stored, the applicant obtains the corresponding copyright certificate, and the exchange contract generates a certificate based on information such as the data owner, transfer time, transfer authority, etc., and stores it on the blockchain;

[0053] (5) Access control, attribute encryption process; In order to achieve data access control, a revocable flexible access control method is used to ensure the security of shared data. Access is authorized based on the user who has obtained sharing permissions, including system initialization, attribute private key generation, encryption, pre-decryption, and decryption.

[0054] Further, the step S4 includes:

[0055] (1) Initialize reputation: Calculate the initial reputation value for each node based on its historical behavior and asset collateral and the votes of the master nodes in the previous round;

[0056] (2) Select the master node: select the node with the highest reputation as the master node based on the node reputation value;

[0057] (3) Select consensus nodes: Combine the master node votes and node historical performance to select the set of nodes that participate in the consensus;

[0058] (4) Consensus execution: The master node coordinates the consensus process, the consensus node sends consensus information to the master node, and the master node verifies the transaction and reaches consensus;

[0059] (5) Update reputation: After consensus is reached, the reputation value is updated based on the node performance, including the consensus completion time and weight;

[0060] (6) Dynamic adjustment: adjust the role of nodes in the consensus according to changes in reputation.

[0061] Furthermore, the step S5 comprises:

[0062] (1) During each transfer process, key information such as the user, time, transfer certificate, data watermark, time, etc. are stored on the chain;

[0063] (2) During the circulation process, a new digital watermark related to the new circulation user is generated each time; at the same time, the circulation evidence contract combines the generated data watermark identification and extraction method to store it on the chain for verification;

[0064] (3) During the transfer process, the transfer contract notifies the user who has the data authority to prevent the data from being abused, and stores the original data file, fingerprint, user, and transfer certificate on the chain.

[0065] Further, the step S6 includes:

[0066] (1) Local training encryption phase: Feldman’s Verifiable Secret Sharing (VSS) scheme is an improved mechanism based on Shamir’s secret sharing combined with a homomorphic encryption scheme. It allows participants to verify whether the secret shares they receive are correct. First, the local models are trained using local data, and after the training is completed, they are encrypted and distributed, including:

[0067] 1) Encryption parameter setting

[0068] Let p be a large prime number, q be a large prime factor of p-1, g belong to Zp* and be an element of order q, (p,q,g) is publicly known; n is the number of participants, t is the threshold value, and s is the key to be shared;

[0069] 2) Secret distribution stage

[0070] The distributor selects a polynomial a(x)=a with a maximum degree of k-1 0 +a 1 x 1 +a 2 x 2 +…+a k-1 x k-1 , where a 0 represents the key s, which refers to the encrypted local parameter;

[0071] Calculate commitment c 0 =g a0 ,c 1 =g a1 ,…,c k-1 =g ak-1 , the above operations are based on modulo p; distribute commitments and secret shares, and commit c i and secret share s i Sent to participant P i ;

[0072] (2) Server local aggregation verification phase.

[0073] When the i-th aggregation server receives the data share v, it performs the following verification:

[0074]

[0075] When the verification is completed, the smart contract is called to verify the correctness of the model training consensus;

[0076] (3) After the model verification is completed, a federal abnormal behavior detection model is generated to identify abnormal behavior, and the identification results are automatically stored on the chain by calling the smart contract.

[0077] Furthermore, the step S7 includes:

[0078] (1) Subject crawler monitoring: By setting the subject words of the data, the blockchain calls the monitoring smart contract and uses the subject crawler technology to crawl data in real time from key areas where data may be leaked, and compares the crawled data with the data content, permissions, and owners stored in the system;

[0079] (2) Anomaly comparison: The crawled data is constructed into a data monitoring vector, and the outlier anomaly monitoring method combining multi-dimensional features is used for analysis and monitoring. When the monitored data is found to be outlier data, it is stored as evidence. The crawled data anomaly information, time, data fingerprint identification, abnormal behavior URL and other information are stored on the chain using the evidence storage contract, and verified using the consensus mechanism.

[0080] (3) Accountability of the subject: When the system detects abnormal risks, it will hold the subject accountable.

[0081] Beneficial effects of the invention: The energy data trusted sharing method based on multi-blockchain collaboration and improved consensus of the invention comprises the steps of S1, uploading data to the chain, combining the interplanetary file system and block Hash to complete the distributed storage of data on and off the chain; S2, generating data fingerprints, and completing the generation of publishable data fingerprints by combining smart contracts with row data; S3, sharing data flow based on the publishable energy data of the blockchain; S4, performing consensus based on POBT+; S5, storing data flow, and completing the chain storage of the data flow process by combining smart contracts; S6, identifying abnormal behavior; S7, tracing data flow; through the above steps, the energy data trusted sharing method based on multi-blockchain collaboration and improved consensus of the invention builds a distributed trusted prevention and control environment based on blockchain technology, combines attribute encryption and digital fingerprint technology to realize access control and abuse accountability, greatly improves the construction of a secure environment in the process of data sharing, realizes flexible and revocable fine-grained access control, completes the precise accountability for unauthorized use of data, and ensures high efficiency and security in the process of energy data sharing. BRIEF DESCRIPTION OF THE DRAWINGS

[0082] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0083] Figure 1 The figure is a flowchart of a trusted energy data sharing method based on multi-blockchain collaboration and improved consensus. DETAILED DESCRIPTION

[0084] The present invention will be further described below in conjunction with the accompanying drawings.

[0085] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0086] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0087] The energy data trusted sharing method based on multi-blockchain collaboration and improved consensus of the present invention comprises the following steps:

[0088] S1. Upload data to the blockchain and combine the Interstellar File System and block hash to complete the distributed storage of data on and off the blockchain;

[0089] S2. Generate data fingerprints by combining smart contracts with row data to complete the generation of publishable data fingerprints;

[0090] S3. Energy data can be published based on blockchain for data circulation and sharing;

[0091] S4. Conduct consensus based on POBT+;

[0092] S5. Data transfer and evidence storage, by combining smart contracts to complete the on-chain evidence storage of the data transfer process;

[0093] S6. Identify abnormal behaviors;

[0094] S7. Trace data flow.

[0095] Furthermore, the step S1 includes:

[0096] (1) User registration and login: When registering, the user submits the user registration information. After successful authentication, the system uses the elliptic curve encryption algorithm to generate a public key, a private key and a user account for the user. The user identity information and the public and private key pair are uniquely bound, and the public and private key pair are uniquely bound to the user account. The user login is authenticated by the user account and password.

[0097] (2) Data upload: After the user successfully registers / logs in, the cultural resource file is uploaded through the resource upload module. The system saves the data resource file to the distributed file system IPFS and generates the storage address of the corresponding index link data;

[0098] (3) Data similarity comparison: Use a similarity comparison algorithm to compare the uploaded data file with the copyrighted data in the system. If the similarity is less than the threshold, the upload is allowed. Otherwise, the upload is rejected unless proof of copyright transfer can be provided.

[0099] (4) Data credibility verification: In order to ensure the authenticity and legality of the data, the language machine mechanism is used to complete the data legality and credibility authentication; for example, to obtain web data, it is necessary to hold a data source certificate; the data exchange process between the execution engine, users, external data sources and the language machine, unify or clearly distinguish the data interaction process for different data source types;

[0100] (5) Hash generation: After the file storage is completed, the SHA-256 algorithm is used to generate a resource content hash for the resource file. The resource-related information including the resource name, resource hash, timestamp, etc. is uploaded to the blockchain through the upload contract and synchronized to all nodes in the blockchain. The PBFT and other consensus algorithms are used to complete the verification and situation generation work.

[0101] (6) Encrypted storage: Use IPFS to store data. When uploading to IPFS nodes for storage, the nodes organize and store the files in blocks in the format of a Merkle directed acyclic graph. After storage, the file is represented by the root hash function of the Merkle directed acyclic graph. Users obtain files from the IPFS network in the form of DHT.

[0102] (7) Generate a certificate; Combine the verification results, user ID, time, HASH and other key information using the certificate contract to complete the generation of the copyright certificate. After the generation is completed, the certificate is verified by consensus on the chain and stored after verification.

[0103] Furthermore, the step S2 includes:

[0104] (1) Watermark embedding parameter selection

[0105] In order to obtain more accurate and efficient watermark data, it is necessary to select the best embedding position for watermark generation; similar to the overall operation of the genetic algorithm, the genetic simulated annealing algorithm also starts the search process for the global optimal solution from a set of randomly generated initial solutions (initial population). First, a new group of individuals is generated through genetic operations such as selection, crossover, and mutation. Then, each resulting individual is independently simulated annealed, and its results are used as individuals in the next generation population; the process is iterated repeatedly until the conditions are met; the following is a description of the process of the simulated annealing algorithm.

[0106] 1. Initialize the number of iterations (t=0).

[0107] 2. Generate an initial population (P(t)), where the population may refer to a set of possible private key candidates.

[0108] 3. Evaluate the fitness of the initial population (P(t)). The fitness function is used to evaluate the quality of each individual (private key candidate).

[0109] 4. Perform a crossover operation to generate a new population (P'(t)). The crossover operation simulates the mating process in biological genetics and produces new individuals by combining certain characteristics of two or more individuals.

[0110] 5. Perform mutation operation on (P'(t)) to generate (P)(t)). Mutation operation increases the diversity of the population by randomly changing certain characteristics of individuals.

[0111] 6. Apply the simulated annealing algorithm to (P)(t)) to generate (P”’(t)). Simulated annealing is a probabilistic algorithm used to accept or reject new states at a given temperature to avoid falling into a local optimal solution.

[0112] 7. Evaluate the fitness of (P”’(t)).

[0113] 8. Generate the next generation population (P(t+1)) through operations such as selection, crossover and mutation. This is achieved by combining the current population (P(t)) and the population \(P"'(t)\) processed by simulated annealing.

[0114] 9. Check whether (P(t+1)) meets the end condition, which may be reaching a certain fitness threshold or completing the maximum number of iterations.

[0115] 10. If (P(t+1)) satisfies the conditions, output the optimal private key (K_s) in P(t+1)).

[0116] 11. If (P(t+1)) does not meet the conditions, jump back to step 4 above and continue the iterative process.

[0117] In the process of watermark grouping parameters, the GASA algorithm is first applied to obtain the key KS that is most suitable for database grouping. Then, some text data attribute columns in the database are selected (must be non-empty) to generate the primary key PK based on these text data. There are many methods to choose from for specific operations. Here, the text data is converted into hexadecimal and repeated until a primary key value of uniform length is generated. The length can be determined by the user, but it is necessary to ensure that the length of the primary key meets the guarantee condition of non-repetition. When extracting database watermarks, the primary key can be determined by determining which attribute columns and the generation method. The primary key will not be transmitted during the transmission process, saving storage space. At the same time, it avoids the problem that the watermark cannot be restored and cannot be confirmed due to malicious deletion of the primary key. Then, the key is applied to group the data in the database as follows;

[0118] n u =H(Ks|H(Ks|t u PK))modNg

[0119] Where n: in the context of a database, represents a unique identifier or data item associated with user u, such as a user ID or a hash value of a data record;

[0120] H: represents a hash function, which is used to generate the hash value of a data item to ensure the integrity and fast retrieval of the data;

[0121] Ks: represents a key or key seed, which is used to encrypt or sign sensitive data in the database;

[0122] t u : represents a timestamp or transaction ID associated with user u, used to record the creation or update time of the data item;

[0123] PK: stands for a public key, which is used to verify the origin or integrity of data in a multi-user environment;

[0124] Ng: represents a modulus, which is used to implement modular operations in the database, which may be used in some encryption algorithms or data grouping strategies;

[0125] After the grouping is completed, watermark generation is performed, including:

[0126] Loop through all groups to determine the embedded attribute column of the data watermark; combine the maximum value max[i] and the minimum value min[i] in the data to calculate the predicted value using the following formula:

[0127]

[0128] Calculate the prediction error (actual value v) to build a histogram,

[0129]

[0130] Calculate the new prediction error, combine the errors, complete the generation of the watermark attribute value, and then generate the result v' e , complete watermark embedding;

[0131]

[0132] (2) Watermark text addition and extraction

[0133] 1) Synonym identification: traverse the text and retrieve the prepared synonym database, if the word is MFS or SMFS, identify it as a synonym;

[0134] 2) Binary quantization: quantize the identified synonyms into binary sequences; if there are synonyms, obtain an n-bit synonym sequence Q;

[0135] 3) Compression: Q is compressed into a shorter m-bit binary sequence Q' by using adaptive binary arithmetic coding; thereby obtaining some redundant space to accommodate additional watermark information;

[0136] 4) Binarization of watermark information: The watermark information is converted into a binary sequence according to the ASCII value of its characters;

[0137] 5) Additional information estimation: In order to distinguish the compressed synonym sequence Q' from the watermark information M, when they are concatenated together and embedded into the text, their length is recorded and sent to the receiver;

[0138] 6) Embedded information generation: the additional information is connected in series with Q' and the watermark information M to form a complete embedded information S;

[0139] 7) Compare: Compare the embedded information S with the original synonym sequence Q to find mismatched values ​​at certain corresponding positions;

[0140] 8) Synonym replacement; for unmatched positions, the original synonym will be replaced by its synonym whose encoding value is equal to the embedded information bit; no replacement will be done for matching positions; when all embedded information bits are embedded, the watermarked text generation is complete; the watermarked text will be sent to the receiver, who can extract the watermark information and restore the original cover text without any distortion;

[0141] (3) Watermark tampering verification

[0142] In order to prevent malicious users from tampering with the watermark, when the system finds similar data, it will perform tampering detection based on the watermark information stored on the chain. That is, it will use the watermark generation algorithm and the relevant primary key to check whether the watermark of the data has been tampered with, determine the tampering location, and perform a chain comparison to ensure the security and uniqueness of the data.

[0143] Furthermore, the step S3 includes:

[0144] (1) Public chain sharing request: First, all data uploaded are stored on the public chain; users can only make data sharing requests on the chain after completing identity verification; when a user initiates a sharing request, the sharing contract will first query the penalty block to find out whether the user has malicious behavior in sharing; if not, the contract selects the owner of the data that the user requests to share and the mortgage certificate to initiate a message for sharing; when the data owner agrees to share, the requesting user and the sharing user are sent to the private chain sharing contract for sharing;

[0145] (2) Establishment of shared private chain: When calling a private contract for sharing, first query the user address to establish a link, and then call the script of the hyperledger to establish the private chain; there are only nodes of the two parties and the regulatory agency, which prevents other users from understanding user data information and realizes secure data sharing;

[0146] (3) Exchange certificates and store them on the chain; when the owner agrees to the applicant's request, the exchange contract automatically completes the data copyright transfer and sends the data storage address, password and other information to the applicant; at the same time, the transaction user's flow time, data hash, transaction hash, etc. are generated into a certificate and stored on the chain;

[0147] (4) After the evidence is stored, the exchange is completed and the certificate is automatically generated; when the exchange certificate is stored, the applicant obtains the corresponding copyright certificate, and the exchange contract generates a certificate based on information such as the data owner, transfer time, transfer authority, etc., and stores it on the blockchain;

[0148] (5) Access control, attribute encryption process: In order to achieve data access control, a revocable flexible access control method is used to ensure the security of shared data. Access is authorized according to the user who obtains the sharing permission. It includes five components: system initialization, attribute private key generation, encryption, pre-decryption, and decryption. The details are as follows:

[0149] 1) System initialization algorithm: Setup(λ)→(PK, msk);

[0150] Input the security parameter λ and run the initialization function to get the system parameters (p, G, H, GT, e, g, h); where G, H, G, T are all groups with prime order p, g and h are the generators of G and H respectively, and GT is a bilinear mapping;

[0151] Initialization: (SP Q ,MK Q )←Setup(I λ );

[0152] Based on the incoming security parameter I λ , generate a public key MKQ according to the user's predefined access control policy, and assign the corresponding attribute S according to the server state; according to the selected parameters a1, a2, b1, b2∈ZP, generate the system's encryption master private key: MKQ=(g, h, b1, b2, gd1, gd2);

[0153] 2) Generate attribute private key algorithm: SK Q ←KeyGen(MK Q ,S uid ).

[0154] According to the attribute set Suid that the system assigns the user to obtain access to, and the public master key, the generated access private key SKQ (Q =, 1, 2) of the specified user is obtained: SKQ = (Suid, h, b1, b2);

[0155] 3) Data encryption algorithm: ER Q ←Encrypt(MK Q ,SK Q ,A u ,Data).

[0156] The data encryption process is completed according to the access structure Au, the public private key, the original data Data and the private key SKQ to obtain the encrypted data ERQ: ERQ = (s1, s2, H, T);

[0157] 4) Data pre-decryption algorithm: MI Q ←Decrypt(SP Q ,ER Q ,SK Q ).

[0158] According to the access structure, the user's private key and public key are used to calculate the decrypted intermediate plaintext MI. Q , that is, MIQ = (sk1, I, w, T);

[0159] 5) Decryption algorithm: RI Q ←Decrypt(ER Q ,SK Q ).

[0160] RIQ=(sk2,I,MIQ,ER0,ER1).

[0161] Further, the step S4 includes:

[0162] (1) Initialize reputation: Calculate the initial reputation value for each node based on its historical behavior and asset collateral and the votes of the master nodes in the previous round;

[0163] (2) Select the master node: select the node with the highest reputation as the master node based on the node reputation value;

[0164] (3) Select consensus nodes: Combine the master node votes and node historical performance to select the set of nodes that participate in the consensus;

[0165] (4) Consensus execution: The master node coordinates the consensus process, the consensus node sends consensus information to the master node, and the master node verifies the transaction and reaches consensus;

[0166] (5) Update reputation: After consensus is reached, the reputation value is updated based on the node performance, including the consensus completion time and weight;

[0167] (6) Dynamic adjustment: adjust the role of nodes in the consensus according to changes in reputation.

[0168] Furthermore, the step S5 comprises:

[0169] (1) During each transfer process, key information such as the user, time, transfer certificate, data watermark, time, etc. are stored on the chain;

[0170] (2) During the circulation process, a new digital watermark related to the new circulation user is generated each time; at the same time, the circulation evidence contract combines the generated data watermark identification and extraction method to store it on the chain for verification;

[0171] (3) During the transfer process, the transfer contract notifies the user who has the data authority to prevent the data from being abused, and stores the original data file, fingerprint, user, and transfer certificate on the chain.

[0172] Further, the step S6 includes:

[0173] (1) Local training encryption phase: Feldman’s Verifiable Secret Sharing (VSS) scheme is an improved mechanism based on Shamir’s secret sharing combined with a homomorphic encryption scheme. It allows participants to verify whether the secret shares they receive are correct. First, the local models are trained using local data, and after the training is completed, they are encrypted and distributed, including:

[0174] 1) Encryption parameter setting

[0175] Let p be a large prime number, q be a large prime factor of p-1, g belong to Zp* and be an element of order q, (p,q,g) is publicly known; n is the number of participants, t is the threshold value, and s is the key to be shared;

[0176] 2) Secret distribution stage

[0177] The distributor selects a polynomial a(x)=a with a maximum degree of k-1 0 +a 1 x 1 +a 2 x 2 +…+a k-1 x k-1 , where a 0 represents the key s, which refers to the encrypted local parameter;

[0178] Calculate commitment c 0 =g a0 ,c 1 =g a1 ,…,c k-1 =g ak-1, the above operations are based on modulo p; distribute commitments and secret shares, and commit c i and secret share s i Sent to participant P i ;

[0179] (2) Server local aggregation verification phase.

[0180] When the i-th aggregation server receives the data share v, it performs the following verification:

[0181]

[0182] When the verification is completed, the smart contract is called to verify the correctness of the model training consensus;

[0183] (3) After the model verification is completed, a federal abnormal behavior detection model is generated to identify abnormal behavior, and the identification results are automatically stored on the chain by calling the smart contract.

[0184] Furthermore, the step S7 includes:

[0185] (1) Subject crawler monitoring: By setting the subject words of the data, the blockchain calls the monitoring smart contract and uses the subject crawler technology to crawl data in real time from key areas where data may be leaked, and compares the crawled data with the data content, permissions, and owners stored in the system;

[0186] (2) Anomaly comparison: The crawled data is constructed into a data monitoring vector, and the outlier anomaly monitoring method combining multi-dimensional features is used for analysis and monitoring. When the monitored data is found to be outlier data, it is stored as evidence. The crawled data anomaly information, time, data fingerprint identification, abnormal behavior URL and other information are stored on the chain using the evidence storage contract, and verified using the consensus mechanism.

[0187] (3) Accountability of the subject: When the system detects abnormal risks, it will conduct accountability operations on the subject, including:

[0188] 1) Leakage source: By combining the fingerprint information of the leaked data, verification is performed to determine which node in the flow process has leaked;

[0189] 2) Leakage path: Send risk warnings to users who may leak information, build a directed graph of leakage paths based on their feedback, and store the results on-chain;

[0190] 3) Accountability for leaks: Combine the leak judgment results with the on-chain evidence and use the traceability contract to automatically report to the judicial authorities in the chain, thus realizing the function of tracing the source of the leak;

[0191] 4) Remind the owner; after the above result judgment is completed, the penalty contract will make a penalty judgment based on the subjective intention of the leak, whether the leaking subject is an on-chain user, and the harm caused: if the leak is serious, the account permissions will be revoked and the user will be blacklisted; if the leak is moderate, the user will be punished by not being able to perform sharing operations for a certain period of time; if the leak risk is minor, the review level of sharing will be increased to enhance risk verification.

[0192] In summary, the energy data trusted sharing method based on multi-blockchain collaboration and improved consensus of the present invention includes the steps of S1, uploading data to the chain, combining the interplanetary file system and block hash to complete the distributed storage of data on and off the chain; S2, generating data fingerprints, and completing the generation of publishable data fingerprints by combining smart contracts with row data; S3, sharing data flow based on the publishable energy data of the blockchain;

[0193] S4. Conduct consensus based on POBT+; S5. Conduct data flow evidence storage, and complete the on-chain evidence storage of the data flow process by combining with smart contracts; S6. Perform abnormal behavior identification; S7. Perform data flow tracing; Through the above steps, the energy data trusted sharing method based on multi-blockchain collaboration and improved consensus of the present invention builds a distributed trusted prevention and control environment based on blockchain technology, combines attribute encryption and digital fingerprint technology to achieve access control and abuse accountability, greatly improves the construction of a secure environment in the data sharing process, realizes flexible and revocable fine-grained access control, completes accurate accountability for unauthorized use of data, and ensures high efficiency and security in the energy data sharing process.

[0194] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0195] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, and these changes and improvements all fall within the scope of the present invention to be protected.

Claims

1. A trusted energy data sharing method based on multi-blockchain collaboration and improved consensus, characterized by: The following steps are involved: S1. Upload data to the blockchain and combine the Interstellar File System and block hash to complete the distributed storage of data on and off the blockchain; S2. Generate data fingerprints by combining smart contracts with row data to complete the generation of publishable data fingerprints; S3. Energy data can be published based on blockchain for data circulation and sharing; S4. Conduct consensus based on POBT+; S5. Data transfer and evidence storage, by combining smart contracts to complete the on-chain evidence storage of the data transfer process; S6. Identify abnormal behaviors; S7. Trace data flow.

2. The energy data trusted sharing method based on multi-blockchain collaboration and improved consensus as claimed in claim 1 is characterized in that: The step S1 comprises: (1) User registration and login: When registering, the user submits the user registration information. After successful authentication, the system uses the elliptic curve encryption algorithm to generate a public key, a private key and a user account for the user. The user identity information is uniquely bound to the public and private key pair, and the public and private key pair is uniquely bound to the user account. (2) Data upload: After the user successfully registers / logs in, the cultural resource file is uploaded through the resource upload module. The system saves the data resource file to the distributed file system IPFS and generates the storage address of the corresponding index link data; (3) Data similarity comparison: Use a similarity comparison algorithm to compare the uploaded data file with the copyrighted data in the system. If the similarity is less than a threshold, the upload is allowed; otherwise, the upload is rejected. (4) Data credibility verification: Use the language machine mechanism to complete the legal and credible authentication of data; execute the data exchange process between the engine, users, external data sources and the language machine, and unify or clearly distinguish the data interaction process for different data source types; (5) Hash generation: After the file storage is completed, the SHA-256 algorithm is used to generate a resource content hash for the resource file. The resource-related information is uploaded to the blockchain through the upload contract and synchronized to all nodes in the blockchain. The consensus algorithm is used to complete the verification and situation generation work. (6) Encrypted storage: Use IPFS to store data. When uploading to IPFS nodes for storage, the nodes organize and store the files in blocks in the format of a Merkle directed acyclic graph. After storage, the file is represented by the root hash function of the Merkle directed acyclic graph. Users obtain files from the IPFS network in the form of DHT. (7) Generate a certificate; Combine the verification results, user ID, time, HASH and other key information using the certificate contract to complete the generation of the copyright certificate. After the generation is completed, the certificate is verified by consensus on the chain and stored after verification.

3. The energy data trusted sharing method based on multi-blockchain collaboration and improved consensus as claimed in claim 1 is characterized in that: The step S2 comprises: (1) Watermark embedding parameter selection In the process of watermark grouping parameters, the GASA algorithm is first applied to obtain the key KS that is most suitable for database grouping. Then, some text data attribute columns in the database are selected to generate the primary key PK based on these text data. When extracting database watermarks, the primary key can be determined by determining which attribute columns and the generation method. Then, the key is applied to group the database data as follows; n u =H(Ks|H(Ks|t u PK))modNg Where n: in the context of a database, represents a unique identifier or data item associated with user u; H: represents a hash function, which is used to generate the hash value of a data item to ensure the integrity and fast retrieval of the data; Ks: represents a key or key seed, which is used to encrypt or sign sensitive data in the database; t u : represents a timestamp or transaction ID associated with user u, used to record the creation or update time of the data item; PK: stands for a public key, which is used to verify the origin or integrity of data in a multi-user environment; Ng: represents a modulus, which is used to implement modulus operations in the database; After the grouping is completed, watermark generation is performed, including: Loop through all groups to determine the embedded attribute column of the data watermark; combine the maximum value max[i] and the minimum value min[i] in the data to calculate the predicted value using the following formula: Calculate the prediction errors to construct a histogram, Calculate the new prediction error, combine the errors, complete the generation of the watermark attribute value, and then generate the result v' e , complete watermark embedding; (2) Watermark text addition and extraction 1) Synonym identification: traverse the text and retrieve the prepared synonym database, if the word is MFS or SMFS, identify it as a synonym; 2) Binary quantization: quantize the identified synonyms into binary sequences; if there are synonyms, obtain an n-bit synonym sequence Q; 3) Compression: Q is compressed into a shorter m-bit binary sequence Q' by using adaptive binary arithmetic coding; thereby obtaining some redundant space to accommodate additional watermark information; 4) Binarization of watermark information: The watermark information is converted into a binary sequence according to the ASCII value of its characters; 5) Additional information estimation: In order to distinguish the compressed synonym sequence Q' from the watermark information M, when they are concatenated together and embedded into the text, their length is recorded and sent to the receiver; 6) Embedded information generation: the additional information is connected in series with Q' and the watermark information M to form a complete embedded information S; 7) Compare: Compare the embedded information S with the original synonym sequence Q to find mismatched values ​​at certain corresponding positions; 8) Synonym replacement; for unmatched positions, the original synonym will be replaced by its synonym whose encoding value is equal to the embedded information bit; no replacement will be done for matching positions; when all embedded information bits are embedded, the watermarked text generation is complete; the watermarked text will be sent to the receiver, who can extract the watermark information and restore the original cover text without any distortion; (3) Watermark tampering verification When the system finds similar data, it performs tampering detection based on the watermark information stored on the chain. That is, it uses the watermark generation algorithm and the relevant primary key to check whether the watermark of the data has been tampered with, determine the tampering location, and perform a chain comparison to ensure the security and uniqueness of the data.

4. The energy data trusted sharing method based on multi-blockchain collaboration and improved consensus as claimed in claim 1 is characterized in that: The step S3 comprises: (1) Public chain sharing request: First, all data uploaded are stored on the public chain; users can only make data sharing requests on the chain after completing identity verification; when a user initiates a sharing request, the sharing contract will first query the penalty block to find out whether the user has malicious behavior in sharing; if not, the contract selects the owner of the data that the user requests to share and the mortgage certificate to initiate a message for sharing; when the data owner agrees to share, the requesting user and the sharing user are sent to the private chain sharing contract for sharing; (2) Establishing shared private chains: When calling a private contract for sharing, first query the user address to establish a link, and then call the Hyperledger script to establish a private chain; (3) Exchange certificates and store them on the chain; when the owner agrees to the applicant's request, the exchange contract automatically completes the data copyright transfer and sends the data storage address, password and other information to the applicant; at the same time, the transaction user's flow time, data hash, transaction hash, etc. are generated into a certificate and stored on the chain; (4) After the evidence is stored, the exchange is completed and the certificate is automatically generated; when the exchange certificate is stored, the applicant obtains the corresponding copyright certificate, and the exchange contract generates a certificate based on information such as the data owner, transfer time, transfer authority, etc., and stores it on the blockchain; (5) Access control, attribute encryption process; In order to achieve data access control, a revocable flexible access control method is used to ensure the security of shared data. Access is authorized based on the user who has obtained sharing permissions, including system initialization, attribute private key generation, encryption, pre-decryption, and decryption.

5. The energy data trusted sharing method based on multi-blockchain collaboration and improved consensus as claimed in claim 1 is characterized in that: The step S4 comprises: (1) Initialize reputation: Calculate the initial reputation value for each node based on its historical behavior and asset collateral and the votes of the master nodes in the previous round; (2) Select the master node: select the node with the highest reputation as the master node based on the node reputation value; (3) Select consensus nodes: Combine the master node votes and node historical performance to select the set of nodes that participate in the consensus; (4) Consensus execution: The master node coordinates the consensus process, the consensus node sends consensus information to the master node, and the master node verifies the transaction and reaches consensus; (5) Update reputation: After consensus is reached, the reputation value is updated based on the node performance, including the consensus completion time and weight; (6) Dynamic adjustment: adjust the role of nodes in the consensus according to changes in reputation.

6. The energy data trusted sharing method based on multi-blockchain collaboration and improved consensus as claimed in claim 1 is characterized in that: The step S5 comprises: (1) During each transfer process, key information such as the user, time, transfer certificate, data watermark, time, etc. are stored on the chain; (2) During the circulation process, a new digital watermark related to the new circulation user is generated each time; at the same time, the circulation evidence contract combines the generated data watermark identification and extraction method to store it on the chain for verification; (3) During the transfer process, the transfer contract notifies the user who has the data authority to prevent the data from being abused, and stores the original data file, fingerprint, user, and transfer certificate on the chain.

7. The energy data trusted sharing method based on multi-blockchain collaboration and improved consensus as claimed in claim 1 is characterized in that: The step S6 comprises: (1) Local training encryption stage: First, the local model uses local data for model training, and after training, it is encrypted and distributed, including: 1) Encryption parameter setting Let p be a large prime number, q be a large prime factor of p-1, g belong to Zp* and be an element of order q, (p,q,g) is publicly known; n is the number of participants, t is the threshold value, and s is the key to be shared; 2) Secret distribution stage The distributor selects a polynomial of degree at most k-1 a(x) = a0+a1x1+a2x2+…+a k-1 x k-1 , where a0 represents the key s, which here refers to the encrypted local parameter; Calculate commitment c0 = g a0 ,c1=g a1 ,…,c k-1 =g ak-1 , the above operations are based on modulo p; distribute commitments and secret shares, and commit c i and secret share s i Sent to participant P i ; (2) Server local aggregation verification phase When the i-th aggregation server receives the data share v, it performs the following verification: When the verification is completed, the smart contract is called to verify the correctness of the model training consensus; (3) After the model verification is completed, a federal abnormal behavior detection model is generated to identify abnormal behavior, and the identification results are automatically stored on the chain by calling the smart contract.

8. The energy data trusted sharing method based on multi-blockchain collaboration and improved consensus as claimed in claim 1 is characterized in that: The step S7 comprises: (1) Subject crawler monitoring: By setting the subject words of the data, the blockchain calls the monitoring smart contract and uses the subject crawler technology to crawl data in real time from key areas where data may be leaked, and compares the crawled data with the data content, permissions, and owners stored in the system; (2) Anomaly comparison: The crawled data is constructed into a data monitoring vector, and the outlier anomaly monitoring method combining multi-dimensional features is used for analysis and monitoring. When the monitored data is found to be outlier data, it is stored as evidence. The crawled data anomaly information, time, data fingerprint identification, abnormal behavior URL and other information are stored on the chain using the evidence storage contract, and verified using the consensus mechanism. (3) Accountability of the subject: When the system detects abnormal risks, it will hold the subject accountable.

Citation Information

Cited By

  • Information security protection method and device based on polynomial commitment and block chain, equipment and medium

    CN120354396A

  • Credit investigation data secure storage method and system

    CN121037139A

  • Distributed medical data security sharing method based on block chain and AI

    CN121193430A

  • System and method for preventing tampering of airport check-in display screen information

    CN121525108A

  • An airport check-in display screen information tamper-proofing system and method

    CN121525108B