Data Storage and Query of Blockchain
Glossary
Term Definition Blockchain Node A node that runs software in a blockchain network to support the functions of the blockchain network. Blockchain nodes can be any device connected to the Internet, such as computers, laptops, mobile phones, and servers. Service Request A request sent by a user to a blockchain node, such as a query request, a request to create a smart contract, a request to execute a smart contract, an information request, a request to transfer cryptocurrency, etc. Data Type The category or attribute of the data in a service request, such as name, age, product name, price, etc. Service Data The data value corresponding to the data type, such as name: Zhang San, age: 20, product name: shoes, price: 100 yuan, etc. Smart Contract A program running on a blockchain that defines and executes predetermined rules and protocols. Consensus Network A network consisting of multiple blockchain nodes that participate in the consensus process of a blockchain system. Relational Database A database that organizes data in a tabular form and can be queried and managed using Structured Query Language (SQL). Data Sequence A data string obtained by serializing the data in a service request according to a predefined data format. Mapping Relationship The correspondence between data types and service data. Short Answer Questions
How does a blockchain node process received service requests?
The blockchain node will first parse the service request according to the predefined data format to obtain the data type and service data. Then, according to the mapping relationship between the data type and the service data, the service data will be stored in the corresponding relational database.
Why should service data be stored in a relational database?
Storing service data in a relational database can improve the efficiency and flexibility of data query. Relational databases support structured query language (SQL), and users can use various conditions to query data without being restricted by predefined indexes.
What is a data sequence and what does it do?
A data sequence is a data string obtained by serializing the data in the service request according to a predefined data format. The blockchain node will store the data sequence in the blockchain for subsequent service data verification.
What is a service type and what role does it play in the data storage process?
A service type is a category or identifier of a service request, such as commodity purchase, identity authentication, data query, etc. Blockchain nodes can create corresponding relational databases or data tables according to the service type to store and manage different types of service data.
What is a mapping relationship and what role does it play in the data query process?
A mapping relationship is the corresponding relationship between data types and service data. Users can quickly locate and query the corresponding service data from a relational database by specifying the data type or using the data type as a query condition.
Compared with the traditional index-based blockchain data query method, what are the advantages of the present invention?
The present invention does not need to rely on predefined indexes for data query, and users can use various conditions for data query, which improves the efficiency and flexibility of data query.
How does the blockchain node ensure the security of service data?
The blockchain node will store the hash value of the service request in the blockchain for subsequent service data verification. Any tampering with the service data will cause the hash value to mismatch and thus be detected.
What scenarios can the present invention be applied to?
The present invention can be applied to various scenarios that require data storage and query, such as supply chain management, identity authentication, Internet of Things, digital rights management, etc.
What is the "predefined data format" mentioned in the present invention?
The predefined data format refers to the data structure used by the blockchain node to parse service requests and generate data sequences, such as JSON, XML, etc.
What is the "consensus process" mentioned in the present invention?
The consensus process refers to the process by which multiple blockchain nodes reach a consensus on the validity of blockchain data. Only blockchain data that has been verified by the consensus process will be added to the blockchain.