In urban computing composed of various Internet of Things (IoT) devices, data collected from IoT as learning data for other IoT devices in a circular structure. Therefore, data are shared resources and crucial in urban computing. In particular, group communication is essential for effective data sharing and to updating software in an IoT system. However, changing the group key is imperative for data security in group communication whenever the group member changes. When the movement of IoTs is high, group key redistribution must be repeated because the group membership keeps changing. In changing and redistributing the group keys, overhead occurs, inevitably degrading system performance. In addition, since much data traffic generates in IoT devices' crowded areas, transmission delay and data loss could degrade system performance. Due to IoT's low power and low capacity characteristics, one-to-one communication is inefficient, requiring efficient group management and group key management. This work proposes a hierarchical blockchain-based group and group key management scheme to establish an efficient communication environment in urban computing. We adopted blockchains to track the movement and density of IoT and secure node authorization. Using the upper layer blockchain, the unmanned aerial vehicle (UAV) determines the movement and density of IoTs. Using the lower-layer blockchain, base stations (BSs) identify the IoT's movement of information in each group. We included only nodes determined to be safe in the group. Through the hierarchical blockchain, while protecting the IoT's privacy, we can record the information in the blockchain to determine the mobility of nodes and the node density of a group. We set several experimental environments, and analyzed the efficiency by simulating the addition of secondary gateways and group integration. As a result, we showed that our proposal establishes an efficient communication environment and reduces computational and communication overhead.INDEX TERMS group management, group key management, urban computing, internet of things, blockchain, unmanned aerial vehicle, data security, privacy