Data processing method and device based on line segment tree structure, equipment and medium

By using segment tree structure and lazy loading technology in blockchain nodes, the problem of low off-chain data utilization during periodic callbacks of oracle contracts is solved, improving storage efficiency and data utilization, and reducing resource waste.

CN122112005APending Publication Date: 2026-05-29TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411758964.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In existing technologies, when oracle contracts periodically call back, the utilization rate of off-chain business data is low, resulting in a waste of storage resources on the blockchain. Furthermore, smart contracts need to select the truly necessary business data from a large amount of off-chain data to execute data business.

Method used

It adopts a segment tree structure and a lazy loading framework. It uses the segment tree structure to look up the condition hash value in the on-chain storage space of the blockchain node. If it is not found, it queries the off-chain oracle for data and stores off-chain business data on demand when it is really needed.

Benefits of technology

It improves the storage efficiency of off-chain data and the overall data utilization rate, reduces interaction consumption, and avoids the waste of blockchain storage resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122112005A_ABST
    Figure CN122112005A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a data processing method and device based on a line segment tree structure, equipment and medium, the method comprises: after the oracle contract receives the first transaction request sent by the business contract, the first request condition corresponding to the first condition hash value is obtained based on the first transaction request, and the condition hash value matched with the first condition hash value is found in the line segment tree structure of the on-chain storage space. If not found, the oracle contract is called to send the first off-chain query request for the first request condition to the off-chain oracle, so that the oracle returns the first off-chain business data to the oracle contract. The received first off-chain business data is taken as the first business data by calling the oracle contract, and the first business data and the first condition hash value are updated to the tree node associated with the first request condition in the on-chain storage space. By using the embodiments of the present application, the utilization rate of off-chain data can be improved, and the waste of storage resources can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of blockchain technology, and in particular to a data processing method, apparatus, device, and medium based on a segment tree structure. Background Technology

[0002] Currently, when using blockchain-related applications, oracle contracts deployed on the blockchain can periodically invoke smart contracts on the blockchain to execute relevant data services through periodic callbacks. For example, a periodic callback here specifically refers to the oracle contract on the blockchain periodically (e.g., weekly) receiving periodic callback transactions proactively uploaded by off-chain oracles for a specific data service. Based on the off-chain business data related to that data service carried in the periodic callback transaction, the oracle contract can then trigger the invocation of the smart contract on the blockchain to execute that data service.

[0003] During the implementation process, the inventors discovered that existing methods of calling oracle contracts to periodically call back corresponding smart contracts suffer from several drawbacks. First, the off-chain oracle periodically (e.g., weekly) automatically acquires off-chain business data related to the data service. Then, it periodically (e.g., weekly) packages this off-chain business data into periodic callback transactions and actively uploads them to the blockchain nodes. This allows the oracle contract, when performing periodic callbacks, to indiscriminately provide the large amount of weekly uploaded off-chain business data to the corresponding smart contract on the blockchain. This forces the smart contract to select only the truly needed business data from the large amount of off-chain business data to execute the data service. Consequently, after successfully executing the data service through the smart contract, the oracle contract is needed to indiscriminately upload the large amount of off-chain business data carried in the periodic callback transaction to the blockchain. This results in the entire blockchain storing excessive amounts of other business data that are not needed for executing the data service. Therefore, when using oracle contracts for periodic callbacks, there is a waste of on-chain storage resources due to the low utilization rate of the large amount of off-chain business data acquired from the off-chain. Summary of the Invention

[0004] This application provides a method, apparatus, device, and medium for processing segment tree structure data, which can improve the storage efficiency of the storage module in the blockchain node for the smartphone to obtain off-chain data, and uses a lazy loading framework to improve the overall data utilization and reduce interaction consumption.

[0005] This application provides a data processing method based on a segment tree structure, including:

[0006] The oracle contract is invoked to obtain the first condition hash value corresponding to the first request condition from the first transaction request. The first transaction request is sent to the oracle contract by the first business terminal corresponding to the first business object through invoking the first business contract. The first condition hash value is obtained by the first business contract performing a hash calculation on the first request condition. The first request condition refers to the request condition used to request the acquisition of the first business data associated with the data business.

[0007] Search for the condition hash value that matches the first condition hash value among the condition hash values ​​recorded in the tree nodes of the segment tree structure stored in the on-chain storage space.

[0008] If no matching condition hash value is found, and it is determined that the first business data does not exist in the on-chain storage space, a first off-chain query request for the first request condition is sent to the oracle through the oracle contract. The first off-chain query request is used to instruct the oracle to obtain the first off-chain business data corresponding to the first condition hash value when it calculates the first condition hash value corresponding to the first request condition, and to return the first condition hash value and the first off-chain business data to the oracle contract based on the first off-chain query request.

[0009] The oracle contract is invoked to take the first off-chain business data as the first business data to be written into the on-chain storage space, and the first condition hash value and the first business data are updated and stored in the tree node associated with the first request condition in the on-chain storage space.

[0010] One embodiment of this application provides a data processing device based on a segment tree structure, including:

[0011] The first condition hash value acquisition module is used to call the oracle contract to obtain the first condition hash value corresponding to the first request condition from the first transaction request. The first transaction request is sent by the first business terminal corresponding to the first business object to the oracle contract by calling the first business contract. The first condition hash value is obtained by the first business contract performing hash calculation on the first request condition. The first request condition refers to the request condition used to request the acquisition of the first business data associated with the data business.

[0012] The on-chain condition hash value lookup module is used to search for a condition hash value that matches the first condition hash value among the condition hash values ​​recorded in the tree nodes of the segment tree structure stored in the on-chain storage space.

[0013] The first off-chain query request sending module is used to send a first off-chain query request for the first request condition to the oracle through the oracle contract if no condition hash value matching the first condition hash value is found and it is determined that the first business data does not exist in the on-chain storage space. The first off-chain query request is used to instruct the oracle to obtain the first off-chain business data corresponding to the first condition hash value when it calculates the first condition hash value corresponding to the first request condition, and to return the first condition hash value and the first off-chain business data to the oracle contract based on the first off-chain query request.

[0014] The first business data update storage module is used to call the oracle contract to take the first off-chain business data as the first business data to be written into the on-chain storage space, and update and store the first condition hash value and the first business data into the tree node associated with the first request condition in the on-chain storage space.

[0015] Among them, the tree nodes on the segment tree structure include the first type of nodes; the node data structure corresponding to the first type of nodes includes the business type of the data service, the business dimension data corresponding to the business type, and the hash storage list; the business dimension data corresponding to the first type of nodes is used to characterize the first dimension search range of the data service in each business dimension; the hash storage list corresponding to the first type of nodes is used to record the conditional hash value in the first dimension search range.

[0016] The on-chain conditional hash value lookup module includes:

[0017] The first-dimensional search range acquisition unit is used to call the oracle contract to obtain the segment tree structure that matches the business type of the data business, and to obtain the first-dimensional search range of the data business in each business dimension from the storage data structure corresponding to the first type of node in the segment tree structure.

[0018] The first range comparison result acquisition unit is used to acquire the target condition query range indicated by the first request condition, compare the target condition query range with the first dimension search range, and obtain the first range comparison result.

[0019] The condition hash value lookup unit is used to search for a condition hash value that matches the first condition hash value in the condition hash values ​​recorded in the first dimension search range in the hash storage list corresponding to the first type of node if the first range comparison result indicates that the target condition query range is the first dimension search range.

[0020] In this segment tree structure, tree nodes include first-type child nodes; first-type child nodes are the child nodes of the first-type nodes; if the segment tree structure is a one-dimensional segment tree structure, then the child nodes of the first-type nodes include first-child nodes and second-child nodes; the node data structure corresponding to the first-child nodes and second-child nodes includes the business type of the data service, the business dimension data corresponding to the business type, and a hash storage list; the business dimension data corresponding to the first-child node is used to represent the first sub-dimension search range of the data service in each business dimension, and the business dimension data corresponding to the second-child node is used to represent the second sub-dimension search range of the data service in each business dimension; the hash storage list corresponding to the first-child node is used to record the conditional hash value in the first sub-dimension search range, and the hash storage list corresponding to the second-child node is used to record the conditional hash value in the second sub-dimension search range;

[0021] The on-chain conditional hash lookup module also includes:

[0022] The second range comparison unit is used to compare the target condition query range with the first sub-dimension search range and the second sub-dimension search range respectively if the first range comparison result indicates that the target condition query range is the range in the first dimension search range, and obtain the second range comparison result.

[0023] The child node hash list lookup unit is used to search for a condition hash value that matches the first condition hash value in the condition hash value recorded in the hash storage list corresponding to the first child node in the first sub-dimension search range if the second range comparison result indicates that the target condition query range is the first sub-dimension search range and the target condition query range does not belong to the range in the second sub-dimension search range.

[0024] The on-chain conditional hash value lookup module also includes:

[0025] The overlapping result processing unit is configured to, if the second range comparison result indicates that the target condition query range and the first sub-dimension search range have a first overlapping range, and the target condition query range and the second sub-dimension search range have a second overlapping range, then search for a condition hash value that matches the first condition hash value in the condition hash value recorded in the hash storage list corresponding to the first type of node in the first dimension search range; the first overlapping range is the range in the first sub-dimension search range, and the second overlapping range is the range in the second sub-dimension search range.

[0026] The device also includes:

[0027] The polling request acquisition module is used to acquire polling requests sent by the oracle;

[0028] The call log checking module is used to check the events generated by the call logs in the oracle contract based on the polling request, and obtain the event checking results.

[0029] The hash registration sending module is used to send a hash registration event to the oracle when the event check result indicates that the call record generation event is the event corresponding to the generation of the first contract call record; the hash registration event is used to instruct the oracle to perform hash registration for the first condition hash value.

[0030] The first business data update and storage module includes:

[0031] The callback transaction acquisition unit is used to acquire the first callback transaction returned by the oracle in response to the first off-chain query request; the first callback transaction carries the first condition hash value and the first off-chain business data;

[0032] The callback transaction parsing unit is used to call the oracle contract to parse the first callback transaction, obtain the first condition hash value and the first off-chain business data, and retrieve the first contract call record corresponding to the first condition hash value from the oracle contract. The first contract call record refers to the record recorded in the oracle contract with the first condition hash value as the key and the first merge request dataset as the value. The first merge request dataset is a request dataset used to merge multiple transaction requests corresponding to the same request condition. The multiple transaction requests include the first transaction request.

[0033] The response data backfilling unit is used to backfill the first business data as the first request response data into the first transaction request in the first contract request dataset when the oracle contract is called to use the first off-chain business data as the first business data to be written into the on-chain storage space, so as to obtain the first contract call record after the callback.

[0034] The first business data storage unit is used to update and store the first condition hash value and the first business data in the tree node associated with the first request condition in the on-chain storage space based on the first contract call record after the callback.

[0035] The device also includes:

[0036] The callback detection module is used to perform callback detection on the first transaction request based on the first contract call record after the callback, and obtain the callback detection result.

[0037] The callback function execution module is used to determine the first callback function for calling the first business contract based on the callback parameters if the callback detection result indicates that the first transaction request carries callback parameters for the first business contract, and to send the first business data back to the first business contract when the contract address of the first business contract is obtained through the first callback function.

[0038] The execution result return module is used to execute data services through the first business contract, obtain the first business execution result corresponding to the data service, and return the first business execution result to the first business terminal corresponding to the business contract.

[0039] Among them, multiple transaction requests include a second transaction request in addition to the first transaction request. The second transaction request is sent by the second business terminal corresponding to the second business object to the oracle contract by calling the second business contract. The second request condition refers to the request condition used to request the acquisition of the first business data.

[0040] The device also includes:

[0041] The second business contract processing module is used to simultaneously send the first business data back to the second business contract when sending the first business data back to the first business contract.

[0042] The device also includes:

[0043] The on-chain business data acquisition module is used to retrieve the first business data from the node tree structure corresponding to the target tree node by calling the oracle contract if a condition hash value matching the first condition hash value is found in the on-chain storage space.

[0044] The business data return module is used to call the oracle contract to return the first business data to the first business contract, execute the data business through the first business contract, obtain the second business execution result corresponding to the data business, and return the second business execution result to the first business terminal corresponding to the business contract.

[0045] The request parameters for the first transaction request include callback parameters and request sender parameters. The request sender parameters are used to represent the contract address of the first business contract, and the callback parameters are used to instruct the oracle contract to return the first business data to the first business contract based on the contract address of the first business contract when it obtains the first business data.

[0046] The business data return module includes:

[0047] The callback function execution unit is used to call the callback function indicated by the callback parameter in the oracle contract, obtain the business address of the business contract indicated by the request sender parameter, and return the first business data to the first business contract based on the contract address of the business contract.

[0048] The data service execution unit is used to call the business execution function associated with the data service in the first business contract based on the first business data, execute the data service, and obtain the second business execution result corresponding to the data service.

[0049] The execution result return unit is used to return the execution result of the second service to the first service terminal.

[0050] The device also includes:

[0051] The transaction request acquisition module is used to acquire multiple transaction requests associated with data services; the multiple transaction requests include a first transaction request and a second transaction request, and the second transaction request is a transaction request other than the first transaction request;

[0052] The second condition hash value acquisition module is used to call the oracle contract to obtain the second condition hash value corresponding to the second request condition from the second transaction request;

[0053] The first contract call record generation module is used to merge multiple transaction requests into a first merged request dataset through an oracle contract when the second condition hash value is consistent with the first condition hash value, and when it is determined that the second condition request is the same as the first request condition. The module also generates a first contract call record to record the first condition hash value and the first merged request dataset. The first contract call record is used to indicate that when the first business data is obtained, the first business data is used as the first request response data to fill each of the multiple transaction requests.

[0054] The device also includes:

[0055] The second contract call record generation module is used to determine that the second request condition is different from the first request condition if the second condition hash value is different from the first condition hash value, and to generate a second contract call record for recording the second condition hash value and the second merged request dataset when creating the second request merged dataset corresponding to the second transaction request through the oracle contract; the second contract call record is used to indicate that when the second business data required for the second transaction request is obtained, the second business data is filled back into the second transaction request as the second request response data.

[0056] The device also includes:

[0057] The third transaction request acquisition module is used to call the oracle contract to obtain the third condition hash value corresponding to the third request condition from the third transaction request when the third transaction request is acquired; the acquisition timestamp of multiple transaction requests is the first timestamp, and the acquisition timestamp of the third transaction request is the second timestamp; the second timestamp is the timestamp after the first timestamp.

[0058] The conditional hash value comparison module is used to compare the third conditional hash value with the first conditional hash value if the second timestamp is a timestamp within the time interval threshold range corresponding to the first timestamp, and obtain the hash value comparison result.

[0059] The first merge request dataset update module is used to add the third transaction request to the first merge request dataset through an oracle contract if the hash value comparison result indicates that the third condition hash value is consistent with the first condition hash value.

[0060] The device also includes:

[0061] The third contract call record generation module is used to generate a third contract call record to record the third condition hash value and the third merged request dataset when calling the oracle contract to create the third request merged dataset corresponding to the third transaction request if the hash value comparison result indicates that the third condition hash value is different from the first condition hash value. The third contract call record is used to indicate that when the third business data required for the third transaction request is obtained, the third business data will be filled back into the third transaction request as the third request response data.

[0062] Among them, the tree nodes in the segment tree structure include the second type of nodes; the node data structure corresponding to the second type of nodes includes the business type of the data service, the business dimension data corresponding to the business type, and the hash storage list; the business dimension data corresponding to the second type of nodes is used to characterize the second dimension search range of the data service in each business dimension;

[0063] The first business data update and storage module includes:

[0064] The first business data acquisition unit is used to call the oracle contract to use the first off-chain business data as the first business data to be written into the on-chain storage space.

[0065] The second-dimensional search range acquisition unit is used to call the oracle contract to obtain the segment tree structure that matches the business type of the data business, and to obtain the second-dimensional search range of the data business in each business dimension from the storage data structure corresponding to the second type of node of the segment tree structure.

[0066] The third range comparison unit is used to obtain the target condition query range indicated by the first request condition, compare the target condition query range with the second dimension search range, and obtain the third range comparison result.

[0067] The second type of node update unit is used to record the first condition hash value and the first business data in the hash storage list corresponding to the second type of node if the third range comparison result indicates that the target condition query range is the first dimension search range.

[0068] In this segment tree structure, tree nodes include second-type child nodes; second-type child nodes are the child nodes of second-type nodes; if the segment tree structure is a one-dimensional segment tree structure, then the child nodes of second-type nodes include third-type child nodes and fourth-type child nodes; the node data structure corresponding to the third-type child nodes and fourth-type child nodes includes the business type of the data service, the business dimension data corresponding to the business type, and a hash storage list; the business dimension data corresponding to the third-type child node is used to represent the third sub-dimension search range of the data service in each business dimension, and the business dimension data corresponding to the fourth-type child node is used to represent the fourth sub-dimension search range of the data service in each business dimension;

[0069] The first business data update and storage module also includes:

[0070] The fourth range comparison unit is used to compare the target condition query range with the third sub-dimension search range and the fourth sub-dimension search range respectively if the third range comparison result indicates that the target condition query range is the range in the first dimension search range, and obtain the fourth range comparison result.

[0071] The third child node update unit is used to record the first condition hash value and the first business data in the hash storage list corresponding to the third child node if the fourth range comparison result indicates that the target condition query range is the third sub-dimension search range and the target condition query range does not belong to the range in the fourth sub-dimension search range.

[0072] One aspect of this application provides a computer device, including a memory and a processor. The memory is connected to the processor, the memory is used to store computer programs, and the processor is used to call the computer programs so that the computer device executes the method provided in one aspect of this application.

[0073] One aspect of this application provides a computer-readable storage medium storing a computer program adapted to be loaded and executed by a processor, so that a computer device having a processor performs the method provided in one aspect of this application.

[0074] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method provided in one aspect above. Embodiments of this application may...

[0075] In this embodiment, when a blockchain application is integrated and running in a business terminal (e.g., the first business terminal corresponding to the first business object), the business terminal (e.g., the first business terminal) calls a business contract deployed in a blockchain node (i.e., a smart contract related to the blockchain application in the business terminal) to execute related data services. Here, one data service can correspond to one or more business contracts. For ease of understanding, this embodiment refers to the business contract called by the first terminal device for the data service as the first business contract. It should be understood that before the blockchain node calls the first business contract to execute the data service requested by the first terminal device, it needs to quickly query the on-chain storage space of the blockchain node through an oracle contract deployed on the blockchain node to see if the business data required to execute the data service exists. This means that at this time, the oracle contract in the blockchain node will receive the transaction request (i.e., the first transaction request) sent by the first business contract, and then, when writing the first transaction request into the oracle contract, it can call the oracle contract to obtain the first condition hash value corresponding to the first request condition from the first transaction request. Understandably, the first condition hash value here is obtained by hashing the first request condition requested by the first business contract for the first business object. This first request condition refers to the request condition used to request the acquisition of first business data associated with the data business. Furthermore, blockchain nodes can search in the segment tree structure (specifically, the condition hash values ​​recorded by the tree nodes in the segment tree structure) in the on-chain storage space to see if there is first business data matching the first condition hash value. It should be understood that, in this embodiment, any tree node on the segment tree structure deployed in the on-chain storage space can be used to store off-chain business data uploaded on demand by oracles deployed off-chain (i.e., under the blockchain maintained by the blockchain node). It should be noted that the storage structure of the on-chain storage space involved in this implementation is a segment tree structure, which differs from the chain storage structure of a blockchain composed of blocks containing a large number of transactions (e.g., callback transactions). Therefore, to reduce the complexity of directly traversing and searching for business data in a large number of callback transactions in blocks on the blockchain, this embodiment deploys an additional on-chain storage space on the blockchain node for storing the segment tree structure, and uses the segment tree structure in this on-chain storage space to reduce the complexity of searching for business data. Therefore, if the blockchain node does not find the first business data in the on-chain storage space, it needs to send a first off-chain query request for the first request condition to the off-chain oracle deployed on demand.Understandably, the first off-chain query request here can instruct the oracle, upon calculating the first condition hash value corresponding to the first request condition, to retrieve the first off-chain business data corresponding to the first condition hash value, and return the first condition hash value and the first off-chain business data to the oracle contract based on the first off-chain query request. Furthermore, the blockchain node can invoke the oracle contract to use the retrieved first off-chain business data as the first business data to be written into the on-chain storage space, thereby updating the tree node associated with the first request condition in the on-chain storage space with the first condition hash value and the first business data. Therefore, in this embodiment, the oracle does not need to periodically upload large amounts of off-chain business data to the blockchain node. Instead, it utilizes lazy loading technology to return the requested off-chain business data (e.g., the first off-chain business data) to the blockchain node in the form of a transaction only when the first business object (e.g., the user) actually needs it. Thus, for the segment tree structure in the on-chain storage space, the blockchain node only stores the requested off-chain business data (e.g., the first off-chain business data) after packaging the transaction carrying the first off-chain business data onto the chain. This means that by implementing on-demand storage through the segment tree structure in the on-chain storage space, this embodiment can not only improve the utilization rate of the off-chain business data (i.e., the first off-chain business data) stored in the on-chain storage space, but also fundamentally avoid wasting the storage resources of the blockchain maintained by the blockchain node. Attached Figure Description

[0076] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0077] Figure 1 This is a schematic diagram of a network architecture provided in an embodiment of this application;

[0078] Figure 2 This is a schematic diagram of a data interaction scenario provided in an embodiment of this application;

[0079] Figure 3 This is a schematic diagram of a data processing method based on a segment tree structure provided in an embodiment of this application;

[0080] Figure 4This is a schematic diagram illustrating a scenario where an oracle contract retrieves business data from on-chain storage space, as provided in an embodiment of this application.

[0081] Figure 5 This is a schematic diagram illustrating a scenario for querying business data based on a segment tree structure, as provided in this application example.

[0082] Figure 6 This is a schematic diagram illustrating another scenario for querying business data based on a segment tree structure, as provided in this application example.

[0083] Figure 7 This is another scenario illustration provided by the example in this application for querying business data based on a segment tree structure;

[0084] Figure 8 This is a schematic diagram illustrating a scenario where an oracle contract generates contract call records, as provided in an embodiment of this application.

[0085] Figure 9 This is a schematic diagram illustrating a scenario where an oracle performs hash registration, as provided in an embodiment of this application.

[0086] Figure 10 This is a flowchart illustrating another data processing method based on a segment tree structure provided in an embodiment of this application;

[0087] Figure 11 This is a schematic diagram illustrating a scenario of oracle contract processing callback transactions provided in an embodiment of this application;

[0088] Figure 12 This is a schematic diagram illustrating a scenario of delayed tag propagation in a segment tree, as provided in an embodiment of this application.

[0089] Figure 13 This is a schematic diagram of an oracle processing data request flow provided in an embodiment of this application;

[0090] Figure 14 This is a schematic diagram of a process for processing business data using an oracle contract, provided in an embodiment of this application.

[0091] Figure 15 This is a schematic diagram of a data processing device based on a segment tree structure provided in an embodiment of this application;

[0092] Figure 16 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0093] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0094] Blockchain: Blockchain is a distributed ledger technology in the field of information technology. It generally consists of consensus, transaction blocks and state data storage, cryptographic identity security and other components. Because the ledger is stored in a distributed manner and the blocks are agreed upon, it has the characteristics of being immutable, traceable and jointly maintained.

[0095] It is understood that, in the embodiments of this application, the first business terminal corresponding to the first business object (e.g., user) integrates and runs a relevant blockchain application using blockchain technology, which can then call the first business contract existing with the blockchain node to execute the first data business.

[0096] Segment Tree: A segment tree is an advanced data structure used for efficiently handling range queries and updates. It is particularly suitable for scenarios requiring frequent range queries and updates, such as in competitive programming, database systems, and some real-time processing systems. The advantages of segment trees are: efficiency (the time complexity of both range queries and range updates is O(log n)), flexibility (segment trees can handle not only static arrays but also dynamic updates, suitable for scenarios requiring frequent modifications and queries), and scalability (segment trees can be extended to other advanced data structures, such as binary indexed trees, persistent segment trees, and multidimensional segment trees, to handle more complex data and requirements).

[0097] In this application example, a segment tree structure is allocated within the blockchain node for on-chain storage. This allows the blockchain node to leverage the efficiency, flexibility, and scalability of segment trees to efficiently search for or store relevant business data. When the first business contract in the blockchain node is invoked and the first data business is executed by the first business terminal, the blockchain node can search for the first business data within the segment tree structure of the on-chain storage space. The segment tree in the on-chain storage space can be a multi-dimensional segment tree to accommodate the storage of business data of different data types (e.g., the first business data).

[0098] Lazy loading is an optimization technique designed to improve system performance and resource utilization efficiency. Its core idea is to delay the loading or initialization of resources until they are actually needed, thus avoiding unnecessary resource consumption. It can be used to optimize segment trees, aiming to efficiently handle range update operations. With lazy loading, each segment tree node maintains a delay flag to record update operations that need to be postponed. The delay flag is applied to that node and its child nodes only when a query or update operation accesses it, thus avoiding traversing the entire range during updates. Specific application scenarios include webpage loading, database queries, and modular programming. It primarily allocates resources on demand, effectively improving system performance and response speed.

[0099] Oracles are crucial components of blockchain and smart contract systems, providing off-chain data (such as real-world events) to on-chain smart contracts. Due to the self-contained and tamper-proof nature of blockchain, it cannot directly access external data, but smart contracts often rely on this data to execute. Specific applications include: Decentralized Finance (DeFi): obtaining real-time market prices and updating asset values ​​in contracts; Insurance: automatically executing payout clauses based on weather and disaster data provided by oracles; Predicting market outcomes: providing data such as sporting events and election results to ensure fair execution of smart contracts; Supply chain management: verifying logistics data to ensure transparency and reliability. Oracles expand the application scenarios and functionality of smart contracts by providing reliable and accurate external data.

[0100] Understandably, in this embodiment, after the smart contract in the blockchain node receives the first transaction request from the first business contract, it can search for the corresponding first business data in the segment tree structure of the on-chain storage space based on the first request conditions carried in the first transaction request. If the blockchain node does not find the first business data in the on-chain storage space, it will call the oracle contract to send a first query request to the off-chain oracle device, so that the oracle device returns a callback transaction carrying the first off-chain business data to the blockchain node based on the first query request. Thus, this embodiment utilizes lazy loading technology, returning the requested first off-chain business data to the blockchain node as a transaction only when the first business object actually needs it. In this embodiment, lazy loading technology is also used for the segment data structure of the on-chain storage space, utilizing lazy marking to assist in updating the segment tree. This allows the blockchain node to reduce the storage time of business data (e.g., the first off-chain business data) by using lazy marking technology during the process of receiving the off-chain business data returned by the oracle and storing it in the on-chain storage space.

[0101] For further details, please see Figure 1 , Figure 1 This is a schematic diagram of a network architecture provided in an embodiment of this application. Figure 1 As shown, the network architecture may include a blockchain network 100a, a business terminal cluster 100b, and an oracle device cluster 100c.

[0102] The service terminal cluster 100b can include one or more service terminals; there is no limit to the number of service terminals. For example... Figure 1 As shown, the business terminal cluster 100b can specifically include business terminal 110a, business terminal 110b, ..., business terminal 110n. Among them, the business terminals in the business terminal cluster 100b can run blockchain-related applications (e.g., data element blockchain platform, supply chain management blockchain system, etc.).

[0103] Among them, such as Figure 1 The blockchain network 100a shown may include multiple blockchain nodes (i.e., consensus nodes participating in record-keeping on the blockchain). The number of blockchain nodes (i.e., consensus nodes participating in record-keeping on the blockchain) in blockchain network 100a will not be limited here. Figure 1 As shown, the multiple blockchain nodes in blockchain network 100a may specifically include blockchain node 10a, blockchain node 10b, blockchain node 10c, and blockchain node 10d. Figure 1 As shown, a business terminal in the business terminal cluster 100b (e.g., business terminal 110a) can establish a network connection with blockchain nodes 10a, 10b, 10c, and 10d to interact with a blockchain node in the blockchain network 100a when the business terminal in the business terminal cluster 100b is connected to the blockchain network 100a. For example, when business terminal 110a runs a specific blockchain-related application, it can interact with blockchain node 10a in the blockchain network 100a to call the smart contract in blockchain node 10a to execute related data services (e.g., weather analysis, insurance claims, etc.).

[0104] The oracle device cluster 100c can include one or more oracle devices; there is no limit to the number of oracle devices. For example... Figure 1As shown, the oracle device cluster 100c can specifically include oracle devices 120a, 120b, ..., 120n. A specific oracle device in the oracle device cluster 100c (e.g., oracle device 120a) can establish a network connection with blockchain nodes 10a, 10b, 10c, and 10d to interact with a specific blockchain node in blockchain network 100d when the oracle device in the oracle device cluster 100c is connected to the blockchain network 100d. It can be understood that when the smart contract of a blockchain node (e.g., blockchain node 10a) in blockchain network 100a executes data services, it can send transaction requests to the oracle contract in that blockchain node, enabling the oracle contract in the blockchain node to search for business data related to the data services on the chain. If the blockchain node cannot find the business data on the chain, it will call the oracle contract to send an off-chain business data query request to the off-chain oracle device (e.g., oracle device 120a), so that the oracle device can return the off-chain business data to the oracle contract in the blockchain node.

[0105] It should be understood that the oracle devices in oracle device cluster 100c (e.g., oracle device 120a) can return off-chain business data to the oracle contract in the blockchain node (e.g., blockchain node 10d) by sending callback transactions. Upon receiving the callback transaction, the blockchain node will treat this off-chain business data as business data and invoke the oracle contract to perform a callback to the business contract, enabling the business contract to successfully execute the relevant data business using this business data. The blockchain node will then write the completed callback transaction to... Figure 1 The blockchain shown can specifically be blockchain 10e maintained by blockchain nodes deployed in blockchain network 100d.

[0106] In this embodiment of the application, the oracle device in the oracle device cluster 100c can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0107] In this embodiment of the application, the service terminals in the service terminal cluster 100b may include: smartphones, tablets, laptops, desktop computers, wearable devices (such as smartwatches and smart bracelets), smart home devices, head-mounted devices, smart vehicle terminals, and other smart terminals.

[0108] In this embodiment, a business object (e.g., a user) can use blockchain-related applications through a business terminal (e.g., a first business terminal). During the execution of these applications, the business terminal can invoke a business contract within a blockchain node to execute related data services. These data services can include weather analysis, insurance claims, etc., without specifying the exact type of data service. During the execution of data services, the business contract may use specific business data; for example, weather analysis might use the weather conditions for a particular week. In this case, the business contract sends a transaction request containing request conditions and a hash value of those conditions to the smart contract to request the business data. The hash value of the request conditions is obtained by hashing the request conditions. When the oracle contract receives the transaction request from the business contract, the blockchain node invokes the oracle contract to search for the business data in the on-chain storage space of the blockchain node. This on-chain storage space contains a segment tree structure for storing data. If the blockchain node does not find the business data in the on-chain storage space, it invokes the oracle contract to initiate a query request for the business data from an off-chain oracle device (e.g., a first off-chain query request). Once the oracle receives the query request, it will search for the relevant business data in the off-chain dataset and return the found business data to the blockchain node.

[0109] After receiving the business data, the blockchain node invokes the oracle contract to return the data to the business contract and incorporates it as transaction response data into the transaction request, thus completing the transaction. Next, the blockchain node stores the business data in a segment tree structure within the on-chain storage space. Specifically, the blockchain node invokes the oracle contract to find the tree node associated with the business data within a segment tree structure related to the data business, and stores the business data and its request condition hash value in that tree node. Subsequently, if a new business contract requests the same business data, the blockchain node can directly retrieve it from that tree node.

[0110] For further details, please refer to [link / reference]. Figure 2 , Figure 2 This is a schematic diagram illustrating a data interaction scenario provided in an embodiment of this application. For example... Figure 2As shown, users can use various blockchain applications in business terminal 20a (i.e., the first business terminal). These applications primarily include data element blockchain platforms, supply chain management blockchain platforms, and resource settlement blockchain platforms. During the operation of a particular blockchain application, it can invoke the business contract 21a (i.e., the first business contract) in blockchain node 20b to execute corresponding data transactions. During this execution, business contract 21a may need to use specific business data (i.e., the first business data). The blockchain node can then invoke business contract 21a to execute S11, sending a transaction request (i.e., the first transaction request) to oracle contract 21b to request the first business data. This first transaction request includes the first request condition for the first business data and the corresponding first condition hash value. Upon receiving the transaction request, oracle contract 21b in the blockchain node searches for the first business data in storage module 21c (i.e., on-chain storage space) using the first request condition and the first condition hash value. The storage module 21c uses a segment tree structure to store data, and supports the blockchain node 20b to perform range lookups and updates on the data.

[0111] If blockchain node 20b does not find the first business data in storage module 21c, it will execute step S12, calling oracle contract 21b to send a first off-chain query request to oracle device 20c, which exists in the blockchain network. This allows oracle device 20c to register a condition hash based on the request condition hash value carried in the off-chain query request. The query engine of oracle device 20c will search for the first off-chain business data corresponding to the registered condition hash value in the off-chain dataset, and execute step S13, returning the found first off-chain business data to blockchain node 20b. Here, the first off-chain business data is the same as the first business data requested by the business contract, which means that blockchain node 20b has received the first business data. It will then call oracle contract 21b to populate the received first transaction request with the first business data as transaction response data, and return the first business data to business contract 21a. At this time, the blockchain node can call oracle contract 21b to execute S14, storing the first business data received from oracle device 20c in storage module 21c. The storage module 21c maintains a segment tree associated with data services. The oracle contract 21b searches for the segment tree node corresponding to the first request condition in the segment tree and stores the first data service and the hash value of the first condition corresponding to the target data service in the segment tree node.

[0112] In this embodiment, the oracle does not need to periodically upload large amounts of off-chain business data to the blockchain node. Instead, it utilizes lazy loading technology to return the requested off-chain business data (e.g., the first off-chain business data) to the blockchain node in the form of a transaction only when the first business object (e.g., the user) actually needs it. Thus, for the segment tree structure in the on-chain storage space, the blockchain node only stores the requested off-chain business data (e.g., the first off-chain business data) after packaging the transaction carrying the first off-chain business data onto the chain. This means that by implementing on-demand storage through the segment tree structure in the on-chain storage space, this embodiment can not only improve the utilization rate of the off-chain business data (i.e., the first off-chain business data) stored in the on-chain storage space, but also fundamentally avoid wasting the storage resources of the blockchain maintained by the blockchain node.

[0113] It is understood that in the specific implementation of this application, business data of users, enterprises, institutions and other objects may be involved (e.g., users' invoicing information, credit information, tax refunds, etc., and enterprises' income and loss, enterprise qualifications and other information). When the above embodiments of this application are applied to specific products or technologies, permission or consent from users, enterprises, institutions and other objects is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of relevant countries and regions.

[0114] For further details, please see Figure 3 , Figure 3 This is a schematic diagram illustrating a data processing method based on a segment tree structure provided in an embodiment of this application. It is understood that this data processing method can be executed by blockchain nodes in a blockchain network. These blockchain nodes are equipped with oracle contracts associated with oracles, business contracts associated with data services, and on-chain storage space corresponding to the segment tree structure. The blockchain nodes described above can be... Figure 1 Blockchain nodes 10a, 10b, 10c, and 10d in the blockchain network 100a. It is understood that, in this embodiment, the data processing method based on a segment tree structure may include at least steps S101 to S104.

[0115] Step S101: Call the oracle contract to obtain the first condition hash value corresponding to the first request condition from the first transaction request;

[0116] Specifically, in step S101, the blockchain node invokes the oracle contract to obtain the first transaction request sent from the first business contract. This first transaction request is sent by the first business terminal corresponding to the first business object to the oracle contract by invoking the first business contract. The first business object can be a user using the business terminal, and the first business contract is a smart contract existing in the blockchain node that can be used to execute specific data transactions. It can be understood that a user wants to use a blockchain application on the business terminal, and thus invokes the first business contract existing in the blockchain node to execute related data transactions. The blockchain applications here mainly include platforms or systems that require blockchain technology, such as data element blockchain platforms, supply chain management blockchain systems, and resource settlement blockchain platforms; this application example does not specify a particular application. The specific data transactions executed by the business contract can be data processing transactions such as weather analysis and insurance claims. For example, executing the data transaction of the relevant business contract to analyze the weather conditions for the past week, etc. The specific execution process and functions of data transactions are diverse, and will not be elaborated further here. Understandably, data services can use specific business data to perform related business operations. For example, if a data service is analyzing the weather conditions of the past week, then the weather data of the past week can be used as specific business data for specific analysis.

[0117] In this embodiment, when a business contract wants to use the first business data, it sends a first transaction request to the oracle contract in the blockchain node to obtain the first business data. This first transaction request includes the first request condition corresponding to the first business data and the first condition hash value corresponding to the first request condition. The request condition (e.g., the first request condition) is the specific condition range of the business data in each classification dimension of its data type. For example, when the business data is weather information for the past week, the request condition (e.g., the first request condition) in the time dimension is the time range of the past week (e.g., from November 1st to November 7th), while in the weather information dimension it includes specific dimensions such as temperature and whether it rained. Different business data have different data classification methods, such as time series data, time data, state data, etc. Different data may be classified into different types from multiple dimensions, and business data has its corresponding condition range in each dimension. Further examples are not provided here. The condition hash value (e.g., the first condition hash value) is obtained by calculating the hash value of the request condition (e.g., the first request condition).

[0118] After the oracle contract receives the first transaction request sent by the first business contract, the blockchain node will call the oracle contract to obtain the request conditions and the hash value of the request conditions in the transaction request, so as to find the target business data of the transaction request in the on-chain storage space.

[0119] Step S102: Search for a condition hash value that matches the first condition hash value among the condition hash values ​​recorded in the tree nodes of the segment tree structure stored in the on-chain storage space.

[0120] Specifically, after the oracle contract receives the first transaction request from the first business contract, the blockchain node uses the first request condition and the first condition hash value carried in the first transaction request to search for the first business data requested by the first business contract in the on-chain storage space. The on-chain storage space uses a segment tree structure to store the business data; therefore, querying the target business data (e.g., the first business data) also uses the segment tree query logic. A segment tree is a data structure that stores data based on a dimensional search range; the data is stored in a specific tree node of the tree structure. A segment tree can query the corresponding tree node from the root node within a fixed search range. In this way, accessing a tree node only requires traversing a path from the root node, without needing to perform key-value traversal of the stored data. It is known that due to different data types, data can be classified and integrated from multiple dimensions to support efficient range searches. Correspondingly, in the segment tree structure, we can use multi-dimensional segment trees to handle cases where data has multiple dimensions, including two-dimensional and three-dimensional segment trees, etc. Taking a one-dimensional segment tree as an example, the dimensional search range represented by the business dimension data in the segment tree node is a one-dimensional interval. When the stored business data is weather information, the corresponding dimensional search range is the date interval to which the weather belongs. However, in a two-dimensional segment tree, the dimensional search range in the segment tree node is a rectangular area. If the data type is weather temperature, the dimensional search range has two dimensions: one dimension represents the date interval of a certain period, and the other dimension is the time interval of a certain day. The node stores the specific temperature at a specific time on that day. The specific dimensional division of the segment tree is determined by the data type to be stored, which will not be elaborated further here.

[0121] It is understandable that when the first business contract in a blockchain node executes a specific data business (e.g., the first data business), the data type of the business data requested by the first business contract may also be different if the executed data business is different. It is also understandable that different data types of business data may differ in their dimensional division and classification, thus requiring the use of segment tree structures with different dimensions for storage. In this embodiment, after obtaining off-chain business data (e.g., the first off-chain business data) from an incoming oracle device, the blockchain node stores the off-chain business data in the corresponding segment tree structure according to its data type. If common oracle-provided data is classified by data type, there are at least 10 possible classifications.

[0122] 1. Price data: Price data from financial markets and exchanges, such as stocks and foreign exchange.

[0123] 2. Weather data: Meteorological information, including temperature, rainfall, wind speed, etc. For example, weather data used in agricultural insurance smart contracts.

[0124] 3. Sports event data: information such as match results and scores. For example, oracle data used to predict market or sports event outcomes.

[0125] 4. Internet of Things (IoT) data: Data from sensors and devices, such as temperature sensors and GPS positioning. For example, logistics data in supply chain management.

[0126] 5. Voting data: Voting results. For example, the voting results of a decentralized system.

[0127] 6. Product and service data: Product inventory, transportation status, production information, etc. For example, product status data in supply chain management and traceability systems.

[0128] 7. News and Event Data: Global news and information on important events. For example, event data that triggers specific terms in insurance smart contracts.

[0129] 8. Health and medical data: Patient health records, hospital data, drug information, etc. For example, data from health insurance and health management applications.

[0130] 9. Legal and Compliance Data: Information such as regulations, compliance documents, and legal judgments. For example, data used for compliance reviews and the enforcement of legal contracts.

[0131] 10. Game data: In-game events, player status, match results, etc. For example, data in decentralized games.

[0132] It's understandable that all the off-chain business data provided by oracles (e.g., first-level off-chain business data) may also include other data types, which we won't go into detail about here. Based on their characteristics, the above data can be broadly categorized into three types: the first type can be time-series data (price data, weather data, sports event data, IoT data, healthcare data); the second type can be event data (voting data, news event data, game data); and the third type can be state data (goods and services data, legal and regulatory data).

[0133] In this embodiment of the application, when storing these three types of data using a segment tree structure, the field design of the storage object corresponding to the time series data can be found in Table 1 below.

[0134] Table 1

[0135]

[0136] As shown in Table 1, time series data can be queried using a segment tree with time intervals as one dimension, and it can also be queried at a single point. Therefore, in this embodiment, a one-dimensional segment tree structure is suitable for storage.

[0137] The field design of the storage object corresponding to the event data can be found in Table 2 below.

[0138] Table 2

[0139]

[0140] As shown in Table 2, event data can be sorted by time and used for range queries using a segment tree. Since event data may contain multiple types, a two-dimensional segment tree structure is used for storage. In this second-dimensional segment tree structure, the first dimension can be the time dimension, and the second dimension can be the event type dimension. For example, for sports event data, when storing it according to the time data using a two-dimensional segment tree structure, for a given tree node, the first dimension can store a certain time range in which the sports event data was generated, and the second dimension can store the specific event type of the sports event described within that time range (e.g., goal event, score event, etc.).

[0141] The field design of the storage object corresponding to the status data can be found in Table 3 below.

[0142] Table 3

[0143]

[0144] As shown in Table 3, State Data can be divided into two dimensions: time and state type, and stored in a two-dimensional segment tree structure. Queries also need to be performed according to these two dimensions. For example, for product and service data, in a tree node of the two-dimensional segment tree structure storing this data, the first dimension could be a certain time range in which a certain type of product exists, while the second dimension could be the specific state information of that type of product within that time range (e.g., product inventory, transportation status, production information, etc.).

[0145] Blockchain nodes search for target tree nodes associated with request conditions (e.g., the first request condition) carried in transaction requests (e.g., the first transaction request) within a segment tree structure in the on-chain storage space. Specifically, the search for a target tree node starts from the root node. The range of the request condition (e.g., the first request condition) is compared with the dimensional search range in the segment tree node. If the range of the request condition matches the dimensional search range of the tree node, it means the business data may be stored in that tree node, and this tree node is the target tree node. For example, if the business data to be searched is weather conditions for a certain period, the range of the request condition corresponds to a certain date range. The segment tree structure storing this business data is also a one-dimensional segment tree structure. A certain tree node within this structure also stores its corresponding dimensional search range, which is also a date range. If the range of the request condition and the dimensional search range of the tree node are the same, then this tree node can be considered the target tree node, and the business data to be searched may exist in that tree node. Taking the search for weather information as an example, if the request condition range is from 2024.11.01 to 2024.11.03, and the dimensional search range of a certain tree node is also from 2024.11.01 to 2024.11.03, then that tree node is the target tree node that has been found.

[0146] After a blockchain node locates the target tree node in its on-chain storage space, it compares the request condition hash value (e.g., the first condition hash value) carried in the transaction request with the condition hash values ​​in the target tree node's condition hash list. If the condition hash list contains a condition hash value identical to the request condition hash value (e.g., the first condition hash value), it means that the target business data (e.g., the first business data) is stored in the condition hash list of the target tree node. The condition hash list in the target tree node stores key-value pairs of specific condition hash values ​​and business data. Therefore, when a condition hash value identical to the request condition hash value (e.g., the first condition hash value) is found, it means that the data corresponding to that condition hash value is the requested business data (e.g., the first business data). Once the oracle contract finds the target business data (e.g., the first business data), it returns the target business data to the business contract (e.g., the first business contract) so that the business contract executes the corresponding business data and obtains the business execution result, which is then returned to the business terminal that called the business contract.

[0147] It's important to note that if the transaction request sent by the business contract here (e.g., the first transaction request) carries a callback parameter, it means that the oracle contract needs to return the found target business data to the business contract by calling back to it. Specifically, the oracle contract in the cross-chain mechanism can use the callback parameter to determine the callback function used to execute the callback business logic. By executing this callback function with the address of the business contract as a parameter, the target business data is transmitted to the business execution function in the business contract to execute the relevant data business.

[0148] For further details, please see Figure 4 , Figure 4 This is a schematic diagram illustrating a scenario where an oracle contract retrieves business data from on-chain storage space, as provided in an embodiment of this application. Figure 4As shown, when a blockchain application of a certain business terminal (e.g., the first business terminal) runs, it calls business contract 40a (i.e., the first business contract) to perform weather analysis-related data services, requiring the weather conditions from November 20, 2024 to November 21, 2024. These weather conditions are the target business data (i.e., the first business data) requested by business contract 40a. At this time, business contract 40a sends a transaction request 41a (i.e., the first transaction request) to oracle contract 40b, carrying the request condition 43a (i.e., the first request condition) corresponding to the first business data and the condition hash value 44a (i.e., the first condition hash value) corresponding to the request condition 43a. Upon receiving transaction request 41a, oracle contract 40b searches for the first business data in the on-chain storage space, i.e., storage module 40c, based on the request condition 43a and the condition hash value 44a.

[0149] Understandably, the on-chain storage space contains multiple segment tree structures to store business data of different data types. Different data services will not use the same data types, and their dimensional partitioning will also differ. Therefore, multiple segment tree structures are needed, such as... Figure 4 As shown, the storage module 40c includes segment tree structures 45a, 45b, ..., 45n. During the search for target business data, the data service type executed by the business contract 40a determines that the segment tree accessed for the searched business data should be segment tree structure 45b in the storage module 40c. Then, the segment tree node corresponding to request condition 43a is found through segment tree structure 45b. Specifically, as... Figure 4 As shown, by comparing the request condition range corresponding to request condition 43a with the dimensional search range in the segment tree node, it is found that the request condition range corresponding to request condition 43a is consistent with the dimensional search range of segment tree node 46a. Therefore, it can be determined that segment tree node 46a is the target tree node being searched. Figure 4 As shown, the condition hash list of segment tree node 46a (i.e., the target tree node) at this time stores multiple condition hash values, including condition hash value 44a, ..., condition hash value 44n. We can then compare condition hash value 44a with the condition hash values ​​in the condition hash list of segment tree node 46a. We will find that condition hash value 44a also exists in the condition hash list, and the corresponding business data 47a is the target business data requested by the business contract. Figure 4As shown, this represents the weather conditions from November 20th to November 21st, 2024. After the blockchain node retrieves business data 47a, it calls the oracle contract to check that transaction request 41a has no callback field, indicating that there is no need to call back business contract 40a. At this point, oracle contract 40b can return business data 47a to business contract 40a.

[0150] It should be understood that for other segment tree structures such as segment tree structure 45a and segment tree structure 45n in the storage module 40c, the specific implementation method of finding the target tree node through other segment tree structures can be referred to the specific implementation method of finding the target tree node through segment tree structure 45b, and will not be described in detail in this application embodiment.

[0151] Understandably, when an oracle contract searches for target business data (e.g., the first business data) in a segment tree, it can use the request condition range (i.e., the target condition query range) corresponding to the request condition (e.g., the first request condition) to query the nodes in the segment tree and compare the range with the condition range (i.e., the dimension search range) of the segment tree nodes to confirm the target tree node. Specifically, when a blockchain node queries the segment tree structure, it compares the target condition query range corresponding to the first request condition with the dimensional search range (i.e., the first dimensional search range) of the first type of node in the segment tree (e.g., the root node). If the target condition query range is a sub-range of the first dimensional search range, it means that the requested business data (i.e., the first business data) may exist in the child nodes (i.e., the first type of child nodes) corresponding to the first type of node. Then, it continues to compare the request condition range (i.e., the target condition query range) with the dimensional search range corresponding to the child nodes (i.e., the first type of child nodes) of the first type of node (e.g., the root node of the segment tree). If the dimensional search range of a child node of the first type of node includes the request condition range (i.e., the target condition query range), it continues to query the subtree of that child node until a tree node with a dimensional search range matching the request condition range is found. This child node (i.e., the first type of child node) is then considered a new first type of node, and the query continues until the target tree node is found. This is determined by the basic structure of a segment tree. In a segment tree, the dimensional search range of a node (e.g., a first-type node) can be composed of the dimensional search ranges of all its child nodes (e.g., first-type child nodes), and the dimensional search ranges of its child nodes will not overlap. Therefore, when querying a segment tree, it is necessary to start from the root node and search downwards along a certain path until a node is found whose dimensional search range matches the requested condition range. This tree node is the target tree node found.

[0152] It's important to note that a situation may arise when comparing the dimensional search range of a segment tree node with the range of the requested conditions (e.g., the target condition query range). In this case, the requested condition range is a sub-range of the dimensional search range of the segment tree node, but the requested condition range overlaps with the dimensional search ranges of multiple child nodes of the segment tree node. In this situation, the segment tree node is considered the target tree node found in the query.

[0153] By comparing the range of request conditions and the search range of tree nodes, the target tree node associated with the request condition (e.g., the first request condition) can be found. Then, the target business data (e.g., the first business data) can be located within that tree node using the condition hash value (e.g., the first condition hash value). The retrieved target business data is then returned to the business contract. The specific process of finding the first target business data in the condition hash list and returning the first business data to the first business contract can be found in the above description. Figure 4 The description will not be repeated here.

[0154] For details, please see Figure 5 , Figure 5 This is a schematic diagram illustrating a scenario for querying business data based on a segment tree structure, as provided in this application example. For example... Figure 5 As shown, when searching for the target tree node in the segment tree structure 51a using the request condition range 54a (e.g., the target condition query range corresponding to the first request condition) corresponding to request condition 52a (e.g., the first request condition), the search begins from the root node of the segment tree, i.e., segment tree node 55a. The search is then compared with the dimensional search range 56a of the request condition range 54a and segment tree node 55a. At this point, the root node can be considered a first-class node. Since the request condition range 54a is a sub-range of the dimensional search range 56a, the search continues with the child nodes of segment tree node 55a. The child nodes of tree node 55a can be considered first-class child nodes, namely segment tree nodes 55b and 55c. Comparing the dimensional search ranges of the request condition range 54a with those of segment tree nodes 55b and 55c reveals that the dimensional search range 56b of the request condition range 54a and segment tree node 55b are the same range. Therefore, segment tree node 55b can be identified as the target tree node. Then, the condition hash value 53a can be queried in the condition hash list of segment tree node 55. If condition hash value 53a is not found in the condition hash list, it means that the business data requested by request condition 52a does not exist in segment tree node 55b, that is, the target business data requested by request condition 52a does not exist in segment tree structure 51a. If a condition hash value with the same first condition hash value is found in the target tree node, it means that the first business data exists in the tree node. At this time, the blockchain node successfully queries the first business data in the on-chain storage space.

[0155] For further details, please see Figure 6 , Figure 6 This is a schematic diagram illustrating another scenario for querying business data based on a segment tree structure, provided in this application example. For example... Figure 6 As shown, at this point, it is necessary to search for the target business data (e.g., the first business data) in the segment tree structure 51a using request condition 52b (e.g., the first request condition). First, the comparison begins from the dimension search range 56a of the root node, i.e., the segment tree node 55a, using the request condition range 54b corresponding to request condition 52b. At this point, the segment tree node 55a can be considered a first-class node. The comparison reveals that request condition range 54b is a sub-range of dimension search range 56a. Then, the dimension search ranges of request condition range 54b and the child nodes of segment tree node 55a are compared. At this point, the child nodes of segment tree node 55a can be considered first-class child nodes. This involves comparing the request condition range 54b with the dimension search range 56b of segment tree node 55b and the dimension search range 56c of segment tree node 55c. The comparison reveals overlap between the request condition range 54b and both dimension search ranges 56b and 56c. Therefore, the target tree node can be determined as the parent node of segment tree nodes 55b and 55c, i.e., segment tree node 55a. The target business data can then be queried from segment tree node 55a using the condition hash value 53b.

[0156] For further details, please see Figure 7 , Figure 7 This is a schematic diagram illustrating another scenario for querying business data based on a segment tree structure, provided in an embodiment of this application. For example... Figure 7As shown, at this point, the segment tree structure 51a needs to be queried using request condition 52c. First, the request condition range 54c (e.g., the target condition query range corresponding to the first request condition) is compared with the dimension search range 56a of the root node, i.e., the segment tree node 55a. It is found that the request condition range 54c is a sub-range of the dimension search range 56a. Then, the request condition range 54c is compared with the dimension search range of the child nodes of the segment tree node 55a, that is, the request condition range 54c is compared with the dimension search range 56b and the dimension search range 56c. At this point, the segment tree node 55a can be regarded as a first-class node, while the segment tree nodes 55b and 55c can be regarded as first-class child nodes. By comparison, we know that the requested condition range 54c is a sub-range of the dimension search range 56b of the segment tree node 55b. Similarly, we continue to compare the requested condition range 54c with the dimension search ranges of the child nodes of the segment tree node 55b, i.e., comparing the requested condition range 54c with the dimension search ranges 56d and 56e. At this point, we can see that the segment tree node 55b is a new first-class node, and the segment tree nodes 55d and 55e can be considered new first-class child nodes, to continue the similar range comparisons and queries for the target tree node. Finally, we know that the requested condition range 54c is consistent with the dimension search range of the child nodes of the segment tree node 55b, i.e., the requested condition range 54c is consistent with the dimension search range 56d of the segment tree node 55d. Therefore, we can confirm that the segment tree node 55d is the target tree node, and then we can use the condition hash value 53c to query whether the target business data exists in the condition hash list of the segment tree node 55d.

[0157] Step S103: If no condition hash value matching the first condition hash value is found, when it is determined that the first business data does not exist in the on-chain storage space, a first off-chain query request for the first request condition is sent to the oracle through the oracle contract.

[0158] Specifically, if the oracle contract receives a transaction request from the first business contract (i.e., the first transaction request), and the blockchain node does not find a condition hash value matching the first condition hash value in the segment tree structure of the on-chain storage space based on the first request condition in the first transaction request, it can determine that the first business data requested by the first transaction request does not exist in the on-chain storage space. At this point, the blockchain node will invoke the oracle contract to send an off-chain query request (i.e., the first off-chain query request) to the oracle on the blockchain to query the first business data. After the off-chain oracle device receives the first off-chain query request sent by the oracle contract, it will use the request hash value (i.e., the first condition hash value) carried in the first off-chain query request to search for the target business data (i.e., the first off-chain business data) in the off-chain dataset, and then return the target business data to the oracle contract. Here, the off-chain oracle may be some devices used to collect data, storing the collected data but not putting it on the blockchain; therefore, this is not a limitation. Once a blockchain node receives the first off-chain business data sent by the off-chain oracle, it can use the first off-chain business data as the first business data and call the oracle contract to return the first business data to the first business contract, so that the first business contract can execute the relevant business data.

[0159] It's important to note that when an oracle contract receives transaction requests, it may receive multiple requests simultaneously (including a first transaction request and a second transaction request). Among these simultaneous requests, some may request the same data. For example, both the first and second transaction requests might request the same first business data. In this case, the oracle contract can merge the first and second transaction requests to generate a single request dataset (i.e., the first merged request dataset). Understandably, the first and second transaction requests carry the same condition hash value (i.e., the first condition hash value and the second condition hash value are the same). Therefore, a contract call record (the first contract call record) can be generated to record the correspondence between the first condition hash value and the first merged request dataset. After receiving the first off-chain business data returned by the off-chain oracle and using it as the first business data, the blockchain node can invoke the oracle contract to populate each of the multiple transaction requests in the first merged request dataset with this first business data as the request response data (i.e., the first request response data). In this way, the target business data is simultaneously returned to multiple business contracts that requested that data.

[0160] It's important to note that if the oracle contract receives multiple transaction requests requesting different business data—for example, the first and second transaction requests request different business data (i.e., the first condition hash value differs from the second condition hash value)—then the oracle contract will create a contract call record for each of the first and second transaction requests. Taking the second transaction request as an example, the blockchain node will call the oracle contract to create a second request merged dataset containing the second transaction request, and generate a second contract call record to record the correspondence between the second condition hash value and the second merged request dataset. Furthermore, when the blockchain node receives the business data requested by the second transaction request (i.e., the second business data), it will call the oracle contract to populate the second transaction request in the second merged request dataset with the second business data as the second request response data.

[0161] Understandably, when an oracle contract receives a new transaction request, there might be instances where the oracle contract already contains contract call records generated from previously obtained transaction requests. Therefore, when the oracle contract receives a transaction request (e.g., the third transaction request), it records the timestamp of that transaction request. If the difference between the timestamp of the third transaction request (i.e., the second timestamp) and the timestamp of the first transaction request (i.e., the first timestamp) is less than a pre-set time interval threshold, meaning the second timestamp falls within the time interval threshold corresponding to the first timestamp, the conditional hash values ​​of the third and first transaction requests are compared to determine whether the third transaction request should be added to the request dataset (i.e., the first merged request dataset) containing the first transaction request. Understandably, the time interval threshold here can be set to the shortest possible time for the oracle contract to receive a transaction request and complete the transaction. Then, by comparing the difference between the timestamp of the subsequently acquired transaction request (i.e., the second timestamp) and the timestamp of the previously acquired transaction request (i.e., the first timestamp) to see if it is less than the time interval threshold, it can be determined that when the oracle contract processes the third transaction request, it stores the contract call record corresponding to the previously acquired transaction request (i.e., the first contract call record). Furthermore, by comparing the condition hash value of the third transaction request (i.e., the third condition hash value) with the first condition hash value, it can be determined whether to add the subsequently acquired transaction request (i.e., the third transaction request) to the first contract call record. If the third transaction request is added to the first contract call record, then when the blockchain obtains the first business data, it can call the oracle contract to fill the first business data as transaction response data back into the first and third transaction requests in the first contract call record.

[0162] If the difference between the timestamp of the third transaction request and the timestamp of the first transaction request is greater than the time interval threshold, it means that when the oracle contract receives the third transaction request, the first contract call record containing the first transaction request may have already been backfilled with business data. Therefore, a new contract call record (i.e., the third contract call record) needs to be generated for the third transaction request. At this time, the blockchain node will call the oracle contract to add the third transaction request to the third request merged dataset and generate a third contract call record to record the correspondence between the condition hash value of the third transaction request (i.e., the third condition hash value) and the third request merged dataset.

[0163] After the oracle contract creates a contract call record containing multiple transaction requests (e.g., the first contract call record), if it receives a callback transaction from the oracle (e.g., the first callback transaction), it can find the contract call record corresponding to the condition hash value carried in the callback transaction. At this point, the oracle contract can use the target business data carried in the callback transaction as transaction response data to populate multiple transaction requests in the request dataset of that contract call record. It then performs callback checks on these multiple transaction requests, performing contract callbacks on the requests that require callbacks. This allows for simultaneous callbacks of multiple business contracts, essentially packaging these multiple transaction requests into a single transaction when they are uploaded to the blockchain.

[0164] For further details, please see Figure 8 , Figure 8 This is a schematic diagram illustrating a scenario where an oracle contract generates contract call records, as provided in an embodiment of this application. Figure 8 As shown, after oracle contract 61a receives transaction requests 62a and 62b, it compares their acquisition timestamps, specifically acquisition timestamp 66a and acquisition timestamp 66b, to determine if the difference between them is less than a threshold (i.e., the time interval threshold range). It can be understood that transaction requests 62a and 62b at this point are the first and second transaction requests, respectively. When the oracle receives them, it compares the first and second timestamps (i.e., the first and second timestamps...) Figure 8 The timestamps 66a and 66b are used to determine whether to merge the two transactions. If the difference between timestamps 66a and 66b is less than a threshold, it indicates that the oracle contract 61a received the first and second transaction requests at similar times. Therefore, the first condition hash value and the second condition hash value can be compared to determine whether to merge the two transaction requests into the same request dataset (i.e., the first merged request dataset), thus generating the first contract call record. Figure 8As shown, at this point, oracle contract 61a compares condition hash value 63a (i.e., the first condition hash value) and condition hash value 63b (i.e., the second condition hash value). If condition hash value 63a and condition hash value 63b are the same, it indicates that the business data requested by transaction request 62a and transaction request 62b are the same. Therefore, oracle contract 61a will merge transaction request 62a and transaction request 62b to generate request dataset 64a (i.e., the first merged request dataset) and generate contract call record 65a (i.e., the first contract call record) to record the correspondence between condition hash value 63a and request dataset 64a. If oracle contract 61a finds that the first and second condition hash values ​​are not the same when comparing them, it will generate contract call records for the first and second transaction requests respectively. Figure 8 As shown, when the condition hash value 63a and the condition hash value 63b are different, a contract call record 65b will be generated to record the correspondence between the condition hash value 63a and the transaction request 62a, and a contract call record 65c will be generated to record the correspondence between the condition hash value 63b and the transaction request 62b.

[0165] If the difference between the timestamps of the first and second transaction requests exceeds a time interval threshold, contract call records will be generated for both the first and second transaction requests respectively. Figure 8 As shown, when comparing the timestamp 66a and the timestamp 66b, if the difference between the timestamps 66a and 66b is less than the threshold, then transaction request 62a and transaction request 62b will be added to request dataset 64b and request dataset 64c respectively, and contract call record 65b and contract call record 65c will be generated to record the correspondence between condition hash value 63a and request dataset 64b.

[0166] It is important to note that in this embodiment, the off-chain oracle can poll the oracle contracts in the blockchain nodes and check the generation events of contract call records in the oracle contracts. If a contract call record (e.g., the first contract call record) is detected, the condition hash value (e.g., the first condition hash value) corresponding to the contract call record will be obtained, and the condition hash value will be hash-registered in the query engine. This allows the oracle to automatically query the off-chain business data corresponding to the condition hash value after the oracle contract receives a transaction request and generates a contract call record, and then send the off-chain business data to the oracle contract.

[0167] For further details, please see Figure 9 , Figure 9This is a schematic diagram illustrating a scenario where an oracle performs hash registration, as provided in an embodiment of this application. Figure 9 As shown, oracle device 70b executes S21, polling the oracle contract to detect if it has generated a contract call record. At this time, oracle contract 70a executes S22, receiving a new transaction request 71a, and then executes S23, generating a contract call record 65d using the condition hash value 63d carried by transaction request 71a. This record records the correspondence between the condition hash value 63d and the request dataset 64d containing transaction request 71a. Since the oracle device continuously polls the oracle contract, it can detect the generation of contract call record 65d and executes step S24, obtaining the condition hash value 63d from contract call record 65d and registering it in its query engine. Upon receiving this hash registration, the query engine can search for the business data corresponding to the condition hash value in the off-chain dataset and send this business data to the oracle contract, enabling the oracle contract to complete the transaction request present in contract call record 65d using this business data.

[0168] Step S104: Call the oracle contract to use the first off-chain business data as the first business data to be written into the on-chain storage space, and update the first condition hash value and the first business data to the tree node associated with the first request condition in the on-chain storage space.

[0169] After a blockchain node receives the first off-chain business data sent by the off-chain oracle, it treats this off-chain business data as the first business data requested in the first transaction request and fills it back into the first transaction request as the first transaction response data, thus completing the first request transaction and returning the first business data to the first business contract that sent the transaction request. After completing the transaction, the blockchain node stores the first business data in the segment tree structure of the storage module (i.e., the on-chain storage space). Regarding the storage of business data, it is first necessary to use the first request condition corresponding to the first business data to search for a segment tree node that meets the condition in the segment tree structure. The dimension search range in the segment node must be the same as the search range corresponding to the first request condition (the range of the first request condition). The specific method for finding the target tree node can be found in the description of step S102 above, and will not be repeated here. After finding the target tree node, the first business data and its corresponding first condition hash value can be stored in the condition hash list of the target tree node, so that when subsequent data business requests the first business data, it can be directly obtained through the on-chain storage space.

[0170] It is understood that, in this embodiment of the application, when a blockchain node receives off-chain business data (e.g., the first off-chain business data) and stores the off-chain business data and its corresponding condition hash value into the segment tree structure of the on-chain storage space, if the dimensional search range covered by the segment tree structure used to store the off-chain business data cannot completely include the request condition range of the off-chain business data, the segment tree structure will be reconstructed to form a new segment tree structure so that the off-chain business data can be stored in a tree node of this new segment tree structure. At this time, the original segment tree structure will become a subtree of this new segment tree structure. Taking the weather of a certain week of this month as an example, if the dimensional search range of the root node of the segment tree structure of the on-chain storage space is another week of this month, then when storing the off-chain business data, the segment tree structure at this time will be reconstructed to form a new segment tree structure. At this time, the dimensional search range of the root node of the new segment tree structure is the time range of this month, and the original old segment tree also becomes a subtree of the new segment tree. At this point, the weather information obtained for a particular week of the month can be stored in this new segment tree structure.

[0171] It's important to note that after the off-chain oracle receives the first data query request from the oracle contract and retrieves the first off-chain business data based on that request, it can send the first off-chain business data to the oracle contract via a callback transaction. Upon receiving the callback transaction from the off-chain oracle, the oracle contract can analyze the first off-chain business data carried in the callback transaction and the corresponding first condition hash value. The oracle contract will use this off-chain business data as the first business data and use the first condition hash value to find the corresponding contract call record. In other words, the oracle contract has already generated the corresponding first contract call record before the oracle device sends the callback transaction to it. Furthermore, the oracle contract will populate the first contract call record with the first business data as the first transaction response data, and perform callback checks on multiple transaction requests in the first contract call record. It will then perform callbacks on the business contracts corresponding to the transaction requests that require callbacks, thus achieving simultaneous callbacks (i.e., one-time callbacks) for multiple transaction requests.

[0172] To further understand the embodiments of this application, please refer to [further details]. Figure 10 , Figure 10This is a flowchart illustrating another data processing method based on a segment tree structure provided in this application embodiment. It is understood that this data processing method can be executed by blockchain nodes in a blockchain network. These blockchain nodes are equipped with oracle contracts associated with oracles, business contracts associated with data services, and on-chain storage space corresponding to the segment tree structure. The blockchain nodes described above can be... Figure 1 The corresponding embodiment is blockchain node 10d. It is understood that, in the embodiments of this application, the data processing method based on the segment tree structure may include at least steps S201 to S214.

[0173] Step S201: Call the oracle contract to obtain the first condition hash value corresponding to the first request condition from the first transaction request;

[0174] Specifically, when a user (i.e., the business object) executes a relevant blockchain application through the first business terminal, it invokes a first business contract existing on the blockchain network. During the execution of the first data business, the first business contract may use target business data (i.e., the first business data). At this point, it sends a transaction request to the oracle contract existing in the blockchain node to request the first business data. The first transaction request also includes information such as the first request conditions and the first condition hash value regarding the first business data, allowing the blockchain node to locate the first business data in the on-chain storage space using the first request conditions. For the specific process of step S201, please refer to the description of step S101 above; further details will not be elaborated here.

[0175] Step S202: Call the oracle contract to obtain the segment tree structure that matches the business type of the data business, and obtain the first dimension search range of the data business in each business dimension from the storage data structure corresponding to the first type of node in the segment tree structure.

[0176] Specifically, after the oracle contract in the blockchain node receives a transaction request, it can search for the target business data (i.e., the first business data) in the segment tree structure of the on-chain storage space using the first request condition and the first condition hash value corresponding to the first business data in the first transaction request. Before searching for the first business data, the segment tree structure corresponding to the first business data must first be determined. It is understandable that multiple segment tree structures may be stored in the storage space, with different structures used to store different types of data. Therefore, the data type of the target data must first be determined by the business type of the business executed by the first business contract (i.e., the first data business), thereby determining the target segment tree structure to be searched. Further, the target tree node that meets the conditions is searched within the target segment tree structure. Since the segment tree structure in the on-chain storage space can use multi-dimensional segment tree structures, and the number of child nodes of tree nodes in segment trees of different dimensions may differ—for example, a one-dimensional segment tree is a binary tree, where each tree node may have two child nodes, while a two-dimensional segment tree is a quadtree, where each tree node has four child nodes—the search process for segment trees of different dimensions may differ, but the essence is the same: searching downwards along the path from the root node to the leaf node. For ease of understanding, let's take a one-dimensional segment tree as an example. When a blockchain node searches for a target tree node, it obtains the first-dimensional search range of the data business in each business dimension from the storage data structure corresponding to the first type of node in the segment tree structure (e.g., the root node), and compares the relationship between the first request condition range corresponding to the first request condition and this first-dimensional search range to determine whether the first business data might exist in the first type of node.

[0177] Step S203: Obtain the target condition query range indicated by the first request condition, compare the target condition query range with the first dimension search range, and obtain the first range comparison result;

[0178] Step S204: If the first range comparison result indicates that the target condition query range is the first dimension search range, then in the condition hash values ​​recorded in the first dimension search range in the hash storage list corresponding to the first type of node, find the condition hash value that matches the first condition hash value.

[0179] Specifically, in steps S203 and S204, after obtaining the first-dimensional search range in the first type of nodes of the target segment tree, the first-dimensional search range can be compared with the first request condition range (i.e., a first range comparison is performed). If the first range comparison result indicates that the first-dimensional search range and the first request condition range are the same, it means that the target business data (i.e., the first business data) may exist in the first type of nodes in the target segment tree at this time. By searching the condition hash list in the data structure of the first type of nodes, the condition hash values ​​of all data stored in the first type of nodes can be confirmed. If the target condition hash value (i.e., the first condition hash value) corresponding to the target business data exists among these condition hash values, it indicates that the first business data is stored in the first type of nodes at this time. Then, the oracle contract can directly obtain the first business data through the data structure of the first type of nodes and return the first business data to the first business contract that requested it. If the first condition hash value does not exist in the first type of nodes, it means that the first business data does not exist in the on-chain storage space at this time, and the blockchain node will obtain the first business data through the oracle that exists off-chain.

[0180] Step S205: If the first range comparison result indicates that the target condition query range is the range in the first dimension search range, then the target condition query range is compared with the first sub-dimension search range and the second sub-dimension search range respectively to obtain the second range comparison result.

[0181] Step S206: If the second range comparison result indicates that the target condition query range is the first sub-dimension search range, and the target condition query range does not belong to the range in the second sub-dimension search range, then in the condition hash values ​​recorded in the hash storage list corresponding to the first child node in the first sub-dimension search range, find the condition hash value that matches the first condition hash value.

[0182] Specifically, in step S204, if the first dimension search range of the first type of node (e.g., the root node) is compared with the request condition range corresponding to the first request condition (i.e., the target condition query range), and it is found that the target condition query range is within the first dimension search range, then it means that the first business data may exist in the child nodes (i.e., the first type of child nodes) of the first type of node. At this point, steps S205 to S206 can be executed to obtain the dimension search range in the data structure of the first type of child node. Taking a one-dimensional segment tree structure as an example, there are two first type of child nodes, designated as the first child node and the second child node. The dimension search ranges of the first child node and the second child node are the first sub-dimension search range and the second sub-dimension search range, respectively. The target condition query range is compared with the first sub-dimension search range and the second sub-dimension search range (similar to the comparison in step S203). If a range in either the first sub-dimension search range or the second sub-dimension search range is consistent with the target condition query range, then it means that the first business data may exist in the first child node and the second child node. For example, if the target condition query range is compared with the first sub-dimension search range (i.e., a second range comparison is performed), and the result of the second range comparison indicates that the target condition query range is the first sub-dimension search range, it means that the first business data may exist in the first child node. At this time, the first condition hash value can be compared with the condition hash value existing in the condition hash list of the first child node. If there is a condition hash value that matches the first condition hash value, it means that the target business data exists in the first child node. If there is no condition hash value that matches the first condition hash value, it means that the target business data does not exist in the first child node, and it can also be determined that the first business data does not exist in the on-chain storage space at this time.

[0183] It's important to note that during the comparison of the target condition query range with the dimensional search range of the first and second child nodes, if the target condition query range is a sub-range of the first or second sub-dimensional search range, it means the target business data might be stored in a child node of the first or second child node. This can be understood as the first and second child nodes being similar to the first type of node mentioned earlier. Therefore, we can consider the segment tree nodes as having two types: first-type nodes and first-type child nodes, with the first-type nodes being the parent nodes of the first-type child nodes. In the query process described above, if the dimensional search range of the first-type child nodes does not meet the requirements, then the first-type child nodes will become the new first-type nodes, and the same query logic will continue. In short, the entire process of finding the first business data starts from the root node of the segment tree, searches the tree nodes along the path from the root node to a leaf node, and determines whether the first business data exists.

[0184] In one possible scenario, when comparing the target query range with the dimensional search range of the child nodes (i.e., the first-class child nodes) of the first-class node, there might be overlap between the target query range and the dimensional search ranges of multiple first-class child nodes. Taking a one-dimensional segment tree as an example, the first-class child nodes include first and second child nodes. If the target query range overlaps firstly with the dimensional search range of the first child node (i.e., the first sub-dimensional search range) and secondly with the dimensional search range of the second child node (i.e., the second sub-dimensional search range), the combined first and second overlaps constitute the request condition range. In this case, it is necessary to compare the first condition hash value with the condition hash values ​​in the condition hash list of the first-class node. The first business data might then reside within this first-class node.

[0185] It's important to note that if the business data being searched (e.g., the first business data) is stored in a two-dimensional segment tree structure, then a given tree node in this structure will have four child nodes. Taking the storage of event data as an example, the tree node will have two dimensions: time and event type. When determining the child nodes of a given tree node in this two-dimensional segment tree structure, the node can be divided into two tree nodes based on the time dimension, and then these two tree nodes can be further divided into four tree nodes based on the event type dimension. These four tree nodes are the child nodes of the given node. The specific implementation of data searching between parent and child nodes in a two-dimensional segment tree structure can be found in the description of searching two byte points under a parent node in a one-dimensional segment tree, which will not be repeated here. The request conditions used in the specific search process (e.g., the first request condition) also include two dimensions. The target tree node is determined by searching using both dimensions simultaneously within the segment tree structure.

[0186] For the specific implementation process of steps S202 to S206, please refer to the description of step S102 above, which will not be repeated here.

[0187] Step S207: If no condition hash value matching the first condition hash value is found, when it is determined that the first business data does not exist in the on-chain storage space, a first off-chain query request for the first request condition is sent to the oracle through the oracle contract.

[0188] Specifically, when the oracle contract cannot find the first business data in the on-chain storage space through steps S203 to S204 described above, it can initiate a first off-chain query request for the first business data to the oracle existing off-chain, in order to obtain the first business data from the off-chain dataset. For the specific process of step S207, please refer to the description of step S103 above, which will not be repeated here.

[0189] After receiving the first off-chain query request from the oracle contract, the oracle device can obtain the corresponding first request condition based on the first off-chain query request, calculate the first condition hash value, and then register the corresponding hash request in its search engine based on the first condition hash value. The search engine in the oracle device can then use this hash request to search for the corresponding first off-chain business data in the off-chain dataset, and finally return the first off-chain business data to the blockchain node.

