Data cross-chain query method based on storage relay chain structure

By constructing a storage relay chain structure and a cross-chain controller, and combining reinforcement learning with the DQN model, the cross-chain transaction processing of the government consortium chain is optimized, solving the problem of poor cross-chain interaction performance and achieving efficient cross-chain data query.

CN118227683BActive Publication Date: 2026-11-24LIAONING UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410471388.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-19
Publication Date
2026-11-24
Estimated Expiration
2044-04-19

AI Technical Summary

Technical Problem

Traditional cross-chain technology has poor cross-chain interaction performance in government consortium blockchains, which cannot meet the high requirements of privacy and real-time performance of government consortium blockchains, thus limiting its application in the field of e-government.

Method used

A storage relay chain structure is constructed, and a cross-chain controller and relay chain priority query mechanism are adopted. By combining reinforcement learning and DQN model, the resource utilization of cross-chain transactions is optimized, and the efficiency of cross-chain query is improved through prediction and parallel processing.

Benefits of technology

It effectively improves the efficiency of cross-chain data query between government consortium blockchains, shortens the query time, and meets the privacy and real-time requirements of government consortium blockchains.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118227683B_ABST
    Figure CN118227683B_ABST
Patent Text Reader

Abstract

The data cross-chain query method based on a storage relay chain structure comprises the following steps: 1) Constructing a storage relay chain to handle cross-chain data query services; 2) Constructing a cross-chain controller to coordinate the interaction between the source chain and the relay chain, unifying the cross-chain data query transaction format, generating prediction proposals based on historical transactions, and allocating transaction proposals to eligible relay chains for processing according to an allocation strategy; 3) Defining a relay chain priority query mechanism to provide the cross-chain data query process for the relay chain; 4) Using a DQN model to dynamically select the optimal parameters based on the real-time status of the cross-chain system. This invention provides a data cross-chain query method based on a storage relay chain structure, effectively improving the throughput of cross-chain data queries in e-government consortium chains and reducing transaction latency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of information technology, and specifically relates to a cross-chain data query method based on a storage relay chain structure. Background Technology

[0002] With the rapid development and widespread application of cutting-edge technologies such as blockchain and artificial intelligence, new possibilities have been opened up for secure and reliable collaborative work and data sharing in the field of e-government. Government departments are using blockchain to build secure and transparent information sharing and collaborative work platforms to improve governance efficiency. However, traditional cross-chain technologies are mostly aimed at value cross-chaining and do not consider the characteristics of data cross-chaining. The performance of cross-chain interaction is poor. If the bottleneck of cross-chain query efficiency is not overcome, it will greatly limit the application of consortium blockchains in the field of e-government.

[0003] Cross-chain data transfer in government consortium blockchains differs from that in value-based blockchains. It does not require asset exchange and is not susceptible to double-spending attacks. Government consortium blockchains are used for basic transaction information storage, event accountability, and data tampering prevention, and have higher requirements for privacy and real-time performance. Therefore, cross-chain transfer in government consortium blockchains should focus more on ensuring short response times, low latency, and no data leakage for stored transactions. Summary of the Invention

[0004] To address the problems of existing technologies, this invention proposes a cross-chain data query method based on a storage relay chain structure. This method constructs a storage relay chain structure to achieve parallel processing of cross-chain data query services. It proposes a cross-chain controller and a relay chain priority query mechanism. The cross-chain controller predicts transactions based on historical data and allocates appropriate relay chains for processing cross-chain transactions. When the source chain initiates a cross-chain query transaction, it prioritizes searching on the relay chain and the prediction buffer to shorten query time. Furthermore, it combines reinforcement learning with cross-chain queries, using a DQN model to dynamically select optimal parameters based on the real-time state of the cross-chain system, ensuring full resource utilization and achieving optimal cross-chain data query efficiency.

[0005] This invention is achieved through the following technical solution: a cross-chain data query method based on a storage relay chain structure, the steps of which are as follows:

[0006] Step 1) Construct M storage relay chains to enable parallel processing of cross-chain data query services.

[0007] 1.1) Construct M storage relay chains, and to address the issue of the privacy of government information, use a private dataset mechanism to ensure data privacy for organizations applying for cross-chain services within the same relay chain;

[0008] 1.2) Construct a query filter in the relay block header to map the hash of the transaction proposal in the block to the set in the block header. The query filter retrieves whether the transaction proposal has been initiated and exists in a certain block.

[0009] Step 2) Construct a cross-chain controller to coordinate the interaction between the source chain and the relay chain, unify the cross-chain data query transaction format, generate prediction proposals based on historical transactions, and allocate transaction proposals to qualified relay chains for processing according to the allocation strategy.

[0010] 2.1) The cross-chain controller receives cross-chain requests and generates cross-chain transactions in a unified format. A cross-chain transaction includes the following data items: Crosschain_id, Tx_type, Source_chain, Target_chain, Req_node_id, Read_node_id, Req_node_signature, Read_node_signature, Query_condition, Query_value, If_other, Query_target, and Query_response. Where Crosschain_id is the cross-chain data transaction number, Tx_type is the transaction type (Tx_type = 1 indicates the transaction is initiated by the source chain, Tx_type = 0 indicates the transaction is a prediction transaction obtained by searching the prediction table), Source_chain is the source chain (the blockchain where the node initiating the cross-chain transaction resides), and Target_chain is the target chain (the block where the cross-chain data is located). The chain, the source chain and the target chain for the predicted transaction are empty; Req_node_id is the ID of the node Req_node that requested the cross-chain data query, and Read_node_id is the ID of the node Read_node that obtained the target data; Req_node_signature and Read_node_signature are the signatures of Req_node and Read_node, respectively; Query_condition is the name of the query condition, Query_value is the value of the query condition, If_other indicates whether there are other query conditions. If If_other = true, the corresponding Query_condition and Query_value are recorded in sequence until If_other = false; Query_target represents the name of the target data to be queried, and Query_response is the data result of the query. Query_condition, Query_value and Query_target constitute the transaction proposal for the cross-chain transaction.

[0011] 2.2) The cross-chain controller defines the retrieval prediction table and updates and maintains the retrieval prediction table based on historical transactions. The structure of the retrieval prediction table is shown in Table 1:

[0012] Table 1 Retrieval Prediction Structure Table

[0013]

[0014] Among them, Rel_Item_tarchain is the target chain of the cross-chain data query request and its related attributes with other basic information chains. Basic_infochain_i is i basic information chains. The cross-chain controller maintains i retrieval prediction tables. One basic information chain corresponds to one retrieval prediction table. Different retrieval prediction tables are updated according to the different target chains of the cross-chain data query request.

[0015] All values ​​in the retrieval prediction table are initially 0. When the cross-chain controller receives a cross-chain data transaction, it reads the Target_chain, Query_condition, and Query_value of the cross-chain request and updates the retrieval prediction table corresponding to the Target_chain of the l cross-chain transactions that are similar to the current cross-chain transaction. If a certain Rel_Item_tarchain of the information queried by the l cross-chain transactions is related to the current transaction, the corresponding retrieval prediction table is updated, and the value of the associated attribute corresponding to the Target_chain of the current cross-chain data query is incremented by 1.

[0016] 2.3) The cross-chain controller generates a prediction proposal based on the retrieval prediction table. When the cross-chain controller receives a cross-chain transaction, it obtains the Target_chain and Query_condition of the transaction, determines the retrieval prediction table based on the Target_chain of the transaction, and then determines the tuple based on the Query_condition. In the tuple with the same name as the Query_condition, it finds the basic information chain with the largest value and uses it as the Target_chain of the prediction transaction. It then generates a prediction proposal in combination with the Query_condition. If there are multiple Query_conditions, multiple prediction proposals are generated.

