Data processing method and device based on block chain network and storage medium

By performing semantic sharding and vectorization on multimodal data in the blockchain network and establishing a two-level index structure, the problem of low retrieval efficiency in traditional blockchain networks is solved, enabling fast and accurate multimodal data retrieval and improving semantic understanding capabilities.

CN121681891APending Publication Date: 2026-03-17INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511957898.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-23
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Traditional blockchain networks suffer from excessively long retrieval times and lack semantic understanding capabilities when dealing with massive amounts of data, making them ineffective at handling semantic queries of multimodal data.

Method used

By performing semantic sharding and vectorization on multi-modal data in the blockchain network, a two-level index structure is established: the first-level index is based on the mapping of keywords and semantic shard identification information, and the second-level index is based on the encoding mapping of vectorized metadata, which supports fast location and accurate semantic retrieval.

Benefits of technology

It enables fast and accurate multimodal data retrieval in the blockchain network, improves retrieval efficiency and semantic understanding capabilities, and meets the requirements for real-time response.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121681891A_ABST
    Figure CN121681891A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device based on a block chain network and a storage medium, and relates to the field of block chains. The method comprises the steps that N types of modal data in a block chain network are acquired, and N is an integer larger than 1; performing semantic fragmentation on the N types of modal data, and recording identification information of different semantic fragments to a first-level index; performing vectorization processing on the data stored in each semantic fragment to generate corresponding vectorized metadata, and establishing a second-level index based on the vectorized metadata; a semantic retrieval request from the Internet of Things equipment is received, and the semantic retrieval request comprises a target query vector; and according to the target query vector, the first-level index and the second-level index, determining and returning a retrieval result matched with the semantic retrieval request. According to the method and the device, the technical problem of low multi-modal semantic retrieval efficiency caused by low global traversal retrieval efficiency and lack of semantic understanding capability of a traditional block chain is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of blockchain, and more specifically, to a data processing method, apparatus, and storage medium based on a blockchain network. Background Technology

[0002] In recent years, blockchain technology, due to its distributed, immutable, and decentralized characteristics, has demonstrated enormous potential in data security and trust establishment, and has been widely applied, especially in finance, healthcare, and the Internet of Things. However, with the explosive growth of data volume in blockchain networks, particularly the increase in unstructured and multimodal data, traditional blockchain retrieval mechanisms are facing severe challenges.

[0003] In traditional blockchain networks, data retrieval requires traversing each block from the beginning, checking if the content of each transaction matches the query criteria. This global traversal approach leads to excessively long retrieval times when dealing with large amounts of data, failing to meet the demands for real-time or rapid response. Furthermore, traditional retrieval mechanisms cannot effectively handle semantic queries on multimodal data because they lack the ability to understand and process data semantics.

[0004] There is currently no effective solution to the above problems. Summary of the Invention

[0005] This application provides a data processing method, apparatus, and storage medium based on a blockchain network, which at least solves the technical problem of low efficiency in multimodal semantic retrieval caused by the low efficiency of global traversal retrieval and lack of semantic understanding capabilities in traditional blockchains.

[0006] According to one aspect of the embodiments of this application, a data processing method based on a blockchain network is provided, comprising: acquiring N modal data in the blockchain network, where N is an integer greater than 1; performing semantic segmentation on the N modal data and recording the identification information of different semantic segments into a first-level index, wherein the first-level index is used to characterize the mapping relationship between keywords and the identification information of semantic segments; performing vectorization processing on the data stored in each semantic segment to generate corresponding vectorized metadata, and establishing a second-level index based on the vectorized metadata, wherein the second-level index is used to characterize the mapping relationship between keywords and the index encoding of the vectorized metadata; receiving a semantic retrieval request from an Internet of Things device, wherein the semantic retrieval request includes a target query vector; and determining and returning retrieval results matching the semantic retrieval request based on the target query vector, the first-level index, and the second-level index.

[0007] Optionally, semantic segmentation is performed on the N modal data, including: extracting the data features and associated location information of each modal data; determining the semantic similarity between every two modal data in the N modal data based on the data features and location information of each modal data; and clustering the N modal data into different semantic segments based on the semantic similarity between every two modal data.

[0008] Optionally, the data stored in each semantic segment is vectorized to generate corresponding vectorized metadata, including: detecting the data type of the modal data stored in the i-th semantic segment, where the i-th semantic segment is any semantic segment; if the modal data stored in the i-th semantic segment is detected to be text data, then the text data is vectorized using a pre-trained text vectorization model to generate text vectorized metadata corresponding to the text data; if the modal data stored in the i-th semantic segment is detected to be image data, then the image data is vectorized using a pre-trained convolutional neural network to generate image vectorized metadata corresponding to the image data.

[0009] Optionally, the data processing method based on the blockchain network further includes: performing dimensionality compression and filtering on the generated text vectorized metadata and image vectorized metadata, wherein dimensionality compression is used to reduce the data dimensionality of the text vectorized metadata and image vectorized metadata, and filtering is used to filter out metadata that appears repeatedly in the text vectorized metadata and image vectorized metadata.

[0010] Optionally, based on the target query vector, the first-level index, and the second-level index, the retrieval results matching the semantic retrieval request are determined, including: querying the first-level index based on the target query vector to determine one or more target semantic shards; generating a cross-shard query request for the target semantic shard based on the target query vector and the target semantic shard; broadcasting the cross-shard query request to the target node, wherein the target node is a node in the blockchain network corresponding to the target semantic shard; and determining the retrieval results matching the target query vector based on the query response returned by the target node based on the second-level index.