[0190] For further details, please see Figure 13 , Figure 13 This is a schematic diagram of an oracle processing data request flow provided in an embodiment of this application. For example... Figure 13 As shown, in steps S41 to S44, after the oracle receives the first off-chain query request sent by the blockchain calling the oracle contract, it calculates the corresponding first condition hash value based on the first request condition carried in the first off-chain query request and determines whether the first condition hash value exists. Since the first condition hash value exists in the oracle, it means that the first business data has been queried before, and at this time, the first business data can be directly returned to the blockchain node. However, step S45 is also executed to check the callback of the transaction request. If the first business data needs to be callback to the first business contract, step S46 is executed to send a callback transaction to the oracle contract to transmit the first business data. If step S44 determines that the first request condition hash does not exist in the oracle, step S47 is further executed to determine whether the first request condition meets the requirements. If it does not meet the requirements, step S48 is executed to report an error. If it meets the requirements, step S49 is executed to register a query request in the oracle using the first condition hash, and the first off-chain business data is found in the off-chain dataset through the query request. Finally, step S50 is executed to return the found first off-chain business data to the blockchain node.

[0191] Step S208: Obtain the first callback transaction returned by the oracle for the first off-chain query request;

[0192] Step S209: Call the oracle contract to parse the first callback transaction, obtain the first condition hash value and the first off-chain business data, and retrieve the first contract call record corresponding to the first condition hash value from the oracle contract;

[0193] In step S207, after the oracle contract sends a first off-chain query request for the first business data to the off-chain oracle, the oracle can query the first off-chain business data in the off-chain dataset and send the queried first off-chain business data into the first callback transaction to the oracle contract. Then, the oracle executes step S208, and the oracle contract receives the returned first callback transaction to execute step S209, obtaining the first off-chain business data placed by the oracle in the first callback transaction, using this as the first business data, and filling the first transaction request with the first transaction response data sent by the business contract. It can be understood that the first transaction request here is stored in the first contract call record, and the oracle needs to obtain the first transaction request corresponding to the first business data through the first contract call record.

[0194] Step S210: When calling the oracle contract to write the first off-chain business data as the first business data to be written into the on-chain storage space, the first business data is used as the first request response data to fill the first transaction request in the first contract request dataset, and the first contract call record after the callback is obtained.

[0195] When a blockchain node obtains the first off-chain business data and uses it as the first business data to be written into the on-chain storage space, it calls an oracle node to find the contract call record (i.e., the first contract call record) generated by the first condition hash value corresponding to the first business data. Then, it can determine the transaction request (i.e., the first transaction request) requesting the first business data. The first business data is then used as the first transaction response data to fill back into the first transaction request to obtain the callback-ready first contract call record. Finally, the first business data is returned to the business contract that needs it (i.e., the first business contract).

[0196] It is important to note that the aforementioned first contract call record is generated when the oracle receives a transaction request from a business contract. This is done by analyzing the condition hash values ​​among multiple received transaction requests, merging all requests with the first condition hash value (including the first transaction request) into a single request dataset (i.e., the first request dataset), and then using the first request dataset and the first condition hash values ​​carried by the transaction requests within it to generate the first contract call record. In this way, when a blockchain node obtains the first business data corresponding to the first condition hash value, it can invoke the oracle contract to uniformly return the first business data to the requesting business contract (including the first business contract). For the specific process of the oracle contract generating the contract call record, please refer to the description of step S103 above; it will not be repeated here.

[0197] Step S211: Based on the first contract call record after the callback, perform callback detection on the first transaction request to obtain the callback detection result;

[0198] After the blockchain node receives the first business data and fills it back into the first transaction request in the first contract call record, a callback detection can be performed on the first transaction request to determine whether the first business data should be sent back to the first business contract that sent the first transaction request via a callback.

[0199] Step S212: If the callback detection result indicates that the first transaction request carries callback parameters for the first business contract, then the first callback function for calling back the first business contract is determined based on the callback parameters. When the contract address of the first business contract is obtained through the first callback function, the first business data is sent back to the first business contract.

[0200] When the oracle contract performs callback checks on the first transaction request, it examines the callback parameters within the request. These parameters indicate the first callback function the oracle contract needs to execute. The transaction request also carries the contract address of the first business contract that sent the request. If the check indicates that a callback is required for the first transaction request, the oracle contract executes the first callback function to retrieve the contract address of the first business contract that sent the request and then sends the first business data back to that contract.

[0201] For further details, please see Figure 14 , Figure 14 This is a schematic diagram illustrating the process of an oracle contract for processing business data, provided in an embodiment of this application. For example... Figure 14 As shown in steps S51 to S53, when the oracle contract receives a callback transaction carrying the first off-chain business data sent by the oracle, it will set the first off-chain business data as the first business data and store the first business data and its corresponding condition hash value (i.e., the first condition hash value) in the on-chain storage space, that is, in the segment tree structure of the on-chain storage space. After the first business data is stored on-chain, the blockchain node will call the oracle contract to execute step S54 to check whether the first transaction request with the backfilled business data needs a callback. If a callback is needed, step S56 will be executed, and the blockchain node will call the oracle contract to execute the corresponding callback function (i.e., the first callback function) to send the first business data back to the first business contract for execution of related data business (i.e., the first business data). If a callback is not needed, the blockchain node will execute step S55, and call the oracle contract to return the backfilled transaction to the business contract.

[0202] Step S213: Execute the data service through the first business contract, obtain the first business execution result corresponding to the data service, and return the first business execution result to the first business terminal corresponding to the business contract;

[0203] After receiving the first business data sent by the oracle contract when executing the first callback function, the first business contract can execute the relevant data business (i.e., the first business data) and obtain the first execution result, and finally return the first execution result to the application terminal (i.e., the first business terminal) that called the business contract.

[0204] For further details, please see Figure 11 , Figure 11 This is a schematic diagram illustrating a scenario where an oracle contract processes callback transactions, as provided in an embodiment of this application. Figure 11 As shown, after oracle device 90b finds the relevant target business data (i.e., the first off-chain business data), it executes step S31, sending a callback transaction 93a carrying the first off-chain business data to oracle contract 90a. The oracle contract, by analyzing this callback transaction, can obtain the request condition hash value 91a corresponding to the first off-chain business data, and then use this condition hash value to search for the contract call record 94a corresponding to the request condition hash value 91a in the generated contract call records. For example... Figure 11 As shown, contract call record 94a is used to record the correspondence between condition hash value 91a and request dataset 95b. Therefore, the business data corresponding to condition hash value 91a is the data requested by the transaction request in request dataset 95b. That is, the business data 92b obtained by the oracle contract through off-chain business data 92a is the first business data requested by the transaction request in request dataset 95b. Subsequently, the oracle contract will execute S32 to fill the business data 92b back into transaction request 96a and transaction request 96b as transaction response data.

[0205] After the first business data is backfilled, the transaction request in contract call record 94a can be considered a callback-received contract call record. At this time, oracle contract 90a can execute S33 to perform callback detection on the transaction request in contract call record 94a. Specifically, callback detection determines whether a callback parameter field exists in the transaction request; if it does, it indicates that the transaction request needs to be callback-received. Figure 11 As shown, both transaction requests 96a and 96b in the request dataset 95b contain callback parameter fields. Therefore, after executing S33, oracle contract 90a can determine that S34 needs to be executed for transaction requests 96a and 96b, and the callback execution of business contracts 97a and 97b that sent transaction requests 96a and 96b will be performed. Specifically, Figure 11As shown, the oracle contract can analyze the callback parameter fields in transaction requests 96a and 96b to obtain the callback functions to be executed. The oracle contract then executes these callback functions and, through the business contract addresses recorded in these two transaction requests, transmits the business data to the business contracts 97a and 97b that sent the two transaction requests. After receiving the business data sent by the oracle contract through the callback functions, the business contracts can execute relevant data operations using this data, obtain the execution results, and return the results to the business terminal.

[0206] Step S214: Based on the first contract call record after the callback, update and store the first condition hash value and the first business data in the tree node associated with the first request condition in the on-chain storage space;

[0207] After a blockchain node calls an oracle contract to populate the received first business data into the corresponding transaction request (i.e., the first transaction request) and sends the first business data to the first business contract, the first business data and its corresponding first condition hash value are stored in the on-chain storage space. When storing the first business data and the first condition hash value into the segment tree structure in the on-chain storage space, the target segment tree structure for storing the data is first determined based on the data type of the first business data. Then, the target tree node associated with the first request condition is found in the target segment tree structure through the request condition range corresponding to the first request condition of the business data (i.e., the target condition query range). The specific process of finding the target tree node is the same as the process of finding the target tree node in step S102 above, so the process of finding the target tree node will not be described again here. However, the purpose of finding the target tree node here is different from that in step S102. Step S102 finds the target tree node to find the first business data in the target tree node, while here the blockchain node finds the target tree node to store the obtained first off-chain business data in the target tree node. Therefore, after the blockchain node finds the tree node associated with the first request condition, it can store the first business data and the first condition hash value in the condition hash list of that tree node.

[0208] It is important to note that because a segment tree node has an inclusion relationship with its subtrees, the dimensional search range of that node essentially includes the dimensional search range of the nodes in its subtrees. Therefore, during the segment tree update process, if a node completes an update, all nodes in its subtrees need to be updated. In this embodiment, the segment tree structure in the on-chain storage space generates a delay marker (i.e., a first delay marker) in the updated node when updating a node (i.e., a second-type node). This delay marker allows for delayed updates to the segment tree. For example, after receiving first off-chain business data and finding a target segment tree node (i.e., a second-type node) that can be used to store this data, the oracle contract updates the storage of the first off-chain business data in the condition hash list corresponding to that segment tree. During this update process, a first delay marker related to the update is also generated. By generating the first delay marker, the update only updates the target node (i.e., the second-type node) and not the nodes in its subtrees. The delayed flag will only be applied the next time the target tree node is accessed, and the child nodes (i.e., second-type child nodes) of the target tree node will be updated based on this delayed flag. It can be understood that the segment tree node here can be accessed because of querying certain data or in the process of storing certain business data, such as to obtain the dimension search range in the tree node for comparison, etc., without specific restrictions.

[0209] When a segment tree node (i.e., a second-type node) is visited, its first delay tag is detected, and the child nodes (i.e., second-type child nodes) are updated based on this first delay tag. Since this delay tag is generated when the tree node is updated and records relevant update information, the child nodes (i.e., second-type child nodes) can be updated accordingly using the update information recorded in the first delay tag. During the update process of the second-type child nodes, a corresponding delay tag is generated in each child node, and the first delay tag in the second-type node is eliminated. It's understandable that the first delay tag in the visited second-type tree node has been used and disappeared, while its child nodes, due to being updated, generate new delay tags (first child delay tags), since delay tags are generated when tree nodes are updated. If the newly generated child node with the delayed tag (i.e., the second type of child node) is accessed for some reason, the delayed tag (i.e., the first child delayed tag) in the child node will continue to be applied. The specific application process is the same as the application process described above, that is, the child node of the second type of child node is updated and the first child delayed tag is passed on.

[0210] Understandably, by maintaining a deferred tag during segment tree node updates, updating a certain tree node (i.e., a second-type node) does not update all nodes in the segment tree structure to which that node belongs that should be updated. Only when a second-type node with a first deferred tag is accessed is the first deferred tag passed down and applied. This ensures that each time a node in the segment tree is accessed, that node is an updated node. Because of the deferred tag, a large number of nodes in the segment tree structure remain unupdated. By reducing update operations on these nodes, the time efficiency of segment tree updates is greatly improved.

[0211] For further details, please see Figure 12 , Figure 12 This is a schematic diagram illustrating a scenario of delayed tag propagation in a segment tree, as provided in an embodiment of this application. Figure 12 As shown, when segment tree node 58a in segment tree 69a is accessed, a delay marker 59a is found in segment tree node 58a. Therefore, the child nodes of segment tree node 58a, namely segment tree nodes 58b and 58c, are updated based on this delay marker. It can be understood that the delay marker 59a in segment tree node 58a may have been generated by a previous update of segment tree node 58a, for example, in this embodiment, a delay marker generated when the oracle contract stores received off-chain business data at this node, and therefore this delay marker needs to be propagated downwards. Furthermore, as... Figure 12 As shown, after updating segment tree nodes 58b and 58c based on the delay tag 59a, a new delay tag will be generated in segment tree nodes 58b and 58c according to the content of this update, that is... Figure 12 Delay markers 59b and 59c are in the range. Since delay marker 59a has already been applied at this point, it will be cleared.

[0212] Furthermore, such as Figure 12 As shown, if segment tree node 58b in segment tree 69b, which generated delay tags 59b and 59c, is visited again, the delay tag 59b in segment tree node 58b will continue to propagate to its child nodes. Figure 12 As shown, at this point, only segment tree nodes 58b and 58c in segment tree 69b contain delay tags. Since segment tree node 58b has been visited, the child nodes of segment tree node 58b, namely segment tree nodes 58d and 58e, can be updated based on the delay tag 59b. New delay tags will then be generated in these two nodes based on this update. Figure 12Delay markers 59d and 59e are used in the segment tree. Because the delay markers are used, delay marker 59b in segment tree node 58b is subsequently cleared, ultimately forming a structure like... Figure 12 The segment tree shown is 69c.

[0213] Further, please see Figure 15 , Figure 15 This is a schematic diagram of a data processing device based on a segment tree structure provided in an embodiment of this application. The data processing device 1 can be a computer program (including program code) running on a computer device; for example, the data processing device 1 can be an application software. The data processing device 1 can be used to execute the data processing device provided in the embodiment of this application. Figure 3 The corresponding steps in the method. The data processing device 1 may include: a first conditional hash value acquisition module 11, an on-chain conditional hash value lookup module 12, a first off-chain query request sending module 13, and a first business data update storage module 14;

[0214] The first condition hash value acquisition module 11 is used to call the oracle contract to obtain the first condition hash value corresponding to the first request condition from the first transaction request; the first transaction request is sent by the first business terminal corresponding to the first business object to the oracle contract by calling the first business contract; the first condition hash value is obtained by the first business contract performing hash calculation on the first request condition; the first request condition refers to the request condition used to request the acquisition of the first business data associated with the data business.

[0215] The on-chain condition hash value lookup module 12 is used to search for a condition hash value that matches the first condition hash value among the condition hash values ​​recorded in the tree nodes of the segment tree structure stored in the on-chain storage space.

[0216] The first off-chain query request sending module 13 is used to send a first off-chain query request for the first request condition to the oracle through the oracle contract if no condition hash value matching the first condition hash value is found and it is determined that the first business data does not exist in the on-chain storage space. The first off-chain query request is used to instruct the oracle to obtain the first off-chain business data corresponding to the first condition hash value when it calculates the first condition hash value corresponding to the first request condition, and to return the first condition hash value and the first off-chain business data to the oracle contract based on the first off-chain query request.

[0217] The first business data update storage module 14 is used to call the oracle contract to use the first off-chain business data as the first business data to be written into the on-chain storage space, and to update and store the first condition hash value and the first business data into the tree node associated with the first request condition in the on-chain storage space.

[0218] The specific implementation methods of the first conditional hash value acquisition module 11, the on-chain conditional hash value lookup module 12, the first off-chain query request sending module 13, and the first business data update storage module 14 can be found in the above description. Figure 3 The descriptions of steps S101-S104 in the corresponding embodiments will not be repeated here.

[0219] Among them, the tree nodes on the segment tree structure include the first type of nodes; the node data structure corresponding to the first type of nodes includes the business type of the data service, the business dimension data corresponding to the business type, and the hash storage list; the business dimension data corresponding to the first type of nodes is used to characterize the first dimension search range of the data service in each business dimension; the hash storage list corresponding to the first type of nodes is used to record the conditional hash value in the first dimension search range.