[0017] 2.4) The cross-chain controller allocates proposals to the corresponding relay chains, defining the relay chain allocation strategy as a triple: Strategy = (Relatedness, Frequency, Complexity), where: Relatedness indicates whether the nodes of the target chain of the cross-chain transaction are existing members of the relay chain; Frequency is the frequency at which the relay chain is allocated transactions; and Complexity indicates the complexity of the relay chain, i.e., the management cost of the relay chain, which is determined by the number of nodes.

[0018] min(Frequency*Complexity)stRelatedness=1

[0019] When allocating transactions, the cross-chain controller selects relay chains with low frequency and low complexity from among the relay chains with Relatedness=1.

[0020] Step 3) Define the relay chain priority query mechanism to provide a cross-chain data query process based on the storage relay chain and cross-chain controller.

[0021] 3.1) The relay link receives a transaction and processes it differently depending on the transaction type:

[0022] 3.2) For cross-chain proposals, search n blocks on the relay chain. If they are found, read the feedback. If not, search the local prediction buffer. If they are still not found, interact with the target chain node, read the information, and put the proposal and the searched proposal on the chain.

[0023] 3.3) For a predicted proposal, search for n blocks on the relay chain. If they exist, no operation is required. If they do not exist, interact with the target chain node, read the information and send it to the same chain node. Store the information in the local buffer and do not put it on the chain. The buffer only stores the latest m proposals.

[0024] Step 4) Use the DQN model to dynamically select the optimal parameters based on the real-time status of the cross-chain system.

[0025] 4.1) DQN's agent interacts with the blockchain cross-chain model. At each stage, the cross-chain model sends the retrieval latency and statistical results of the search information on the relay chain to DQN's agent.

[0026] 4.2) DQN combines retrieval delay information and search results to form a state set. in This is to account for the delay in the previous retrieval stage. It is a historical record of transaction query results from the previous stage on the relay chain. The retrieval results are used to calculate the reward value, and the reward function is as follows:

[0027]

[0028] in, This represents the number of transactions from the previous block that were successfully queried in the relay chain. m is the number of transactions contained in the block, Tq is the time to retrieve transactions in the relay block, Tst is the time for the source chain and the target chain to interact and obtain information, υ is the cost of maintaining a relay chain, and β is the weight parameter.

[0029] 4.3) Input the set of states into the neural network to obtain the set of actions. The corresponding Q value is used to guide the construction of the next stage of the cross-chain data query structure by randomly selecting or choosing the action corresponding to the largest Q value using a greedy algorithm. Here, nl is the maximum number of blocks searched on the relay blockchain during time period l. The optimal number of relay chains for time period l.

[0030] The beneficial effects of this invention are as follows: This invention proposes a cross-chain data query method based on a storage relay chain structure. This method constructs a relay chain structure to achieve parallel processing of cross-chain data query services, and proposes a cross-chain controller and a relay chain priority query mechanism. The cross-chain controller predicts transactions based on historical data and allocates appropriate relay chains for processing cross-chain transactions. When the source chain initiates a cross-chain query transaction, it prioritizes searching on the relay chain and the prediction buffer to shorten query time. Furthermore, it combines reinforcement learning with cross-chain queries, using a DQN model to dynamically select optimal parameters based on the real-time state of the cross-chain system, ensuring full resource utilization and achieving optimal cross-chain data query efficiency. Through the above methods, this invention effectively improves the cross-chain data query efficiency between various data chains in a government consortium blockchain. Attached Figure Description

[0031] Figure 1 Data item graph for cross-chain transactions

[0032] Figure 2 This is a flowchart of the method of the present invention. Detailed Implementation

[0033] The cross-chain data query method based on the storage relay chain structure includes the following steps:

[0034] 1) Construction A storage relay chain enables parallel processing of cross-chain data query services;

[0035] (1) Construction A storage relay chain is established, and to address the issue of government information privacy, a private dataset mechanism is used to ensure data privacy for organizations applying for cross-chain services within the same relay chain.

