CN111092925B - Block chain capacity expansion processing method, device and equipment - Google Patents
Block chain capacity expansion processing method, device and equipment Download PDFInfo
- Publication number
- CN111092925B CN111092925B CN201811281730.8A CN201811281730A CN111092925B CN 111092925 B CN111092925 B CN 111092925B CN 201811281730 A CN201811281730 A CN 201811281730A CN 111092925 B CN111092925 B CN 111092925B
- Authority
- CN
- China
- Prior art keywords
- level
- block
- capacity
- level device
- itself
- 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.)
- Active
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 13
- 238000000034 method Methods 0.000 claims abstract description 22
- 230000005284 excitation Effects 0.000 claims description 23
- 238000005538 encapsulation Methods 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 13
- 238000012545 processing Methods 0.000 claims description 7
- 238000004891 communication Methods 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 6
- 230000006855 networking Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 3
- 238000003491 array Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000005259 measurement Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Images
Classifications
-
- 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/10—Protocols in which an application is distributed across nodes in the network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0876—Network utilisation, e.g. volume of load or congestion level
- H04L43/0894—Packet rate
-
- 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/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明提供一种区块链扩容处理方法、装置及设备,涉及通信技术领域。该方法包括:获取自身和相邻设备的网络带宽;根据自身和相邻设备的网络带宽,确定自身的设备等级,其中所述设备等级至少包括第一级设备和第二级设备,所述第一级设备自身以及与所述第一级设备相邻的至少一设备的网络带宽均为第一带宽,所述第二级设备自身以及与所述第二级设备相邻的设备的网络带宽至少包括第二带宽,所述第一带宽大于所述第二带宽;将所述设备等级告知于相邻设备,并接收所述相邻设备发送的设备等级;基于自身和接收设备的设备等级,进行区块的生成。本发明的方案,解决了现有的区块链无法满足使用需求的问题。
The invention provides a block chain expansion processing method, device and equipment, and relates to the technical field of communication. The method includes: acquiring the network bandwidth of the self and adjacent devices; determining the device level of the self according to the network bandwidth of the self and the adjacent devices, wherein the device level at least includes a first-level device and a second-level device, and the first-level device The network bandwidth of the first-level device itself and at least one device adjacent to the first-level device is the first bandwidth, and the network bandwidth of the second-level device itself and the device adjacent to the second-level device is at least Including a second bandwidth, the first bandwidth is greater than the second bandwidth; the device level is notified to the neighboring device, and the device level sent by the neighboring device is received; based on the device level of itself and the receiving device, perform Generation of blocks. The solution of the present invention solves the problem that the existing blockchain cannot meet the usage requirements.
Description
技术领域technical field
本发明涉及通信技术领域,特别是指一种区块链扩容处理方法、装置及设备。The present invention relates to the field of communication technologies, and in particular, to a method, device and equipment for expanding the capacity of a blockchain.
背景技术Background technique
随着比特币的流行和成熟,作为底层的区块链技术引发了广泛关注。由于其具有分布式无中心、数据不可篡改、可追溯等特性,各行业开始引入区块链技术解决以前面临的业务难题。从技术上看,区块链是一种分布式的数据库系统,具体包括密码学、对等P2P网络等核心技术。从链的形态上看,区块链包括公有链、私有链和联盟链等应用形态。With the popularity and maturity of Bitcoin, the underlying blockchain technology has attracted widespread attention. Due to its distributed, non-centralized, non-tamperable, and traceable features, various industries have begun to introduce blockchain technology to solve business problems they faced before. From a technical point of view, blockchain is a distributed database system, including core technologies such as cryptography and peer-to-peer P2P networks. From the perspective of chain form, blockchain includes application forms such as public chain, private chain and alliance chain.
其中公有链具备以下技术特征:1、基于P2P网络组织节点;2、区块的链式存储;3、采用某种共识机制用于节点间一致性的达成;4、采用某种激励机制鼓励更多节点加入系统。以公有链的典型代表比特币为例,随着全球节点不断增多,全网算力不断增强,比特币区块链面临扩容的严峻问题。首先,每一笔交易都被记录在一个区块上,而且区块连接成链式结构决定了系统本质上是一个线性顺序关系。其次,区块大小和区块间的时间间隔硬性决定了系统在单位时间段内容纳的交易数量。Among them, the public chain has the following technical characteristics: 1. Organize nodes based on P2P network; 2. Chain storage of blocks; 3. Adopt a certain consensus mechanism to achieve consistency between nodes; 4. Adopt a certain incentive mechanism to encourage more Multiple nodes join the system. Taking Bitcoin, the typical representative of the public chain, as an example, with the continuous increase of global nodes and the continuous enhancement of the computing power of the entire network, the Bitcoin blockchain faces the severe problem of expansion. First of all, each transaction is recorded on a block, and the block connection into a chain structure determines that the system is essentially a linear order relationship. Second, the block size and the time interval between blocks rigidly determine the number of transactions that the system can accommodate in a unit time period.
然而,比特币一个区块大小为1MB,平均10分钟产生一个区块,假设一个交易大小为256字节,整个比特币系统每10分钟只能处理4K笔交易。这个系统容量大大限制了诸如比特币这样的公有链在高并发高吞吐环境下的应用。因此,现有的区块链无法满足日益增长的使用需求。However, a block size of Bitcoin is 1MB, and a block is generated in an average of 10 minutes. Assuming a transaction size of 256 bytes, the entire Bitcoin system can only process 4K transactions every 10 minutes. This system capacity greatly limits the application of public chains such as Bitcoin in high-concurrency and high-throughput environments. Therefore, the existing blockchain cannot meet the increasing usage demand.
发明内容SUMMARY OF THE INVENTION
本发明的目的是提供一种区块链扩容处理方法、装置及设备,以解决现有的区块链无法满足使用需求的问题。The purpose of the present invention is to provide a block chain expansion processing method, device and equipment to solve the problem that the existing block chain cannot meet the use requirements.
为达到上述目的,本发明的实施例提供一种区块链扩容处理方法,包括:To achieve the above purpose, embodiments of the present invention provide a method for processing blockchain capacity expansion, including:
获取自身和相邻设备的网络带宽;Obtain the network bandwidth of itself and neighboring devices;
根据自身和相邻设备的网络带宽,确定自身的设备等级,其中所述设备等级至少包括第一级设备和第二级设备,所述第一级设备自身以及与所述第一级设备相邻的至少一设备的网络带宽均为第一带宽,所述第二级设备自身以及与所述第二级设备相邻的设备的网络带宽至少包括第二带宽,所述第一带宽大于所述第二带宽;Determine its own device level according to the network bandwidth of itself and neighboring devices, wherein the device level at least includes a first-level device and a second-level device, the first-level device itself and adjacent to the first-level device The network bandwidth of at least one of the devices is the first bandwidth, and the network bandwidth of the second-level device itself and the devices adjacent to the second-level device include at least a second bandwidth, and the first bandwidth is greater than the first bandwidth. two bandwidth;
将所述设备等级告知于相邻设备,并接收所述相邻设备发送的设备等级;Notifying the device level to the neighboring device, and receiving the device level sent by the neighboring device;
基于自身和接收设备的设备等级,进行区块的生成。The generation of blocks is performed based on the device class of itself and the receiving device.
其中,所述基于自身和接收设备的设备等级,进行区块的生成,包括:Wherein, the generation of blocks is performed based on the device level of itself and the receiving device, including:
在自身为第一级设备、接收设备为第一级设备的情况下,按照预设速度生成第一容量的区块;In the case that itself is the first-level device and the receiving device is the first-level device, generate a block of the first capacity according to a preset speed;
在自身为第二级设备、接收设备为第一级设备的情况下,根据所述第一级设备的相邻设备数量确定目标速度,按照所述目标速度生成第二容量的区块;In the case that the device itself is the second-level device and the receiving device is the first-level device, the target speed is determined according to the number of adjacent devices of the first-level device, and the block of the second capacity is generated according to the target speed;
在自身为第一级设备、接收设备为第二级设备,或者自身为第二级设备、接收设备为第二级设备的情况下,按照预设速度生成第二容量的区块;其中,In the case where it is a first-level device and the receiving device is a second-level device, or is a second-level device and the receiving device is a second-level device, a block of the second capacity is generated according to a preset speed; wherein,
所述第一容量大于所述第二容量。The first capacity is greater than the second capacity.
其中,所述根据所述第一级设备的相邻设备数量确定目标速度,包括:Wherein, determining the target speed according to the number of adjacent devices of the first-level device includes:
根据公式V=(K*m)*T/M,得到目标速度V;其中,K为所述第一级设备的相邻设备中第二级设备的数量,m为第二容量,T为预设速度,M为第一容量。According to the formula V=(K*m)*T/M, the target speed V is obtained; wherein, K is the number of second-level equipment in the adjacent equipment of the first-level equipment, m is the second capacity, and T is the preset Set the speed, M is the first capacity.
其中,所述第一容量的区块封装了多个第二容量的区块,且所述第一容量的区块包括大区块标识。The blocks of the first capacity encapsulate a plurality of blocks of the second capacity, and the blocks of the first capacity include large block identifiers.
其中,所述第二容量的区块包括区块封装标识,所述区块封装标识用于表示所述区块的来源。Wherein, the block of the second capacity includes a block encapsulation identifier, and the block encapsulation identifier is used to indicate the source of the block.
其中,所述方法包括:Wherein, the method includes:
若自身为第一级设备,且接收到来自第一级设备的区块,则直接转发接收到的区块至接收设备中的第一级设备,并在对接收到区块解封装后,转发至接收设备中的第二级设备;If it is a first-level device and receives a block from the first-level device, it directly forwards the received block to the first-level device in the receiving device, and after decapsulating the received block, forwards the block. to secondary equipment in the receiving equipment;
若自身为第一级设备,且接收到来自第二级设备的区块,则直接转发接收到的区块至接收设备中的第二级设备,并在对接收到区块封装得到第一容量的区块后,转发至接收设备中的第一级设备;If it is a first-level device and receives a block from a second-level device, it directly forwards the received block to the second-level device in the receiving device, and encapsulates the received block to obtain the first capacity After the block, it is forwarded to the first-level equipment in the receiving equipment;
若自身为第二级设备,则将接收到的区块转发至接收设备。If it is a second-level device, it forwards the received block to the receiving device.
其中,所述方法还包括:Wherein, the method also includes:
根据自身和相邻设备的设备等级,确定对应的转发激励。Determine the corresponding forwarding incentives according to the device levels of the device itself and neighboring devices.
其中,所述根据自身和相邻设备的设备等级,确定对应的激励,包括:Wherein, determining the corresponding incentives according to the device levels of the device itself and neighboring devices, including:
若自身为第一级设备,则根据公式Q1=(S-s)*T/S,得到激励Q1;If it is the first-level equipment, the excitation Q 1 is obtained according to the formula Q 1 =(S-s)*T/S;
若自身为第二级设备,则根据公式Q2=s*T/S,得到激励Q2;其中,If it is a second-level device, the excitation Q 2 is obtained according to the formula Q 2 =s*T/S; among them,
S为所述第一级设备的出块速度;s为所述第二级设备的出块速度;T为预设基础激励。S is the block-producing speed of the first-level equipment; s is the block-producing speed of the second-level equipment; T is the preset basic excitation.
为达到上述目的,本发明的实施例提供一种终端设备,包括处理器和收发器,其中,To achieve the above object, an embodiment of the present invention provides a terminal device, including a processor and a transceiver, wherein,
所述处理器用于获取自身和相邻设备的网络带宽;根据自身和相邻设备的网络带宽,确定自身的设备等级,其中所述设备等级至少包括第一级设备和第二级设备,所述第一级设备自身以及与所述第一级设备相邻的至少一设备的网络带宽均为第一带宽,所述第二级设备自身以及与所述第二级设备相邻的设备的网络带宽至少包括第二带宽,所述第一带宽大于所述第二带宽;The processor is used to obtain the network bandwidth of itself and adjacent devices; according to the network bandwidths of itself and adjacent devices, determine its own device level, wherein the device level at least includes a first-level device and a second-level device, and the The network bandwidth of the first-level device itself and at least one device adjacent to the first-level device is the first bandwidth, and the network bandwidth of the second-level device itself and the devices adjacent to the second-level device At least a second bandwidth is included, and the first bandwidth is greater than the second bandwidth;
所述收发器用于将所述设备等级告知于相邻设备,并接收所述相邻设备发送的设备等级;The transceiver is used for informing adjacent devices of the device class, and receiving the device class sent by the adjacent devices;
所述处理器还用于基于自身和接收设备的设备等级,进行区块的生成。The processor is further configured to generate blocks based on the device class of itself and the receiving device.
其中,所述处理器还用于在自身为第一级设备、接收设备为第一级设备的情况下,按照预设速度生成第一容量的区块;在自身为第二级设备、接收设备为第一级设备的情况下,根据所述第一级设备的相邻设备数量确定目标速度,按照所述目标速度生成第二容量的区块;在自身为第一级设备、接收设备为第二级设备,或者自身为第二级设备、接收设备为第二级设备的情况下,按照预设速度生成第二容量的区块;其中,Wherein, the processor is further configured to generate a block of the first capacity according to a preset speed when it is the first-level device and the receiving device is the first-level device; when it is the second-level device and the receiving device In the case of the first-level equipment, the target speed is determined according to the number of adjacent devices of the first-level equipment, and the block of the second capacity is generated according to the target speed; if it is the first-level equipment and the receiving device is the first-level equipment The second-level device, or in the case where it is the second-level device and the receiving device is the second-level device, generates a block of the second capacity according to the preset speed; wherein,
所述第一容量大于所述第二容量。The first capacity is greater than the second capacity.
其中,所述处理器还用于根据公式V=(K*m)*T/M,得到目标速度V;其中,K为所述第一级设备的相邻设备中第二级设备的数量,m为第二容量,T为预设速度,M为第一容量。Wherein, the processor is further configured to obtain the target speed V according to the formula V=(K*m)*T/M; wherein, K is the number of the second-level equipment in the adjacent equipment of the first-level equipment, m is the second capacity, T is the preset speed, and M is the first capacity.
其中,所述第一容量的区块封装了多个第二容量的区块,且所述第一容量的区块包括大区块标识。The blocks of the first capacity encapsulate a plurality of blocks of the second capacity, and the blocks of the first capacity include large block identifiers.
其中,所述第二容量的区块包括区块封装标识,所述区块封装标识用于表示所述区块的来源。Wherein, the block of the second capacity includes a block encapsulation identifier, and the block encapsulation identifier is used to indicate the source of the block.
其中,所述处理器还用于若自身为第一级设备,且接收到来自第一级设备的区块,则直接转发接收到的区块至接收设备中的第一级设备,并在对接收到区块解封装后,转发至接收设备中的第二级设备;若自身为第一级设备,且接收到来自第二级设备的区块,则直接转发接收到的区块至接收设备中的第二级设备,并在对接收到区块封装得到第一容量的区块后,转发至接收设备中的第一级设备;若自身为第二级设备,则将接收到的区块转发至接收设备。Wherein, the processor is further configured to directly forward the received block to the first-level device in the receiving device if it is the first-level device and receives the block from the first-level device, and in the pairing After receiving the block decapsulation, it is forwarded to the second-level device in the receiving device; if it is a first-level device and receives a block from the second-level device, it directly forwards the received block to the receiving device. The second-level equipment in the receiving device, and after encapsulating the received block to obtain a block of the first capacity, it is forwarded to the first-level device in the receiving equipment; if it is a second-level device, the received block forwarded to the receiving device.
其中,所述处理器还用于根据自身和相邻设备的设备等级,确定对应的转发激励。Wherein, the processor is further configured to determine corresponding forwarding incentives according to the device levels of itself and neighboring devices.
其中,所述处理器还用于若自身为第一级设备,则根据公式Q1=(S-s)*T/S,得到激励Q1;若自身为第二级设备,则根据公式Q2=s*T/S,得到激励Q2;其中,Wherein, the processor is further configured to obtain excitation Q 1 according to the formula Q 1 =(S-s)*T/S if it is the first-level device; if it is the second-level device, then according to the formula Q 2 =s*T/S, the excitation Q 2 is obtained; where,
S为所述第一级设备的出块速度;s为所述第二级设备的出块速度;T为预设基础激励。S is the block-producing speed of the first-level equipment; s is the block-producing speed of the second-level equipment; T is the preset basic excitation.
为达到上述目的,本发明的实施例提供一种区块链扩容处理装置,包括:In order to achieve the above purpose, an embodiment of the present invention provides a block chain expansion processing device, including:
获取模块,用于获取自身和相邻设备的网络带宽;The acquisition module is used to acquire the network bandwidth of itself and neighboring devices;
确定模块,用于根据自身和相邻设备的网络带宽,确定自身的设备等级,其中所述设备等级至少包括第一级设备和第二级设备,所述第一级设备自身以及与所述第一级设备相邻的至少一设备的网络带宽均为第一带宽,所述第二级设备自身以及与所述第二级设备相邻的设备的网络带宽至少包括第二带宽,所述第一带宽大于所述第二带宽;The determining module is configured to determine its own device level according to the network bandwidth of itself and adjacent devices, wherein the device level at least includes a first-level device and a second-level device, the first-level device itself and the The network bandwidth of at least one device adjacent to the first-level device is the first bandwidth, the network bandwidth of the second-level device itself and the devices adjacent to the second-level device include at least the second bandwidth, and the first the bandwidth is greater than the second bandwidth;
收发模块,用于将所述设备等级告知于相邻设备,并接收所述相邻设备发送的设备等级;a transceiver module, configured to notify the device level to the adjacent device, and receive the device level sent by the adjacent device;
生成模块,用于基于自身和接收设备的设备等级,进行区块的生成。The generation module is used to generate blocks based on the device level of the device itself and the receiving device.
为达到上述目的,本发明的实施例提供一种终端设备,包括收发器、存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序;所述处理器执行所述计算机程序时实现如上所述的区块链扩容处理方法。In order to achieve the above object, an embodiment of the present invention provides a terminal device, including a transceiver, a memory, a processor, and a computer program stored in the memory and running on the processor; the processor executes the The above-mentioned blockchain expansion processing method is realized when the computer program is described.
为达到上述目的,本发明的实施例提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如上所述的区块链扩容处理方法中的步骤。In order to achieve the above object, embodiments of the present invention provide a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the steps in the above-mentioned blockchain expansion processing method.
本发明的上述技术方案的有益效果如下:The beneficial effects of the above-mentioned technical solutions of the present invention are as follows:
本发明实施例的方法,在获取自身及相邻设备的网络带宽后,进一步由所获取的网络带宽确定出自身的设备等级,然后将设备等级告知于相邻设备,并接收相邻设备发送的设备等级,最终基于自身和接收设备的设备等级进行区块的生成。这样,考虑到了网络带宽的情况,提升系统容量的同时也保障了区块的安全性,实现效果更佳。In the method according to the embodiment of the present invention, after acquiring the network bandwidth of the self and the adjacent devices, the device level of the self is further determined from the acquired network bandwidth, and then the device level is notified to the adjacent devices, and the information sent by the adjacent devices is received. Device level, and finally generate blocks based on the device level of itself and the receiving device. In this way, considering the network bandwidth, the security of the block is also guaranteed while the system capacity is increased, and the realization effect is better.
附图说明Description of drawings
图1为本发明实施例的区块链扩容处理方法的流程图之一;FIG. 1 is one of the flowcharts of the blockchain expansion processing method according to an embodiment of the present invention;
图2a-2e为网络的节点示意图;2a-2e are schematic diagrams of nodes of the network;
图3为网络中设备等级分布示意图;Fig. 3 is a schematic diagram of device level distribution in the network;
图4为第一容量的区块结构示意图;4 is a schematic diagram of a block structure of a first capacity;
图5为第二容量的区块结构示意图;5 is a schematic diagram of the block structure of the second capacity;
图6为本发明实施例的终端设备的结构图;6 is a structural diagram of a terminal device according to an embodiment of the present invention;
图7为本发明另一实施例的终端设备的结构图。FIG. 7 is a structural diagram of a terminal device according to another embodiment of the present invention.
具体实施方式Detailed ways
为使本发明要解决的技术问题、技术方案和优点更加清楚,下面将结合附图及具体实施例进行详细描述。In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, the following will be described in detail with reference to the accompanying drawings and specific embodiments.
本发明针对现有的区块链无法满足日益增长的使用需求的问题,提供了一种区块链扩容处理方法,能够依据网络带宽优化区块链组网结构,提升系统容量。Aiming at the problem that the existing blockchain cannot meet the increasing use demand, the present invention provides a blockchain expansion processing method, which can optimize the blockchain networking structure according to the network bandwidth and improve the system capacity.
如图1所示,本发明实施例的一种区块链扩容处理方法,包括:As shown in FIG. 1 , a method for processing capacity expansion of a blockchain according to an embodiment of the present invention includes:
步骤101,获取自身和相邻设备的网络带宽;
步骤102,根据自身和相邻设备的网络带宽,确定自身的设备等级,其中所述设备等级至少包括第一级设备和第二级设备,所述第一级设备自身以及与所述第一级设备相邻的至少一设备的网络带宽均为第一带宽,所述第二级设备自身以及与所述第二级设备相邻的设备的网络带宽至少包括第二带宽,所述第一带宽大于所述第二带宽;Step 102: Determine its own device level according to the network bandwidth of itself and neighboring devices, wherein the device level at least includes a first-level device and a second-level device, the first-level device itself and the first-level device and the first-level device. The network bandwidth of at least one device adjacent to the device is the first bandwidth, and the network bandwidth of the second-level device itself and the device adjacent to the second-level device includes at least the second bandwidth, and the first bandwidth is greater than the second bandwidth;
步骤103,将所述设备等级告知于相邻设备,并接收所述相邻设备发送的设备等级;
步骤104,基于自身和接收设备的设备等级,进行区块的生成。
本发明实施例的区块链扩容处理方法应用于终端设备,而相邻设备则是基于网络结构,与该终端设备能够进行通信的其它终端设备。按照上述步骤,该终端设备在获取自身及相邻设备的网络带宽后,进一步由所获取的网络带宽确定出自身的设备等级,然后将设备等级告知于相邻设备,并接收相邻设备发送的设备等级,最终基于自身和接收设备的设备等级进行区块的生成。这样,考虑到了网络带宽的情况,提升系统容量的同时也保障了区块的安全性,实现效果更佳。The blockchain expansion processing method in the embodiment of the present invention is applied to a terminal device, and the adjacent devices are other terminal devices that can communicate with the terminal device based on the network structure. According to the above steps, after acquiring the network bandwidth of itself and its neighboring devices, the terminal device further determines its own device level from the acquired network bandwidth, then informs the neighboring devices of the device level, and receives the information sent by the neighboring devices. Device level, and finally generate blocks based on the device level of itself and the receiving device. In this way, considering the network bandwidth, the security of the block is also guaranteed while the system capacity is increased, and the realization effect is better.
应该知道的是,在该实施例中,终端设备与其相邻设备作为公有链上的节点都接入一个P2P网络中,所有节点都可以测试节点所在的网络的网络带宽。例如,目前最常用的两种网络带宽100Mbps和1000Mbps,节点A以100Mbps带宽接入网络,节点B以1000Mbps带宽接入网络,节点将网络测量结果暂存在节点本地,在需要的情况下,将自身的网络测量结果在其相邻节点间广播。It should be known that, in this embodiment, the terminal device and its adjacent devices are connected to a P2P network as nodes on the public chain, and all nodes can test the network bandwidth of the network where the nodes are located. For example, the two most commonly used network bandwidths are 100Mbps and 1000Mbps. Node A accesses the network with a bandwidth of 100Mbps, and Node B accesses the network with a bandwidth of 1000Mbps. The node temporarily stores the network measurement results locally at the node. The results of network measurements are broadcast among its neighbors.
例如,对于上述的两种网络带宽,终端设备分别称为100M节点和1000M节点,在接收到相邻节点的网络带宽后,有5种可能的情况:For example, for the above two network bandwidths, the terminal equipment is called a 100M node and a 1000M node respectively. After receiving the network bandwidth of the adjacent node, there are 5 possible situations:
(1)如图2a所示,自身为100M节点,相邻节点中有一个1000M节点:将自己标记成第二级设备;(1) As shown in Figure 2a, itself is a 100M node, and there is a 1000M node in the adjacent node: mark itself as a second-level device;
(2)如图2b所示,自身为100M节点,相邻节点中有多个1000M节点:将自己标记为第二级设备;(2) As shown in Figure 2b, itself is a 100M node, and there are multiple 1000M nodes in adjacent nodes: mark itself as a second-level device;
(3)如图2c所示,自身为100M节点,相邻节点中没有1000M节点:将自己标记为第二级设备;(3) As shown in Figure 2c, it is a 100M node, and there is no 1000M node in the adjacent nodes: mark itself as a second-level device;
(4)如图2d所示,自身为1000M节点,相邻节点都是100M节点:将自己标记为第二级设备;(4) As shown in Figure 2d, itself is a 1000M node, and the adjacent nodes are all 100M nodes: mark itself as a second-level device;
(5)如图2e所示,自身为1000M节点,相邻节点存在1000M节点:将自己标记为第一级设备。(5) As shown in Figure 2e, it is a 1000M node, and there are 1000M nodes in the adjacent nodes: mark itself as a first-level device.
之后,节点可将自己的设备等级广播给相邻节点,当然也可由相邻节点的广播信息获得相邻节点的设备等级。最终,部分1000M节点成为第一级设备,100M节点和部分1000M节点成为第二级设备。第二级设备可能没有与其相邻的第一级设备或者有唯一的第一级设备。第一级设备同时也知道与其相邻的第二级设备。一个网络的设备等级示意图如图3所示,包括5个第一级设备(斜杠填充)和7个第二级设备。After that, the node can broadcast its own equipment level to the adjacent nodes, and of course, the equipment level of the adjacent nodes can also be obtained from the broadcast information of the adjacent nodes. Finally, some 1000M nodes become first-level devices, and 100M nodes and some 1000M nodes become second-level devices. A second-level device may have no or only first-level device adjacent to it. A first-level device is also aware of its adjacent second-level devices. A schematic diagram of the device level of a network is shown in Figure 3, including 5 first-level devices (slash-filled) and 7 second-level devices.
当然,考虑到网络(如P2P网络)中,往往会不断有新的节点加入或退出,因此,在该实施例中,会检测链路连通,当检测到与相邻节点的连接关系发生变化时,会重新进行设备等级的判断。Of course, considering that in a network (such as a P2P network), new nodes often join or leave, therefore, in this embodiment, link connectivity is detected, and when it is detected that the connection relationship with adjacent nodes changes , the device level judgment will be performed again.
在该实施例中,可选地,步骤1023包括:In this embodiment, optionally, step 1023 includes:
在自身为第一级设备、接收设备为第一级设备的情况下,按照预设速度生成第一容量的区块;In the case that itself is the first-level device and the receiving device is the first-level device, generate a block of the first capacity according to a preset speed;
在自身为第二级设备、接收设备为第一级设备的情况下,根据所述第一级设备的相邻设备数量确定目标速度,按照所述目标速度生成第二容量的区块;In the case that the device itself is the second-level device and the receiving device is the first-level device, the target speed is determined according to the number of adjacent devices of the first-level device, and the block of the second capacity is generated according to the target speed;
在自身为第一级设备、接收设备为第二级设备,或者自身为第二级设备、接收设备为第二级设备的情况下,按照预设速度生成第二容量的区块;其中,In the case where it is a first-level device and the receiving device is a second-level device, or is a second-level device and the receiving device is a second-level device, a block of the second capacity is generated according to a preset speed; wherein,
所述第一容量大于所述第二容量。The first capacity is greater than the second capacity.
这样,将能够针对终端设备自身以及接收设备的设备等级,采用更合理的方式生成区块。对于自身为第一级设备、接收设备为第一级设备的情况,由于网络状态较好,较大的数据区块会更好的提高效率,改善系统容量,因此,会按照预设速度生成第一容量的区块;对于自身为第一级设备、接收设备为第二级设备,或者自身为第二级设备、接收设备为第二级设备的情况,由于网络的限制,则会按照预设速度生成第二容量的区块;对于自身为第二级设备、接收设备为第一级设备的情况,则可以提高出块速度,来达到改善系统容量的目的,具体的,根据第一级设备的相邻设备数量确定目标速度,按照该目标速度生成第二容量的区块。In this way, blocks can be generated in a more reasonable manner according to the terminal equipment itself and the equipment level of the receiving equipment. For the case where it is the first-level device and the receiving device is the first-level device, due to the good network status, a larger data block will better improve the efficiency and improve the system capacity. Therefore, the first level will be generated at the preset speed. A block with a capacity; for the case where it is the first-level device, the receiving device is the second-level device, or the second-level device and the receiving device is the second-level device, due to network limitations, the default The speed of generating blocks of the second capacity; for the case where the device itself is the second-level device and the receiving device is the first-level device, the block generation speed can be increased to achieve the purpose of improving the system capacity. Specifically, according to the first-level device The number of adjacent devices of , determines the target speed, and generates blocks of the second capacity according to the target speed.
其中,优选地,所述根据所述第一级设备的相邻设备数量确定目标速度,包括:Wherein, preferably, determining the target speed according to the number of adjacent devices of the first-level device includes:
根据公式V=(K*m)*T/M,得到目标速度V;其中,K为所述第一级设备的相邻设备中第二级设备的数量,m为第二容量,T为预设速度,M为第一容量。According to the formula V=(K*m)*T/M, the target speed V is obtained; wherein, K is the number of second-level equipment in the adjacent equipment of the first-level equipment, m is the second capacity, and T is the preset Set the speed, M is the first capacity.
这样,作为当前第二级设备的接收设备的第一级设备,就能够进一步在在负载可控的情况下较高效率的产生大区块,充分利用第一级设备提升系统效率。In this way, the first-level equipment, which is the receiving equipment of the current second-level equipment, can further generate large blocks with high efficiency under the condition of controllable load, and make full use of the first-level equipment to improve the system efficiency.
假设,预设速度为10分钟/块,第一容量的区块为10M区块,第二容量的区块为1M区块,具体地:Assuming that the preset speed is 10 minutes/block, the block of the first capacity is a 10M block, and the block of the second capacity is a 1M block, specifically:
两个第一级设备之间,由于网络状态较好,可以使用10M区块作为最大区块,采用10分钟/块生成区块;Between two first-level devices, due to the good network status, 10M block can be used as the largest block, and 10 minutes/block can be used to generate blocks;
第一级设备与接收设备为第二级设备之间,由于网络的限制,使用1M区块作为最大区块,采用10分钟/块生成区块;Between the first-level equipment and the receiving equipment is the second-level equipment, due to network limitations, 1M block is used as the largest block, and 10 minutes/block is used to generate blocks;
两个第二级设备之间,使用1M区块作为最大区块,采用10分钟/块生成区块;Between two second-level devices, use 1M block as the largest block, and use 10 minutes/block to generate blocks;
第二级设备与接收设备为第一级设备之间,由于在网络中有4个设备连接到该第一级设备,通过公式V=(K*m)*T/M,可得到目标速度=(4*1)*10/10,也即4分钟/块,使用1M区块作为最大区块。Between the second-level device and the receiving device is the first-level device, since there are 4 devices connected to the first-level device in the network, through the formula V=(K*m)*T/M, the target speed can be obtained= (4*1)*10/10, which is 4 minutes/block, using 1M block as the largest block.
需要知道的是,在该实施例中,预设速度多为固定值,可不降低将全网作为一个整体的出块速度,使得数据的安全性和改造前基本维持一致。当然,在网络情况允许的情况下,也可以针对网络进行预设速度调整。It should be noted that, in this embodiment, the preset speed is mostly a fixed value, and the block generation speed of the entire network as a whole may not be reduced, so that the security of the data is basically the same as before the transformation. Of course, if the network conditions allow, the preset speed adjustment can also be performed for the network.
还应该知道的是,该实施例中,所述第一容量的区块封装了多个第二容量的区块,且所述第一容量的区块包括大区块标识。It should also be known that, in this embodiment, the block of the first capacity encapsulates a plurality of blocks of the second capacity, and the block of the first capacity includes a large block identifier.
这样,如图4所示,第一容量的区块中封装了多个第二容量的区块,第二容量的区块可以链表形式存储。而由于第一容量的区块包括了大区块标识(可添加在区块头部),便于识别出第一容量的区块,当需要将大区块拆成第二容量的区块时,依次取出封装的第二容量的区块即可。In this way, as shown in FIG. 4 , a plurality of blocks of the second capacity are encapsulated in the block of the first capacity, and the blocks of the second capacity can be stored in the form of a linked list. Since the block of the first capacity includes a large block identifier (which can be added to the block header), it is easy to identify the block of the first capacity. When the large block needs to be split into a block of the second capacity, The encapsulated blocks of the second capacity can be taken out in sequence.
可选地,所述第二容量的区块包括区块封装标识,所述区块封装标识用于表示所述区块的来源。Optionally, the block of the second capacity includes a block encapsulation identifier, and the block encapsulation identifier is used to indicate the source of the block.
如图5所示,第二容量的区块添加了用于表示区块自身的来源的区块封装标识(可添加在区块头部),如此,通过该区块封装标识即可了解到该区块是第二级设备产生的,还是从第一容量的区块中解封装出来的。因为二者难度不同。As shown in Figure 5, the block of the second capacity is added with a block encapsulation identifier (which can be added to the block header) for indicating the source of the block itself, so that the block encapsulation identifier can be used to know the Whether the block is generated by the second-level device, or decapsulated from the block of the first capacity. Because the difficulty of the two is different.
另外,在该实施例中,对于已生成区块的收发,所述方法包括:In addition, in this embodiment, for the transceiving of the generated block, the method includes:
若自身为第一级设备,且接收到来自第一级设备的区块,则直接转发接收到的区块至接收设备中的第一级设备,并在对接收到区块解封装后,转发至接收设备中的第二级设备;If it is a first-level device and receives a block from the first-level device, it directly forwards the received block to the first-level device in the receiving device, and after decapsulating the received block, forwards the block. to secondary equipment in the receiving equipment;
若自身为第一级设备,且接收到来自第二级设备的区块,则直接转发接收到的区块至接收设备中的第二级设备,并在对接收到区块封装得到第一容量的区块后,转发至接收设备中的第一级设备;If it is a first-level device and receives a block from a second-level device, it directly forwards the received block to the second-level device in the receiving device, and encapsulates the received block to obtain the first capacity After the block, it is forwarded to the first-level equipment in the receiving equipment;
若自身为第二级设备,则将接收到的区块转发至接收设备。If it is a second-level device, it forwards the received block to the receiving device.
这里,对于第一级设备的收发规则,对接收到来自第一级设备的区块,是直接转发接收到的区块至接收设备中的第一级设备,同时,在对接收到区块解封装后,转发至接收设备中的第二级设备;对于接收到来自第二级设备的区块,是直接转发接收到的区块至接收设备中的第二级设备,同时,在对接收到区块封装得到第一容量的区块后,转发至接收设备中的第一级设备。对于第二级设备的收发规则,是将接收到的区块转发至接收设备。Here, for the sending and receiving rules of the first-level device, for the block received from the first-level device, it is to directly forward the received block to the first-level device in the receiving device. After encapsulation, it is forwarded to the second-level device in the receiving device; for the block received from the second-level device, the received block is directly forwarded to the second-level device in the receiving device. After the block encapsulation obtains the block of the first capacity, it is forwarded to the first-level device in the receiving device. For the sending and receiving rules of the second-level device, the received block is forwarded to the receiving device.
一般而言,在公有区块链中,存在激励机制,以鼓励更多的节点参与系统,为系统服务的同时获得回报。因此,在该实施例中,所述方法还包括:Generally speaking, in public blockchains, there is an incentive mechanism to encourage more nodes to participate in the system and get rewards while serving the system. Therefore, in this embodiment, the method further includes:
根据自身和相邻设备的设备等级,确定对应的转发激励。Determine the corresponding forwarding incentives according to the device levels of the device itself and neighboring devices.
可选地,所述根据自身和相邻设备的设备等级,确定对应的激励,包括:Optionally, determining the corresponding incentives according to the device levels of the device itself and neighboring devices, including:
若自身为第一级设备,则根据公式Q1=(S-s)*T/S,得到激励Q1;If it is the first-level equipment, the excitation Q 1 is obtained according to the formula Q 1 =(S-s)*T/S;
若自身为第二级设备,则根据公式Q2=s*T/S,得到激励Q2;其中,If it is a second-level device, the excitation Q 2 is obtained according to the formula Q 2 =s*T/S; among them,
S为所述第一级设备的出块速度;s为所述第二级设备的出块速度;T为预设基础激励。S is the block-producing speed of the first-level equipment; s is the block-producing speed of the second-level equipment; T is the preset basic excitation.
如此,通过上述公式,就能够针对不同等级设备给予其适当的激励,当然,具体的激励方式不限于上述内容,在此不再一一列举。In this way, through the above formula, appropriate incentives can be given to devices of different grades. Of course, the specific incentive methods are not limited to the above content, and will not be listed one by one here.
综上所述,本发明实施例的区块链扩容处理方法,在获取自身及相邻设备的网络带宽后,进一步由所获取的网络带宽进行区块的生成,能够依据网络带宽状况,优化区块链组网结构,提升系统容量;允许区块链上区块大小不同,由终端设备依据网络情况决策;高带宽节点转发大区块时可获得额外激励,维持系统整体公平性。To sum up, the blockchain expansion processing method according to the embodiment of the present invention, after obtaining the network bandwidth of itself and its adjacent devices, further generates blocks based on the obtained network bandwidth, which can optimize the area according to the network bandwidth status. The blockchain networking structure increases the system capacity; allows the blocks on the blockchain to have different sizes, and the terminal device makes decisions based on network conditions; high-bandwidth nodes can obtain additional incentives when forwarding large blocks to maintain the overall fairness of the system.
如图6所示,本发明实施例的一种终端设备600,包括处理器610和收发器620,其中,As shown in FIG. 6, a
所述处理器610用于获取自身和相邻设备的网络带宽;根据自身和相邻设备的网络带宽,确定自身的设备等级,其中所述设备等级至少包括第一级设备和第二级设备,所述第一级设备自身以及与所述第一级设备相邻的至少一设备的网络带宽均为第一带宽,所述第二级设备自身以及与所述第二级设备相邻的设备的网络带宽至少包括第二带宽,所述第一带宽大于所述第二带宽;The
所述收发器620用于将所述设备等级告知于相邻设备,并接收所述相邻设备发送的设备等级;The
所述处理器610还用于基于自身和接收设备的设备等级,进行区块的生成。The
可选地,所述处理器610还用于在自身为第一级设备、接收设备为第一级设备的情况下,按照预设速度生成第一容量的区块;在自身为第二级设备、接收设备为第一级设备的情况下,根据所述第一级设备的相邻设备数量确定目标速度,按照所述目标速度生成第二容量的区块;在自身为第一级设备、接收设备为第二级设备,或者自身为第二级设备、接收设备为第二级设备的情况下,按照预设速度生成第二容量的区块;其中,Optionally, the
所述第一容量大于所述第二容量。The first capacity is greater than the second capacity.
可选地,所述处理器610还用于根据公式V=(K*m)*T/M,得到目标速度V;其中,K为所述第一级设备的相邻设备中第二级设备的数量,m为第二容量,T为预设速度,M为第一容量。Optionally, the
可选地,所述第一容量的区块封装了多个第二容量的区块,且所述第一容量的区块包括大区块标识。Optionally, the first-capacity block encapsulates a plurality of second-capacity blocks, and the first-capacity block includes a large block identifier.
可选地,所述第二容量的区块包括区块封装标识,所述区块封装标识用于表示所述区块的来源。Optionally, the block of the second capacity includes a block encapsulation identifier, and the block encapsulation identifier is used to indicate the source of the block.
可选地,所述处理器610还用于若自身为第一级设备,且接收到来自第一级设备的区块,则直接转发接收到的区块至接收设备中的第一级设备,并在对接收到区块解封装后,转发至接收设备中的第二级设备;若自身为第一级设备,且接收到来自第二级设备的区块,则直接转发接收到的区块至接收设备中的第二级设备,并在对接收到区块封装得到第一容量的区块后,转发至接收设备中的第一级设备;若自身为第二级设备,则将接收到的区块转发至接收设备。Optionally, the
可选地,所述处理器610还用于根据自身和相邻设备的设备等级,确定对应的转发激励。Optionally, the
可选地,所述处理器610还用于若自身为第一级设备,则根据公式Q1=(S-s)*T/S,得到激励Q1;若自身为第二级设备,则根据公式Q2=s*T/S,得到激励Q2;其中,Optionally, the
S为所述第一级设备的出块速度;s为所述第二级设备的出块速度;T为预设基础激励。S is the block-producing speed of the first-level equipment; s is the block-producing speed of the second-level equipment; T is the preset basic excitation.
本发明实施例的终端设备,在获取自身及相邻设备的网络带宽后,进一步由所获取的网络带宽进行区块的生成,能够依据网络带宽状况,优化区块链组网结构,提升系统容量;允许区块链上区块大小不同,由终端设备依据网络情况决策;高带宽节点转发大区块时可获得额外激励,维持系统整体公平性。The terminal device in the embodiment of the present invention, after acquiring the network bandwidth of itself and adjacent devices, further generates blocks based on the acquired network bandwidth, which can optimize the blockchain networking structure and improve the system capacity according to the network bandwidth status. ; Allow different block sizes on the blockchain, and the terminal device makes decisions based on network conditions; high-bandwidth nodes can obtain additional incentives when forwarding large blocks to maintain the overall fairness of the system.
本发明另一实施例的区块链扩容处理装置,包括:A block chain expansion processing device according to another embodiment of the present invention includes:
获取模块,用于获取自身和相邻设备的网络带宽;The acquisition module is used to acquire the network bandwidth of itself and neighboring devices;
确定模块,用于根据自身和相邻设备的网络带宽,确定自身的设备等级,其中所述设备等级至少包括第一级设备和第二级设备,所述第一级设备自身以及与所述第一级设备相邻的至少一设备的网络带宽均为第一带宽,所述第二级设备自身以及与所述第二级设备相邻的设备的网络带宽至少包括第二带宽,所述第一带宽大于所述第二带宽;The determining module is configured to determine its own device level according to the network bandwidth of itself and adjacent devices, wherein the device level at least includes a first-level device and a second-level device, the first-level device itself and the The network bandwidth of at least one device adjacent to the first-level device is the first bandwidth, the network bandwidth of the second-level device itself and the devices adjacent to the second-level device include at least the second bandwidth, and the first the bandwidth is greater than the second bandwidth;
收发模块,用于将所述设备等级告知于相邻设备,并接收所述相邻设备发送的设备等级;a transceiver module, configured to notify the device level to the adjacent device, and receive the device level sent by the adjacent device;
生成模块,用于基于自身和接收设备的设备等级,进行区块的生成。The generation module is used to generate blocks based on the device level of the device itself and the receiving device.
其中,所述生成模块具体用于:Wherein, the generation module is specifically used for:
在自身为第一级设备、接收设备为第一级设备的情况下,按照预设速度生成第一容量的区块;In the case that itself is the first-level device and the receiving device is the first-level device, generate a block of the first capacity according to a preset speed;
在自身为第二级设备、接收设备为第一级设备的情况下,根据所述第一级设备的相邻设备数量确定目标速度,按照所述目标速度生成第二容量的区块;In the case that the device itself is the second-level device and the receiving device is the first-level device, the target speed is determined according to the number of adjacent devices of the first-level device, and the block of the second capacity is generated according to the target speed;
在自身为第一级设备、接收设备为第二级设备,或者自身为第二级设备、接收设备为第二级设备的情况下,按照预设速度生成第二容量的区块;其中,In the case where it is a first-level device and the receiving device is a second-level device, or is a second-level device and the receiving device is a second-level device, a block of the second capacity is generated according to a preset speed; wherein,
所述第一容量大于所述第二容量。The first capacity is greater than the second capacity.
其中,所述生成模块具体用于:Wherein, the generation module is specifically used for:
根据公式V=(K*m)*T/M,得到目标速度V;其中,K为所述第一级设备的相邻设备中第二级设备的数量,m为第二容量,T为预设速度,M为第一容量。According to the formula V=(K*m)*T/M, the target speed V is obtained; wherein, K is the number of second-level equipment in the adjacent equipment of the first-level equipment, m is the second capacity, and T is the preset Set the speed, M is the first capacity.
其中,所述第一容量的区块封装了多个第二容量的区块,且所述第一容量的区块包括大区块标识。The blocks of the first capacity encapsulate a plurality of blocks of the second capacity, and the blocks of the first capacity include large block identifiers.
其中,所述第二容量的区块包括区块封装标识,所述区块封装标识用于表示所述区块的来源。Wherein, the block of the second capacity includes a block encapsulation identifier, and the block encapsulation identifier is used to indicate the source of the block.
其中,所述装置包括:Wherein, the device includes:
第一区块收发模块,用于若自身为第一级设备,且接收到来自第一级设备的区块,则直接转发接收到的区块至接收设备中的第一级设备,并在对接收到区块解封装后,转发至接收设备中的第二级设备;The first block transceiver module is used for directly forwarding the received block to the first-level device in the receiving device if it is a first-level device and receives a block from the first-level device, and sends the block to the first-level device in the receiving device. After receiving the block decapsulation, it is forwarded to the second-level device in the receiving device;
第二区块收发模块,用于若自身为第一级设备,且接收到来自第二级设备的区块,则直接转发接收到的区块至接收设备中的第二级设备,并在对接收到区块封装得到第一容量的区块后,转发至接收设备中的第一级设备;The second block transceiver module is used for directly forwarding the received block to the second-level device in the receiving device if it is the first-level device and receiving the block from the second-level device, and in the pairing After receiving the block encapsulation to obtain the block of the first capacity, it is forwarded to the first-level equipment in the receiving equipment;
第三区块收发模块,用于若自身为第二级设备,则将接收到的区块转发至接收设备。The third block transceiver module is used for forwarding the received block to the receiving device if it is a second-level device.
其中,所述装置还包括:Wherein, the device also includes:
激励模块,用于根据自身和相邻设备的设备等级,确定对应的转发激励。The excitation module is used to determine the corresponding forwarding excitation according to the device level of the device itself and adjacent devices.
其中,所述激励模块具体用于:Wherein, the incentive module is specifically used for:
若自身为第一级设备,则根据公式Q1=(S-s)*T/S,得到激励Q1;If it is the first-level equipment, the excitation Q 1 is obtained according to the formula Q 1 =(S-s)*T/S;
若自身为第二级设备,则根据公式Q2=s*T/S,得到激励Q2;其中,If it is a second-level device, the excitation Q 2 is obtained according to the formula Q 2 =s*T/S; among them,
S为所述第一级设备的出块速度;s为所述第二级设备的出块速度;T为预设基础激励。S is the block-producing speed of the first-level equipment; s is the block-producing speed of the second-level equipment; T is the preset basic excitation.
本发明实施例的区块链扩容处理装置,在获取自身及相邻设备的网络带宽后,进一步由所获取的网络带宽确定出自身的设备等级,然后将设备等级告知于相邻设备,并接收相邻设备发送的设备等级,最终基于自身和接收设备的设备等级进行区块的生成,能够依据网络带宽状况,优化区块链组网结构,提升系统容量;允许区块链上区块大小不同,由终端设备依据网络情况决策;高带宽节点转发大区块时可获得额外激励,维持系统整体公平性。The block chain expansion processing device according to the embodiment of the present invention, after acquiring the network bandwidth of itself and its neighboring devices, further determines its own device level from the acquired network bandwidth, and then informs the neighboring devices of the device level, and receives The device level sent by the neighboring device, and finally the block generation is performed based on the device level of itself and the receiving device, which can optimize the blockchain networking structure and improve the system capacity according to the network bandwidth status; allow different block sizes on the blockchain , the terminal device makes decisions based on network conditions; high-bandwidth nodes can obtain additional incentives when forwarding large blocks to maintain the overall fairness of the system.
本发明另一实施例的终端设备,如图7所示,包括收发器710、存储器720、处理器700及存储在所述存储器720上并可在所述处理器700上运行的计算机程序;所述处理器700执行所述计算机程序时实现如上所述的区块链扩容处理方法。A terminal device according to another embodiment of the present invention, as shown in FIG. 7 , includes a
所述收发器710,用于在处理器700的控制下接收和发送数据。The
其中,在图7中,总线架构可以包括任意数量的互联的总线和桥,具体由处理器700代表的一个或多个处理器和存储器720代表的存储器的各种电路链接在一起。总线架构还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口提供接口。收发器710可以是多个元件,即包括发送机和接收机,提供用于在传输介质上与各种其他装置通信的单元。针对不同的用户设备,用户接口730还可以是能够外接内接需要设备的接口,连接的设备包括但不限于小键盘、显示器、扬声器、麦克风、操纵杆等。7, the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by
处理器700负责管理总线架构和通常的处理,存储器720可以存储处理器700在执行操作时所使用的数据。The
本发明实施例的一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如上所述的区块链扩容处理方法中的步骤,且能达到相同的技术效果,为避免重复,这里不再赘述。其中,所述的计算机可读存储介质,如只读存储器(Read-Only Memory,简称ROM)、随机存取存储器(Random Access Memory,简称RAM)、磁碟或者光盘等。A computer-readable storage medium according to an embodiment of the present invention stores a computer program thereon, and when the computer program is executed by a processor, implements the steps in the blockchain expansion processing method as described above, and can achieve the same technology The effect, in order to avoid repetition, is not repeated here. The computer-readable storage medium is, for example, a read-only memory (Read-Only Memory, ROM for short), a random access memory (Random Access Memory, RAM for short), a magnetic disk, or an optical disk.
进一步需要说明的是,此说明书中所描述的终端包括但不限于智能手机、平板电脑等,且所描述的许多功能部件都被称为模块,以便更加特别地强调其实现方式的独立性。It should be further noted that the terminals described in this specification include but are not limited to smart phones, tablet computers, etc., and many of the described functional components are referred to as modules to more particularly emphasize the independence of their implementations.
本发明实施例中,模块可以用软件实现,以便由各种类型的处理器执行。举例来说,一个标识的可执行代码模块可以包括计算机指令的一个或多个物理或者逻辑块,举例来说,其可以被构建为对象、过程或函数。尽管如此,所标识模块的可执行代码无需物理地位于一起,而是可以包括存储在不同位里上的不同的指令,当这些指令逻辑上结合在一起时,其构成模块并且实现该模块的规定目的。In this embodiment of the present invention, the modules may be implemented in software so as to be executed by various types of processors. For example, an identified executable code module may comprise one or more physical or logical blocks of computer instructions, which may be structured as objects, procedures, or functions, for example. Nonetheless, the executable code of the identified module need not be physically located together, but may include different instructions stored in different bits that, when logically combined, constitute the module and implement the specification of the module Purpose.
实际上,可执行代码模块可以是单条指令或者是许多条指令,并且甚至可以分布在多个不同的代码段上,分布在不同程序当中,以及跨越多个存储器设备分布。同样地,操作数据可以在模块内被识别,并且可以依照任何适当的形式实现并且被组织在任何适当类型的数据结构内。所述操作数据可以作为单个数据集被收集,或者可以分布在不同位置上(包括在不同存储设备上),并且至少部分地可以仅作为电子信号存在于系统或网络上。In practice, an executable code module may be a single instruction or many instructions, and may even be distributed over multiple different code segments, among different programs, and across multiple memory devices. Likewise, operational data may be identified within modules, and may be implemented in any suitable form and organized within any suitable type of data structure. The operational data may be collected as a single data set, or may be distributed over different locations (including over different storage devices), and may exist at least in part only as electronic signals on a system or network.
在模块可以利用软件实现时,考虑到现有硬件工艺的水平,所以可以以软件实现的模块,在不考虑成本的情况下,本领域技术人员都可以搭建对应的硬件电路来实现对应的功能,所述硬件电路包括常规的超大规模集成(VLSI)电路或者门阵列以及诸如逻辑芯片、晶体管之类的现有半导体或者是其它分立的元件。模块还可以用可编程硬件设备,诸如现场可编程门阵列、可编程阵列逻辑、可编程逻辑设备等实现。When a module can be implemented by software, considering the level of existing hardware technology, a module that can be implemented by software, regardless of cost, can build corresponding hardware circuits to implement corresponding functions. The hardware circuits include conventional very large scale integration (VLSI) circuits or gate arrays as well as off-the-shelf semiconductors such as logic chips, transistors, or other discrete components. A module may also be implemented in programmable hardware devices, such as field programmable gate arrays, programmable array logic, programmable logic devices, and the like.
上述范例性实施例是参考该些附图来描述的,许多不同的形式和实施例是可行而不偏离本发明精神及教示,因此,本发明不应被建构成为在此所提出范例性实施例的限制。更确切地说,这些范例性实施例被提供以使得本发明会是完善又完整,且会将本发明范围传达给那些熟知此项技术的人士。在该些图式中,组件尺寸及相对尺寸也许基于清晰起见而被夸大。在此所使用的术语只是基于描述特定范例性实施例目的,并无意成为限制用。如在此所使用地,除非该内文清楚地另有所指,否则该单数形式“一”、“一个”和“该”是意欲将该些多个形式也纳入。会进一步了解到该些术语“包含”及/或“包括”在使用于本说明书时,表示所述特征、整数、步骤、操作、构件及/或组件的存在,但不排除一或更多其它特征、整数、步骤、操作、构件、组件及/或其族群的存在或增加。除非另有所示,陈述时,一值范围包含该范围的上下限及其间的任何子范围。The above-described exemplary embodiments are described with reference to the drawings, many different forms and embodiments are possible without departing from the spirit and teachings of the present invention, and therefore the present invention should not be construed as the exemplary embodiments set forth herein limits. Rather, these exemplary embodiments are provided so that this disclosure will be thorough and complete, and will convey the scope of the invention to those skilled in the art. In the drawings, component sizes and relative sizes may be exaggerated for clarity. The terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. As used herein, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It will be further understood that the terms "comprising" and/or "comprising" when used in this specification denote the presence of stated features, integers, steps, operations, components and/or components, but do not exclude one or more other The presence or addition of features, integers, steps, operations, components, components and/or groups thereof. Unless otherwise indicated, when stated, a range of values includes the upper and lower limits of that range and any subranges therebetween.
以上所述是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明所述原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above are the preferred embodiments of the present invention. It should be pointed out that for those skilled in the art, without departing from the principles of the present invention, several improvements and modifications can be made. It should be regarded as the protection scope of the present invention.
Claims (17)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811281730.8A CN111092925B (en) | 2018-10-23 | 2018-10-23 | Block chain capacity expansion processing method, device and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811281730.8A CN111092925B (en) | 2018-10-23 | 2018-10-23 | Block chain capacity expansion processing method, device and equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111092925A CN111092925A (en) | 2020-05-01 |
CN111092925B true CN111092925B (en) | 2022-08-05 |
Family
ID=70392275
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811281730.8A Active CN111092925B (en) | 2018-10-23 | 2018-10-23 | Block chain capacity expansion processing method, device and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111092925B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111769946B (en) * | 2020-05-08 | 2022-08-19 | 贵阳信息技术研究院(中科院软件所贵阳分部) | Large-scale node capacity expansion method for alliance chain |
CN111625196A (en) * | 2020-05-26 | 2020-09-04 | 北京海益同展信息科技有限公司 | Block chain node capacity expansion method and device, computer equipment and storage medium |
CN111737362B (en) * | 2020-07-22 | 2020-12-22 | 百度在线网络技术(北京)有限公司 | Block chain processing method, device, equipment and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105814900A (en) * | 2013-09-25 | 2016-07-27 | 爱立信股份有限公司 | System and method for managing adjacent channels in an adaptive streaming environment |
CN106296191A (en) * | 2016-08-13 | 2017-01-04 | 深圳市樊溪电子有限公司 | A kind of PoW common recognition mechanism of block chain power-aware |
CN107277781A (en) * | 2017-05-03 | 2017-10-20 | 上海点融信息科技有限责任公司 | Block chain multicast network, block chain equipment and its communication means under mobile broadband network |
CN107330786A (en) * | 2017-05-19 | 2017-11-07 | 杭州云象网络技术有限公司 | A kind of block chain network node communication method based on weight |
CN107528886A (en) * | 2017-07-25 | 2017-12-29 | 中国科学院计算技术研究所 | Block chain the whole network method for splitting and system |
WO2018183148A1 (en) * | 2017-03-29 | 2018-10-04 | Alibaba Group Holding Limited | Method, apparatus, and system for blockchain consensus |
-
2018
- 2018-10-23 CN CN201811281730.8A patent/CN111092925B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105814900A (en) * | 2013-09-25 | 2016-07-27 | 爱立信股份有限公司 | System and method for managing adjacent channels in an adaptive streaming environment |
CN106296191A (en) * | 2016-08-13 | 2017-01-04 | 深圳市樊溪电子有限公司 | A kind of PoW common recognition mechanism of block chain power-aware |
WO2018183148A1 (en) * | 2017-03-29 | 2018-10-04 | Alibaba Group Holding Limited | Method, apparatus, and system for blockchain consensus |
CN107277781A (en) * | 2017-05-03 | 2017-10-20 | 上海点融信息科技有限责任公司 | Block chain multicast network, block chain equipment and its communication means under mobile broadband network |
CN107330786A (en) * | 2017-05-19 | 2017-11-07 | 杭州云象网络技术有限公司 | A kind of block chain network node communication method based on weight |
CN107528886A (en) * | 2017-07-25 | 2017-12-29 | 中国科学院计算技术研究所 | Block chain the whole network method for splitting and system |
Non-Patent Citations (3)
Title |
---|
InfiniteChain:A Multi-chain Architecture with Distributed Auditing of Sidechains for Public Blockchains;Po-Han Chen,Chun-Hao Chiu,Hsuan-Cheng Lin,An-Jie Jheng;《Lecture Notes in Computer Science》;20180622;全文 * |
区块链全局账本数据的拆分技术研究;于雷等;《高技术通讯》;20171215;全文 * |
比特币现金区块链扩容技术研究;金钊;《电子世界》;20180308;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN111092925A (en) | 2020-05-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11729006B2 (en) | Securing communications | |
US10742760B2 (en) | Neworking internet of things (IoT) devices | |
CN106162684B (en) | Method, device and system for data transmission based on ZigBee network | |
CN111092925B (en) | Block chain capacity expansion processing method, device and equipment | |
CN112468372B (en) | Equipment status detection method and device in power line communication network | |
CN108418884A (en) | A kind of method, apparatus and electronic equipment of transmission services data | |
CN102883337B (en) | Multihop network construction method, set up device and node | |
CN114039798A (en) | Data transmission method and device and electronic equipment | |
CN111314394B (en) | Resource publishing method, device, equipment and storage medium of Internet of things | |
CN107959642B (en) | Method, device and system for measuring network path | |
CN112165505A (en) | Decentralized data processing method, electronic device and storage medium | |
CN114979148B (en) | Data transmission method, device and computer readable storage medium | |
CN119211254A (en) | A data processing method, switching node and related system | |
CN113259887B (en) | Power distribution body area network and transmission method thereof | |
CN111885588B (en) | Method and device for executing electronic card management service | |
CN114208122B (en) | Autonomous semantic data discovery for distributed networking systems | |
CN113708946B (en) | Computing system and message routing method | |
CN114363359A (en) | A block synchronization method, device, electronic device and storage medium | |
CN110929101A (en) | A method and device for determining connected components and strongly connected components | |
CN101801033B (en) | AC selection method and equipment | |
CN105636182B (en) | A kind of information processing method and corresponding intrument | |
Haripriya | The performance optimization of approximate minimum spanning tree for the different mobility model | |
CN119583353B (en) | Construction method of network topology structure, data transmission method, electronic equipment and computer program product | |
WO2024148578A1 (en) | Model training method and apparatus | |
Kaur et al. | Link Recovery in IoT Using Buffer Size Scheme |
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 |