[0011] Optionally, based on the query response returned by the target node based on the second-level index, the retrieval result matching the target query vector is determined, including: receiving the target index code returned by the target node based on the second-level index, wherein the target index code is the index code related to the cross-shard query request matched from the second-level index; using the target index code as the query response and obtaining the candidate vectorized metadata corresponding to the query response; detecting the semantic relevance between the target query vector and the candidate vectorized metadata; if the semantic relevance is greater than a preset threshold, then using the modal data corresponding to the candidate vectorized metadata as the retrieval result matching the target query vector.

[0012] Optionally, the data processing method based on the blockchain network further includes: associating cross-shard query requests with the returned search results and storing them in the data cache area of ​​the blockchain network; setting a cache duration for cached items in the data cache area; and within the cache duration, if a semantic search request with a similarity greater than a preset similarity to the target query vector is received again, the search results are returned directly from the data cache area.

[0013] Optionally, the data processing method based on the blockchain network also includes: monitoring the semantic distribution change information of data access requests in the blockchain network; dynamically adjusting the composition and topology of semantic shards according to the semantic distribution change information; and synchronously updating the adjusted semantic shard information to the first-level index through the blockchain consensus mechanism.

[0014] Optionally, when building the second-level index, the keywords are disambiguated using a knowledge graph to determine the mapping relationship of the keywords in the second-level index.

[0015] Optionally, the N modal data are data collected by IoT devices, and semantic retrieval requests are initiated by IoT devices with a resource idle rate less than a preset idle rate.

[0016] According to another aspect of the embodiments of this application, a data processing apparatus based on a blockchain network is also provided, comprising: an acquisition unit, configured to acquire N types of modal data in the blockchain network, where N is an integer greater than 1; a first processing unit, configured to perform semantic segmentation on the N types of modal data and record the identification information of different semantic segments into a first-level index, wherein the first-level index is used to characterize the mapping relationship between keywords and the identification information of semantic segments; a second processing unit, configured to perform vectorization processing on the data stored in each semantic segment, generate corresponding vectorized metadata, and establish a second-level index based on the vectorized metadata, wherein the second-level index is used to characterize the mapping relationship between keywords and the index encoding of the vectorized metadata; a receiving unit, configured to receive a semantic retrieval request from an Internet of Things device, wherein the semantic retrieval request includes a target query vector; and a determining unit, configured to determine and return a retrieval result matching the semantic retrieval request based on the target query vector, the first-level index, and the second-level index.

[0017] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, which stores a computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located performs the above-described data processing method based on a blockchain network.

[0018] According to another aspect of the embodiments of this application, an electronic device is also provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors cause the one or more processors to perform the above-described data processing method based on a blockchain network.

[0019] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program or instructions, which, when executed by a processor, implement the above-described data processing method based on a blockchain network.

[0020] In this application, the data processing method based on a blockchain network first obtains N modal data from the blockchain network, where N is an integer greater than 1; performs semantic segmentation on the N modal data and records the identification information of different semantic segments in a first-level index, wherein the first-level index is used to represent the mapping relationship between keywords and the identification information of semantic segments; performs vectorization processing on the data stored in each semantic segment to generate corresponding vectorized metadata, and establishes a second-level index based on the vectorized metadata, wherein the second-level index is used to represent the mapping relationship between keywords and the index encoding of the vectorized metadata; receives a semantic retrieval request from an IoT device, wherein the semantic retrieval request includes a target query vector; and determines and returns the retrieval results matching the semantic retrieval request based on the target query vector, the first-level index, and the second-level index.

[0021] As described above, this application first aggregates various data types in the blockchain network, classifies and optimizes data storage through semantic sharding technology, and establishes a two-level index data structure: the first-level index is based on the mapping between keywords and semantic shard identification information to achieve rapid location; the second-level index relies on vectorized metadata, extracts semantic features of the data through a deep learning model, and establishes a mapping relationship between keywords and vectorized metadata encoding, thereby supporting more accurate semantic retrieval. When an IoT device initiates a query request containing semantic information, the system can efficiently utilize these two levels of indexes to locate and return highly relevant results, solving the technical problem of low efficiency in multimodal semantic retrieval caused by the low efficiency of global traversal retrieval and lack of semantic understanding capabilities in traditional blockchains. Attached Figure Description

[0022] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0023] Figure 1 This is a flowchart of an optional data processing method based on a blockchain network according to an embodiment of this application;

[0024] Figure 2 This is a schematic diagram of an optional data processing method based on a blockchain network according to an embodiment of this application;

[0025] Figure 3 This is a schematic diagram of an optional data processing device based on a blockchain network according to an embodiment of this application. Detailed Implementation

[0026] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0028] It should also be noted that the information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, and displayed data) collected in this application are information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of related data all comply with the relevant laws, regulations, and standards of the relevant regions, necessary confidentiality measures have been taken, and they do not violate public order and good morals. Corresponding operation entry points are provided for users to choose to authorize or refuse. For example, this system has interfaces with relevant users or organizations. Before obtaining relevant information, a request to obtain the information needs to be sent to the aforementioned user or organization through the interface, and the relevant information is obtained only after receiving consent from the aforementioned user or organization.

[0029] According to an embodiment of this application, an embodiment of a data processing method based on a blockchain network is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0030] According to the embodiments of this application, a data processing system based on a blockchain network (hereinafter referred to as the system) can be used as the execution subject of the data processing method based on a blockchain network in the embodiments of this application. The system can be a software system or an embedded system combining software and hardware. Of course, the execution subject of the method in the embodiments of this application can also be other forms of execution subject, such as devices, equipment, etc. It should be known by those skilled in the art that this application does not particularly limit the specific form of the execution subject of the method.

[0031] Figure 1 This is a data processing method based on a blockchain network according to embodiments of this application, such as... Figure 1 As shown, the method includes the following steps:

[0032] Step S101: Obtain N modal data from the blockchain network, where N is an integer greater than 1.

[0033] Optionally, modal data refers to data existing in different formats or types, such as text, images, audio, and video. N modal data represent two or more unstructured data types contained in the blockchain.

[0034] Optionally, the system first collects data from various nodes of the blockchain. The data collected by each node may come from different sensors, log files, image libraries, etc., and contains various types of unstructured data.

[0035] Step S102: Semantic segmentation is performed on the N types of modal data, and the identification information of different semantic segments is recorded in the first-level index. The first-level index is used to represent the mapping relationship between keywords and the identification information of semantic segments.

[0036] Optionally, semantic sharding is a technique for dividing and storing datasets based on the semantic similarity of their content. The first-level index is a mapping table of keywords to semantic shard identifiers, used to quickly locate the shard containing data with specific keywords.

[0037] Optionally, the system uses natural language processing techniques and image recognition algorithms, such as lightweight convolutional neural network models, to analyze and understand the semantic features of each piece of data and classify it into corresponding semantic segments. Then, the system creates a first-level index that associates keywords with the identifier information of the corresponding segment, facilitating rapid searching.

[0038] Optionally, semantic sharding can reduce the number of block traversals during retrieval, accelerating the retrieval process. The existence of the first-level index allows retrieval requests to directly locate the shard containing potentially relevant data, avoiding unnecessary full-network scanning and thus improving retrieval efficiency.

[0039] Step S103: The data stored in each semantic segment is vectorized to generate corresponding vectorized metadata, and a second-level index is established based on the vectorized metadata. The second-level index is used to represent the mapping relationship between keywords and the index encoding of vectorized metadata.

[0040] Optionally, vectorization is the process of converting unstructured data into fixed-length numerical vectors, making it easier for computers to understand and compare. Vectorized metadata contains a simplified semantic representation of the data.

[0041] Optionally, for text data, the system uses a language model trained bidirectionally based on an attention mechanism to convert the text data into a vector representation; for image data, a lightweight convolutional neural network model is used to extract feature vectors. The generated vectorized metadata serves as the basis for the second-level index, and an inverted index technique is used to establish the relationship between keywords and vector metadata index codes.

[0042] Optionally, the second-level index is a keyword index based on vector metadata. The construction of the second-level index allows retrieval to be based on the inherent semantics of the data, improving the accuracy and flexibility of the search. Even if the query request contains complex semantic concepts, the system can return highly relevant results through vector similarity calculation.

[0043] Step S104: Receive a semantic retrieval request from an IoT device, wherein the semantic retrieval request includes a target query vector.

[0044] Optionally, semantic retrieval is a search technique based on text meaning rather than keyword matching, returning relevant results by understanding the query intent and content semantics. The target query vector is a vector representation of the semantic description in the request, facilitating comparison with stored vectorized metadata.

[0045] Optionally, before sending a retrieval request, IoT devices use vectorization technology to convert the query semantics into a target query vector. After receiving the request, the system first uses a first-level index to locate potentially relevant shards, and then uses a second-level index to perform vector matching based on the shards located by the first-level index to find the most relevant data.

[0046] Step S105: Based on the target query vector, the first-level index, and the second-level index, determine and return the retrieval results that match the semantic retrieval request.

[0047] Optionally, after locating a fragment that may contain the required data, the system compares the target query vector with the vectorized metadata within that fragment and calculates a similarity score between them. The data items with the highest scores are considered the best matching results and are returned to the IoT device that sent the retrieval request via the network, thereby achieving accurate semantic-level retrieval. This not only speeds up the retrieval process but also ensures the high relevance of the returned results, improving the quality and efficiency of data retrieval.

[0048] In one optional embodiment, semantic segmentation of N modal data includes: extracting data features and associated location information for each modal data; determining the semantic similarity between every two modal data in the N modal data based on the data features and location information of each modal data; and clustering the N modal data into different semantic segments based on the semantic similarity between every two modal data.

[0049] Optionally, specialized preprocessing and feature extraction algorithms are employed for data of different modalities. For example, for text data, the system uses natural language processing techniques, such as word embedding or word frequency-inverse document frequency methods, to extract semantic features; for image data, computer vision techniques, such as feature point detection, color histograms, or feature layer outputs of deep convolutional neural networks, are used to describe the data.

[0050] Optionally, the location information of IoT devices (such as location coordinates or network location identifiers) is acquired through built-in sensors or network interfaces and combined with data features to ensure that each data element has its own unique semantic feature description and location context, enabling accurate location and comparison of data in the semantic space.

[0051] Optionally, semantic similarity measures the degree of similarity in semantic content between different data elements, which can be evaluated by calculating the distance between data feature vectors (such as Euclidean distance, cosine similarity, etc.). The system combines the vectorized features of each data type with location information and uses semantic similarity algorithms, such as word vector-based similarity calculation, image feature vector comparison methods, or hybrid models that combine location distance factors, to determine the semantic similarity score between two sets of data from different modalities. By quantifying the semantic similarity between different modalities, the system can begin to build a preliminary framework for semantic segmentation, providing a basis for the next step of clustering, thereby optimizing the distributed storage and retrieval performance of the data.

[0052] Optionally, clustering is an unsupervised learning method used to group similar data elements into the same group or partition. The system utilizes a semantic similarity matrix and applies a clustering algorithm to cluster all data. The goal of clustering is to maximize the similarity of data within the same partition while minimizing the similarity of data between different partitions. Ultimately, data from different modalities will be assigned to the most suitable semantic partitions based on a comprehensive consideration of their semantic features and location information.

[0053] Optionally, through clustering, the system can effectively organize and manage large-scale multimodal data, ensuring that each semantic segment stores information closely related to a certain topic or concept. This allows for quick location of the target data segment during retrieval, reducing unnecessary search scope and improving retrieval speed and accuracy.

[0054] In one optional embodiment, the data stored in each semantic segment is vectorized to generate corresponding vectorized metadata, including: detecting the data type of the modal data stored in the i-th semantic segment, wherein the i-th semantic segment is any semantic segment; if the modal data stored in the i-th semantic segment is detected to be text data, then the text data is vectorized using a pre-trained text vectorization model to generate text vectorized metadata corresponding to the text data; if the modal data stored in the i-th semantic segment is detected to be image data, then the image data is vectorized using a pre-trained convolutional neural network to generate image vectorized metadata corresponding to the image data.

[0055] Optionally, before processing the data, the system first needs to identify the modality of the data stored in the i-th semantic segment. This can generally be done by examining the data's metadata or data structure, such as file extensions (e.g., .jpg or .txt) or header identifiers. Identifying the data's modality and selecting the correct vectorization processing model helps subsequent data processing steps to adopt the most effective processing strategies for different types of data.

[0056] Optionally, the text vectorization model is a model trained using deep learning techniques, such as a language model or word vector model trained bidirectionally based on an attention mechanism. This model can convert semantic information in text into numerical vectors. Text vectorization metadata is a simplified representation of the vectorized text data, retaining the main semantic features while occupying less storage space.

[0057] Optionally, when the system determines that the data is text, it calls a pre-trained text vectorization model (e.g., a miniaturized language model trained bidirectionally based on an attention mechanism) to perform deep learning processing on the text data, extract its core semantic features and convert them into fixed-length numerical vectors, thereby generating text vectorized metadata.

[0058] Optionally, when the data is identified as an image, the system uses a pre-trained lightweight convolutional neural network model to process the image. Through the forward propagation of the neural network, key feature points of the image are extracted and converted into vectors. This vector is the image vectorized metadata. The generation of image vectorized metadata allows the retrieval system to understand the semantic content of the image, rather than just pixel values.

[0059] Alternatively, a convolutional neural network (CNN) is a deep learning model specifically designed for processing image input. It consists of convolutional layers, pooling layers, and fully connected layers, and can automatically identify and extract features from images. Image vectorized metadata is a vectorized representation of image features, which also retains the main semantic information of the image, but in a more concise form.

[0060] In an optional embodiment, the data processing method based on the blockchain network further includes: performing dimensionality compression and filtering on the generated text vectorized metadata and image vectorized metadata, wherein dimensionality compression is used to reduce the data dimensionality of the text vectorized metadata and image vectorized metadata, and filtering is used to filter out metadata that appears repeatedly in the text vectorized metadata and image vectorized metadata.

[0061] Optionally, since text vectorized metadata and image vectorized metadata generally have high dimensionality, dimensionality compression is required to convert high-dimensional data into low-dimensional data in order to reduce storage space requirements and computational complexity.

[0062] Optionally, the system employs dimensionality reduction techniques, such as principal component analysis, t-distributed neighborhood embedding, or autoencoders, to compress the dimensions of text and image vectorized metadata. For example, principal component analysis can remove redundant features from metadata, retaining only the most important principal components. This significantly reduces the dimensionality of the data while preserving its main semantic information, thereby improving retrieval speed.

[0063] Optionally, after dimensionality compression, the system further utilizes data structures such as Bloom filters to filter duplicates in text and image vectorized metadata. A Bloom filter is a space-efficient probabilistic data structure that can quickly determine whether an element is likely to exist in a set, thus effectively removing duplicate metadata entries. By removing duplicate vectorized metadata, it ensures that each data element is represented only once in the index, reducing unnecessary waste of storage and computational resources.

[0064] In one optional embodiment, determining the retrieval results matching the semantic retrieval request based on the target query vector, the first-level index, and the second-level index includes: querying the first-level index based on the target query vector to determine one or more target semantic shards; generating a cross-shard query request for the target semantic shard based on the target query vector and the target semantic shard; broadcasting the cross-shard query request to a target node, wherein the target node is a node in the blockchain network corresponding to the target semantic shard; and determining the retrieval results matching the target query vector based on the query response returned by the target node based on the second-level index.

[0065] Optionally, IoT devices or retrieval systems compare the target query vector with the first-level index, using a vector space model or similarity algorithm (such as cosine similarity) to find the identifier information of the semantic segment that best matches the query vector. Locating the target semantic segment through the first-level index can narrow the scope of the query and reduce unnecessary searches across all segments, thereby improving query efficiency and speed.

[0066] Optionally, the system constructs a query request based on the determined target semantic shard, including the target query vector and other necessary query parameters, such as the query range and data type. Generating a cross-shard query request is to request more detailed retrieval results from specific shard nodes, enabling the query to more accurately locate the shard containing relevant data and reducing queries to irrelevant shards.

[0067] Optionally, cross-shard query requests are broadcast to all nodes related to the target semantic shard via the blockchain network's broadcast mechanism. Upon receiving the request, the relevant nodes process it according to their internally stored second-level index and return retrieval results that match the query vector.

[0068] Optionally, after receiving a cross-shard query request, the target node uses the vectorized metadata in the second-level index to compare it with the target query vector and calculate a similarity score. The system will then select the results with the highest scores from all the query responses returned by the target nodes as the final retrieval results.

[0069] In one optional embodiment, determining the retrieval result matching the target query vector based on the query response returned by the target node based on the second-level index includes: receiving the target index code returned by the target node based on the second-level index, wherein the target index code is an index code related to the cross-shard query request matched from the second-level index; using the target index code as the query response and obtaining candidate vectorized metadata corresponding to the query response; detecting the semantic relevance between the target query vector and the candidate vectorized metadata; if the semantic relevance is greater than a preset threshold, then using the modal data corresponding to the candidate vectorized metadata as the retrieval result matching the target query vector.

[0070] Optionally, after the target node receives a cross-shard query request, it can utilize its local second-level index—a list of index codes from keywords to vector metadata—to find metadata matching the target query vector. This process involves calculating a similarity score (such as cosine similarity) between the query vector and the vector metadata in the index. The system selects the index codes with the highest scores and returns them as part of the query response to the receiving end of the requesting device or system via the blockchain network. Upon receiving the target index code, the receiving end can retrieve the corresponding vectorized metadata in the corresponding target semantic shard based on the target index code.

[0071] Optionally, the system compares the target query vector with each candidate vectorized metadata record, using a semantic similarity algorithm to calculate a relevance score between them. Semantic relevance refers to the degree of similarity in semantic features between the target query vector and the candidate vectorized metadata. The detection process may rely on machine learning models or mathematical algorithms (such as cosine similarity, Euclidean distance, etc.) to quantify the semantic proximity between the two. By quantifying semantic relevance, the system can filter out the data that best matches the query requirements from numerous candidates, thereby improving the accuracy of the retrieval results.

[0072] Optionally, the system sets a reasonable semantic relevance threshold as a standard for determining whether data should be included in the search results. When the semantic relevance score of candidate vectorized metadata is higher than this threshold, the system recovers the associated modal data from the blockchain network or local storage, which constitutes the search results. By setting thresholds, the system filters out irrelevant or weakly relevant results, helping to return the most semantically relevant data set to users or devices, thus improving search efficiency and user experience.

[0073] In an optional embodiment, the data processing method based on the blockchain network further includes: associating the cross-shard query request with the returned search results and storing them in the data cache area of ​​the blockchain network; setting a cache duration for the cached items in the data cache area; and within the cache duration, if a semantic search request with a similarity greater than a preset similarity to the target query vector is received again, the search results are returned directly from the data cache area.

[0074] Optionally, the data cache area is a specific part of the blockchain network used to temporarily store recent cross-shard queries and their response results for subsequent fast retrieval.

[0075] Optionally, a query-result mapping table can be established, which associates cross-shard query requests with search results for efficient retrieval and reuse of previous results. If a cross-shard query request is processed and returns search results, the results, along with their corresponding query request parameters, will be stored in a data cache area. This storage could be a key-value database, where the key is a summary or encoding of the query request, and the value is metadata or a reference to the actual data in the search results.

[0076] Optionally, the cache duration is the time each cached item lives in the data cache area. After this duration, the cached item will be automatically deleted or updated to maintain the timeliness and accuracy of the cache. The system sets a reasonable cache duration based on the data update frequency, the storage limitations of the cache area, and the timeliness requirements of the data. For example, if the data is updated frequently, the cache duration may be set to a shorter time to avoid providing outdated information; conversely, if the data is relatively stable, the cache duration can be set to a longer time.

[0077] Optionally, a preset similarity score is used to determine whether a new query request is sufficiently similar to a query in the cache, so as to determine whether previous search results can be reused. When the system receives a new semantic search request, it first calculates the similarity between this request and the query request stored in the cache area. If the similarity is greater than a preset threshold, the system will directly return the previously stored search results from the cache without re-executing the cross-shard query process. By reusing search results in the cache, the system can reduce redundant calculations and network communication, especially when dealing with frequent similar queries, thereby improving the system's response speed and resource utilization efficiency.

[0078] In an optional embodiment, the data processing method based on the blockchain network further includes: monitoring the semantic distribution change information of data access requests in the blockchain network; dynamically adjusting the composition and topology of semantic shards according to the semantic distribution change information; and synchronously updating the adjusted semantic shard information to the first-level index through the blockchain consensus mechanism.

