CN116248725A - Blockchain node sharding method for node collaborative storage in the Internet of Vehicles environment - Google Patents
Blockchain node sharding method for node collaborative storage in the Internet of Vehicles environment Download PDFInfo
- Publication number
- CN116248725A CN116248725A CN202310518821.3A CN202310518821A CN116248725A CN 116248725 A CN116248725 A CN 116248725A CN 202310518821 A CN202310518821 A CN 202310518821A CN 116248725 A CN116248725 A CN 116248725A
- Authority
- CN
- China
- Prior art keywords
- nodes
- node
- shard
- sharding
- committee
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 29
- 238000004891 communication Methods 0.000 claims abstract description 62
- 238000012790 confirmation Methods 0.000 claims abstract description 20
- 238000004364 calculation method Methods 0.000 claims description 12
- 230000015572 biosynthetic process Effects 0.000 claims description 4
- 238000005192 partition Methods 0.000 claims description 3
- 238000013467 fragmentation Methods 0.000 abstract description 3
- 238000006062 fragmentation reaction Methods 0.000 abstract description 3
- 238000000638 solvent extraction Methods 0.000 abstract 1
- 238000005516 engineering process Methods 0.000 description 9
- 230000001934 delay Effects 0.000 description 7
- 238000012795 verification Methods 0.000 description 7
- 238000005457 optimization Methods 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 230000002068 genetic effect Effects 0.000 description 2
- 230000001965 increasing effect Effects 0.000 description 2
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 1
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 1
- 206010039203 Road traffic accident Diseases 0.000 description 1
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 1
- 125000002015 acyclic group Chemical group 0.000 description 1
- 238000013523 data management Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000005265 energy consumption Methods 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 239000002360 explosive Substances 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/30—Decision processes by autonomous network management units using voting and bidding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3247—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T10/00—Road transport of goods or passengers
- Y02T10/10—Internal combustion engine [ICE] based vehicles
- Y02T10/40—Engine management systems
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
技术领域Technical Field
本申请涉及物联网技术领域,特别是涉及一种车联网环境中面向节点协作存储的区块链节点分片方法。The present application relates to the field of Internet of Things technology, and in particular to a blockchain node sharding method for node collaborative storage in an Internet of Vehicles environment.
背景技术Background Art
随着物联网的发展,车联网逐渐成为技术和产业上的重要应用。车联网(Internetof Vehicles, IoV)是人、车、路之间进行无线通信和信息交换的大型综合网络。车联网可以显著提高交通效率,减少能源消耗,减少交通事故。通常,车联网由智能车辆、路边单元(RoadSide Units,RSU)、可信机构(Trusted Authority,TA)以及数据中心(Data Center,DC)组成, RSU通常是固定在路边的道路基础设施,TA通常是受信任的服务器,DC用于存储所有车联网相关的信息。当车辆进入RSU的通信范围时,它将通过专用近距离通信协议通过无线通道自动与RSU通信。有线通道通常用于每个TA之间以及TA和DC之间。车辆通过RSU与TA建立连接后,可以向TA上传自己的位置、车辆状态等信息,也可以从TA接收交通信息等信息,规划自己的行驶路线。With the development of the Internet of Things, the Internet of Vehicles has gradually become an important application in technology and industry. The Internet of Vehicles (IoV) is a large-scale integrated network for wireless communication and information exchange between people, vehicles and roads. The Internet of Vehicles can significantly improve traffic efficiency, reduce energy consumption and reduce traffic accidents. Usually, the Internet of Vehicles consists of smart vehicles, roadside units (RSU), trusted authorities (TA) and data centers (DC). RSU is usually a road infrastructure fixed on the roadside, TA is usually a trusted server, and DC is used to store all information related to the Internet of Vehicles. When a vehicle enters the communication range of the RSU, it will automatically communicate with the RSU through a wireless channel using a dedicated short-range communication protocol. Wired channels are usually used between each TA and between TA and DC. After the vehicle establishes a connection with the TA through the RSU, it can upload its location, vehicle status and other information to the TA, and can also receive information such as traffic information from the TA to plan its own driving route.
在车联网中,移动车辆会不断产生大量不同类型的数据,车辆之间的数据共享对于提高驾驶安全与增强车载服务起着至关重要的作用,但在数据共享中,容易造成数据安全和隐私信息泄露等问题。基于上述问题,将区块链技术与车联网结合,可以利用利用区块链去中心化、区块链匿名性、不可篡改和可追溯性的技术特征,确保了数据共享的隐私性、安全性和完整性,利用区块链中的加密算法形成有效的访问控制,能有效解决未经授权访问车辆间共享数据的问题,借助区块链的智能合约技术,车辆可以依据自身资源状态和共享数据特征,自适应地定制合适的共享规则,真正实现用户自治的数据共享,减轻车联网中用户数据管理压力。然而,由于车联网设备(RSU等)的资源受限(如存储空间有限)、车联网中区块链的可扩展性差、吞吐量低等问题,限制了区块链在车联网中的应用。此外,由于5G移动通信的逐渐普及和车联网设备数量的爆炸性增长,迫切地需要提高区块链系统的可扩展性和吞吐量。In the Internet of Vehicles, mobile vehicles will continuously generate a large amount of different types of data. Data sharing between vehicles plays a vital role in improving driving safety and enhancing in-vehicle services. However, in data sharing, it is easy to cause problems such as data security and privacy information leakage. Based on the above problems, the combination of blockchain technology and the Internet of Vehicles can utilize the technical characteristics of blockchain decentralization, blockchain anonymity, immutability and traceability to ensure the privacy, security and integrity of data sharing. The encryption algorithm in the blockchain is used to form an effective access control, which can effectively solve the problem of unauthorized access to shared data between vehicles. With the help of blockchain's smart contract technology, vehicles can adaptively customize appropriate sharing rules based on their own resource status and shared data characteristics, truly realize user-autonomous data sharing, and reduce the pressure of user data management in the Internet of Vehicles. However, due to the limited resources of Internet of Vehicles devices (RSU, etc.) (such as limited storage space), poor scalability of blockchain in the Internet of Vehicles, and low throughput, the application of blockchain in the Internet of Vehicles is limited. In addition, due to the gradual popularization of 5G mobile communications and the explosive growth of the number of Internet of Vehicles devices, there is an urgent need to improve the scalability and throughput of blockchain systems.
解决区块链可扩展性的方案一般分为三类:侧链、分片和有向无环图,其中,分片技术是一项很有前途的解决方案。分片技术分为三种类型:节点分片,交易分片以及状态分片。其中,节点分片是将传统的区块链中的节点划分成很多小的分片,每个分片并行处理提交给区块链的交易,以此来提高区块链系统的可扩展性。每个分片可以视为一个小型的区块链,每个分片内部的节点独立地验证本分片内的交易,分片内所有节点达成共识后将交易打包成微区块。每个分片都会产生微区块,由目录委员会收集所有的微区块并进行验证,最终生成一个完整的区块提交给区块链。因此,理论上区块链的交易吞吐量能够得到数倍的提高。Solutions to blockchain scalability are generally divided into three categories: sidechains, sharding, and directed acyclic graphs. Among them, sharding technology is a very promising solution. Sharding technology is divided into three types: node sharding, transaction sharding, and state sharding. Among them, node sharding is to divide the nodes in the traditional blockchain into many small shards, and each shard processes the transactions submitted to the blockchain in parallel, so as to improve the scalability of the blockchain system. Each shard can be regarded as a small blockchain. The nodes within each shard independently verify the transactions within the shard. After all nodes in the shard reach a consensus, the transactions are packaged into micro-blocks. Each shard will generate micro-blocks, and the directory committee will collect all micro-blocks and verify them, and finally generate a complete block and submit it to the blockchain. Therefore, in theory, the transaction throughput of the blockchain can be increased several times.
相关技术中,虽然分片技术可以提高区块链系统的可扩展性,但在车联网中使用区块链分片技术,采用节点随机划分的分片方案,容易导致恶意节点聚集到同一分片的问题,从而影响分片安全性,为了解决分片安全性问题,提出了基于信任值的分片模型,利用声誉来刻画节点之间的异质性,可以提高分片的安全性,但是却忽略了分片内各节点间的通信延迟问题。In related technologies, although sharding technology can improve the scalability of blockchain systems, the use of blockchain sharding technology in the Internet of Vehicles adopts a sharding scheme with random node division, which easily leads to the problem of malicious nodes gathering in the same shard, thereby affecting the security of the shard. In order to solve the problem of sharding security, a sharding model based on trust value is proposed, which uses reputation to characterize the heterogeneity between nodes, which can improve the security of sharding, but ignores the problem of communication delay between nodes in the shard.
因此,目前的区块链节点分片方法的各节点间的通信延迟较高。Therefore, the communication delay between nodes in the current blockchain node sharding method is relatively high.
发明内容Summary of the invention
基于此,有必要针对上述技术问题,提供一种能够降低各节点间的通信延迟的车联网环境中面向节点协作存储的区块链节点分片方法。Based on this, it is necessary to provide a blockchain node sharding method for node collaborative storage in the Internet of Vehicles environment, which can reduce the communication delay between nodes in response to the above technical problems.
一种车联网环境中面向节点协作存储的区块链节点分片方法,所述方法包括:A blockchain node sharding method for node collaborative storage in an Internet of Vehicles environment, the method comprising:
区块链系统中的所有节点对工作量证明难题进行求解,最先解决工作量证明难题的前h个节点确定为目录委员会中的各成员节点;All nodes in the blockchain system solve the proof-of-work problem, and the first h nodes that solve the proof-of-work problem are determined as member nodes of the directory committee;
随机从各所述成员节点中选出目录委员会的领导节点;Randomly select a leader node of the directory committee from each of the member nodes;
各所述成员节点各自运行NSGA-II算法,得到各所述成员节点的最佳分片结果;Each of the member nodes runs the NSGA-II algorithm to obtain the best sharding result for each of the member nodes;
各所述成员节点将各自的最佳分片结果发送至所述领导节点;Each of the member nodes sends its own best sharding result to the leader node;
所述领导节点根据各最佳分片结果,从中选出通信延迟差异最小的最佳分片结果,向目录委员会中的其他节点广播通信延迟差异最小的最佳分片结果;The leader node selects the best sharding result with the smallest communication delay difference from each best sharding result, and broadcasts the best sharding result with the smallest communication delay difference to other nodes in the directory committee;
目录委员会中的其他节点根据接收到的通信延迟差异最小的最佳分片结果进行确认签名;Other nodes in the directory committee confirm the signature based on the best shard result with the smallest communication delay difference received;
当所述领导节点接收到大于等于 2h/3个节点的确认签名的情况下,目录委员会达成共识,分片完成;When the leader node receives confirmation signatures from more than or equal to 2 h /3 nodes, the directory committee reaches a consensus and sharding is completed;
当所述领导节点接收到小于 2h/3个节点的确认签名的情况下,返回执行所述随机从各所述成员节点中选出目录委员会的领导节点的步骤,直至所述领导节点接收到大于等于 2h/3个节点的确认签名,目录委员会达成共识,分片完成,生成分片结果列表;When the leader node receives confirmation signatures from less than 2 h /3 nodes, it returns to the step of randomly selecting the leader node of the directory committee from each of the member nodes until the leader node receives confirmation signatures from more than or equal to 2 h /3 nodes, the directory committee reaches a consensus, the sharding is completed, and a sharding result list is generated;
根据所述分片结果列表,对各分片中的节点进行协作组划分,确定各分片的协作组划分结果列表。According to the sharding result list, the nodes in each shard are divided into cooperative groups, and a cooperative group division result list of each shard is determined.
在其中一个实施例中,在所述区块链系统中的所有节点对工作量证明难题进行求解,最先解决工作量证明难题的前h个节点确定为目录委员会中的各成员节点的步骤之前,还包括:In one embodiment, before all nodes in the blockchain system solve the proof-of-work problem and the first h nodes that solve the proof-of-work problem are determined as member nodes of the directory committee, the process further includes:
对区块链系统中的所有节点进行分析,确定所述区块链系统中的恶意节点以及恶意节点总数;Analyze all nodes in the blockchain system to determine malicious nodes and the total number of malicious nodes in the blockchain system;
根据所述区块链系统中的节点总数和所述区块链系统中的恶意节点总数,确定所述区块链系统中恶意节点的比例是否大于三分之一;Determining whether a proportion of malicious nodes in the blockchain system is greater than one-third based on the total number of nodes in the blockchain system and the total number of malicious nodes in the blockchain system;
在所述区块链系统中恶意节点的比例大于三分之一的情况下,从所述区块链系统中移除q个恶意节点;When the proportion of malicious nodes in the blockchain system is greater than one-third, removing q malicious nodes from the blockchain system;
其中,,为需要移除的恶意节点个数,m为区块链系统中的恶意节点个数,N为区块链系统中的节点总数,Δ为区块链系统中恶意节点的比例。in, , is the number of malicious nodes that need to be removed, m is the number of malicious nodes in the blockchain system, N is the total number of nodes in the blockchain system, and Δ is the proportion of malicious nodes in the blockchain system.
在其中一个实施例中,所述NSGA-II算法的目标函数为:In one embodiment, the objective function of the NSGA-II algorithm is:
; ;
其中,为分片间节点数量的差异,为分片间的恶意节点比例差异,为分片间的通信延迟差异,为分片间的存储空间差异,Ω为节点划分的解空间,X为成员节点的最佳分片结果,R为最佳分片结果中分片内恶意节点的比例。in, is the difference in the number of nodes between shards, is the difference in the proportion of malicious nodes between shards, is the communication delay difference between shards, is the storage space difference between shards, Ω is the solution space of node partition, X is the best sharding result of member nodes, and R is the proportion of malicious nodes in the shard in the best sharding result.
在其中一个实施例中,所述分片间节点数量的差异的计算方式为:In one embodiment, the difference in the number of nodes between the shards The calculation method is:
; ;
其中,为分片j中的节点数,h为区块链系统中的分片数。in, is the number of nodes in shard j , and h is the number of shards in the blockchain system.
在其中一个实施例中,所述分片间的恶意节点比例差异的计算方式为:In one embodiment, the difference in the proportion of malicious nodes between the shards The calculation method is:
; ;
; ;
其中,为分片j的恶意节点比例,E j 为分片j内恶意节点数。in, is the ratio of malicious nodes in shard j , and Ej is the number of malicious nodes in shard j .
在其中一个实施例中,所述分片间的通信延迟差异的计算方式为:In one embodiment, the communication delay difference between the shards The calculation method is:
; ;
其中,为分片j内所有节点到分片领导节点u的通信延迟差异,为领导节点u到节点i的通信延迟,g j 为分片j的节点总数,为分片领导节点u接收到节点i回复的时刻,为分片领导节点u发送信息给节点i的时刻。in, is the difference in communication delay from all nodes in shard j to shard leader node u , is the communication delay from leader node u to node i , gj is the total number of nodes in shard j , is the time when the shard leader node u receives the reply from node i , The time when the shard leader node u sends information to node i .
在其中一个实施例中,所述分片间的存储空间差异的计算方式为:In one embodiment, the storage space difference between the shards The calculation method is:
; ;
其中,为分片j内节点的存储空间,c i 为节点i的存储空间大小。in, is the storage space of the node in shard j , and ci is the storage space size of node i .
在其中一个实施例中,所述根据所述分片结果列表,对各分片中的节点进行协作组划分,确定各分片的协作组划分结果列表,包括:In one embodiment, dividing the nodes in each shard into cooperative groups according to the shard result list to determine the cooperative group division result list of each shard includes:
将分片j中可用存储空间大于分片j所需存储空间F j 的节点从所述分片结果列表中移除;Remove the nodes whose available storage space in shard j is greater than the storage space Fj required by shard j from the shard result list;
所述目录委员会的领导节点广播开始组队通知;The leader node of the directory committee broadcasts a notification of starting team formation;
分片j中的节点接收到开始组队通知后,立即向分片j中的其他节点广播组队请求;After receiving the notification to start teaming, the node in shard j immediately broadcasts the teaming request to other nodes in shard j ;
当分片j中的节点i接收到一个节点b的同意组队消息后,计算该节点i和该节点b的可用存储空间大小,若节点i和节点b的可用存储空间总和大于F j ,则组队结束;When node i in shard j receives a message from node b agreeing to form a team, it calculates the available storage space of node i and node b . If the sum of the available storage space of node i and node b is greater than F j , the team formation ends;
若节点i和节点b的可用存储空间总和小于等于F j ,则继续等待其他节点的同意组队消息,直至节点i与同意组队的节点的可用存储空间总和大于F j ;If the sum of available storage space of node i and node b is less than or equal to F j , then continue to wait for teaming consent messages from other nodes until the sum of available storage space of node i and the nodes that agree to teaming is greater than F j ;
当所述分片结果列表中各分片的节点全部完成组队或各分片的剩余未组队的节点的可用存储空间总和小于F,各分片的协作组划分结束,各分片的剩余未组队的节点将作为各分片的候补节点。When all nodes of each shard in the shard result list have completed teaming or the sum of available storage space of the remaining unteamed nodes of each shard is less than F , the division of the collaboration groups of each shard is completed, and the remaining unteamed nodes of each shard will be used as candidate nodes of each shard.
上述车联网环境中面向节点协作存储的区块链节点分片方法,通过区块链系统中的所有节点对工作量证明难题进行求解,最先解决工作量证明难题的前h个节点确定为目录委员会中的各成员节点,并随机从各所述成员节点中选出目录委员会的领导节点,进而各所述成员节点各自运行NSGA-II算法,得到各所述成员节点的最佳分片结果,并将各自的最佳分片结果发送至所述领导节点;从而所述领导节点根据各最佳分片结果,从中选出通信延迟差异最小的最佳分片结果,向目录委员会中的其他节点广播通信延迟差异最小的最佳分片结果;目录委员会中的其他节点根据接收到的通信延迟差异最小的最佳分片结果进行确认签名;当所述领导节点接收到大于等于 2h/3个节点的确认签名的情况下,目录委员会达成共识,分片完成;当所述领导节点接收到小于2h/3个节点的确认签名的情况下,返回执行所述随机从各所述成员节点中选出目录委员会的领导节点的步骤,直至所述领导节点接收到大于等于2h/3个节点的确认签名,目录委员会达成共识,分片完成,生成分片结果列表;进而根据所述分片结果列表,对各分片中的节点进行协作组划分,确定各分片的协作组划分结果列表,由此,得到通信延迟差异最小的分片结果,提高区块链的交易吞吐量,降低了分片内各节点间的通信延迟。The blockchain node sharding method for node cooperative storage in the above-mentioned Internet of Vehicles environment solves the proof-of-work problem through all nodes in the blockchain system, and the first h nodes that solve the proof-of-work problem are determined as the member nodes in the directory committee, and the leader node of the directory committee is randomly selected from each of the member nodes, and then each of the member nodes runs the NSGA-II algorithm to obtain the best sharding result of each member node, and sends each of the best sharding results to the leader node; thereby, the leader node selects the best sharding result with the smallest communication delay difference from each best sharding result, and broadcasts the best sharding result with the smallest communication delay difference to other nodes in the directory committee; other nodes in the directory committee confirm the signature based on the received best sharding result with the smallest communication delay difference; when the leader node receives confirmation signatures of more than or equal to 2 h /3 nodes, the directory committee reaches a consensus and the sharding is completed; when the leader node receives confirmation signatures of less than 2 h /3 nodes, it returns to the step of randomly selecting the leader node of the directory committee from each of the member nodes until the leader node receives confirmation signatures of more than or equal to 2 h /3 nodes. /3 nodes’ confirmation signatures, the directory committee reaches a consensus, the sharding is completed, and a sharding result list is generated; then, according to the sharding result list, the nodes in each shard are divided into collaborative groups, and the collaborative group division result list of each shard is determined, thereby obtaining the sharding result with the smallest communication delay difference, improving the transaction throughput of the blockchain, and reducing the communication delay between nodes in the shard.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为一个实施例中车联网环境中面向节点协作存储的区块链节点分片方法的流程示意图;FIG1 is a flow chart of a blockchain node sharding method for node collaborative storage in an Internet of Vehicles environment in one embodiment;
图2为一个实施例中车联网环境中面向节点协作存储的区块链节点分片方法的结构示意图。FIG2 is a schematic diagram of the structure of a blockchain node sharding method for node collaborative storage in an Internet of Vehicles environment in one embodiment.
具体实施方式DETAILED DESCRIPTION
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
在一个实施例中,如图1和图2所示,提供了一种车联网环境中面向节点协作存储的区块链节点分片方法,包括以下步骤:In one embodiment, as shown in FIG. 1 and FIG. 2 , a blockchain node sharding method for node collaborative storage in an Internet of Vehicles environment is provided, comprising the following steps:
步骤S220,区块链系统中的所有节点对工作量证明难题进行求解,最先解决工作量证明难题的前h个节点确定为目录委员会中的各成员节点。In step S220, all nodes in the blockchain system solve the proof-of-work problem, and the first h nodes that solve the proof-of-work problem first are determined as member nodes in the directory committee.
其中,区块链系统中的所有节点可以包括路边单元,区块链系统中的所有节点可以还包括路边单元和可信机构。车联网中的路边单元负责接收、处理和广播车辆发送的消息。Among them, all nodes in the blockchain system may include roadside units, and all nodes in the blockchain system may also include roadside units and trusted institutions. The roadside units in the Internet of Vehicles are responsible for receiving, processing and broadcasting messages sent by vehicles.
其中,目录委员会负责收集各个分片打包的微区块并合并成区块发布到区块链系统中,负责将节点划分到不同的分片。目录委员会的成员节点由分片的领导节点组成。The Directory Committee is responsible for collecting micro-blocks packaged by each shard and merging them into blocks to be published in the blockchain system, and is responsible for dividing nodes into different shards. The member nodes of the Directory Committee are composed of the leader nodes of the shards.
其中,分片的领导节点负责当前分片的交易分发和验证结果的收集,并将交易验证结果生成微区块提交给目录委员会。Among them, the leader node of the shard is responsible for the transaction distribution and verification result collection of the current shard, and generates micro-blocks based on the transaction verification results and submits them to the directory committee.
其中,微区块,可以是交易在分片中进行验证并达成共识后形成的交易集合。Among them, a micro-block can be a collection of transactions formed after transactions are verified and consensus is reached in the shards.
应理解,一个节点想要加入区块链系统,需要解决一个工作量证明(PoW)难题。在区块链系统初始化时,区块链系统中所有的节点进行PoW难题的求解,最先解决问题的前h个节点当选为目录委员会的成员节点。It should be understood that a node needs to solve a proof-of-work (PoW) problem if it wants to join the blockchain system. When the blockchain system is initialized, all nodes in the blockchain system solve the PoW problem, and the first h nodes that solve the problem are elected as member nodes of the directory committee.
步骤S240,随机从各成员节点中选出目录委员会的领导节点。Step S240: randomly select a leader node of the directory committee from each member node.
其中,目录委员会的领导节点(记为L)通过随机的方式从目录委员会的成员节点中产生。目录委员会的每个成员节点即为每个分片的领导节点。The leader node (denoted as L) of the directory committee is randomly generated from the member nodes of the directory committee. Each member node of the directory committee is the leader node of each shard.
步骤S260,各成员节点各自运行NSGA-II算法,得到各成员节点的最佳分片结果。Step S260: Each member node runs the NSGA-II algorithm to obtain the best sharding result of each member node.
其中,NSGA-II算法是最流行的多目标遗传算法之一,它降低了非劣排序遗传算法的复杂性,具有运行速度快,解集的收敛性好的优点,因此选择NSGA-II算法求解分片结果。Among them, the NSGA-II algorithm is one of the most popular multi-objective genetic algorithms. It reduces the complexity of the non-inferior sorting genetic algorithm and has the advantages of fast running speed and good convergence of the solution set. Therefore, the NSGA-II algorithm is selected to solve the fragmentation results.
在一个实施例中,NSGA-II算法是根据分片中节点数量的多少、节点是否恶意、节点与分片的领导节点之间通信延迟(简称通信延迟)的大小以及分片中节点存储空间的大小来进行节点的分片的。NSGA-II算法的优化目标是:1)分片间节点数量的差异;2)分片间的恶意节点比例差异;3)分片间的通信延迟差异;4)分片间的存储空间的差异。由目录委员会的成员节点各自运行NSGA-II算法,计算分片间节点数量的差异、分片间的恶意节点比例差异、分片间的通信延迟差异和分片间的存储空间的差异,并进行最小化优化,各成员节点最终得出各自的最佳分片结果。In one embodiment, the NSGA-II algorithm shards nodes based on the number of nodes in the shard, whether the node is malicious, the size of the communication delay between the node and the leader node of the shard (referred to as communication delay), and the size of the node storage space in the shard. The optimization goals of the NSGA-II algorithm are: 1) the difference in the number of nodes between shards; 2) the difference in the proportion of malicious nodes between shards; 3) the difference in communication delay between shards; 4) the difference in storage space between shards. The member nodes of the directory committee each run the NSGA-II algorithm to calculate the difference in the number of nodes between shards, the difference in the proportion of malicious nodes between shards, the difference in communication delay between shards, and the difference in storage space between shards, and perform minimization optimization, and each member node finally obtains its own optimal sharding result.
在一个实施例中,NSGA-II算法的目标函数为:In one embodiment, the objective function of the NSGA-II algorithm is:
; ;
其中,为分片间节点数量的差异,为分片间的恶意节点比例差异,为分片间的通信延迟差异,为分片间的存储空间差异,Ω为节点划分的解空间,X为成员节点的最佳分片结果,R为最佳分片结果中分片内恶意节点的比例。in, is the difference in the number of nodes between shards, is the difference in the proportion of malicious nodes between shards, is the communication delay difference between shards, is the storage space difference between shards, Ω is the solution space of node partition, X is the best sharding result of member nodes, and R is the proportion of malicious nodes in the shard in the best sharding result.
应理解, NSGA-II算法的目标函数的优化目标设计为以分片间节点数量的差异、分片间通信延迟差异、分片间的恶意节点比例差异和分片间的存储空间差异为最小化优化目标,可以将区块链系统中的恶意节点均匀分布到各分片中,减小各分片的恶意节点比例差异,从而避免恶意节点聚集到同一分片,造成区块链系统失效。还可以将彼此之间通信延迟较低的节点划分到同一个分片中,并降低分片之间的节点数量差异和分片之间存储空间的差异,降低了同一分片内的交易处理延迟,保证各分片之间的配置均衡,避免出现因为某个分片性能较低,导致目录委员会花费较长时间等待的情况。It should be understood that the optimization goal of the objective function of the NSGA-II algorithm is designed to minimize the difference in the number of nodes between shards, the difference in communication delay between shards, the difference in the proportion of malicious nodes between shards, and the difference in storage space between shards. The malicious nodes in the blockchain system can be evenly distributed to each shard, reducing the difference in the proportion of malicious nodes in each shard, thereby avoiding malicious nodes from gathering in the same shard and causing the blockchain system to fail. Nodes with lower communication delays between each other can also be divided into the same shard, and the difference in the number of nodes between shards and the difference in storage space between shards can be reduced, reducing the transaction processing delay within the same shard, ensuring balanced configuration between shards, and avoiding the situation where the directory committee spends a long time waiting due to the low performance of a certain shard.
应理解,减小分片之间节点数量差异可以保证各个分片之间有相近的交易处理速度。It should be understood that reducing the difference in the number of nodes between shards can ensure similar transaction processing speeds between shards.
应理解,减小分片之间恶意节点比例差异可以保证各个分片的安全性,避免恶意节点聚集到同一分片,导致分片失效。为了提高分片的安全性,避免恶意节点大量进入同一分片,造成分片安全性低的问题,需要考虑分片间恶意节点比例的差异问题。It should be understood that reducing the difference in the proportion of malicious nodes between shards can ensure the security of each shard and prevent malicious nodes from gathering in the same shard, causing the shard to fail. In order to improve the security of shards and prevent malicious nodes from entering the same shard in large numbers, causing the shard to be less secure, it is necessary to consider the difference in the proportion of malicious nodes between shards.
应理解,区块链系统的目录委员会在形成之后,目录委员会中的各成员节点分别作为各个分片的领导节点。减小各个分片内节点与该分片的领导节点之间的通信延迟可以提高分片内交易处理的速度,进而提高分片内的交易吞吐量。为了降低分片之间通信延迟的差异,提高系统吞吐量,需要保证各个分片之间通信延迟的差异尽可能小。越小,代表分片之间通信延迟差异越小,反之,则代表分片之间通信延迟差异大,通信延迟低的分片可以更早提交微区块,而通信延迟高的分片形成微区块的时间较长,进而较晚地提交微区块,造成微区块之间等待时间过长,降低系统吞吐量。It should be understood that after the directory committee of the blockchain system is formed, each member node in the directory committee serves as the leader node of each shard. Reducing the communication delay between the nodes in each shard and the leader node of the shard can increase the speed of transaction processing in the shard, thereby increasing the transaction throughput in the shard. In order to reduce the difference in communication delay between shards and improve the system throughput, it is necessary to ensure that the difference in communication delay between shards is as small as possible. The smaller it is, the smaller the difference in communication delay between shards is. Conversely, the larger the difference in communication delay between shards is, the shards with low communication delay can submit micro-blocks earlier, while the shards with high communication delay take longer to form micro-blocks and submit micro-blocks later, resulting in long waiting time between micro-blocks and reduced system throughput.
应理解,为了保证安全性,除了减少分片之间的恶意节点比例差异,还可以减少分片之间的协作组数量的差异。通过减小分片间存储空间差异来间接保证各分片间有相似的协作组数量。It should be understood that in order to ensure security, in addition to reducing the difference in the proportion of malicious nodes between shards, the difference in the number of collaboration groups between shards can also be reduced. By reducing the difference in storage space between shards, it is indirectly ensured that each shard has a similar number of collaboration groups.
在一个实施例中,分片间节点数量的差异的计算方式为:In one embodiment, the difference in the number of nodes between shards The calculation method is:
; ;
其中,为分片j中的节点数,h为区块链系统中的分片数。in, is the number of nodes in shard j , and h is the number of shards in the blockchain system.
其中,的值越小,代表分片间的节点数量的差异越小。in, The smaller the value, the smaller the difference in the number of nodes between shards.
在一个实施例中,分片间的恶意节点比例差异的计算方式为:In one embodiment, the difference in the proportion of malicious nodes between shards The calculation method is:
; ;
其中,为分片j的恶意节点比例,E j 为分片j内恶意节点数。in, is the ratio of malicious nodes in shard j , and Ej is the number of malicious nodes in shard j .
在一个实施例中,分片间的通信延迟差异的计算方式为:In one embodiment, the communication delay difference between shards The calculation method is:
; ;
其中,为分片j内所有节点到分片领导节点u的通信延迟差异,为领导节点u到节点i的通信延迟,g j 为分片j中协作组的数量,为分片领导节点u接收到节点i回复的时刻,为分片领导节点u发送信息给节点i的时刻。in, is the difference in communication delay from all nodes in shard j to shard leader node u , is the communication delay from leader node u to node i , gj is the number of collaboration groups in shard j , is the time when the shard leader node u receives the reply from node i , The time when the shard leader node u sends information to node i .
在一个实施例中,分片间的存储空间差异的计算方式为:In one embodiment, the storage space difference between the shards The calculation method is:
; ;
其中,为分片j内节点的存储空间,c i 为节点i的存储空间大小。in, is the storage space of the node in shard j , and ci is the storage space size of node i .
步骤S280,各成员节点将各自的最佳分片结果发送至领导节点。Step S280: Each member node sends its best sharding result to the leader node.
步骤S300,领导节点根据各最佳分片结果,从中选出通信延迟差异最小的最佳分片结果,向目录委员会中的其他节点广播通信延迟差异最小的最佳分片结果。Step S300: The leader node selects the best sharding result with the smallest communication delay difference from each best sharding result, and broadcasts the best sharding result with the smallest communication delay difference to other nodes in the directory committee.
步骤S320,目录委员会中的其他节点根据接收到的通信延迟差异最小的最佳分片结果进行确认签名。Step S320: Other nodes in the directory committee confirm the signature based on the received best sharding result with the smallest communication delay difference.
步骤S340,当领导节点接收到大于等于 2h/3个节点的确认签名的情况下,目录委员会达成共识,分片完成。Step S340: When the leader node receives confirmation signatures from more than or equal to 2 h /3 nodes, the directory committee reaches a consensus and the sharding is completed.
步骤S360,当领导节点接收到小于2h/3个节点的确认签名的情况下,返回执行随机从各成员节点中选出目录委员会的领导节点的步骤,直至领导节点接收到大于等于2h/3个节点的确认签名,目录委员会达成共识,分片完成,生成分片结果列表。Step S360: When the leader node receives confirmation signatures from less than 2 h /3 nodes, it returns to the step of randomly selecting the leader node of the directory committee from each member node until the leader node receives confirmation signatures from more than or equal to 2 h /3 nodes, the directory committee reaches a consensus, the sharding is completed, and a sharding result list is generated.
其中,分片,可以是区块链中的所有节点按照一定规则划分成不同的集合,每个集合称为一个分片。Among them, sharding means that all nodes in the blockchain are divided into different sets according to certain rules, and each set is called a shard.
应理解,分片完成后,每个分片内部独立进行交易的验证和确认,所有分片并行处理交易,分片的领导节点负责本分片内部的交易的分发和验证结果的收集工作。目录委员会负责收集和验证各个分片提交的微区块并进行打包上链。It should be understood that after sharding is completed, each shard independently verifies and confirms transactions, all shards process transactions in parallel, and the leader node of the shard is responsible for the distribution of transactions within the shard and the collection of verification results. The Directory Committee is responsible for collecting and verifying the micro-blocks submitted by each shard and packaging them on the chain.
在一个实施例中,步骤S220至步骤S380的执行分片算法实现,分片算法如算法1所示:In one embodiment, the execution of steps S220 to S380 is implemented by a sharding algorithm, and the sharding algorithm is shown in Algorithm 1:
。 .
算法1的相关注释如下:The relevant comments of Algorithm 1 are as follows:
1)第3行表示区块链系统中的所有节点(记为L)求解PoW难题;1) The third line indicates that all nodes in the blockchain system (denoted as L ) solve the PoW problem;
2)第4行表示最先得到结果的前h个节点组成目录委员会M;2) The 4th row indicates that the first h nodes that get the result first form the directory committee M ;
3)第5行表示从目录委员会的节点中随机挑选一个节点作为领导节点;3) Line 5 indicates that a node is randomly selected from the nodes of the directory committee as the leader node ;
4)第6-9行表示M中的节点运行NSGA-II算法得到最佳分片结果,并将最佳分片结果f发送到;4) Lines 6-9 indicate that the nodes in M run the NSGA-II algorithm to obtain the best sharding result and send the best sharding result f to ;
5)第11-12行表示从所有的f中挑选通信延迟最小的结果作为最佳结果,并将广播;5) Lines 11-12 indicate From all f, select the result with the smallest communication delay as the best result , and broadcast;
6)第13行表示将发送确认为最佳分片结果的节点个数赋值给计数器;6) Line 13 indicates that confirmation will be sent Assign the counter the number of nodes in the best sharding result ;
7)第14-16行表示如果M中的节点有超过2h/3个节点发送确认签名到,那么将对应的分片结果记录到分片结果列表Z,分片结束;7) Lines 14-16 indicate that if more than 2 h /3 nodes in M send confirmation signatures, then The corresponding sharding results are recorded in the sharding result list Z , and the sharding ends;
8)第18行表示如果发送确认签名到的节点的个数小于2h/3,即共识失败,那么随机从目录委员会M挑选一个新的节点作为领导节点。8) Line 18 indicates that if you send Confirm signature to If the number of nodes is less than 2 h /3, that is, the consensus fails, then a new node is randomly selected from the directory committee M as the leader node .
其中,在算法1中,若P为NSGA-II算法的优化目标数,Q为种群个体数,则NSGA-II算法的时间复杂度为O(PQ 2)。算法1只有一个单循环,因此算法1的时间复杂度为O(hPQ 2)。In Algorithm 1, if P is the number of optimization targets of the NSGA-II algorithm and Q is the number of individuals in the population, the time complexity of the NSGA-II algorithm is O ( PQ 2 ). Algorithm 1 has only one single loop, so the time complexity of Algorithm 1 is O ( hPQ 2 ).
步骤S380,根据分片结果列表,对各分片中的节点进行协作组划分,确定各分片的协作组划分结果列表。Step S380: divide the nodes in each shard into cooperative groups according to the shard result list, and determine the cooperative group division result list of each shard.
其中,协作组中的节点之间可以彼此交换信息。多个存储空间不足的节点可以构成一个协作组,使得协作组中节点的存储空间之和可以满足区块链的存储要求。The nodes in the collaboration group can exchange information with each other. Multiple nodes with insufficient storage space can form a collaboration group, so that the sum of the storage space of the nodes in the collaboration group can meet the storage requirements of the blockchain.
应理解,在传统的分片区块链中,参与共识的节点需要存储所在分片的区块链完整数据。原因在于,共识节点在验证交易时,需要将交易信息与区块链中的账本信息进行比较,以确定该交易是否合法,但是这种存储完整数据的传统方案并不适应于车联网环境中,原因在于车联网环境中拥有大量存储空间有限的节点,这些节点无法存储完整的区块链数据。为了降低车联网中节点的存储压力,将各分片中的节点进行协作组划分,采用节点协作存储的方式降低车联网中节点的存储压力。各分片中的节点进行协作组划分,可以将彼此之间通信延迟较小的节点划分为一个协作组,协作组的划分需要满足协作组内的可用存储空间大于分片中所需存储空间。It should be understood that in traditional sharded blockchains, nodes participating in consensus need to store the complete blockchain data of the shard in which they are located. The reason is that when verifying a transaction, the consensus node needs to compare the transaction information with the ledger information in the blockchain to determine whether the transaction is legal. However, this traditional solution for storing complete data is not suitable for the Internet of Vehicles environment because there are a large number of nodes with limited storage space in the Internet of Vehicles environment, and these nodes cannot store complete blockchain data. In order to reduce the storage pressure of nodes in the Internet of Vehicles, the nodes in each shard are divided into collaborative groups, and node collaborative storage is used to reduce the storage pressure of nodes in the Internet of Vehicles. The nodes in each shard are divided into collaborative groups, and nodes with smaller communication delays between each other can be divided into a collaborative group. The division of collaborative groups needs to satisfy the requirement that the available storage space in the collaborative group is greater than the required storage space in the shard.
在一个实施例中,为了保证有足够的空间来存储区块链系统的分片j未来产生的新区块,将区块链系统的分片j所需存储空间F j 定义为:In one embodiment, in order to ensure that there is enough space to store new blocks generated by shard j of the blockchain system in the future, the storage space Fj required by shard j of the blockchain system is defined as:
; ;
其中,表示区块链系统的分片j当前所占存储空间,表示区块链系统的分片j的预留空间。预留空间用于区块链系统的分片j中新区块的存储,预留空间越大,代表当前协作组可以协作运行的时间越久。节点i的数据结构为:i=<ID,(x,y),c,B>,,其中,ID代表节点的编号,(x,y)代表节点的二维坐标,c代表节点的存储空间大小,B代表节点存储的区块列表,g j 为分片j的节点总数。in, Indicates the current storage space occupied by shard j of the blockchain system, Represents the reserved space of shard j of the blockchain system. The reserved space is used to store new blocks in shard j of the blockchain system. The larger the reserved space, the longer the current collaboration group can collaborate. The data structure of node i is: i = < ID , ( x , y ), c , B >, , where ID represents the node number, ( x , y ) represents the two-dimensional coordinates of the node, c represents the storage space size of the node, B represents the block list stored by the node, and gj is the total number of nodes in shard j .
其中,分片j中第k个协作组G k 可以表示为:Among them, the kth collaboration group Gk in shard j can be expressed as:
; ;
其中,表示节点i的存储空间大小,表示区块链系统的分片j所需存储空间,β表示满足区块链系统的分片j所需存储空间要求的最小节点数,即β个节点的可用存储空间之和大于等于,β-1个节点的可用存储空间之和小于。如果当前区块链系统的分片j中所有节点的存储空间之和小于,则无法组成协作组。in, Indicates the storage space size of node i , represents the storage space required for shard j of the blockchain system, β represents the minimum number of nodes that meet the storage space requirements of shard j of the blockchain system, that is, the sum of the available storage space of β nodes is greater than or equal to , the sum of available storage space of β -1 nodes is less than If the sum of the storage space of all nodes in the current blockchain system's shard j is less than , a collaborative group cannot be formed.
其中,分片j中的协作组集合S j 为:Among them, the collaboration group set Sj in shard j is:
; ;
其中,表示分片j中的协作组数量。每个分片内部独立进行交易的验证工作,具体的交易验证由协作组节点负责。in, Indicates the number of collaboration groups in shard j . Each shard independently verifies transactions, and the specific transaction verification is the responsibility of the collaboration group node.
在一个实施例中,根据分片结果列表,对各分片中的节点进行协作组划分,确定各分片的协作组划分结果列表,包括:In one embodiment, according to the shard result list, the nodes in each shard are divided into cooperative groups, and the cooperative group division result list of each shard is determined, including:
将分片j中可用存储空间大于分片j的所需存储空间F j 的节点从分片结果列表中移除;目录委员会的领导节点广播开始组队通知;分片j中的节点接收到开始组队通知后,立即向分片j中的其他节点广播组队请求;当分片j中的节点i接收到一个节点b的同意组队消息后,计算该节点i和该节点b的可用存储空间大小,若节点i和节点b的可用存储空间总和大于F j ,则组队结束;若节点i和节点b的可用存储空间总和小于等于F j ,则继续等待其他节点的同意组队消息,直至节点i与同意组队的节点的可用存储空间总和大于F j ;当分片结果列表中各分片的节点全部完成组队或各分片的剩余未组队的节点的可用存储空间总和小于F j ,各分片的协作组划分结束,各分片的剩余未组队的节点将作为各分片的候补节点。The nodes whose available storage space in shard j is greater than the required storage space Fj of shard j are removed from the shard result list; the leader node of the directory committee broadcasts a notification to start teaming; after receiving the notification to start teaming, the nodes in shard j immediately broadcast a request to team up to other nodes in shard j ; when node i in shard j receives a message from node b agreeing to team up, the available storage space of node i and node b is calculated, and if the sum of the available storage space of node i and node b is greater than Fj , the teaming is completed; if the sum of the available storage space of node i and node b is less than or equal to Fj , continue to wait for the teaming agreement message from other nodes until the sum of the available storage space of node i and the nodes agreeing to team up is greater than Fj ; when all the nodes of each shard in the shard result list have completed teaming or the sum of the available storage space of the remaining unteamed nodes of each shard is less than Fj , the division of the collaborative groups of each shard is completed, and the remaining unteamed nodes of each shard will be used as candidate nodes of each shard.
其中,按照节点间的通信延迟大小,将通信延迟较小的节点划分到同一个协作组中,同时保证协作组内节点的总的可用存储空间大于F j 。当一个节点的可用存储空间大于F j ,该节点可独自作为一个协作组。Among them, according to the communication delay between nodes, nodes with smaller communication delay are divided into the same cooperation group, and at the same time, the total available storage space of the nodes in the cooperation group is guaranteed to be greater than F j . When the available storage space of a node is greater than F j , the node can be used as a cooperation group alone.
应理解,分片j中的节点i是根据接收到的同意组队消息,确定与哪个节点组队,即,分片j中的节点i先接收到谁的同意组队消息,就先与谁组队,因此,可以将与节点i通信延迟较小的节点划分到同一协作组中,即满足了各节点之间通信延迟较小的节点划分到同一协作组,降低了区块链系统的通信延迟。It should be understood that node i in shard j determines which node to team up with based on the received teaming agreement message, that is, node i in shard j teams up with the node whose teaming agreement message it receives first. Therefore, nodes with smaller communication delays with node i can be divided into the same collaboration group, that is, nodes with smaller communication delays between nodes are divided into the same collaboration group, thereby reducing the communication delay of the blockchain system.
其中,协作组的组内领导节点通过随机的方式产生,协作组内的各节点均维护一张节点-区块映射表,记录着每个节点存储的区块列表以及每个节点的存储空间利用率。存储空间利用率指的是节点的已用存储空间与节点总存储空间的比例,记为r,如下所示:The leader node of the collaboration group is generated randomly, and each node in the collaboration group maintains a node-block mapping table, which records the list of blocks stored by each node and the storage space utilization of each node. The storage space utilization refers to the ratio of the node's used storage space to the node's total storage space, denoted as r , as shown below:
; ;
其中,代表节点的已用存储空间,代表节点的总存储空间。当区块链系统产生新区块时,由协作组的组内领导节点根据组内各节点的存储空间利用率,选择存储空间利用率最小的节点存储新区块。当组内所有节点的存储空间利用率均大于99%时,由组内领导节点向分片的领导节点提出重新划分协作组的请求。协作组划分过程中,根据节点间的通信延迟的不同,将通信延迟小的节点划分到一个协作组中,同时满足组内节点的总存储空间大于F j 。in, Represents the used storage space of the node, Represents the total storage space of the node. When the blockchain system generates a new block, the leader node of the collaboration group selects the node with the smallest storage space utilization to store the new block based on the storage space utilization of each node in the group. When the storage space utilization of all nodes in the group is greater than 99%, the leader node in the group submits a request to the leader node of the shard to re-divide the collaboration group. During the collaboration group division process, nodes with small communication delays are divided into one collaboration group based on the different communication delays between nodes, while satisfying that the total storage space of the nodes in the group is greater than F j .
其中,分片的领导节点向分片内的成员节点广播需要验证的交易,成员节点(源节点)接收到交易后开始进行验证。如果本地存储的信息可以满足交易验证的要求,则节点在本地进行验证交易,此时交易只需附上源节点的签名。如果本地存储的信息无法验证交易,则需要向协作组中其他节点发送数据共享请求,拥有源节点所需数据的节点(目标节点)接收到请求后,将自己的签名以及源节点所需信息发送到源节点,源节点根据接收到的信息和本地信息进行交易验证,验证通过后将源节点签名和目标节点的签名附加在验证信息上,并发送至分片的领导节点。Among them, the leader node of the shard broadcasts the transaction that needs to be verified to the member nodes in the shard, and the member nodes (source nodes) start to verify after receiving the transaction. If the locally stored information can meet the requirements of transaction verification, the node verifies the transaction locally, and the transaction only needs to be attached with the signature of the source node. If the locally stored information cannot verify the transaction, it is necessary to send a data sharing request to other nodes in the collaboration group. After receiving the request, the node (target node) that has the data required by the source node sends its own signature and the information required by the source node to the source node. The source node verifies the transaction based on the received information and local information. After the verification is passed, the signature of the source node and the signature of the target node are attached to the verification information and sent to the leader node of the shard.
应理解,通过将分片中各节点之间通信延迟较小的节点划分到同一协作组,可以将传统的区块链系统中每个节点存储所在分片的全部区块链信息,优化为一组节点存储所在分片的全部区块链信息,可以使存储空间不足的节点也能够参与到区块链共识工作中。It should be understood that by dividing the nodes with smaller communication delays between nodes in the shard into the same collaboration group, each node in the traditional blockchain system that stores all the blockchain information of the shard in which it is located can be optimized to a group of nodes that store all the blockchain information of the shard in which it is located, so that nodes with insufficient storage space can also participate in the blockchain consensus work.
上述车联网环境中面向节点协作存储的区块链节点分片方法,通过区块链系统中的所有节点对工作量证明难题进行求解,最先解决工作量证明难题的前h个节点确定为目录委员会中的各成员节点,并随机从各成员节点中选出目录委员会的领导节点,进而各成员节点各自运行NSGA-II算法,得到各成员节点的最佳分片结果,并将各自的最佳分片结果发送至领导节点;从而领导节点根据各最佳分片结果,从中选出通信延迟差异最小的最佳分片结果,向目录委员会中的其他节点广播通信延迟差异最小的最佳分片结果;目录委员会中的其他节点根据接收到的通信延迟差异最小的最佳分片结果进行确认签名;当领导节点接收到大于等于2h/3个节点的确认签名的情况下,目录委员会达成共识,分片完成;当领导节点接收到小于2h/3个节点的确认签名的情况下,返回执行随机从各成员节点中选出目录委员会的领导节点的步骤,直至领导节点接收到大于等于2h/3个节点的确认签名,目录委员会达成共识,分片完成,生成分片结果列表;进而根据分片结果列表,对各分片中的节点进行协作组划分,确定各分片的协作组划分结果列表,由此,得到通信延迟差异最小的分片结果,提高区块链的交易吞吐量,降低了分片内各节点间的通信延迟。The blockchain node sharding method for node cooperative storage in the above-mentioned Internet of Vehicles environment solves the proof-of-work problem through all nodes in the blockchain system, and the first h nodes that solve the proof-of-work problem are determined as the member nodes in the directory committee, and the leader node of the directory committee is randomly selected from each member node, and then each member node runs the NSGA-II algorithm to obtain the best sharding result of each member node, and sends their respective best sharding results to the leader node; thus, the leader node selects the best sharding result with the smallest communication delay difference from each best sharding result, and broadcasts the best sharding result with the smallest communication delay difference to other nodes in the directory committee; other nodes in the directory committee confirm the signature based on the received best sharding result with the smallest communication delay difference; when the leader node receives confirmation signatures greater than or equal to 2 h /3 nodes, the directory committee reaches a consensus and the sharding is completed; when the leader node receives confirmation signatures less than 2 h /3 nodes, it returns to the step of randomly selecting the leader node of the directory committee from each member node until the leader node receives confirmation signatures greater than or equal to 2 h /3 nodes. /3 nodes’ confirmation signatures, the directory committee reaches a consensus, the sharding is completed, and a sharding result list is generated; then, based on the sharding result list, the nodes in each shard are divided into collaborative groups, and the collaborative group division result list of each shard is determined. Thus, the sharding result with the smallest communication delay difference is obtained, which improves the transaction throughput of the blockchain and reduces the communication delay between nodes in the shard.
在一个实施例中,在区块链系统中的所有节点对工作量证明难题进行求解,最先解决工作量证明难题的前h个节点确定为目录委员会中的各成员节点的步骤之前,还包括:In one embodiment, before all nodes in the blockchain system solve the proof-of-work puzzle and the first h nodes that solve the proof-of-work puzzle are determined as member nodes of the directory committee, the process further includes:
对区块链系统中的所有节点进行分析,确定区块链系统中的恶意节点以及恶意节点总数;根据区块链系统中的节点总数和区块链系统中的恶意节点总数,确定区块链系统中恶意节点的比例是否大于三分之一;在区块链系统中恶意节点的比例大于三分之一的情况下,从区块链系统中移除q个恶意节点;Analyze all nodes in the blockchain system to determine malicious nodes in the blockchain system and the total number of malicious nodes; determine whether the proportion of malicious nodes in the blockchain system is greater than one third based on the total number of nodes in the blockchain system and the total number of malicious nodes in the blockchain system; if the proportion of malicious nodes in the blockchain system is greater than one third, remove q malicious nodes from the blockchain system;
其中,,q为需要移除的恶意节点个数,m为区块链系统中的恶意节点个数,N为区块链系统中的节点总数,Δ为区块链系统中恶意节点的比例。in, , q is the number of malicious nodes that need to be removed, m is the number of malicious nodes in the blockchain system, N is the total number of nodes in the blockchain system, and Δ is the proportion of malicious nodes in the blockchain system.
应理解,由于本申请采用了PBFT共识,而PBFT共识不允许恶意节点的数量超过节点总数的1/3,因此需要保证区块链系统中恶意节点的比例Δ小于1/3,如果不满足该条件,需要从区块链系统中移除q个恶意节点,以保证Δ小于1/3。其中,区块链系统中恶意节点的比例Δ计算方式为:It should be understood that since this application adopts PBFT consensus, and PBFT consensus does not allow the number of malicious nodes to exceed 1/3 of the total number of nodes, it is necessary to ensure that the proportion of malicious nodes in the blockchain system Δ is less than 1/3. If this condition is not met, q malicious nodes need to be removed from the blockchain system to ensure that Δ is less than 1/3. Among them, the proportion of malicious nodes in the blockchain system Δ is calculated as follows:
。 .
应理解,在将区块链系统中的所有节点进行分片之前,需要判断区块链系统中的所有节点中的恶意节点比例是否小于1/3,如果不是,则需要移除q个恶意节点,以保证区块链系统中的所有节点中的恶意节点比例小于1/3。It should be understood that before sharding all the nodes in the blockchain system, it is necessary to determine whether the proportion of malicious nodes in all the nodes in the blockchain system is less than 1/3. If not, q malicious nodes need to be removed to ensure that the proportion of malicious nodes in all the nodes in the blockchain system is less than 1/3.
上述车联网环境中面向节点协作存储的区块链节点分片方法,通过在区块链系统中的所有节点对工作量证明难题进行求解,最先解决工作量证明难题的前h个节点确定为目录委员会中的各成员节点的步骤之前,对区块链系统中的所有节点进行分析,确定区块链系统中的恶意节点以及恶意节点总数;根据区块链系统中的节点总数和区块链系统中的恶意节点总数,确定区块链系统中恶意节点的比例是否大于三分之一;在区块链系统中恶意节点的比例大于三分之一的情况下,从区块链系统中移除q个恶意节点,可以提高区块链系统的安全性。The blockchain node sharding method for node collaborative storage in the above-mentioned Internet of Vehicles environment solves the proof-of-work problem in all nodes in the blockchain system, and before the first h nodes that solve the proof-of-work problem are determined as member nodes in the directory committee, all nodes in the blockchain system are analyzed to determine malicious nodes in the blockchain system and the total number of malicious nodes; based on the total number of nodes in the blockchain system and the total number of malicious nodes in the blockchain system, it is determined whether the proportion of malicious nodes in the blockchain system is greater than one-third; when the proportion of malicious nodes in the blockchain system is greater than one-third, q malicious nodes are removed from the blockchain system to improve the security of the blockchain system.
应该理解的是,虽然图1的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图1中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that, although the various steps in the flowchart of FIG. 1 are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in FIG. 1 may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310518821.3A CN116248725B (en) | 2023-05-10 | 2023-05-10 | Block chain node slicing method oriented to node collaborative storage in Internet of vehicles environment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310518821.3A CN116248725B (en) | 2023-05-10 | 2023-05-10 | Block chain node slicing method oriented to node collaborative storage in Internet of vehicles environment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116248725A true CN116248725A (en) | 2023-06-09 |
CN116248725B CN116248725B (en) | 2023-07-25 |
Family
ID=86628153
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310518821.3A Active CN116248725B (en) | 2023-05-10 | 2023-05-10 | Block chain node slicing method oriented to node collaborative storage in Internet of vehicles environment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116248725B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118054897A (en) * | 2024-04-15 | 2024-05-17 | 南京信息工程大学 | Method for processing cross-chain transactions with different priorities based on collaborative verification group division |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112073483A (en) * | 2020-08-28 | 2020-12-11 | 武汉大学 | Authority certification consensus method and system based on credit and committee endorsement mechanism |
CN113114496A (en) * | 2021-04-06 | 2021-07-13 | 北京工业大学 | Block chain expandability problem solution based on fragmentation technology |
CN114037531A (en) * | 2021-11-08 | 2022-02-11 | 中山大学 | A method for adjusting shard accounts in a blockchain sharding system and related devices |
CN114567554A (en) * | 2022-02-21 | 2022-05-31 | 新疆财经大学 | Block chain construction method based on node reputation and partition consensus |
CN115118737A (en) * | 2022-08-25 | 2022-09-27 | 南京信息工程大学 | A Consortium Chain Block Storage Method Based on Node Grouping |
CN115357660A (en) * | 2022-07-20 | 2022-11-18 | 之江实验室 | A Blockchain Consensus Method with Security Awareness and Response Strategy |
-
2023
- 2023-05-10 CN CN202310518821.3A patent/CN116248725B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112073483A (en) * | 2020-08-28 | 2020-12-11 | 武汉大学 | Authority certification consensus method and system based on credit and committee endorsement mechanism |
CN113114496A (en) * | 2021-04-06 | 2021-07-13 | 北京工业大学 | Block chain expandability problem solution based on fragmentation technology |
CN114037531A (en) * | 2021-11-08 | 2022-02-11 | 中山大学 | A method for adjusting shard accounts in a blockchain sharding system and related devices |
CN114567554A (en) * | 2022-02-21 | 2022-05-31 | 新疆财经大学 | Block chain construction method based on node reputation and partition consensus |
CN115357660A (en) * | 2022-07-20 | 2022-11-18 | 之江实验室 | A Blockchain Consensus Method with Security Awareness and Response Strategy |
CN115118737A (en) * | 2022-08-25 | 2022-09-27 | 南京信息工程大学 | A Consortium Chain Block Storage Method Based on Node Grouping |
Non-Patent Citations (1)
Title |
---|
张天祥 等: "区块链激励机制在车联网领域的应用研究综述", 《计算机工程与应用》, vol. 59, no. 9 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118054897A (en) * | 2024-04-15 | 2024-05-17 | 南京信息工程大学 | Method for processing cross-chain transactions with different priorities based on collaborative verification group division |
Also Published As
Publication number | Publication date |
---|---|
CN116248725B (en) | 2023-07-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Dai et al. | Deep reinforcement learning and permissioned blockchain for content caching in vehicular edge computing and networks | |
CN109508982B (en) | Random parallel Byzantine fault-tolerant consensus method of block chain main chain and parallel multiple sub-chains | |
CN109447795B (en) | A Byzantine Consensus Method Supporting Fast Finality | |
Wang et al. | Challenges and solutions in autonomous driving: A blockchain approach | |
CN111601258A (en) | Vehicle networking node data safety communication method based on block chain | |
Hui et al. | Reservation service: Trusted relay selection for edge computing services in vehicular networks | |
CN111371905B (en) | A blockchain layered consensus proof system and method based on cloud computing | |
CN107528886A (en) | Block chain the whole network method for splitting and system | |
CN112532676A (en) | Vehicle calculation task unloading method based on block chain data sharing | |
CN113626781B (en) | Block chain efficient authentication method based on trusted group | |
CN112134959A (en) | A method for sharing heterogeneous edge resources based on blockchain | |
CN110276602B (en) | Block chain hierarchical consensus method and system for Internet of things and electronic equipment | |
Xue et al. | STBC: A novel blockchain-based spectrum trading solution | |
CN110400218A (en) | Hierarchical consensus method based on jury system, blockchain data processing system | |
CN113626875B (en) | Knowledge graph file storage method for block chain fragment enabling | |
CN112217683A (en) | Cross-heterogeneous chain data accessibility processing method, system, medium, device, terminal | |
CN111369319A (en) | A blockchain-based crowdsourcing logistics dispatching system and method | |
CN114048578A (en) | High-throughput block chain system and performance optimization model for 6G network | |
CN116167068B (en) | Block chain-based network edge resource trusted allocation method and system | |
Miglani et al. | Blockchain-based co-operative caching for secure content delivery in CCN-enabled V2G networks | |
Jiao et al. | A blockchain-based computing architecture for mobile ad hoc cloud | |
CN116248725A (en) | Blockchain node sharding method for node collaborative storage in the Internet of Vehicles environment | |
CN111798234B (en) | Lightweight block chain system and construction method | |
CN116595094A (en) | Federal learning incentive method, device, equipment and storage medium based on block chain | |
Wang et al. | Secure and distributed iov data sharing scheme based on a hybrid pos blockchain protocol |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |