Energy transaction data sharing system and method based on cloud chain integration
Through cloud-chain integration technology, it solves the problems of data islands and privacy protection in traditional energy data sharing methods, reduces the cost of sharing energy transaction data, improves the security and privacy of data sharing, and realizes trusted sharing of energy transaction data.
Patent Information
- Application Number
- CN202210687595.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-16
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-06-16
AI Technical Summary
Traditional energy data sharing methods have problems such as data islands, massive data processing burdens, privacy protection problems, and low concurrency of the blockchain, resulting in high energy transaction data sharing costs and difficulty in ensuring security and privacy.
Adopting an energy transaction data sharing system based on cloud-chain integration, through the collaborative work of cloud service providers and blockchain, data encryption, index generation, consensus mechanism and smart contract technology are implemented to reduce blockchain storage costs and improve the privacy of data sharing. sex and safety.
It effectively reduces the load of centralized processing, ensures the privacy and security of data sharing, improves the storage efficiency of the blockchain, shortens the consensus time, and achieves trusted sharing of energy transaction data.
Smart Images

Figure CN114884747B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of energy trading technology, and in particular to an energy trading data sharing system and method based on cloud chain integration. Background Art
[0002] Energy is the foundation for the rapid development of the country's political economy and is also a guarantee for meeting the people's material and cultural needs. With the proposal of the "dual carbon" strategic goal, how to overcome the difficulties of green and low-carbon technologies, promote the safe and economic consumption of renewable energy, and promote the construction of the energy industry system in the new era has become the focus of current research. In the traditional energy system, fossil energy occupies an absolute share of my country's energy market, and the energy industries such as electricity, heat, gas, and cold are independent of each other, with obvious supply and demand boundaries, which aggravates the energy crisis, affects environmental protection, and also limits the regulation and use efficiency of energy. Therefore, the energy Internet came into being. Among them, the effective connection and full analysis and utilization of energy big data is one of the ways to achieve a high-quality integrated energy system.
[0003] The traditional way to process energy data is to use a machine learning model, that is, to centralize the data on the server side and train the response model by running a machine learning algorithm. While the massive amount of data from multiple sources and heterogeneity brings security and intelligent analysis support to the energy Internet, it also poses new challenges to the collaborative sharing of data among multiple parties. The current application method has serious data island problems, and the influx of massive data has also caused a serious burden on the centralized data processing model, and is not conducive to the privacy protection of both parties. Energy trading data involves the interests of multiple parties and national strategic security, and has high requirements for privacy and security. The current data sharing method is prone to information leakage. Involving the interests of multiple parties and national strategic security, the development of open and fair data sharing still faces many challenges, such as:
[0004] (1) Energy systems with different characteristics bring a large amount of information with different structures, inaccuracy and uncertainty, which increases the difficulty of planning;
[0005] (2) The influx of massive data has also placed a serious burden on centralized data processing models;
[0006] (3) The energy internet has a complex structure, massive heterogeneous data, and high timeliness requirements. Existing methods have problems such as failure to balance the cost of communication links and imbalanced benefits of heterogeneous services. They have high technical barriers and are not universal.
[0007] (4) Energy trading data involves the interests of multiple parties and national strategic security. How to achieve secure and private trusted sharing has become a difficult point in current research.
[0008] As a new type of distributed database, blockchain is highly consistent with the business needs of the Energy Internet with its anonymous, decentralized, tamper-proof, and reliable traceability features, providing a new solution to the centralized data burden and security issues. However, it adds new cost issues related to blockchain mining, computing, and storage, and cannot meet the real-time requirements of the Energy Internet. The storage pressure brought by the increase in blocks also greatly increases resource consumption. Summary of the invention
[0009] The purpose of the present invention is to provide an energy transaction data sharing system and method based on cloud-chain integration. In view of the problems of low concurrency of blockchain and high cost of shared deployment of energy transaction data, an energy Internet data sharing system under cloud-chain integration is constructed, and the storage and computing capabilities on the cloud are given to the blockchain. The lightweight block storage mode reduces the operating cost of the energy Internet at the same time.
[0010] To achieve the above object, the present invention provides the following solutions:
[0011] An energy transaction data sharing system based on cloud-chain integration, including:
[0012] Data Sharer: Collect system operation information, perform preliminary classification and processing on the operation information, and extract the data summary ABS from the information id and keyword K, and encrypt the ciphertext file C using the symmetric key y F , and sign the shared data at the same time, the signature is sign, and the data index Index is generated; the data sharer sets the data access permission, encrypts the symmetric key y and the keyword K, and generates the ciphertext C respectively key and C Di , C F , C key , sign and ABS id Sent to cloud service provider, Index and C Di Send to blockchain;
[0013] Cloud service providers: perform trusted verification and encrypted storage of shared data uploaded by data sharers, and assign a unique ID to each piece of data data , will be verified by ABS id and C key Pack and encrypt into C da Send to the blockchain, and when the search results of the blockchain are received, the corresponding C F Sent to the data access person who made the request;
[0014] Blockchain: Stores key information and sharing results of shared data, broadcasts the received information to the chain through a consensus mechanism, performs qualification verification and search after receiving the sharing request from the data acquirer, feeds the search results back to the cloud service provider, and sends part of the decrypted ciphertext D at the same time B To data acquirers; use smart contract technology to realize information search and shared service control and record the sharing results on the blockchain to maintain the autonomous operation and maintenance of the data sharing system;
[0015] Data acquirer: A node that needs to acquire shared data and uses its identity ID ob The trapdoor search is sent to the smart contract on the blockchain, verified as qualified, and the partially decrypted ciphertext D is received B And the ciphertext file C sent by the cloud service provider F First, D B Solve to obtain the symmetric key y, and then use the symmetric key y to encrypt the ciphertext file C F Decryption is performed to finally obtain the required plaintext data.
[0016] The present invention also provides an energy transaction data sharing method based on cloud-chain integration, which is applied to the above-mentioned energy transaction data sharing system based on cloud-chain integration, and includes the following steps:
[0017] S1, initialization parameter setting, first obtain the public parameters Params, master key msk and data summary ABS according to the randomly generated security factor id , by initializing the parameters Complete the initial encryption settings during data sharing;
[0018] S2: Information encryption. Data sharers send a shared storage application to the cloud service provider and register their own ID. Hi , define access policies based on LSSS, data sharers extract data summaries ABS id 、Keyword set K={k1,k2,…,k n} and sign it at the same time, and symmetric encrypt the plaintext data with the symmetric key y to obtain C F , and use the public key pk c And the encryption function KeyGen(pk c ) Encrypt the symmetric key y to get C key ;
[0019] S3, index generation, data sharer generates data index The Index is sent to the blockchain and recorded in the entire network through the consensus mechanism.
[0020] S4, trapdoor generation, data acquirer submits application for shared data to blockchain and sends identity After receiving qualified feedback, Send to blockchain, is any random number, A collection of search keywords for data retrievers A collection of attributes for data getters After receiving the content sent by the data acquirer, the blockchain generates a trapdoor:
[0021]
[0022] in, is the trapdoor structure parameter, is the final trapdoor, h and q are the hash parameters calculated when generating the index, t is a random number, and rk is the private key generated by initialization;
[0023] S5, shared data search, blockchain executes search algorithms through smart contracts Receive index and search content Then, calculate:
[0024]
[0025] If the equation holds, it means that the search is valid. The search results are sent to the cloud service provider and the partially decrypted ciphertext D B Send to the data acquirer;
[0026] S6, data verification, the blockchain partially decrypts the information received from the blockchain with its own private key:
[0027]
[0028] Among them, E and C" are the parameters calculated by the encryption algorithm, rk c It is the private key of the blockchain;
[0029] The data acquirer first uses his own private key to solve the D sent by the blockchain B :
[0030]
[0031] Among them, rk o is the private key of the data acquirer, C is the ciphertext encrypted by the symmetric key, and D B Indicates partially decrypted ciphertext;
[0032] Then use the symmetric key y to encrypt the C sent by the cloud service provider. F Solution:
[0033]
[0034] Get the plaintext Finally, the data verification is completed by comparing the keyword hash values through the smart contract to see if they are consistent.
[0035] Furthermore, in S1, initialization parameter setting, firstly obtains the public parameters Params, the master key msk and the data summary ABS according to the randomly generated security factor id , by initializing the parameters Complete the initial encryption settings during data sharing, including:
[0036] Suppose G1 and G2 are two cyclic groups of prime order q, g∈G1, and arbitrarily choose g as a generator of G1. There exists a bilinear mapping e:G1×G1→G2 between the cyclic groups, H1:{0,1} logk →G1, H2: {0,1} logk →G1 is a two-way collision-resistant hash function; data sharers use a randomly generated safety factor Finally, the public parameters Params = (G1, G2, e, H1, H2, g) are generated; msk is used as the master key. is a multiplicative group, containing integers {1,2,…,q-1}. The data sharer completes local data processing and extracts the keyword set K = {k1,k2,…,k n}, Data Summary ABS id ={a1,a2,…,a n}, a i Indicates the various attributes of the data sharer and completes the smart contract initialization.
[0037] Furthermore, in S2, the encryption algorithm includes two parts: key generation and information encryption:
[0038] Through data sharing Calculate the hash value:
[0039]
[0040] Data sharers are randomly selected s is not published, and the corresponding public key is calculated:
[0041]
[0042] in, is a multiplication group, s is a randomly selected random number;
[0043] Calculate the corresponding private key:
[0044]
[0045] The data sharer randomly selects a symmetric key y and uses the AES symmetric encryption algorithm to encrypt the plaintext data. Encrypt and get the encrypted file Encrypt y and K through the LSSS-based access strategy (A, τ), where A is an a×b matrix and τ is the row vector of A. i To ABS id The internal mapping function is unique. Select a random vector κ, random numbers α, λ, and calculate:
[0046]
[0047] Among them, σ i is the secret value to be shared, κ is a random vector, A i is a row vector, C is the ciphertext, C i Keyword ciphertext, E is the decryption parameter;
[0048] Finally, the encrypted output is:
[0049] C ABS ={(A,τ),C,C',E,C i ,C′ i} (5)
[0050] Furthermore, in the S3, the index is calculated as follows:
[0051] Choose any two random numbers r and d,
[0052]
[0053] Among them, V and R are index parameters, C Fi are the encrypted files, h and q are the hash parameters calculated when generating the index, and pk is the public key.
[0054] Furthermore, it also includes: blockchain uses smart contract technology to realize information search and shared service control and record the sharing results on the blockchain to maintain the autonomous operation and maintenance of the data sharing system, specifically:
[0055] 1) The blockchain packages the received shared data and broadcasts it to the consensus node and synchronization node in the whole network. The synchronization node stores the information after receiving the message. Let the number of nodes be num. Each time a consensus is completed, the master node N master Select:
[0056] N master =(L mod num)+1 (12)
[0057] Where L represents the length of the blockchain;
[0058] N masterBroadcast the pre-prepare message to all consensus nodes, and the consensus nodes verify it;
[0059] 2) When N master When the verification information received from other consensus nodes is greater than 2f+1, the synchronization node initiates a commit message, where f is the maximum number of nodes allowed to make errors in the blockchain, and f<1 / 3num;
[0060] 3) When the synchronization node receives feedback from consensus nodes greater than f+1, it initiates a synchronization message;
[0061] 4) Automatically execute smart contracts to complete data sharing;
[0062] 5) Qualified shared data will be packaged and uploaded to the chain and stored in the blockchain network in an unalterable form.
[0063] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects: the energy transaction data sharing system and method based on cloud-chain integration provided by the present invention, (1) the data storage method of cloud-chain integration can avoid the overload of centralized processing and reduce the risk of malicious attacks; (2) the data sharers and data acquirers are completely anonymous to each other, and the cloud service provider and the blockchain cannot directly obtain valuable data, which better guarantees the privacy and security of the data sharing process; (3) the shared information on the blockchain can provide a traceability query function for the data sharing process; (4) the storage method of cloud-chain integration can improve the storage efficiency of the blockchain and reduce storage costs; (5) the block structure designed for energy transaction scenarios can better realize energy transaction data sharing; (6) the improved PBFT consensus mechanism can shorten the consensus time. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] 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 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 work.
[0065] Figure 1 This is a schematic diagram of the structure of an energy transaction data sharing system based on cloud-chain integration according to an embodiment of the present invention;
[0066] Figure 2 It is the energy transaction data sharing mechanism under the cloud chain integration of the embodiment of the present invention;
[0067] Figure 3 This is a flow chart of an energy transaction data sharing method based on cloud-chain integration according to an embodiment of the present invention;
[0068] Figure 4 It is the energy transaction data sharing block of the embodiment of the present invention;
[0069] Figure 5 This is a time comparison bar chart of the traditional PBFT and improved PBFT consensus mechanisms in an embodiment of the present invention. DETAILED DESCRIPTION
[0070] 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.
[0071] The purpose of the present invention is to provide an energy transaction data sharing system and method based on cloud-chain integration. In view of the problems of low concurrency of blockchain and high cost of shared deployment of energy transaction data, an energy Internet data sharing system under cloud-chain integration is constructed, and the storage and computing capabilities on the cloud are given to the blockchain. The lightweight block storage mode reduces the operating cost of the energy Internet at the same time.
[0072] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0073] like Figure 1 and Figure 2 As shown, the energy transaction data sharing system based on cloud chain integration provided by the present invention includes:
[0074] Data Sharer H i ABS: Mainly responsible for collecting system operation information through sensors and other means, and extracting data summaries from the information after preliminary classification and processing of the operation information id and keyword K, and encrypt the ciphertext file C using the symmetric key y F , and sign the shared data to protect the integrity of the data. The signature is sign, and the data index Index is generated; the data sharer sets the data access rights, encrypts the symmetric key y and keyword K, and generates the ciphertext C key and C Di , C F , C key , sign and ABS id Sent to cloud service provider, Index and C Di Send to blockchain;
[0075] Cloud service providers: perform trusted verification and encrypted storage of shared data uploaded by data sharers, and assign a unique ID to each piece of data data, will be verified by ABS id and C key Pack and encrypt into C da Send to the blockchain, and when the search results of the blockchain are received, the corresponding C F Sent to the data access person who made the request;
[0076] Blockchain: Stores key information and sharing results of shared data, broadcasts the received information to the chain through a consensus mechanism, performs qualification verification and search after receiving the sharing request from the data acquirer, feeds the search results back to the cloud service provider, and sends part of the decrypted ciphertext D at the same time B To data acquirers; use smart contract technology to realize information search and shared service control and record the sharing results on the blockchain to maintain the autonomous operation and maintenance of the data sharing system;
[0077] Data Acquisition O j :Nodes that need to obtain shared data in the system will use their identity ID ob The smart contract sent to the blockchain by the trapdoor search verifies the qualified receiving part of the decrypted ciphertext D B , and the ciphertext file C sent by the cloud service provider F First, D B Solve to obtain the symmetric key y, and then use the symmetric key y to encrypt the ciphertext file C F Decryption is performed to finally obtain the required plaintext data.
[0078] like Figure 3 As shown, the present invention also provides an energy transaction data sharing method based on cloud chain integration, which is applied to the above-mentioned energy transaction data sharing system based on cloud chain integration, and includes the following steps:
[0079] S1, initialization parameter setting, first obtain the public parameters Params, master key msk and data summary ABS according to the randomly generated security factor id , by initializing the parameters Complete the initial encryption settings during data sharing; specifically include:
[0080] Suppose G1 and G2 are two cyclic groups of prime order q, g∈G1, and arbitrarily choose g as a generator of G1. There exists a bilinear mapping e:G1×G1→G2 between the cyclic groups, H1:{0,1} logk →G1, H2: {0,1} logk →G1 is a two-way collision-resistant hash function; data sharers use a randomly generated safety factor Finally, the public parameters Params = (G1, G2, e, H1, H2, g) are generated; msk is used as the master key. is a multiplicative group, including integers {1,2,…,q-1}. In addition, the data sharer needs to complete local data processing and extract the keyword set K = {k1,k2,…,k n}, Data Summary ABS id ={a1,a2,…,a n}, a i Indicates various attributes of the data sharer and completes the smart contract initialization;
[0081] S2, information encryption, data sharers send shared storage applications to cloud service providers and register their own identities Define access policies based on LSSS, and data sharers extract data summaries ABS id 、Keyword set K={k1,k2,…,k n} and sign it at the same time, and symmetric encrypt the plaintext data with the symmetric key y to obtain C F , and use the public key pk c And the encryption function KeyGen(pk c ) Encrypt the symmetric key y to get C key ; Among them, the encryption algorithm includes two parts: key generation and information encryption:
[0082] Through data sharing Calculate the hash value:
[0083]
[0084] Data sharers are randomly selected s is not published, and the corresponding public key is calculated:
[0085]
[0086] in, is a multiplication group, s is a randomly selected random number;
[0087] Calculate the corresponding private key:
[0088]
[0089] The data sharer randomly selects a symmetric key y and uses the AES symmetric encryption algorithm to encrypt the plaintext data. Encrypt and get the encrypted file Encrypt y and K through the LSSS-based access strategy (A, τ), where A is an a×b matrix and τ is the row vector of A. i To ABS id The internal mapping function is unique. Select a random vector κ, random numbers α, λ, and calculate:
[0090]
[0091] Among them, σ i is the secret value to be shared, κ is a random vector, A i is a row vector, C is the ciphertext, C i Keyword ciphertext, E is the decryption parameter;
[0092] Finally, the encrypted output is:
[0093] C ABS ={(A,τ),C,C',E,C i ,C′ i} (5)
[0094] S3, index generation, data sharer generates data index Index = {ABS:ABS id ,ID:ID Hi ,V,R,C F1 ,C F2 ,…,C Fl}, and send the Index to the blockchain, and use the consensus mechanism to broadcast the record to the entire network;
[0095] V and R have no specific meanings and are only parameters to support indexing. The generation method is shown in formula (6). F1 ,C F2 ,…,C Fl These are the encrypted files;
[0096] The index is calculated as follows:
[0097] Choose any two random numbers r and d,
[0098]
[0099] Among them, V and R are index parameters, C Fi are the encrypted files, h and q are the hash parameters calculated when generating the index, and pk is the public key.
[0100] S4, trapdoor generation, data acquirer submits application for shared data to blockchain and sends identity After receiving qualified feedback, Send to blockchain, is any random number, A collection of search keywords for data retrievers A collection of attributes for data getters After receiving the content sent by the data acquirer, the blockchain generates a trapdoor:
[0101]
[0102] S5, shared data search, blockchain executes search algorithms through smart contracts Receive index and search content Then, calculate:
[0103]
[0104] If the equation holds, it means that the search is valid. The search results are sent to the cloud service provider and the partially decrypted ciphertext D B Send to the data acquirer;
[0105] S6, data verification, the blockchain partially decrypts the information received from the blockchain with its own private key:
[0106]
[0107] Among them, E and C' are the parameters calculated by the encryption algorithm, see formula (4), rk c It is the private key of the blockchain;
[0108] The data acquirer first uses his own private key to solve the D sent by the blockchain B :
[0109]
[0110] Among them, rk o is the private key of the data acquirer, C is the ciphertext encrypted by the symmetric key, and D B Indicates partially decrypted ciphertext;
[0111] Then use the symmetric key y to encrypt the C sent by the cloud service provider. F Solution:
[0112]
[0113] Get the plaintext Finally, the data verification is completed by comparing the keyword hash values through the smart contract to see if they are consistent.
[0114] In order to achieve real-time sharing of energy trading data, this patent improves the PBFT consensus algorithm. The method also includes: blockchain uses smart contract technology to realize information search and shared service control and records the sharing results on the blockchain to maintain the autonomous operation and maintenance of the data sharing system, specifically:
[0115] 1) The blockchain packages the received shared data and broadcasts it to the consensus node and synchronization node in the whole network. The synchronization node stores the information after receiving the message. Let the number of nodes be num. Each time a consensus is completed, the master node N master Select:
[0116] Nmaster =(L mod num)+1 (12)
[0117] Where L represents the length of the blockchain;
[0118] N master Broadcast the pre-prepare message to all consensus nodes, and the consensus nodes verify it;
[0119] 2) When N master When the verification information received from other consensus nodes is greater than 2f+1, the synchronization node initiates a commit message, where f is the maximum number of nodes allowed to make errors in the blockchain, and f<1 / 3num;
[0120] 3) When the synchronization node receives feedback from consensus nodes greater than f+1, it initiates a synchronization message;
[0121] 4) Automatically execute smart contracts to complete data sharing;
[0122] 5) Qualified shared data will be packaged and uploaded to the chain and stored in the blockchain network in an unalterable form.
[0123] The present invention designs a corresponding block structure for energy trading scenarios, such as Figure 4 As shown. When a data sharing process cycle ends, a block is generated by the consensus mechanism and marked with a real-time timestamp, indicating that the sharing service has been effectively completed, preventing repeated system operations while providing a traceability query function. The block structure is divided into two parts: the block header and the block body. The block body contains three parts: shared data keywords, smart contracts, and data sharing results.
[0124] The data keywords contain the key information of the data uploaded by the data sharer, and record the transaction information such as the energy transactions between the energy seller and the energy trader, the market strategy after the dynamic game, the price time, and the attribute information of the shared data itself. This paper sets the shared data attributes as a dynamic variable array with an upper limit of 6, and the data sharer can formulate it according to his own needs. The smart contract mainly includes functions such as index generation, trapdoor generation, search algorithm, data verification, etc. involved in the data sharing process. The data sharing results include the identity and attributes of the data acquirer, the keywords used for information search, the data acquisition authority determination results and the information search results.
[0125] The block header stores general information of the blockchain. The data in the block is converted into a Merkle root through a hash function to ensure the relationship between blocks.
[0126] The energy transaction data sharing system and method based on cloud chain integration provided by the present invention have the following technical effects:
[0127] (1) It realizes the trusted sharing of energy transaction data based on cloud-chain fusion technology without the intervention of a third-party intermediary, thus reducing the burden of centralized data processing;
[0128] (2) The cloud service provider only stores the information of the data sharer and the shared data, and the blockchain only stores the information of the data acquirer, data keywords and sharing results, which improves the storage efficiency of the blockchain;
[0129] (3) Data sharers and data acquirers only need to authenticate their identities to the cloud service provider and the blockchain. They are completely anonymous and only interact with each other through keyword index information, which better ensures the privacy of the data sharing process.
[0130] (4) The data acquirer generates the correct trapdoor, and the blockchain uses the trapdoor to perform accurate searches. The shared data of this system is correct and reliable when there are no malicious nodes interfering with the application process.
[0131] (5) Compared with the traditional PBFT, the improved PBFT consensus mechanism shortens the time by about 50%. Figure 5 shown.
[0132] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0133] The present application uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. An energy transaction data sharing system based on cloud-chain integration, characterized in that: include: Data Sharer: Collect system operation information, perform preliminary classification and processing on the operation information, and extract the data summary ABS from the information id and keyword K, and encrypt the ciphertext file C using the symmetric key y F , and sign the shared data at the same time, the signature is sign, and the data index Index is generated; The data sharer sets the data access rights, encrypts the symmetric key y and keyword K, and generates the ciphertext C key and C Di , C F , C key , sign and ABS id Sent to cloud service provider, Index and C Di Send to blockchain; Cloud service providers: perform trusted verification and encrypted storage of shared data uploaded by data sharers, and assign a unique ID to each piece of data data , will be verified by ABS id and C key Pack and encrypt into C da Send to the blockchain, and when the search results of the blockchain are received, the corresponding C F Sent to the data access person who made the request; Blockchain: Stores key information and sharing results of shared data, broadcasts the received information to the chain through a consensus mechanism, performs qualification verification and search after receiving the sharing request from the data acquirer, feeds the search results back to the cloud service provider, and sends part of the decrypted ciphertext D at the same time B To data acquirers; use smart contract technology to realize information search and shared service control and record the sharing results on the blockchain to maintain the autonomous operation and maintenance of the data sharing system; Data acquirer: refers to a node that has the need to acquire shared data and uses its identity ID ob The results of the trapdoor search are sent to the smart contract of the blockchain, verified as qualified, and the partially decrypted ciphertext D is received B And the ciphertext file C sent by the cloud service provider F First, D B Solve to obtain the symmetric key y, and then use the symmetric key y to encrypt the ciphertext file C F Decryption is performed to finally obtain the required plaintext data.
2. A method for sharing energy transaction data based on cloud-chain integration, applied to the energy transaction data sharing system based on cloud-chain integration as claimed in claim 1, characterized in that: The following steps are involved: S1, initialization parameter setting, first obtain the public parameters Params, master key msk and data summary ABS according to the randomly generated security factor id , by initializing the parameters Complete the initial encryption settings during data sharing; S2, information encryption, data sharers send shared storage applications to cloud service providers and register their own identities Define access policies based on LSSS, and data sharers extract data summaries ABS id 、Keyword set K={k1,k2,…,k n } and sign it at the same time, and symmetric encrypt the plaintext data with the symmetric key y to obtain C F , and use the public key pk c And the encryption function KeyGen(pk c ) Encrypt the symmetric key y to get C key ; S3, index generation, data sharer generates data index Index = {ABS:ABS id ,ID:ID Hi ,V,R,C F1 ,C F2 ,…,C Fl }, and send the Index to the blockchain, and use the consensus mechanism to broadcast the record to the entire network; S4, trapdoor generation, data acquirer submits application for shared data to blockchain and sends identity After receiving qualified feedback, Send to blockchain, A collection of search keywords for data retrievers After receiving the content sent by the data acquirer, the blockchain generates a trapdoor: in, is the trapdoor structure parameter, is the final trapdoor, h and q are the hash parameters calculated when generating the index, t is a random number, and rk is the private key generated by initialization; S5, shared data search, blockchain executes search algorithms through smart contracts Receive index and search content Then, calculate: If the equation holds, it means that the search is valid. The search results are sent to the cloud service provider and the partially decrypted ciphertext D B Send to the data acquirer; S6, data verification, the blockchain partially decrypts the information received from the blockchain with its own private key: Among them, E and C" are the parameters calculated by the encryption algorithm, rk c It is the private key of the blockchain; The data acquirer first uses his own private key to solve the D sent by the blockchain B : Among them, rk o is the private key of the data acquirer, C is the ciphertext encrypted by the symmetric key, and D B Indicates partially decrypted ciphertext; Then use the symmetric key y to encrypt the C sent by the cloud service provider. F Solution: Get the plaintext Finally, the data verification is completed by comparing the keyword hash values through the smart contract to see if they are consistent.
3. The energy transaction data sharing method based on cloud chain integration according to claim 2 is characterized in that: S1, initialization parameter setting, first obtains the public parameters Params, the master key msk and the data summary ABS according to the randomly generated security factor id , by initializing the parameters Complete the initial encryption settings during data sharing, including: Suppose G1 and G2 are two cyclic groups of prime order q, g∈G1, and arbitrarily choose g as a generator of G1. There exists a bilinear mapping e:G1×G1→G2 between the cyclic groups, H1:{0,1} logk →G1, H2: {0,1} logk →G1 is a two-way collision-resistant hash function; data sharers use a randomly generated safety factor Finally, the public parameters Params = (G1, G2, e, H1, H2, g) are generated; msk is used as the master key. is a multiplicative group, containing integers {1,2,…,q-1}. The data sharer completes local data processing and extracts the keyword set K = {k1,k2,…,k n }, Data Summary ABS id ={a1,a2,…,a n } i Indicates the various attributes of the data sharer and completes the smart contract initialization.
4. The energy transaction data sharing method based on cloud chain integration according to claim 3 is characterized in that: In S2, the encryption algorithm includes two parts: key generation and information encryption: Through data sharing Calculate the hash value: Data sharers are randomly selected s is not published, and the corresponding public key is calculated: in, is a multiplicative group, s is a randomly selected random number; Calculate the corresponding private key: The data sharer randomly selects a symmetric key y and uses the ABS symmetric encryption algorithm to encrypt the plaintext data. Encrypt and get the encrypted file Encrypt y and K through the LSSS-based access strategy (A, τ), where A is an a×b matrix and τ is the row vector of A. i To ABS id The internal mapping function is unique. Select a random vector κ, random numbers α, λ, and calculate: s i =A i ·k C=e(g,g) αf C”=g f E=e(g αf ,g λ ) Among them, σ i is the secret value to be shared, κ is a random vector, A i is a row vector, C is the ciphertext, C i Keyword ciphertext, E is the decryption parameter; Finally, the encrypted output is: C ABS ={(A,τ),C,C',E,C i ,C i '}。 5. The energy transaction data sharing method based on cloud chain integration according to claim 3 is characterized in that: In the S3, the index is calculated as follows: Choose any two random numbers r and d, h i =H1(k i ),q i =H2(k i ) V=g r R=pk d Among them, V and R are index parameters, C Fi are the encrypted files, h and q are the hash parameters calculated when generating the index, and pk is the public key.
6. The energy transaction data sharing method based on cloud chain integration according to claim 2 is characterized in that: Also includes: Blockchain uses smart contract technology to realize information search and shared service control and record the sharing results on the blockchain to maintain the autonomous operation and maintenance of the data sharing system. Specifically: 1) The blockchain packages the received shared data and broadcasts it to the consensus node and synchronization node in the whole network. The synchronization node stores the information after receiving the message. Let the number of nodes be num. Each time a consensus is completed, the master node N master Select: N master =(L mod num)+1 Where L represents the length of the blockchain; N master Broadcast the pre-prepare message to all consensus nodes, and the consensus nodes verify it; 2) When N master When the verification information received from other consensus nodes is greater than 2f+1, the synchronization node initiates a commit message, where f is the maximum number of nodes allowed to make errors in the blockchain, and f<1 / 3num; 3) When the synchronization node receives feedback from consensus nodes greater than f+1, it initiates a synchronization message; 4) Automatically execute smart contracts to complete data sharing; 5) Qualified shared data will be packaged and uploaded to the chain and stored in the blockchain network in an unalterable form.