[0079] Optionally, the semantic distribution change information of data access requests refers to the changes in the semantic patterns and frequencies of data queries on the network over time. This can include query volume, query trends, and migration of data access hotspots for different semantic topics. The system continuously analyzes and records the semantic features of all data access requests, for example, by parsing query vectors to identify query topics and keywords. Then, these features are periodically summarized to form a statistical report on semantic distribution.

[0080] Optionally, dynamic adjustment means that the semantic sharding and network structure are not static, but are updated periodically based on changes in the semantic distribution of data access requests. Based on the monitored changes in semantic distribution, the system reassesses the composition of each semantic shard and the necessity of network connections. For example, if a surge in query demand for a specific topic is detected, the system may add or expand shards related to that topic. Simultaneously, to optimize data access efficiency, the system may also adjust the network structure between shards, such as increasing connections between shards with high data access activity and reducing direct queries to less popular shards, thereby better matching the semantic needs of data access, optimizing data storage and retrieval efficiency, and reducing unnecessary network communication and computational resource consumption.

[0081] Optionally, a blockchain consensus mechanism is an algorithm used in a blockchain network to ensure data consistency among all nodes, such as Proof-of-Work, Proof-of-Stake, or Byzantine Fault Tolerance. When the composition or topology of semantic shards is adjusted, the system encodes the changes and broadcasts them to all nodes through the blockchain consensus mechanism. The consensus mechanism ensures that all nodes receive the same updated information after verification, thereby maintaining the consistency and accuracy of the first-level index.

[0082] In one alternative embodiment, when building the second-level index, the keywords are disambiguated using a knowledge graph to determine the mapping relationship of the keywords in the second-level index.

[0083] Alternatively, a knowledge graph is a structured data representation that expresses the relationships between things and concepts in the world through entity nodes and edge relationships. It is often used to enhance the machine's understanding and reasoning abilities.

[0084] Optionally, before building the second-level index, a deep understanding of the keywords is required, especially addressing the issue of keyword ambiguity, or "disambiguation." The system will consult the knowledge graph to analyze the historical usage scenarios, contextual information, and relationships with other keywords for each keyword to determine its specific meaning. For example, for the keyword "AAA," the knowledge graph can help distinguish whether it is an item name (e.g., fruit, vegetable), a company name, a software name, or other possible meanings, thus mapping the keyword to the correct vectorized metadata.

[0085] Optionally, ambiguity resolution can ensure the accuracy and reliability of the second-level index, preventing retrieval errors caused by keyword ambiguity. By combining with a knowledge graph, the system can more accurately understand the true meaning of keywords, thereby improving retrieval precision.

[0086] Optionally, after ambiguity resolution, the system can determine the correct mapping relationship of each keyword in the second-level index, that is, the association between the keyword and specific vectorized metadata. The relevant mapping relationships can be encoded and added to the second-level index, forming an index encoding list that can quickly locate specific instances of the keyword. In this way, even when faced with complex multimodal data, the required information can be found quickly and accurately through keywords.

[0087] In one optional embodiment, the N modal data are data collected by IoT devices, and the semantic retrieval request is initiated by an IoT device whose resource idle rate is less than a preset idle rate.

[0088] Optionally, IoT devices are intelligent devices that establish connections between the physical and digital worlds, such as sensors, smart cameras, and smartwatches, and can collect and upload data in various scenarios. IoT devices continuously or periodically collect N modalities of data from their surroundings or specific objects through their built-in sensors or external interfaces. After preliminary processing, such as noise reduction and format conversion, the data is uploaded to a blockchain network and stored in corresponding semantic shards.

[0089] Optionally, the resource idle rate refers to the proportion of computing resources currently unused by IoT devices, reflecting the device's load status. The preset idle rate is a threshold set by the system to determine whether IoT devices are under high load, thereby deciding whether to initiate a lightweight semantic retrieval request.

[0090] Optionally, IoT devices continuously monitor their resource idle rate when performing tasks or processing data. When a device detects that its resource idle rate is lower than a preset threshold, the system determines that it may not be able to process data requests in a timely or efficient manner, and initiates a semantic retrieval request. It then utilizes the lightweight semantic retrieval mechanism in the blockchain network to quickly locate and obtain the required data.

[0091] Figure 2 This diagram illustrates the structure of a data processing method based on a blockchain network. First, the system constructs a two-level index data structure: the first level is a semantic sharding routing table, and the second level is an inverted index within each shard. The inverted index transforms "finding a document" into "finding a set of documents associated with keywords" through reverse mapping. Mapping document content to the correspondence between keywords and documents enables rapid retrieval of massive amounts of data. The following is a detailed description of the system's three main paths:

[0092] Direct path: The retrieval request directly accesses the first-level semantic sharding routing table through the keyword, and quickly obtains the storage sharding identification information related to the keyword.

[0093] Cache optimization path: If the search request involves frequently accessed keywords, the system will prioritize searching through a lightweight caching mechanism. When the similarity between the requested keyword and the keyword in the cache exceeds a preset threshold, the system will directly return the result from the cache, reducing the depth query of the inverted index within the shard; otherwise, it will continue to perform a deep query of the inverted index within the shard to obtain the vector metadata related to the keyword.

[0094] Propagation Suppression Path: For requests requiring cross-shard retrieval, the system employs a propagation suppression algorithm to optimize the query process. The algorithm predicts the set of shards that may contain the target data based on semantic analysis of keywords, and then uses the inverted index within each shard to match keywords to vector metadata within the predicted shard set.

[0095] Figure 3 This is a schematic diagram of an optional data processing apparatus based on a blockchain network according to an embodiment of this application. According to another aspect of an embodiment of this application, a data processing apparatus based on a blockchain network is also provided, including: an acquisition unit 301, a first processing unit 302, a second processing unit 303, a receiving unit 304, and a determining unit 305.

[0096] The system includes: an acquisition unit 301, used to acquire N types of modal data from the blockchain network, where N is an integer greater than 1; a first processing unit 302, used to perform semantic segmentation on the N types of modal data and record the identification information of different semantic segments into a first-level index, wherein the first-level index is used to represent the mapping relationship between keywords and the identification information of semantic segments; a second processing unit 303, used to perform vectorization processing on the data stored in each semantic segment, generate corresponding vectorized metadata, and establish a second-level index based on the vectorized metadata, wherein the second-level index is used to represent the mapping relationship between keywords and the index encoding of vectorized metadata; a receiving unit 304, used to receive semantic retrieval requests from IoT devices, wherein the semantic retrieval request includes a target query vector; and a determining unit 305, used to determine and return retrieval results matching the semantic retrieval request based on the target query vector, the first-level index, and the second-level index.

[0097] Optionally, the first processing unit 302 includes: a location extraction subunit, used to extract data features and associated location information of each modality data; a similarity determination subunit, used to determine the semantic similarity between every two modal data in N modal data based on the data features and location information of each modality data; and a clustering subunit, used to cluster the N modal data into different semantic segments based on the semantic similarity between every two modal data.

[0098] Optionally, the second processing unit 303 includes: a data type detection subunit, used to detect the data type of the modal data stored in the i-th semantic segment, wherein the i-th semantic segment is any semantic segment; a text data vectorization processing subunit, used to vectorize the text data using a pre-trained text vectorization model if the modal data stored in the i-th semantic segment is detected as text data, and generate text vectorized metadata corresponding to the text data; and an image data vectorization processing subunit, used to vectorize the image data using a pre-trained convolutional neural network if the modal data stored in the i-th semantic segment is detected as image data, and generate image vectorized metadata corresponding to the image data.

[0099] Optionally, the image data vectorization processing subunit includes: performing dimensionality compression and filtering processing on the generated text vectorized metadata and image vectorized metadata, wherein dimensionality compression is used to reduce the data dimensionality of the text vectorized metadata and image vectorized metadata, and filtering processing is used to filter out metadata that appears repeatedly in the text vectorized metadata and image vectorized metadata.

[0100] Optionally, the determining unit 305 includes: a first determining subunit, used to query a first-level index based on the target query vector to determine one or more target semantic shards; a query subunit, used to generate a cross-shard query request for the target semantic shard based on the target query vector and the target semantic shard; a broadcasting subunit, used to broadcast the cross-shard query request to a target node, wherein the target node is a node in the blockchain network corresponding to the target semantic shard; and a second determining subunit, used to determine the retrieval result matching the target query vector based on the query response returned by the target node based on the second-level index.

[0101] Optionally, the second determining subunit includes: an index encoding module, configured to receive a target index encoding returned by the target node based on the second-level index, wherein the target index encoding is an index encoding matched from the second-level index related to the cross-shard query request; a query response module, configured to use the target index encoding as a query response and obtain candidate vectorized metadata corresponding to the query response; a semantic relevance module, configured to detect the semantic relevance between the target query vector and the candidate vectorized metadata; and a matching module, configured to, if the semantic relevance is greater than a preset threshold, use the modal data corresponding to the candidate vectorized metadata as the retrieval result matched with the target query vector.

[0102] Optionally, the data processing method based on the blockchain network further includes: an association unit, used to associate cross-shard query requests with returned search results and store them in the data cache area of ​​the blockchain network; a caching module, used to set the cache duration for cached items in the data cache area; and a search result return unit, used to directly return search results from the data cache area if a semantic search request with a similarity greater than a preset similarity to the target query vector is received again within the cache duration.

[0103] Optionally, the data processing method based on the blockchain network further includes: a change information detection unit, used to monitor the semantic distribution change information of data access requests in the blockchain network; a dynamic adjustment unit, used to dynamically adjust the composition and topology of semantic shards according to the semantic distribution change information; and an update unit, used to synchronously update the adjusted semantic shard information to the first-level index through the blockchain consensus mechanism.

[0104] Optionally, the data processing method based on the blockchain network also includes: when building the second-level index, combining knowledge graphs to resolve ambiguities of keywords in order to determine the mapping relationship of keywords in the second-level index.

[0105] Optionally, the data processing method based on the blockchain network also includes: N modal data are data collected by IoT devices, and semantic retrieval requests are initiated by IoT devices with a resource idle rate less than a preset idle rate.

[0106] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, which stores a computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located performs the above-described data processing method based on a blockchain network.

[0107] According to another aspect of the embodiments of this application, an electronic device is also provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors cause the one or more processors to perform the above-described data processing method based on a blockchain network.

[0108] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program or instructions, which, when executed by a processor, implement the above-described data processing method based on a blockchain network.

[0109] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0110] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0111] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0112] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0113] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0114] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0115] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A data processing method based on a blockchain network, characterized in that, The method comprises: acquiring N modal data in a blockchain network, N being an integer greater than 1; performing semantic slicing on the N modal data, and recording identification information of different semantic slices to a first index, wherein the first index is used to represent a mapping relationship between a keyword and the identification information of the semantic slices; performing vectorization processing on data stored in each semantic slice to generate corresponding vectorized metadata, and establishing a second index based on the vectorized metadata, wherein the second index is used to represent a mapping relationship between a keyword and an index code of the vectorized metadata; receiving a semantic retrieval request from an Internet of Things device, wherein the semantic retrieval request comprises a target query vector; determining and returning a retrieval result matched with the semantic retrieval request according to the target query vector, the first index and the second index. 2.The blockchain network based data processing method of claim 1, wherein, The semantic slicing on the N modal data comprises: extracting data features and associated location information of each modal data; determining semantic similarity between each two modal data in the N modal data according to the data features and the location information of each modal data; clustering the N modal data to different semantic slices according to the semantic similarity between each two modal data. 3.The blockchain network based data processing method of claim 1, wherein, The vectorization processing on data stored in each semantic slice to generate corresponding vectorized metadata comprises: detecting a data type of modal data stored in an i-th semantic slice, wherein the i-th semantic slice is any semantic slice; if it is detected that the modal data stored in the i-th semantic slice is text data, performing vectorization processing on the text data by using a pre-trained text vectorization model to generate text vectorized metadata corresponding to the text data; if it is detected that the modal data stored in the i-th semantic slice is image data, performing vectorization processing on the image data by using a pre-trained convolutional neural network to generate image vectorized metadata corresponding to the image data. 4.The method of claim 3, wherein, The method further comprises: performing dimension compression and filtering processing on the generated text vectorized metadata and image vectorized metadata, wherein the dimension compression is used to reduce the data dimension of the text vectorized metadata and the image vectorized metadata, and the filtering processing is used to filter metadata that repeatedly appears in the text vectorized metadata and the image vectorized metadata. 5.The blockchain network based data processing method according to claim 1, characterized in that, The determination of the retrieval result matched with the semantic retrieval request according to the target query vector, the first index and the second index comprises: querying the first index based on the target query vector to determine one or more target semantic slices; generating a cross-slice query request for the target semantic slices according to the target query vector and the target semantic slices; broadcasting the cross-slice query request to a target node, wherein the target node is a node in the blockchain network corresponding to the target semantic slices; According to a query response returned by the target node based on the second-level index, a search result matched with the target query vector is determined. 6.The blockchain network based data processing method of claim 5, wherein, According to a query response returned by the target node based on the second-level index, a search result matched with the target query vector is determined, including: Receiving a target index code returned by the target node based on the second-level index, wherein the target index code is an index code matched from the second-level index and related to the cross-shard query request; Taking the target index code as the query response, and obtaining candidate vectorized metadata corresponding to the query response; Detecting semantic relevance between the target query vector and the candidate vectorized metadata; If the semantic relevance is greater than a preset threshold, modal data corresponding to the candidate vectorized metadata is taken as a search result matched with the target query vector. 7.The blockchain network based data processing method of claim 6, wherein, The data processing method based on the blockchain network further includes: Associating the cross-shard query request with the returned search result, and storing the cross-shard query request and the returned search result in a data cache area of the blockchain network; Setting a cache time length for a cache item in the data cache area; Within the cache time length, if a semantic search request with a similarity greater than a preset similarity to the target query vector is received again, the search result is directly returned from the data cache area. 8.The blockchain network based data processing method of claim 1, wherein, The data processing method based on the blockchain network further includes: Monitoring semantic distribution change information of data access requests in the blockchain network; According to the semantic distribution change information, dynamically adjusting the constitution and topology of the semantic shards; Through a blockchain consensus mechanism, synchronously updating the adjusted semantic shard information to the first-level index. 9.The method of claim 1, wherein, When the second-level index is established, the key words are disambiguated in combination with a knowledge graph to determine a mapping relationship of the key words in the second-level index. 10.The method of claim 1, wherein, The N kinds of modal data are data collected by the Internet of Things devices, and the semantic search request is initiated by an Internet of Things device with a resource idle rate less than a preset idle rate. 11.A data processing apparatus based on a blockchain network, characterized in that, Including: An obtaining unit is configured to obtain N kinds of modal data in a blockchain network, N being an integer greater than 1; A first processing unit is configured to perform semantic sharding on the N kinds of modal data, and record identification information of different semantic shards to a first-level index, wherein the first-level index is used to represent a mapping relationship between a key word and the identification information of the semantic shards; A second processing unit is configured to perform vectorization processing on data stored in each semantic shard, generate corresponding vectorized metadata, and establish a second-level index based on the vectorized metadata, wherein the second-level index is used to represent a mapping relationship between a key word and an index code of the vectorized metadata; A receiving unit is configured to receive a semantic search request from an Internet of Things device, wherein the semantic search request includes a target query vector; A determining unit is configured to determine and return a search result matched with the semantic search request according to the target query vector, the first-level index, and the second-level index.

12. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, wherein the computer program, when running, causes a device where the computer readable storage medium is located to perform the data processing method based on the blockchain network in any one of claims 1 to 10.

13. An electronic device, comprising: An apparatus comprising one or more processors and memory storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the data processing method based on the blockchain network in any one of claims 1 to 10.

14. A computer program product, characterised in that, A computer program or instructions, which, when executed by a processor, implement the data processing method based on the blockchain network in any one of claims 1 to 10.