A multi-keyword searchable encryption method for energy block chain supervision data

By building an R-HashMap index structure on the energy blockchain and using a cuckoo filter, the problem of low efficiency in multi-keyword retrieval was solved, enabling efficient and accurate retrieval and index updating of energy blockchain regulatory data.

CN115766136BActive Publication Date: 2026-06-19BIG DATA CENT OF STATE GRID CORP OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BIG DATA CENT OF STATE GRID CORP OF CHINA
Filing Date
2022-11-03
Publication Date
2026-06-19

Smart Images

  • Figure CN115766136B_ABST
    Figure CN115766136B_ABST
Patent Text Reader

Abstract

This invention relates to the field of searchable encryption technology in blockchain, specifically a multi-keyword searchable encryption method for energy blockchain regulatory data. The method uses a keyword extraction algorithm to extract a keyword set from the regulatory data, encrypts it to obtain a secure index set, and then uses the LSH algorithm to hash the secure index set to obtain secure index hash addresses. Keywords from the keyword set are inserted into their corresponding secure index hash addresses, and the keywords in the keyword set are linked with the corresponding blockchain storage address information of the encrypted regulatory data through linked list nodes to form an index structure. During querying, the Manhattan distance algorithm is used to obtain index keywords similar to the query keywords, thereby obtaining the query results. This invention performs similar keyword classification when building the index structure, shortening the time for matching a large number of keywords during retrieval; and uses a cuckoo filter to filter invalid queries, reducing the system's query burden.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of blockchain searchable encryption technology, specifically a multi-keyword searchable encryption method for energy blockchain regulatory data. Background Technology

[0002] Energy big data integrates big data technology with massive amounts of energy data, accumulating a wealth of high-value data and serving as a crucial component in building an "Internet+" smart energy system. Energy big data is characterized by numerous stakeholders, large data volume, diverse application scenarios, high requirements for regulatory collaboration, and involvement of personal information protection. Energy blockchain leverages the anti-counterfeiting, anti-tampering, and traceability features of blockchain technology to effectively improve the efficiency of collaborative management of energy big data, enhance the traceability, risk verification, and analysis capabilities throughout the entire energy big data sharing process, and realize the added value of energy big data. Throughout its entire lifecycle—from collection and storage to processing, use, and sharing—energy big data generates a large amount of regulatory data, which is a vital resource for ensuring the secure sharing of energy big data. To ensure the security of regulatory data, it is encrypted and stored on the energy blockchain. Authorized users can access the regulatory data through searchable encryption technology, thereby achieving secure and reliable energy data sharing.

[0003] In recent years, many researchers have explored searchable encryption technologies on the blockchain. Some researchers have proposed a practical searchable encryption scheme, SWP, which primarily addresses the issue of users being able to retrieve encrypted data stored on cloud servers via keyword searches, thus sparking a surge in research on searchable encryption technologies. Others have proposed the concept of multi-user searchability and secure indexes, constructing a secure index using a Bloom filter, although this suffers from low retrieval efficiency and insufficient accuracy. Some researchers have achieved server-side data verifiability and used blockchain technology and hash functions to ensure fair payment of search fees, but have not achieved precise searching of encrypted transactions on the blockchain. Others have used B+ tree index structures to construct secure indexes, improving the efficiency of multi-keyword encrypted retrieval, but have not presented experimental data to prove its efficiency. Still others have proposed using an inverted index as the index structure and timestamps as the primary keys to achieve on-chain retrieval functionality; however, this method does not consider users' needs for language-based searches and the complexity of deleting nodes from the inverted index structure.

[0004] Yan Xixi, Feng Suwei, Tang Yongli, Yin Pei. Encryption Scheme for Multi-Keyword Fuzzy Search Based on Blockchain [J / OL]. Electronics and Information Science proposes an encryption scheme for multi-keyword fuzzy search based on blockchain. It utilizes the immutability, transparency, and traceability of blockchain to protect users' private data from leakage; at the same time, it adopts the index structure of R-HashMap and the secure K-Nearest Neighbor (KNN) algorithm to ensure that users can search and update efficiently. The innovations of this paper are as follows: (1) Introducing the blockchain mechanism, storing the secure index in the blockchain and uploading the encrypted file to the cloud server to ensure the correctness of the search results; using the immutability of blockchain to ensure the correctness of the results and the fairness of users, numbering the files to prevent the cloud server from erroneously sending data or forging search results. (2) Proposing a new efficient index structure R-HashMap to improve the efficiency of searchable encryption; using the secure KNN algorithm to measure the Euclidean distance of different keywords, and by setting a threshold, fuzzy search can be satisfied; using the top-k algorithm to optimize the search results can better meet the user's query needs. (3) Security analysis confirms that the scheme satisfies the semantic security of adaptive keyword selection and user fairness.

[0005] Fuzzy search-based solutions cannot return precise search results. When files are deleted, the index structure is inefficiently updated. Because blockchain is a distributed ledger technology, storing large amounts of raw files directly on the blockchain would place an excessive storage burden on each blockchain node. Traversal methods based on this index structure are inefficient, have high system overhead, and cannot filter or avoid invalid queries. Summary of the Invention

[0006] To address the shortcomings of existing technologies, the present invention aims to provide a multi-keyword searchable encryption method for energy blockchain regulatory data.

[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0008] A multi-keyword searchable encryption method for energy blockchain regulatory data includes the following steps:

[0009] S1. Obtain the regulated data and the regulatory data;

[0010] S2. Generate a key using a symmetric encryption algorithm;

[0011] S3. Using the key generated in step S2, encrypt the monitored data and the monitoring data respectively to obtain monitored data ciphertext and monitoring data ciphertext; use a keyword extraction algorithm to extract the keyword set of the monitoring data, and use the key generated in step S2 to encrypt the keyword set to obtain the security index set of the monitoring data; use a hash algorithm to calculate the hash value of the monitored data ciphertext, and use the key generated in step S2 to encrypt the hash value of the monitored data ciphertext and the corresponding monitored data address to generate tamper verification data; submit the monitoring data ciphertext, the security index set, and the tamper verification data together to the consortium blockchain to execute the consensus algorithm and upload them to the blockchain;

[0012] S4. The security index set is hashed using the LSH algorithm to obtain the security index hash address. Keywords from the keyword set in step S3 are inserted into the corresponding security index hash address. The keywords from the keyword set in step S3 are linked with the blockchain storage address information of the corresponding regulatory data ciphertext through a chain list node to form an index structure. The blockchain storage address information includes the block hash address and the transaction data identifier within the block.

[0013] S5. Obtain the query keywords and identity identifiers of the data users, and use the key generated in step S2 to encrypt the query keywords and identity identifiers to generate a search trapdoor;

[0014] S6. Calculate the Manhattan distance between the query keyword vector in the search trapdoor generated in step S5 and the keyword vector in the index structure generated in step S4. Find the keyword vector in the index structure with the smallest Manhattan distance to the query keyword vector to obtain the bucket address of the query keyword. Filter invalid queries using the cuckoo filter corresponding to the bucket address. If the query is valid, continue to retrieve the blockchain storage address information of the transaction data in the index structure. Based on the blockchain storage address information, retrieve the regulatory data and the corresponding off-chain address from the block. Finally, read the regulated data in the private cloud server based on the off-chain address.

[0015] S7. The private cloud server authenticates user permissions. If the authentication is successful, the search results are decrypted.

[0016] Furthermore, the symmetric encryption algorithm adopts the national standard SM4 algorithm.

[0017] Furthermore, the keyword extraction algorithm employs the TextRank algorithm.

[0018] Furthermore, step S4 specifically includes the following steps:

[0019] S41. The LSH algorithm is used to calculate the hash address of the security index in the security index set. The security index is hashed according to the hash address. If the keywords of the linked list with the same hash address exceed 8, the linked list is automatically converted into a red-black tree.

[0020] S42. While hashing the secure index, link the blockchain storage address information of the ciphertext of the regulatory data corresponding to the secure index to the linked list pointer of the secure index.

[0021] S43. While hashing the security index, if the same keyword is found in the same hash address, the security index is discarded, and the blockchain storage address information of the regulatory data ciphertext corresponding to the security index is linked together through the keyword's linked list pointer.

[0022] S44. Repeat steps S41, S42, and S43 until the blockchain storage address information of the security index and its corresponding regulatory data ciphertext in the security index set has been hashed.

[0023] The multi-keyword searchable encryption method for energy blockchain regulatory data described in this invention has the following beneficial effects:

