摘 要
本文提出了一种分布式类似地球的模拟系统的设计,探讨了其具体原理与实现细节。在当今技术条件与硬件条件限制下,要创造一个真正意义上的虚拟世界尚且不太现实。但借助分布式与去中心化相关技术,假以合理的架构与设计,构建一个规模足够大、可负载用户足够多的近似的模拟系统,这是可以做到的。
通过在球体上均匀布点并据此划分出无数的多边形区块,以区块为单位进行曲面到平面投影,建立一个与现实比例尺能够大于100%的球体地图模型。从用户的角度看去,球体模型上无数个相对极小的区块都无限接近平面,这样就达到了“规模足够大”这一目标。然后通过建立一套可以延迟、并行、多起点地演算与加载的随机生成算法,将整个模型上所有地形数据等都藏在了随机算法中,解决了这个规模级别的数据量问题。并参考一些现有地球参数对其加以约束与修正,保证了这个模型足够大的同时也足够合理。
借助分布式的架构,搭建一个Peer-to-Peer网络,将系统的计算与存储压力分摊到这个去中心化的集群中,可以突破单机或中心化集群的瓶颈,使得系统有足够的能力来应对可预期的甚至理论上无限的用户量,这样就做到了“负载用户足够多”。另外,去中心化的架构使得系统难以预测与控制,需要假之以区块链共识与一些加密认证技术来防止重要数据的伪造与篡改,通过搭建区块链来维护重要的数据,参照ssh-rsa协议来加密隐私内容,保证了这个分布式的去中心化的系统能有秩序地运行。
在完成系统理论设计的同时,我也尝试基于Go语言实际完成了一个Demo,亲自验证了一些技术细节上的可行性,本文也会详细讨论这些,并针对一些技术难点,给出默认实现、讨论可能地方案。
关键词: 模拟现实,分布式系统,去中心化,区块链
Distributed Earthlike Simulation System
Abstract
This paper presents a design of a distributed Earth-like virtual system and discusses its specific principles and implementation details. Under the constraints of today's technical conditions and hardware conditions, it is not yet realistic to create a virtual world. However, with the help of distributed and decentralized related technologies and reasonable architecture and design, it is possible to build an analog system, which is large enough scale, able to load enough users, and strong enough scalability.
By evenly distribute points on the sphere and divide the countless polygon blocks according to them, and the projection of the surface to the plane in block units, a sphere map model with a realistic scale greater than 100% can be established. From the user's point of view, numerous relatively tiny blocks on the sphere model are infinitely close to the plane, thus achieving the goal of “large enough scale”. Then by setting up a stochastic generation algorithm that can delay, parallel, and multiple origin calculations and loads, hidden all the terrain data of the entire model in the random algorithm, the data volume problem of this scale level is solved. It is also constrained and modified with reference to some existing earth parameters to ensure that the model is sufficiently large and sufficient reasonable.
With a distributed architecture, a Peer-to-Peer network is built to distribute the computational and storage pressures of the system to this decentralized cluster. then it can break through the bottleneck of the stand-alone or centralized cluster, make the system have enough ability to deal with the expected and even theoretically unlimited number of users, so that achieved "a sufficient load of users". In addition, the decentralized architecture makes the system difficult to predict and control. It needs blockchain consensus and some encryption authentication technologies to prevent the forgery and tampering of important data. By building blockchains to maintain important data and encrypting the privacy content with reference to the ssh-rsa protocol, this distributed decentralized system is guaranteed to operate in an orderly manner.
While completing the system theory design, I also attempted to actually complete a demo based on the Go programming language and personally verified the feasibility of some technical details. This paper will also discuss these in detail, and for some technical difficulties, give some default implementation or discuss possible solutions.
Key Words: simulated reality, distributed system, decentralized, blockchain