## 5 Spatio-Temporal Big Data Collaborative Storage Mechanism
### Overview of On-Chain and Off-Chain Collaborative Storage System  
The system model diagram of this solution is shown in Figure 1. It is mainly segmented into six layers, including the storage layer, data layer, network layer, consensus layer, contract layer, and application layer. Their specific introduction is as follows:  
Storage Layer: Responsible for storing data securely and persistently in the network. This layer is implemented through distributed ledger technology, which encrypts transaction data and stores it decentralized on multiple nodes throughout the network. This decentralized storage increases the security and tamper-resistance of the data because to alter the information stored on the blockchain, it is necessary to change, the data on most of the nodes within the network simultaneously, which is almost impractical to achieve in practice. The storage layer is the foundation of the core architecture of blockchain technology, ensuring the tamper-proof and permanently recorded nature of the entire system'sdata. In addition to the storage of blockchain nodes, this paper also incorporates blockchain off-chain storage into the storage layer to enhance the scalability of the blockchain. Data Layer: The blockchain constitutes a chain-like data structure consisting of a series of connected blocks, each of which internally records the hash value and transaction details of the previous block. The block header carries meta-information such as version numbers, timestamps, random numbers, and the Merkle tree root hash of the transaction. Using the Merkle tree structure, it is possible to efficiently confirm whether a transaction is present within a block. Network Layer: The network layer is a collection of technologies and protocols that ensure effective communication and data synchronization between blockchain nodes. It covers the discovery and connection mechanisms of nodes, routing protocols, and network topology to ensure that information can be transmitted securely and efficiently in a decentralized environment. Nodes, as the basic units of the network, find optimal paths to exchange blocks and transaction data through specific routing protocols, while the topology of the network ensures the network's resilience and scalability. In addition, the network layer supports the implementation of a distributed storage network, which increases redundancy and improves data security and availability by decentralizing data storage on multiple nodes. Consensus Layer: Blockchain consensus mechanism is the mechanism tasked with agreeing on a certain version of a transaction record (i.e., the state of the blockchain) among all participants in the network. The consensus layer ensures not only the consistency and immutability of data but also the safety and reliability of the decentralized network. The consensus layer uses different algorithms to achieve this goal, which include proof of work, proof of stake, delegated proof of stake, and Byzantine fault tolerance. Through the consensus mechanism, the blockchain network can ensure that all nodes agree on the correctness and order of data without a central authority. Contract Layer: The smart contract layer is the programming level that enables automatic enforcement of contract terms on blockchain technology. It is a critical component responsible for handling the creation, deployment, and execution of smart contracts. Smart contracts are automated programs running on the blockchain that can automatically execute predefined operations when predetermined conditions are met. Figure 1: Storage system architecture in on-chain and off-chain system. Application Layer: The application layer of the blockchain provides a direct interface for users to interact with and covers wallets, blockchain browsers, and decentralized applications (DApps).