《计算机应用》唯一官方网站 ›› 2025, Vol. 45 ›› Issue (11): 3446-3452.DOI: 10.11772/j.issn.1001-9081.2024121836

• 第七届CCF中国区块链技术大会 • 上一篇    

基于一致性哈希的区块链存储优化策略

刘明灏, 洪建磊, 王成翔, 赵金东()   

  1. 烟台大学 计算机与控制工程学院,山东 烟台 264005
  • 收稿日期:2024-12-31 修回日期:2025-02-05 接受日期:2025-02-11 发布日期:2025-03-21 出版日期:2025-11-10
  • 通讯作者: 赵金东
  • 作者简介:刘明灏(1998—),男,山东枣庄人,硕士研究生,主要研究方向:区块链存储扩展
    洪建磊(2000—),男,安徽池州人,硕士研究生,主要研究方向:区块链、预言机
    王成翔(1998—),男,山东济南人,硕士研究生,主要研究方向:区块链安全

Blockchain storage optimization strategy based on consistent hashing

Minghao LIU, Jianlei HONG, Chengxiang WANG, Jindong ZHAO()   

  1. College of Computer and Control Engineering,Yantai University,Yantai Shandong 264005,China
  • Received:2024-12-31 Revised:2025-02-05 Accepted:2025-02-11 Online:2025-03-21 Published:2025-11-10
  • Contact: Jindong ZHAO
  • About author:LIU Minghao, born in 1998, M. S. candidate. His research interests include blockchain storage expansion.
    HONG Jianlei, born in 2000, M. S. candidate. His research interests include blockchain, oracle.
    WANG Chengxiang, born in 1998, M. S. candidate. His research interests include blockchain security.

摘要:

为了解决区块链数据量剧增带来的存储问题,提出一种改进的一致性哈希算法,以实现区块链的存储扩展。针对Hyperledger Fabric在企业级应用中节点存储负载不均和数据倾斜的问题,基于一致性哈希算法提出了改进方案——基于虚拟节点分配与动态权重策略的哈希算法(VNDWS)。首先,采用虚拟节点分配机制为每个节点动态分配多个虚拟节点,使数据在哈希环中均匀分布,减少负载不均;其次,应用动态权重机制,基于节点存储能力和网络延迟等性能指标实时调整权重,使高性能节点承担更多数据负载,从而优化数据分配和存储效率。仿真实验结果表明,与传统区块链Fabric网络和传统一致性哈希算法相比,VNDWS的节点存储消耗分别降低了48.31和6.39个百分点,而数据查询效率分别提升了96.25%和21.95%。VNDWS在存储扩展方面能有效降低节点存储消耗并提高查询效率。

关键词: 区块链, 存储扩展, 一致性哈希, 虚拟节点, 动态权重

Abstract:

In order to solve the storage challenges caused by the rapid growth of blockchain data, an improved consistent hashing algorithm was proposed to achieve blockchain storage expansion. To address the issues of uneven storage load and data skew of nodes in Hyperledger Fabric for enterprise-level applications, an improved solution based on consistent hashing algorithm was proposed, namely Hash algorithm based on Virtual Node allocation and Dynamic Weight Strategy (VNDWS). Firstly, a virtual node allocation mechanism was adopted to dynamically assign multiple virtual nodes to each physical node, ensuring an even distribution of data across the hashing ring and reducing load imbalance. Secondly, a dynamic weight mechanism was applied to adjust weights in real-time based on performance indicators such as node storage capacity and network latency, enabling high-performance nodes to handle larger data load, and thereby optimizing data distribution and storage efficiency. Simulation experimental results showed that compared to the traditional blockchain Fabric network and the conventional consistent hashing algorithm, VNDWS reduced node storage consumption by 48.31 and 6.39 percentage points, respectively, while improving data query efficiency by 96.25% and 21.95%. VNDWS effectively reduces node storage consumption and enhances query efficiency in terms of storage expansion.

Key words: blockchain, storage expansion, consistent hashing, virtual node, dynamic weight

中图分类号: