Credible query configuration method and system for block chain PB-level multi-modal data

By adopting a decentralized adaptive multi-level indexing mechanism in the blockchain system, building in-block indexes and incremental views, the query performance is optimized, and the blockchain system's insufficient index construction and query complexity in PB-level multimodal data processing is solved, and efficient and trusted query and traceability query are achieved.

CN120179650AActive Publication Date: 2025-06-20JINAN SHENGAN INFORMATION TECH CO LTD

Patent Information

Application Number
CN202510310798.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-17
Publication Date
2025-06-20
Estimated Expiration
2045-03-17

AI Technical Summary

Technical Problem

When processing PB-level multimodal data, blockchain systems have problems such as insufficient index construction, high complexity of data query, and low query efficiency, which cannot meet millions of trusted queries per second and transaction processing capabilities of tens of thousands of TPS.

Method used

The decentralized adaptive multi-level indexing mechanism is adopted, and the in-block indexing of Merkle Tree and B+ tree building blocks is combined with incremental view and coarse-grained indexing models to optimize query performance, support complex queries and traceability queries, and hash verification is used to ensure the credibility of query results.

Benefits of technology

It realizes efficient index construction and rapid query of PB-level multimodal data, improves the query execution capabilities of the blockchain system, supports query efficiency of millions/second and trusted traceability query, and solves the problem of efficient and trusted queries in the blockchain system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120179650A_ABST
    Figure CN120179650A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of block chains, and discloses a trusted query configuration method and system for block chain PB-level multi-modal data, and the method comprises the steps: obtaining multi-modal uplink data, and extracting metadata of the multi-modal data to construct an in-block index; constructing a block index table based on the block ID, logically organizing the block index table, and adaptively and dynamically adjusting the block index table; constructing an index partition table used for storing block index table identifiers and addresses; constructing a coarse-grained index model, quickly positioning a block index table in an index partition table according to query conditions, searching a reverse index in the block index table, obtaining a block ID (Identity) and a storage position, retrieving an index in a block, querying a specific data record, verifying a Hash path, and realizing credible query of data. According to the method, a decentralized self-adaptive multi-level index mechanism is adopted, decentralized query performance is optimized, complex query and traceability query operations such as connection and aggregation are supported, and effectiveness and credibility of query results are guaranteed through a credible query algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular, to a method and system for configuring a trusted query of PB-level multimodal data in a blockchain. Background Art

[0002] The statements in this section merely provide background technical information related to the present invention and do not necessarily constitute prior art.

[0003] Blockchain is a new computing paradigm that prevents data tampering through encryption, organizes multiple pieces of data at the block granularity, stores blocks in a linked list append mode, ensures consistency through multiple block copies, and reaches a consensus on the integrity of blocks through transaction processing by multiple parties. It is mainly applicable to untrusted multi-party value exchange scenarios characterized by openness and sharing. According to the different storage models, query capabilities, and transaction processing mechanisms of the blockchain, it has mainly experienced three development stages: digital currency, smart contract, and smart society.

[0004] As the application focus of the blockchain gradually shifts from digital currency to digital society, the blockchain has begun to play an active role in fields such as digital government, healthcare, and finance, and will become an important enabling technology for improving the social and economic collaboration model in the future. However, as the basic core of the blockchain application system, there are still problems in blockchain storage and data management, such as insufficient multimodal data expression ability, poor scalability of the storage model, lack of complex query ability, and low transaction processing performance. There is still a large gap from the PB (Petabytes)-level multimodal data storage ability, millions of complex queries per second and trusted traceability queries, and transaction processing ability of tens of thousands of TPS (Transactions per second) required by the digital society.

[0005] This means that blockchain data is no longer limited to numerical values, but theoretically supports more modalities such as text, sequences, and videos. The introduction of multimodal data such as videos has rapidly increased the storage requirements of a single block, and it is easier to trigger the bottleneck of full nodes with the weakest storage capacity. To address this challenge, the blockchain system mainly adopts an on-chain and off-chain storage architecture model, moves the data in the on-chain block to off-chain local storage or cloud storage, and reconstructs the on-chain index in the form of "pointers" and synchronizes it to a relational database, converting the query problem of the blockchain into an index and retrieval problem of the database, such as FabricSQL, BigChainDB, ChainSQL, TrustSQL, etc. Further, to support all parties to reach a consensus on the query results efficiently, FISCO BCOS adopts a deterministic transaction concurrency processing method based on DAG, and Chang'an Chain adopts an optimistic transaction concurrency processing mechanism. Nevertheless, the transaction processing ability of blockchain 2.0 is still only 20~1000 TPS, and the total storage rarely breaks through the PB level.

[0006] In summary, the current blockchain storage architecture model, data query mechanism, and transaction processing mechanism are still in the primary stage in supporting PB-level multi-modal data storage, reliable queries of millions of records per second, and transaction processing of 70,000 TPS, and still face a large number of fundamental challenges. The main problems are as follows: 1. It is unable to adapt to the index construction of PB-level multi-modal data, and there is a lack of index construction methods for unstructured data such as videos, audios, and pictures.

[0007] 2. There is a lack of efficient index construction methods. The limited expressive ability of the K-V model leads to insufficient semantic description of blockchain data, making it difficult to support complex queries and unable to provide linked queries for data within blockchain blocks and cloud storage data.

[0008] 3. There is a lack of implementation methods for fast queries, and it is unable to perform complex queries, traceability queries, etc. in a timely manner. Summary of the Invention

[0009] To solve the above problems, the present invention proposes a reliable query configuration method and system for PB-level multi-modal data of a blockchain. For PB-level multi-modal data, a decentralized adaptive multi-level index mechanism is adopted to optimize the decentralized query performance, support complex queries such as joins and aggregations, and traceability query operations, and ensure the effectiveness and reliability of query results through a reliable query algorithm.

[0010] To achieve the above object, the present invention adopts the following technical solutions: In the first aspect, the present invention provides a reliable query configuration method for PB-level multi-modal data of a blockchain, including the following steps: Obtain multi-modal data uploaded to the blockchain, extract the metadata of the multi-modal data, construct an in-block index based on the metadata using a Merkle Tree, and optimize the constructed index using a B+ tree; Construct a block index table based on the block ID, and logically organize the block index table in the way of an incremental view, and adaptively and dynamically adjust the block index table according to the changes in the blockchain data; Construct an index partition table according to the type of metadata for storing the block index table identifier and address; Construct a coarse-grained index model, quickly locate the block index table to be queried in the index partition table according to the query conditions, search for the inverted index in the block index table according to the metadata to be queried, obtain the block ID and storage location, retrieve the in-block index, query the specific data record, and verify the hash path to achieve reliable query of the data.

[0011] As an alternative implementation, constructing the in-block index based on the metadata is specifically: Construct an in-block index using the metadata of multimodal data as the leaf node building blocks of a Merkle Tree, and optimize the constructed index using a B+ tree.

[0012] As an alternative implementation, when extracting the metadata of multimodal data, data truncation is used to process the compressed feature codes.

[0013] As an alternative implementation, synchronization update rules are pre-set for the in-block index, and various types of basic framework data, intelligent perception data, and association relationship data cached in memory are batch processed to avoid frequent write and update operations on the global index and local index.

[0014] As an alternative implementation, a Bloom filter or an encrypted multiset accumulator is used to construct a coarse-grained index model.

[0015] As an alternative implementation, the block index table is an inverted index, supporting single-column index, unique index, primary key index, and clustered index.

[0016] In a second aspect, the present invention provides a trusted query configuration system for PB-level multimodal data of a blockchain, including: An in-block index construction module, configured to: obtain multimodal data uploaded to the blockchain, extract the metadata of the multimodal data, construct an in-block index based on the metadata using a Merkle Tree, and optimize the constructed index using a B+ tree; A block index construction module, configured to: construct a block index table based on the block ID, logically organize the block index table in the form of an incremental view, and adaptively and dynamically adjust the block index table according to the changes in the blockchain data; A partition index construction module, configured to: construct an index partition table according to the type of metadata, for storing the block index table identifier and address; A trusted query module, configured to: construct a coarse-grained index model, quickly locate the block index table to be queried in the index partition table according to the query conditions, search the inverted index in the block index table according to the metadata to be queried, obtain the block ID and storage location, retrieve the in-block index, query the specific data record, and verify the hash path to implement the trusted query of the data.

[0017] In a third aspect, the present invention provides an electronic device, including a memory, a processor, and computer instructions stored on the memory and running on the processor. When the computer instructions are run by the processor, the method described in the first aspect is completed.

[0018] In a fourth aspect, the present invention provides a computer-readable storage medium for storing computer instructions. When the computer instructions are executed by a processor, the method described in the first aspect is completed.

[0019] In a fifth aspect, the present invention provides a computer program product, including a computer program which, when executed by a processor, implements the method described in the first aspect.

[0020] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. The present invention proposes a method and system for configuring a trusted query of PB-level multimodal data in a blockchain. It innovatively proposes a multi-level index structure and uses a verification chain to ensure the credibility of off-chain data. For multimodal data, a hash self-learning algorithm is adopted to continuously optimize the index structure, and at the same time, new ideas are provided for complex queries and traceability queries. Specifically, in implementation, technologies such as distributed storage, encrypted multiset accumulators, and multimodal hash methods are used to support the indexing of multimodal data.

[0021] 2. The present invention proposes a method and system for configuring a trusted query of PB-level multimodal data in a blockchain. It uses an improved Merkle Tree to provide fast query and trusted verification of intra-block data, and uses a verification chain to store the hash values of off-chain data to ensure the authenticity and integrity of off-chain data; this multi-level index structure provides good technical support for fast execution and fast verification of collaborative queries and trusted verification of on-chain and off-chain data, and solves the problem of efficient and trusted queries in blockchain systems.

[0022] Advantages of additional aspects of the present invention will be partially given in the following description, partially will become obvious from the following description, or will be understood through the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The accompanying drawings forming a part of this specification are used to provide a further understanding of the present invention. The schematic embodiments and descriptions thereof of the present invention are used to explain the present invention and do not constitute an improper limitation to the present invention.

[0024] Figure 1 It is an architecture diagram of a method for configuring a trusted query of PB-level multimodal data in a blockchain provided in Embodiment 1 of the present invention; Figure 2 It is a flowchart of adaptively constructing an index provided in Embodiment 1 of the present invention; Figure 3 It is a multi-level index structure diagram provided in Embodiment 1 of the present invention; Figure 4 It is a trusted query mechanism of PB-level multimodal data in a blockchain provided in Embodiment 1 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0025] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0026] It should be noted that the following detailed description is exemplary and is intended to provide further illustration of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present invention belongs.

[0027] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units need not be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0028] In the case of no conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other.

[0029] Embodiment 1 As Figure 1 shown, this embodiment provides a method for configuring a trusted query of PB-level multimodal data in a blockchain, including the following steps: S1. Obtain multimodal data uploaded to the blockchain, extract the metadata of the multimodal data, construct an in-block index based on the metadata using MerkleTree, and optimize the constructed index using a B+ tree; S2. Construct a block index table based on the block ID, logically organize the block index table in the way of an incremental view, and adaptively and dynamically adjust the block index table according to the changes in the blockchain data; S3. Construct an index partition table according to the type of metadata, which is used to store the block index table identifier and address; S4. Construct a coarse-grained index model, quickly locate the block index table to be queried in the index partition table according to the query condition, search for the inverted index according to the metadata to be queried in the block index table, obtain the block ID and storage location, retrieve the in-block index, query the specific data record, and verify the hash path to achieve trusted query of the data.

[0030] The present invention is directed to PB-level multimodal data and provides an efficient index construction method and a fast query mechanism. A decentralized adaptive multi-level index construction model is proposed, including shard index, block index, and intra-block index, which meets the requirements of index adaptive construction and verifiability. The metadata modeling of large-scale multimodal data is designed, and the index table is logically organized in the form of incremental views. The index table is adaptively adjusted dynamically according to the changes in transaction data to achieve efficient and trustworthy indexing of on-chain and off-chain data. A query expression based on multimodal data is adopted, and a trustworthy traceability query and optimization algorithm are designed to improve the query execution ability, achieve a query efficiency of millions per second, and support time window query, range query, keyword query, and subscription query.

[0031] A distributed index server is adopted: a multi-level verifiable index of shard, block, and intra-block is established for blockchain data to be uploaded, as well as single-index, multi-index, and partition index within the chain. The Bloom filter is optimized, which can significantly reduce the decentralized query latency. For the trustworthy query problem of on-chain and off-chain data, a verification blockchain for storing the hash values of off-chain transaction data is established, and the authenticity and integrity of off-chain data are guaranteed through the verification of hash values.

[0032] Complex query and trustworthy traceability are supported: the multimodal data is reduced in dimension and quantified, and the data is mapped to a binary coding space through hashing to generate specific pattern hash codes and multi-pattern collaborative hash codes for different retrieval tasks, supporting multi-keyword query, fuzzy query, Top-k query, etc. Trustworthy verification is carried out for the hierarchical index, mainly including hash result verification, on-chain and off-chain data collaborative verification, encrypted multiset accumulator, etc.

[0033] The basic idea of the incremental index organization method is as follows: in order to comprehensively take care of small, medium, large, and extra-large jobs, various organization methods can be adopted to form the physical structure of the file. If the disk block size is 1KB or 4KB, for small files, at most only 10 disk blocks will be occupied. In order to improve the access speed of a large number of small jobs, it is best to directly put the disk block address of each of them into the file control block FCB (or index node), so that the disk block address of the file can be directly obtained from the FCB. Generally, this addressing method is also called direct addressing. For medium-sized files, a single-level index organization method can be adopted. At this time, to obtain the disk block address of the file, only need to first find the index table of the file from the FCB, and then the disk block address can be obtained from it, which can be called one-level indirect addressing. For large and extra-large files, two-level and three-level index organization methods can be adopted, or called two-level indirect addressing and three-level indirect addressing. The so-called incremental index organization method is organized based on the above basic idea. It adopts both direct addressing and single-level and multi-level index organization methods (indirect addressing).

[0034] Adapting and dynamically adjusting the index table according to the changes in transaction data, specifically: dynamically adjusting the hash function based on the characteristics of the data to reduce hash collisions and improve the efficiency of indexing; dynamically adjusting the size of the index according to the growth and changes of the data to accommodate newly added data, thereby reducing hash conflicts.

[0035] Method for constructing an in-block index based on metadata of multi-modal data: The in-block data storage space of the blockchain is limited. When storing PB-level multi-modal data, on-chain and off-chain data collaborative processing is required, which brings great difficulties to the rapid query of blockchain data. Adopting an index mechanism is an effective solution to improve query performance. For multi-modal data, metadata needs to be extracted first. Metadata is used to describe multi-modal data such as contract data, transaction data, pictures, and videos and is the basis for constructing the index. By listening to the data on the chain to extract metadata, the metadata is used as the leaf nodes of the Merkle Tree to construct the in-block index. Optimization methods such as B+ and multi-way trees are used to optimize the trusted data index establishment model to achieve in-block query support and trusted verification for multi-modal data. The specific steps are as Figure 2 shown (1) Metadata extraction: Listen to multi-modal data on the chain, and use the hash method to map the multi-modal data to the binary coding space. To improve the data processing efficiency, data truncation can be used for the compressed feature codes. For example, using the SM3 hash algorithm to output a 16-byte feature code, the first 12 bytes can be used as the feature code. The truncated feature code has the same effect of hash verification and also preserves the similarity between data points. Through dimensionality reduction and quantization expression methods, use LPG (Labeled Property Graphs) to abstractly express multi-modal data, mainly including four expression methods: nodes (data entities), relationships (connections between nodes), attributes (existing in the form of key-value pairs between nodes and relationships), and labels (indicating the roles and types of nodes), etc.

[0036] (2) Data on the chain: The metadata is used as the leaf nodes of the Merkle Tree to construct the in-block index. Optimization methods such as B+ and multi-way trees are used to optimize the trusted data index establishment model to achieve in-block query support and trusted verification for multi-modal data.

[0037] (3) In-block index synchronization and update of the blockchain: Preset synchronization and update rules, and batch process various basic framework data, intelligent perception data, and association relationship data cached in the memory to avoid frequent write and update operations on the global index and local index.

[0038] (4) Combining with the deep learning model, it supports the query mode of multi-modal data, converts it into hash codes of specific modes and multi-mode collaborative hash codes for different query tasks, transforms the query conditions into complex queries of metadata, and supports multi-keyword queries, fuzzy queries, Top-k queries, etc.

[0039] (5) For off-chain data, the verification chain method is adopted to store the link address of the off-chain data and the hash value of the off-chain data in the blockchain, and the position of the verification chain is stored through the index table. The decentralized verification chain can ensure the authenticity of the off-chain data hash value and provide effective verification support for trusted queries.

[0040] Construction method of multi-level index: To improve the retrieval performance, for the index of block data, a multi-level index model is constructed according to the type of metadata in the block, as Figure 3 shown. First, construct an index partition table according to the metadata type to store the specific index table identifier and address, and use methods such as Bloom filters and encrypted multiset accumulators to construct a coarse-grained index model, which can quickly locate the index table to be queried according to the query conditions; secondly, construct dynamically according to the block changes, adopt the incremental index method to construct an inverted index, and the index can be constructed based on metadata such as keywords and feature codes, supporting single-column indexes, unique indexes, primary key indexes, and clustered indexes; the third-level index is the in-block index, which is optimized using a B+ tree.

[0041] An off-chain index server is adopted, which is independent of the blockchain. A distributed database is used to store the index table, and a multi-level verifiable index of partitions, blocks, and in-blocks is established, and the changes in blockchain data are monitored to dynamically update and maintain the multi-level index table, and the query capabilities of the database are utilized to provide complex query functions based on SQL language. The specific steps are as follows: (1) Construct a distributed index database, disperse the index data and store it on multiple computers, and perform collaborative processing through the network. Utilizing the parallel processing capabilities of multiple computers can significantly improve the efficiency of index construction and query. Select appropriate data sources and dynamically write the indexes into the distributed storage system, such as HDFS (Hadoop Distributed File System) of Hadoop.

[0042] (2) Primary index construction, in the distributed storage system, construct a primary index for the main data, create a table or view on the index data, and define the index fields. Taking Apache Hive as an example, a Hive table can be created to store the data, and a primary index can be created based on a certain field (such as ID).

[0043] (3) Build an index partition table quick search model. Design a coarse-grained index model using Bloom filters, and use binary vectors (bit arrays) and a series of random mapping functions (SM3) to determine whether the index partition data is in a set. Design a coarse-grained index model using Bloom filters to provide efficient search and filtering functions for index partition data.

[0044] Initialization: Create a bit array and initialize all bits to 0. Select a set of independent keys K1, K2, K3 as the input of the random function for hash calculation, and select the SM3 algorithm as the hash function.

[0045] Insert partition index type: Input the index type on the distributed index server, and calculate its hash value using all hash functions. Set the bit at the corresponding hash value position in the bit array to 1.

[0046] Query index type: For each data type to be queried, calculate its hash value using all hash functions. Check whether all bits at the corresponding hash value positions in the bit array are 1. If all bits are 1, it is considered that the element may exist (but there is a possibility of false positives); if any bit is 0, it is determined that the element does not exist. In this way, it can be quickly judged whether there is data to be retrieved on the distributed index server.

[0047] (4) Build an index partition table, which is dynamically built according to block changes, and use the incremental index method to build an inverted index. The index can be built based on metadata such as keywords and feature codes, and supports single-column index, unique index, primary key index, and clustered index.

[0048] (5) Merkle Tree optimization. Use a B+ tree to optimize the construction of in-block indexes within the blockchain. A B+ tree is a self-balancing, ordered tree data structure that performs search, sequential access, insertion, and deletion operations in O(log n) time complexity. B+ trees are widely used as index structures in databases and file systems and can effectively support range queries and sorting operations. The following is the construction process of the B+ tree.

[0049] Select index column: Select a column with high selectivity as the index column according to the query requirements.

[0050] Create the root node: Use the first key value of the index column as the key of the root node and create the corresponding pointers (if there are child nodes).

[0051] Insert key value: For each key value to be inserted, start searching for its insertion position from the root node. If the root node is not full, directly insert the key value. If the root node is full, perform node splitting, distribute the key values to two new nodes, and create a new parent node to store the intermediate key values of the split nodes.

[0052] Maintaining balance: During the insertion process, if a node splits, the split result needs to be propagated upward, which may cause the parent node to split. Through this splitting and propagation process, the B+ tree maintains its balance.

[0053] Deleting key values: The deletion operation is similar to the insertion operation, but the merging of nodes needs to be considered. If a node becomes underfilled (below the minimum fill factor) after deletion, an attempt is made to borrow values from sibling nodes or merge nodes to maintain balance.

[0054] Optimize the Merkle Tree using the B+ tree to adapt to the storage and query of large-scale data. Store each layer of the Merkle Tree as an independent B+ tree node. For example, the hash values of each layer can be used as a node and stored in the B+ tree. In this way, the efficient query and range query capabilities of the B+ tree can be utilized. In each leaf node of the B+ tree, store a pointer to the corresponding node in the Merkle Tree or directly store part of the hash value. This can quickly locate the specific hash value and then verify the integrity of the data. Use the B+ tree to dynamically update the hash values of the Merkle Tree. When a data block changes, only update the hash value of the corresponding node in the B+ tree, and then recalculate the hash values of the upper-layer nodes until the root node. This can reduce unnecessary full-tree reconstruction. The specific steps are as follows: (1) Construct the basic data structure: First, establish a B+ tree structure.

[0055] (2) Initialize the Merkle Tree: In each node of the B+ tree, initialize the corresponding layer of the Merkle Tree.

[0056] (3) Data insertion and update: When a new data block is inserted or an existing data block is updated, calculate the new hash value and update the corresponding node in the B+ tree.

[0057] (4) Query and verification: Through the query function of the B+ tree, quickly locate a specific Merkle Tree node for data integrity verification.

[0058] Use the constructed multi-level index for fast and reliable traceability query: Such as Figure 4As shown in the figure, hash result verification, on-chain and off-chain data collaborative verification, encrypted multiset accumulator verification, etc. are used. First, according to the query conditions, quickly locate the block index table to be queried in the index partition table; search the inverted index according to the metadata to be queried in the block index table to locate the block ID and storage location; according to the block ID and storage location, retrieve the in-block index, query the specific data record, and verify the hash path through the improved B+ Tree to achieve a trusted query of the in-block data; obtain the off-chain data according to the off-chain data address in the block index table, query and verify the on-chain hash value, and verify the integrity of the off-chain data according to the verified on-chain hash value to perform collaborative trusted query of on-chain and off-chain data. The specific query steps are as follows: (1)Access the distributed index server, input the secret keys k1, k2, k3 according to the type of retrieved data, calculate the hash result of SM3 distributively, query the Bloom filter according to the hash result. If all the corresponding positions are 1, it means that the relevant index partition table is stored on this index server.

[0059] (2)Query the index partition table, quickly locate the blocks that meet the conditions according to the query data, and verify the integrity of the on-chain data and off-chain data according to the hash value of the integrity check.

[0060] (3)Traverse the multi-modal data in the blockchain block, verify the integrity from the leaf node to the root node in the B+ tree, and return the query result.

[0061] Embodiment 2 This embodiment provides a trusted query configuration system for PB-level multi-modal data in a blockchain, including: An in-block index construction module, configured to: obtain multi-modal data on the chain, extract the metadata of the multi-modal data, and construct an in-block index based on the metadata; A block index construction module, configured to: construct a block index table based on the block ID, logically organize the block index table in the way of an incremental view, and adaptively and dynamically adjust the block index table according to the changes in the blockchain data; A partition index construction module, configured to: construct an index partition table according to the type of metadata, for storing the block index table identifier and address; A trusted query module, configured to: construct a coarse-grained index model, quickly locate the block index table to be queried in the index partition table according to the query conditions, search the inverted index according to the metadata to be queried in the block index table to obtain the block ID and storage location, retrieve the in-block index, query the specific data record, and verify the hash path to achieve a trusted query of the data.

[0062] It should be noted here that the above modules correspond to the steps described in Embodiment 1. The examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the content disclosed in Embodiment 1 above. It should be noted that the above modules, as part of the system, can be executed in a computer system such as a set of computer-executable instructions.

[0063] In more embodiments, there is also provided: An electronic device includes a memory, a processor, and computer instructions stored on the memory and running on the processor. When the computer instructions are run by the processor, the method described in Embodiment 1 is completed. For the sake of brevity, it will not be elaborated here.

[0064] It should be understood that in this embodiment, the processor may be a central processing unit CPU, and the processor may also be other general-purpose processors, digital signal processors DSP, application-specific integrated circuits ASIC, off-the-shelf programmable gate arrays FPGA, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0065] The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A part of the memory may also include a non-volatile random memory. For example, the memory may also store information about the device type.

[0066] A computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by the processor, the method described in Embodiment 1 is completed.

[0067] The method in Embodiment 1 can be directly embodied as being executed and completed by a hardware processor, or by a combination of hardware and software modules in the processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps of the above method. To avoid repetition, it will not be described in detail here.

[0068] A computer program product includes a computer program. When the computer program is executed by the processor, the method described in Embodiment 1 is implemented and completed.

[0069] The present invention also provides at least one computer program product tangibly stored on a non-transitory computer-readable storage medium. The computer program product includes computer-executable instructions, such as instructions included in program modules, which are executed in a device on a target real or virtual processor to perform the processes / methods described above. Generally, program modules include routines, programs, libraries, objects, classes, components, data structures, etc. that perform specific tasks or implement specific abstract data types. In various embodiments, the functions of program modules can be combined or divided among program modules as needed. The machine-executable instructions for program modules can be executed within local or distributed devices. In a distributed device, program modules can be located in local and remote storage media.

[0070] The computer program code for implementing the method of the present invention can be written in one or more programming languages. This computer program code can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the program code is executed by the computer or other programmable data processing device, the functions / operations specified in the flowchart and / or block diagram are implemented. The program code can be executed entirely on the computer, partially on the computer, as a stand-alone software package, partially on the computer and partially on a remote computer, or entirely on a remote computer or server.

[0071] In the context of the present invention, the computer program code or related data can be carried by any suitable carrier so that a device, apparatus, or processor can perform the various processes and operations described above. Examples of carriers include signals, computer-readable media, and the like. Examples of signals can include electrical, optical, radio, acoustic, or other forms of propagated signals, such as carrier waves, infrared signals, etc.

[0072] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in conjunction with this embodiment can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. A professional technician can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of this application.