[0024] (1) A searchable encryption scheme that supports multi-keyword retrieval on a consortium blockchain is proposed. When building the index structure, similar keywords are classified, which shortens the time for matching a large number of keywords during retrieval.

[0025] (2) The Cuckoo Filter is used to filter invalid queries and reduce the query burden of the system.

[0026] (3) Improve the inverted index structure by connecting the nodes representing the same regulatory data in the linked list with del pointers. This will improve the update speed while deleting block node information and updating the index structure, avoid traversing the index, and reduce computational overhead. Attached Figure Description

[0027] The present invention includes the following figures:

[0028] Figure 1 Flowchart of the method of this invention;

[0029] Figure 2 SimilarDPHashMap index structure diagram. Detailed Implementation

[0030] Terminology used:

[0031] 1. Data Provider (DP)

[0032] 2. Data Owner (DO)

[0033] 3. Data User (DU)

[0034] 4. Alliance Chain System (ACS)

[0035] 5. Private Cloud Server (PCS)

[0036] 6. Blockchain Storage Address Information (SAI)

[0037] 7. Cuckoo Filter Query Rules (Bqrules)

[0038] Data providers refer to entities that provide energy data; data owners refer to energy big data centers; data users refer to individuals or entities that use consortium blockchains to query regulatory data and regulated data; regulated data refers to energy big data shared with all sectors of society, also known as off-chain data; regulatory data refers to access records generated during the sharing of energy big data.

[0039] The present invention provides a multi-keyword searchable encryption method for energy blockchain regulatory data, comprising the following steps:

[0040] Step 1: The data provider sends the regulated data to be shared to the DO.

[0041] Step 2: Generate a key using the national standard SM4 cryptographic algorithm. This is executed by the data owner DO, who inputs the system parameter FK and the fixed parameter CK, and outputs the key MK.

[0042] Step 3: Encrypt the off-chain data and regulatory data using an encryption function to obtain the ciphertext file CF and the ciphertext file CMF for the regulatory data. j The TextRank keyword extraction algorithm is used to extract keywords from the required energy regulatory data, obtaining a keyword set W, which is then used to construct a security index set CI. Finally, the regulatory data is encrypted using the CMF (Content ciphertext). j It can search for the security index set (CI) of the regulatory data and the CH corresponding to the encrypted text of the regulatory data. i Submit them together to the consortium blockchain to execute the consensus algorithm and put them on the chain;

[0043] Step 4: encrypt the regulatory data (CMF) after the on-chain process in Step 3. jThe blockchain storage address information SAI = (BlockAddr, BlockDataNo) and the security index set CI are used by the IndexBuild algorithm of the updating smart contract to update the SimilarDPHashMap index. Each key is inserted into the index structure, and the SAI related to that key are linked together through a chain list node. The blockchain storage address information includes the hash address of the block (BlockAddr) and the transaction data identifier within the block (BlockDataNo).

[0044] Step 5: Generate a search trapdoor using the SM4 cryptographic algorithm. DU sends the query keyword set QW and its own identity ID to DO in plaintext. After DO authentication and authorization, DO will generate a search trapdoor T for DU. qw ;

[0045] Step 6: Search Smart Contract (SSC) obtains data through transactions. User DU sends a search trap T. qw Then, enter the search term "trapdoor T". qw Output one or more on-chain regulatory data (CMF) j And the corresponding encrypted data CF under supervision i off-chain address addr i When performing multi-keyword search operations, use the Cuckoo Filter database for filtering.

[0046] Step 7: Authenticate user permissions and decrypt search results using the SM4 algorithm, with PCS executing the decryption algorithm.

[0047] Step 2 is the key generation process, which is executed by the data owner DO, denoted as KeyGen(FK,CK)→MK. The specific process is as follows:

[0048] Input system parameters FK and fixed parameters CK, output key MK. Key MK = {MK0, MK1, MK2, MK3}, system parameters FK = {FK0, FK1, FK2, FK3}, fixed parameters CK = {CK0, CK1, CK2, CK3}, round keys (rK0, rK1, rK2, ..., rK3). 31 The process involves XORing each word of the key with each word of the system parameters to obtain (K0, K1, K2, K3). Then, the last three words are XORed with the fixed parameter CK0, followed by a function T operation to obtain the value C. Finally, C obtained from function T is XORed with K0 to obtain the subkey for the first round, which is also K4 for the next round of key operations. The first step is the XOR operation of the key with the system parameters (K0, K1, K2, K3) = (MK0⊕FK0, MK1⊕FK1, MK2⊕FK2, MK3⊕FK3). The second step is to obtain the subkey rK.i =K i +4 = K i ⊕T′(K i +1⊕K i +2⊕K i +3⊕CK i Since SM4 encryption requires 32 rounds, the formula provides the 32 round keys needed for encryption. Furthermore, the encryption algorithm employs a 32-round iterative structure, using one round key per round. SM4 encrypts four words at a time, producing a one-word intermediate ciphertext. This intermediate ciphertext is then concatenated with the first three words for the next encryption round, iterating for a total of 32 rounds to ultimately produce the four-word ciphertext.

[0049] Step 3 involves encrypting the obtained regulatory data ciphertext CMF. j It can search for the security index set (CI) of the regulatory data and the CH corresponding to the ciphertext of the regulatory data. i Together, they are submitted to the consortium blockchain for consensus algorithm execution and on-chain processing, denoted as Enc(MK, MF). j ,(addr i H i ),W i )→(CMF j CH i CI i The specific steps are as follows:

[0050] Step 3.1: Enc(MK,F)→CF, encrypt the off-chain data using the encryption function to form the ciphertext file CF={CF i |i=1,2,…,n}.

[0051] Step 3.2: Hash(CF) i )→H i The hash value of the encrypted data is calculated using a hash function. It is then packaged and stored on the blockchain to verify whether the off-chain data has been tampered with.

[0052] Step 3.3: Enc(MK,MF) i →CMF j In this CF i Once regulatory data (MF) is generated throughout the entire lifecycle... i The algorithm is then used to encrypt regulatory data.

[0053] Step 3.4: Enc(MK,W)→CI, use the keyword extraction algorithm TextRank to extract the keyword set W of this regulatory data, and construct the security index set CI, where W={w k |k=1,2,…,q},CI={ci k |k=1,2,…,q}.

[0054] Step 3.5: Enc(MK, addr) i H i →CH i Add the address of the file in the chain. i The hash value H of this file i Packaged and encrypted into CH i .

[0055] Step 3.6: Encrypt the regulatory data (CMF) j It can search for the security index set CI of this regulatory data, and the CH corresponding to the ciphertext of this regulatory data. i They are submitted together to the consortium blockchain to execute the consensus algorithm and be uploaded to the blockchain.

[0056] Step 4 is the index building process, denoted as IndexBuild(MK,CI,SAI)→SimilarDPHashMap. The blockchain storage address information SAI = (BlockAddr,BlockDataNo) of CMFj after the on-chain process in Step 3, and the security index set CI are passed to the IndexBuild algorithm of the updating smart contract to update the SimilarDPHashMap index. Each key is inserted into the index structure, and the SAI related to that key are linked together through a linked list. The specific steps are as follows:

[0057] Step 4.1: Calculate CI = {ci} using the LSH function family. k The hash address of the secure index set CIk in |k=1,2,…,q} is hashed according to the hash address ci. k If a linked list containing the same hash address has more than 8 keys, the linked list will automatically be converted into a red-black tree. The properties of the LSH function family ensure that keys from the same hash address have high pairwise similarity.

[0058] Step 4.2: Hash ci k At the same time, ci k The corresponding SAI link to CI k On the dp pointer.

[0059] Step 4.3: Hash ci k At the same time, if the same key is found in the same hash address, then discard the ci. k , put ci k The corresponding SAI is linked together through the dp pointer of this keyword.

[0060] Step 4.4: Repeat steps 3.1, 3.2, and 3.3 until the security index in CI and its corresponding SAI hash are complete.

[0061] The constructed index structure is as follows Figure 2 As shown in the diagram, CW represents the ciphertext keyword, and SAI represents the blockchain storage address information. An improved inverted index structure connects nodes representing the same regulatory data in the linked list using del pointers. This improves update speed while deleting block node information and updating the index structure, avoiding index traversal and reducing computational overhead.

[0062] Step 5 is the process of generating the search trapdoor, denoted as Trapdoor(MK,QW)→T QW The specific process is as follows:

[0063] DU sends the query keyword set QW and its own identity ID to DO in plaintext. After DO authenticates and authorizes DU, DO will generate a search trap T for DU. QW .

[0064] Step 6 is the execution process of the Search Smart Contract (SSC), denoted as Search(T) QW → C, the specific steps are as follows:

[0065] Step 6.1: The Search Smart Contract (SSC) obtains the search trap T sent by the data user (DU) through a transaction. QW .

[0066] Step 6.2: Calculate the search trapdoor T QW {QW i} and the index structure SimilarDPHashMap's {CW i Find the bucket address for each query keyword based on the Manhattan distance of}. Among them, QW i It is T QW Keywords in CW i These are keywords in a SimilarDPHashMap, calculated by manipulating the query keyword vector QW. i The keyword vector CW in the SimilarDPHashMap index structure i The Manhattan distance is calculated, and then the keywords in the SimilarDPHashMap that have the minimum Manhattan distance to each query keyword are found. The Manhattan distance is used here to calculate similarity, which is faster than Euclidean and cosine distance algorithms.

[0067] Step 6.3: Then, invalid queries are filtered out using the cuckoo filter corresponding to the bucket address.

[0068] Step 6.4: If the query is valid, continue retrieving the blockchain storage address information SAI from the index structure according to the Bqrules query rules. Based on the SAI, retrieve the regulatory data and its corresponding off-chain address from the block. Finally, read the regulated dataset from the cloud server based on the off-chain address.

[0069] Step 7 is the decryption process, in which the PCS executes the decryption algorithm Dec(MK, CF). i The process of obtaining plaintext data is as follows: PCS first verifies the identity and permissions of DU to determine whether it can access CF. i If possible, decrypt or partially decrypt it and return F. i Granted to the user; if access permissions are insufficient, the encryption state is maintained and no decryption is performed. The SM4 decryption algorithm is similar to the encryption algorithm, the only difference being the order of the key wheels used. SM4 decryption uses the key wheels in the reverse order of encryption. During the encoding process, a marker data point—CryptFlag—determines whether to generate encryption or decryption key wheels. When CryptFlag is 1, encryption is performed; when CryptFlag is 0, decryption is performed.

[0070] The present invention will be further described in detail below with reference to the accompanying drawings.

[0071] The data provider sends the regulated data to be shared to the data owner;

[0072] The data owner encrypts the monitored data and stores the encrypted monitored data ciphertext and key together in the private cloud server. The monitored data generated during the external sharing of data is encrypted and stored in the consortium blockchain system. The blockchain storage address information of the monitored data ciphertext is returned. The keywords of the monitored data are encrypted and sent to the smart contract of the consortium blockchain system to construct an index.

[0073] Data users register with the data owner using their own identity and send the query keywords in plaintext to the data owner to construct a search trap. The data owner selects a data user they trust, generates a search trap for the data user using a symmetric encryption algorithm, and then sends the search trap to the consortium blockchain system for multi-keyword retrieval.

[0074] The consortium blockchain system is used to store encrypted regulatory data, index the received keywords and blockchain storage address information, and use search smart contracts for retrieval, authorization authentication and decryption;

[0075] Private cloud servers are used to store encrypted data and keys for monitored data, enabling data users to decrypt search results.

[0076] The specific process of this invention is as follows: Figure 1 As shown, it includes the following steps:

[0077] Step 1: The data provider sends the set of data files to be shared to the data owner (DO).

[0078] Step 2: The data owner generates 32 round keys using the SM4 cryptographic algorithm. Input system parameters FK and fixed parameters CK, output key MK. Key MK = {MK0, MK1, MK2, MK3}, system parameters FK = {FK0, FK1, FK2, FK3}, fixed parameters CK = {CK0, CK1, CK2, CK3}. Round keys (rK0, rK1, rK2, ..., rK... 31 The process involves XORing each word of the key with each word of the system parameters to obtain (K0, K1, K2, K3). Then, the last three words are XORed with the fixed parameter CK0, followed by a function T operation to obtain the value C. Finally, C obtained from function T is XORed with K0 to obtain the subkey for the first round, which is also K4 for the next round of key operations. The first step is the XOR operation of the key with the system parameters (K0, K1, K2, K3) = (MK0⊕FK0, MK1⊕FK1, MK2⊕FK2, MK3⊕FK3). The second step is to obtain the subkey rK. i =K i+4 =K i ⊕T′(K i+1 ⊕K i+2 ⊕K i+3 ⊕CK i Since SM4 encryption requires 32 rounds of operations, this formula can be used to obtain the keys needed for the 32 rounds of encryption.

[0079] Step 3: The data owner encrypts the off-chain data using an encryption function. During the 32 rounds of iterative encryption, a key generated in S2 is used in each round. The SM4 encryption algorithm processes four words at a time, producing a one-word intermediate ciphertext. This intermediate ciphertext is concatenated with the first three words for the next encryption round. This process is repeated 32 times, ultimately producing a four-word ciphertext. Finally, the ciphertext file CF = {CF...} is formed. i |i=1,2,…,n}. The data owner uses a hash function to calculate the hash value of the ciphertext data, and then packages it and stores it on the blockchain. This serves to verify whether the off-chain data has been tampered with. In this CF... i Once regulatory data (MF) is generated throughout the entire lifecycle... i The algorithm is executed to encrypt the regulatory data. The keyword set W for this regulatory data is extracted using the textRank keyword extraction algorithm, and a security index set CI is constructed, where W = {w k |k=1,2,…,q},CI={ci k|k=1,2,…,q}, the address of the file in the chain is addr i The hash value H of this file i Pack and encrypt into a cryptographic hash value CH i Finally, the regulatory data is encrypted using CMF. j It can search for the security index set CI of this regulatory data, and the CH corresponding to the ciphertext of this regulatory data. i They are submitted together to the consortium blockchain to execute the consensus algorithm and be uploaded to the blockchain.

[0080] Step 4: The data user sends the query keyword set QW and their own identity ID to the data owner in plaintext.

[0081] Step 5: The data owner selects a trusted data user and uses the SM4 cryptographic algorithm to generate a search trapdoor for the data user.

[0082] Step Six: Data users send the search trapdoor to the consortium blockchain system, which then performs on-chain multi-keyword retrieval on the blockchain through the search smart contract. The system inputs the keyword tag "tag," checks if "tag" exists, returns True if it does, and False otherwise. This generates f = fingerprint(tag), and executes the expression i1 = H. c (tag) and i2=i1⊕H c (f) retrieves the corresponding buckets bucket[i1] and bucket[i2]. If the bucket contains f, return True; otherwise, return False.

[0083] Step 7: Search Smart Contract (SSC) obtains data through transactions. User (DU) sends search trap T. QW ={QW1, QW2, ..., QW n Let FirstN = (Addrhash) be the first element of each hash address in the SimilarDPHashMap index structure. i CW i ), T Q W ={QW1, QW2, ..., QW n} and CW = {CW1, CW2, ..., CW m The Manhattan distance matrix SpecialMDM with dimension dim = (q+1)×m is constructed by converting the vector into a spatial vector using the dual coding function and performing vectorization V operation. The matrix is ​​shown in equation (1), where i,k∈[1,m], min(D 1,i min(D) represents the minimum D value in the first row of the matrix. 1,i ) represents T QW The first element of the index hash address i most similar to QW1 is CW.i This can be achieved by using FirstN = (Addrhash) i CW i Locate the QW1 hash address as Addrhash. i This indicates that QW1 belongs to the address Addrhash. i Elements of the category. Similarly, from min(D) n,k It can be known that QW n With CW k Most similar, its search address is Addrha sh k The search trapdoor T can be calculated using the SpecialMDM matrix. QW The hash address of each query keyword is: Addrhash = {Addrhash} i Addrhash j ,…,Addrhash k}. QW i After using the SpecialMDM hash address location method, the calculation result is obtained: R={(Q W1,CW i Addrhash i ),(QW2,CW j Addrhash j ),…,(QW n CW k Addrhash k CW k It is the sum of the first element of all indexed hash addresses and QW n The most similar keywords, and Ad drhash k It's CW k The hash address, also QW n The hash address after location. We will use it in SimilarDPHashMap[Addrhash k ] Query element QW n For ease of description, let's unify the subscripts of all elements in R: R = {QW1, CW1, ..., CW1}. i Addrhash i ),(QW2,CW j Addrhash j ),…,(QW n CW k Addrhash k )}, at this point, T QW The hash addresses for each query keyword have been calculated.

[0084]

[0085] Based on the calculated hash addresses of each query keyword, execute the Bqrules query rules, read all related regulatory data SAI information, and then read all regulatory data on the block based on the SAI, while also reading the off-chain regulated data storage address of the regulatory data.

[0086] Step 8: The search smart contract returns the obtained off-chain file address to the private cloud server.

[0087] Step Nine: The private cloud server first verifies the identity and permissions of the data user to determine whether they can access CF. i If possible, decrypt or partially decrypt it and return F. i Grant access to the user; if access permissions are insufficient, maintain the encrypted state and do not perform decryption.

[0088] This invention addresses the challenge of multi-keyword search for encrypted regulatory data on the blockchain by designing a fast indexing algorithm. By querying multiple keywords, relevant regulatory data on the blockchain can be retrieved, and subsequently, off-chain documents can be found.

[0089] The inverted index structure is improved by connecting nodes representing the same regulatory data in the linked list using del pointers. This improves update speed while deleting block node information and updating the index structure, avoids traversing the index, and reduces computational overhead.

[0090] To reduce invalid queries, use the more efficient Cuckoo Filter to filter keywords when performing multi-keyword search operations.

[0091] The contents not described in detail in this specification are existing technologies known to those skilled in the art.

Claims

1. A multi-keyword searchable encryption method for energy blockchain regulatory data, characterized in that, Includes the following steps: S1. Obtain the regulated data and the regulatory data; S2. Generate a key using a symmetric encryption algorithm; S3. Using the key generated in step S2, encrypt the monitored data and the monitoring data respectively to obtain the monitored data ciphertext and the monitoring data ciphertext; use a keyword extraction algorithm to extract the keyword set of the monitoring data, and use the key generated in step S2 to encrypt the keyword set to obtain the security index set of the monitoring data; The hash value of the monitored data ciphertext is calculated using a hash algorithm. The hash value of the monitored data ciphertext and the corresponding monitored data address are encrypted using the key generated in step S2 to generate tamper verification data. The monitored data ciphertext, the security index set, and the tamper verification data are submitted to the consortium blockchain to execute the consensus algorithm and upload them to the blockchain. S4. The security index set is hashed using the LSH algorithm to obtain the security index hash address. Keywords from the keyword set in step S3 are inserted into the corresponding security index hash address. The keywords from the keyword set in step S3 are linked with the blockchain storage address information of the corresponding regulatory data ciphertext through a chain list node to form an index structure. The blockchain storage address information includes the block hash address and the transaction data identifier within the block. S5. Obtain the query keywords and identity identifiers of the data users, and use the key generated in step S2 to encrypt the query keywords and identity identifiers to generate a search trapdoor; S6. Calculate the Manhattan distance between the query keyword vector in the search trapdoor generated in step S5 and the keyword vector in the index structure generated in step S4. Find the keyword vector in the index structure with the smallest Manhattan distance to the query keyword vector to obtain the bucket address of the query keyword. Filter invalid queries using the cuckoo filter corresponding to the bucket address. If the query is valid, continue to retrieve the blockchain storage address information of the transaction data in the index structure. Based on the blockchain storage address information, retrieve the regulatory data and the corresponding off-chain address from the block. Finally, read the regulated data in the private cloud server based on the off-chain address. S7. The private cloud server authenticates user permissions. If the authentication is successful, the search results are decrypted.

2. The multi-keyword searchable encryption method for energy-oriented blockchain regulatory data according to claim 1, wherein: The symmetric encryption algorithm used is the national standard SM4 algorithm.

3. The multi-keyword searchable encryption method for energy-oriented blockchain regulatory data of claim 1, wherein: The keyword extraction algorithm uses the TextRank algorithm.

4. The multi-keyword searchable encryption method for energy-oriented blockchain regulatory data of claim 1, wherein, Step S4 specifically includes the following steps: S41. The LSH algorithm is used to calculate the hash address of the security index in the security index set. The security index is hashed according to the hash address. If the keywords of the linked list with the same hash address exceed 8, the linked list is automatically converted into a red-black tree. S42. While hashing the secure index, link the blockchain storage address information of the ciphertext of the regulatory data corresponding to the secure index to the linked list pointer of the secure index. S43. While hashing the security index, if the same keyword is found in the same hash address, the security index is discarded, and the blockchain storage address information of the regulatory data ciphertext corresponding to the security index is linked together through the keyword's linked list pointer. S44, repeat steps S41, S42, and S43 until the hash of the security index in the security index set and the corresponding blockchain storage address information of the supervision data ciphertext is completed.