[0036] (2) A query filter is constructed in the relay block header, mapping the hash of the transaction proposal in the block to a set in the block header. This query filter can quickly retrieve whether the transaction proposal has been initiated and exists in a certain block. For example, a bit vector is stored in each block header. By mapping the transaction proposal to the Kth position in the bit vector through a hash function and setting it to 1, the presence of the proposal in the block is determined by checking if this position is 1. If it is 0, the proposal is definitely in the block; if it is 1, it may be in the block. This can greatly improve the speed of data retrieval on the relay chain.

[0037] 2) Construct a cross-chain controller to coordinate the interaction between the source chain and the relay chain, unify the cross-chain data query transaction format, generate prediction proposals based on historical transactions, and allocate transaction proposals to the appropriate relay chain for processing;

[0038] (1) The cross-chain controller receives cross-chain requests and generates cross-chain transactions in a unified format, as shown in the format below. Figure 1 As shown:

[0039] In this context, `Crosschain_id` is the cross-chain data transaction number, `Tx_type` is the transaction type (Tx_type = 1 indicates the transaction is initiated by the source chain, Tx_type = 0 indicates the transaction is a prediction transaction obtained by searching the prediction table), `Source_chain` is the source chain (the blockchain where the node initiating the cross-chain transaction resides), `Target_chain` is the target chain (the blockchain where the cross-chain data resides; the source and target chains for prediction transactions are empty), `Req_node_id` is the ID of the node requesting the cross-chain data query, and `Read_node_id` is the ID of the node obtaining the target data. `Req_node_signature` and `Read_node_signature` are the signatures of the `Req_node` and `Read_node`, respectively. `Query_condition` is the query condition name, `Query_value` is the query condition value, `If_other` indicates whether there are other query conditions; if `If_other = true`, the corresponding `Query_condition` and `Query_value` are recorded sequentially until `If_other = false`. `Query_target` represents the target data name. `Query_response` is the query result. Query_condition, Query_value, and Query_target constitute the transaction proposal for cross-chain transactions.

[0040] (2) The cross-chain controller defines the retrieval prediction table and updates and maintains the retrieval prediction table based on historical transactions. The structure of the retrieval prediction table is shown in Table 1:

[0041] Table 1 Retrieval Prediction Structure Table

[0042]

[0043] Among them, Rel_Item_tarchain represents the target chain of the cross-chain data query request and its related attributes with other basic information chains. Basic_infochain_i represents i basic information chains. The cross-chain controller maintains a total of i retrieval prediction tables. One basic information chain corresponds to one retrieval prediction table. Different retrieval prediction tables are updated according to the different target chains of the cross-chain data query request.

[0044] All retrieval prediction tables are initially set to 0. When the cross-chain controller receives a cross-chain data query request, it reads the Target_chain, Query_condition, and Query_value of the request and updates the retrieval prediction tables corresponding to the Target_chains of the l most closely related cross-chain transactions. If a Rel_Item_tarchain from the query information of the l most closely related cross-chain transactions is related to this transaction, its corresponding retrieval prediction table is updated by incrementing the value of its association attribute corresponding to the Target_chain of the current cross-chain data query by 1.

[0045] (3) The cross-chain controller generates a prediction proposal based on the retrieval prediction table. When the cross-chain controller receives a cross-chain transaction, it obtains the Target_chain and Query_condition of the transaction. Based on the Target_chain of the transaction, it determines the retrieval prediction table, and then determines the tuples based on the Query_condition. Among the tuples with the same name as the Query_condition, it finds the underlying information chain with the largest value, which is used as the Target_chain for predicting the transaction. Combined with the Query_condition, it generates a prediction proposal. If there are multiple Query_conditions, multiple prediction proposals are generated.

[0046] (4) The cross-chain controller allocates proposals to the corresponding relay chains. The relay chain allocation strategy is defined as a triple: Strategy = (Relatedness, Frequency, Complexity). Where: Relatedness indicates whether the nodes of the target chain of the cross-chain transaction are existing members of the relay chain. Frequency is the frequency at which the relay chain is allocated transactions. Complexity indicates the complexity of the relay chain, which is determined by factors such as the management cost of the relay chain and the number of nodes.

[0047] min(Frequency*Complexity)stRelatedness=1

[0048] When allocating transactions, the cross-chain controller selects relay chains with low frequency and low complexity from among the relay chains with Relatedness=1.

[0049] 3) Define a relay chain priority query mechanism to provide a cross-chain data query process based on the relay chain and cross-chain controller;

[0050] (1) When a relay link receives a transaction, it processes it differently depending on the type of transaction:

[0051] (2) For cross-chain proposals, search n blocks on the relay chain. If there are any, read the feedback. If not, search the local prediction buffer. If there are still no blocks, interact with the target chain node, read the information, and put the proposal and the searched proposal on the chain.

[0052] (3) For a predicted proposal, search for n blocks on the relay chain. If there are any, no operation is required. If not, interact with the target chain node, read the information and send the information to the same chain node, store it in the local buffer, and do not put it on the chain. The buffer only stores the latest m proposals.

[0053] 4) Use the DQN model to dynamically select the optimal parameters based on the real-time status of the cross-chain system.

[0054] (1) DQN's agent interacts with the blockchain cross-chain model. At each stage, the cross-chain model sends the retrieval latency and statistical results of the search information on the relay chain to DQN's agent.

[0055] (2) DQN constructs a state set from retrieval latency information and search results. in This is to account for the delay in the previous retrieval stage. This is a historical record of transaction query results from the previous stage on the relay chain. The search results are also used to calculate the reward value, using the following reward function:

[0056]

[0057] in, This represents the number of successful queries of transactions from the previous block within the relay consortium blockchain. m is the number of transactions contained in the block, Tq is the time to retrieve transactions in the relay block, Tst is the time for the source chain and the target chain to interact and obtain information, υ is the cost of maintaining a relay chain, and β is the weight parameter.

[0058] (3) Input the state set into the neural network to obtain the action set. The corresponding Q-value, using a greedy algorithm, randomly selects or chooses the action corresponding to the largest Q-value to guide the construction of the next stage of the cross-chain data query structure. Here, nl represents the maximum number of blocks searched on the relay blockchain during time period l. The optimal number of relay chains for time period l.

[0059] Example 1:

[0060] Suppose that various government departments in city A maintain multiple business chains and basic information chains to store business information, identity information, electronic certificates, invoices, and other basic information. Previously, e-government data was stored in each department, but many business processes require collaboration. However, constantly querying data from each department leads to bottlenecks in efficiency. By establishing a government consortium blockchain, reliable and tamper-proof data can be accumulated. This allows future business processes to be supported by data on the consortium blockchain, meeting the needs of frequent and routine business collaboration. Therefore, the authenticity and accuracy of data in the government consortium blockchain are crucial. This necessitates frequent cross-chain data queries between business chains to obtain data from the basic information chains for verification of business information.

[0061] Suppose a business chain node initiates a cross-chain request, requiring information from the underlying information chain to verify the on-chain information of the business chain. The cross-chain request includes source chain information, information about the node initiating the cross-chain request, the target chain to be queried, and query conditions. Upon receiving the cross-chain request, the cross-chain controller standardizes and processes it, generating a cross-chain transaction, as shown in Table 2.

[0062] Table 2 Standardized Cross-Chain Transaction Table

[0063]

[0064] The cross-chain controller extracts partial transaction information to update the retrieval prediction table, specifically extracting Target_chain as the bill chain, Query_condition as the ID card number, and Query_value = 10201020345. If there is a transaction in the first l cross-chain transactions with Target_chain as the identity information chain, Query_condition as the ID card number, and Query_value = user_id, then in the retrieval prediction table corresponding to the identity information chain (Target_chain of the first l cross-chain transactions), the value corresponding to <ID card number, bill chain> is updated by incrementing it by 1, with the ID card number being a common query condition. As shown in Table 3, the behavior is the basic information chain, and the columns represent the related attributes of the identity information chain and various basic information chains. This table can record whether the system, after querying the information of the identity information chain, queries other related or the same basic information chain within a short period of time.