[0073] Although the specific implementation manners of the present invention have been described above in conjunction with the accompanying drawings, it is not a limitation to the protection scope of the present invention. Those skilled in the art should understand that based on the technical solution of the present invention, various modifications or deformations that can be made by those skilled in the art without creative efforts are still within the protection scope of the present invention.

Claims

1. A trusted query configuration method for PB-level multimodal data in blockchain, characterized in that: The following steps are involved: Obtain multimodal on-chain data and extract metadata of multimodal data. Use Merkle Tree to build in-block index based on metadata and use B+ tree to optimize the constructed index. Build a block index table based on the block ID, organize the block index table logically through incremental views, and dynamically adjust the block index table according to the changes in blockchain data; Build an index partition table based on the type of metadata to store the block index table identifier and address; Build a coarse-grained index model, quickly locate the block index table to be queried in the index partition table according to the query conditions, search the inverted index in the block index table according to the metadata to be queried, obtain the block ID and storage location, retrieve the index in the block, query the specific data record, and verify the hash path to achieve trusted query of data.

2. A trusted query configuration method for blockchain PB-level multimodal data as described in claim 1, characterized in that: Build in-block indexes based on metadata, specifically: The metadata of multimodal data is used as the leaf nodes of the Merkle Tree to build an intra-block index, and the constructed index is optimized using the B+ tree.

3. A trusted query configuration method for blockchain PB-level multimodal data as claimed in claim 1, characterized in that: When extracting metadata of multimodal data, the compressed feature codes are processed by data truncation.

4. A trusted query configuration method for blockchain PB-level multimodal data as described in claim 2, characterized in that: Pre-set synchronization update rules for the index within the block, batch process various basic framework data, intelligent perception data and association relationship data cached in the memory, and avoid frequent writing and updating operations on global and local indexes.

5. A trusted query configuration method for blockchain PB-level multimodal data as claimed in claim 1, characterized in that: A coarse-grained index model is constructed using Bloom filters or encrypted multiset accumulators.

6. A trusted query configuration method for blockchain PB-level multimodal data as claimed in claim 1, characterized in that: The block index table is a reverse sort index, supporting single column index, unique index, primary key index and clustered index.

7. A trusted query configuration system for PB-level multimodal data in blockchain, characterized in that: include: The intra-block index building module is configured to: obtain multi-modal on-chain data, extract metadata of the multi-modal data, build an intra-block index using Merkle Tree based on the metadata, and optimize the built index using B+ tree; The block index building module is configured to: build a block index table based on the block ID, logically organize the block index table by incremental view, and dynamically adjust the block index table according to the changes of blockchain data; The partition index building module is configured to: build an index partition table according to the type of metadata, for storing the block index table identifier and address; The trusted query module is configured to: build a coarse-grained index model, quickly locate the block index table to be queried in the index partition table according to the query conditions, search the inverted index in the block index table according to the metadata to be queried, obtain the block ID and storage location, retrieve the index in the block, query the specific data record, and verify the hash path to realize the trusted query of data.

8. An electronic device, characterized in that: The method comprises a memory and a processor and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method according to any one of claims 1 to 6 is completed.

9. A computer-readable storage medium, characterized in that: Used to store computer instructions, which, when executed by a processor, complete the method described in any one of claims 1 to 6.

10. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Information query and consensus method, system and device and storage medium

    CN110008233A

  • Sub-table management method and device based on index template, equipment and storage medium

    CN114153844A

  • Verifiable efficient query method for block chain

    CN116910173A

  • Multi-modal data verifiable query method and system based on block chain

    CN118245640A

  • Hybrid storage block chain query optimization method oriented to business environment evaluation

    CN118312532A

Cited By

  • Multi-modal data storage method and device, equipment, medium and product

    CN120950005A

  • Mass data query method and related equipment

    CN121009117A

  • Power consumption data tracing method and device, electronic equipment and storage medium

    CN122087012A