Verifiable query method for cross-chain resource retrieval
By designing a segmentable keyword-based verifiable data structure and keyword allocation optimization model on edge devices, the storage burden and verification mechanism problems of edge device queries in cross-chain scenarios are solved, and a secure and trustworthy blockchain query is achieved, reducing costs and enhancing user trust.
Patent Information
- Application Number
- CN202510255405.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-05
- Publication Date
- 2025-06-06
AI Technical Summary
In cross-chain scenarios, it is difficult for the existing technology to realize secure and trustworthy blockchain query of edge devices without storing the entire ledger, and the lack of an effective verification mechanism, resulting in high query costs, impaired data integrity and user trust.
Design a segmentable keyword-based verifiable data structure, and realize the rapid retrieval of data and the verifiability of query results by building a keyword index tree and integrating RSA accumulator, and reduce the storage burden and query cost of edge devices through keyword allocation optimization model and yield-based allocation strategy.
It realizes secure and trustworthy blockchain query without storing the entire ledger on edge devices, reducing storage and computing costs, ensuring the integrity and correctness of query results, and improving user trust and system security.
Smart Images

Figure CN120104651A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer science and technology, and in particular to a verifiable query method for cross-chain resource retrieval. Background Art
[0002] In recent years, blockchain technology has developed rapidly and has been widely used in finance, supply chain, Internet of Things, and medical fields. As a decentralized distributed ledger, blockchain provides highly secure data management and transaction records through its inherent immutability and transparency. However, due to the closed nature of blockchain networks and limited interoperability, there are data silos between different blockchain systems, which hinders the efficiency of cross-chain data access and resource discovery. In cross-chain scenarios, users want to efficiently and securely obtain data from different blockchains and verify their integrity and correctness. For example, smart contracts in the supply chain may need to query payment records on financial blockchains, while nodes in decentralized storage networks may need to access relevant data on other chains. However, existing cross-chain query methods have challenges in storage burden and data verifiability, resulting in high query costs and lack of verification mechanisms. Specifically, when users query ledger data, they cannot ensure that the results returned from different storage nodes are correct and have not been tampered with. Due to the lack of a strong verification mechanism, malicious nodes may return forged or incomplete query results, threatening the integrity of the data and the trust of users.
[0003] Existing blockchain query methods are mainly divided into two categories: query methods based on verifiable data structures and query methods based on broadcast. The former relies on verifiable query data structures built on the entire ledger, such as Merkle trees, to provide query and verification services. This method performs well in data integrity and security, but requires nodes to store the entire ledger, which consumes a lot of storage and computing resources, especially on resource-constrained edge devices. The query method based on broadcast reduces the storage burden of a single node through technologies such as sharding storage and data pruning, enabling edge devices to participate in the blockchain network. These methods have made progress in scalability and reduced storage and computing costs, but they are insufficient in the verifiability of data queries. Due to the decentralized storage of data, the query results rely on the response of multiple nodes and lack a unified verification mechanism. Users cannot ensure the correctness of the returned data and face the risk of tampering by malicious nodes. This lack of verification weakens system security and user trust. Therefore, how to achieve efficient and verifiable keyword queries in a cross-chain environment and ensure that data interactions on different chains are secure and reliable is an important topic of current research. Summary of the invention
[0004] The purpose of the present invention is to propose a verifiable query method for cross-chain resource retrieval to solve the problem of how to implement a verifiable blockchain query solution that supports cross-chain resource retrieval in a distributed storage architecture, ensuring that edge devices can perform secure and reliable queries without storing the entire ledger. The present invention designs a splittable keyword-based verifiable data structure to provide users in edge environments with reliable blockchain data storage and query services, thereby promoting the further application and development of blockchain technology in edge computing scenarios.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] A verifiable query method for cross-chain resource retrieval, comprising the following steps:
[0007] S1. When constructing each blockchain block, a keyword index tree is constructed from top to bottom starting from the root node according to the keywords of the transaction data packaged in the block to achieve fast data retrieval;
[0008] S2, based on the keyword index tree constructed in S1, starting from the leaf node, count the index keywords of the current node and all the keywords of the tree with the node as the root node from bottom to top, and realize the verifiability of the query results by integrating the RSA accumulator;
[0009] S3. Combining the user's habits of accessing the network, querying data, data volume, and communication cost, with the goal of minimizing the user's query cost, construct a keyword allocation optimization problem, solve the constructed optimization problem, and obtain the block division strategy;
[0010] S4. Design a keyword allocation strategy based on yield. For each pair of keywords and edge devices, comprehensively consider the changes in query cost caused by it and the amount of data corresponding to the keywords, obtain the yield of the keywords, and give priority to high-yield keywords until the storage threshold of the edge device is met, thereby minimizing the query cost.
[0011] Preferably, the step of constructing a keyword index tree in S1 further includes the following contents:
[0012] For a set of data objects {o 1 ,o 2 ,…,o i ,…,o n}, where o i ={t i ,K i}, according to the unified rules, list K i Sort the elements in the tree so that objects with a common prefix keyword are assigned to a branch; iTaking the elements in as units, insert the data objects into the radix tree one by one to complete the construction of the keyword index tree.
[0013] Preferably, the step of integrating the RSA accumulator to make the query result verifiable in S2 specifically refers to:
[0014] The bottom-up construction of the verifiable data structure is realized based on the index tree. The blockchain miners generate a verifiable data structure for each block, and the root of the verifiable data structure replaces the Merkle tree root of the original block; the service provider uses the verifiable data structure to generate a verification object for each query to realize the user's verifiable search.
[0015] Preferably, the verifiable data structure includes a data node D i and index node N i Two types of nodes; among them, the data node D i Responsible for recording transaction data, represented by node hash h Di and data list O Di Composition; Let hash(·) represent the cryptographic hash function, assuming that the data node D i The data object covered is {o 1 ,o 2 ,…,o F}, and the corresponding domains are defined as:
[0016] (1)O Di ={o 1 ,o 2 ,…,o F}; (2)h Di = hash(O Di );
[0017] The index node N i It is an internal node of the verifiable data structure, responsible for speeding up the query process and providing verification proof. Ni , Child Hash Child hash of type data node The type is the child hash of the index node RSA accumulator value List of all keywords included And the index list Composition; let “|” represent string concatenation, acc(·) represent accumulator operation, and let node N i The index child node list is {N 1 ,N 2 ,…,N F} and the data child node is D i , the index node Ni The domains are defined as follows:
[0018] (1) =The index keyword of the current node; (2) = all keywords contained in the subtree with the current node as the root node; (3) (4) (5) (6) (7)
[0019] The above bottom-up calculation process continues until the hash of the root node is obtained. Said As part of the block header, it is used to assist users in verifying query results.
[0020] Preferably, S3 specifically includes the following contents:
[0021] Construct a keyword allocation optimization (KAO) model, assuming that the block contains N keywords, denoted by K = {k 1 ,k 2 ,…,k i ,…,k N}, the amount of data corresponding to each keyword is expressed as S = {s 1 ,s 2 ,…,s i ,…,s N};
[0022] The service provider maintains M edge devices, denoted by E = {e 1 ,e 2 ,…,e j ,…,e M};
[0023] There are a total of |U| users in the network, represented by U={u 1 ,u 2 ,…,u k ,…,u |U|};
[0024] For user u k , which is from the edge device e j The frequency of access to the network is Access the keyword k i The frequency of the data is recorded as
[0025] Any two edge devices j ,e M The unit communication cost between Mj ;
[0026] Let variable x ij Indicates keyword k i Is the data stored on the edge device? j In the above, keyword allocation optimization (KAO) reasonably allocates the data corresponding to the keywords to the edge devices for storage to achieve the goal of minimizing the query cost. Its formula is as follows:
[0027]
[0028] The amount of data stored in each edge device does not exceed its capacity, where C j For edge devices j The capacity is expressed as:
[0029]
[0030] It is stipulated that a keyword data is only assigned to one edge device for storage:
[0031]
[0032] Assign variable x ij is an integer variable with a value of 0 or 1. If the keyword k i Stored on edge devices j On, then x ij =1, otherwise 0.
[0033] Preferably, the S4 specifically includes the following contents:
[0034] The keyword data is stored on multiple devices to further reduce the query cost. i Edge devices j , when the keyword k i Data is stored in edge devices j When the user searches for keyword k i The resulting change in query cost is:
[0035]
[0036] Among them, D(k i ) indicates that it contains the keyword k i A collection of edge devices for data, Indicates that from the existence of keyword k i From the set of edge devices for the data, select the edge device with the lowest query cost to execute the query;
[0037] By s i ′ represents the edge device e j In the storage keyword ki The amount of data storage increased after the data is added, keyword k i Assign to edge devices j The rate of return is defined as:
[0038] ratio(k i ,e j )=ΔC(k i ,e j ) / s i '
[0039] Select ratio(k i ,e j ) value increases the utilization rate of network storage resources; for each edge device, the rate of return of each keyword for the device is calculated, and the one with the largest rate of return is selected for allocation until the threshold of device storage is reached.
[0040] Beneficial effects:
[0041] This invention solves the problem of verifiable blockchain query in cross-chain query scenarios for the first time. While alleviating the data storage burden of edge devices, it enables users to verify the integrity and correctness of query results. Its specific beneficial effects are reflected in:
[0042] (1) The present invention proposes a divisible keyword-based verifiable data structure, which supports keyword-based data pruning operations and integrates a cryptographic RSA accumulator. While reducing the storage capacity of edge devices, it ensures the integrity and correctness of user query results, providing a balanced solution for storage optimization and verifiable query.
[0043] (2) The present invention comprehensively considers factors such as user access frequency, keyword access frequency, distance between edge devices, and keyword data volume, constructs a keyword placement optimization model, clarifies the partitioning strategy of the verifiable data structure, and minimizes the query cost of users across the entire network while ensuring that the storage volume does not exceed the device capacity.
[0044] (3) The present invention designs a keyword allocation strategy based on yield, defines the keyword yield, and for each pair of keywords and edge devices, considers the change in query cost and the amount of keyword data, and gives priority to keywords with high yields, thereby improving data availability and query speed and reducing user query delays. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings involved in the embodiments are briefly introduced. Obviously, the drawings in the following description are only schematic illustrations of some embodiments of the present invention. For those skilled in the art, other forms of drawings can also be constructed based on these drawings without creative work.
[0046] Figure 1 This is a method flow chart of a verifiable query method based on cross-chain resource retrieval proposed in Example 1 of the present invention;
[0047] Figure 2 This is a schematic diagram of the system architecture of a query system implemented by the verifiable query method based on cross-chain resource retrieval proposed in Example 1 of the present invention. DETAILED DESCRIPTION
[0048] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0049] The present invention proposes a verifiable query method for cross-chain resource retrieval, which takes a divisible keyword-based verifiable data structure as the core, divides the data part and the corresponding index part of the block, and stores the divided sub-blocks in different edge devices. The user's query request will be assigned to the corresponding edge device for processing by the network access device. After receiving the query request, the edge device finds the qualified data through the index structure, and generates a verification object to assist the user in verifying the integrity and correctness of the result. This method reduces the storage burden of each edge device and provides users with a verifiable query service. The verifiable query method for cross-chain resource retrieval proposed by the present invention is described below in conjunction with specific drawings and examples. The specific content is as follows.
[0050] Embodiment 1:
[0051] See also Figure 1-2 , a verifiable query method for cross-chain resource retrieval, including the following:
[0052] Step 1: Construct a divisible keyword-based verifiable data structure for each blockchain;
[0053] Step 1-1: Top-down index tree construction.
[0054] For a set of data objects {o 1 ,o 2 ,…,o i ,…,o n}, where o i ={t i,K i}, in order to allocate objects with the same prefix keyword to the same branch as much as possible, we use the unified rule to sort the list K i Sort the elements in by the size of the hash value. i Insert the data objects into the radix tree one by one, taking the elements in as units.
[0055] Step 1-2: Bottom-up RSA accumulator integration.
[0056] Blockchain miners generate a verifiable data structure for each block, and the root of the verifiable data structure replaces the Merkle tree root of the original block. Service providers can use it to generate a verification object for each query to achieve verifiable search for users. This technology implements the bottom-up construction of the verifiable data structure based on the index tree. The verifiable data structure mainly consists of two types of nodes: data nodes D i and index node N i The data node is mainly responsible for recording transaction data, which is represented by the node hash h Di and data list O Di We let hash(·) represent the cryptographic hash function, assuming that the data node D i The data object covered is {o 1 ,o 2 ,…,o F}, and the corresponding domains are defined as:
[0057] (1) (2)
[0058] Index node N i It is also an internal node of the verifiable data structure, mainly responsible for speeding up the query process and providing verification proof. Child Hash Child hash of type data node The type is the child hash of the index node RSA accumulator value List of all keywords included And the index list We let | represent string concatenation, acc(·) represent accumulator operation, and let node N i The index child node list is {N 1 ,N 2 ,…,N F} and the data child node is D i , index node N i The domains are defined as follows:
[0059] (1) =The index keyword of the current node; (2) = all keywords contained in the subtree with the current node as the root node; (3) (4) (5) (6) (7)
[0060] This bottom-up calculation process continues until the hash of the root node is obtained. This hash value is part of the block header to assist users in verifying query results.
[0061] Step 2: Divide the verifiable data structure according to the resources of each blockchain;
[0062] Step 2-1: Keyword assignment optimization (KAO) model building.
[0063] Assume that block contains N keywords, denoted by K = {k 1 ,k 2 ,…,k i ,…,k N}, the amount of data corresponding to each keyword is expressed as S = {s 1 ,s 2 ,…,s i ,…,s N The service provider maintains M edge devices E = {e 1 ,e 2 ,…,e j ,…,e M There are a total of |U| users in the network, represented by U={u 1 ,u 2 ,…,u k ,…,u |U|}. For user u k , which is from the edge device e j The frequency of access to the network is Access the keyword k i The frequency of the data is recorded as Any two edge devices j ,e M The unit communication cost between Mj We let the variable x ij Indicates keyword k i Is the data stored on the edge device? j KAO reasonably distributes the data corresponding to keywords to the edge devices for storage to achieve the goal of minimizing the query cost. Its formula is as follows:
[0064] The amount of data stored in each edge device cannot exceed its capacity, where C j For edge devices j The capacity is expressed as:
[0065] Here, it is stipulated that a keyword data is only assigned to one edge device for storage:
[0066]
[0067] Assign variable x ij is an integer variable with a value of 0 or 1. If the keyword k i Stored on edge devices j On, then x ij =1, otherwise 0.
[0068] Step 2-2: Keyword allocation based on profitability.
[0069] The optimization goal of the above steps is to minimize the query cost of the network while meeting the storage resource constraints of the edge devices. In the KAO solution, each keyword is assigned only once. In order to further reduce the query cost, the keyword data needs to be stored on multiple devices. i Edge devices j For example, when the keyword k i Data is stored in edge devices j When the user searches for keyword k i The resulting change in query cost is:
[0070]
[0071] Among them, D(k i ) indicates that it contains the keyword k i A collection of edge devices for data, Represents the existence of keyword k i In the edge device set of data, select the edge device with the lowest query cost to execute the query. We use s i ′ represents the edge device e j In the storage keyword k i The amount of data storage increased after the data is added, keyword k i Distribute to edge devices j The rate of return is defined as:
[0072] ratio(k i ,e j )=ΔC(k i ,e j ) / s i '
[0073] Select ratio(k i ,e j ) can increase the utilization of network storage resources. For each edge device, the yield of each keyword for the device is calculated, and the one with the largest yield is selected for allocation until the device storage threshold is reached.
[0074] In summary, the present invention proposes a verifiable blockchain keyword query method that supports cross-chain resource retrieval, which designs a divisible keyword-based verifiable data structure, and combines indicators such as the frequency of user access to the network, keyword access frequency, keyword data volume, blockchain storage resources, and network transmission cost to construct a KAO model. Combined with a keyword allocation strategy based on yield, the division of the verifiable data structure is realized, thereby effectively reducing the storage burden of edge devices and supporting users to verify the query results.
[0075] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A verifiable query method for cross-chain resource retrieval, characterized in that: The following steps are involved: S1. When constructing each blockchain block, a keyword index tree is constructed from top to bottom starting from the root node according to the keywords of the transaction data packaged in the block to achieve fast data retrieval; S2, based on the keyword index tree constructed in S1, starting from the leaf node, count the index keywords of the current node and all the keywords of the tree with the node as the root node from bottom to top, and realize the verifiability of the query results by integrating the RSA accumulator; S3. Combining the user's habits of accessing the network, querying data, data volume, and communication cost, with the goal of minimizing the user's query cost, construct a keyword allocation optimization problem, solve the constructed optimization problem, and obtain the block division strategy; S4. Design a keyword allocation strategy based on yield. For each pair of keywords and edge devices, comprehensively consider the changes in query cost caused by it and the amount of data corresponding to the keywords, obtain the yield of the keywords, and give priority to high-yield keywords until the storage threshold of the edge device is met, thereby minimizing the query cost.
2. A verifiable query method for cross-chain resource retrieval according to claim 1, characterized in that: The construction of the keyword index tree described in S1 further includes the following contents: For a set of data objects {o1,o2,…,o i ,…,o n }, where o i ={t i ,K i }, according to the unified rules, list K i Sort the elements in the tree so that objects with a common prefix keyword are assigned to a branch; i Taking the elements in as units, insert the data objects into the radix tree one by one to complete the construction of the keyword index tree.
3. A verifiable query method for cross-chain resource retrieval according to claim 1, characterized in that: The verification of the query result by integrating the RSA accumulator described in S2 specifically refers to: The bottom-up construction of the verifiable data structure is realized based on the index tree. The blockchain miners generate a verifiable data structure for each block, and the root of the verifiable data structure replaces the Merkle tree root of the original block; the service provider uses the verifiable data structure to generate a verification object for each query to realize the user's verifiable search.
4. A verifiable query method for cross-chain resource retrieval according to claim 3, characterized in that: The verifiable data structure includes a data node D i and index node N i Two types of nodes; among them, the data node D i Responsible for recording transaction data, which is hashed by the node and data list Composition; Let hash(·) represent the cryptographic hash function, assuming that the data node D i The covered data objects are {o1,o2,…,o F }, and the corresponding domains are defined as: (1) (2) The index node N i It is an internal node of the verifiable data structure, responsible for speeding up the query process and providing verification proof. Child Hash Child hash of type data node The type is the child hash of the index node RSA accumulator value List of all keywords included And the index list Composition; let "|" represent string concatenation, acc(·) represent accumulator operation, and let node N i The index child node list is {N1,N2,…,N F } and the data child node is D i , the index node N i The domains are defined as follows: (1) =The index keyword of the current node; (2) = all keywords contained in the subtree with the current node as the root node; (3) (4) (5) (6) (7) The above bottom-up calculation process continues until the hash of the root node is obtained. Said As part of the block header, it is used to assist users in verifying query results.
5. A verifiable query method for cross-chain resource retrieval according to claim 1, characterized in that: The S3 specifically includes the following contents: Construct a keyword allocation optimization model, assuming that the block contains N keywords, denoted by K = {k1, k2, …, k i ,…,k N }, the amount of data corresponding to each keyword is expressed as S = {s1, s2, ..., s i ,…,s N }; The service provider maintains M edge devices, denoted by E = {e1, e2, …, e j ,…,e M }; There are a total of |U| users in the network, represented by U={u1,u2,…,u k ,…,u |U| }; For user u k , which is from the edge device e j The frequency of access to the network is Access the keyword k i The frequency of the data is recorded as Any two edge devices j ,e M The unit communication cost between Mj ; Let variable x ij Indicates keyword k i Is the data stored on the edge device? j In the above, keyword allocation optimization reasonably allocates the data corresponding to the keywords to the edge devices for storage to achieve the goal of minimizing the query cost. Its formula is as follows: The amount of data stored in each edge device does not exceed its capacity, where C j For edge devices j The capacity is expressed as: It is stipulated that a keyword data is only assigned to one edge device for storage: Assign variable x ij is an integer variable with a value of 0 or 1. If the keyword k i Stored on edge devices j On, then x ij =1, otherwise 0.
6. A verifiable query method for cross-chain resource retrieval according to claim 5, characterized in that: The S4 specifically includes the following contents: The keyword data is stored on multiple devices to further reduce the query cost. i Edge devices j , when the keyword k i Data is stored in edge devices j When the user searches for keyword k i The resulting change in query cost is: Among them, D(k i ) indicates that it contains the keyword k i A collection of edge devices for data, Indicates that from the existence of keyword k i From the set of edge devices for the data, select the edge device with the lowest query cost to execute the query; By s i ′ represents the edge device e j In the storage keyword k i The amount of data storage increased after the data is added, keyword k i Distribute to edge devices j The rate of return is defined as: ratio(k i ,e j )=ΔC(k i ,e j ) / s i ′ Select ratio(k i ,e j ) value increases the utilization rate of network storage resources; for each edge device, the rate of return of each keyword for the device is calculated, and the one with the largest rate of return is selected for allocation until the threshold of device storage is reached.