[0065] Table 3: Search Prediction Table Corresponding to Identity Information Chain

[0066]

[0067] After updating the retrieval table, the cross-chain controller predicts transactions based on the retrieval prediction table. For this cross-chain transaction, the Target_chain is the identity information chain, the Query_condition is the ID card number, and the Query_value = user_id. It then searches the retrieval prediction table corresponding to the identity information chain (transaction target chain) for the row corresponding to the Query_condition, i.e., the row corresponding to the ID card number. Within that row, it searches for the column with the largest value. If the column corresponding to the largest value in the ID card number row is the column of the bill chain, then the bill chain is used as the target chain for the predicted transaction. Combining the Query_condition and Query_value of the cross-chain transaction, a prediction proposal is constructed: Tx_type = 1, Source_chain = null, Target_chain is the bill chain, Query_condition is the ID card number, and Query_value = user_id.

[0068] The cross-chain controller selects relay chains with low frequency and low complexity from among the relay chains with Relatedness=1 according to the allocation strategy.

[0069] The relay chain will retrieve cross-chain proposals by searching n blocks on the relay chain. If a proposal is found, the feedback is read. If not, the proposal is searched in the local prediction buffer. If still not found, the proposal is interacted with the target chain node to read the information and then uploaded to the chain along with the retrieved proposal. The predicted proposal will be retrieved by searching n blocks on the relay chain. If a proposal is found, no action is needed. If not, the proposal is interacted with the target chain node to read the information and then sent to the same chain node. The information is stored in the local buffer but not uploaded to the chain. The buffer only stores the latest m proposals.

[0070] The retrieval time and results are input to the DQN proxy. DQN selects the parameters with the best throughput in the current state, namely the number of blocks retrieved on the relay chain and the number of relay chains, to guide the next stage of cross-chain operations.

Claims

1. A method for cross-chain query of data based on a storage relay chain structure, characterized in that, The steps are as follows: Step 1) Construction The storage relay chain realizes parallel processing of cross-chain data query services; Step 2) Construct a cross-chain controller to coordinate the interaction between the source chain and the relay chain, unify the cross-chain data query transaction format, generate prediction proposals based on historical transactions, and allocate transaction proposals to eligible relay chains for processing according to the allocation strategy; The specific method is as follows: Step 2.1) The cross-chain controller receives the cross-chain application and generates a cross-chain transaction in a unified format. The cross-chain transaction includes the following data items: , , , , , , , , , , , and ;in, For cross-chain data transaction numbers, For transaction type, This indicates that the transaction is a cross-chain transaction initiated by the source chain; This indicates that the transaction was a predicted transaction obtained by retrieving the prediction table; The source chain refers to the blockchain where the node initiating the cross-chain transaction resides. The target chain refers to the blockchain where the cross-chain data resides; the source and target chains for the predicted transaction are empty. The ID of the node Req_node that requested the cross-chain data query. To obtain the ID of the Read_node from which the target data is obtained; and The signatures for Req_node and Read_node are respectively; For the query criteria name, To retrieve values ​​for the query conditions, To determine if there are other query conditions, if Then record the corresponding records in sequence. and ,until ; Indicates the name of the target data to be queried. For the query results, , and Transaction proposals that constitute cross-chain transactions; Step 2.2) The cross-chain controller defines the retrieval prediction table and updates and maintains the retrieval prediction table based on historical transactions. The structure of the retrieval prediction table is shown in Table 1: Table 1: Retrieval Prediction Table Structure Rel_Item_tarchain Basic_infochain_1 … Basic_infochain_i Item1 Num11 … Num1i … … … … in, For cross-chain data query requests, the target chain and its related attributes to other underlying information chains are defined. for A basic information chain, jointly maintained by the cross-chain controller. Each retrieval prediction table corresponds to a basic information chain. Different retrieval prediction tables are updated based on the target chain of the cross-chain data query request. All values ​​in the retrieval prediction table are initially 0. When the cross-chain controller receives a cross-chain data transaction, it reads the cross-chain request. , , This updates the previous transactions that are similar to this cross-chain transaction. Cross-chain transactions The corresponding retrieval prediction table, first A specific piece of information from a cross-chain transaction query If the transaction is related, the corresponding retrieval prediction table is updated, and the associated attributes are compared with the current cross-chain data query. Increment the corresponding value by 1; Step 2.3) The cross-chain controller generates a prediction proposal based on the retrieval prediction table. When the cross-chain controller receives a cross-chain transaction, it obtains the transaction's... and According to the transaction Determine the retrieval prediction table, and then based on Determine the tuple, in the tuple name and Among identical tuples, the one with the largest value corresponds to the underlying information chain, which is used to predict transactions. , combined Generate prediction proposals, if If there are multiple, then multiple prediction proposals will be generated; Step 2.4) The cross-chain controller allocates the proposal to the corresponding relay chain, defining the relay chain allocation strategy as a triple: ,in: This indicates whether the node on the target chain of the cross-chain transaction is an existing member of the relay chain. The frequency at which transactions are assigned to the relay chain. This indicates the complexity of the relay chain, i.e., the management cost of the relay chain, which is determined by the number of nodes; When allocating transactions, the cross-chain controller selects... In the relay chain Low Small relay chain; Step 3) Define the relay chain priority query mechanism to provide a cross-chain data query process based on the storage relay chain and cross-chain controller; Step 4) Use the DQN model to dynamically select the optimal parameters based on the real-time status of the cross-chain system.

2. The cross-chain data query method based on a storage relay chain structure according to claim 1, characterized in that, Step 1), specifically, is as follows: Step 1.1) Construction A storage relay chain, and in response to the issue of government information privacy, a private dataset mechanism is used to ensure data privacy for organizations applying for cross-chain services within the same relay chain; Step 1.2) Construct a query filter in the relay block header, map the hash of the transaction proposal in the block to the set in the block header, and retrieve whether the transaction proposal has been initiated and exists in a certain block.

3. The cross-chain data query method based on a storage relay chain structure according to claim 1, characterized in that, Step 3), specifically, is as follows: Step 3.1) The relay link receives a transaction and processes it differently depending on the transaction type: Step 3.2) For cross-chain proposals, search on the relay chain. If a block exists, read the feedback; if not, search the local prediction buffer; if still not found, interact with the target chain node, read the information, and put the proposal and the search proposal on the chain. Step 3.3) For predicted proposals, retrieve them on the relay chain. If a block exists, no action is needed; otherwise, interact with the target chain node, read the information, send it to other chain nodes, store it in a local buffer, and do not upload it to the chain. The buffer only stores the latest information. One proposal.

4. The cross-chain data query method based on a storage relay chain structure according to claim 1, characterized in that, Step 4), specifically, is as follows: Step 4.1) DQN's agent interacts with the blockchain cross-chain model. At each stage, the cross-chain model will send the retrieval latency and statistical results of the search information on the relay chain to DQN's agent. Step 4.2) DQN constructs a state set from the retrieval delay information and the search results. ,in This is to account for the delay in the previous retrieval stage. It is a historical record of transaction query results from the previous stage on the relay chain. The retrieval results are used to calculate the reward value, and the reward function is as follows: in, This represents the number of transactions from the previous block that were successfully queried in the relay chain. , The number of transactions contained in the block. To retrieve the time of a transaction in a relay block, This refers to the time it takes for the source chain and the target chain to interact and obtain information. The cost of maintaining a relay chain These are weight parameters; Step 4.3) Input the state set into the neural network to obtain the action set. The corresponding Q-value, using a greedy algorithm, randomly selects or chooses the action corresponding to the largest Q-value to guide the construction of the next stage of the cross-chain data query structure. for The maximum number of blocks that can be searched when looking up a transaction on the relay blockchain during a given time period. for The optimal number of relay chains for a given time period.