CN113901142B - Space-time data-oriented block chain architecture and range query processing method - Google Patents

Space-time data-oriented block chain architecture and range query processing method Download PDF

Info

Publication number
CN113901142B
CN113901142B CN202111190860.2A CN202111190860A CN113901142B CN 113901142 B CN113901142 B CN 113901142B CN 202111190860 A CN202111190860 A CN 202111190860A CN 113901142 B CN113901142 B CN 113901142B
Authority
CN
China
Prior art keywords
space
time data
node
data
query
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111190860.2A
Other languages
Chinese (zh)
Other versions
CN113901142A (en
Inventor
丁琳琳
华亚洲
李思思
陈泽
张翰林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Liaoning University
Original Assignee
Liaoning University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Liaoning University filed Critical Liaoning University
Priority to CN202111190860.2A priority Critical patent/CN113901142B/en
Publication of CN113901142A publication Critical patent/CN113901142A/en
Application granted granted Critical
Publication of CN113901142B publication Critical patent/CN113901142B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A block chain architecture and range query processing method facing to space-time data comprises the following steps: step 1: dividing node categories according to the role of the nodes in the blockchain network; step 2: carrying out data processing and signature confirmation on the generated space-time data, then releasing the space-time data into a block chain network, and further processing by nodes in the space-time data; step 3: the method comprises the steps of obtaining space-time data from a block chain network, storing the space-time data in blocks based on a quadtree and a single-chain table storage structure when the data quantity reaches a certain peak range, namely (1M-2M), introducing the time range and the space range of the stored space-time data into a block head, and then storing the blocks into a block chain through the reference of a plurality of forward blocks. Step 4: and giving out the time and space dimension range of the space-time data to be inquired, carrying out range inquiry of the space-time data in the constructed block chain by utilizing the space-time range stored in the block head, and returning an inquiry result. By the method, the support of the block chain technology on the space-time data is improved in terms of improving the space-time data throughput and the space-time data query efficiency.

Description

Space-time data-oriented block chain architecture and range query processing method
Technical Field
The invention relates to a space-time data storage and query method, in particular to a space-time data oriented block chain architecture and a range query processing method. Belonging to the field of block chains and distributed data storage.
Background
The blockchain is a chained data structure which is formed by combining data blocks in a sequential connection mode according to a time sequence, and is essentially a decentralized distributed ledger, and the distributed ledger is guaranteed to be untampered in a cryptographic mode. The block chain has the advantages of decentralization, tamper resistance and traceability, so that the block chain can safely and reliably store data records. Because of the advantages of the blockchain technology in data management, the blockchain technology has been widely used in fields of finance, medical treatment, education, etc., and with the continuous development of the blockchain technology, the blockchain technology will be applied to more fields.
The spatio-temporal data is data having a time dimension and a space dimension, and most of data types in the fields of supply chain management, electronic commerce and the like are spatio-temporal data. The method has the advantages that the complete, transparent and safe storage of the space-time data is guaranteed, the method has important significance in practical application, the current storage mode of the space-time data is mostly centralized storage, and the storage mode leads to the opacity of the space-time data, easy formation of data islands and difficult problem tracing.
Therefore, the space-time data management and the blockchain technology are combined, the space-time data is managed by utilizing the characteristics of decentralization, tamper resistance and traceability of the blockchain technology, the generated space-time data is stored in the blockchain, and multiple parties participate in storing data copies together, so that the transparent and safe storage of the space-time data and the active and searchable problems are realized.
The space-time data has the characteristics of time sensitivity, high change speed and large data scale, and the traditional block chain technology is difficult to meet the characteristics of the space-time data, so the support of the space-time data is limited. For example, a bitcoin blockchain can only process 7 transactions per second, well below the throughput requirements of spatiotemporal data. Secondly, the complicated voting confirmation mechanism of the traditional block chain technology leads to long time for confirming space-time data and low uplink speed. Finally, the conventional block chain technology has a low query mode in terms of data query, when data query is performed, firstly, the latest block is queried, and then the previous block is queried according to the hash pointer in the block head until the block is created.
In summary, the conventional blockchain technique has the following drawbacks in terms of space-time data management: 1. the processing efficiency of the space-time data is low, and the complicated voting confirmation mechanism causes the low speed of the space-time data uplink, so that the throughput requirement of the space-time data is difficult to meet. 2. The traditional block chain technology has single query form in the aspect of data query, only supports the query based on the data hash value, and the query mode is traversal query, and in the worst case, the query needs to traverse to the created block, so that the quick query requirement of space-time data is difficult to meet.
Disclosure of Invention
The invention aims to provide a block chain architecture and a range query processing method for space-time data. The method solves the technical problem that the prior conventional block chain technology has limited support for space-time data management, can rapidly process generated space-time data, and supports rapid query of the space-time data.
The invention aims at realizing the following technical scheme: a block chain architecture and range query processing method facing to space-time data comprises the following steps:
step1: dividing node categories according to the role of the nodes in the blockchain network;
Step 2: carrying out data processing and signature confirmation on the newly generated space-time data, then releasing the space-time data into a block chain network, and further processing by nodes in the space-time data;
Step 3: acquiring space-time data from a block chain network, storing the space-time data in a block based on a quadtree and a single-chain table storage structure when the data quantity reaches a certain peak value range (1M-2M), introducing the time range and the space range of the stored space-time data into a block head, and then storing the block into a block chain through the reference of a plurality of forward blocks;
step 4: and giving out the time and space dimension range of the space-time data to be inquired, carrying out range inquiry of the space-time data in the constructed block chain by utilizing the space-time range stored in the block head, and returning an inquiry result.
Further, in the step 1, the node class includes user nodes, auxiliary nodes, consensus nodes and full nodes;
The user node: the user node is used for generating space-time data, carrying out data processing and signature confirmation on the generated space-time data, and issuing the confirmed space-time data into the block chain network;
The auxiliary node: the auxiliary node is used for collecting space-time data issued by the user node into the block chain network and storing the data in a buffer zone in a space-time data pool;
wherein: the auxiliary nodes comprise super auxiliary nodes and common auxiliary nodes;
The super auxiliary node: the supernode auxiliary node is responsible for data interaction between the consensus node and the user nodes. In one aspect, spatiotemporal data published by user nodes into a blockchain network is collected and stored into a buffer of a spatiotemporal data pool. On the other hand, responding to the request of the consensus node, and returning the space-time data in the buffer area in the space-time data pool to the consensus node;
the common auxiliary node: the common auxiliary node also maintains a space-time data pool and is used for ensuring the consistency of the data states in the space-time data pool by carrying out data synchronous communication with other auxiliary nodes after the data in the space-time data pool is changed;
The consensus node: the consensus nodes act to store the generated spatiotemporal data into the blockchain. When a new block is constructed, the consensus node sends a data acquisition request to the auxiliary node, and the space-time data is stored in a block chain after being acquired from the auxiliary node;
the full node: the full node is used for storing complete data copies of the space-time data block chain, responding to the query request of the user node and returning space-time data meeting the query condition to the user node;
further, in the step 2, the specific steps are as follows: firstly, after the user node generates the space-time data, formatting the space-time data by the user node, and processing the space-time data into data with the format of { keyi, timei, spacei, < other attributes >, < signs > }; secondly, the user node carries out signature confirmation on the processed space-time data and issues the space-time data after signature confirmation to a block chain network; finally, the auxiliary node collects the space-time data issued by the user node to the blockchain network, performs validity check on the signature information by utilizing the public key of the signature party, and stores the checked space-time data in a buffer zone in a space-time data pool in sequence according to the time sequence of the checked space-time data, wherein the space-time data with illegal signature information is discarded.
Further, in the step 3, the specific steps are as follows:
Step 3.1: and the consensus node communicates with the super auxiliary node according to the locally stored route information, and sends a request for acquiring the space-time data to the super auxiliary node.
Step 3.2: after receiving the request of the consensus node, the super auxiliary node firstly adds the request into a request queue, then the super auxiliary node checks a buffer area in the space-time data pool to see whether the buffer area which is not empty exists, if so, the space-time data in the buffer area is sent to the consensus node according to the sequence of the request queue, otherwise, the super auxiliary node enters a waiting state until the space-time data in the buffer area is not empty.
Step 3.3: after receiving the space-time data returned by the super auxiliary node, the consensus node stores the space-time data in a block based on a quadtree and a single-chain table storage structure according to the time and space dimensions of the space-time data, and introduces the time range and the space range of the stored data in the block head for facilitating the space-time data query.
Step 3.4: after random numbers meeting requirements are found by the consensus node through a low-difficulty POW algorithm, the consensus node stores newly generated blocks into a blockchain through references to a plurality of forward blocks, so that a Directed Acyclic Graph (DAG) topological structure is formed by the whole blockchain network. And then the common node broadcasts the new block through the whole network, and other common nodes and the whole node update the local block chain data according to the broadcast message.
Further, in the step4, the specific steps are as follows:
Step 4.1: and the full node receives the space-time data query request sent by the user node, and obtains the query condition corresponding to the query request.
Step 4.2: the full node searches the blocks in the local stored space-time data block chain from the latest block according to the query condition in the query request, and finds out the blocks which are stored in the block head and have the space-time range meeting the query condition as candidate blocks. After the candidate block set is obtained, the full nodes sequentially search the space-time data stored in the candidate blocks, find out the space-time data meeting the query conditions from the space-time data and put the space-time data into the result set.
Step 4.3: after the candidate block is searched, the full node returns the data in the result set to the user node according to the query path.
In the step 4.1, the following specific situations are:
Case 1: the query condition corresponding to the query request of the user is single-value query on the space-time data, namely, the space-time data with the query time dimension of t and the space dimension of s.
Case 2: the query conditions corresponding to the query request of the user are range query of space-time data, the range query is divided into three types, namely, the space-time data with the query time dimension within [ t1, t2] and the space dimension of s is queried; secondly, querying space-time data with time dimension t and space dimension within s1 and s 2; finally, the space-time data with the time dimension in [ t1, t2] and the space dimension in [ s1, s2] are queried.
In the step 4.2, the specific steps are as follows:
Step 4.2.1: if the query condition corresponding to the query request of the user is in the state 1. The full node starts to inquire from the latest block in the local stored space-time data block chain complete data copy, and the inquiry algorithm is a breadth-first traversal algorithm of the graph. In the inquiring process, firstly judging whether the time dimension t and the space dimension s to be inquired by a user are in the space-time ranges [ tstart, tend ] and [ sstart, send ] stored in the block head, if so, adding the current block into the candidate block set, otherwise, skipping the current block and continuing to traverse forward. And stopping the breadth-first traversal algorithm when the created block is reached or the query condition is not within the space-time range in the block head.
Step 4.2.2: traversing a quadtree and singly linked list based storage structure (F-L tree) within the candidate block. Firstly, judging the relation between the query conditions t and s of the user and the time dimension median tmid and the space dimension median smid stored in the block head. If t < tmid, s < smid, then search the subtree with F-Ltree number 00; if t < tmid, s > smid, searching the subtree with the F-L tree number of 01; if t > tmid, s < smid, searching the subtree with the F-L tree number of 10; if t > tmid, s > smid, then the subtree with F-Ltree number 11 is retrieved. Until the node is a leaf node, and adding the data meeting the query condition in the node into the result set.
Step 4.2.3: and if the query condition corresponding to the query request of the user is case 2. Taking the last case of case 2 as an example, the full node starts to query from the latest block in the local saved complete data copy of the spatio-temporal data blockchain, and the query algorithm is a breadth-first traversal algorithm of the graph. In the query process, firstly judging whether the time range [ t1, t2] and the space range [ s1, s2] of the user query are intersected with the space-time ranges [ tstart, tend ] and [ sstart, send ] stored in the block head, if the intersection exists, adding the current block into the candidate block set, otherwise, skipping the current block and continuing to traverse forward. And stopping the breadth-first traversal algorithm when the time-space range in the block head of the created block or all blocks has no intersection with the query condition.
Step 4.2.4: traversing a storage structure (F-L tree) based on a quadtree and a single linked list in a candidate block, judging which branch of the F-L tree needs to be traversed according to the relation between the query conditions [ t1, t2], [ s1, s2] of a user and the time dimension median tmid and the space dimension median smid stored in the block head of the candidate block in the traversing process until the branch is traversed to a leaf node of the F-L tree, and adding space-time data meeting the query conditions of the user in the node into a result set.
The beneficial effects of the invention are as follows: the invention provides a space-time data-oriented blockchain architecture and a range query processing method, and the space-time data blockchain with a topological structure of a Directed Acyclic Graph (DAG) is constructed by the method. Because the DAG block chain structure allows the nodes to go out of the block in parallel, the processing speed of the space-time data is increased, and the time for the space-time data to be uplink is reduced. In addition, in order to improve the query efficiency of the space-time data, a storage structure (F-L tree) based on a quadtree and a singly linked list is provided in the block, and the F-L tree supports various query types of the space-time data, such as single-value query, range query and the like based on time and space dimensions, and the F-Ltree query speed is high, the efficiency is high, and the query requirement of a user can be met.
Drawings
Fig. 1: the invention provides a block chain network structure diagram.
Fig. 2: the space-time data block chain structure diagram constructed by the invention.
Fig. 3: the invention provides a construction process schematic diagram of F-Ltree.
Fig. 4: the data processing time of different architectures consumes the comparison.
Fig. 5: single block single value query time consumption comparison.
Fig. 6: single block range query time consuming comparisons.
Fig. 7: multi-block single value query time consumption comparison.
Fig. 8: multi-block range query time consumption comparisons.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clear, the present application will be described in further detail with reference to the accompanying drawings and examples.
A block chain architecture and range query processing method facing to space-time data comprises the following steps:
step1: dividing node categories according to the role of the nodes in the blockchain network;
1.1: user node: the user node is used for generating space-time data, carrying out data processing and signature confirmation on the generated space-time data, and issuing the confirmed space-time data into the block chain network.
1.2: Auxiliary node: the auxiliary nodes function to collect spatiotemporal data published by the user nodes into the blockchain network and store the data in buffers in a spatiotemporal data pool.
1.2.1: Super auxiliary node: the supernode auxiliary node is responsible for data interaction between the consensus node and the user nodes. In one aspect, spatiotemporal data published by user nodes into a blockchain network is collected and stored into a buffer of a spatiotemporal data pool. On the other hand, responding to the request of the consensus node, and returning the space-time data in the buffer area in the space-time data pool to the consensus node;
1.2.2: common auxiliary nodes: the common auxiliary node also maintains a space-time data pool and is used for ensuring the consistency of the data states in the space-time data pool by carrying out data synchronous communication with other auxiliary nodes after the data in the space-time data pool is changed;
1.3: consensus node: the consensus nodes act to store the generated spatiotemporal data into the blockchain. When a new block is constructed, the consensus node sends a data acquisition request to the super auxiliary node, and the super auxiliary node acquires the space-time data and stores the space-time data in the block chain.
1.4: Full node: the full node is used for storing complete data copies of the space-time data blockchain, responding to the query request of the user node and returning the data meeting the query condition to the user node.
In the blockchain network presented in fig. 1, the four types of nodes described above are included.
Step 2: carrying out data processing and signature confirmation on the generated space-time data, then releasing the space-time data into a block chain network, and carrying out further processing on the space-time data by nodes in the space-time data, wherein the specific steps are as follows:
firstly, after the user node generates the space-time data, formatting the space-time data by the user node, and processing the space-time data into data with the format of { keyi, timei, spacei, < other attributes >, < signs > }; secondly, the user node carries out signature confirmation on the processed space-time data and issues the space-time data after signature confirmation to a block chain network; finally, the auxiliary node collects the space-time data issued by the user node to the blockchain network, performs validity check on the signature information by utilizing the public key of the signature party, and stores the checked space-time data in a buffer zone in a space-time data pool in sequence according to the time sequence of the checked space-time data, wherein the space-time data with illegal signature information is discarded.
Step 3: and acquiring space-time data from the block chain network, storing the space-time data in blocks based on a quadtree and a single-chain table storage structure when the data quantity reaches a certain peak range (1M-2M), introducing the time range and the space range of the stored space-time data into a block head, and then storing the blocks into the block chain through the reference of a plurality of forward blocks.
3.1: And the consensus node communicates with the super auxiliary node according to the locally stored route information, and sends a request for acquiring the space-time data to the super auxiliary node.
3.2: After receiving the request of the consensus node, the super auxiliary node firstly adds the request into a request queue, then the super auxiliary node checks a buffer area in the space-time data buffer pool to see whether the buffer area which is not empty exists, if so, the space-time data in the buffer area is sent to the consensus node according to the sequence of the request queue, otherwise, the waiting state is entered until the space-time data in the buffer area is not empty.
3.3: After receiving the space-time data returned by the super auxiliary node, the consensus node stores the space-time data in a block based on a quadtree and a single-chain table storage structure according to the time and space dimensions of the space-time data, and introduces the time range and the space range of the stored data in the block head for facilitating the space-time data query.
3.4: After random numbers meeting requirements are found by the consensus node through a low-difficulty POW algorithm, the consensus node stores newly generated blocks into a blockchain through references to a plurality of forward blocks, so that a Directed Acyclic Graph (DAG) topological structure is formed by the whole blockchain network. And then the common node broadcasts the new block through the whole network, and other common nodes and the whole node update the local block chain data according to the broadcast message.
Step 4: and giving out the time and space dimension range of the space-time data to be inquired, carrying out range inquiry of the space-time data in the constructed block chain by utilizing the space-time range stored in the block head, and returning an inquiry result.
4.1. The full node receives a space-time data query request sent by a user node, and obtains a query condition corresponding to the query request from the space-time data query request, which is specifically divided into the following cases:
Case 1: the query condition corresponding to the query request of the user is single-value query on the space-time data, namely, the space-time data with the query time dimension of t and the space dimension of s.
Case 2: the query conditions corresponding to the query request of the user are range query of space-time data, the range query is divided into three types, namely, the space-time data with the query time dimension within [ t1, t2] and the space dimension of s is queried; secondly, querying space-time data with time dimension t and space dimension within s1 and s 2; finally, the space-time data with the time dimension in [ t1, t2] and the space dimension in [ s1, s2] are queried.
4.2. The full node searches the blocks in the local stored space-time data block chain from the latest block according to the query condition in the query request, and finds out the blocks which are stored in the block head and have the space-time range meeting the query condition as candidate blocks. After the candidate block set is obtained, the full nodes sequentially search the space-time data stored in the candidate blocks, find out the space-time data meeting the query conditions from the space-time data and put the space-time data into the result set.
4.2.1. If the query condition corresponding to the query request of the user is in the state 1. The full node starts to inquire from the latest block in the local stored space-time data block chain complete data copy, and the inquiry algorithm is a breadth-first traversal algorithm of the graph. In the inquiring process, firstly judging whether the time dimension t and the space dimension s to be inquired by a user are in the space-time ranges [ tstart, tend ] and [ sstart, send ] stored in the block head, if so, adding the current block into the candidate block set, otherwise, skipping the current block and continuing to traverse forward. And stopping the breadth-first traversal algorithm when the created block is reached or the query condition is not within the space-time range in the block head.
4.2.2. Traversing a quadtree and singly linked list based storage structure (F-L tree) within the candidate block. Firstly, judging the relation between the query conditions t and s of the user and the time dimension median tmid and the space dimension median smid stored in the block head. If t < tmid, s < smid, searching the subtree with the F-L tree number of 00; if t < tmid, s > smid, searching the subtree with the F-L tree number of 01; if t > tmid, s < smid, then search the subtree with F-Ltree number 10; if t > tmid, s > smid, then the subtree with F-Ltree number 11 is retrieved. Until the node is a leaf node, and adding the data meeting the query condition in the node into the result set.
4.2.3. And if the query condition corresponding to the query request of the user is case 2. Taking the last case of case 2 as an example, the full node starts to query from the latest block in the local saved complete data copy of the spatio-temporal data blockchain, and the query algorithm is a breadth-first traversal algorithm of the graph. In the query process, firstly judging whether the time range [ t1, t2] and the space range [ s1, s2] of the user query are intersected with the space-time ranges [ tstart, tend ] and [ sstart, send ] stored in the block head, if the intersection exists, adding the current block into the candidate block set, otherwise, skipping the current block and continuing to traverse forward. And stopping the breadth-first traversal algorithm when the time-space range in the block head of the created block or all blocks has no intersection with the query condition.
4.2.4. Traversing a storage structure (F-L tree) based on a quadtree and a single linked list in a candidate block, judging which branch of the F-L tree needs to be traversed according to the relation between the query conditions [ t1, t2], [ s1, s2] of a user and the time dimension median tmid and the space dimension median smid stored in the block head of the candidate block in the traversing process until the branch is traversed to a leaf node of the F-L tree, and adding space-time data meeting the query conditions of the user in the node into a result set.
4.3. After the candidate block is searched, the full node returns the data in the result set to the user node according to the query path.
Specific application example
A block chain architecture and range query processing method facing to space-time data comprises the following specific embodiments:
(1) Generation and validation of spatiotemporal data: in the constructed blockchain network, the space-time data mainly originates from user nodes, and the generation and confirmation of the space-time data need the participation of the user nodes. Most of the data generated by the user nodes can be abstracted into spatio-temporal data having a temporal dimension and a spatial dimension. Taking electronic commerce as an example, when a user purchases a certain commodity, a space-time data record is generated, the purchase time and the delivery place correspond to the time dimension and the space dimension of the space-time data, the position change process of the commodity along with time in the subsequent transportation process is the update process of the space-time data, and the updated space-time data is stored in the block chain again.
In the confirmation process of the space-time data, the first confirmation of the space-time data is the confirmation of the user node, the user node firstly formats the space-time data before the confirmation, abstracts the space-time data into a format of Ti= { key i, timei, spacei, < other attributes > }, carries out signature confirmation on the processed space-time data, adds signature information into the processed space-time data, namely Ti= { key i, spacei, locali, < other attributes >, < signs > }, and distributes the space-time data added with the signature information into a block chain network. The secondary confirmation of the space-time data is that when the super auxiliary node collects the space-time data in the process of generating the new block, the super auxiliary node performs secondary confirmation of the space-time data by verifying the correctness of the signature information, and stores the verified correct data in a buffer area in a space-time data pool.
In the blockchain network shown in fig. 1, firstly, user nodes perform formatting processing on generated spatiotemporal data, perform signature confirmation on the processed spatiotemporal data, and issue the spatiotemporal data into the blockchain network after the signature confirmation. And finally, the data are collected by the auxiliary nodes and stored in a buffer zone in the space-time data pool.
(2) Space-time data acquisition: in the constructed blockchain network, the consensus node is responsible for updating the blockchain data, i.e., generating new blocks. And when the consensus node constructs a new block, sending a request for acquiring space-time data to the super auxiliary node according to the locally stored routing information of the super auxiliary node. When the super auxiliary node receives the request of the consensus node, the request is added into a waiting queue first, the state of a space-time data buffer area is checked, whether the buffer area which is not empty exists is checked, if the buffer area which is not empty exists, all the consensus nodes enter the waiting state, space-time data is acquired after the buffer area is filled, and if the buffer area exists, the super auxiliary node sequentially sends the space-time data in the buffer area and the buffer area number to the consensus node according to the request sequence in the request queue. And after receiving the message of the consensus node, the common auxiliary node updates the data of the buffer area in the local space-time data pool and agrees with the data in the buffer area with other auxiliary nodes.
(3) Index construction based on quadtree and singly linked list: the space-time data is data with time dimension and space dimension, the support degree of the storage structure in the traditional bit coin and Ethernet block chain for space-time data query is limited, only query based on transaction hash value is supported, multi-attribute query of the space-time data cannot be realized, and daily requirements of users are difficult to meet. For this purpose, an index structure F-Ltree (four-link Tree) based on a quadtree and a singly linked list is proposed inside the blockchain.
In the index construction process, when the consensus node receives a space-time data set T= { T1, T2, T3, …, tn, … } returned by the super auxiliary node, a time range [ tstart, tend ] corresponding to the data set T and a space range [ sstart, send ] corresponding to a GeoHash value are calculated. In the construction process of the F-L tree, a root node is firstly established, and the root node covers the time range and the space range of the data set T. As shown in fig. 3, the time range of the data set T is [1-100], the space range is [1,200], and after the root node is established, the whole space-time range is divided twice according to the time range median tmid and the space range median smid. Each sub-region corresponds to a sub-node of the root node. And numbering the child nodes according to the time and space ranges represented by the child nodes. The time dimension is greater than tmid number 1, whereas 0, and the space dimension is greater than smid number 1, whereas 0. The four child nodes are numbered 00, 01, 10 and 11 in sequence. And sub-node areas are divided secondarily according to the concentration degree of space-time data in each sub-node area. For example, if the division of the subregion with the number 10 is continued, the subregions with the numbers 1000, 1001, 1010, 1011 may be continued to be divided into new subregions if necessary, so as to form new subregions. And (3) until the space-time data quantity in each sub-area is lower than a threshold k, storing the space-time data of each sub-node by using a linked list structure, wherein the threshold k is the maximum length of the linked list of the sub-nodes, and continuously repeating the process to finally construct F-Ltree.
(4) Space-time data single value query: to support spatio-temporal data querying, when a block is created, the temporal and spatial ranges covered by the spatio-temporal data stored by the block, i.e., [ tstart, tend ] and [ sstart, send ], are added to the block header. When the user node needs to inquire the space-time data, firstly, a query request is sent to the whole node, after the whole node receives the query request of the user, the query conditions tquery and squery in the query request are read, and the whole node starts to inquire from the latest unreferenced block according to the breadth-first search algorithm. For each unreferenced block, it is first determined tquery whether it is within the [ tstart, tend ] range and squery whether it is within the [ sstart, send ] range, if so, the block is added to the candidate set, otherwise, the forward block is continued to be retrieved until the spatiotemporal range in all block headers does not satisfy query conditions tquery and squery. And finally, searching the F-Ltree in the candidate block set for space-time data meeting the requirements and returning a query result.
FIG. 2 is a block chain network architecture after construction, the topology of which is Directed Acyclic Graph (DAG).
(5) Space-time data range query: the range query pattern is query= { [ tquery, tquery2], [ squery1, squery2] }, where [ tquery1, tquery ] is the time range to be queried and [ squery1, squery2] is the spatial range to be queried. In the query process, the full node first judges whether the space-time range in the latest unreferenced block head has intersection with the space-time range of the query condition, if so, the block is added into the candidate block set, and if not, the forward block is continuously searched until the space-time range in all the block heads has no intersection with the query condition. And finally, searching space-time data meeting the requirements of F-L tree searching in the candidate block set and returning a searching result.
The method is mainly tested from 3 aspects, is named ST_Block-DAG in experiments, has comparison structures STBitcoin and STEth, and adopts a traversing query mode in terms of data query, STBitcoin and STEth, and has equivalent query efficiency, so that only STBitcoin is selected as a comparison experiment when the query efficiency is compared, and the following steps are respectively described:
(1) Comparing the space-time data processing efficiency: the space-time data-oriented block chain construction and query method is compared with other architectures in space-time data processing efficiency by changing the amount of space-time data to be processed. Fig. 4 illustrates the time consumption from data generation to data processing to data chaining for three different configurations of spatio-temporal data for different amounts of data. As can be seen from the analysis, the processing time of the three materials has a trend of increasing with the increase of the amount of the space-time data to be processed. However, the st_block-DAG increases less, STBitcoin increases most, STEth increases between the two. This is due to the unique memory structure of the DAG, which allows the consensus nodes to go out of blocks in parallel, thereby greatly increasing the speed of spatio-temporal data chaining. However, STBitcon and STEth are configured as single-chain structures, which can only generate blocks in sequence, and the cumbersome acknowledgement mechanism of STBitcoin further increases the time for processing the spatiotemporal data of STBitcoin.
(2) Comparing the single block query efficiency: by varying the amount of spatio-temporal data within a single Block, the query efficiency of st_block-DAG and STBitcoin is compared. The query mode is divided into single-block single-value query and single-block range query.
FIG. 5 shows the trend of the single value query time of the spatiotemporal data under a single block with the transaction amount in the block. It can be seen that as the amount of transactions in a Block increases, both query times show a linear trend, but the st_block-DAG has a smaller increase in query efficiency. As shown by analysis experiment results, only one query path in the F-L tree needs to be traversed for single-Block single-value query ST_Block-DGA, and the complexity is lower than O (logn+k), wherein k is the length of a linked list in a leaf node, and k is far smaller than n. For STBitcoin, the query mode is a traversal query, and the time complexity is O (n).
FIG. 6 shows the range query time of spatiotemporal data under a single block as a function of the amount of transactions within the block. Where the spatiotemporal data to be queried ranges from 10. In fig. 8, both query times still show increasing trends with increasing intra-Block transaction amounts and the increase magnitude of st_block-DAG is greater than that of single-Block single-value queries, but still less than STBitcoin. Analysis of experimental results shows that the range query may traverse multiple query paths when traversing the F-L tree according to the query conditions, and the query complexity is O (ilogn +ik) < O (n), i the number of query paths. While for STBitcoin-range queries, a sequential traversal approach is still adopted, with a temporal complexity of O (n) still.
(3) Comparing the multi-block query efficiency: the amount of spatio-temporal data in each Block is fixed, and the query efficiency of ST_Block-DAG and STBitcoin is compared by changing the number of blocks to be queried. The query mode is divided into multi-block single-value query and multi-block range query.
Fig. 7 shows the trend of the multi-Block spatio-temporal data single-value query time with the number of blocks, and it can be seen that the query time of both of them shows an increasing trend with the increase of the number of blocks, but the increase of st_block-DAG is smaller. Analysis of the experimental results shows that the increasing trend of st_block-DAG is lower than STBitcoin, because STBitcoin adopts a linear traversal mode, if the number of blocks to be queried is n, the time complexity of each query is O (n), and the overall query time complexity is O (n 2). For st_block-DAG, the time complexity of each query is O (logn+k), and the overall query time complexity is O (nlogn+nk) < O (n 2).
Fig. 8 shows the trend of the query time of the multi-Block spatio-temporal data range over the number of blocks, it can be seen that as the number of blocks increases, both the query time showed an increasing trend, the increase of st_block-DAG compared to the multi-Block single value query was greater, and the trend of STBitcoin was the same as that of the multi-Block single value query. Analysis of the experimental results shows that the overall time complexity for the multi-block range query STBitcoin is still the same as for the multi-block single-value query, O (n 2). For st_block-DAG, the time complexity of each query is O (ilogn +ik), i is the number of query paths, and the overall time complexity is O (inlogn +ink).

Claims (2)

1. A block chain architecture and range query processing method facing to space-time data is characterized by comprising the following steps:
step1: dividing node categories according to the role of the nodes in the blockchain network;
the node categories are as follows:
User node: for generating spatiotemporal data;
Auxiliary node: the system comprises a buffer area, a buffer area and a data storage unit, wherein the buffer area is used for storing space-time data issued by a user node into a block chain network;
Consensus node: for storing the generated spatiotemporal data into a blockchain; when a new block is constructed, the consensus node sends a data acquisition request to the auxiliary node, and the space-time data is stored in a block chain after being acquired from the auxiliary node;
full node: the method comprises the steps of storing complete data copies of a space-time data block chain, responding to a query request of a user node, and returning space-time data meeting query conditions to the user node;
The auxiliary nodes comprise super auxiliary nodes and common auxiliary nodes;
The super auxiliary node: is responsible for data interaction with the consensus node and the user node; in one aspect, spatio-temporal data published by a user node into a blockchain network is collected and stored into a buffer of a spatio-temporal data pool; on the other hand, responding to the request of the consensus node, and returning the space-time data in the buffer area in the space-time data pool to the consensus node;
the common auxiliary node: the data synchronization method is used for maintaining the space-time data pool, and is used for ensuring the consistency of the data states in the space-time data pool by performing data synchronization communication between the common auxiliary node and other auxiliary nodes after the data in the space-time data pool is changed;
Step 2: processing and signature confirmation are carried out on the generated space-time data, namely the user nodes, then the space-time data is issued into a block chain network and is further processed by the nodes in the block chain network;
Step 3: acquiring space-time data from a block chain network, storing the space-time data in a block based on a quadtree and a single-chain table storage structure when the data quantity reaches a certain peak value range (1M-2M), introducing the time range and the space range of the stored space-time data into a block head, and then storing the block into a block chain through the reference of a plurality of forward blocks;
in the step3, the specific steps are as follows:
step 3.1: the consensus node communicates with the super auxiliary node according to the locally stored route information, and sends a request for acquiring space-time data to the super auxiliary node;
Step 3.2: after receiving the request of the consensus node, the super auxiliary node firstly adds the request into a request queue, then the super auxiliary node checks a buffer area in a space-time data pool to see whether the buffer area which is not empty exists, if so, the space-time data in the buffer area is sent to the consensus node according to the sequence of the request queue, otherwise, the super auxiliary node enters a waiting state until the space-time data in the buffer area is not empty;
step 3.3: after receiving the space-time data returned by the super auxiliary node, the consensus node stores the space-time data in a block based on a quadtree and a single-chain table storage structure according to the time and space dimensions of the space-time data, and introduces the time range and the space range of the stored data into the block head for facilitating the space-time data query;
Step 3.4: after random numbers meeting requirements are found by the consensus node through a low-difficulty POW algorithm, the consensus node stores newly generated blocks into a blockchain through references to a plurality of forward blocks, so that a Directed Acyclic Graph (DAG) topological structure is formed by the whole blockchain network; then the consensus node broadcasts the new block to the whole network, and other consensus nodes and the whole node update the local block chain data according to the broadcast message;
Step 4: giving out the time and space dimension range of the space-time data to be inquired, carrying out range inquiry of the space-time data in the constructed block chain by utilizing the space-time range stored in the block head, and returning an inquiry result;
in the step 4, the specific steps are as follows:
step 4.1: the full node receives a space-time data query request sent by a user node, and obtains a query condition corresponding to the query request;
Step 4.2: the full node searches blocks in a local stored space-time data block chain from the latest block according to the query condition in the query request, and finds out the blocks which are stored in the block head and have the space-time range meeting the query condition as candidate blocks; after the candidate block set is obtained, the full nodes sequentially search the space-time data stored in the candidate blocks, find out the space-time data meeting the query conditions from the space-time data and put the space-time data into a result set;
step 4.3: after the candidate block is searched, the full node returns the data in the result set to the user node according to the query path;
In said step 4.1, the user's query request is divided into the following cases:
Case 1: the query condition corresponding to the query request of the user is single-value query on the space-time data, namely, the space-time data with the query time dimension of t and the space dimension of s;
Case 2: the query conditions corresponding to the query request of the user are range query of space-time data, the range query is divided into three types, namely, the space-time data with the query time dimension within [ t1, t2] and the space dimension of s is queried; secondly, querying space-time data with time dimension t and space dimension within s1 and s 2; finally, inquiring space-time data with the time dimension within [ t1, t2] and the space dimension within [ s1, s2 ];
In the step 4.2, the specific steps are as follows:
step 4.2.1: if the query condition corresponding to the query request of the user is in the state 1; the full node starts to inquire from the latest block in the local stored space-time data block chain complete data copy, and the inquiry algorithm is a breadth-first traversal algorithm of the graph; in the inquiring process, firstly judging whether the time dimension t and the space dimension s to be inquired by a user are in a space-time range [ tstart, tend ] and [ sstart, send ] stored in a block head, if so, adding the current block into a candidate block set, otherwise, skipping the current block and continuing to traverse forwards; stopping breadth-first traversal algorithm when the created block is reached or the query condition is not within the space-time range in the block head;
Step 4.2.2: traversing a quadtree and singly linked list based storage structure (F-L tree) in the candidate block; firstly, judging the relation between query conditions t and s of a user and a time dimension median tmid and a space dimension median smid stored in a block head; if t < tmid, s < smid, searching the subtree with the F-L tree number of 00; if t < tmid, s > smid, searching the subtree with the F-L tree number of 01; if t > tmid, s < smid, searching the subtree with the F-L tree number of 10; if t > tmid, s > smid, searching the subtree with the F-L tree number of 11; until the node is a leaf node, adding the data meeting the query condition in the node into the result set;
Step 4.2.3: if the query condition corresponding to the query request of the user is case 2, taking the last one in case 2 as an example, the full node starts to query from the latest block in the local stored space-time data block chain complete data copy, and the query algorithm is a breadth-first traversal algorithm of the graph; in the inquiring process, firstly judging whether the time range [ t1, t2] and the space range [ s1, s2] of the user inquiry are intersected with the space-time ranges [ tstart, tend ] and [ sstart, send ] stored in the block head, if the intersection exists, adding the current block into the candidate block set, otherwise, skipping the current block and continuing to traverse forwards; stopping breadth-first traversal algorithm when the time-space range in the block head of the created block or all blocks has no intersection with the query condition;
Step 4.2.4: traversing a storage structure (F-L tree) based on a quadtree and a single linked list in a candidate block, judging which branch of the F-L tree needs to be traversed according to the relation between query conditions [ t1, t2], [ s1, s2] of a user and time dimension median tmid and space dimension median smid stored in the block head of the candidate block in the traversing process until the branch is traversed to a leaf node of the F-L tree, and adding space-time data meeting the query conditions of the user in the node into a result set.
2. The method for processing the block chain architecture and the range query for the spatio-temporal data according to claim 1, wherein in the step2, the specific steps are as follows:
Firstly, after the user node generates the space-time data, formatting the space-time data by the user node, and processing the space-time data into data with the format of { keyi, timei, spacei, < other attributes >, < signs > }; secondly, the user node carries out signature confirmation on the processed space-time data and issues the space-time data after signature confirmation to a block chain network, wherein < signs > is signature information of the user; finally, the auxiliary node collects the space-time data issued by the user node to the blockchain network, performs validity check on the signature information by utilizing the public key of the signature party, and stores the checked space-time data in a buffer zone in a space-time data pool in sequence according to the time sequence of the checked space-time data, wherein the space-time data with illegal signature information is discarded.
CN202111190860.2A 2021-10-13 2021-10-13 Space-time data-oriented block chain architecture and range query processing method Active CN113901142B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111190860.2A CN113901142B (en) 2021-10-13 2021-10-13 Space-time data-oriented block chain architecture and range query processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111190860.2A CN113901142B (en) 2021-10-13 2021-10-13 Space-time data-oriented block chain architecture and range query processing method

Publications (2)

Publication Number Publication Date
CN113901142A CN113901142A (en) 2022-01-07
CN113901142B true CN113901142B (en) 2024-05-07

Family

ID=79191621

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111190860.2A Active CN113901142B (en) 2021-10-13 2021-10-13 Space-time data-oriented block chain architecture and range query processing method

Country Status (1)

Country Link
CN (1) CN113901142B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108595720A (en) * 2018-07-12 2018-09-28 中国科学院深圳先进技术研究院 A kind of block chain spatiotemporal data warehouse method, system and electronic equipment
CN109885615A (en) * 2019-01-24 2019-06-14 华东师范大学 A kind of range query towards the light client of block chain based on index can verify that querying method
WO2020062211A1 (en) * 2018-09-30 2020-04-02 北京大学深圳研究生院 Method and system for mimicry storage tamper-proof log fused with blockchain technology
CN111757111A (en) * 2020-06-29 2020-10-09 北京百度网讯科技有限公司 Video encoding method, apparatus, device and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11507569B2 (en) * 2019-05-20 2022-11-22 Chia Network Inc. Methods for extending a proof-of-space-time blockchain

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108595720A (en) * 2018-07-12 2018-09-28 中国科学院深圳先进技术研究院 A kind of block chain spatiotemporal data warehouse method, system and electronic equipment
WO2020062211A1 (en) * 2018-09-30 2020-04-02 北京大学深圳研究生院 Method and system for mimicry storage tamper-proof log fused with blockchain technology
CN109885615A (en) * 2019-01-24 2019-06-14 华东师范大学 A kind of range query towards the light client of block chain based on index can verify that querying method
CN111757111A (en) * 2020-06-29 2020-10-09 北京百度网讯科技有限公司 Video encoding method, apparatus, device and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
面向时空数据的区块链构建及查询方法;华亚洲;《计算机应用》;20221130;第1-9页 *
面向时空数据的区块链研究综述;傅易文晋;《计算机工程》;20200331;第46卷(第3期);第1-10页 *

Also Published As

Publication number Publication date
CN113901142A (en) 2022-01-07

Similar Documents

Publication Publication Date Title
US7260572B2 (en) Method of processing query about XML data using APEX
Ding et al. Efficient and progressive algorithms for distributed skyline queries over uncertain data
Deshpande et al. Cache-and-query for wide area sensor databases
Chen et al. Constrained skyline query processing against distributed data sites
CN102929936B (en) Log recording method, log inquiring method and system
Chan et al. Re-tree: an efficient index structure for regular expressions
CN102122285A (en) Data cache system and data inquiry method
CN106294772A (en) The buffer memory management method of distributed memory columnar database
Kawaguchi et al. Implementing incremental view maintenance in nested data models
CN109947796A (en) A kind of caching method of distributed data base system inquiry intermediate result set
CN102270232A (en) Semantic data query system with optimized storage
Pei et al. An efficient query scheme for hybrid storage blockchains based on merkle semantic trie
Min et al. Symmetric continuous subgraph matching with bidirectional dynamic programming
Peng et al. Efficient hop-constrained st simple path enumeration
CN113901142B (en) Space-time data-oriented block chain architecture and range query processing method
CN109857924A (en) A kind of big data analysis monitor information processing system and method
CN114020737A (en) Efficient and reliable indexing method for block chain data
Li et al. Accelerating sequence event detection through condensed composition
Bou et al. Scalable keyword search over relational data streams by aggressive candidate network consolidation
Semertzidis et al. A hybrid approach to temporal pattern matching
Wei et al. Towards the efficient discovery of meaningful functional dependencies
Flouris et al. Issues in complex event processing systems
Gao et al. Holistic top-k simple shortest path join in graphs
CN102043866B (en) Relaxation search and optimization sequencing method based on form characteristic
Subha P-tree oriented association rule mining of multiple data sources

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant