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
- equipment
- block
- level
- stage
- capacity
- 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 15
- 238000000034 method Methods 0.000 claims abstract description 19
- 238000012545 processing Methods 0.000 claims abstract description 13
- 230000005284 excitation Effects 0.000 claims description 33
- 238000012856 packing Methods 0.000 claims description 14
- 238000004590 computer program Methods 0.000 claims description 12
- 238000004806 packaging method and process Methods 0.000 claims description 8
- 238000004891 communication Methods 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 5
- 230000006855 networking Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000005259 measurement Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000005538 encapsulation Methods 0.000 description 1
- 230000010354 integration 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
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 capacity expansion processing method, a block chain capacity expansion processing device and block chain capacity expansion processing equipment, and relates to the technical field of communication. The method comprises the following steps: acquiring network bandwidths of the device and adjacent equipment; determining a device level of the device according to network bandwidths of the device and adjacent devices, wherein the device level at least comprises a first-level device and a second-level device, the network bandwidths of the first-level device and at least one device adjacent to the first-level device are both first bandwidths, the network bandwidths of the second-level device and the device adjacent to the second-level device at least comprise a second bandwidth, and the first bandwidth is larger than the second bandwidth; informing the equipment grade to adjacent equipment, and receiving the equipment grade sent by the adjacent equipment; the generation of the block is performed based on the device class of the receiving device and the self. The scheme of the invention solves the problem that the existing block chain can not meet the use requirement.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, an apparatus, and a device for processing a block chain in a capacity expansion mode.
Background
With the popularity and maturity of bitcoin, blockchain technology as an underlying layer has attracted a great deal of attention. Due to the characteristics of distributed centerless, data non-tampering, traceability and the like, block chain technology is introduced into various industries to solve the service problems in the past. Technically, a blockchain is a distributed database system, and specifically includes core technologies such as cryptography, peer-to-peer P2P network, and the like. From the chain form, the blockchain includes application forms such as public chain, private chain and alliance chain.
The public chain has the following technical characteristics: 1. organizing nodes based on a P2P network; 2. chain storage of blocks; 3. adopting a certain consensus mechanism for achieving the consistency among the nodes; 4. some incentive mechanism is employed to encourage more nodes to join the system. Taking the typical representative bit coin of the public chain as an example, as the global nodes are increasing, the whole network computing power is increasing, and the bit coin block chain faces a severe problem of capacity expansion. First, each transaction is recorded on a block, and the linked chain structure of blocks determines that the system is essentially a linear sequence. Second, the block size and the time interval between blocks rigidly determine the number of transactions the system can accommodate per unit time.
However, bitcoin a block size of 1MB, an average of 10 minutes results in a block, 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 use of public chains such as bitcoins in high-concurrency high-throughput environments. Therefore, the existing block chain cannot meet the increasing use requirement.
Disclosure of Invention
The invention aims to provide a block chain capacity expansion processing method, a block chain capacity expansion processing device and block chain capacity expansion processing equipment, and aims to solve the problem that an existing block chain cannot meet use requirements.
To achieve the above object, an embodiment of the present invention provides a block chain capacity expansion processing method, including:
acquiring network bandwidths of the device and adjacent equipment;
determining a device level of the device according to network bandwidths of the device and adjacent devices, wherein the device level at least comprises a first-level device and a second-level device, the network bandwidths of the first-level device and at least one device adjacent to the first-level device are both first bandwidths, the network bandwidths of the second-level device and the device adjacent to the second-level device at least comprise a second bandwidth, and the first bandwidth is larger than the second bandwidth;
informing the equipment grade to adjacent equipment, and receiving the equipment grade sent by the adjacent equipment;
the generation of the block is performed based on the device class of the receiving device and the self.
Wherein the generating of the block based on the device classes of the self and the receiving device comprises:
under the condition that the receiving equipment is first-stage equipment and the self is first-stage equipment, generating a block with a first capacity according to a preset speed;
under the condition that the receiving equipment is the first-stage equipment, determining a target speed according to the number of adjacent equipment of the first-stage equipment, and generating a block with a second capacity according to the target speed;
generating a block with a second capacity according to a preset speed under the condition that the receiving device is a first-stage device and the receiving device is a second-stage device or the receiving device is a second-stage device; wherein,
the first capacity is greater than the second capacity.
Wherein the determining a target speed according to the number of neighboring devices of the first level device comprises:
obtaining a target speed V according to a formula V, (K M) T/M; and K is the number of second-stage equipment in the adjacent equipment of the first-stage equipment, M is the second capacity, T is the preset speed, and M is the first capacity.
The block of the first capacity encapsulates a plurality of blocks of the second capacity, and the block of the first capacity comprises a large block identifier.
Wherein the blocks of the second capacity comprise block packing identifiers, and the block packing identifiers are used for representing the sources of the blocks.
Wherein the method comprises the following steps:
if the self is the first-level equipment and the block from the first-level equipment is received, directly forwarding the received block to the first-level equipment in the receiving equipment, and after the received block is unpacked, forwarding the block to the second-level equipment in the receiving equipment;
if the self is the first-stage equipment and the block from the second-stage equipment is received, the received block is directly forwarded to the second-stage equipment in the receiving equipment, and after the block with the first capacity is obtained by packaging the received block, the block is forwarded to the first-stage equipment in the receiving equipment;
and if the received block is the second-level equipment, forwarding the received block to the receiving equipment.
Wherein the method further comprises:
and determining corresponding forwarding excitation according to the equipment grades of the self equipment and the adjacent equipment.
Wherein, the determining the corresponding excitation according to the device grades of the self device and the adjacent device comprises:
if the device is the first-level device, the formula Q is used 1 (S-S) T/S, resulting in excitation Q 1 ;
If the device is the second-level device, the formula Q is used 2 T/S, resulting in excitation Q 2 (ii) a Wherein,
s is the block outlet speed of the first-stage equipment; s is the block-out speed of the second-stage equipment; t is a preset base 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 for acquiring network bandwidths of the processor and adjacent equipment; determining a device level of the device according to network bandwidths of the device and adjacent devices, wherein the device level at least comprises a first-level device and a second-level device, the network bandwidths of the first-level device and at least one device adjacent to the first-level device are both first bandwidths, the network bandwidths of the second-level device and the device adjacent to the second-level device at least comprise a second bandwidth, and the first bandwidth is larger than the second bandwidth;
the transceiver is used for informing the equipment grade to adjacent equipment and receiving the equipment grade sent by the adjacent equipment;
the processor is further configured to generate the block based on device ranks of the receiving device and the receiving device.
The processor is further used for generating a block with a first capacity according to a preset speed under the condition that the processor is a first-stage device and the receiving device is the first-stage device; under the condition that the receiving equipment is the first-stage equipment, determining a target speed according to the number of adjacent equipment of the first-stage equipment, and generating a block with a second capacity according to the target speed; generating a block with a second capacity according to a preset speed under the condition that the receiving device is a first-stage device and the receiving device is a second-stage device or the receiving device is a second-stage device; wherein,
the first capacity is greater than the second capacity.
The processor is further configured to obtain a target speed V according to a formula V ═ K ═ M) × T/M; and K is the number of second-stage equipment in the adjacent equipment of the first-stage equipment, M is the second capacity, T is the preset speed, and M is the first capacity.
The block of the first capacity encapsulates a plurality of blocks of the second capacity, and the block of the first capacity comprises a large block identifier.
Wherein the blocks of the second capacity comprise block packing identifiers, and the block packing identifiers are used for representing the sources of the blocks.
The processor is further configured to, if the processor is a first-level device and receives a block from the first-level device, directly forward the received block to the first-level device in the receiving device, and forward the block to a second-level device in the receiving device after decapsulating the received block; if the self is the first-stage equipment and the block from the second-stage equipment is received, the received block is directly forwarded to the second-stage equipment in the receiving equipment, and after the block with the first capacity is obtained by packaging the received block, the block is forwarded to the first-stage equipment in the receiving equipment; and if the received block is the second-level equipment, forwarding the received block to the receiving equipment.
Wherein the processor is further configured to determine a corresponding forwarding incentive based on device ranks of the device itself and neighboring devices.
Wherein the processor is further configured to determine whether the first-level device is a first-level device, based on the formula Q 1 (S-S) T/S, resulting in excitation Q 1 (ii) a If the device is the second-level device, the formula Q is used 2 T/S, resulting in excitation Q 2 (ii) a Wherein,
s is the block outlet speed of the first-stage equipment; s is the block-out speed of the second-stage equipment; t is a preset base excitation.
To achieve the above object, an embodiment of the present invention provides a block chain capacity expansion processing apparatus, including:
the acquisition module is used for acquiring network bandwidths of the self and adjacent equipment;
the device level determination module is used for determining a device level of the device according to network bandwidths of the device and adjacent devices, wherein the device level at least comprises a first-level device and a second-level device, the network bandwidths of the first-level device and at least one device adjacent to the first-level device are both first bandwidths, the network bandwidths of the second-level device and the device adjacent to the second-level device at least comprise a second bandwidth, and the first bandwidth is larger than the second bandwidth;
the receiving and sending module is used for informing the equipment grade to adjacent equipment and receiving the equipment grade sent by the adjacent equipment;
and the generating module is used for generating the block based on the device grades of the receiving device and the self receiving device.
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 executable on the processor; when the processor executes the computer program, the block chain capacity expansion processing method is realized.
To achieve the above object, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps in the block chain capacity expansion processing method as described above.
The technical scheme of the invention has the following beneficial effects:
according to the method provided by the embodiment of the invention, after the network bandwidths of the self and the adjacent equipment are obtained, the equipment grade of the self is further determined according to the obtained network bandwidths, then the equipment grade is informed to the adjacent equipment, the equipment grade sent by the adjacent equipment is received, and finally, the block is generated based on the equipment grades of the self and the receiving equipment. Therefore, the condition of network bandwidth is considered, the system capacity is improved, the safety of the block is guaranteed, and the realization effect is better.
Drawings
Fig. 1 is a flowchart of a block chain capacity expansion processing method according to an embodiment of the present invention;
FIGS. 2a-2e are schematic diagrams of nodes of a network;
FIG. 3 is a schematic diagram of the device level distribution in the network;
FIG. 4 is a block diagram of a first capacity;
FIG. 5 is a block diagram of a second capacity;
fig. 6 is a structural diagram of a terminal device according to an embodiment of the present invention;
fig. 7 is a structural diagram of a terminal device according to another embodiment of the present invention.
Detailed Description
In order to make the technical problems, technical solutions and advantages of the present invention more apparent, the following detailed description is given with reference to the accompanying drawings and specific embodiments.
The invention provides a block chain capacity expansion processing method aiming at the problem that the existing block chain cannot meet the increasing use requirement, and the block chain capacity expansion processing method can optimize a block chain networking structure according to network bandwidth and improve system capacity.
As shown in fig. 1, a block chain capacity expansion processing method according to an embodiment of the present invention includes:
and 104, generating the block based on the device grades of the receiving device and the self receiving device.
The block chain capacity expansion processing method of the embodiment of the invention is applied to the terminal equipment, and the adjacent equipment is other terminal equipment which can communicate with the terminal equipment based on a network structure. According to the above steps, after the terminal device obtains the network bandwidths of the terminal device and the adjacent device, the terminal device further determines the device grade of the terminal device according to the obtained network bandwidths, then informs the adjacent device of the device grade, receives the device grade sent by the adjacent device, and finally generates the block based on the device grades of the terminal device and the receiving device. Therefore, the condition of network bandwidth is considered, the system capacity is improved, the safety of the block is guaranteed, and the realization effect is better.
It should be appreciated that in this embodiment, the end device and its neighboring devices all access a P2P network as nodes on a public chain, and all nodes can test the network bandwidth of the network in which the nodes are located. For example, two most commonly used network bandwidths are 100Mbps and 1000Mbps at present, a node a accesses a network with a bandwidth of 100Mbps, a node B accesses the network with a bandwidth of 1000Mbps, and the node temporarily stores a network measurement result in the local node, and broadcasts the network measurement result of the node itself between adjacent nodes if necessary.
For example, for the two network bandwidths described above, the terminal devices are respectively referred to as 100M node and 1000M node, and after receiving the network bandwidth of the adjacent node, there are 5 possible cases:
(1) as shown in fig. 2a, it is a 100M node, and there is a 1000M node in the adjacent nodes: marking itself as a second level device;
(2) as shown in fig. 2b, it is a 100M node, and there are multiple 1000M nodes in the neighboring nodes: marking the device as a second-level device;
(3) as shown in fig. 2c, it is a 100M node, and there is no 1000M node in the neighboring nodes: marking the device as a second-level device;
(4) as shown in fig. 2d, it is a 1000M node, and the neighboring nodes are all 100M nodes: marking the device as a second-level device;
(5) as shown in fig. 2e, the node itself is a 1000M node, and the adjacent nodes have 1000M nodes: marking itself as the first level device.
Then, the node may broadcast its own device level to the neighboring nodes, or certainly, the device level of the neighboring node may be obtained from the broadcast information of the neighboring node. Finally, part of the 1000M nodes become first level devices, and the 100M nodes and part of the 1000M nodes become second level devices. The second level device may have no neighboring first level device or a unique first level device. The first level device also knows the second level devices that are adjacent to it. A device level diagram of a network is shown in fig. 3, comprising 5 first level devices (slash fill) and 7 second level devices.
Of course, considering that a network (such as a P2P network) often has new nodes to join or leave continuously, in this embodiment, link connectivity is detected, and when a change in connection relationship with an adjacent node is detected, the determination of the device level is performed again.
In this embodiment, optionally, step 1023 includes:
under the condition that the receiving equipment is first-stage equipment and the self is first-stage equipment, generating a block with a first capacity according to a preset speed;
under the condition that the receiving equipment is the first-stage equipment, determining a target speed according to the number of adjacent equipment of the first-stage equipment, and generating a block with a second capacity according to the target speed;
generating a block with a second capacity according to a preset speed under the condition that the receiving device is a first-stage device and the receiving device is a second-stage device or the receiving device is a second-stage device; wherein,
the first capacity is greater than the second capacity.
In this way, the blocks can be generated in a more reasonable manner for the device classes of the terminal device itself and the receiving device. For the situation that the receiving device is a first-level device, the network state is good, and a large data block can better improve the efficiency and improve the system capacity, so that a block with a first capacity can be generated at a preset speed; for the situation that the receiving device is a first-level device and the receiving device is a second-level device, or the receiving device is a second-level device and the receiving device is a second-level device, due to the limitation of a network, a block with a second capacity can be generated according to a preset speed; specifically, a target speed is determined according to the number of adjacent devices of the first-stage device, and a block of the second capacity is generated according to the target speed.
Preferably, the determining the target speed according to the number of the adjacent devices of the first-stage device includes:
obtaining a target speed V according to a formula V, (K M) T/M; and K is the number of second-stage equipment in the adjacent equipment of the first-stage equipment, M is the second capacity, T is the preset speed, and M is the first capacity.
Therefore, the first-stage equipment serving as the receiving equipment of the current second-stage equipment can further generate large blocks with higher efficiency under the condition of controllable load, and the efficiency of the system is improved by fully utilizing the first-stage equipment.
Assuming that the predetermined speed is 10 minutes/block, the first capacity block is 10M blocks, and the second capacity block is 1M blocks, specifically:
between two first-level devices, because the network state is good, a 10M block can be used as a maximum block, and a block is generated by adopting 10 minutes per block;
the method comprises the following steps that 1M blocks are used as the maximum blocks and 10 minutes/block are adopted to generate the blocks between first-level equipment and receiving equipment as second-level equipment due to the limitation of a network;
between two second-level devices, a 1M block is used as a maximum block, and a block is generated by adopting 10 minutes per block;
since 4 devices are connected to the first-stage device in the network, the target speed (4 × 1) × 10/10, i.e., 4 minutes/block, can be obtained by using the formula V ═ K × M) × T/M, and 1M block is used as the maximum block.
It should be noted that, in this embodiment, the preset speed is a fixed value, and the block-out speed of the whole network as a whole may not be reduced, so that the security of the data is substantially consistent with that before modification. Of course, the preset speed adjustment may also be made for the network, if the network conditions allow.
It should also be appreciated that in this embodiment, 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.
Thus, as shown in fig. 4, a plurality of blocks of the second capacity are packaged in the blocks of the first capacity, and the blocks of the second capacity can be stored in a linked list form. And because the block of the first capacity includes the large block identification (can be added in the head of the block), the block of the first capacity is convenient to identify, when the large block needs to be disassembled into the block of the second capacity, the blocks of the second capacity which are packaged can be taken out in sequence.
Optionally, the second capacity of blocks includes a block packing identifier, the block packing identifier being used to indicate a source of the blocks.
As shown in fig. 5, the block of the second capacity is added with a block encapsulation identifier (which may be added to the head of the block) for indicating the source of the block itself, so that it can be known whether the block is generated by the second level device or is unpacked from the block of the first capacity. Because the two are difficult to separate.
In addition, in this embodiment, for the transmission and reception of the generated block, the method includes:
if the self is the first-level equipment and the block from the first-level equipment is received, directly forwarding the received block to the first-level equipment in the receiving equipment, and after the received block is unpacked, forwarding the block to the second-level equipment in the receiving equipment;
if the self is the first-stage equipment and the block from the second-stage equipment is received, the received block is directly forwarded to the second-stage equipment in the receiving equipment, and after the block with the first capacity is obtained by packaging the received block, the block is forwarded to the first-stage equipment in the receiving equipment;
and if the received block is the second-level equipment, forwarding the received block to the receiving equipment.
Here, for the transceiving rule of the first-level device, the block received from the first-level device is directly forwarded to the first-level device in the receiving device, and meanwhile, after the block is decapsulated, the block 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, and meanwhile, after the block with the first capacity is obtained by packaging the received block, the block is forwarded to the first-level device in the receiving device. For the transceiving rule of the second level device, the received block is forwarded to the receiving device.
Generally, in a public blockchain, there is an incentive mechanism to encourage more nodes to participate in the system, serving the system while receiving rewards. Thus, in this embodiment, the method further comprises:
and determining corresponding forwarding excitation according to the equipment grades of the self equipment and the adjacent equipment.
Optionally, the determining, according to the device classes of the device and the neighboring devices, the corresponding excitation includes:
if the device is the first-level device, the formula Q is used 1 (S-S) T/S, resulting in excitation Q 1 ;
If the device is the second-level device, the device is based on the publicFormula Q 2 T/S, resulting in excitation Q 2 (ii) a Wherein,
s is the block outlet speed of the first-stage equipment; s is the block-out speed of the second-stage equipment; t is a preset base excitation.
Thus, through the above formula, it is able to give appropriate incentives to devices of different grades, and of course, the specific incentives are not limited to the above, and are not listed here.
In summary, in the block chain capacity expansion processing method according to the embodiment of the present invention, after the network bandwidths of the self and the adjacent devices are obtained, the block is further generated according to the obtained network bandwidths, so that the block chain networking structure can be optimized according to the network bandwidth condition, and the system capacity is increased; allowing the block size on the block chain to be different, and making a decision by the terminal equipment according to the network condition; when the high-bandwidth node forwards a large block, additional excitation can be obtained, and the overall fairness of the system is maintained.
As shown in fig. 6, a terminal device 600 according to an embodiment of the present invention includes a processor 610 and a transceiver 620, wherein,
the processor 610 is configured to obtain network bandwidths of the device and neighboring devices; determining a device level of the device according to network bandwidths of the device and adjacent devices, wherein the device level at least comprises a first-level device and a second-level device, the network bandwidths of the first-level device and at least one device adjacent to the first-level device are both first bandwidths, the network bandwidths of the second-level device and the device adjacent to the second-level device at least comprise a second bandwidth, and the first bandwidth is larger than the second bandwidth;
the transceiver 620 is configured to inform a neighboring device of the device class and receive the device class sent by the neighboring device;
the processor 610 is further configured to generate a block based on device ranks of the receiving device and the receiving device.
Optionally, the processor 610 is further configured to generate a block with a first capacity at a preset speed if the receiving device is a first-stage device; under the condition that the receiving equipment is the first-stage equipment, determining a target speed according to the number of adjacent equipment of the first-stage equipment, and generating a block with a second capacity according to the target speed; generating a block with a second capacity according to a preset speed under the condition that the receiving device is a first-stage device and the receiving device is a second-stage device or the receiving device is a second-stage device; wherein,
the first capacity is greater than the second capacity.
Optionally, the processor 610 is further configured to obtain a target speed V according to a formula V ═ K × M ═ T/M; and K is the number of second-stage equipment in the adjacent equipment of the first-stage equipment, M is the second capacity, T is the preset speed, and M is the first capacity.
Optionally, the first capacity block encapsulates a plurality of second capacity blocks, and the first capacity block includes a large block id.
Optionally, the second capacity of blocks includes a block packing identifier, the block packing identifier being used to indicate a source of the blocks.
Optionally, the processor 610 is further configured to, if the self is a first-level device and a block from the first-level device is received, directly forward the received block to the first-level device in the receiving device, and forward the block to a second-level device in the receiving device after decapsulating the received block; if the self is the first-stage equipment and the block from the second-stage equipment is received, the received block is directly forwarded to the second-stage equipment in the receiving equipment, and after the block with the first capacity is obtained by packaging the received block, the block is forwarded to the first-stage equipment in the receiving equipment; and if the received block is the second-level equipment, forwarding the received block to the receiving equipment.
Optionally, the processor 610 is further configured to determine a corresponding forwarding incentive according to device ranks of the self and the neighboring devices.
Optionally, the processor 610 is further configured to determine whether the first-level device is a first-level device according to a formula Q 1 (S-S) T/S, resulting in excitation Q 1 (ii) a If it is a second level deviceIf yes, according to formula Q 2 T/S, resulting in excitation Q 2 (ii) a Wherein,
s is the block outlet speed of the first-stage equipment; s is the block-out speed of the second-stage equipment; t is a preset base excitation.
After the network bandwidths of the terminal equipment and the adjacent equipment are obtained, the block is further generated according to the obtained network bandwidths, so that the block chain networking structure can be optimized according to the network bandwidth condition, and the system capacity is improved; allowing the block size on the block chain to be different, and making a decision by the terminal equipment according to the network condition; when the high-bandwidth node forwards a large block, additional excitation can be obtained, and the overall fairness of the system is maintained.
Another embodiment of the present invention provides a block chain capacity expansion processing apparatus, including:
the acquisition module is used for acquiring network bandwidths of the self and adjacent equipment;
the device level determination module is used for determining a device level of the device according to network bandwidths of the device and adjacent devices, wherein the device level at least comprises a first-level device and a second-level device, the network bandwidths of the first-level device and at least one device adjacent to the first-level device are both first bandwidths, the network bandwidths of the second-level device and the device adjacent to the second-level device at least comprise a second bandwidth, and the first bandwidth is larger than the second bandwidth;
the receiving and sending module is used for informing the equipment grade to adjacent equipment and receiving the equipment grade sent by the adjacent equipment;
and the generating module is used for generating the block based on the device grades of the receiving device and the self receiving device.
Wherein the generation module is specifically configured to:
under the condition that the receiving equipment is first-stage equipment and the self is first-stage equipment, generating a block with a first capacity according to a preset speed;
under the condition that the receiving equipment is the first-stage equipment, determining a target speed according to the number of adjacent equipment of the first-stage equipment, and generating a block with a second capacity according to the target speed;
generating a block with a second capacity according to a preset speed under the condition that the receiving device is a first-stage device and the receiving device is a second-stage device or the receiving device is a second-stage device; wherein,
the first capacity is greater than the second capacity.
Wherein the generation module is specifically configured to:
obtaining a target speed V according to a formula V, (K M) T/M; and K is the number of second-stage equipment in the adjacent equipment of the first-stage equipment, M is the second capacity, T is the preset speed, and M is the first capacity.
The block of the first capacity encapsulates a plurality of blocks of the second capacity, and the block of the first capacity comprises a large block identifier.
Wherein the blocks of the second capacity comprise block packing identifiers, and the block packing identifiers are used for representing the sources of the blocks.
Wherein the apparatus comprises:
the first block transceiver module is used for directly forwarding the received block to the first-stage equipment in the receiving equipment if the first-stage equipment is the first-stage equipment and the block from the first-stage equipment is received, and forwarding the received block to the second-stage equipment in the receiving equipment after the received block is unpacked;
the second block transceiver module is used for directly forwarding the received block to the second-level equipment in the receiving equipment if the second-level equipment is the first-level equipment and receives the block from the second-level equipment, and forwarding the block to the first-level equipment in the receiving equipment after the block with the first capacity is obtained by packaging the received block;
and the third block transceiver module is used for forwarding the received block to the receiving equipment if the third block transceiver module is the second-level equipment.
Wherein the apparatus further comprises:
and the excitation module is used for determining corresponding forwarding excitation according to the equipment grades of the excitation module and the adjacent equipment.
Wherein the excitation module is specifically configured to:
if the device is the first-level device, the formula Q is used 1 (S-S) T/S, resulting in excitation Q 1 ;
If the device is the second-level device, the formula Q is used 2 T/S, resulting in excitation Q 2 (ii) a Wherein,
s is the block outlet speed of the first-stage equipment; s is the block-out speed of the second-stage equipment; t is a preset base excitation.
After the network bandwidths of the self and the adjacent devices are obtained, the block chain capacity expansion processing device further determines the device grade of the self according to the obtained network bandwidths, informs the device grade to the adjacent devices, receives the device grade sent by the adjacent devices, and finally generates a block based on the device grades of the self and the receiving devices, so that the block chain networking structure can be optimized according to the network bandwidth condition, and the system capacity is improved; allowing the block size on the block chain to be different, and making a decision by the terminal equipment according to the network condition; when the high-bandwidth node forwards a large block, additional excitation can be obtained, and the overall fairness of the system is maintained.
A terminal device according to another embodiment of the present invention, as shown in fig. 7, includes a transceiver 710, a memory 720, a processor 700, and a computer program stored in the memory 720 and executable on the processor 700; the processor 700 implements the above-described method for processing the capacity expansion of the blockchain when executing the computer program.
The transceiver 710 is used for receiving and transmitting data under the control of the processor 700.
Where in fig. 7, the bus architecture may include any number of interconnected buses and bridges, with various circuits being linked together, particularly one or more processors represented by processor 700 and memory represented by memory 720. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. The bus interface provides an interface. The transceiver 710 may be a number of elements including a transmitter and a receiver that provide a means for communicating with various other apparatus over a transmission medium. The user interface 730 may also be an interface capable of interfacing with a desired device for different user devices, including but not limited to a keypad, display, speaker, microphone, joystick, etc.
The processor 700 is responsible for managing the bus architecture and general processing, and the memory 720 may store data used by the processor 700 in performing operations.
The computer-readable storage medium of the embodiment of the present invention stores a computer program thereon, and when the computer program is executed by a processor, the steps in the block chain capacity expansion processing method described above are implemented, and the same technical effect can be achieved. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It is further noted that the terminals described in this specification include, but are not limited to, smart phones, tablets, etc., and that many of the functional components described are referred to as modules in order to more particularly emphasize their implementation independence.
In embodiments of the present invention, modules may be implemented in software for execution by various types of processors. An identified module of executable code may, for instance, comprise one or more physical or logical blocks of computer instructions which may, for instance, be constructed as an object, procedure, or function. Nevertheless, the executables of an identified module need not be physically located together, but may comprise disparate instructions stored in different bits which, when joined logically together, comprise the module and achieve the stated purpose for the module.
Indeed, a module of executable code may be a single instruction, or many instructions, and may even be distributed over several different code segments, among different programs, and across several memory devices. Likewise, operational data may be identified within the modules and may be embodied 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 partially, merely as electronic signals on a system or network.
When a module can be implemented by software, considering the level of existing hardware technology, a module implemented by software may build a corresponding hardware circuit to implement a corresponding function, without considering cost, and the hardware circuit may include a conventional Very Large Scale Integration (VLSI) circuit or a gate array and an existing semiconductor such as a logic chip, a transistor, 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 or the like.
The exemplary embodiments described above are described with reference to the drawings, and many different forms and embodiments of the invention may be made without departing from the spirit and teaching of the invention, therefore, the invention is not to be construed as limited to the exemplary embodiments set forth herein. Rather, these exemplary embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art. In the drawings, the size and relative sizes of components may be exaggerated for clarity. The terminology used herein is for the purpose of describing particular example 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 indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. Unless otherwise indicated, a range of values, when stated, includes the upper and lower limits of the range and any subranges therebetween.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the appended claims.
Claims (17)
1. A block chain capacity expansion processing method is characterized by comprising the following steps:
acquiring network bandwidths of the device and adjacent equipment;
determining a device level of the device according to network bandwidths of the device and adjacent devices, wherein the device level at least comprises a first-level device and a second-level device, the network bandwidths of the first-level device and at least one device adjacent to the first-level device are both first bandwidths, the network bandwidths of the second-level device and the device adjacent to the second-level device at least comprise a second bandwidth, and the first bandwidth is larger than the second bandwidth;
informing the equipment grade to adjacent equipment, and receiving the equipment grade sent by the adjacent equipment;
generating a block based on the equipment grades of the self and the receiving equipment;
the generating of the block based on the device grades of the self and the receiving device comprises the following steps:
under the condition that the receiving equipment is first-stage equipment and the self is first-stage equipment, generating a block with a first capacity according to a preset speed;
under the condition that the receiving equipment is the first-stage equipment, determining a target speed according to the number of adjacent equipment of the first-stage equipment, and generating a block with a second capacity according to the target speed;
generating a block with a second capacity according to a preset speed under the condition that the receiving device is a first-stage device and the receiving device is a second-stage device or the receiving device is a second-stage device; wherein,
the first capacity is greater than the second capacity.
2. The method of claim 1, wherein determining a target speed based on the number of neighboring devices to the first level device comprises:
obtaining a target speed V according to a formula V, (K M) T/M; and K is the number of second-stage equipment in the adjacent equipment of the first-stage equipment, M is the second capacity, T is the preset speed, and M is the first capacity.
3. The method of claim 2, wherein the first size block encapsulates a plurality of second size blocks, and wherein the first size block comprises a large block identifier.
4. The method of claim 1 or 3, wherein the second capacity of blocks comprises a block packing identifier, the block packing identifier being used to indicate a source of the blocks.
5. The method according to claim 1, characterized in that it comprises:
if the self is the first-level equipment and the block from the first-level equipment is received, directly forwarding the received block to the first-level equipment in the receiving equipment, and after the received block is unpacked, forwarding the block to the second-level equipment in the receiving equipment;
if the self is the first-stage equipment and the block from the second-stage equipment is received, the received block is directly forwarded to the second-stage equipment in the receiving equipment, and after the block with the first capacity is obtained by packaging the received block, the block is forwarded to the first-stage equipment in the receiving equipment;
and if the received block is the second-level equipment, forwarding the received block to the receiving equipment.
6. The method of claim 1, further comprising:
and determining corresponding forwarding excitation according to the equipment grades of the self equipment and the adjacent equipment.
7. The method of claim 6, wherein determining the corresponding stimulus based on the device ranks of the device and the neighboring devices comprises:
if the device is the first-level device, the formula Q is used 1 (S-S) T/S, resulting in excitation Q 1 ;
If the device is the second-level device, the formula Q is used 2 T/S, resulting in excitation Q 2 (ii) a Wherein,
s is the block outlet speed of the first-stage equipment; s is the block-out speed of the second-stage equipment; t is a preset base excitation.
8. A terminal device, comprising a processor and a transceiver, wherein,
the processor is used for acquiring network bandwidths of the processor and adjacent equipment; determining a device level of the device according to network bandwidths of the device and adjacent devices, wherein the device level at least comprises a first-level device and a second-level device, the network bandwidths of the first-level device and at least one device adjacent to the first-level device are both first bandwidths, the network bandwidths of the second-level device and the device adjacent to the second-level device at least comprise a second bandwidth, and the first bandwidth is larger than the second bandwidth;
the transceiver is used for informing the equipment grade to adjacent equipment and receiving the equipment grade sent by the adjacent equipment;
the processor is also used for generating blocks based on the equipment grades of the processor and the receiving equipment;
the processor is also used for generating a block with a first capacity according to a preset speed under the condition that the processor is a first-stage device and the receiving device is the first-stage device; under the condition that the receiving equipment is the first-stage equipment, determining a target speed according to the number of adjacent equipment of the first-stage equipment, and generating a block with a second capacity according to the target speed; generating a block with a second capacity according to a preset speed under the condition that the receiving device is a first-stage device and the receiving device is a second-stage device or the receiving device is a second-stage device; wherein,
the first capacity is greater than the second capacity.
9. The terminal device of claim 8,
the processor is further configured to obtain a target speed V according to a formula V ═ K × M × T/M; and K is the number of second-stage equipment in the adjacent equipment of the first-stage equipment, M is the second capacity, T is the preset speed, and M is the first capacity.
10. The terminal device of claim 8, wherein the block of the first capacity encapsulates a plurality of blocks of the second capacity, and wherein the block of the first capacity comprises a large block identifier.
11. A terminal device according to claim 8 or 10, wherein the blocks of the second capacity comprise a block packing identity, the block packing identity being used to indicate the origin of the blocks.
12. The terminal device of claim 8,
the processor is further configured to, if the processor is a first-level device and receives a block from the first-level device, directly forward the received block to the first-level device in the receiving device, and forward the block to a second-level device in the receiving device after decapsulating the received block; if the self is the first-stage equipment and the block from the second-stage equipment is received, the received block is directly forwarded to the second-stage equipment in the receiving equipment, and after the block with the first capacity is obtained by packaging the received block, the block is forwarded to the first-stage equipment in the receiving equipment; and if the received block is the second-level equipment, forwarding the received block to the receiving equipment.
13. The terminal device of claim 8,
the processor is further configured to determine a corresponding forwarding incentive based on device ranks of the device and neighboring devices.
14. The terminal device of claim 13,
the processor is further configured to determine if the first-level device is a first-level device, based on the formula Q 1 (S-S) T/S, resulting in excitation Q 1 (ii) a If the device is the second-level device, the formula Q is used 2 T/S, resulting in excitation Q 2 (ii) a Wherein,
s is the block outlet speed of the first-stage equipment; s is the block-out speed of the second-stage equipment; t is a preset base excitation.
15. A block chain capacity expansion processing device, comprising:
the acquisition module is used for acquiring network bandwidths of the self and adjacent equipment;
the device level determination module is used for determining a device level of the device according to network bandwidths of the device and adjacent devices, wherein the device level at least comprises a first-level device and a second-level device, the network bandwidths of the first-level device and at least one device adjacent to the first-level device are both first bandwidths, the network bandwidths of the second-level device and the device adjacent to the second-level device at least comprise a second bandwidth, and the first bandwidth is larger than the second bandwidth;
the receiving and sending module is used for informing the equipment grade to adjacent equipment and receiving the equipment grade sent by the adjacent equipment;
the generating module is used for generating the blocks based on the equipment grades of the receiving equipment and the self receiving equipment;
wherein the generation module is specifically configured to:
under the condition that the receiving equipment is first-stage equipment and the self is first-stage equipment, generating a block with a first capacity according to a preset speed;
under the condition that the receiving equipment is the first-stage equipment, determining a target speed according to the number of adjacent equipment of the first-stage equipment, and generating a block with a second capacity according to the target speed;
generating a block with a second capacity according to a preset speed under the condition that the receiving device is a first-stage device and the receiving device is a second-stage device or the receiving device is a second-stage device; wherein,
the first capacity is greater than the second capacity.
16. A terminal device comprising a transceiver, a memory, a processor and a computer program stored on the memory and executable on the processor; the computer program is executed by the processor to implement the method for processing block chain expansion according to any one of claims 1 to 7.
17. A computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps in the method for processing blockchain expansion according to any one of claims 1 to 7.
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 |
---|---|---|
CN109417691B (en) | Bluetooth cluster online upgrading method and device | |
US20210250190A1 (en) | Securing communications | |
CN111092925B (en) | Block chain capacity expansion processing method, device and equipment | |
US20210307189A1 (en) | Modular system for internet of things | |
CN109672708B (en) | Communication method, device and system | |
CN112468372B (en) | Method and device for detecting equipment state in power line communication network | |
US20190289091A1 (en) | Neworking internet of things (iot) devices | |
CN109768970A (en) | It is a kind of based on configurable puppy parc generation method | |
CN109981751A (en) | A kind of document transmission method and system, computer equipment and storage medium | |
CN111431803A (en) | Routing method and device | |
CN104519545A (en) | Relay apparatus and method of selecting relay node based on learning in wireless network | |
US20230042747A1 (en) | Message Processing Method and Device, Storage Medium, and Electronic Device | |
CN114039798B (en) | Data transmission method and device and electronic equipment | |
Brandão et al. | An energy balanced flooding algorithm for a BLE mesh network | |
CN105743816B (en) | A kind of link aggregation method and device | |
CN103581317B (en) | A kind of method of network resources locating | |
CN106301472A (en) | Method and the website of relay is selected in power line network | |
CN113179215B (en) | Networking communication method, system, node device, storage medium and electronic device | |
CN103457748A (en) | Data transmission method, system and device | |
CN105763463B (en) | Method and device for transmitting link detection message | |
CN112511621B (en) | Data transmission method and device, storage medium, and electronic device | |
CN110888892B (en) | Block synchronization method, device and storage medium | |
CN108713199A (en) | Right management method, system, mobile terminal, shared charging equipment and server | |
US11477174B2 (en) | Method for re-registering a smart electricity meter | |
CN105451367A (en) | Wireless network connection method, device and system |
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 |