[0220] The on-chain conditional hash value lookup module 12 includes: a first-dimensional search range acquisition unit 121, a first-range comparison result acquisition unit 122, and a conditional hash value lookup unit 123;

[0221] The first dimension search range acquisition unit 121 is used to call the oracle contract to obtain the segment tree structure that matches the business type of the data business, and to obtain the first dimension search range of the data business in each business dimension from the storage data structure corresponding to the first type of node of the segment tree structure.

[0222] The first range comparison result acquisition unit 122 is used to acquire the target condition query range indicated by the first request condition, compare the target condition query range with the first dimension search range, and obtain the first range comparison result.

[0223] The condition hash value lookup unit 123 is used to search for a condition hash value that matches the first condition hash value in the condition hash value recorded in the first dimension search range in the hash storage list corresponding to the first type of node if the first range comparison result indicates that the target condition query range is the first dimension search range.

[0224] In this segment tree structure, tree nodes include first-type child nodes; first-type child nodes are the child nodes of the first-type nodes; if the segment tree structure is a one-dimensional segment tree structure, then the child nodes of the first-type nodes include first-child nodes and second-child nodes; the node data structure corresponding to the first-child nodes and second-child nodes includes the business type of the data service, the business dimension data corresponding to the business type, and a hash storage list; the business dimension data corresponding to the first-child node is used to represent the first sub-dimension search range of the data service in each business dimension, and the business dimension data corresponding to the second-child node is used to represent the second sub-dimension search range of the data service in each business dimension; the hash storage list corresponding to the first-child node is used to record the conditional hash value in the first sub-dimension search range, and the hash storage list corresponding to the second-child node is used to record the conditional hash value in the second sub-dimension search range;

[0225] The specific implementation methods of the first dimension search range acquisition unit 121, the first range comparison result acquisition unit 122, and the conditional hash value lookup unit 123 can be found in the above description. Figure 10 The descriptions of steps S202 to S204 in the corresponding embodiments will not be repeated here.

[0226] The on-chain conditional hash value lookup module 12 also includes: a second range comparison unit 124 and a child node hash list lookup unit 125;

[0227] The second range comparison unit 124 is used to compare the target condition query range with the first sub-dimension search range and the second sub-dimension search range respectively if the first range comparison result indicates that the target condition query range is the range in the first dimension search range, and obtain the second range comparison result.

[0228] The child node hash list lookup unit 125 is used to search for a condition hash value that matches the first condition hash value in the condition hash value recorded in the hash storage list corresponding to the first child node in the first sub-dimension search range if the second range comparison result indicates that the target condition query range is the first sub-dimension search range and the target condition query range does not belong to the range in the second sub-dimension search range.

[0229] The specific implementation methods of the second range comparison unit 124 and the child node hash list lookup unit 125 can be found in the above description. Figure 10 The descriptions of steps S205 to S206 in the corresponding embodiments will not be repeated here.

[0230] The on-chain conditional hash value lookup module 12 also includes: an overlap result processing unit 126;

[0231] The overlapping result processing unit 126 is configured to, if the second range comparison result indicates that the target condition query range and the first sub-dimension search range have a first overlapping range, and the target condition query range and the second sub-dimension search range have a second overlapping range, then search for a condition hash value that matches the first condition hash value in the condition hash value recorded in the hash storage list corresponding to the first type of node in the first dimension search range; the first overlapping range is the range in the first sub-dimension search range, and the second overlapping range is the range in the second sub-dimension search range.

[0232] The device 1 also includes: a polling request acquisition module 23, a call record checking module 24, and a hash registration sending module 25;

[0233] Polling request acquisition module 23 is used to acquire polling requests sent by the oracle;

[0234] Call record checking module 24 is used to perform event checking on the call records generated in the oracle contract based on polling requests, and obtain the event checking results;

[0235] The hash registration sending module 25 is used to send a hash registration event to the oracle when the event check result indicates that the call record generation event is the event corresponding to the generation of the first contract call record; the hash registration event is used to instruct the oracle to perform hash registration for the first condition hash value.

[0236] The first business data update and storage module 14 includes: a callback transaction acquisition unit 141, a callback transaction parsing unit 142, a response data backfilling unit 143, and a first business data storage unit 144.

[0237] The callback transaction acquisition unit 141 is used to acquire the first callback transaction returned by the oracle in response to the first off-chain query request; the first callback transaction carries the first condition hash value and the first off-chain business data.

[0238] Callback transaction parsing unit 142 is used to call the oracle contract to parse the first callback transaction, obtain the first condition hash value and the first off-chain business data, and retrieve the first contract call record corresponding to the first condition hash value from the oracle contract; the first contract call record refers to the record recorded in the oracle contract with the first condition hash value as the key and the first merge request dataset as the value; the first merge request dataset is a request dataset used to merge multiple transaction requests corresponding to the same request condition; the multiple transaction requests include the first transaction request;

[0239] The response data backfilling unit 143 is used to backfill the first business data as the first request response data into the first transaction request in the first contract request dataset when the oracle contract is called to use the first off-chain business data as the first business data to be written into the on-chain storage space, so as to obtain the first contract call record after the callback.

[0240] The first business data storage unit 144 is used to update and store the first condition hash value and the first business data in the tree node associated with the first request condition in the on-chain storage space based on the first contract call record after the callback.

[0241] The specific implementation methods of the callback transaction acquisition unit 141, callback transaction parsing unit 142, response data backfilling unit 143, and first business data storage unit 144 can be found in the above description. Figure 3 The description of step S104 in the corresponding embodiment will not be repeated here.

[0242] The device 1 also includes: a callback detection module 28, a callback function execution module 29, and an execution result return module 30;

[0243] The callback detection module 28 is used to perform callback detection on the first transaction request based on the first contract call record after the callback, and obtain the callback detection result.

[0244] The callback function execution module 29 is used to determine the first callback function for calling the first business contract based on the callback parameters if the callback detection result indicates that the first transaction request carries callback parameters for the first business contract, and to send the first business data back to the first business contract when the contract address of the first business contract is obtained through the first callback function.

[0245] The execution result return module 30 is used to execute data services through the first business contract, obtain the first business execution result corresponding to the data service, and return the first business execution result to the first business terminal corresponding to the business contract.

[0246] The specific implementation methods of the callback detection module 28, the callback function execution module 29, and the execution result return module 30 can be found in the above. Figure 10 The descriptions of steps S211 to S214 in the corresponding embodiments will not be repeated here.

[0247] Among them, multiple transaction requests include a second transaction request in addition to the first transaction request. The second transaction request is sent by the second business terminal corresponding to the second business object to the oracle contract by calling the second business contract. The second request condition refers to the request condition used to request the acquisition of the first business data.

[0248] Device 1 also includes: a second business contract processing module 31;

[0249] The second business contract processing module 31 is used to simultaneously send the first business data back to the second business contract when sending the first business data back to the first business contract.

[0250] The device 1 also includes: an on-chain business data acquisition module 26 and a business data return module 27;

[0251] The on-chain business data acquisition module 26 is used to, if a condition hash value matching the first condition hash value is found in the on-chain storage space, take the tree node storing the first condition hash value in the on-chain storage space as the target tree node, and call the oracle contract to obtain the first business data from the node tree structure corresponding to the target tree node.

[0252] The business data return module 27 is used to call the oracle contract to return the first business data to the first business contract, execute the data business through the first business contract, obtain the second business execution result corresponding to the data business, and return the second business execution result to the first business terminal corresponding to the business contract.

[0253] The request parameters for the first transaction request include callback parameters and request sender parameters. The request sender parameters are used to represent the contract address of the first business contract, and the callback parameters are used to instruct the oracle contract to return the first business data to the first business contract based on the contract address of the first business contract when it obtains the first business data.

[0254] The business data return module 27 includes: a callback function execution unit 271, a data business execution unit 272, and an execution result return unit 273;

[0255] Callback function execution unit 271 is used to call the callback function indicated by the callback parameter in the oracle contract, obtain the business address of the business contract indicated by the request sender parameter, and return the first business data to the first business contract based on the contract address of the business contract.

[0256] The data service execution unit 272 is used to call the business execution function associated with the data service in the first business contract based on the first business data, execute the data service, and obtain the second business execution result corresponding to the data service.

[0257] The execution result return unit 273 is used to return the execution result of the second service to the first service terminal.

[0258] The device 1 further includes: a transaction request acquisition module 15, a second condition value acquisition module 16, and a first contract call record generation module 17;

[0259] The transaction request acquisition module 15 is used to acquire multiple transaction requests associated with data services; the multiple transaction requests include a first transaction request and a second transaction request, wherein the second transaction request is a transaction request other than the first transaction request.

[0260] The second condition hash value acquisition module 16 is used to call the oracle contract to obtain the second condition hash value corresponding to the second request condition from the second transaction request;

[0261] The first contract call record generation module 17 is used to merge multiple transaction requests into a first merged request dataset through an oracle contract when the second condition hash value is consistent with the first condition hash value, and when it is determined that the second condition request is the same as the first request condition. The module generates a first contract call record for recording the first condition hash value and the first merged request dataset. The first contract call record is used to indicate that when the first business data is obtained, the first business data is used as the first request response data to fill each of the multiple transaction requests.

[0262] The specific implementation methods of the transaction request acquisition module 15, the second condition value acquisition module 16, and the first contract call record generation module 17 can be found in the above description. Figure 10 The description of step S209 in the corresponding embodiment will not be repeated here.

[0263] The device 1 also includes:

[0264] The second contract call record generation module 18 is used to determine that the second request condition is different from the first request condition if the second condition hash value is different from the first condition hash value, and to generate a second contract call record for recording the second condition hash value and the second merged request dataset when creating the second request merged dataset corresponding to the second transaction request through the oracle contract; the second contract call record is used to indicate that when the second business data required for the second transaction request is obtained, the second business data is filled back into the second transaction request as the second request response data.

[0265] The device also includes: a third transaction request acquisition module 19, a conditional hash value comparison module 20, and a first merge request dataset update module 21;

[0266] The third transaction request acquisition module 19 is used to call the oracle contract to obtain the third condition hash value corresponding to the third request condition from the third transaction request when the third transaction request is acquired; the acquisition timestamp of multiple transaction requests is the first timestamp, and the acquisition timestamp of the third transaction request is the second timestamp; the second timestamp is the timestamp after the first timestamp.

[0267] The conditional hash value comparison module 20 is used to compare the third conditional hash value with the first conditional hash value if the second timestamp is a timestamp within the time interval threshold range corresponding to the first timestamp, and obtain the hash value comparison result.

[0268] The first merge request dataset update module 21 is used to add the third transaction request to the first merge request dataset through the oracle contract if the hash value comparison result indicates that the third condition hash value is consistent with the first condition hash value.

[0269] The device also includes:

[0270] The third contract call record generation module 22 is used to generate a third contract call record for recording the third condition hash value and the third merged request dataset when calling the oracle contract to create the third request merged dataset corresponding to the third transaction request if the hash value comparison result indicates that the third condition hash value is different from the first condition hash value. The third contract call record is used to indicate that when the third business data required for the third transaction request is obtained, the third business data will be filled back into the third transaction request as the third request response data.

[0271] Among them, the tree nodes in the segment tree structure include the second type of nodes; the node data structure corresponding to the second type of nodes includes the business type of the data service, the business dimension data corresponding to the business type, and the hash storage list; the business dimension data corresponding to the second type of nodes is used to characterize the second dimension search range of the data service in each business dimension;

[0272] The first business data update and storage module 14 includes: a first business data acquisition unit 145, a second dimension search range acquisition unit 146, a third range comparison unit 147, and a second type of node update unit 148;

[0273] The first business data acquisition unit 145 is used to call the oracle contract to use the first off-chain business data as the first business data to be written into the on-chain storage space.

[0274] The second-dimensional search range acquisition unit 146 is used to call the oracle contract to obtain the segment tree structure that matches the business type of the data business, and to obtain the second-dimensional search range of the data business in each business dimension from the storage data structure corresponding to the second type of node of the segment tree structure.

[0275] The third range comparison unit 147 is used to obtain the target condition query range indicated by the first request condition, compare the target condition query range with the second dimension search range in the third range, and obtain the third range comparison result.

[0276] The second type of node update unit 148 is used to record the first condition hash value and the first business data in the hash storage list corresponding to the second type of node if the third range comparison result indicates that the target condition query range is the first dimension search range.

[0277] The specific implementation methods of the first business data acquisition unit 145, the second dimension search range acquisition unit 146, the third range comparison unit 147, and the second type of node update unit 148 can be found above. Figure 3 The description of step S104 in the corresponding embodiment will not be repeated here.

[0278] In this segment tree structure, tree nodes include second-type child nodes; second-type child nodes are the child nodes of second-type nodes; if the segment tree structure is a one-dimensional segment tree structure, then the child nodes of second-type nodes include third-type child nodes and fourth-type child nodes; the node data structure corresponding to the third-type child nodes and fourth-type child nodes includes the business type of the data service, the business dimension data corresponding to the business type, and a hash storage list; the business dimension data corresponding to the third-type child node is used to represent the third sub-dimension search range of the data service in each business dimension, and the business dimension data corresponding to the fourth-type child node is used to represent the fourth sub-dimension search range of the data service in each business dimension;

[0279] The first business data update storage module 14 also includes: a fourth range comparison unit 149 and a third child node update unit 151;

[0280] The fourth range comparison unit 149 is used to perform a fourth range comparison with the third sub-dimension search range and the fourth sub-dimension search range respectively if the third range comparison result indicates that the target condition query range is the range in the first dimension search range, and to obtain the fourth range comparison result.

[0281] The third child node update unit 151 is used to record the first condition hash value and the first business data in the hash storage list corresponding to the third child node if the fourth range comparison result indicates that the target condition query range is the third sub-dimension search range and the target condition query range does not belong to the range in the fourth sub-dimension search range.

[0282] Further, please see Figure 16 , Figure 16 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 16 As shown, the computer device 1000 can be a user terminal, for example, the one described above. Figure 1 The service terminal 110a in the corresponding embodiment can also be a server, for example, as described above. Figure 1The blockchain node 10d in the corresponding embodiment will not be limited here. For ease of understanding, this application takes a computer device as a user terminal as an example. The computer device 1000 may include: a processor 1001, a network interface 1004, and a memory 1005. In addition, the computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. The communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory, such as at least one disk storage device. The memory 1005 may also optionally be at least one storage device located away from the aforementioned processor 1001. Figure 16 As shown, the memory 1005, which is a computer-readable storage medium, may include an operating system, a network communication module, a user interface module, and a device control application.

[0283] The network interface 1004 in the computer device 1000 can also provide network communication functionality. Figure 16 In the computer device 1000 shown, the network interface 1004 provides network communication functionality; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to implement the aforementioned... Figure 3 or Figure 10 The description of the data processing method based on the segment tree structure in the corresponding embodiments can also be performed as described above. Figure 15 The description of the data processing device 1 based on the segment tree structure in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated here.

[0284] Furthermore, it should be noted that this application embodiment also provides a computer-readable storage medium, which stores the computer program executed by the data processing device 1 based on the segment tree structure mentioned above. The computer program includes computer instructions, and when the processor executes the computer instructions, it can execute the aforementioned... Figure 3 or Figure 10The description of the data processing method based on the segment tree structure in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the computer-readable storage medium embodiments related to this application, please refer to the description of the method embodiments of this application. As an example, computer instructions can be deployed and executed on a single computer device, or on multiple computer devices located in one location, or on multiple computer devices distributed across multiple locations and interconnected via a communication network. These multiple computer devices distributed across multiple locations and interconnected via a communication network can constitute a blockchain system.

[0285] Furthermore, it should be noted that this application also provides a computer program product or computer program, which may include computer instructions, which may be stored in a computer-readable storage medium. The processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor may execute the computer instructions, causing the computer device to perform the aforementioned actions. Figure 3 or Figure 10 The description of the data processing method based on the segment tree structure in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the computer program products or computer program embodiments involved in this application, please refer to the description of the method embodiments of this application.

[0286] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0287] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0288] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.

Claims

1. A data processing method based on a segment tree structure, characterized in that, The method is executed by a blockchain node, which deploys an oracle contract associated with the oracle, a business contract associated with the data service, and on-chain storage space corresponding to the segment tree structure. The on-chain storage space stores the condition hash values ​​recorded by the tree nodes in the segment tree structure, with each condition hash value corresponding to a request condition. The method includes: The oracle contract is invoked to obtain the first condition hash value corresponding to the first request condition from the first transaction request; the first transaction request is sent to the oracle contract by the first business terminal corresponding to the first business object through invoking the first business contract; the first condition hash value is obtained by the first business contract performing a hash calculation on the first request condition; the first request condition refers to the request condition used to request the acquisition of the first business data associated with the data business. Among the condition hash values ​​recorded in the tree nodes of the segment tree structure stored in the on-chain storage space, find the condition hash value that matches the first condition hash value; If no matching condition hash value is found, and it is determined that the first business data does not exist in the on-chain storage space, a first off-chain query request for the first request condition is sent to the oracle through the oracle contract. The first off-chain query request is used to instruct the oracle to obtain the first off-chain business data corresponding to the first condition hash value when it calculates the first condition hash value corresponding to the first request condition, and to return the first condition hash value and the first off-chain business data to the oracle contract based on the first off-chain query request. The oracle contract is invoked to use the first off-chain business data as the first business data to be written into the on-chain storage space, and the first condition hash value and the first business data are updated and stored in the tree node associated with the first request condition in the on-chain storage space.

2. The method according to claim 1, characterized in that, The tree nodes in the segment tree structure include a first type of node; the node data structure corresponding to the first type of node includes the business type of the data service, the business dimension data corresponding to the business type, and a hash storage list; the business dimension data corresponding to the first type of node is used to characterize the first dimension search range of the data service in each business dimension; the hash storage list corresponding to the first type of node is used to record the conditional hash value in the first dimension search range. The step of searching for a condition hash value that matches the first condition hash value from the condition hash values ​​recorded in the tree nodes of the segment tree structure stored in the on-chain storage space includes: Call the oracle contract to obtain a segment tree structure that matches the business type of the data service, and obtain the first dimension search range of the data service in each business dimension from the storage data structure corresponding to the first type of node in the segment tree structure; Obtain the target condition query range indicated by the first request condition, compare the target condition query range with the first dimension search range to obtain the first range comparison result; If the first range comparison result indicates that the target condition query range is the first dimension search range, then in the condition hash values ​​recorded in the hash storage list corresponding to the first type of node in the first dimension search range, a condition hash value that matches the first condition hash value is searched.

3. The method according to claim 2, characterized in that, The tree nodes in the segment tree structure include a first type of child nodes; the first type of child nodes are the child nodes of the first type of node; if the segment tree structure is a one-dimensional segment tree structure, then the child nodes of the first type of node include a first child node and a second child node; the node data structure corresponding to the first child node and the second child node includes the business type of the data service, the business dimension data corresponding to the business type, and a hash storage list; the business dimension data corresponding to the first child node is used to characterize the first sub-dimension search range of the data service in each business dimension, and the business dimension data corresponding to the second child node is used to characterize the second sub-dimension search range of the data service in each business dimension; the hash storage list corresponding to the first child node is used to record the conditional hash value in the first sub-dimension search range, and the hash storage list corresponding to the second child node is used to record the conditional hash value in the second sub-dimension search range; The method further includes: If the first range comparison result indicates that the target condition query range is within the first dimension search range, then the target condition query range is compared with the first sub-dimension search range and the second sub-dimension search range respectively to obtain the second range comparison result. If the second range comparison result indicates that the target condition query range is the first sub-dimension search range, and the target condition query range does not belong to the range in the second sub-dimension search range, then in the condition hash values ​​recorded in the hash storage list corresponding to the first child node in the first sub-dimension search range, a condition hash value matching the first condition hash value is searched.

4. The method according to claim 3, characterized in that, The method further includes: If the second range comparison result indicates that the target condition query range and the first sub-dimension search range have a first overlapping range, and the target condition query range and the second sub-dimension search range have a second overlapping range, then in the condition hash values ​​recorded in the hash storage list corresponding to the first type of node in the first dimension search range, a condition hash value matching the first condition hash value is searched; the first overlapping range is the range in the first sub-dimension search range, and the second overlapping range is the range in the second sub-dimension search range.

5. The method according to claim 1, characterized in that, The method further includes: Obtain the polling request sent by the oracle; Based on the polling request, the event is checked by generating the event from the call record in the oracle contract, and the event check result is obtained. When the event check result indicates that the call record generation event is the event corresponding to the generation of the first contract call record, a hash registration event for registering the first condition hash value is sent to the oracle; the hash registration event is used to instruct the oracle to perform hash registration for the first condition hash value.

6. The method according to claim 1, characterized in that, The step of calling the oracle contract to use the first off-chain business data as the first business data to be written into the on-chain storage space, and updating the storage of the first condition hash value and the first business data in the tree node associated with the first request condition in the on-chain storage space includes: Obtain the first callback transaction returned by the oracle in response to the first off-chain query request; the first callback transaction carries the first condition hash value and the first off-chain business data. The oracle contract is invoked to parse the first callback transaction, obtaining the first condition hash value and the first off-chain business data. The first contract call record corresponding to the first condition hash value is obtained from the oracle contract. The first contract call record refers to the record recorded in the oracle contract with the first condition hash value as the key and the first merge request dataset as the value. The first merge request dataset is a request dataset used to merge multiple transaction requests corresponding to the same request condition. The multiple transaction requests include the first transaction request. When the oracle contract is invoked to write the first off-chain business data as the first business data to be written into the on-chain storage space, the first business data is used as the first request response data to fill the first transaction request in the first contract request dataset, and the first contract call record after the callback is obtained. Based on the first contract call record after the callback, the first condition hash value and the first business data are updated and stored in the tree node associated with the first request condition in the on-chain storage space.

7. The method according to claim 6, characterized in that, The method further includes: Based on the first contract call record after the callback, the first transaction request is subjected to callback detection to obtain the callback detection result. If the callback detection result indicates that the first transaction request carries callback parameters for the first business contract, then a first callback function for calling back the first business contract is determined based on the callback parameters. When the contract address of the first business contract is obtained through the first callback function, the first business data is sent back to the first business contract. The data service is executed through the first business contract, and the first business execution result corresponding to the data service is obtained. The first business execution result is then returned to the first business terminal corresponding to the business contract.

8. The method according to claim 7, characterized in that, The plurality of transaction requests include a second transaction request in addition to the first transaction request. The second transaction request is sent by the second business terminal corresponding to the second business object to the oracle contract by calling the second business contract. The second request condition refers to the request condition used to request the acquisition of the first business data. The method further includes: When the first business data is sent back to the first business contract, the first business data is simultaneously sent back to the second business contract.

9. The method according to claim 1, characterized in that, The method further includes: If a condition hash value matching the first condition hash value is found in the on-chain storage space, the tree node storing the first condition hash value in the on-chain storage space is taken as the target tree node, and the oracle contract is called to obtain the first business data from the node tree structure corresponding to the target tree node. The oracle contract is invoked to return the first business data to the first business contract, and the data business is executed through the first business contract to obtain the second business execution result corresponding to the data business. The second business execution result is then returned to the first business terminal corresponding to the business contract.

10. The method according to claim 9, characterized in that, The request parameters of the first transaction request include callback parameters and request sender parameters; the request sender parameters are used to characterize the contract address of the first business contract, and the callback parameters are used to instruct the oracle contract to return the first business data to the first business contract based on the contract address of the first business contract when it obtains the first business data; The step of calling the oracle contract to return the first business data to the first business contract, executing the data business through the first business contract to obtain the second business execution result corresponding to the data business, and returning the second business execution result to the first business terminal corresponding to the business contract includes: Call the callback function indicated by the callback parameter in the oracle contract, obtain the business address of the business contract indicated by the request sender parameter, and return the first business data to the first business contract based on the contract address of the business contract; Based on the first business data, the business execution function associated with the data business in the first business contract is called to execute the data business and obtain the second business execution result corresponding to the data business. The result of the second service execution is returned to the first service terminal.

11. The method according to claim 1, characterized in that, The method further includes: Obtain multiple transaction requests associated with the data service; the multiple transaction requests include the first transaction request and the second transaction request, wherein the second transaction request is a transaction request other than the first transaction request; The oracle contract is invoked to obtain the second condition hash value corresponding to the second request condition from the second transaction request; If the second condition hash value is consistent with the first condition hash value, then when it is determined that the second condition request is the same as the first request condition, the multiple transaction requests are merged into a first merged request dataset through the oracle contract, and a first contract call record is generated to record the first condition hash value and the first merged request dataset; the first contract call record is used to indicate that when the first business data is obtained, the first business data is used as the first request response data to fill each of the multiple transaction requests.

12. The method according to claim 11, characterized in that, The method further includes: If the second condition hash value is different from the first condition hash value, then the second request condition is determined to be a request condition different from the first request condition. When creating the second request merge dataset corresponding to the second transaction request through the oracle contract, a second contract call record is generated to record the second condition hash value and the second merge request dataset. The second contract call record is used to indicate that when the second business data required by the second transaction request is obtained, the second business data is backfilled into the second transaction request as the second request response data.

13. The method according to claim 11, characterized in that, The method further includes: Upon receiving a third transaction request, the oracle contract is invoked to retrieve the third condition hash value corresponding to the third request condition from the third transaction request; the timestamps for the acquisition of the multiple transaction requests are the first timestamps, and the timestamps for the acquisition of the third transaction request are the second timestamps; the second timestamp is a timestamp after the first timestamp. If the second timestamp is a timestamp within the time interval threshold range corresponding to the first timestamp, then the third conditional hash value is compared with the first conditional hash value to obtain a hash value comparison result; If the hash value comparison result indicates that the third condition hash value is consistent with the first condition hash value, then when it is determined that the third condition request is the same as the first request condition, the third transaction request is added to the first merged request dataset through the oracle contract.

14. The method according to claim 13, characterized in that, The method further includes: If the hash value comparison result indicates that the third condition hash value is different from the first condition hash value, then when the oracle contract is called to create the third request merge dataset corresponding to the third transaction request, a third contract call record is generated to record the third condition hash value and the third merge request dataset; the third contract call record is used to indicate that when the third business data required by the third transaction request is obtained, the third business data is filled back into the third transaction request as the third request response data.

15. The method according to claim 1, characterized in that, The tree nodes in the segment tree structure include a second type of node; the node data structure corresponding to the second type of node includes the business type of the data service, the business dimension data corresponding to the business type, and a hash storage list; the business dimension data corresponding to the second type of node is used to characterize the second dimension search range of the data service in each business dimension; The step of calling the oracle contract to use the first off-chain business data as the first business data to be written into the on-chain storage space, and updating the storage of the first condition hash value and the first business data in the tree node associated with the first request condition in the on-chain storage space includes: The oracle contract is invoked to use the first off-chain business data as the first business data to be written into the on-chain storage space. Call the oracle contract to obtain a segment tree structure that matches the business type of the data service, and obtain the second dimension search range of the data service in each business dimension from the storage data structure corresponding to the second type of node of the segment tree structure; Obtain the target condition query range indicated by the first request condition, and compare the target condition query range with the second dimension search range to obtain the third range comparison result. If the third range comparison result indicates that the target condition query range is the first dimension search range, then the first condition hash value and the first business data are recorded in the hash storage list corresponding to the second type of node.

16. The method according to claim 15, characterized in that, The tree nodes in the segment tree structure include second-type child nodes; the second-type child nodes are the child nodes of the second-type nodes; if the segment tree structure is a one-dimensional segment tree structure, then the child nodes of the second-type nodes include third-type child nodes and fourth-type child nodes; the node data structure corresponding to the third-type child nodes and the fourth-type child nodes includes the business type of the data service, the business dimension data corresponding to the business type, and a hash storage list; the business dimension data corresponding to the third-type child node is used to characterize the third sub-dimension search range of the data service in each business dimension, and the business dimension data corresponding to the fourth-type child node is used to characterize the fourth sub-dimension search range of the data service in each business dimension; The method further includes: If the third range comparison result indicates that the target condition query range is within the range of the first dimension search range, then the target condition query range is compared with the third sub-dimension search range and the fourth sub-dimension search range respectively to obtain the fourth range comparison result; If the fourth range comparison result indicates that the target condition query range is the third sub-dimension search range, and the target condition query range does not belong to the range in the fourth sub-dimension search range, then the first condition hash value and the first business data are recorded in the hash storage list corresponding to the third child node.

17. A data processing device based on a segment tree structure, characterized in that, The device operates on a blockchain node, on which are deployed oracle contracts associated with oracles, business contracts associated with data services, and on-chain storage space corresponding to the segment tree structure. The on-chain storage space stores the condition hash values ​​recorded by the tree nodes in the segment tree structure, with each condition hash value corresponding to a request condition. The device includes: The first condition hash value acquisition module is used to call the oracle contract to obtain the first condition hash value corresponding to the first request condition from the first transaction request. The first transaction request is sent by the first business terminal corresponding to the first business object to the oracle contract by calling the first business contract. The first condition hash value is obtained by the first business contract performing hash calculation on the first request condition. The first request condition refers to the request condition used to request the acquisition of the first business data associated with the data business. The on-chain condition hash value lookup module is used to search for a condition hash value that matches the first condition hash value among the condition hash values ​​recorded in the tree nodes of the segment tree structure stored in the on-chain storage space. The first off-chain query request sending module is used to send a first off-chain query request for the first request condition to the oracle through the oracle contract if no condition hash value matching the first condition hash value is found and it is determined that the first business data does not exist in the on-chain storage space. The first off-chain query request is used to instruct the oracle to obtain the first off-chain business data corresponding to the first condition hash value when it calculates the first condition hash value corresponding to the first request condition, and to return the first condition hash value and the first off-chain business data to the oracle contract based on the first off-chain query request. The first business data update storage module is used to call the oracle contract to take the first off-chain business data as the first business data to be written into the on-chain storage space, and update and store the first condition hash value and the first business data into the tree node associated with the first request condition in the on-chain storage space.

18. A computer device, characterized in that, Including memory and processor; The memory is connected to the processor, the memory is used to store computer programs, and the processor is used to invoke the computer programs so that the computer device performs the method according to any one of claims 1-16.

19. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded and executed by a processor to cause a computer device having the processor to perform the method of any one of claims 1-16.

20. A computer program product, characterized in that, Includes a computer program / instruction that, when executed by a processor, implements the method according to any one of claims 1-16.