Block chain communication method, related equipment, storage medium and computer program product
By adopting IP multicast technology and communication compensation mechanism in the blockchain system, the block propagation delay and capacity problems between accounting nodes are solved, operating costs are reduced, and system performance is improved.
Patent Information
- Application Number
- CN202411347044.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-01-03
AI Technical Summary
In the blockchain system, when the P2P method of propagating block/ledger data between accounting nodes occurs, the processing delay, system capacity and throughput are limited, increasing the deployment and operation costs of blockchain business.
Using IP multicast technology, blocks are sent to all accounting nodes in the multicast tree through IP multicast address, realizing multiple receptions at one time, and using the communication compensation mechanism to obtain the lost block when the missing block is determined. .
It reduces network communication bandwidth overhead and communication delay, reduces blockchain business deployment and operation costs, and improves system capacity and service performance.
Smart Images

Figure CN119254783A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular to a blockchain communication method, related equipment, storage medium and computer program product. Background Art
[0002] Blockchain is a new information processing and storage technology that uses a decentralized networking structure to manage and maintain distributed ledgers. It uses a consensus mechanism to ensure that ledger data is fair and cannot be tampered with, supports neutral execution of contracts (computer program codes recognized by multiple parties), and solves problems such as information opacity, lack of trust, and poor collaboration between partners. In enterprise application scenarios, multiple companies can form an alliance and use alliance chains to conduct business cooperation. In order to ensure the consistency of data storage and consensus in the data processing process, blockchain engines with an "endorsement-sorting-verification" processing model are generally used. In the process of distributing block / ledger data in this processing model, the sorting node usually sends blocks to the accounting node, and the accounting nodes propagate block / ledger data to other accounting nodes in a peer-to-peer (P2P) network.
[0003] However, when accounting nodes propagate block / ledger data to other accounting nodes in a P2P manner, this process may take a certain amount of time, and there is no guarantee that each accounting node receives and only receives the message once. This is constrained by processing latency, system capacity, and throughput, leading to increased blockchain business deployment and operating costs. Summary of the invention
[0004] The implementing legislation of this application provides a blockchain communication method, related equipment, storage medium and computer program product, which can reduce network communication bandwidth overhead and communication latency, thereby reducing blockchain business deployment and operating costs.
[0005] The technical solution of the embodiment of the present application is implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides a blockchain communication method, which is applied to a first node and includes:
[0007] Receive first information sent by a second node; wherein the first information includes a first IP multicast address, the first IP multicast address includes a first chain identifier and an IP multicast address corresponding to a first channel identifier under the first chain identifier, and the second node is at least used to manage an accounting node group address and an IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier;
[0008] After receiving the first block sent by the first sorting node, convert the first block into a second block; wherein the first sorting node is at least used to package the blocks and generate blocks in sequence according to the packaging rule;
[0009] The second block is sent to all first accounting nodes in the multicast tree corresponding to the first IP multicast address through a first preset method; wherein the first preset method includes an IP multicast method.
[0010] In a second aspect, an embodiment of the present application provides a blockchain communication method, which is applied to a first accounting node, and the method includes:
[0011] Receive a second block sent by the first node in a first preset manner; wherein the first preset manner includes an IP multicast manner, the second block includes a block obtained by encrypting the first block based on the first encryption information, and the first block includes a first chain identifier and a block corresponding to a first channel identifier under the first chain identifier;
[0012] Determine whether there is a lost block at present based on the first chain identifier, the first channel identifier and the second block;
[0013] When it is determined that there is a lost block, the lost block is obtained based on the communication compensation mechanism.
[0014] In a third aspect, an embodiment of the present application provides a blockchain communication method, which is applied to a second node and includes:
[0015] Receive a third request sent by the chain management cluster; wherein the third request carries at least one chain identifier and a channel identifier under the chain identifier;
[0016] Acquire, based on the multicast address library, a second IP multicast address corresponding to the at least one chain identifier and the channel identifier under the chain identifier, and assign a corresponding third node address to the at least one chain identifier and the channel identifier under the chain identifier;
[0017] Sending first information to the first node; wherein the first information includes a first IP multicast address, the third node address includes the first node address, and the second IP multicast address includes the first IP multicast address.
[0018] In a fourth aspect, an embodiment of the present application provides a first node, the first node comprising: a first receiving unit, a conversion unit and a first sending unit; wherein,
[0019] A first receiving unit, configured to receive first information sent by a second node; wherein the first information includes a first IP multicast address, the first IP multicast address includes a first chain identifier and an IP multicast address corresponding to a first channel identifier under the first chain identifier, and the second node is at least configured to manage an accounting node group address and an IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier;
[0020] The conversion unit is configured to convert the first block into a second block after receiving the first block sent by the first sorting node; wherein the first sorting node is at least configured to package the blocks and generate blocks in sequence according to the packaging rule;
[0021] The first sending unit is used to send the second block to all first accounting nodes in the multicast tree corresponding to the first IP multicast address through a first preset method; wherein the first preset method includes an IP multicast method.
[0022] In a fifth aspect, an embodiment of the present application provides a first node, the first node comprising: a first processor and a first memory; wherein:
[0023] The first memory is used to store a computer program that can be run on the processor;
[0024] The first processor is used to execute the blockchain communication method as described above when running the computer program.
[0025] In a sixth aspect, an embodiment of the present application provides a first accounting node, the first accounting node comprising: a second receiving unit, a judging unit, and a first obtaining unit; wherein:
[0026] The second receiving unit is configured to receive a second block sent by the first node in a first preset manner; wherein the first preset manner includes an IP multicast manner, the second block includes a block obtained by encrypting the first block based on the first encryption information, and the first block includes a first chain identifier and a block corresponding to a first channel identifier under the first chain identifier;
[0027] The determining unit is configured to determine whether there is a lost block at present based on the first chain identifier, the first channel identifier and the second block;
[0028] The first acquisition unit is used to acquire the lost block based on the communication compensation mechanism when it is determined that there is a lost block.
[0029] In a seventh aspect, an embodiment of the present application provides a first accounting node, the first accounting node comprising: a second processor and a second memory; wherein:
[0030] The second memory is used to store a computer program that can be run on the processor;
[0031] The second processor is used to execute the blockchain communication method as described above when running the computer program.
[0032] In an eighth aspect, an embodiment of the present application provides a second node, the second node comprising: a third receiving unit, a second acquiring unit, an allocating unit, and a second sending unit; wherein,
[0033] The third receiving unit is used to receive a third request sent by the chain management cluster; wherein the third request carries at least one chain identifier and a channel identifier under the chain identifier;
[0034] The second acquisition unit is used to acquire, based on the multicast address library, a second IP multicast address corresponding to the at least one chain identifier and the channel identifier under the chain identifier;
[0035] The allocation unit is configured to allocate a corresponding third node address to the at least one chain identifier and a channel identifier under the chain identifier;
[0036] The second sending unit is used to send first information to the first node; wherein the first information includes a first IP multicast address, the third node address includes the first node address, and the second IP multicast address includes the first IP multicast address.
[0037] In a ninth aspect, an embodiment of the present application provides a second node, wherein the second node includes: a third processor and a third memory; wherein:
[0038] The third memory is used to store a computer program that can be run on the processor;
[0039] The third processor is used to execute the blockchain communication method as described above when running the computer program.
[0040] In the tenth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program code is stored. When the computer program code is executed by a computer, the blockchain communication method as described above is implemented.
[0041] In the eleventh aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the blockchain communication method as described above.
[0042] The embodiments of the present application provide a blockchain communication method, related equipment, storage medium and computer program product, wherein a first node receives first information sent by a second node, the first information includes a first IP multicast address; wherein the second node is at least used to manage the accounting node group address and IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier; after receiving the first block sent by the first sorting node, the first block is converted into a second block; wherein the first sorting node is at least used to package the blocks and generate blocks in sequence according to the packaging rules; the second block is sent to all first accounting nodes in the multicast tree corresponding to the first IP multicast address in a first preset manner; wherein the first preset manner includes IP multicast mode; the first accounting node determines whether there is a lost block at present based on the first chain identifier, the first channel identifier and the second block; when it is determined that there is a lost block, the lost block is obtained based on the communication compensation mechanism; the second node receives a third request sent by the chain management cluster; wherein the third request carries at least one chain identifier and a channel identifier under the chain identifier; based on the multicast address library, a second IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier is obtained, and a corresponding third node address is assigned to at least one chain identifier and a channel identifier under the chain identifier; the first information is sent to the first node; wherein the third node address includes the first node address, and the second IP multicast address includes the first IP multicast address. It can be seen that after receiving the third request sent by the chain management cluster, the second node can obtain the second IP multicast address corresponding to at least one chain identifier and the channel identifier under the chain identifier based on the multicast address library, and assign the corresponding third node address to at least one chain identifier and the channel identifier under the chain identifier. Then the second node can send the first information to the first node, and the first information carries the first chain identifier and the first IP multicast address corresponding to the first channel identifier under the first chain identifier, so that after the first node receives the first block sent by the first sorting node, it can send the second block converted from the first block to all nodes in the multicast tree corresponding to the first IP multicast address through IP multicast. There is a first accounting node, that is, the first node only needs to send the second block once, and all relevant accounting nodes can receive it within one communication cycle, thereby reducing network communication bandwidth overhead and communication delay, thereby reducing blockchain business deployment and operating costs; the first accounting node can determine whether there is a lost block based on the first chain identifier, the first channel identifier and the second block; when it is determined that there is a lost block, the lost block can be obtained based on the communication compensation mechanism. This communication compensation mechanism is not only applicable to occasional multicast packet loss scenarios, but also to scenarios where the accounting node is offline for a long time or resumes work after disconnection, and can quickly compensate for block loss during the offline period. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1A schematic diagram of P2P communication redundancy and delay in related technologies;
[0044] Figure 2 The blockchain communication method proposed in this application embodiment is shown in FIG. Figure 1 ;
[0045] Figure 3 A schematic diagram of the networking solution of the blockchain system proposed in the embodiment of the present application;
[0046] Figure 4 The blockchain communication method proposed in this application embodiment is shown in FIG. Figure 2 ;
[0047] Figure 5 The blockchain communication method proposed in this application embodiment is shown in FIG. Figure 3 ;
[0048] Figure 6 The blockchain communication method proposed in this application embodiment is shown in FIG. Figure 4 ;
[0049] Figure 7 The blockchain communication method proposed in this application embodiment is shown in FIG. Figure 5 ;
[0050] Figure 8 The blockchain communication method proposed in this application embodiment is shown in FIG. Figure 6 ;
[0051] Fig. 9 The blockchain communication method proposed in this application embodiment is shown in FIG. Figure 7 ;
[0052] Fig.10 A schematic diagram of the process of establishing a multicast channel in the blockchain system chain and channel creation process proposed in the embodiment of the present application;
[0053] Fig.11 A schematic diagram of the optimized blockchain system communication process proposed in the embodiment of the present application;
[0054] Fig.12 Schematic diagram of the composition structure of the first node proposed in the embodiment of the present application Figure 1 ;
[0055] Fig.13 Schematic diagram of the composition structure of the first node proposed in the embodiment of the present application Figure 2 ;
[0056] Fig.14 Schematic diagram of the composition structure of the first accounting node proposed in the embodiment of the present application Figure 1 ;
[0057] Fig.15Schematic diagram of the composition structure of the first accounting node proposed in the embodiment of the present application Figure 2 ;
[0058] Fig.16 The structure diagram of the second node proposed in the embodiment of the present application is shown in FIG. Figure 1 ;
[0059] Fig.17 The structure diagram of the second node proposed in the embodiment of the present application is shown in FIG. Figure 2 . DETAILED DESCRIPTION
[0060] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. It is understood that the specific embodiments described herein are only used to explain the related applications, rather than to limit the applications. It should also be noted that, for ease of description, only the parts related to the related applications are shown in the drawings.
[0061] In the blockchain system, the data stored in each node is used to record accounts separately to form a distributed ledger. The chain structure of the ledger data combined with the cryptographic algorithm ensures the temporal relationship of the data and the self-consistency of the information. The code (smart contract) signed and approved by relevant nodes runs in a secure environment to ensure the neutrality and credibility of the information processing process.
[0062] Blockchain as a Service (BaaS) refers to deploying the blockchain engine on a cloud computing platform, using the deployment and management advantages of cloud infrastructure to provide developers with a convenient, high-performance blockchain ecosystem and supporting ecological services, and a blockchain open platform that supports developers' business expansion and operational support. Compared with a bare blockchain system, the functions provided by BaaS are mainly: quickly establish the development environment you need, and provide a series of operational services such as blockchain-based search queries, transaction submissions, and data analysis. These services can be centralized or decentralized to help developers verify their concepts and models faster. BaaS provides blockchain capability services and supporting services, and can provide blockchain application innovation incubators for blockchain developers and entrepreneurs.
[0063] In the enterprise application scenario, multiple enterprises form an alliance and use the alliance chain to conduct business cooperation. In order to ensure the consistency of data storage and the consensus of the data processing process, the blockchain engine of the "endorsement-sorting-verification" processing model is generally adopted; among them, in the business process of this processing model, when distributing block / ledger data, the sorting node will send blocks to the accounting node, and the process of sending blockchains between accounting nodes adopts the application layer protocol and is sent in a P2P manner.
[0064] However, when accounting nodes propagate block / ledger data to other accounting nodes in a P2P manner, this process may take a certain amount of time, and there is no guarantee that each accounting node receives and only receives the message once. This is constrained by processing latency, system capacity, and throughput, leading to increased blockchain business deployment and operating costs. Figure 1 It is a schematic diagram of P2P communication redundancy and delay in related technologies, such as Figure 1 As shown in the figure, the message sent from Node1 takes two sending cycles to reach Node3, which brings additional delay and increases the waiting time required for ledger convergence; Node2, 4, and 5 all receive three copies of the same data from multiple paths, which not only occupies the communication bandwidth, but also consumes the receiving, parsing, and judgment overhead of the receiving node.
[0065] In summary, blockchain platforms that use P2P (such as Gossip) protocols are constrained in processing latency, system capacity, and throughput, which leads to higher costs for providing and using blockchain services, further increasing the deployment and operating costs of blockchain services.
[0066] In order to solve the problem of large network communication bandwidth overhead and communication delay, which increases the deployment and operation costs of blockchain services, the embodiments of the present application provide a blockchain communication method, related equipment, storage medium and computer program product, wherein a first node receives a first message sent by a second node, the first message includes a first IP multicast address; wherein the second node is at least used to manage the accounting node group address and IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier; after receiving the first block sent by the first sorting node, the first block is converted into a second block; wherein the first sorting node is at least used to package the blocks and generate blocks in order according to the packaging rules; the second block is sent to the multicast tree corresponding to the first IP multicast address in a first preset manner. All first accounting nodes; wherein the first preset method includes an IP multicast method; the first accounting node determines whether there is a lost block at present based on the first chain identifier, the first channel identifier and the second block; when it is determined that there is a lost block, the lost block is obtained based on the communication compensation mechanism; the second node receives a third request sent by the chain management cluster; wherein the third request carries at least one chain identifier and a channel identifier under the chain identifier; based on the multicast address library, obtains a second IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier, and assigns a corresponding third node address to at least one chain identifier and a channel identifier under the chain identifier; sends the first information to the first node; wherein the third node address includes the first node address, and the second IP multicast address includes the first IP multicast address. It can be seen that after receiving the third request sent by the chain management cluster, the second node can obtain the second IP multicast address corresponding to at least one chain identifier and the channel identifier under the chain identifier based on the multicast address library, and assign the corresponding third node address to at least one chain identifier and the channel identifier under the chain identifier. Then the second node can send the first information to the first node, and the first information carries the first chain identifier and the first IP multicast address corresponding to the first channel identifier under the first chain identifier, so that after the first node receives the first block sent by the first sorting node, it can send the second block converted from the first block to all nodes in the multicast tree corresponding to the first IP multicast address through IP multicast. There is a first accounting node, that is, the first node only needs to send the second block once, and all relevant accounting nodes can receive it within one communication cycle, thereby reducing network communication bandwidth overhead and communication delay, thereby reducing blockchain business deployment and operating costs; the first accounting node can determine whether there is a lost block based on the first chain identifier, the first channel identifier and the second block; when it is determined that there is a lost block, the lost block can be obtained based on the communication compensation mechanism. This communication compensation mechanism is not only applicable to occasional multicast packet loss scenarios, but also to scenarios where the accounting node is offline for a long time or resumes work after disconnection, and can quickly compensate for block loss during the offline period.
[0067] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0068] The present application embodiment provides a blockchain communication method, which is applied to a first node. Figure 2 The blockchain communication method proposed in this application embodiment is shown in FIG. Figure 1 ,like Figure 2 As shown, the blockchain communication method may include the following steps:
[0069] Step 101, receive the first information sent by the second node; wherein the first information includes a first IP multicast address, the first IP multicast address includes a first chain identifier and an IP multicast address corresponding to a first channel identifier under the first chain identifier, and the second node is at least used to manage the accounting node group address and IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier.
[0070] In an embodiment of the present application, the first node may receive first information sent by the second node, where the first information includes a first IP multicast address.
[0071] It should be noted that, in the embodiments of the present application, the IP multicast address may be an IPv4 / IPv6 multicast (IP Multicasting) address, and the present application does not specifically limit the type of the IP multicast address.
[0072] It should be noted that, in the embodiments of the present application, Figure 3 This is a schematic diagram of the networking solution of the blockchain system proposed in the embodiment of the present application, such as Figure 3 As shown, the present application adds a communication cluster, which includes two new components: a communication management module and a multicast communication module. At the same time, a multicast forwarding tree is constructed between the accounting node and the multicast communication module to form an IP multicast network.
[0073] It should be noted that, in the embodiments of the present application, the multicast communication module may include a group of homogeneous, load-sharing multicast communication nodes to provide a highly available multicast rendezvous point (RP) service.
[0074] It should be noted that, in an embodiment of the present application, the communication management module may include a group of multicast management nodes with homogeneous redundancy and a shared multicast address library and a multicast address library with high availability and high real-time performance.
[0075] It should be noted that in the embodiments of the present application, the multicast address library may include the following information: (1) all channels in the blockchain system and the accounting node information owned by each organization in the channel; (2) the occupancy status of all IP multicast addresses in the blockchain service network, the chain and channel identification information of the IP multicast address service. The present application does not specifically limit the type and quantity of information included in the multicast address library.
[0076] It should be noted that, in the embodiment of the present application, the first node may be a communication node corresponding to the first chain identifier and the first channel identifier under the first chain identifier.
[0077] It should be noted that, in the embodiment of the present application, the first IP multicast address may refer to the IP multicast address corresponding to the first chain identifier and the first channel identifier under the first chain identifier.
[0078] It should be noted that, in an embodiment of the present application, the second node may be a communication management module, which may be used to manage the accounting node group address and IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier.
[0079] It should be noted that, in an embodiment of the present application, after the second node sends the first information to the first accounting node, the first node can receive a first request sent by a network device connected to the first accounting node; respond to the first request, and then add the network device connected to the first accounting node as a leaf node to the multicast tree based on the first node address and the first IP multicast address; wherein the root of the multicast tree is the first node.
[0080] It should be noted that, in the embodiment of the present application, the first node address is used to identify the first node corresponding to the first chain identifier and the first channel identifier under the first chain identifier.
[0081] Exemplarily, in an embodiment of the present application, after the second node sends the first information to the first accounting node, the first accounting node can initiate an Internet Group Management Protocol (IGMP) request to the connected network device based on the first node address and the first IP multicast address, so that the network device sends a first request to the first node based on the IGMP request; wherein the first request is used to add the first accounting node to the multicast tree, respond to the first request, and then the first node can add the network device connected to the first accounting node as a leaf node to the multicast tree based on the first node address and the first IP multicast address, and the root of the multicast tree is the first node.
[0082] Step 102: after receiving the first block sent by the first sorting node, convert the first block into a second block; wherein the first sorting node is at least used to package the blocks and generate blocks in sequence according to the packaging rules.
[0083] In an embodiment of the present application, after receiving the first block sent by the first sorting node, the first node converts the first block into a second block; wherein the first sorting node is at least used to package the blocks and generate blocks in order according to the packaging rules.
[0084] It should be noted that, in an embodiment of the present application, the first information may also include first encryption information, and the first encryption information includes at least a first encryption algorithm and a first key. The present application does not specifically limit the type and amount of information included in the first information.
[0085] It should be noted that, in an embodiment of the present application, when the first node converts the first block into the second block, it can encrypt the first block based on the first encryption information to obtain the second block; wherein the first block includes a block corresponding to the first chain identifier and the first channel identifier, that is, the embodiment of the present application provides an encryption communication method for block data.
[0086] It should be noted that, in the embodiments of the present application, Figure 4 The blockchain communication method proposed in this application embodiment is shown in FIG. Figure 2 ,like Figure 4 As shown, after converting the first block into the second block, that is, after step 102, the following steps may also be included:
[0087] Step 104: Store the identification information corresponding to the second block and the data content corresponding to the second block in a block storage library.
[0088] Step 103: Send the second block to all first accounting nodes in the multicast tree corresponding to the first IP multicast address through a first preset method; wherein the first preset method includes an IP multicast method.
[0089] In an embodiment of the present application, after receiving the first block sent by the first sorting node and converting the first block into a second block, the first node can send the second block to all first accounting nodes in the multicast tree corresponding to the first IP multicast address through a first preset method.
[0090] That is to say, in an embodiment of the present application, the embodiment of the present application can first establish an IP multicast channel. For example, after the second node sends the first information to the first accounting node, the first node can receive the first request sent by the network device connected to the first accounting node; then the first node can add the network device connected to the first accounting node as a leaf node to the multicast tree based on the first node address and the first IP multicast address; wherein the root of the multicast tree is the first node, thereby forming a multicast forwarding tree with the first node address as the source address and the first IP multicast address as the destination address, and then the first node can send the second block to all first accounting nodes in the multicast tree corresponding to the first IP multicast address via IP multicast.
[0091] It should be noted that, in the embodiment of the present application, the process of the first node sending a block to the first accounting node adopts the IP multicast protocol, that is, the first node only sends once, and all relevant accounting nodes can receive it, which not only reduces the network communication bandwidth overhead and communication delay, but also avoids the accounting node forwarding blocks and identifying repeatedly forwarded blocks. Therefore, the processing resources and communication costs are reduced, and the service performance is improved.
[0092] It should be noted that, in the embodiments of the present application, Figure 5 The blockchain communication method proposed in this application embodiment is shown in FIG. Figure 3 ,like Figure 5 As shown, after sending the second block to all first accounting nodes in the multicast tree corresponding to the first IP multicast address in the first preset manner, that is, after step 103, the following steps may also be included:
[0093] Step 105: Receive a second request sent by the first accounting node; wherein the second request carries identification information corresponding to the lost block.
[0094] It should be noted that, in an embodiment of the present application, the second request may carry identification information corresponding to the lost block, for example, the ID of the lost block. The present application does not specifically limit the type and amount of information carried by the second request.
[0095] Step 106: Acquire the lost block based on the identification information corresponding to the lost block and the block storage library.
[0096] It should be noted that, in an embodiment of the present application, the first node may query the lost block in the block storage repository based on the identification information corresponding to the lost block.
[0097] Step 107: Send the lost block to the corresponding accounting node through a second preset method, wherein the second preset method includes a unicast method, and the accounting node includes the first accounting node that sends the second request.
[0098] In summary, the embodiment of the present application can first establish an IP multicast channel. After the second node sends the first information to the first accounting node, the first node can receive the first request sent by the network device connected to the first accounting node; then the first node can add the network device connected to the first accounting node as a leaf node to the multicast tree based on the first node address and the first IP multicast address; wherein the root of the multicast tree is the first node, so that a multicast forwarding tree with the first node address as the source address and the first IP multicast address as the destination address can be formed, and then the first node can send the second block to all the first accounting nodes in the multicast tree corresponding to the first IP multicast address through IP multicast, that is, the process of the first node sending the block to the first accounting node adopts the IP multicast protocol, the first node only sends it once, and all relevant accounting nodes can receive it, which not only reduces the network communication bandwidth overhead and communication delay, but also avoids the accounting node forwarding blocks and identifying repeatedly forwarded blocks. Therefore, the processing resources and communication costs are reduced, and the service performance is improved.
[0099] An embodiment of the present application provides a blockchain communication method, which is applied to a first node, and the first node receives first information sent by a second node; wherein the first information includes a first IP multicast address, the first IP multicast address includes a first chain identifier and an IP multicast address corresponding to a first channel identifier under the first chain identifier, and the second node is at least used to manage the accounting node group address and IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier; after receiving a first block sent by a first sorting node, the first block is converted into a second block; wherein the first sorting node is at least used to package the blocks and generate blocks in sequence according to the packaging rules; the second block is sent to all first accounting nodes in the multicast tree corresponding to the first IP multicast address through a first preset method; wherein the first preset method includes an IP multicast method. It can be seen that after the first node receives the first block sent by the first sorting node, it can send the second block converted from the first block to all first accounting nodes in the multicast tree corresponding to the first IP multicast address through IP multicast. That is, the first node only needs to send the second block once, and all relevant accounting nodes can receive it within one communication cycle, thereby reducing network communication bandwidth overhead and communication delay, thereby reducing blockchain business deployment and operating costs.
[0100] Based on the above embodiment, another embodiment of the present application provides a blockchain communication method, which is applied to a first accounting node. Figure 6 The blockchain communication method proposed in this application embodiment is shown in FIG. Figure 4 ,like Figure 6 As shown, the blockchain communication method may include the following steps:
[0101] Step 201, receiving a second block sent by a first node through a first preset method; wherein the first preset method includes an IP multicast method, the second block includes a block after encrypting the first block based on first encryption information, and the first block includes a first chain identifier and a block corresponding to a first channel identifier under the first chain identifier.
[0102] In an embodiment of the present application, the first accounting node may receive a second block sent by the first node in a first preset manner.
[0103] It should be noted that, in the embodiments of the present application, Figure 7 The blockchain communication method proposed in this application embodiment is shown in FIG. Figure 5 ,like Figure 7 As shown, before receiving the second block sent by the first node in the first preset manner, that is, before step 201, the following steps may also be included:
[0104] 204. Receive first information sent by the second node; wherein the first information includes a first node address and a first IP multicast address.
[0105] It should be noted that, in an embodiment of the present application, the first accounting node can receive the first information sent by the second node; wherein the first accounting node can be any accounting node in the accounting node group corresponding to the first chain identifier and the first channel identifier under the first chain identifier.
[0106] It should be noted that, in an embodiment of the present application, the second node may be a communication management module, which may be used to manage the accounting node group address and IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier.
[0107] 205. Initiate an IGMP request to the corresponding network device based on the first node address and the first IP multicast address, so that the network device sends a first request to the first node based on the IGMP request; wherein the first request is used to add the first accounting node to the multicast tree.
[0108] It should be noted that, in an embodiment of the present application, the first accounting node can initiate an IGMP request to the corresponding network device based on the first node address and the first IP multicast address.
[0109] Step 202: determine whether there is a lost block based on the first chain identifier, the first channel identifier and the second block.
[0110] In an embodiment of the present application, after receiving the second block sent by the first node in the first preset manner, the first accounting node can determine whether there is a lost block based on the first chain identifier, the first channel identifier and the second block.
[0111] It should be noted that, in an embodiment of the present application, when the first accounting node determines whether there is a lost block at present based on the first chain identifier, the first channel identifier and the second block, it can determine whether the identification information corresponding to the received second block is consistent with the expected identification information based on the first chain identifier and the first channel identifier; if the identification information corresponding to the second block is consistent with the expected identification information, it is determined that there is no lost block; or, if the identification information corresponding to the second block is inconsistent with the expected identification information, it is determined that there is a lost block.
[0112] Exemplarily, in an embodiment of the present application, the first accounting node receives the m+1th second block on a specific multicast address, but has not received the mth second block in the chain and the channel corresponding to the first chain identifier and the first channel identifier locally, that is, the identification information (m+1) corresponding to the second block is inconsistent with the expected identification information (m), then it can be concluded that a block is lost.
[0113] Step 203: When it is determined that there is a lost block, the lost block is obtained based on the communication compensation mechanism.
[0114] In an embodiment of the present application, after the first accounting node determines whether there is a lost block based on the first chain identifier, the first channel identifier and the second block, it can obtain the lost block based on the communication compensation mechanism if it is determined that there is a lost block.
[0115] It should be noted that, in an embodiment of the present application, when the first accounting node determines that there is a lost block, it can send a second request to the first node when obtaining the lost block based on the communication compensation mechanism; wherein the second request carries identification information corresponding to the lost block; and then the lost block sent by the first node through a second preset method can be received; wherein the second preset method includes a unicast method.
[0116] It should be noted that, in the embodiments of the present application, the above method for determining whether a block is lost not only supports the identification and compensation of a single block loss, but also can identify multiple continuous or discontinuous block losses; and the above method is not only applicable to occasional multicast packet loss scenarios, but also to scenarios where the accounting node is offline for a long time or resumes work after a network outage, and can quickly compensate for block losses during the offline period.
[0117] To summarize, after receiving the second block sent by the first node via IP multicast, the first accounting node can determine whether there is a lost block at present based on the first chain identifier, the first channel identifier and the second block, that is, it can determine whether the identification information corresponding to the received second block is consistent with the expected identification information based on the first chain identifier and the first channel identifier; if the identification information corresponding to the second block is consistent with the expected identification information, it is determined that there is no lost block; or, if the identification information corresponding to the second block is inconsistent with the expected identification information, it is determined that there is a lost block. When the first accounting node determines that there is a lost block, it can obtain the lost block based on the communication compensation mechanism, and can send a second request to the first node; wherein the second request carries the identification information corresponding to the lost block; then the lost block sent by the first node via unicast can be received, that is, the embodiment of the present application designs a compensation mechanism for the IP multicast feature to improve the reliability of communication.
[0118] The embodiment of the present application provides a blockchain communication method, which is applied to a first accounting node, and the first accounting node receives a second block sent by the first node through a first preset method; wherein the first preset method includes an IP multicast method, the second block includes a block encrypted based on the first encryption information, and the first block includes a first chain identifier and a block corresponding to a first channel identifier under the first chain identifier; based on the first chain identifier, the first channel identifier and the second block, it is judged whether there is a lost block at present; in the case where it is judged that there is a lost block, the lost block is obtained based on a communication compensation mechanism. It can be seen that the first accounting node can judge whether there is a lost block at present based on the first chain identifier, the first channel identifier and the second block; in the case where it is judged that there is a lost block, the lost block can be obtained based on a communication compensation mechanism. The communication compensation mechanism is not only applicable to occasional multicast packet loss scenarios, but also applicable to scenarios where the accounting node is offline for a long time or resumes work after disconnection, and can quickly compensate for block loss during offline period.
[0119] Based on the above embodiment, another embodiment of the present application provides a blockchain communication method, which is applied to a second node. Figure 8 The blockchain communication method proposed in this application embodiment is shown in FIG. Figure 6 ,like Figure 8 As shown, the blockchain communication method may include the following steps:
[0120] Step 301: Receive a third request sent by a chain management cluster; wherein the third request carries at least one chain identifier and a channel identifier under the chain identifier.
[0121] In an embodiment of the present application, the second node may receive a third request sent by the chain management cluster.
[0122] It should be noted that, in an embodiment of the present application, the second node may be a communication management module, which may be used to manage the accounting node group address and IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier.
[0123] Step 302: Based on the multicast address library, obtain a second IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier, and allocate a corresponding third node address to at least one chain identifier and a channel identifier under the chain identifier.
[0124] In an embodiment of the present application, after receiving the third request sent by the chain management cluster, the second node can obtain a second IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier based on the multicast address library, and assign a corresponding third node address to at least one chain identifier and a channel identifier under the chain identifier.
[0125] It should be noted that in the embodiments of the present application, the network management component in the chain management cluster can pre-enable the IP multicast protocol (such as PIM-SM / PIM-DM, IGMP / IGMP-Snooping, etc.) on the relevant network devices. The present application does not specifically limit the type of IP multicast protocol.
[0126] That is to say, in an embodiment of the present application, after receiving the third request sent by the chain management cluster, the second node can obtain an idle IP multicast address from the multicast address library module, assign a corresponding second IP multicast address to at least one chain identifier and a channel identifier under the chain identifier, and assign a corresponding third node address to at least one chain identifier and a channel identifier under the chain identifier.
[0127] Step 303: Send first information to the first node; wherein the first information includes the first IP multicast address, the third node address includes the first node address, and the second IP multicast address includes the first IP multicast address.
[0128] In an embodiment of the present application, the second node can send the first information to the first node after obtaining the second IP multicast address corresponding to at least one chain identifier and the channel identifier under the chain identifier based on the multicast address library, and assigning a corresponding third node address to at least one chain identifier and the channel identifier under the chain identifier.
[0129] Exemplarily, in an embodiment of the present application, assuming that the IP multicast address assigned by the second node to the first chain identifier and the first channel identifier under the first chain identifier is the first IP multicast address, and the corresponding node address assigned to the first chain identifier and the first channel identifier under the first chain identifier is the first node address, the second node can send a first message to the first node corresponding to the first node address, and the first information includes the first IP multicast address, so that after the first node subsequently receives the block sent by the first sorting node, it will send the block to all first accounting nodes in the multicast tree corresponding to the first IP multicast address via IP multicast.
[0130] It should be noted that, in an embodiment of the present application, the second node may also send the first node address to the sorting cluster, so that the sorting cluster sends the corresponding block to the first node based on the first node address; wherein the sorting cluster includes one or more sorting nodes.
[0131] It should be noted that, in an embodiment of the present application, the first information also includes a first node address and first encryption information, the first encryption information includes at least a first encryption algorithm and a first key, and the second node can send the first information to the first accounting node so that the first accounting node initiates an IGMP request to the corresponding network device based on the first node address and the first IP multicast address.
[0132] To summarize, the second node can obtain the second IP multicast address corresponding to at least one chain identifier and the channel identifier under the chain identifier based on the multicast address library, and assign a corresponding third node address to at least one chain identifier and the channel identifier under the chain identifier; assuming that the IP multicast address assigned by the second node to the first chain identifier and the first channel identifier under the first chain identifier is the first IP multicast address, and the corresponding node address assigned to the first chain identifier and the first channel identifier under the first chain identifier is the first node address, then the second node can send the first information to the first node corresponding to the first node address, and the first information includes the first IP multicast address, so that after the first node subsequently receives the block sent by the first sorting node, it will send the block to all first accounting nodes in the multicast tree corresponding to the first IP multicast address via IP multicast, the third node address includes the first node address, and the second IP multicast address includes the first IP multicast address.
[0133] The embodiment of the present application provides a blockchain communication method, which is applied to a second node, and the second node receives a third request sent by a chain management cluster; wherein the third request carries at least one chain identifier and a channel identifier under the chain identifier; based on a multicast address library, a second IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier is obtained, and a corresponding third node address is assigned to at least one chain identifier and a channel identifier under the chain identifier; a first message is sent to a first node; wherein the first message includes a first IP multicast address, the third node address includes a first node address, and the second IP multicast address includes a first IP multicast address. It can be seen that the second node can obtain a second IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier based on a multicast address library, and assign a corresponding third node address to at least one chain identifier and a channel identifier under the chain identifier, and then send information carrying an IP multicast address corresponding to a specific chain identifier and a channel identifier under the chain identifier to the node corresponding to the third node address, so that the corresponding communication node can send the block to all first accounting nodes in the multicast tree corresponding to the IP multicast address by IP multicast after receiving the block sent by the first sorting node, thereby reducing network communication bandwidth overhead and communication delay.
[0134] Based on the above embodiments, another embodiment of the present application provides a blockchain communication method, which is applied to a first node, a first accounting node, and a second node. Fig. 9 The blockchain communication method proposed in this application embodiment is shown in FIG. Figure 7 ,like Fig. 9 As shown, the blockchain communication method may include the following steps:
[0135] Step 401: The second node receives a third request sent by the chain management cluster; wherein the third request carries at least one chain identifier and a channel identifier under the chain identifier.
[0136] It should be noted that, in an embodiment of the present application, the second node may be a communication management module, which may be used to manage the accounting node group address and IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier.
[0137] Step 402: The second node obtains a second IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier based on the multicast address library, and allocates a corresponding third node address to at least one chain identifier and a channel identifier under the chain identifier.
[0138] It should be noted that in the embodiments of the present application, the network management component in the chain management cluster can pre-enable the IP multicast protocol (such as PIM-SM / PIM-DM, IGMP / IGMP-Snooping, etc.) on the relevant network devices. The present application does not specifically limit the type of IP multicast protocol.
[0139] That is to say, in an embodiment of the present application, after receiving the third request sent by the chain management cluster, the second node can obtain an idle IP multicast address from the multicast address library module, assign a corresponding second IP multicast address to at least one chain identifier and a channel identifier under the chain identifier, and assign a corresponding third node address to at least one chain identifier and a channel identifier under the chain identifier.
[0140] Step 403: The second node sends first information to the first node; wherein the first information includes the first IP multicast address, the third node address includes the first node address, and the second IP multicast address includes the first IP multicast address.
[0141] Exemplarily, in an embodiment of the present application, assuming that the IP multicast address assigned by the second node to the first chain identifier and the first channel identifier under the first chain identifier is the first IP multicast address, and the corresponding node address assigned to the first chain identifier and the first channel identifier under the first chain identifier is the first node address, the second node can send a first message to the first node corresponding to the first node address, and the first information includes the first IP multicast address, so that after the first node subsequently receives the block sent by the first sorting node, it will send the block to all first accounting nodes in the multicast tree corresponding to the first IP multicast address via IP multicast.
[0142] It should be noted that, in an embodiment of the present application, the second node may also send the first node address to the sorting cluster, so that the sorting cluster sends the corresponding block to the first node based on the first node address; wherein the sorting cluster includes one or more sorting nodes.
[0143] It should be noted that, in an embodiment of the present application, the first information also includes a first node address and first encryption information, the first encryption information includes at least a first encryption algorithm and a first key, and the second node can send the first information to the first accounting node so that the first accounting node initiates an IGMP request to the corresponding network device based on the first node address and the first IP multicast address.
[0144] It should be noted that, in an embodiment of the present application, after the second node sends the first information to the first accounting node, the first node can receive a first request sent by a network device connected to the first accounting node; respond to the first request, and then add the network device connected to the first accounting node as a leaf node to the multicast tree based on the first node address and the first IP multicast address; wherein the root of the multicast tree is the first node.
[0145] It should be noted that, in the embodiment of the present application, the first node address is used to identify the first node corresponding to the first chain identifier and the first channel identifier under the first chain identifier.
[0146] Exemplarily, in an embodiment of the present application, after the second node sends the first information to the first accounting node, the first accounting node can initiate an IGMP request to the connected network device based on the first node address and the first IP multicast address, so that the network device sends the first request to the first node based on the IGMP request; wherein the first request is used to add the first accounting node to the multicast tree, respond to the first request, and then the first node can add the network device connected to the first accounting node as a leaf node to the multicast tree based on the first node address and the first IP multicast address, and the root of the multicast tree is the first node.
[0147] Step 404: After receiving the first block sent by the first sorting node, the first node converts the first block into a second block; wherein the first sorting node is at least used to package the blocks and generate blocks in sequence according to the packaging rules.
[0148] It should be noted that, in an embodiment of the present application, when the first node converts the first block into the second block, it can encrypt the first block based on the first encryption information to obtain the second block; wherein the first block includes a block corresponding to the first chain identifier and the first channel identifier.
[0149] It should be noted that, in the embodiments of the present application, Figure 4 As shown, after the first block is converted into the second block, the identification information corresponding to the second block and the data content corresponding to the second block can be stored in the block storage library.
[0150] Step 405: The first node sends the second block to all first accounting nodes in the multicast tree corresponding to the first IP multicast address through a first preset method; wherein the first preset method includes an IP multicast method.
[0151] That is to say, in an embodiment of the present application, the embodiment of the present application can first establish an IP multicast channel. For example, after the second node sends the first information to the first accounting node, the first node can receive the first request sent by the network device connected to the first accounting node; then the first node can add the network device connected to the first accounting node as a leaf node to the multicast tree based on the first node address and the first IP multicast address; wherein the root of the multicast tree is the first node, thereby forming a multicast forwarding tree with the first node address as the source address and the first IP multicast address as the destination address, and then the first node can send the second block to all first accounting nodes in the multicast tree corresponding to the first IP multicast address via IP multicast.
[0152] It should be noted that, in the embodiment of the present application, the process of the first node sending a block to the first accounting node adopts the IP multicast protocol, that is, the first node only sends once, and all relevant accounting nodes can receive it, which not only reduces the network communication bandwidth overhead and communication delay, but also avoids the accounting node forwarding blocks and identifying repeatedly forwarded blocks. Therefore, the processing resources and communication costs are reduced, and the service performance is improved.
[0153] It should be noted that, in the embodiments of the present application, Figure 5 As shown, after the second block is sent to all first accounting nodes in the multicast tree corresponding to the first IP multicast address through a first preset method, a second request sent by the first accounting node can be received; wherein the second request carries identification information corresponding to the lost block, and then the lost block can be obtained based on the identification information corresponding to the lost block and the block repository, and then the lost block can be sent to the corresponding accounting node through a second preset method, wherein the second preset method includes a unicast method, and the accounting node includes the first accounting node that sends the second request.
[0154] It should be noted that, in an embodiment of the present application, the second request may carry identification information corresponding to the lost block, for example, the ID of the lost block. The present application does not specifically limit the type and amount of information carried by the second request.
[0155] Step 406: The first accounting node determines whether there is a lost block based on the first chain identifier, the first channel identifier, and the second block.
[0156] It should be noted that, in an embodiment of the present application, when the first accounting node determines whether there is a lost block at present based on the first chain identifier, the first channel identifier and the second block, it can determine whether the identification information corresponding to the received second block is consistent with the expected identification information based on the first chain identifier and the first channel identifier; if the identification information corresponding to the second block is consistent with the expected identification information, it is determined that there is no lost block; or, if the identification information corresponding to the second block is inconsistent with the expected identification information, it is determined that there is a lost block.
[0157] Exemplarily, in an embodiment of the present application, the first accounting node receives the m+1th second block on a specific multicast address, but has not received the mth second block in the chain and the channel corresponding to the first chain identifier and the first channel identifier locally, that is, the identification information (m+1) corresponding to the second block is inconsistent with the expected identification information (m), then it can be concluded that a block is lost.
[0158] Step 407: When the first accounting node determines that there is a lost block, it obtains the lost block based on the communication compensation mechanism.
[0159] It should be noted that, in an embodiment of the present application, when the first accounting node determines that there is a lost block, it can send a second request to the first node when obtaining the lost block based on the communication compensation mechanism; wherein the second request carries identification information corresponding to the lost block; and then the lost block sent by the first node through a second preset method can be received; wherein the second preset method includes a unicast method.
[0160] It should be noted that, in the embodiments of the present application, the above method for determining whether a block is lost not only supports the identification and compensation of a single block loss, but also can identify multiple continuous or discontinuous block losses; and the above method is not only applicable to occasional multicast packet loss scenarios, but also to scenarios where the accounting node is offline for a long time or resumes work after a network outage, and can quickly compensate for block losses during the offline period.
[0161] In summary, the embodiment of the present application can first establish an IP multicast channel. After the second node sends the first information to the first accounting node, the first node can receive the first request sent by the network device connected to the first accounting node; then the first node can add the network device connected to the first accounting node as a leaf node to the multicast tree based on the first node address and the first IP multicast address; wherein the root of the multicast tree is the first node, so that a multicast forwarding tree with the first node address as the source address and the first IP multicast address as the destination address can be formed, and then the first node can send the second block to all the first accounting nodes in the multicast tree corresponding to the first IP multicast address through IP multicast, that is, the process of the first node sending the block to the first accounting node adopts the IP multicast protocol, the first node only sends it once, and all relevant accounting nodes can receive it, which not only reduces the network communication bandwidth overhead and communication delay, but also avoids the accounting node forwarding blocks and identifying repeatedly forwarded blocks. Therefore, the processing resources and communication costs are reduced, and the service performance is improved. After receiving the second block sent by the first node via IP multicast, the first accounting node can determine whether there is a lost block at present based on the first chain identifier, the first channel identifier and the second block, that is, it can determine whether the identification information corresponding to the received second block is consistent with the expected identification information based on the first chain identifier and the first channel identifier; if the identification information corresponding to the second block is consistent with the expected identification information, it is determined that there is no lost block; or, if the identification information corresponding to the second block is inconsistent with the expected identification information, it is determined that there is a lost block. When determining that there is a lost block, the first accounting node can obtain the lost block based on the communication compensation mechanism, and can send a second request to the first node; wherein the second request carries the identification information corresponding to the lost block; and then the lost block sent by the first node via unicast can be received.
[0162] The embodiment of the present application provides a blockchain communication method, which is applied to a first node, a first accounting node and a second node, wherein the first node receives first information sent by the second node, the first information includes a first IP multicast address; wherein the second node is at least used to manage the accounting node group address and the IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier; after receiving the first block sent by the first sorting node, the first block is converted into a second block; wherein the first sorting node is at least used to package the blocks and generate blocks in sequence according to the packaging rules; the second block is sent to all first accounting nodes in the multicast tree corresponding to the first IP multicast address in a first preset manner; wherein the first preset manner The method includes an IP multicast method; the first accounting node determines whether there is a lost block at present based on the first chain identifier, the first channel identifier and the second block; when it is determined that there is a lost block, the lost block is obtained based on the communication compensation mechanism; the second node receives a third request sent by the chain management cluster; wherein the third request carries at least one chain identifier and a channel identifier under the chain identifier; based on the multicast address library, a second IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier is obtained, and a corresponding third node address is assigned to at least one chain identifier and a channel identifier under the chain identifier; the first information is sent to the first node; wherein the third node address includes the first node address, and the second IP multicast address includes the first IP multicast address. It can be seen that after receiving the third request sent by the chain management cluster, the second node can obtain the second IP multicast address corresponding to at least one chain identifier and the channel identifier under the chain identifier based on the multicast address library, and assign the corresponding third node address to at least one chain identifier and the channel identifier under the chain identifier. Then the second node can send the first information to the first node, and the first information carries the first chain identifier and the first IP multicast address corresponding to the first channel identifier under the first chain identifier, so that after the first node receives the first block sent by the first sorting node, it can send the second block converted from the first block to all nodes in the multicast tree corresponding to the first IP multicast address through IP multicast. There is a first accounting node, that is, the first node only needs to send the second block once, and all relevant accounting nodes can receive it within one communication cycle, thereby reducing network communication bandwidth overhead and communication delay, thereby reducing blockchain business deployment and operating costs; the first accounting node can determine whether there is a lost block based on the first chain identifier, the first channel identifier and the second block; when it is determined that there is a lost block, the lost block can be obtained based on the communication compensation mechanism. This communication compensation mechanism is not only applicable to occasional multicast packet loss scenarios, but also to scenarios where the accounting node is offline for a long time or resumes work after disconnection, and can quickly compensate for block loss during the offline period.
[0163] Based on the above embodiments, another embodiment of the present application provides a blockchain communication method. This method addresses the communication defects existing in the current blockchain platform and proposes a method for using IP multicast technology to carry out communication between blockchain nodes in a cloud data center networking environment, thereby effectively improving communication efficiency, reducing communication load, and eliminating message transmission and processing redundancy, thereby achieving the effect of reducing system overhead, increasing system capacity, and reducing the cost of providing a single service.
[0164] It should be noted that in the embodiments of the present application, multicast technology refers to a network communication in which a single sender corresponds to multiple receivers. In multicast technology, by transmitting a single information stream to multiple receivers, the network communication traffic in the case where multiple receivers listen to or view the same resource at the same time can be reduced. Multicast technology solves the problem of achieving single-point sending and multi-point receiving with minimal network overhead, that is, point-to-multipoint data transmission. It is more efficient than broadcast / unicast transmission, can save network bandwidth, and reduce network load; compared with unicast, the advantage of multicast is that: since the transmitted information is copied and distributed at the network node as far away from the information source as possible, the increase in users will not lead to an increase in the load of the information source and a significant increase in network resource consumption; compared with broadcast, the advantage of multicast is that: since the transmitted information will only be sent to the receiver who needs the information, it will not cause a waste of network resources and can improve the security of information transmission; in addition, broadcast can only be carried out in the same broadcast domain, while multicast can achieve cross-domain transmission.
[0165] It should be noted that in the embodiments of the present application, the present application optimizes the blockchain system of the "endorsement-sorting-verification" model. Figure 3 As shown, the present application adds a communication cluster, which includes two new components: a communication management module and a multicast communication module. At the same time, a multicast forwarding tree is constructed between the accounting node and the multicast communication module to form an IP multicast network.
[0166] It should be noted that in the embodiments of the present application, the following prerequisites are assumed: (1) the service provider nodes (physical computers or virtual machines or containers) of the entire blockchain system are located in the same cloud data center, or in multiple cloud data centers but there are direct links between these data centers; all service provider nodes, regardless of whether they are physically located in the same data center, can form the same virtual local area network through networking technologies (such as virtual private network (VPN), virtual local area network (VLAN), virtual extended local area network (VxLAN), etc.); (2) the cloud data center interconnection network and the cloud data center internal network support IPv4 / IPv6 multicast, collectively referred to as IP multicast.
[0167] It should be noted that in the embodiments of the present application, the functions of the newly added components (communication cluster) of the present application are described as follows: (1) a multicast communication module, including a group of isomorphic, load-sharing multicast communication nodes, providing a highly available multicast convergence point service, and each multicast communication node provides the following functions: a. connecting to a sorting cluster of a specific channel on a specific chain, and obtaining packaged blocks for a specific channel on a specific chain from one or more sorting nodes in the sorting cluster; b. using "channel identifier + block ID" as an index to cache block data in a block repository; the cached data can be used for retransmission or compensatory acquisition of specific blocks; c. (optional) accepting multicast communication encryption information encrypted by the public key of the multicast communication node from the communication management module, including but not limited to: symmetric keys, cryptographic algorithms, etc.; and using its own private key to decrypt the above information; d. (optional) encrypting block data according to the cryptographic algorithm and the parsed key; e. decrypting the block data according to the I assigned by the communication management module P multicast address, encapsulated into a multicast message based on the multicast protocol format requirements, and forwarded the message to the multicast forwarding tree corresponding to the channel; (2) a communication management module, including a group of multicast management nodes with homogeneous redundancy and shared multicast address library and a high-availability, high-real-time multicast address library; wherein the multicast management node provides the following functions: a. IP multicast address pool management: including idle IP multicast address pool and occupied IP multicast address pool; b. IP multicast address allocation and recycling; c. The correspondence between the IP multicast address in "use" state and (chain identifier, channel identifier); d. The correspondence between the IP multicast address in "use" state and the multicast communication node; e. (optional) the multicast communication encryption password is allocated and transmitted to the multicast communication node and the sorting node. The key is allocated by this module. A symmetric key for a specific encryption algorithm is provided for each chain, each channel, and each multicast address. The symmetric key will be encrypted with the public key of each node and distributed to the corresponding multicast communication node and verification node respectively.
[0168] It should be noted that in the embodiments of the present application, the multicast address library may include the following information: (1) all channels in the blockchain system and the accounting node information owned by each organization in the channel, which is provided in real time by the blockchain management module through the A.1 interface; (2) the occupancy status of all IP multicast addresses in the blockchain service network, the chain and channel identifiers of the IP multicast address services, within the virtual network scope of the blockchain service network, within the life cycle scope, on different chains and channels, the IP multicast address is not reused, and this information is maintained in real time by this module. The present application does not specifically limit the type and quantity of information included in the multicast address library.
[0169] It should be noted that in the embodiments of the present application, the present application enhances the functions of the existing blockchain nodes, including the sorting cluster, the accounting cluster and the chain management cluster; among them, the enhancement of the sorting cluster function mainly includes: Figure 3 As shown, a. The sorting node enhances the communication management function, communicates with the multicast management node through the A.3 interface, and obtains the multicast communication node address for a specific chain and channel; b. The sorting node modifies the communication function, replaces the original P2P communication protocol with a unicast reliable communication protocol from the sorting node to the multicast communication node (for example: based on the Transmission Control Protocol (TCP) long connection); the enhancement of the accounting cluster function mainly includes: a. The accounting node enhances the communication management function, communicates with the multicast management node, and obtains the multicast communication node address for a specific chain and channel; b. The accounting node enhances the communication function, including an IP multicast client, which, after receiving the multicast address notification of the above A.3 interface, initiates an IGMP join instruction to a specific IP multicast address, joins a specific multicast communication, and establishes a forwarding tree to the multicast communication node with itself as a leaf node; at the same time, uninstalls the corresponding P2P communication protocol, and no longer communicates directly with other verification nodes; c. (Optional) Accepts the encrypted multicast communication information encrypted by the public key of the accounting node from the communication management module, including but not limited to: symmetric key, cryptographic algorithm, etc.; and uses its own private key to decrypt the encrypted multicast communication information. The above information; d. Accept multicast messages from the specified IP multicast tree and decrypt them using the specified cryptographic algorithm and key; e. Message compensation: In addition to the normal acceptance of multicast messages mentioned above, the verification node also has a message compensation function, that is, for a specific channel, if the block ID is found to be discontinuous, it can actively initiate a missing block acquisition request to any communication node, and obtain the specified block in unicast communication mode to ensure the continuity of the blockchain structure; The enhancements to the chain management cluster function mainly include: a. Channel management component: Add an interface with the communication management module, instruct the communication management module to allocate multicast addresses for the specified chain and specified channel and notify the sorting cluster, multicast communication cluster and accounting cluster; b. Network management component: Responsible for turning on or off IP multicast protocol support on relevant network devices in the relevant data center network, and making necessary configurations.
[0170] It should be noted that, in the embodiments of the present application, Fig.10 This is a schematic diagram of the process of establishing a multicast channel in the blockchain system chain and channel creation process proposed in the embodiment of the present application, such as Fig.10As shown, the IP multicast channel establishment process during the chain and channel establishment process designed in the embodiment of the present application is as follows: 0. Through the network management component in the chain management cluster, the IP multicast protocol (such as PIM-SM / PIM-DM, IGMP / IGMP-Snooping, etc.) is pre-enabled on the relevant network devices; 1. The chain administrator initiates a chain and channel creation request, and initiates a creation instruction after completing the relevant configuration; 2. After completing the channel and chain creation related processing, a request for the corresponding multicast channel creation is initiated to the communication management module (i.e., the second node) of the communication management cluster; 3. The communication management module (i.e., the second node) obtains an idle IP multicast address M from the multicast address library module, and allocates a corresponding communication node address (i.e., a specific "chain identifier + channel ID" (i.e., at least one chain identifier and a channel identifier under the chain identifier) The communication node A (i.e., the third node address) uniquely identified by the "chain identifier + channel ID" is notified by the communication management module (i.e., the second node) to the corresponding sorting cluster in the sorting cluster of the communication node address A (i.e., the first node address) uniquely identified by the "chain identifier + channel ID"; 5. The communication management module notifies the communication node A (i.e., the first node address) uniquely identified by the "chain identifier + channel ID", the multicast communication address M (i.e., the first IP multicast address), and (optionally) the multicast communication encryption information (i.e., the first encryption information) encrypted using the public key of the receiver (including the key K, encryption algorithm, etc.) to all verification nodes in the channel with "chain identifier + channel ID" respectively; 6-7. The communication node (i.e., the first node) parses the message to obtain the multicast address M (i.e., the first IP multicast address) and the (optional) multicast communication encryption information. Each verification node parses the communication node address A, obtains the multicast address M, and (optional) multicast communication encryption information from the message; initiates an IGMP multicast join request with the communication node A as the source and the multicast address M as the target to the corresponding network device; 8. After the network device adjacent to the verification node recognizes the IGMP request, it initiates a multicast join request from bottom to top in the direction of the communication node A, forming a multicast forwarding tree with A (i.e., the first node) as the source and M as the target address; 9-10. After the multicast routing is stable and the multicast tree is established, the communication node sends a channel establishment completion or failure response to the communication management module and the channel management component.
[0171] That is to say, in an embodiment of the present application, the embodiment of the present application can first establish an IP multicast channel. For example, after the second node sends the first information to the first accounting node, the first node can receive the first request sent by the network device connected to the first accounting node; then the first node can add the network device connected to the first accounting node as a leaf node to the multicast tree based on the first node address and the first IP multicast address; wherein the root of the multicast tree is the first node, thereby forming a multicast forwarding tree with the first node address as the source address and the first IP multicast address as the destination address, and then the first node can send the second block to all first accounting nodes in the multicast tree corresponding to the first IP multicast address via IP multicast.
[0172] It should be noted that, in an embodiment of the present application, the first information may include one or more of a first node address, a first IP multicast address, and first encryption information. The present application does not specifically limit the type and amount of information included in the first information.
[0173] It should be noted that, in the embodiment of the present application, the process of the first node sending a block to the first accounting node adopts the IP multicast protocol, that is, the first node only sends once, and all relevant accounting nodes can receive it, which not only reduces the network communication bandwidth overhead and communication delay, but also avoids the accounting node forwarding blocks and identifying repeatedly forwarded blocks. Therefore, the processing resources and communication costs are reduced, and the service performance is improved.
[0174] It should be noted that, in the embodiments of the present application, Fig.10 As shown, the aforementioned process describes the process in which the multicast management node of the communication management module applies for an idle multicast IP address from the multicast address library during the process of creating a chain or a channel; when deleting a channel or a chain, the reverse operation is used to release the multicast IP address and return it to the multicast address library.
[0175] Further, in an embodiment of the present application, based on the IP multicast channel successfully established based on the above method, the communication process of the blockchain system optimized by the communication mechanism designed by the present application is shown as follows: Fig.11 The following is a schematic diagram of the optimized blockchain system communication process proposed in the embodiment of the present application, as shown in FIG. Fig.11As shown, the optimized blockchain system communication process may include the following steps: Step 0. The client is ready, has learned the address information of the endorsement node in the network, and is ready to propose, that is, a call to the smart contract; Step 1. The client connects to the endorsement nodes P1 and Px of the organization specified by the smart contract endorsement policy, and calls the smart contract S1 to query or update the ledger L1; Step 2. The endorsement node Px executes the chain code S1 to generate a proposal response, which includes the query result or the ledger update proposal data and the signature endorsement of the endorsement node Px on the proposal data; Step 3. Client A receives the response to the proposal, and the query process ends here; for the update process, continue with the following steps; Step 4. Client A collects a sufficient number of responses from the endorsement nodes; Step 5. Client A creates a transaction and sends the transaction to the main sorting node O1 for sorting; Step 6. The sorting node O1 collects transactions in the network and Pack into blocks (i.e., the first block); Step 7. The main sorting node unicasts these blocks (i.e., the first block) to the corresponding communication node n (i.e., the first node); Step 8. The communication node (i.e., the first node) determines whether to encrypt the block data according to the confidentiality requirements of the data on the channel. If encryption is required, the corresponding encryption key K is extracted using the "chain identifier + channel ID", and the block is encrypted using the specified algorithm; then, the block identifier and content are stored in the block storage repository; Step 9. With the communication node (i.e., the first node) as the root, the new block content (i.e., the second block) is sent with the group address M as the target address in IP multicast; Step 10. All accounting nodes (i.e., the first accounting node) that have joined the multicast tree receive the new block, (optionally) use the key K to decrypt and restore the block content, and verify the transaction before submitting it to the ledger L1; Step 11. When L1 is updated, the client is notified of the call success in an event manner.
[0176] It should be noted that, in the embodiments of the present application, Fig.11 As shown, in step 9 of the above process, the communication node sends blocks to the accounting node using the IP multicast protocol, that is, the communication node only sends once, and all relevant accounting nodes can receive it, which not only reduces the network communication bandwidth overhead and communication delay, but also avoids the accounting node forwarding blocks and identifying repeated forwarded blocks. Therefore, the processing resources and communication costs are reduced, and the service performance is improved.
[0177] It should be noted that in the embodiment of the present application, considering the abnormal situations such as packet loss in multicast using User Datagram Protocol (UDP) and the overload of the accounting node at the time of multicast and failure to receive correctly, the embodiment of the present application also designs a communication compensation mechanism. The compensation process is as follows: Fig.11As shown, the communication compensation mechanism may include the following steps: Step 21. A certain accounting node z (i.e., the first accounting node) receives the m+1th block multicast at a specific multicast address, but has not received the mth block in the chain and the channel locally, then it can be concluded that the previous multicast message is lost; Step 22. The accounting node sends a specific block content acquisition request (i.e., the second request) to any idle communication node in the multicast communication cluster; Steps 23-24. The communication node (i.e., the first node) obtains the corresponding block from the block repository and sends it to the accounting node in unicast mode.
[0178] Exemplarily, in an embodiment of the present application, the first accounting node may determine whether the identification information corresponding to the received second block is consistent with the expected identification information based on the first chain identifier and the first channel identifier; if the identification information corresponding to the second block is consistent with the expected identification information, it is determined that there is no lost block; or, if the identification information corresponding to the second block is inconsistent with the expected identification information, it is determined that there is a lost block.
[0179] Exemplarily, in an embodiment of the present application, the first accounting node receives the m+1th second block on a specific multicast address, but has not received the mth second block in the chain and the channel corresponding to the first chain identifier and the first channel identifier locally, that is, the identification information (m+1) corresponding to the second block is inconsistent with the expected identification information (m), then it can be concluded that a block is lost.
[0180] It should be noted that in the embodiments of the present application, for the above-mentioned communication compensation mechanism process, the block loss detection method not only supports the identification and compensation of a single block loss, but also can identify multiple continuous or discontinuous block losses. The above method is not only applicable to occasional multicast packet loss scenarios, but also to scenarios where the accounting node is offline for a long time or resumes work after disconnection, and can quickly compensate for block loss during the offline period.
[0181] In summary, the embodiment of the present application can first establish an IP multicast channel. After the second node sends the first information to the first accounting node, the first node can receive the first request sent by the network device connected to the first accounting node; then the first node can add the network device connected to the first accounting node as a leaf node to the multicast tree based on the first node address and the first IP multicast address; wherein the root of the multicast tree is the first node, so that a multicast forwarding tree with the first node address as the source address and the first IP multicast address as the destination address can be formed, and then the first node can send the second block to all the first accounting nodes in the multicast tree corresponding to the first IP multicast address through IP multicast, that is, the process of the first node sending the block to the first accounting node adopts the IP multicast protocol, the first node only sends it once, and all relevant accounting nodes can receive it, which not only reduces the network communication bandwidth overhead and communication delay, but also avoids the accounting node forwarding blocks and identifying repeatedly forwarded blocks. Therefore, the processing resources and communication costs are reduced, and the service performance is improved. After receiving the second block sent by the first node via IP multicast, the first accounting node can determine whether there is a lost block at present based on the first chain identifier, the first channel identifier and the second block, that is, it can determine whether the identification information corresponding to the received second block is consistent with the expected identification information based on the first chain identifier and the first channel identifier; if the identification information corresponding to the second block is consistent with the expected identification information, it is determined that there is no lost block; or, if the identification information corresponding to the second block is inconsistent with the expected identification information, it is determined that there is a lost block. When determining that there is a lost block, the first accounting node can obtain the lost block based on the communication compensation mechanism, and can send a second request to the first node; wherein the second request carries the identification information corresponding to the lost block; and then the lost block sent by the first node via unicast can be received.
[0182] The embodiment of the present application provides a blockchain communication method, which is applied to a first node, a first accounting node and a second node, wherein the first node receives first information sent by the second node, the first information includes a first IP multicast address; wherein the second node is at least used to manage the accounting node group address and the IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier; after receiving the first block sent by the first sorting node, the first block is converted into a second block; wherein the first sorting node is at least used to package the blocks and generate blocks in sequence according to the packaging rules; the second block is sent to all first accounting nodes in the multicast tree corresponding to the first IP multicast address in a first preset manner; wherein the first preset manner The method includes an IP multicast method; the first accounting node determines whether there is a lost block at present based on the first chain identifier, the first channel identifier and the second block; when it is determined that there is a lost block, the lost block is obtained based on the communication compensation mechanism; the second node receives a third request sent by the chain management cluster; wherein the third request carries at least one chain identifier and a channel identifier under the chain identifier; based on the multicast address library, a second IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier is obtained, and a corresponding third node address is assigned to at least one chain identifier and a channel identifier under the chain identifier; the first information is sent to the first node; wherein the third node address includes the first node address, and the second IP multicast address includes the first IP multicast address. It can be seen that after receiving the third request sent by the chain management cluster, the second node can obtain the second IP multicast address corresponding to at least one chain identifier and the channel identifier under the chain identifier based on the multicast address library, and assign the corresponding third node address to at least one chain identifier and the channel identifier under the chain identifier. Then the second node can send the first information to the first node, and the first information carries the first chain identifier and the first IP multicast address corresponding to the first channel identifier under the first chain identifier, so that after the first node receives the first block sent by the first sorting node, it can send the second block converted from the first block to all nodes in the multicast tree corresponding to the first IP multicast address through IP multicast. There is a first accounting node, that is, the first node only needs to send the second block once, and all relevant accounting nodes can receive it within one communication cycle, thereby reducing network communication bandwidth overhead and communication delay, thereby reducing blockchain business deployment and operating costs; the first accounting node can determine whether there is a lost block based on the first chain identifier, the first channel identifier and the second block; when it is determined that there is a lost block, the lost block can be obtained based on the communication compensation mechanism. This communication compensation mechanism is not only applicable to occasional multicast packet loss scenarios, but also to scenarios where the accounting node is offline for a long time or resumes work after disconnection, and can quickly compensate for block loss during the offline period.
[0183] Based on the above embodiment, the embodiment of the present application provides a first node, Fig.12The structure diagram of the first node Figure 1 ,like Fig.12 As shown, the first node 10 includes: a first receiving unit 11, a conversion unit 12 and a first sending unit 13; wherein,
[0184] A first receiving unit 11 is used to receive first information sent by a second node; wherein the first information includes a first IP multicast address, the first IP multicast address includes a first chain identifier and an IP multicast address corresponding to a first channel identifier under the first chain identifier, and the second node is at least used to manage an accounting node group address and an IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier;
[0185] The conversion unit 12 is used to convert the first block into a second block after receiving the first block sent by the first sorting node; wherein the first sorting node is at least used to package the blocks and generate blocks in sequence according to the packaging rule;
[0186] The first sending unit 13 is used to send the second block to all first accounting nodes in the multicast tree corresponding to the first IP multicast address through a first preset method; wherein the first preset method includes an IP multicast method.
[0187] In the embodiments of the present application, further, Fig.13 The structure diagram of the first node Figure 2 ,like Fig.13 As shown, the first node 10 proposed in the embodiment of the present application may also include a first processor 14, a first memory 15 storing executable instructions of the first processor 14, and further, the first node 10 may also include a first communication interface 16, and a first bus 17 for connecting the first processor 14, the first memory 15 and the first communication interface 16.
[0188] In the embodiment of the present application, the first processor 14 may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It can be understood that for different devices, the electronic device used to implement the above-mentioned processor function may also be other, and the embodiment of the present application is not specifically limited. The first node 10 may also include a first memory 15, which may be connected to the first processor 14, wherein the first memory 15 is used to store executable program code, the program code includes computer operation instructions, and the first memory 15 may include a high-speed RAM memory, and may also include a non-volatile memory, for example, at least two disk memories.
[0189] In the embodiment of the present application, the first bus 17 is used to connect the first communication interface 16, the first processor 14 and the first memory 15, and the mutual communication between these devices.
[0190] In the embodiment of the present application, the first memory 15 is used to store instructions and data.
[0191] Further, in an embodiment of the present application, the above-mentioned first processor 14 is used to receive first information sent by a second node; wherein, the first information includes a first IP multicast address, the first IP multicast address includes a first chain identifier and an IP multicast address corresponding to a first channel identifier under the first chain identifier, and the second node is at least used to manage the accounting node group address and IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier; after receiving the first block sent by the first sorting node, the first block is converted into a second block; wherein, the first sorting node is at least used to package the blocks and generate blocks in order according to the packaging rules; the second block is sent to all first accounting nodes in the multicast tree corresponding to the first IP multicast address through a first preset method; wherein, the first preset method includes an IP multicast method.
[0192] In practical applications, the first memory 15 may be a volatile memory, such as a random access memory (RAM); or a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk (HDD) or a solid-state drive (SSD); or a combination of the above types of memories, and provide instructions and data to the first processor 14.
[0193] The embodiment of the present application provides a first node, the first node receives the first information sent by the second node; wherein the first information includes a first IP multicast address, the first IP multicast address includes the first chain identifier and the IP multicast address corresponding to the first channel identifier under the first chain identifier, and the second node is at least used to manage the accounting node group address and IP multicast address corresponding to at least one chain identifier and the channel identifier under the chain identifier; after receiving the first block sent by the first sorting node, the first block is converted into a second block; wherein the first sorting node is at least used to package the blocks and generate blocks in accordance with the order of the packaging rules; the second block is sent to all the first accounting nodes in the multicast tree corresponding to the first IP multicast address through a first preset method; wherein the first preset method includes an IP multicast method. It can be seen from this that after the first node receives the first block sent by the first sorting node, the second block converted from the first block can be sent to all the first accounting nodes in the multicast tree corresponding to the first IP multicast address through an IP multicast method, that is, the first node only needs to send the second block once, and all relevant accounting nodes can receive it within a communication cycle, thereby reducing the network communication bandwidth overhead and communication delay, thereby reducing the blockchain business deployment and operation costs.
[0194] An embodiment of the present application provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the blockchain communication method as described above.
[0195] Specifically, the program instructions corresponding to a blockchain communication method in this embodiment can be stored on a storage medium such as a CD, a hard disk, a USB flash drive, etc. When the program instructions corresponding to a blockchain communication method in the storage medium are read or executed by an electronic device, the following steps are included:
[0196] Receive first information sent by a second node; wherein the first information includes a first IP multicast address, the first IP multicast address includes a first chain identifier and an IP multicast address corresponding to a first channel identifier under the first chain identifier, and the second node is at least used to manage an accounting node group address and an IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier;
[0197] After receiving the first block sent by the first sorting node, convert the first block into a second block; wherein the first sorting node is at least used to package the blocks and generate blocks in sequence according to the packaging rule;
[0198] The second block is sent to all first accounting nodes in the multicast tree corresponding to the first IP multicast address through a first preset method; wherein the first preset method includes an IP multicast method.
[0199] The embodiment of the present application further provides a computer program product, including a computer program, and the computer program can be executed by the first processor 14 of the first node 10 to complete the steps of any of the aforementioned methods.
[0200] In the embodiments of the present application, further, Fig.14 This is a schematic diagram of the composition structure of the first accounting node Figure 1 ,like Fig.14 As shown, the first accounting node 20 includes: a second receiving unit 21, a judging unit 22 and a first obtaining unit 23; wherein,
[0201] The second receiving unit 21 is used to receive a second block sent by the first node in a first preset manner; wherein the first preset manner includes an IP multicast manner, the second block includes a block encrypted based on the first encryption information, and the first block includes a first chain identifier and a block corresponding to a first channel identifier under the first chain identifier;
[0202] The determining unit 22 is configured to determine whether there is a lost block at present based on the first chain identifier, the first channel identifier and the second block;
[0203] The first acquisition unit 23 is used to acquire the lost block based on the communication compensation mechanism when it is determined that there is a lost block.
[0204] In the embodiments of the present application, further, Fig.15 This is a schematic diagram of the composition structure of the first accounting node Figure 2 ,like Fig.15As shown, the first accounting node 20 proposed in the embodiment of the present application may also include a second processor 24 and a second memory 25 storing executable instructions of the second processor 24. Further, the first accounting node 20 may also include a second communication interface 26 and a second bus 27 for connecting the second processor 24, the second memory 25 and the second communication interface 26.
[0205] In the embodiment of the present application, the second processor 24 may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It can be understood that for different devices, the electronic device used to implement the above-mentioned processor function may also be other, and the embodiment of the present application is not specifically limited. The first accounting node 20 may also include a second memory 25, which may be connected to the second processor 24, wherein the second memory 25 is used to store executable program code, the program code includes computer operation instructions, and the second memory 25 may include a high-speed RAM memory, and may also include a non-volatile memory, for example, at least two disk memories.
[0206] In the embodiment of the present application, the second bus 27 is used to connect the second communication interface 26, the second processor 24 and the second memory 25, and the mutual communication between these devices.
[0207] In the embodiment of the present application, the second memory 25 is used to store instructions and data.
[0208] Further, in an embodiment of the present application, the above-mentioned second processor 24 is used to receive a second block sent by the first node through a first preset method; wherein the first preset method includes an IP multicast method, the second block includes a block after encrypting the first block based on the first encryption information, and the first block includes a first chain identifier and a block corresponding to the first channel identifier under the first chain identifier; based on the first chain identifier, the first channel identifier and the second block, it is determined whether there is a lost block at present; when it is determined that there is a lost block, the lost block is obtained based on the communication compensation mechanism.
[0209] In practical applications, the second memory 25 may be a volatile memory, such as a random access memory (RAM); or a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or a combination of the above types of memories, and provide instructions and data to the second processor 24.
[0210] The embodiment of the present application provides a first accounting node, the first accounting node receives the second block sent by the first node through a first preset method; wherein the first preset method includes an IP multicast method, the second block includes a block encrypted based on the first encryption information, and the first block includes a first chain identifier and a block corresponding to the first channel identifier under the first chain identifier; based on the first chain identifier, the first channel identifier and the second block, it is judged whether there is a lost block at present; in the case where it is judged that there is a lost block, the lost block is obtained based on the communication compensation mechanism. It can be seen that the first accounting node can judge whether there is a lost block at present based on the first chain identifier, the first channel identifier and the second block; in the case where it is judged that there is a lost block, the lost block can be obtained based on the communication compensation mechanism. The communication compensation mechanism is not only applicable to occasional multicast packet loss scenarios, but also applicable to scenarios where the accounting node is offline for a long time or resumes work after disconnection, and can quickly compensate for block loss during the offline period.
[0211] An embodiment of the present application provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the blockchain communication method as described above.
[0212] Specifically, the program instructions corresponding to a blockchain communication method in this embodiment can be stored on a storage medium such as a CD, a hard disk, a USB flash drive, etc. When the program instructions corresponding to a blockchain communication method in the storage medium are read or executed by an electronic device, the following steps are included:
[0213] Receive a second block sent by the first node in a first preset manner; wherein the first preset manner includes an IP multicast manner, the second block includes a block obtained by encrypting the first block based on the first encryption information, and the first block includes a first chain identifier and a block corresponding to a first channel identifier under the first chain identifier;
[0214] Determine whether there is a lost block at present based on the first chain identifier, the first channel identifier and the second block;
[0215] When it is determined that there is a lost block, the lost block is obtained based on the communication compensation mechanism.
[0216] The embodiment of the present application also provides a computer program product, including a computer program, which can be executed by the second processor 24 of the first accounting node 20 to complete the steps of any of the aforementioned methods.
[0217] In the embodiments of the present application, further, Fig.16 The structure diagram of the second node Figure 1 ,like Fig.16 As shown, the second node 30 includes: a third receiving unit 31, a second acquiring unit 32, an allocating unit 33 and a second sending unit 34; wherein,
[0218] The third receiving unit 31 is used to receive a third request sent by the chain management cluster; wherein the third request carries at least one chain identifier and a channel identifier under the chain identifier;
[0219] The second acquisition unit 32 is used to acquire, based on the multicast address library, a second IP multicast address corresponding to the at least one chain identifier and the channel identifier under the chain identifier;
[0220] The allocation unit 33 is used to allocate a corresponding third node address to the at least one chain identifier and the channel identifier under the chain identifier;
[0221] The second sending unit 34 is used to send first information to the first node; wherein the first information includes a first IP multicast address, the third node address includes the first node address, and the second IP multicast address includes the first IP multicast address.
[0222] In the embodiments of the present application, further, Fig.17 The structure diagram of the second node Figure 2 ,like Fig.17 As shown, the second node 30 proposed in the embodiment of the present application may also include a third processor 35 and a third memory 36 storing executable instructions of the third processor 35. Further, the second node 30 may also include a third communication interface 37 and a third bus 38 for connecting the third processor 35, the third memory 36 and the third communication interface 37.
[0223] In the embodiment of the present application, the third processor 35 can be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor. It can be understood that for different devices, the electronic device used to implement the above-mentioned processor function can also be other, and the embodiment of the present application is not specifically limited. The second node 30 can also include a third memory 36, which can be connected to the third processor 35, wherein the third memory 36 is used to store executable program code, the program code includes computer operation instructions, and the third memory 36 may include a high-speed RAM memory, and may also include a non-volatile memory, for example, at least two disk memories.
[0224] In the embodiment of the present application, the third bus 38 is used to connect the third communication interface 37, the third processor 35 and the third memory 36, and the mutual communication between these devices.
[0225] In the embodiment of the present application, the third memory 36 is used to store instructions and data.
[0226] Further, in an embodiment of the present application, the above-mentioned third processor 35 is used to receive a third request sent by the chain management cluster; wherein the third request carries at least one chain identifier and a channel identifier under the chain identifier; based on the multicast address library, obtain the second IP multicast address corresponding to the at least one chain identifier and the channel identifier under the chain identifier, and assign a corresponding third node address to the at least one chain identifier and the channel identifier under the chain identifier; send first information to the first node; wherein the first information includes the first IP multicast address, the third node address includes the first node address, and the second IP multicast address includes the first IP multicast address.
[0227] In practical applications, the third memory 36 may be a volatile memory, such as a random access memory (RAM); or a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or a combination of the above types of memories, and provide instructions and data to the third processor 35.
[0228] The embodiment of the present application provides a second node, the second node receives a third request sent by a chain management cluster; wherein the third request carries at least one chain identifier and a channel identifier under the chain identifier; based on the multicast address library, obtains a second IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier, and assigns a corresponding third node address to at least one chain identifier and a channel identifier under the chain identifier; sends a first message to the first node; wherein the first message includes a first IP multicast address, the third node address includes the first node address, and the second IP multicast address includes the first IP multicast address. It can be seen that the second node can obtain a second IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier based on the multicast address library, and assigns a corresponding third node address to at least one chain identifier and a channel identifier under the chain identifier, and then can send information carrying an IP multicast address corresponding to a specific chain identifier and a channel identifier under the chain identifier to the node corresponding to the third node address, so that the corresponding communication node can send the block to all first accounting nodes in the multicast tree corresponding to the IP multicast address through IP multicast after receiving the block sent by the first sorting node, thereby reducing network communication bandwidth overhead and communication delay.
[0229] An embodiment of the present application provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the blockchain communication method as described above.
[0230] Specifically, the program instructions corresponding to a blockchain communication method in this embodiment can be stored on a storage medium such as a CD, a hard disk, a USB flash drive, etc. When the program instructions corresponding to a blockchain communication method in the storage medium are read or executed by an electronic device, the following steps are included:
[0231] Receive a third request sent by the chain management cluster; wherein the third request carries at least one chain identifier and a channel identifier under the chain identifier;
[0232] Acquire, based on the multicast address library, a second IP multicast address corresponding to the at least one chain identifier and the channel identifier under the chain identifier, and assign a corresponding third node address to the at least one chain identifier and the channel identifier under the chain identifier;
[0233] Sending first information to the first node; wherein the first information includes a first IP multicast address, the third node address includes the first node address, and the second IP multicast address includes the first IP multicast address.
[0234] The embodiment of the present application further provides a computer program product, including a computer program, and the computer program can be executed by the third processor 35 of the second node 30 to complete the steps of any of the aforementioned methods.
[0235] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of hardware embodiments, software embodiments, or embodiments in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.
[0236] The present application is described with reference to implementation flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0237] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which is implemented in the implementation flow diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0238] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing the steps in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0239] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.
Claims
1. A blockchain communication method, characterized in that: The method is applied to a first node, and the method comprises: receiving first information sent by a second node; wherein the first information includes a first Internet Protocol IP multicast address, the first IP multicast address includes a first chain identifier and an IP multicast address corresponding to a first channel identifier under the first chain identifier, and the second node is at least used to manage an accounting node group address and an IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier; After receiving the first block sent by the first sorting node, convert the first block into a second block; wherein the first sorting node is at least used to package the blocks and generate blocks in sequence according to the packaging rule; The second block is sent to all first accounting nodes in the multicast tree corresponding to the first IP multicast address through a first preset method; wherein the first preset method includes an IP multicast method.
2. The method according to claim 1, characterized in that: The method further comprises: After the second node sends the first information to the first accounting node, receiving a first request sent by a network device to which the first accounting node is connected; In response to the first request, the network device connected to the first accounting node is added as a leaf node to the multicast tree based on the first node address and the first IP multicast address; wherein the root of the multicast tree is the first node.
3. The method according to claim 1, characterized in that: The first information further includes first encryption information, the first encryption information at least includes a first encryption algorithm and a first key, the first node address is used to identify the first chain identifier and the first node corresponding to the first channel identifier under the first chain identifier, and the converting the first block into the second block includes: The first block is encrypted based on the first encryption information to obtain the second block; wherein the first block includes a block corresponding to the first chain identifier and the first channel identifier.
4. The method according to claim 1, characterized in that After sending the second block to all first accounting nodes in the multicast tree corresponding to the first IP multicast address in a first preset manner, the method further includes: receiving a second request sent by the first accounting node; wherein the second request carries identification information corresponding to the lost block; Acquire the lost block based on identification information corresponding to the lost block and a block repository; The lost block is sent to the corresponding accounting node in a second preset manner, wherein the second preset manner includes a unicast manner, and the accounting node includes the first accounting node that sends the second request.
5. The method according to claim 1, characterized in that: After converting the first block into a second block, the method further includes: The identification information corresponding to the second block and the data content corresponding to the second block are stored in a block storage library.
6. A blockchain communication method, characterized in that: The method is applied to a first accounting node, and the method includes: Receive a second block sent by the first node in a first preset manner; wherein the first preset manner includes an IP multicast manner, the second block includes a block obtained by encrypting the first block based on the first encryption information, and the first block includes a first chain identifier and a block corresponding to a first channel identifier under the first chain identifier; Determine whether there is a lost block at present based on the first chain identifier, the first channel identifier and the second block; When it is determined that there is a lost block, the lost block is obtained based on the communication compensation mechanism.
7. The method according to claim 6, characterized in that Before receiving the second block sent by the first node in the first preset manner, the method further includes: Receiving first information sent by a second node; wherein the first information includes a first node address and the first IP multicast address; Based on the first node address and the first IP multicast address, an Internet Group Management Protocol IGMP request is initiated to the corresponding network device, so that the network device sends a first request to the first node based on the IGMP request; wherein the first request is used to add the first accounting node to the multicast tree.
8. The method according to claim 6, characterized in that The determining whether there is a currently lost block based on the first chain identifier, the first channel identifier, and the second block includes: Determining whether the identification information corresponding to the received second block is consistent with the expected identification information based on the first chain identifier and the first channel identifier; If the identification information corresponding to the second block is consistent with the expected identification information, it is determined that there is no lost block; Alternatively, if the identification information corresponding to the second block is inconsistent with the expected identification information, it is determined that a block is lost.
9. The method according to claim 6, characterized in that The method of obtaining the lost block based on the communication compensation mechanism when it is determined that there is a lost block includes: Sending a second request to the first node; wherein the second request carries identification information corresponding to the lost block; Receive the lost block sent by the first node through a second preset method; wherein the second preset method includes a unicast method.
10. A blockchain communication method, characterized in that: The method is applied to the second node, and the method includes: Receive a third request sent by the chain management cluster; wherein the third request carries at least one chain identifier and a channel identifier under the chain identifier; Acquire, based on the multicast address library, a second IP multicast address corresponding to the at least one chain identifier and the channel identifier under the chain identifier, and assign a corresponding third node address to the at least one chain identifier and the channel identifier under the chain identifier; Sending first information to the first node; wherein the first information includes a first IP multicast address, the third node address includes the first node address, and the second IP multicast address includes the first IP multicast address.
11. The method according to claim 10, characterized in that The method further comprises: The first node address is sent to a sorting cluster, so that the sorting cluster sends the corresponding block to the first node based on the first node address; wherein the sorting cluster includes one or more sorting nodes.
12. The method according to claim 10, characterized in that The first information further includes the first node address and first encryption information, the first encryption information at least includes a first encryption algorithm and a first key, and the method further includes: The first information is sent to a first accounting node, so that the first accounting node initiates an IGMP request to a corresponding network device based on the first node address and the first IP multicast address.
13. A first node, characterized in that: The first node includes: a first receiving unit, a conversion unit and a first sending unit; wherein, A first receiving unit, configured to receive first information sent by a second node; wherein the first information includes a first IP multicast address, the first IP multicast address includes a first chain identifier and an IP multicast address corresponding to a first channel identifier under the first chain identifier, and the second node is at least configured to manage an accounting node group address and an IP multicast address corresponding to at least one chain identifier and a channel identifier under the chain identifier; The conversion unit is configured to convert the first block into a second block after receiving the first block sent by the first sorting node; wherein the first sorting node is at least configured to package the blocks and generate blocks in sequence according to the packaging rule; The first sending unit is used to send the second block to all first accounting nodes in the multicast tree corresponding to the first IP multicast address through a first preset method; wherein the first preset method includes an IP multicast method.
14. A first node, characterized in that: The first node includes: a first processor and a first memory; wherein, The first memory is used to store a computer program that can be run on the processor; The first processor is configured to execute the method according to any one of claims 1 to 5 when running the computer program.
15. A first accounting node, characterized in that: The first accounting node includes: a second receiving unit, a judging unit and a first obtaining unit; wherein, The second receiving unit is configured to receive a second block sent by the first node in a first preset manner; wherein the first preset manner includes an IP multicast manner, the second block includes a block obtained by encrypting the first block based on the first encryption information, and the first block includes a first chain identifier and a block corresponding to a first channel identifier under the first chain identifier; The determining unit is configured to determine whether there is a lost block at present based on the first chain identifier, the first channel identifier and the second block; The first acquisition unit is used to acquire the lost block based on the communication compensation mechanism when it is determined that there is a lost block.
16. A first accounting node, characterized in that: The first accounting node includes: a second processor and a second memory; wherein, The second memory is used to store a computer program that can be run on the processor; The second processor is configured to execute the method according to any one of claims 6 to 9 when running the computer program.
17. A second node, characterized in that: The second node includes: a third receiving unit, a second acquiring unit, an allocating unit and a second sending unit; wherein, The third receiving unit is used to receive a third request sent by the chain management cluster; wherein the third request carries at least one chain identifier and a channel identifier under the chain identifier; The second acquisition unit is used to acquire, based on the multicast address library, a second IP multicast address corresponding to the at least one chain identifier and the channel identifier under the chain identifier; The allocation unit is configured to allocate a corresponding third node address to the at least one chain identifier and a channel identifier under the chain identifier; The second sending unit is used to send first information to the first node; wherein the first information includes a first IP multicast address, the third node address includes the first node address, and the second IP multicast address includes the first IP multicast address.
18. A second node, characterized in that: The second node includes: a third processor and a third memory; wherein, The second memory is used to store a computer program that can be run on the processor; The second processor is configured to execute the method according to any one of claims 10 to 12 when running the computer program.
19. A computer-readable storage medium, characterized in that: The storage medium stores computer program codes, which, when executed by a computer, execute the method described in any one of claims 1 to 5, 6 to 9, or 10 to 12.
20. A computer program product, comprising a computer program, characterized in that The computer program implements the method according to any one of claims 1-5, 6-9 or 10-12 when executed by a processor.
Citation Information
Patent Citations
Block chain unicast / multicast network, block chain device and communication method thereof in mobile broadband network
CN107277781A
Data transmission method and device, electronic equipment and storage medium
CN116192728A
Multicast management method, system and device, switch and storage medium
CN117041136A
