Blockchain-based Smart IoT and Metaverse Data Interaction and Fusion Method and System
By using blockchain technology and distributed timing databases in the intelligent IoT data interaction with metacosmic data, encapsulating and mapping the physical and virtual world data, the problems of low data interaction efficiency and limited scalability are solved, and efficient and secure data interaction and convergence are achieved.
Patent Information
- Application Number
- CN202510488205.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2045-04-18
AI Technical Summary
The prior art has problems in the interaction between intelligent IoT and metacosmic data, such as low data security, poor real-time and limited scalability, and lacks effective data mapping and fusion mechanisms, which affects the efficiency of data interaction.
By obtaining the physical world data of smart IoT devices and the virtual world data of metacosmic virtual scenes, they are encapsulated into blockchain transaction information, and corresponding relationships are established based on preset multi-dimensional mapping rules, a distributed timing database is used for classification storage, and a two-way data index is established to achieve efficient query.
It realizes the seamless integration of the physical world and the virtual world data, improves data storage efficiency and query speed, provides a unified data interaction interface, and meets the special needs of intelligent IoT and meta-universe scenarios.
Smart Images

Figure CN120011371B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technology of intelligent Internet of Things, and particularly to a method and system for the interaction and integration of intelligent Internet of Things and metaverse data based on blockchain. Background Art
[0002] With the rapid development of Internet of Things and metaverse technologies, the data interaction between intelligent Internet of Things devices and virtual reality scenarios has become increasingly important. Traditional data interaction methods mainly rely on centralized data storage and processing systems, which have problems such as low data security, poor real-time performance, and limited scalability. Blockchain technology provides a new idea for solving these problems due to its characteristics of decentralization, immutability, and traceability.
[0003] However, the current methods for the interaction and integration of intelligent Internet of Things and metaverse data based on blockchain still face some challenges. First, the formats and structures of physical world data and virtual world data are quite different, lacking an effective data mapping and integration mechanism, resulting in low data interaction efficiency. Second, the existing blockchain storage solutions are difficult to meet the requirements of efficient storage and rapid retrieval of massive Internet of Things and metaverse data, affecting the real-time performance of data interaction. Finally, traditional data access methods are difficult to take into account the data characteristics of both the physical world and the virtual world at the same time, and cannot provide users with a unified and convenient data interaction experience.
[0004] To solve these problems, there is an urgent need for a new method that can effectively integrate physical world data and virtual world data, support efficient storage and rapid retrieval, and provide a unified data interaction interface. Such a method should be able to make full use of the advantages of blockchain technology to achieve secure and trustworthy data interaction, while meeting the special requirements in the scenarios of intelligent Internet of Things and metaverse. Summary of the Invention
[0005] Embodiments of the present invention provide a method and system for the interaction and integration of intelligent Internet of Things and metaverse data based on blockchain, which can solve the problems in the prior art.
[0006] In the first aspect of the embodiments of the present invention, a method for the interaction and integration of intelligent Internet of Things and metaverse data based on blockchain is provided, including:
[0007] Obtain physical world data in intelligent Internet of Things devices; at the same time, obtain virtual world data in the metaverse virtual scenario;
[0008] Encapsulate the physical world data and the virtual world data into blockchain transaction information respectively, and establish a corresponding relationship between the physical world data and the virtual world data based on a preset data mapping rule;
[0009] Classify and store the blockchain transaction information through a distributed time-series database, where the distributed time-series database includes a physical data layer and a virtual data layer, and a two-way data index is established between the physical data layer and the virtual data layer;
[0010] Receive a data interaction request initiated by a user, where the data interaction request includes identification information of physical world data or virtual world data to be accessed; process the data interaction request, and obtain corresponding blockchain transaction information according to the two-way data index;
[0011] Parse the obtained blockchain transaction information into physical world data or virtual world data, and return the parsed data to the user.
[0012] Encapsulate the physical world data and the virtual world data into blockchain transaction information respectively, and establish a correspondence between the physical world data and the virtual world data based on a preset data mapping rule, including:
[0013] Establish a correspondence between the physical world data and the virtual world data based on a preset multi-dimensional mapping rule, where the multi-dimensional mapping rule includes a space mapping rule, a state mapping rule, and an environmental data mapping rule;
[0014] Perform compression encoding on the multi-dimensional mapping rule and perform cascade operations in combination with timestamp information and version identification information to obtain verification data, store the blockchain transaction data that passes the verification according to the storage hierarchy structure for blockchain storage, and establish an index structure for the blockchain transaction data based on a multi-level index mechanism;
[0015] Perform real-time mapping and synchronous update on the physical world data and the virtual world data based on the index structure, and trigger an exception handling mechanism when an abnormal mapping is detected, where the exception handling mechanism includes re-verification and adjustment of the mapping rule.
[0016] Perform compression encoding on the multi-dimensional mapping rule and perform cascade operations in combination with timestamp information and version identification information to obtain verification data, store the blockchain transaction data that passes the verification according to the storage hierarchy structure for blockchain storage, and establish an index structure for the blockchain transaction data based on a multi-level index mechanism, including:
[0017] Perform compression encoding on the multi-dimensional mapping rule to obtain compressed rule data, perform cascade operations on the compressed rule data with timestamp information and version identification information, and then perform hash calculation to obtain verification data;
[0018] Perform verification based on the verification data. After the verification passes, store the blockchain transaction data in the blockchain according to the storage hierarchy, where the storage hierarchy includes block header information, transaction list information, and index table information. The block header information is used to record basic blockchain information, the transaction list information is used to store transaction data information, and the index table information is used to establish a data retrieval path;
[0019] Establish an index structure for the blockchain transaction data based on a multi-level index mechanism. The multi-level index mechanism includes a primary key index, a version tree index, and a time index. The primary key index is used to uniquely identify transaction data, the version tree index is used to record the evolution relationship of rule versions, and the time index is used to achieve sequential retrieval.
[0020] Establish a two-way data index between the physical data layer and the virtual data layer. Obtaining the corresponding blockchain transaction information according to the two-way data index includes:
[0021] Construct a physical data index structure based on device identification information, data type information, time range information, and physical block pointer information. The physical block pointer information is used to point to the physical data stored in the blockchain;
[0022] Construct a virtual data index structure based on virtual object identification information, scenario type information, status information, and virtual block pointer information. The virtual block pointer information is used to point to the virtual data stored in the blockchain;
[0023] Establish a two-way data index based on the physical data index structure and the virtual data index structure. The two-way data index includes a forward mapping relationship from the physical index key to the virtual index set and a reverse mapping relationship from the virtual index key to the physical index set;
[0024] Obtain the corresponding blockchain transaction information according to the two-way data index.
[0025] The method further includes performing adaptive cache optimization on the blockchain transaction information:
[0026] Obtain the data size information of the blockchain transaction information and the system cache capacity information. Calculate a space occupancy benchmark value based on the ratio of the data size information to the system cache capacity information, and use the product of the space occupancy benchmark value and the data priority factor as the space occupancy evaluation value. The data priority factor is used to represent the importance of the target data;
[0027] Obtain the update time information of the blockchain transaction information and the current system time information, calculate the time difference between the update time information and the current system time information, and substitute the time difference and the timeliness decay coefficient into the exponential decay function to calculate the timeliness evaluation value, where the timeliness decay coefficient is used to control the rate of timeliness decay;
[0028] Multiply the space occupancy evaluation value and the timeliness evaluation value by the corresponding weight coefficients respectively and sum them to obtain the cache priority score, where the weight coefficients are used to balance the influence degrees of different evaluation indicators;
[0029] Adjust the cache policy for the blockchain transaction information based on the cache priority score. When the cache priority score is higher than the preset cache threshold, load the blockchain transaction information into the cache. When the cache priority score is lower than the preset cache threshold, remove the blockchain transaction information from the cache.
[0030] Parsing the obtained blockchain transaction information into physical world data or virtual world data and returning the parsed data to the user includes:
[0031] Obtain the data identification field in the blockchain transaction information, and judge whether the blockchain transaction information belongs to physical world data or virtual world data according to the data identification field;
[0032] When the blockchain transaction information belongs to physical world data, extract the device identification information, sensing data information and timestamp information in the blockchain transaction information according to the preset physical data parsing template to generate physical world parsing data;
[0033] When the blockchain transaction information belongs to virtual world data, extract the virtual object identification information, scene state information and interaction behavior information in the blockchain transaction information according to the preset virtual data parsing template to generate virtual world parsing data;
[0034] Return the physical world parsing data or the virtual world parsing data to the user.
[0035] In the second aspect of the embodiments of the present invention, a blockchain-based intelligent Internet of Things and metaverse data interaction and fusion system is provided, including:
[0036] The first unit is used to obtain the physical world data in the intelligent Internet of Things device; and obtain the virtual world data in the metaverse virtual scene at the same time;
[0037] The second unit is used to encapsulate the physical world data and the virtual world data into blockchain transaction information respectively, and establish a corresponding relationship between the physical world data and the virtual world data based on the preset data mapping rules;
[0038] A third unit for classifying and storing the blockchain transaction information through a distributed time-series database, wherein the distributed time-series database includes a physical data layer and a virtual data layer, and a bidirectional data index is established between the physical data layer and the virtual data layer;
[0039] A fourth unit for receiving a data interaction request initiated by a user, where the data interaction request includes identification information of physical world data or virtual world data to be accessed; processing the data interaction request, and obtaining corresponding blockchain transaction information according to the bidirectional data index;
[0040] A fifth unit for parsing the obtained blockchain transaction information into physical world data or virtual world data, and returning the parsed data to the user.
[0041] In a third aspect of the embodiments of the present invention, an electronic device is provided, including:
[0042] A processor;
[0043] A memory for storing instructions executable by the processor;
[0044] Wherein, the processor is configured to call the instructions stored in the memory to execute the method described above.
[0045] In a fourth aspect of the embodiments of the present invention, a computer-readable storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method described above is implemented.
[0046] The beneficial effects of this application are as follows:
[0047] By encapsulating physical world data and virtual world data into blockchain transaction information and establishing a corresponding relationship, seamless integration of physical world and virtual world data is achieved, laying a foundation for in-depth interaction between intelligent IoT and the metaverse.
[0048] A distributed time-series database is used to classify and store blockchain transaction information, and a bidirectional data index is established, improving the data storage efficiency and query speed, which is conducive to the efficient management and rapid access of large-scale data.
[0049] Based on the user's data interaction request, relevant data in the physical world or virtual world can be flexibly parsed and returned, providing users with a convenient cross-domain data access experience, and promoting information circulation and value transfer between the physical world and the virtual world. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a schematic flowchart of a method for data interaction and integration between intelligent IoT and the metaverse based on blockchain in the embodiments of the present invention;
[0051] Figure 2 This is a schematic diagram for comparing the cache hit rates under different blockchain transaction data volumes in the embodiments of the present invention. Detailed implementation manners
[0052] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are only a part rather than all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0053] The technical solutions of the present invention will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0054] Figure 1 This is a schematic flowchart of a method for intelligent IoT and metaverse data interaction and fusion based on blockchain in the embodiments of the present invention. As Figure 1 shown, the method includes:
[0055] Obtain physical world data in intelligent IoT devices; meanwhile, obtain virtual world data in the metaverse virtual scene;
[0056] Encapsulate the physical world data and the virtual world data into blockchain transaction information respectively, and establish a corresponding relationship between the physical world data and the virtual world data based on a preset data mapping rule;
[0057] Classify and store the blockchain transaction information through a distributed time-series database. The distributed time-series database includes a physical data layer and a virtual data layer, and a bidirectional data index is established between the physical data layer and the virtual data layer;
[0058] Receive a data interaction request initiated by a user. The data interaction request includes identification information of physical world data or virtual world data to be accessed; process the data interaction request, and obtain corresponding blockchain transaction information according to the bidirectional data index;
[0059] Parse the obtained blockchain transaction information into physical world data or virtual world data, and return the parsed data to the user.
[0060] In an alternative embodiment, encapsulating the physical world data and the virtual world data into blockchain transaction information respectively, and establishing a correspondence between the physical world data and the virtual world data based on a preset data mapping rule includes:
[0061] Establishing a correspondence between the physical world data and the virtual world data based on a preset multi-dimensional mapping rule, where the multi-dimensional mapping rule includes a space mapping rule, a state mapping rule, and an environmental data mapping rule;
[0062] Performing compression encoding on the multi-dimensional mapping rule and performing cascade operations in combination with timestamp information and version identification information to obtain verification data, storing the blockchain transaction data that passes the verification in a blockchain according to a storage hierarchy structure, and establishing an index structure for the blockchain transaction data based on a multi-level index mechanism;
[0063] Performing real-time mapping and synchronous update on the physical world data and the virtual world data based on the index structure, and triggering an exception handling mechanism when abnormal mapping is detected, where the exception handling mechanism includes re-verifying and adjusting the mapping rule.
[0064] In the data encapsulation stage, the system encapsulates the physical world data and the virtual world data into blockchain transaction information respectively. The blockchain transaction information consists of three parts: transaction header information, data payload information, and digital signature information. The transaction header information includes version number information (such as v1.0.2), timestamp information (accurate to the millisecond level, such as 2023-10-15 13:45:28.352), and transaction type identification information (such as "physical data" is identified as "P", "virtual data" is identified as "V"). The data payload information includes data feature value information and data source information. For example, the data feature value collected by a certain temperature sensor is "28.5°C", and the data source is "sensor ID: TSN20231015A"; the position feature value of a certain virtual object is "coordinates (125.3, 78.9, 10.2)", and the data source is "virtual object ID: VO20231015B".
[0065] The digital signature information is generated by ECDSA (Elliptic Curve Digital Signature Algorithm). In specific implementation, the secp256k1 curve parameters are adopted. The signature process is as follows: First, perform SHA-256 hash operation on the transaction header information and the data payload information to obtain a 32-byte digest, and then use the private key to perform ECDSA signature on the digest to generate 65-byte signature data. In this way, the integrity of the transaction data and the non-deniability of the source are ensured.
[0066] Establish the correspondence between physical world data and virtual world data based on preset multi-dimensional mapping rules. The multi-dimensional mapping rules include spatial mapping rules, state mapping rules, and environmental data mapping rules.
[0067] The spatial mapping rules are used to implement the conversion from the physical coordinate system to the virtual coordinate system and the correction of coordinate offsets. In specific implementation, the physical coordinates adopt the GPS standard (WGS84), such as the location of an IoT device being "34.12345 degrees north latitude, 108.54321 degrees east longitude"; the virtual coordinates adopt the 3D Cartesian coordinate system, for example, "X: 350.25, Y: 120.75, Z: 15.50". The conversion process includes two steps: coordinate system conversion and scale factor scaling. First, convert the GPS coordinates to a local rectangular coordinate system, and then map the physical world distance to the virtual world distance according to a preset scale factor (such as 1:100). When it is detected that the coordinate offset error exceeds the preset threshold (such as 0.5 meters), the system automatically activates the correction mechanism to eliminate the offset error through multi-point sampling and weighted averaging method.
[0068] The state mapping rules are used to define the correspondence between the physical device state and the virtual object state. For example, the physical state of the IoT device "smart light" includes three parameters: "on / off", "brightness percentage", and "color temperature", and the corresponding virtual object states are "display state", "luminous intensity", and "light source color". The system realizes the accurate mapping between the two through a state conversion table. For example, the physical brightness "85%" is mapped to the virtual luminous intensity "0.85", and the physical color temperature "3200K" is mapped to the virtual light source color "RGB(255, 244, 229)". To ensure the mapping accuracy, the system has implemented an adaptive adjustment mechanism to automatically evaluate the mapping accuracy and make fine-tuning every 100 state changes.
[0069] The environmental data mapping rules are used to implement the conversion from physical environmental parameters to virtual environmental parameters. For example, the physical world temperature "28℃" is mapped to the heat effect parameter "0.65" in the virtual world, and the physical world humidity "75%" is mapped to the water vapor effect parameter "0.75" in the virtual world. The mapping adopts a piecewise linear interpolation algorithm to map the physical parameter range (such as temperature from -10℃ to 40℃) to the virtual parameter range (such as heat effect from 0 to 1.0). The system dynamically adjusts the visual effects, particle system parameters, and physical simulation parameters in the virtual world according to the real-time collected environmental data.
[0070] Compress and encode the multi - dimensional mapping rules, and perform cascading operations in combination with timestamp information and version identification information to obtain verification data. The compression encoding uses the Huffman encoding method, encoding common mapping rule parameters into shorter binary sequences, with a compression rate of over 65%. Taking the spatial mapping rules as an example, the original rule data is about 150KB, and after compression, it only occupies 52KB of storage space. The timestamp is represented by a 64 - bit long integer (millisecond precision), and the version identification is represented by a 16 - bit integer (for example, version "2.5.3" is encoded as "0x0253").
[0071] The cascading operation process is as follows: First, divide the compressed and encoded mapping rule data into 64 - byte data blocks, then perform exclusive - OR operations with the timestamp and version identification, and finally generate a verification value through the SHA - 256 algorithm. Each verification value is 32 bytes long and is used to verify the integrity and validity of the mapping rules. The blockchain transaction data that passes the verification is stored according to the storage hierarchy structure, adopting a four - layer storage structure: block layer, transaction layer, data layer, and index layer.
[0072] Establish an index structure for blockchain transaction data based on a multi - level index mechanism, including three types: time index, spatial index, and type index. The time index is implemented based on a B + tree, and the index key is the transaction timestamp; the spatial index is implemented based on an R - tree, and the index key is the coordinate information of the device or object; the type index is implemented based on a hash table, and the index key is the transaction type identification. The index structure supports composite queries, such as "querying all temperature sensor data in a specific area within a specific time range". The index storage adopts prefix compression technology, further saving about 25% of the storage space.
[0073] Based on the index structure, perform real - time mapping and synchronous updates on physical world data and virtual world data. The update cycle is divided into three levels according to the importance of the data: high priority (updated once every 50 milliseconds), medium priority (updated once every 200 milliseconds), and low priority (updated once every 1 second). For example, location data related to user interaction belongs to high priority, ambient light data belongs to medium priority, and background sound effect parameters belong to low priority.
[0074] When an abnormal mapping is detected, an exception handling mechanism will be triggered. The determination criteria for abnormal mapping include: coordinate offset exceeding a preset threshold (such as the mapping error between the physical position and the virtual position > 2 meters), status inconsistency (such as the physical device is on but the virtual object shows an off state), and excessive environmental parameter differences (such as the mapping deviation between the physical temperature and the virtual heat parameter > 20%). The exception handling mechanism includes re - verification and adjustment of the mapping rules, which are specifically divided into three steps: First, pause the affected mapping process, then use the backup rules for temporary replacement, and finally recalculate the optimal mapping parameters in the background and update the rule library. The system will record the abnormal situation and generate an analysis report to help the administrator optimize the mapping rule configuration.
[0075] Table 1: Comparison Data Table of the Data Synchronization Efficiency between the Physical World and the Virtual World in the Embodiment of the Present Invention
[0076]
[0077] As shown in Table 1, this is a performance comparison data of different data types under three technical solutions. The table contains a total of 6 data types: location coordinate data, status change data, environmental parameter data, batch interaction data, low-latency high-priority data, and large-scale user interaction data. The performance of three solutions, namely this technical solution (multi-dimensional mapping), one-way mapping method, and traditional data synchronization, is compared. From the specific data, this technical solution shows obvious advantages in the processing of various types of data. The average processing performance is 16.5, far superior to 53.5 of the one-way mapping method and 97.5 of the traditional data synchronization. Especially in the aspect of large-scale user interaction data, this technical solution only requires 32.8 of processing time, which is 682.6% higher than 256.7 of the traditional method. Other data types such as location coordinate data (12.3 vs 58.7), status change data (8.5 vs 45.2), environmental parameter data (15.7 vs 67.8), batch interaction data (24.6 vs 124.3), and low-latency high-priority data (5.2 vs 32.5) all show significant performance advantages, and the efficiency improvement rates reach 377.2%, 431.8%, 331.8%, 405.3%, and 525.0% respectively. Generally speaking, this technical solution has achieved a 3-6 times performance improvement in all tested data types, and the average efficiency improvement reaches 459.0%, demonstrating excellent technical advantages.
[0078] In an optional embodiment, the multi-dimensional mapping rule is compressed and encoded, and cascaded operations are performed in combination with timestamp information and version identification information to obtain verification data. The blockchain transaction data after passing the verification is stored in the blockchain according to the storage hierarchy. Establishing the index structure of the blockchain transaction data based on the multi-level index mechanism includes:
[0079] The multi-dimensional mapping rule is compressed and encoded to obtain compressed rule data, and the compressed rule data is cascaded with the timestamp information and the version identification information and then hash calculation is performed to obtain verification data;
[0080] Verification is performed according to the verification data. After passing the verification, the blockchain transaction data is stored in the blockchain according to the storage hierarchy. The storage hierarchy includes block header information, transaction list information, and index table information, where the block header information is used to record the basic information of the blockchain, the transaction list information is used to store transaction data information, and the index table information is used to establish a data retrieval path;
[0081] An index structure for the blockchain transaction data is established based on a multi-level index mechanism. The multi-level index mechanism includes a primary key index, a version tree index, and a time index. The primary key index is used to uniquely identify the transaction data, the version tree index is used to record the evolution relationship of the rule versions, and the time index is used to achieve sequential retrieval.
[0082] The multi-dimensional mapping rules are compressed and encoded to obtain compressed rule data. The multi-dimensional mapping rules contain a large number of coordinate transformation parameters, state correspondence relationships, and environmental parameter mapping information. Direct storage would occupy a large amount of space. Adaptive Huffman coding technology is used for compression. Short codes are assigned to frequently occurring parameters in the mapping rules, and long codes are assigned to less frequently occurring parameters. Taking the space mapping rules as an example, which contain data such as a coordinate system transformation matrix, a scaling factor, and an offset. The original data volume is approximately 168 KB. After compression and encoding, the obtained compressed rule data is only 42 KB, and the compression ratio reaches 75%. The state mapping rules and the environmental data mapping rules are also compressed using the same method, being compressed from 92 KB and 124 KB to 28 KB and 35 KB respectively.
[0083] During the compression process, first, the original rule data is scanned to count the occurrence frequencies of each parameter, generating a frequency table. For example, the unit matrix element "1.0000" in the coordinate transformation matrix has an occurrence frequency as high as 32%, and a 2-bit code "01" is assigned to it; while a special mapping parameter such as "rotation angle correction factor (0.1745)" has an occurrence frequency of only 0.1%, and a 12-bit code "011010101101" is assigned to it. An encoding table is constructed through a binary tree, and each parameter is replaced with the corresponding binary code according to the encoding table, finally generating a compressed binary stream of the rule. At the same time, the encoding table is recorded at the head of the compressed data for subsequent decompression use.
[0084] The compressed rule data is concatenated with the timestamp information and the version identification information and then a hash calculation is performed to obtain the verification data. The timestamp information is represented by a 64-bit long integer indicating the current millisecond-level time. For example, "1662345678432" represents 08:21:18.432 on September 5, 2022. The version identification information is represented by a 32-bit integer. The high 8 bits represent the major version number, the middle 12 bits represent the minor version number, and the low 12 bits represent the revision version number. For example, the version "2.5.11" is encoded as "0x02050B".
[0085] The cascaded operation adopts a block exclusive OR connection method, dividing the compressed rule data into blocks of 64 bytes, and performing an exclusive OR operation on each block with the timestamp and version identification information. For example, if the first block of the compressed rule data is "A5B7C2...", the last 8 bytes of the timestamp are "75678432", and the version identification is "02050B", then the exclusive OR result is "D7D2F9...". After processing all blocks, they are concatenated into a complete data stream. Finally, the SHA-256 hash algorithm is executed on this data stream to generate 32-byte verification data.
[0086] Verification is performed based on the verification data. After the verification passes, the blockchain transaction data is stored in the blockchain according to the storage hierarchy. During the verification process, the receiving end repeats the cascaded operation and hash calculation of the compressed rule data and compares it with the received verification data. If the comparison is consistent, the verification passes; otherwise, the transaction is rejected and a resend is requested.
[0087] The storage hierarchy includes block header information, transaction list information, and index table information. The block header information is used to record the basic information of the blockchain, including the block height (such as 425786), the hash value of the previous block (32 bytes), the timestamp (such as 1662345738562), the difficulty target (such as 0x1d00ffff), the nonce (such as 2158734), and the Merkle root (32 bytes). The transaction list information is used to store transaction data information, organized in a Merkle tree structure. Each transaction contains a transaction ID (32 bytes), a transaction type identifier (such as "IOTDATA"), transaction content (including device ID, data type, data value, etc.), and signature information (65 bytes).
[0088] An index structure for blockchain transaction data is established based on a multi-level index mechanism to improve data retrieval efficiency. The multi-level index mechanism includes a primary key index, a version tree index, and a time index. The primary key index is implemented using a hash table and is used to uniquely identify transaction data. The index key is the transaction ID, and the index value is the transaction storage location. For example, when querying the transaction "tx_a4b8c7...", it can be directly located at the 12th transaction in block 425786 through the primary key index, and the query complexity is O(1).
[0089] The version tree index is implemented using a B+ tree structure and is used to record the evolution relationship of rule versions. The index key is the version identification, and the index value is the list of transaction IDs corresponding to the rules of the corresponding version. The version tree maintains a parent-child relationship. For example, the parent version of version "2.5.11" is "2.5.10", and the root node is the initial version "1.0.0". When querying the mapping rules of a specific version, if version "2.5.11" does not exist, it will trace back along the version tree to find the nearest available version "2.5.10".
[0090] The time index is implemented using a skip list structure for time-series retrieval. The index key is the timestamp, and the index value is a list of transaction IDs corresponding to that time. The skip list has multiple levels. Level 0 contains all nodes, and the nodes in the upper levels serve as indexes to accelerate access.
[0091] In practical applications, a smart home scenario was tested, which included 100 Internet of Things devices and corresponding virtual objects. Each device generated 2 pieces of data per second. After compression encoding and storage optimization, the data volume in 24 hours was reduced from the original 7.2 GB to 1.8 GB, saving 75% of the storage space. The query efficiency test showed that the average query time for a single piece of data decreased from 135 ms in the traditional method to 12 ms, a 11-fold improvement. The performance of time range query decreased from 850 ms to 78 ms, an almost 11-fold improvement.
[0092] Compared with the existing technology, the technical innovation point of this application lies in the efficient compression encoding of multi-dimensional mapping rules and the design of a multi-level index structure. Existing blockchain storage technologies usually adopt a single index structure and do not specifically optimize the mapping rules, resulting in storage redundancy and low query efficiency. For example, traditional blockchain systems usually use sequential scanning or simple hash indexes, and querying data within a specific time range requires traversing a large number of blocks, with an average query latency exceeding 500 ms. In addition, in the existing technology, the mapping rules are usually stored in their original form, occupying a large amount of space and having low update efficiency.
[0093] Table 2: Comparison data table of multi-dimensional mapping rule compression and storage space optimization in the embodiments of the present invention
[0094]
[0095] Table 2 shows the performance comparison data of different data types under various compression schemes. The table includes seven data types, namely, spatial mapping rules (1000 pieces), status mapping rules (5000 pieces), environmental data mapping rules (2000 pieces), physical device status data (10000 pieces per day), virtual object data (20000 pieces per day), mapping relationship update data (5000 pieces per day), and data of the complete system (24 hours). By comparing the data performance in five cases: the original data size, the present technical solution (adaptive Huffman + multi-level index), standard compression (gzip), basic compression (RLE), and no compression, the results show that the present technical solution has significant space-saving advantages. Specifically, the spatial mapping rules are compressed from 168.5 to 42.3, with a saving rate of 74.9%; the status mapping rules are compressed from 92.4 to 28.2, with a saving rate of 69.5%; the environmental data mapping rules are compressed from 124.8 to 35.6, with a saving rate of 71.5%; the physical device status data are compressed from 256.3 to 58.4, with a saving rate of 77.2%; the virtual object data are compressed from 384.7 to 82.5, with a saving rate of 78.6%; the mapping relationship update data are compressed from 124.2 to 24.6, with a saving rate as high as 80.2%. In the data of the complete system running for 24 hours, it is compressed from 7250.6 to 1812.5, with a saving rate of 75.0%. Compared with other compression schemes, the present technical solution shows the best compression effect on all data types, with an average space saving of more than 75%, far better than the standard gzip compression and basic RLE compression schemes.
[0096] Starting from the characteristics of the mapping rules, this application designs an adaptive compression algorithm, significantly reducing the storage space; introducing cascade operations and verification mechanisms to ensure data integrity; adopting a multi-level index structure to optimize the query path and greatly improve the retrieval efficiency. These improvements enable the system to process large-scale physical and virtual world data mapping in real time, support high-concurrency data interaction requests, and provide a solid technical foundation for the deep integration of intelligent IoT and the metaverse. Through experimental verification, compared with the existing technology, the storage efficiency of this technical solution is increased by 75%, the query performance is increased by 11 times, and the overall system throughput is increased by 8.5 times, effectively supporting the real-time data mapping and interaction requirements of tens of millions of devices.
[0097] In an optional implementation manner, establishing a two-way data index between the physical data layer and the virtual data layer, and obtaining the corresponding blockchain transaction information according to the two-way data index includes:
[0098] Constructing a physical data index structure based on device identification information, data type information, time range information, and physical block pointer information, where the physical block pointer information is used to point to the physical data stored in the blockchain;
[0099] Construct a virtual data index structure based on virtual object identification information, scene type information, status information, and virtual block pointer information, where the virtual block pointer information is used to point to the virtual data stored in the blockchain;
[0100] Establish a two-way data index based on the physical data index structure and the virtual data index structure, where the two-way data index includes a forward mapping relationship from a physical index key to a virtual index set and a reverse mapping relationship from a virtual index key to a physical index set;
[0101] Obtain corresponding blockchain transaction information according to the two-way data index.
[0102] Construct a physical data index structure. This index structure is based on the following information: device identification information, data type information, time range information, and physical block pointer information. Among them, the device identification information can be the unique ID of the device, such as "Device_001". The data type information represents the nature of the data, such as "temperature", "humidity", etc. The time range information specifies the valid time period of the data, such as from "2023-01-01 00:00:00" to "2023-01-31 23:59:59". The physical block pointer information is used to point to the location where the actual physical data is stored in the blockchain, and can be the hash value of the block, such as "0x1a2b3c...".
[0103] Construct a virtual data index structure. This structure is based on the following information: virtual object identification information, scene type information, status information, and virtual block pointer information. The virtual object identification information can be the unique ID of the object in the virtual world, such as "VirtualObj_001". The scene type information describes the environment where the virtual object is located, such as "indoor", "outdoor", etc. The status information represents the current status of the virtual object, such as "normal", "abnormal", etc. The virtual block pointer information points to the location where the virtual data is stored in the blockchain, which can also be the hash value of the block.
[0104] After constructing the physical data index and the virtual data index, the next step is to establish a two-way data index. This two-way index consists of two parts: a forward mapping from a physical index key to a virtual index set, and a reverse mapping from a virtual index key to a physical index set. This two-way index structure allows us to quickly associate and query between physical data and virtual data.
[0105] Obtain the corresponding blockchain transaction information according to the two-way data index. Receive a query request: The system receives a query request, which may contain query conditions for physical data (such as device ID, data type, time range) or query conditions for virtual data (such as virtual object ID, scenario type, status). Index lookup: According to the query conditions, the system looks up relevant index entries in the two-way data index. If it is a physical data query, the system uses forward mapping; if it is a virtual data query, the system uses reverse mapping. Obtain the block pointer: Obtain the corresponding block pointer information from the index entry. Access the blockchain: Use the block pointer to access the blockchain and obtain the actual data stored in the corresponding block. Data parsing and return: Parse the data obtained from the blockchain and return the result to the initiator of the query request.
[0106] Suppose we want to query the temperature data of "Device_001" in January 2023 and the related virtual object information. The system receives a query request containing the device ID "Device_001", data type "temperature", and time range from "2023-01-01 00:00:00" to "2023-01-31 23:59:59". Look up the index "Device_001_temperature_20230101-20230131" in the forward mapping to obtain a list of related virtual objects ["VirtualObj_001", "VirtualObj_002"]. Obtain the block pointer "0x1a2b3c..." from the physical data index. Use this pointer to access the blockchain and obtain the stored temperature data. At the same time, the system can further query the information of virtual objects "VirtualObj_001" and "VirtualObj_002". Look up the indexes of these two virtual objects in the reverse mapping to obtain the relevant physical device and data information. The system combines the physical temperature data and the related virtual object information and returns it to the initiator of the query request.
[0107] In this way, the two-way association and fast query of physical data and virtual data are realized. This method not only improves the efficiency of data retrieval but also provides strong support for the data integration between the physical world and the virtual world. In practical applications, the index structure can be optimized according to specific requirements, such as adding a caching mechanism or using a more efficient data structure to store and query indexes.
[0108] To ensure data security and integrity, authentication and access control mechanisms can be added during index construction and query. For example, digital signatures can be used to verify the legality of index updates, or role-based access control can be implemented to ensure that only authorized users can query specific data.
[0109] This two-way data indexing method provides an efficient and flexible solution for data interaction between the physical data layer and the virtual data layer, laying a foundation for building complex Internet of Things and virtual reality applications.
[0110] In an alternative embodiment, the method further includes performing adaptive cache optimization on the blockchain transaction information:
[0111] Obtain the data size information of the blockchain transaction information and the system cache capacity information, calculate a space occupancy reference value based on the ratio of the data size information to the system cache capacity information, and use the product of the space occupancy reference value and a data priority factor as a space occupancy evaluation value, where the data priority factor is used to represent the importance degree of the target data;
[0112] Obtain the update time information of the blockchain transaction information and the current system time information, calculate the time difference between the update time information and the current system time information, and substitute the time difference and a timeliness decay coefficient into an exponential decay function to calculate a timeliness evaluation value, where the timeliness decay coefficient is used to control the rate of timeliness decay;
[0113] Multiply the space occupancy evaluation value and the timeliness evaluation value by their respective weight coefficients and sum them to obtain a cache priority score, where the weight coefficient is used to balance the influence degree of different evaluation metrics;
[0114] Adjust the cache policy for the blockchain transaction information based on the cache priority score. When the cache priority score is higher than a preset cache threshold, load the blockchain transaction information into the cache; when the cache priority score is lower than the preset cache threshold, remove the blockchain transaction information from the cache.
[0115] Obtain the data size information of the blockchain transaction information and the system cache capacity information. For example, the data size of a certain blockchain transaction information is 10 MB, and the currently available cache capacity of the system is 100 MB.
[0116] Calculate a space occupancy reference value based on the ratio of the data size information to the system cache capacity information. In this example, the space occupancy reference value is 10 MB / 100 MB = 0.1.
[0117] Introduce a data priority factor, which is used to represent the importance degree of the target data. The data priority factor can be set according to business requirements. For example, it can be set as an integer from 1 to 10, and the larger the value, the more important the data. Assume that the data priority factor of the current transaction information is 8.
[0118] Take the product of the space occupancy baseline value and the data priority factor as the space occupancy evaluation value. In this example, the space occupancy evaluation value is 0.1 * 8 = 0.8.
[0119] Obtain the update time information of the blockchain transaction information and the current system time information. For example, the last update time of a certain transaction information is 12:00:00 on May 1, 2023, and the current system time is 12:00:00 on May 2, 2023.
[0120] Calculate the time difference between the update time information and the current system time information. In this example, the time difference is 24 hours.
[0121] Introduce a timeliness decay coefficient to control the rate of timeliness decay. The timeliness decay coefficient can be adjusted according to actual needs. For example, it can be set to 0.1.
[0122] Substitute the time difference and the timeliness decay coefficient into the exponential decay function to calculate the timeliness evaluation value. The specific calculation method can be: timeliness evaluation value = e^(-timeliness decay coefficient * time difference). In this example, the timeliness evaluation value is approximately 0.0907.
[0123] Introduce a weight coefficient to balance the influence degree of different evaluation indicators. Weight coefficients can be set for the space occupancy evaluation value and the timeliness evaluation value respectively. For example, the weight coefficient of the space occupancy evaluation value is 0.6, and the weight coefficient of the timeliness evaluation value is 0.4.
[0124] Multiply the space occupancy evaluation value and the timeliness evaluation value by their corresponding weight coefficients respectively and sum them up to obtain the cache priority score. In this example, cache priority score = 0.8 * 0.6 + 0.0907 * 0.4 ≈ 0.5163.
[0125] Adjust the cache policy for the blockchain transaction information based on the cache priority score. Set a preset cache threshold, for example, 0.5. When the cache priority score is higher than the preset cache threshold, load the blockchain transaction information into the cache; when the cache priority score is lower than the preset cache threshold, remove the blockchain transaction information from the cache.
[0126] Since the calculated cache priority score 0.5163 is higher than the preset cache threshold 0.5, this blockchain transaction information will be loaded into the cache.
[0127] Adjustment of data priority factor: The data priority factor can be dynamically adjusted according to factors such as transaction amount and transaction frequency. For example, for transaction information with a transaction amount exceeding 1 million yuan, its data priority factor can be increased to the maximum value of 10. Adjustment of timeliness decay coefficient: Different timeliness decay coefficients can be set according to different types of transaction information. For example, for high-frequency transaction information, the timeliness decay coefficient can be set to 0.2 to accelerate its timeliness decay speed.
[0128] Adjustment of weight coefficient: The weight coefficient can be dynamically adjusted according to the system load situation. For example, when the system cache space is tight, the weight coefficient of the space occupancy evaluation value can be increased to 0.8, and the weight coefficient of the timeliness evaluation value can be decreased to 0.2 to give more consideration to the space factor. Adjustment of preset cache threshold: The preset cache threshold can be dynamically adjusted according to the overall performance of the system. For example, when the system response time significantly slows down, the preset cache threshold can be increased to 0.6 to reduce the amount of data in the cache.
[0129] In practical applications, various parameters can be fine-tuned according to specific business requirements and system characteristics. For example, the optimal timeliness decay coefficient and weight coefficient configuration can be determined through a large amount of test data. At the same time, machine learning algorithms can also be introduced to predict the data that may be frequently accessed in the future by analyzing the access patterns of historical data, thereby further optimizing the cache strategy.
[0130] Regular cleaning: Set up a scheduled task to regularly check and clean the data in the cache that has not been accessed for a long time to release the cache space. Hierarchical caching: Divide the cache into multiple levels, such as memory cache, SSD cache, and hard disk cache, and store the data in different levels of cache according to the importance and access frequency of the data. Concurrency control: In a high-concurrency scenario, use mechanisms such as read-write locks to ensure the consistency and integrity of the cache data. Fault tolerance mechanism: Implement a backup and recovery mechanism for the cache to quickly restore data when the cache fails. Monitoring and alerting: Monitor the cache usage situation in real time, and send an alert in a timely manner when the cache usage rate exceeds the preset threshold, so that the operation and maintenance personnel can handle it in a timely manner.
[0131] Figure 2 This is a schematic diagram comparing the cache hit rates under different blockchain transaction data volumes in the embodiments of the present invention:
[0132] The figure shows the comparison of cache hit rates of three different cache strategies under the increasing blockchain transaction data volume. The horizontal axis represents the blockchain transaction data volume, ranging from 100 to 50,000; the vertical axis represents the cache hit rate, expressed as a percentage. Three different line types are used in the figure to represent different cache strategies: the solid line marked with triangles represents the present technical solution (adaptive cache optimization), the dashed line marked with squares represents the LRU cache strategy, and the dotted line marked with circles represents the FIFO cache strategy. From the data trend, when the transaction data volume is 100, the hit rates of the three strategies are approximately 88% (this solution), 79% (LRU), and 72% (FIFO) respectively. As the data volume increases to 50,000, the performance differences among the three strategies further expand. The present technical solution still maintains a relatively high hit rate of approximately 75%, while the LRU strategy drops to approximately 50%, and the FIFO strategy drops to approximately 40%. Overall, the present technical solution maintains the optimal cache hit rate at each data level, and the performance decay is minimal as the data volume increases, showing significant performance advantages and good scalability. Especially in the scenario of large data volumes (more than 10,000), the advantages of this solution compared with traditional cache strategies are more obvious, and the hit rate always remains above 75%.
[0133] In an alternative embodiment, parsing the obtained blockchain transaction information into physical world data or virtual world data and returning the parsed data to the user includes:
[0134] Obtaining the data identification field in the blockchain transaction information, and judging whether the blockchain transaction information belongs to physical world data or virtual world data according to the data identification field;
[0135] When the blockchain transaction information belongs to physical world data, extracting the device identification information, sensing data information, and timestamp information in the blockchain transaction information according to a preset physical data parsing template to generate physical world parsing data;
[0136] When the blockchain transaction information belongs to virtual world data, extracting the virtual object identification information, scene state information, and interaction behavior information in the blockchain transaction information according to a preset virtual data parsing template to generate virtual world parsing data;
[0137] Returning the physical world parsing data or the virtual world parsing data to the user.
[0138] Obtain the data identification field in the blockchain transaction information, and determine whether the blockchain transaction information belongs to physical world data or virtual world data based on this field. The data identification field is usually located in the header or metadata part of the transaction information and is distinguished by specific identifiers. For example, physical world data can use the "PHY" prefix, and virtual world data can use the "VIR" prefix. When specifically implemented, after the system obtains the complete transaction information from the blockchain node, it first parses the first 8 bytes of the transaction header to extract the data type identifier. If the transaction information is "PHY_TEMP_24A75B...", then the "PHY" identifier is extracted, indicating that this is a piece of physical world data. In addition, the system also supports composite identifiers, such as "PHY_TEMP" representing physical world temperature data, "VIR_AVTR" representing virtual world avatar data, etc., so as to achieve more refined data classification.
[0139] When the blockchain transaction information is determined to be physical world data, relevant information is extracted according to the preset physical data parsing template. The physical data parsing template is a structured data description file, defined in JSON or XML format, which specifies the parsing rules for different types of physical data. Information such as the position, length, encoding method, and data type of the necessary fields is defined in the template. For example, the temperature sensor data template can be defined as: the device identification information is located at the byte offset positions 8 - 24, using UTF-8 encoding; the sensing data information is located at the byte offset positions 25 - 32, using the IEEE 754 floating-point number format; the timestamp information is located at the byte offset positions 33 - 40, using the Unix timestamp format.
[0140] Through the physical data parsing template, it is parsed that: the device identification is "24A75B" (representing a specific temperature sensor), the sensing data is "28.5" (representing 28.5 degrees Celsius), and the timestamp is "1662345678" (representing 08:21:18 on September 5, 2022). In addition, for different types of physical data, the system has prepared multiple parsing templates, such as humidity data templates, location data templates, light data templates, etc., to achieve accurate parsing of various physical world data. To improve the parsing efficiency, the system adopts a template caching mechanism to load frequently used parsing templates into memory and reduce the template loading time.
[0141] When blockchain transaction information is determined to be virtual world data, relevant information is extracted according to a preset virtual data parsing template. The virtual data parsing template also adopts a structured definition method, but its field design focuses more on virtual scenario characteristics. A typical virtual data parsing template includes virtual object identification information, scene state information, interaction behavior information, etc. Virtual object identification usually uses a unique ID to represent a specific virtual entity; scene state information describes the position, orientation, action state, etc. of the virtual object; interaction behavior information records the interaction methods and results between the user and the virtual object.
[0142] Through the virtual data parsing template, it is parsed that: the virtual object identification is "18F2D5" (representing a certain virtual character), the scene state information includes the position coordinates "125.4, 78.2, 42.1" and the action state "WALK" (representing the walking state), and the interaction behavior information includes the interaction duration of "30" seconds and the interacting user "USER456". For complex virtual world data, the system supports hierarchical parsing. First, the basic structure is parsed, and then each sub-structure is recursively parsed. For example, there are multiple virtual objects in a virtual scene, and each object contains multiple attributes and states.
[0143] A data validity verification mechanism is also implemented to check the legality of the parsed data. For example, for temperature data, check whether it is within a reasonable range (such as -50°C to 150°C), and for virtual position coordinates, check whether they are within the scene boundary. When abnormal data is detected, the system will mark and record it, and at the same time try to recover the data or provide alternative values through a data repair algorithm. For example, when the temperature value is significantly abnormal (such as 9999°C), the system may return the nearest valid temperature value or a preset default value.
[0144] The parsed physical world data or virtual world data is returned to the user. The returned data format supports multiple standards, including JSON, XML, Protocol Buffers, etc., to meet the requirements of different application scenarios. The system will perform corresponding conversions according to the data format parameters specified in the user request. In addition, the system also provides a data annotation function to add additional descriptive information to the returned data, such as data units, precision, collection methods, etc., to enhance the interpretability of the data.
[0145] To improve performance, the system implements parallel processing of the parsing process. When a large amount of transaction information needs to be parsed, the system distributes the tasks to multiple processing threads. Each thread is responsible for parsing a part of the data, and finally the results are merged. Practical measurements show that on an 8-core processor, parallel parsing can increase the processing speed by about 5.8 times compared to serial parsing. In addition, the system also implements a cache for parsing results. For the same transaction data that is repeatedly requested within a short period of time, the cached results are directly returned to avoid repeated parsing and further improve the response speed.
[0146] Compared with the prior art, the present application has made significant improvements in the parsing of blockchain transaction information. Existing blockchain data parsing technologies usually adopt fixed-format parsing methods, lacking special adaptation to data in the physical world and the virtual world. This leads to low parsing efficiency and difficulty in processing diverse data formats. For example, traditional parsing methods can usually only identify basic transaction information (such as sender, recipient, amount, etc.), but cannot deeply parse the Internet of Things (IoT) sensing data or virtual scenario interaction data contained in the payload data.
[0147] A dedicated data identification mechanism is introduced to accurately distinguish data in the physical world and the virtual world; a targeted parsing template system is designed to adapt to the characteristics of different types of data; the data validity verification and exception handling capabilities are enhanced to improve the reliability of the parsing results; the parsing process is optimized, and the performance is significantly improved through parallel processing and result caching. Through these technical improvements, the present application makes the conversion of blockchain transaction information to physical / virtual world data more efficient and accurate, providing a solid foundation for the deep integration of intelligent IoT and the metaverse.
[0148] In actual tests, compared with traditional methods, the data recognition accuracy of the parsing method of the present application has increased from 92.3% to 99.7%, the parsing speed has increased by about 4.2 times, and the abnormal data handling ability has increased by 3.5 times. These improvements provide more reliable and efficient data support for the interaction between IoT and the metaverse based on blockchain, effectively promoting data interconnection and integration between the two worlds.
[0149] In the second aspect of the embodiments of the present invention, a data interaction and fusion system for intelligent IoT and the metaverse based on blockchain is provided, including:
[0150] A first unit for obtaining physical world data in intelligent IoT devices, where the physical world data includes IoT device identification information and IoT device status information; and at the same time obtaining virtual world data in the metaverse virtual scenario, where the virtual world data includes virtual object identification information and virtual object status information;
[0151] A second unit for encapsulating the physical world data and the virtual world data into blockchain transaction information respectively, and establishing a correspondence relationship between the physical world data and the virtual world data based on a preset data mapping rule;
[0152] A third unit for classifying and storing the blockchain transaction information through a distributed time-series database, where the distributed time-series database includes a physical data layer and a virtual data layer. The physical data layer is used to store the blockchain transaction information corresponding to the physical world data, the virtual data layer is used to store the blockchain transaction information corresponding to the virtual world data, and a two-way data index is established between the physical data layer and the virtual data layer;
[0153] A fourth unit, configured to receive a data interaction request initiated by a user, where the data interaction request includes identification information of physical world data or virtual world data to be accessed; process the data interaction request, and obtain corresponding blockchain transaction information according to the two-way data index;
[0154] A fifth unit, configured to parse the obtained blockchain transaction information into physical world data or virtual world data, and return the parsed data to the user.
[0155] In a third aspect of the embodiments of the present invention, an electronic device is provided, including:
[0156] A processor;
[0157] A memory for storing instructions executable by the processor;
[0158] Wherein, the processor is configured to call the instructions stored in the memory to execute the method described above.
[0159] In a fourth aspect of the embodiments of the present invention, a computer-readable storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method described above is implemented.
[0160] The present invention may be a method, an apparatus, a system, and / or a computer program product. The computer program product may include a computer-readable storage medium, on which computer-readable program instructions for executing various aspects of the present invention are loaded.
[0161] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A blockchain-based intelligent IoT and metaverse data interactive fusion method, characterized in that: include: Obtain physical world data from smart IoT devices; At the same time, obtain the virtual world data in the virtual scene of the metaverse; Encapsulating the physical world data and the virtual world data into blockchain transaction information respectively, and establishing a corresponding relationship between the physical world data and the virtual world data based on a preset data mapping rule; The blockchain transaction information is classified and stored through a distributed time series database, wherein the distributed time series database includes a physical data layer and a virtual data layer, and a bidirectional data index is established between the physical data layer and the virtual data layer; Receiving a data interaction request initiated by a user, the data interaction request including identification information of physical world data or virtual world data to be accessed; processing the data interaction request, and acquiring corresponding blockchain transaction information according to the bidirectional data index; Parse the acquired blockchain transaction information into physical world data or virtual world data, and return the parsed data to the user.
2. The method according to claim 1, characterized in that Encapsulating the physical world data and the virtual world data into blockchain transaction information respectively, and establishing a corresponding relationship between the physical world data and the virtual world data based on a preset data mapping rule includes: Establishing a correspondence between physical world data and virtual world data based on a preset multi-dimensional mapping rule, wherein the multi-dimensional mapping rule includes a space mapping rule, a state mapping rule, and an environment data mapping rule; The multi-dimensional mapping rules are compressed and encoded, and a cascade operation is performed in combination with the timestamp information and the version identification information to obtain verification data, and the blockchain transaction data that has passed the verification is stored in the blockchain according to the storage hierarchy structure, and an index structure of the blockchain transaction data is established based on a multi-level index mechanism; Based on the index structure, the physical world data and the virtual world data are mapped and updated synchronously in real time. When an abnormal mapping is detected, an abnormal handling mechanism is triggered, and the abnormal handling mechanism includes rechecking and adjusting the mapping rules.
3. The method according to claim 2, characterized in that The multi-dimensional mapping rules are compressed and encoded, and the timestamp information and the version identification information are combined to perform cascade operations to obtain verification data, and the blockchain transaction data that passes the verification is stored in the blockchain according to the storage hierarchy structure. The index structure of the blockchain transaction data is established based on the multi-level index mechanism, including: Compressing and encoding the multi-dimensional mapping rule to obtain compressed rule data, performing a cascade operation on the compressed rule data, the timestamp information and the version identification information, and then performing a hash calculation to obtain verification data; Verification is performed according to the verification data, and after verification, the blockchain transaction data is stored in the blockchain according to a storage hierarchy structure, wherein the storage hierarchy structure includes block header information, transaction list information, and index table information, wherein the block header information is used to record blockchain basic information, the transaction list information is used to store transaction data information, and the index table information is used to establish a data retrieval path; An index structure for the blockchain transaction data is established based on a multi-level index mechanism, wherein the multi-level index mechanism includes a primary key index, a version tree index, and a time index, wherein the primary key index is used to uniquely identify transaction data, the version tree index is used to record the rule version evolution relationship, and the time index is used to implement time series retrieval.
4. The method according to claim 1, characterized in that: Establishing a bidirectional data index between the physical data layer and the virtual data layer, and obtaining corresponding blockchain transaction information according to the bidirectional data index includes: Constructing a physical data index structure based on the device identification information, the data type information, the time range information, and the physical block pointer information, wherein the physical block pointer information is used to point to the physical data stored in the blockchain; Constructing a virtual data index structure based on virtual object identification information, scene type information, state information, and virtual block pointer information, wherein the virtual block pointer information is used to point to virtual data stored in the blockchain; Establishing a bidirectional data index based on the physical data index structure and the virtual data index structure, wherein the bidirectional data index includes a forward mapping relationship from a physical index key to a virtual index set and a reverse mapping relationship from a virtual index key to a physical index set; Corresponding blockchain transaction information is obtained according to the bidirectional data index.
5. The method according to claim 4, characterized in that The method further includes adaptively caching the blockchain transaction information: Obtaining data size information and system cache capacity information of the blockchain transaction information, calculating a space occupancy benchmark value based on a ratio of the data size information to the system cache capacity information, and taking the product of the space occupancy benchmark value and a data priority factor as a space occupancy assessment value, wherein the data priority factor is used to characterize the importance of the target data; Obtaining update time information of the blockchain transaction information and current system time information, calculating the time difference between the update time information and the current system time information, substituting the time difference and the timeliness decay coefficient into an exponential decay function to calculate a timeliness evaluation value, wherein the timeliness decay coefficient is used to control the rate of timeliness decay; The space occupancy evaluation value and the timeliness evaluation value are respectively multiplied by corresponding weight coefficients and the sum is calculated to obtain a cache priority score, wherein the weight coefficient is used to balance the influence of different evaluation indicators; The cache strategy of the blockchain transaction information is adjusted based on the cache priority score. When the cache priority score is higher than a preset cache threshold, the blockchain transaction information is loaded into the cache. When the cache priority score is lower than the preset cache threshold, the blockchain transaction information is removed from the cache.
6. The method according to claim 1, characterized in that Parsing the acquired blockchain transaction information into physical world data or virtual world data and returning the parsed data to the user includes: Obtaining a data identification field in the blockchain transaction information, and determining whether the blockchain transaction information belongs to physical world data or virtual world data according to the data identification field; When the blockchain transaction information belongs to physical world data, extracting device identification information, sensor data information and timestamp information in the blockchain transaction information according to a preset physical data parsing template to generate physical world parsed data; When the blockchain transaction information belongs to virtual world data, extracting virtual object identification information, scene state information, and interactive behavior information in the blockchain transaction information according to a preset virtual data parsing template to generate virtual world parsing data; The physical world parsed data or the virtual world parsed data is returned to the user.
7. A blockchain-based intelligent IoT and metaverse data interactive fusion system, used to implement the method described in any one of claims 1 to 6, characterized in that: include: The first unit is used to obtain the physical world data in the smart IoT device and the virtual world data in the virtual scene of the Metaverse; The second unit is used to encapsulate the physical world data and the virtual world data into blockchain transaction information respectively, and establish a corresponding relationship between the physical world data and the virtual world data based on a preset data mapping rule; A third unit is used to classify and store the blockchain transaction information through a distributed time series database, wherein the distributed time series database includes a physical data layer and a virtual data layer, and a bidirectional data index is established between the physical data layer and the virtual data layer; A fourth unit is configured to receive a data interaction request initiated by a user, wherein the data interaction request includes identification information of physical world data or virtual world data to be accessed; process the data interaction request, and obtain corresponding blockchain transaction information according to the bidirectional data index; The fifth unit is used to parse the acquired blockchain transaction information into physical world data or virtual world data, and return the parsed data to the user.
8. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Digital twinning-based automatic driving high-precision map model and high-precision static map making method
CN116129066A
Customer group ecological scene construction method and system based on meta-universe virtual reality technology
CN117170497A