WO2023160089A1 - 用于区块链网络的消息广播方法、区块链节点和区块链系统 - Google Patents

用于区块链网络的消息广播方法、区块链节点和区块链系统 Download PDF

Info

Publication number
WO2023160089A1
WO2023160089A1 PCT/CN2022/135445 CN2022135445W WO2023160089A1 WO 2023160089 A1 WO2023160089 A1 WO 2023160089A1 CN 2022135445 W CN2022135445 W CN 2022135445W WO 2023160089 A1 WO2023160089 A1 WO 2023160089A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
blockchain
message data
node
application layer
Prior art date
Application number
PCT/CN2022/135445
Other languages
English (en)
French (fr)
Inventor
焦梦洪
曾超
孙赫
徐文博
Original Assignee
蚂蚁区块链科技(上海)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 蚂蚁区块链科技(上海)有限公司 filed Critical 蚂蚁区块链科技(上海)有限公司
Publication of WO2023160089A1 publication Critical patent/WO2023160089A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1042Peer-to-peer [P2P] networks using topology management mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
    • H04L12/1859Arrangements for providing special services to substations for broadcast or conference, e.g. multicast adapted to provide push services, e.g. data channels
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Definitions

  • the embodiments of this specification belong to the technical field of blockchain, and in particular relate to a message broadcasting method for a blockchain network, a blockchain node and a blockchain system.
  • the underlying component of a blockchain system is usually a distributed peer-to-peer (P2P) network.
  • P2P peer-to-peer
  • the number of connected blockchain nodes can be dozens, hundreds, or even tens of thousands.
  • it is usually necessary to propagate application layer messages among multiple blockchain nodes in the blockchain network for example, broadcasting from a blockchain node to multiple other blockchain nodes.
  • the demand for such broadcasts is high and the frequency is high, so it is necessary to improve the message broadcasting mechanism in the blockchain network.
  • the purpose of one or more embodiments of this specification is to provide a message broadcasting method for a blockchain network, a blockchain node and a blockchain system, so as to improve the efficiency of message dissemination.
  • a message broadcasting method for a block chain network includes at least a first block chain node, a second block chain node And the third blockchain node, the message broadcasting method includes:
  • the second blockchain node receives message data from the first blockchain node
  • the second blockchain node receives a piece of message data, copying the piece of message data and forwarding the piece of message data to the third blockchain node;
  • the application layer message is generated according to all the message data.
  • a blockchain node including:
  • the communication module is configured to:
  • the block chain node receives a piece of message data, copy the piece of message data and forward the piece of message data to a third block chain node different from the block chain node and the first block chain node blockchain nodes;
  • a network module of the block chain system is configured to generate the application layer message according to all the message data corresponding to the complete application layer message after the block chain node receives all the message data.
  • a blockchain system including the above-mentioned blockchain nodes.
  • Fig. 1 is a schematic diagram of a block chain network in an embodiment of this specification
  • Fig. 2 is a schematic diagram of a blockchain network in another embodiment of this specification.
  • Fig. 3 is a schematic diagram of a blockchain network in another embodiment of the specification.
  • FIG. 4 is a schematic flow diagram of a message broadcasting method for a blockchain network in an embodiment of this specification
  • FIG. 5 is a schematic flow diagram of step S300 in a method for broadcasting messages on a blockchain network in a specific example of this specification;
  • FIG. 6 is a schematic flow diagram of a message broadcasting method for a blockchain network in another embodiment of this specification.
  • Fig. 7 is a schematic flowchart of step S700 in a method for broadcasting a message on a blockchain network in a specific example of this specification.
  • Blockchain is a distributed network data storage technology built using encryption algorithms and point-to-point transmission technology. It has the characteristics of decentralization, tamper-proof, and traceability.
  • data can no longer be stored in a centralized hardware or management organization, but jointly maintained by blockchain nodes with equal rights and obligations; data can be recorded in the system of blockchain technology components On multiple nodes, it is possible to view the data saved by any node in the local blockchain at any time; once the data is verified and added to the blockchain, it can be stored permanently, using consensus algorithms and hash chains
  • Formal data storage technology can realize the non-tampering of data, so as to ensure the security and authenticity of data.
  • various blockchain nodes can be formed into a distributed network, in which the status of each node is equal.
  • the transaction data can be transmitted to each node through the network, and the node can verify the validity of the transaction and add the corresponding block to its local blockchain if the verification is passed.
  • the blockchain node can keep a complete copy of the transaction ledger locally, that is, the local blockchain, so that the copy of the transaction ledger of the node is updated synchronously, thereby reaching a decentralized consensus.
  • the blockchain network can be organized using, for example, a tree topology.
  • the blockchain node that initiates the broadcast of an application layer message can transmit the application layer message to several neighboring nodes in the next layer, and at least one of these nodes can continue to transmit the application layer message to Several neighboring nodes on the next layer, and so on, until the application layer message is broadcast to all or most of the blockchain nodes in the blockchain network.
  • the number of neighbor nodes in the next layer corresponding to each block chain node can be equal, for example, 2, 4 or 8 etc.
  • the tree topology can be determined according to the total number of blockchain nodes in the blockchain network and the expected broadcast depth (the longest broadcast link or the maximum number of broadcast hops that may be passed in a broadcast) and other parameters.
  • each node corresponds to the number of its neighbor nodes in the next layer.
  • the application layer message may be hop-transmitted between multiple blockchain nodes.
  • the transmission of the application layer message can be initiated by one of the multiple blockchain nodes, and the blockchain node transmits the application layer message to the next blockchain node, and the next block
  • the chain node can continue to transmit the application layer message to the next blockchain node, and so on, until it is transmitted to the blockchain node as the transmission interruption point or transmission end point.
  • the first block chain node 910 initiates the broadcast of an application layer message, wherein the first upper layer module 915 of the block chain system can receive data from, for example, a data layer module or Obtain corresponding data from other databases under the blockchain, and prepare application layer messages to be broadcast based on these data.
  • the application layer messages include but are not limited to block messages, consensus messages, etc.
  • the first upper layer module 915 can transmit the prepared application layer message to the first network module 914 of the blockchain system in the first blockchain node 910 .
  • the first network module 914 can communicate with the network layer of the first blockchain node 910 (including the first buffer 913 and the first network card 911 shown in FIG.
  • the application layer message to be transmitted is packaged into one or more message data (usually, the size of each message data is smaller than the application layer The size of the message to facilitate transmission), and serially transmit to the second network card 921 in the second block chain node 920 via the first network card 911 through network transmission.
  • the second blockchain node 920 one or more pieces of message data received by the second network card 921 are uploaded to the second buffer 923 under the action of the second kernel 922 .
  • the second network module 924 of the block chain network in the second block chain node 920 can receive message data from the second buffer 923, and after receiving all message data corresponding to at least one application layer message, these messages The data is assembled into a complete application layer message. Then, the second network module 924 can upload the application layer message to the second upper layer module 925 of the blockchain system, and the second upper layer module 925 can perform operations such as verification, encryption, and decryption on the application layer message.
  • the application layer message When the application layer message is verified by the second upper layer module 925, it means that the application layer message is legal, and it can be transmitted to the third block chain node 930. Similar to the process in the first block chain node 910, the verified application layer message can be sequentially processed by the second network module 924, the second buffer 923, the second kernel 922 and the second network card 921, and be processed by the second The network card 921 transmits serially to the third network card 931 in the third blockchain node 930 through network transmission.
  • the third block chain node 930 one or more pieces of message data can be obtained in a similar manner as in the second block chain node 920, and the message data can be combined to generate a complete application layer message, and the third block chain
  • the third upper layer module 935 of the blockchain system in the blockchain node 930 performs verification, encryption, decryption and other processing on the combined application layer messages.
  • the application layer message may no longer be transmitted to the next block chain node; and when the third block chain node 930 is not the transmission interruption point or the transmission end point , you can continue to transmit application layer messages to the next blockchain node in a similar manner.
  • the processing delay of the blockchain system of the sending node can specifically include the delay of the network layer in the blockchain node sending the application layer message to obtain the message data from the blockchain system, including the upper module of the blockchain system preparing the application layer.
  • the sending node buffer delay includes one or more message data associated with the application layer message in the buffer Transit time, especially when there are multiple message data associated with multiple application layer messages in the buffer, it is usually necessary to wait for one or more message data corresponding to the previous application layer message to be sent serially After that, it is the turn to send one or more message data corresponding to the current application layer message, which may lead to a long buffer delay of the sending node;
  • the transmission delay from the sending node to the receiving node refers to the The time required for the network card of the blockchain node to transmit the message data to the network card of the blockchain node receiving the application layer message via the network;
  • the receiving node buffer delay refers to the time for the message data to receive the application layer message The time required for transit in the buffer; and the processing delay of the receiving node blockchain system refers to the combination of one or more message data from the buffer in the blockchain node receiving the application layer message to generate a complete.
  • the transmission delay is likely to be significantly amplified due to the existence of multiple hops, which ultimately results in low efficiency of message broadcasting in the blockchain network. In turn, it may have a negative impact on the upper-level business in the blockchain system.
  • the blockchain network may include at least a first blockchain node 910 , a second blockchain node 920 and a third blockchain node 930 .
  • the blockchain network can have a tree topology, wherein the second blockchain node 920 can be a neighbor node of the first blockchain node 910, and the third blockchain node 930 can be the second Neighbor nodes of blockchain node 920.
  • the message broadcasting method may include:
  • Step S100 the second blockchain node 920 receives message data from the first blockchain node 910.
  • the message data may be generated by the first blockchain node 910 according to the application layer message to be transmitted.
  • the size of a complete application layer message may be 1-2MB or larger, and for the convenience of transmission, the size of each message data generated according to the application layer message may be, for example, 64kB.
  • message data may exist in the form of message flow data, message frame data, or message packet data.
  • the first blockchain node 910 can use the first network card 911 to transmit the message data to the second blockchain node 920 through wired or wireless network transmission, etc.
  • the second network card 921 in the.
  • the message broadcasting method may also include:
  • Step S300 whenever the second block chain node 920 receives a piece of message data, copy a piece of message data and forward a piece of message data to the third block chain node 930 .
  • each blockchain node 920 every time the second blockchain node 920 receives a message data, it immediately copies the message data and forwards it to the next blockchain node, that is, the third blockchain node 930, without As explained above based on Figure 1, wait to receive all the message data corresponding to the complete application layer message, generate an application layer message based on these message data and successfully verify the application layer message, and then proceed to the third block Forwarding by chain node 930.
  • each blockchain node usually has a strong foundation of trust, that is, block Chain nodes are generally trusted not to do evil or tamper with data.
  • every blockchain node can successfully pass the verification of application layer messages, so in blockchain nodes, after each message data is received, Copy and forward the message data immediately, one of the message data can continue to circulate in the blockchain node to participate in the generation of application layer messages in subsequent steps, and then realize the verification of application layer messages and other operations, while the other A piece of message data can be forwarded to the next blockchain node simultaneously or in parallel to reduce the average transmission delay between each hop, thereby improving the transmission efficiency of message broadcasting.
  • the blockchain nodes are evil
  • other methods and means can be used in the blockchain system to locate and punish the evil nodes.
  • step S300 may include:
  • the second block chain node 920 Whenever the second network card 921 of the second block chain node 920 receives a message data from the first network card 911 of the first block chain node 910, the second block chain node 920 copies a message data and sends a message The data is sent to the third network card 931 of the third blockchain node 930.
  • the processing involved in the dotted box can be performed simultaneously or in parallel with the forwarding of the message data from the second network card 921 to the third network card 931 .
  • the kernel bypass method can be used to sink the forwarding of message data (for example, in the form of Ethernet frames) to the level of the network card without going through the kernel, buffer and other components in the blockchain node.
  • Such transparent forwarding reduces the average transmission delay between each hop.
  • a switch, a network bridge, etc. may also be used to realize copying and forwarding of message data.
  • step S300 may include:
  • Step S331 whenever the second network card 921 of the second blockchain node 920 receives a message data from the first network card 911 of the first blockchain node 910, the second kernel 922 of the second blockchain node 920 Receive a piece of message data from the second network card 921;
  • Step S333 the second kernel 922 converts a message data into a message data packet, and stores a message data packet in the second buffer 923 of the second block chain node 920;
  • Step S335 the second blockchain node 920 copies a message data packet in the second buffer 923 and sends a message data packet to the third blockchain node 930 .
  • the processing involved in the dashed box can be carried out simultaneously or in parallel with the related processing of the message data being sent to the third blockchain node 930 through the second network card 921, the second core 922 and the second buffer 923 . That is to say, in this embodiment, the message data (for example, in the form of a TCP flow) can be copied and forwarded at the buffer level without waiting for the second network module 924 and the second upper layer module 925 of the blockchain system The result of higher layer processing of message data to reduce the average transmission delay between each hop.
  • the message data transmitted to the third blockchain node 930 by the second network card 921 of the second blockchain node 920 can be received by the third network card 931 in the third blockchain node 930, and passed through the third blockchain node 930
  • the processing of the third kernel 932 in is stored in the third buffer 933 of the third blockchain node 930 for further processing.
  • the message data can also be copied and forwarded at other levels such as the data link layer, network layer, etc., without waiting for the blockchain system in the blockchain node.
  • the corresponding module processes the result of the upper layer of the message data to reduce the average transmission delay between each hop.
  • the second blockchain node 920 may communicate with the first blockchain node 910 and the third blockchain node 930 based on Transmission Control Protocol/Internet Protocol TCP/IP.
  • the first buffer 913 , the second buffer 923 and the third buffer 933 may be socket buffers, and the message data may be a socket byte stream.
  • the message broadcasting method may also include:
  • Step S500 after the second blockchain node 920 receives all the message data corresponding to the complete application layer message, generate an application layer message according to all the message data.
  • the application layer message may include at least one of a block message and a consensus message
  • the block message may represent a block to be added to the block chain
  • the block may be a block used to describe a series of transaction information collection
  • the consensus message can represent the consensus information of the blockchain nodes.
  • the second network module 924 of the block chain system can receive all the message data corresponding to the complete application layer message, and generate the application layer message according to these message data.
  • the blockchain node at least one of copying and forwarding of the message data can be performed in parallel with the generation of the application layer message. That is to say, in the broadcasting process of the application layer message, in each blockchain node, the message data can be forwarded without waiting for the completion of the application layer message generation, but the message data can be copied and used One of the message data of the two copied message data continues to be further processed in the blockchain node, and the other message data is forwarded to the next blockchain node at the same time or in parallel, To reduce the broadcast transmission delay of message data.
  • the message broadcasting method may further include:
  • Step S700 the second blockchain node 920 performs preset processing on the application layer message.
  • the preset processing of the application layer message may include processing such as verification, encryption and/or decryption of the application layer message. Verifying the application layer message can help determine whether the application layer message has been maliciously tampered with, so as to ensure that the data and operations corresponding to the application layer message are reliable. Encrypting the application layer messages can better guarantee the security of the application layer messages.
  • the blockchain nodes in the same blockchain network can decrypt the application layer messages they receive based on a predetermined method, so as to obtain the required information therefrom. It can be understood that other preset processing can also be performed on the application layer message based on the blockchain system (for example, according to the smart contract in the blockchain system, etc.), which is not limited here.
  • step S700 may include:
  • Step S711 the second upper layer module 925 of the blockchain system of the second blockchain node 920 obtains the application layer message from the second network module 924 of the blockchain system of the second blockchain node 920;
  • step S713 the second upper layer module 925 performs preset processing on the application layer message.
  • the upper module of the blockchain system may include at least one of, for example, a consensus layer module, an application layer module, an incentive layer module and a contract layer module.
  • the consensus layer module can include consensus algorithms and consensus mechanisms, which are responsible for the effective identification and authentication of the point-to-point mode, enabling highly dispersed blockchain nodes to efficiently reach a consensus on the validity of block data in a decentralized blockchain network.
  • the application layer module can realize various application scenarios, which can include various application scenarios and cases.
  • the incentive layer module can include the issuance system and distribution system of economic incentives, etc., to provide certain incentives and encourage nodes to participate in the security verification of the blockchain.
  • the contract layer module can include various scripts, codes, algorithm mechanisms and smart contracts, which are the basis of blockchain programming.
  • At least one of copying and forwarding of message data and preset processing of application layer messages can also be performed in parallel. That is to say, in the process of broadcasting application layer messages, within each blockchain node, message data can be forwarded directly without waiting for the result of the preset processing of application layer messages. By copying the message data, and using one of the copied message data to continue further processing of the message data and the application layer message in the blockchain node, while simultaneously or parallelly copying the other A copy of the message data is forwarded to the next blockchain node to reduce the broadcast transmission delay of the message data.
  • the transparent routing technology is adopted to parallelize the processing process of receiving and verifying the complete application layer message and the transmission process of the message data used to form the application layer message, Whenever a block chain node receives a message data from its previous block chain node, the current block chain node can immediately copy the message data and forward the message data to its next block or blocks Blockchain nodes, without waiting for the current blockchain node to receive a complete blockchain application layer message, and while forwarding message data to one or more blockchain nodes, the current blockchain node can parallelize Waiting to receive other message data associated with the complete application layer message, assembling and merging these message data to generate the final complete application layer message, and passing the application layer message to the upper module in the blockchain system for further Processing, so that it can save the time for waiting to receive all the message data corresponding to the complete application layer message in each hop of the broadcast application layer message, for combining and forming the application layer message and verifying the application layer message, etc.
  • the processing time and the time used to split the application layer message into one or more message data to be transmitted to the next blockchain node in other words, by reducing the number of node jumps or reducing the number of node receiving packets as much as possible
  • the processing flow makes it unnecessary to pay attention to the processing and forwarding logic of the application layer message from a certain node, thereby reducing the transmission delay.
  • this transmission method can significantly reduce the overall transmission delay, for example, it can reduce the transmission delay by more than 30%.
  • a blockchain node which can be, for example, the first blockchain node 910 shown in Figures 1 to 3, the second blockchain node node 920 or a third block chain node 930.
  • the second blockchain node 920 may include a communication module and a network module (second network module 924 ) of the blockchain system.
  • the communication module can be configured to: receive message data from a first blockchain node different from the blockchain node; and whenever a blockchain node receives a message data, copy a message data and transfer a message The data is forwarded to a third blockchain node different from the blockchain node and the first blockchain node.
  • the network module can be configured to generate an application layer message according to all the message data after the block chain node receives all the message data corresponding to the complete application layer message.
  • the communication module may include a network card (for example, the second network card 921 ) and a buffer (for example, the second buffer 923 ).
  • the network card may be configured to receive message data from a first blockchain node different from the blockchain node, and the network card may also be configured to send a message data to a node other than the blockchain node and the first blockchain node The third block chain node.
  • the buffer can be configured to store the message data packet converted according to the message data, and the message data packet in the buffer is configured to be sent to a third blockchain node different from the blockchain node and the first blockchain node node.
  • the block chain node may also include an upper layer module (for example, the second upper layer module 925) of the block chain system, and the upper layer module may be configured to obtain the application layer message from the network module, and process the application layer message Do preset processing.
  • the upper layer module may include at least one of a consensus layer module, an application layer module, an incentive layer module and a contract layer module.
  • the preset processing may include at least one of verification, encryption and decryption.
  • one or more embodiments of this specification also propose a blockchain system, which may include the above-mentioned blockchain nodes.
  • the blockchain network of the blockchain system may have a tree topology.
  • the improvement of a technology can be clearly distinguished as an improvement in hardware (for example, improvements in circuit structures such as diodes, transistors, and switches) or improvements in software (improvement in method flow).
  • improvements in many current method flows can be regarded as the direct improvement of the hardware circuit structure.
  • Designers almost always get the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be realized by hardware physical modules.
  • a programmable logic device Programmable Logic Device, PLD
  • PLD Programmable Logic Device
  • FPGA Field Programmable GateArray
  • HDL Hardware Description Language
  • the controller may be implemented in any suitable way, for example the controller may take the form of a microprocessor or processor and a computer readable medium storing computer readable program code (such as software or firmware) executable by the (micro)processor , logic gates, switches, Application Specific Integrated Circuit (ASIC), programmable logic controllers, and embedded microcontrollers, examples of controllers include but are not limited to the following microcontrollers: ARC 625D, AtmelAT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the control logic of the memory.
  • ASIC Application Specific Integrated Circuit
  • controller in addition to realizing the controller in a purely computer-readable program code mode, it is entirely possible to make the controller use logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded The same function can be realized in the form of a microcontroller or the like. Therefore, such a controller can be regarded as a hardware component, and the devices included in it for realizing various functions can also be regarded as structures within the hardware component. Or even, means for realizing various functions can be regarded as a structure within both a software module realizing a method and a hardware component.
  • the systems, devices, modules, or units described in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions.
  • a typical implementation device is a server system.
  • the computer that realizes the functions of the above embodiments can be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant , media players, navigation devices, email devices, game consoles, tablet computers, wearable devices, or any combination of these devices.
  • one or more embodiments of the present specification provide the operation steps of the method described in the embodiment or the flowchart, more or fewer operation steps may be included based on conventional or non-inventive means.
  • the sequence of steps enumerated in the embodiments is only one of the execution sequences of many steps, and does not represent the only execution sequence.
  • the methods shown in the embodiments or drawings can be executed sequentially or in parallel (such as a parallel processor or multi-thread processing environment, or even a distributed data processing environment).
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions
  • the device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • Memory may include non-permanent storage in computer-readable media, in the form of random access memory (RAM) and/or nonvolatile memory, such as read-only memory (ROM) or flash memory (flashRAM). Memory is an example of computer readable media.
  • RAM random access memory
  • ROM read-only memory
  • flashRAM flash memory
  • Computer-readable media including both permanent and non-permanent, removable and non-removable media, can be implemented by any method or technology for storage of information.
  • Information may be computer readable instructions, data structures, modules of a program, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk storage, graphene storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by computing devices.
  • computer-readable media excludes transitory computer-readable media, such as modulated data signals and carrier waves.
  • one or more embodiments of this specification may be provided as a method, system or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of the present description may employ a computer program embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein. The form of the product.
  • program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types.
  • program modules may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network.
  • program modules may be located in both local and remote computer storage media including storage devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Computer And Data Communications (AREA)

Abstract

本说明书实施例提供一种用于区块链网络的消息广播方法、区块链节点和区块链系统。该消息广播方法包括:第二区块链节点接收来自第一区块链节点的消息数据;每当第二区块链节点接收到一条消息数据时,复制一条消息数据并将一条消息数据转发给第三区块链节点;以及在第二区块链节点接收到与完整的应用层消息相应的所有消息数据后,根据所有消息数据产生应用层消息。

Description

用于区块链网络的消息广播方法、区块链节点和区块链系统
本申请要求于2022年02月25日提交中国专利局、申请号为202210180901.8、发明名称为“用于区块链网络的消息广播方法、区块链节点和区块链系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本说明书实施例属于区块链技术领域,尤其涉及一种用于区块链网络的消息广播方法、区块链节点和区块链系统。
背景技术
区块链系统(例如,联盟链系统)的底层组件通常是一个分布式点对点(P2P)网络。在不同的区块链网络中,接入的区块链节点的数量可以是几十个、几百个、甚至是成千上万个不等。而在区块链系统中,在执行交易、合约等的时候,通常需要使应用层消息在区块链网络中的多个区块链节点之间进行传播(例如,从一个区块链节点广播到其他多个区块链节点)。而且,在区块链网络中,这种广播的需求量很大、频次很高,因此有必要对区块链网络中的消息广播机制进行改进。
发明内容
本说明书一个或多个实施例的目的在于提供一种用于区块链网络的消息广播方法、区块链节点和区块链系统,以提高消息传播的效率。
根据本说明书一个或多个实施例的第一方面,提供了一种用于区块链网络的消息广播方法,所述区块链网络包括至少第一区块链节点、第二区块链节点和第三区块链节点,所述消息广播方法包括:
所述第二区块链节点接收来自所述第一区块链节点的消息数据;
每当所述第二区块链节点接收到一条消息数据时,复制所述一条消息数据并将所述一条消息数据转发给所述第三区块链节点;以及
在所述第二区块链节点接收到与完整的应用层消息相应的所有消息数据后,根据所述所有消息数据产生所述应用层消息。
根据本说明书一个或多个实施例的第二方面,提供了一种区块链节点,包括:
通信模块,所述通信模块被配置为:
接收来自不同于所述区块链节点的第一区块链节点的消息数据;和
每当所述区块链节点接收到一条消息数据时,复制所述一条消息数据并将所述一条消息数据转发给不同于所述区块链节点和所述第一区块链节点的第三区块链节点;以及
区块链系统的网络模块,所述网络模块被配置为在所述区块链节点接收到与完整的应用层消息相应的所有消息数据后,根据所述所有消息数据产生所述应用层消息。
根据本说明书一个或多个实施例的第三方面,提供了一种区块链系统,包括如上所述的区块链节点。
附图说明
为了更清楚地说明本说明书实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本说明书一实施例中区块链网络的示意图;
图2是本说明书另一实施例中区块链网络的示意图;
图3是本说明书又一实施例中区块链网络的示意图;
图4是本说明书一实施例中用于区块链网络的消息广播方法的流程示意图;
图5是本说明书一具体示例中用于区块链网络的消息广播方法中步骤S300的流程示意图;
图6是本说明书另一实施例中用于区块链网络的消息广播方法的流程示意图;
图7是本说明书一具体示例中用于区块链网络的消息广播方法中步骤S700的流程示意图。
具体实施方式
为了使本技术领域的人员更好地理解本说明书中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本说明书一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本说明书保护的范围。
区块链是一种利用加密算法和点对点传输技术构建的分布式网络数据存储技术,其具有去中心化、防篡改、可溯源等特点。在区块链中,数据可以不再存储于一个中心化的硬件或管理机构,而是由权利和义务对等的区块链节点来共同维护;数据可以被记录在区块链技术构件的系统的多个节点上,能够实现在任意时间查看任何节点保存在本地区块链中的数据;一旦数据经过验证并添加到区块链,就可以被永久地存储起来,利用共识算法和哈希链式数据存储技术能够实现数据的不可篡改,从而保证数据的安全性和真实性。利用点对点网络技术,可以将各个区块链节点组成一个分布式网络,其中每个节点的地位是平等的。可以通过网络将交易数据传递给各个节点,节点可以验证交易的有效性,并在验证通过的情况下将相应的区块加入其本地区块链。区块链节点可以在本地保存有一份完整的交易账本副本,即本地区块链,这样节点的交易账本副本就同步完成更新,从而达成去中心化共识。
对于例如包含1000个或以上的区块链节点的区块链网络而言,由于其中的节点数量众多,可以利用例如树状拓扑来组织区块链网络。具体而言,发起应用层消息的广播的区块链节点可以将该应用层消息传输给其下一层的若干个邻居节点,而这些节点中的至少一个节点可以继续将该应用层消息传输给其再下一层的若干个邻居节点,以此类推,直至应用层消息被广播到区块链网络中的全部或大部分区块链节点。在一些实施例中,为了保持树状拓扑结构的稳定性和可靠性,与每个区块链节点对应的其下一层的邻居节点的数目可以是相等的,例如为2个、4个或8个等。可以根据区块链网络中的区块链节点的总数目以及期望的广播深度(在一次广播中可能经过的最长的广播链路或最大的广播跳数)等参数来确定在树状拓扑结构中,每个节点对应的其下一层邻居节点的数目。在这样的区块链网络中,当一条应用层消息要被广播时,这条应用层消息有可能在多个区块链节点之间进行跳跃传输。取决于树状拓扑结构的深度以及广播算法的优劣,当这条应用层消息被传播到区块链网络中的所有(或者大部分)区块链节点时,往往会存在很高的传输时延,该传输时延可以被简单地表示为:传输时延=区块链节点的跳数*每跳之间的平均传输时延。
其中,应用层消息的传输可以是由多个区块链节点中的一个区块链节点所发起的,该区块链节点将应用层消息传输给下一个区块链节点,且下一个区块链节点可以继续将该应用层消息传输给再下一个区块链节点,依此类推,直至传输到作为传输中断点或传输终点的区块链节点。在一具体示例中,如图1所示,第一区块链节点910发起一条应用层消息的广播,其中区块链系统的第一上层模块915可以从例如区块链上的数据层模块或区块链下的其他数据库等中获取相应的数据,并根据这些数据准备要被广播的应用层消息,该应用层消息包括但不限于是区块消息、共识消息等。然后,第一上层模块915可以将准备好的应用层消息传输给第一区块链节点910中区块链系统的第一网络模块914。第一网络模块914可以与第一区块链节点910的网络层(包括图1中所示的第一缓冲区913和第一网卡911等)通信,在第一区块链节点910的网络层和第一内核912(其为第一区块链节点910的操作系统核心)的作用下,将要传输的应用层消息打包成一条或多条消息数据(通常,每条消息数据的大小小于应用层消息的大小,以方便传输),并经由第一网卡911通过网络传输串行地传输给第二区块链节点920中的第二网卡921。 在第二区块链节点920中,由第二网卡921接收到的一条或多条消息数据在第二内核922的作用下被上传到第二缓冲区923中。第二区块链节点920中区块链网络的第二网络模块924可以从第二缓冲区923中接收消息数据,并在接收到对应于至少一条应用层消息的所有消息数据后,将这些消息数据组合成完整的应用层消息。然后,第二网络模块924可以将该应用层消息上传至区块链系统的第二上层模块925,第二上层模块925可以对该应用层消息进行验证、加密、解密等操作。当应用层消息被第二上层模块925验证通过后,表示该应用层消息是合法的,其可以被继续被传输至第三区块链节点930。与第一区块链节点910中的过程类似,验证后的应用层消息可以依次经过第二网络模块924、第二缓冲区923、第二内核922和第二网卡921的相应处理,被第二网卡921通过网络传输串行地传输给第三区块链节点930中的第三网卡931。在第三区块链节点930中,可以以在第二区块链节点920中类似的方式获取一条或多条消息数据,对消息数据进行组合以产生完整的应用层消息,并由第三区块链节点930中区块链系统的第三上层模块935对组合所得的应用层消息进行验证、加密、解密等处理。当第三区块链节点930为传输中断点或传输终点时,可以不再继续往下一个区块链节点传输该应用层消息;而当第三区块链节点930不是传输中断点或传输终点时,可以以类似的方式继续向下一个区块链节点传输应用层消息。
基于上述过程可知,在区块链网络中,每跳之间的传输时延可以被表示为如下所示:每跳之间的传输时延=发送节点区块链系统处理时延+发送节点缓冲区时延+发送节点到接收节点的传输时延+接收节点缓冲区时延+接收节点区块链系统处理时延。其中,发送节点区块链系统处理时延具体可以包括发送应用层消息的区块链节点中的网络层从区块链系统获取消息数据的时延,包括区块链系统的上层模块准备应用层消息所需的时间和网络模块对应用层消息进行相应的处理并传输给网络层所需的时间;发送节点缓冲区时延包括与应用层消息相关联的一条或多条消息数据在缓冲区中中转的时间,尤其是当缓冲区中已经存在与多条应用层消息相关联的多条消息数据时,通常需要等待在前的应用层消息对应的一条或多条消息数据被全部串行发送完毕后,才轮到当前的应用层消息对应的一条或多条消息数据的发送,这可能导致较长的发送节点缓冲区时延;发送节点到接收节点的传输时延是指从发送应用层消息的区块链节点的网卡经由网络传输消息数据到接收应用层消息的区块链节点的网卡所需的时间;接收节点缓冲区时延是指消息数据在接收应用层消息的区块链节点的缓冲区中中转所需的时间;以及接收节点区块链系统处理时延是指在接收应用层消息的区块链节点中,对来自缓冲区的一条或多条消息数据进行组合以产生完整的应用层消息以及对应用层消息进行验证等处理所需的时间。
可以看到,在区块链网络中进行应用层消息的广播的情况下,传输时延很可能由于多跳的存在而被显著地放大,最终造成区块链网络中的消息广播效率较低,进而可能对区块链系统中的上层业务造成不良影响。
为了解决上述问题,本说明书一个或多个实施例提出了一种用于区块链网络的消息广播方法,其中采用透明路由的设计方案,对应用层消息的广播过程进行优化,从而降低区块链网络中的传输时延。如图1所示,区块链网络可以包括至少第一区块链节点910、第二区块链节点920和第三区块链节点930。在一些实施例中,区块链网络可以具有树状拓扑,其中,第二区块链节点920可以为第一区块链节点910的邻居节点,且第三区块链节点930可以为第二区块链节点920的邻居节点。如图4所示,消息广播方法可以包括:
步骤S100,第二区块链节点920接收来自第一区块链节点910的消息数据。
其中,消息数据可以是第一区块链节点910根据要传输的应用层消息来生成的。通常,一条完整的应用层消息的大小可能在1~2MB或更大,而为了传输的方便,根据应用层消息产生的每条消息数据的大小可以在例如64kB。在每个区块链节点中,消息数据可能以消息流数据、消息帧数据或者消息包数据等形式存在。在一些实施例中,如图2和图3所示,第一区块链节点910可以利用其中的第一网卡911通过有线或无线网络传输等途径将消息数据传递给第二区块链节点920中的第二网卡921。
进一步地,如图4所示,消息广播方法还可以包括:
步骤S300,每当第二区块链节点920接收到一条消息数据时,复制一条消息数据并将一条消息数据转发给第三区块链节点930。
具体而言,第二区块链节点920可以在每接收到一条消息数据时,就立即复制该消息数据并将其转发给下一个区块链节点,即第三区块链节点930,而无需如上文根据图1所阐述的那样,等待接收到对应于完整的应用层消息的所有消息数据,根据这些消息数据生成应用层消息并对应用层消息进行成功验证后,再进行向第三区块链节点930的转发。这是因为在区块链网络中,尤其是在某些特定场景下的区块链系统,例如私链、联盟链系统中,每个区块链节点通常具有较强的信任基础,即区块链节点通常是可信的而不会作恶或对数据进行篡改。相应地,在应用层消息的广播过程中,基本上每个区块链节点对应用层消息的验证都是可以成功通过的,因此在区块链节点中,可以在每接收到一条消息数据后就立即进行该消息数据的复制和转发,其中一份消息数据可以继续在该区块链节点中流转以在后续步骤中参与产生应用层消息,进而实现对应用层消息的验证等操作,而另一份消息数据可以同时地或者并行地转发给下一个区块链节点,以减少每跳之间的平均传输时延,从而改善消息广播的传输效率。当然,可以理解的是,即使区块链节点作恶,在区块链系统中也可以采用其他方法和手段来对作恶的节点进行定位和惩罚。
在本说明书一个或多个实施例中,可以采用多种方式来在接收到一条消息数据后即执行该消息数据的复制与转发。在一示例性实施例中,步骤S300可以包括:
每当第二区块链节点920的第二网卡921接收到来自第一区块链节点910的第一网卡911的一条消息数据时,第二区块链节点920复制一条消息数据并将一条消息数据发送给第三区块链节点930的第三网卡931。
如图2所示,虚线框中涉及的处理可以与消息数据从第二网卡921到第三网卡931的转发同时或并行地进行。也就是说,可以采用内核旁路的方式,将消息数据(例如,以以太帧的形式)的转发下沉到网卡的层面,而无需经过区块链节点中的内核、缓冲区等部件,通过这样的透明转发来减少每跳之间的平均传输时延。在一些实施例中,也可以采用例如交换机、网桥等来实现消息数据的复制和转发。
在另一示例性实施例中,如图5所示,步骤S300可以包括:
步骤S331,每当第二区块链节点920的第二网卡921接收到来自第一区块链节点910的第一网卡911的一条消息数据时,第二区块链节点920的第二内核922从第二网卡921接收一条消息数据;
步骤S333,第二内核922将一条消息数据转换为一个消息数据包,并将一个消息数据包存储到第二区块链节点920的第二缓冲区923中;以及
步骤S335,第二区块链节点920在第二缓冲区923中复制一个消息数据包并将一个消息数据包发送给第三区块链节点930。
如图3所示,虚线框中涉及的处理可以与消息数据经过第二网卡921、第二内核922和第二缓冲区923的相关处理发送到第三区块链节点930中同时或并行地进行。也就是说,在本实施例中,可以在缓冲区的层面复制和转发消息数据(例如,以TCP流的形式),而无需等待区块链系统的第二网络模块924和第二上层模块925对消息数据的更上层处理的结果,以减少每跳之间的平均传输时延。通过第二区块链节点920的第二网卡921传输给第三区块链节点930的消息数据可以被第三区块链节点930中的第三网卡931接收,经过第三区块链节点930中的第三内核932的处理被存储在第三区块链节点930的第三缓冲区933中,以待进一步处理。
可以理解的是,在其他一些实施例中,消息数据也可以在例如数据链路层、网络层等中的其他层面上被复制和转发,而无需等待区块链节点中的区块链系统的相应模块对消息数据的更上层的处理结果,以减少每跳之间的平均传输时延。
在一些实施例中,第二区块链节点920可以基于传输控制协议/互联网络协议TCP/IP与第一区块链节点910和第三区块链节点930通信。相应地,其中的第一缓冲区913、第二缓冲区923和第三缓冲区933可以为套接字(socket)缓冲区,消息数据可能为socket字节流。
进一步地,如图4所示,该消息广播方法还可以包括:
步骤S500,在第二区块链节点920接收到与完整的应用层消息相应的所有消息数据后,根据所有消息数据产生应用层消息。
其中,应用层消息可以包括区块消息和共识消息中的至少一者,区块消息可以表征将要被添加到区块链中的区块,该区块可以是用来描述一系列交易信息的一个集合,而共识消息可以表征区块链节点的共识信息。在第二区块链节点920中,可以由区块链系统的第二网络模块924来接收与完整的应用层消息相应的所有消息数据,并根据这些消息数据来产生应用层消息。
根据上文的描述可知,在区块链节点中,消息数据的复制和转发中的至少一者可以与应用层消息的产生是并行进行的。也就是说,在应用层消息的广播过程中,在每个区块链节点内,可以无需等待完成应用层消息的生成后才进行消息数据的转发,而是可以对消息数据进行复制,并使用复制所得的两份消息数据中的其中一份消息数据在该区块链节点内继续进行消息数据的进一步处理,而同时或并行地将另一份消息数据向下一个区块链节点进行转发,以减少消息数据的广播传输时延。
在本说明书一个或多个实施例中,如图6所示,该消息广播方法还可以包括:
步骤S700,第二区块链节点920对应用层消息进行预设处理。
其中,对应用层消息的预设处理可以包括对应用层消息的验证、加密和/或解密等处理。对应用层消息进行验证可以帮助确定该应用层消息是否经过恶意的篡改等,以保证与应用层消息相应的数据和操作是可靠的。对应用层消息进行加密可以更好地保障应用层消息的安全性。并且,在同一区块链网络中的区块链节点可以基于预先确定的方式对其接收到的应用层消息进行解密,以便从中获取所需的信息。可以理解的是,也可以基于区块链系统(例如,根据区块链系统中的智能合约等)对应用层消息进行其他预设处理,这里不作限制。
具体而言,步骤S700可以包括:
步骤S711,第二区块链节点920的区块链系统的第二上层模块925从第二区块链节点920的区块链系统的第二网络模块924获取应用层消息;以及
步骤S713,第二上层模块925对应用层消息进行预设处理。
其中,区块链系统的上层模块可以包括例如共识层模块、应用层模块、激励层模块和合约层模块中的至少一者。共识层模块可以包含共识算法以及共识机制,负责点对点模式的有效识别认证,使高度分散的区块链节点在去中心化的区块链网络中高效地针对区块数据的有效性达成共识。应用层模块可以实现各类应用场景,其可以包含各种应用场景和案例。激励层模块可以包括经济激励的发行制度和分配制度等,以提供一定的激励措施,鼓励节点参与区块链的安全验证工作。合约层模块可以包括各种脚本、代码、算法机制及智能合约,其是区块链可编程的基础。
可以理解的是,消息数据的复制和转发中的至少一者与应用层消息的预设处理也可以是并行进行的。也就是说,在广播应用层消息的过程中,在每个区块链节点内,可以无需等待对应用层消息的预设处理的结果,而直接进行消息数据的转发。通过对消息数据进行复制,并使用复制所得的两份消息数据中的其中一份消息数据在该区块链节点内继续进行消息数据和应用层消息的进一步处理,而同时或并行地将另一份消息数据向下一个区块链节点进行转发,以减少消息数据的广播传输时延。
在本说明书一个或多个实施例中,采用透明路由的技术,将对完整的应用层消息的接收和验证等处理过程与对用于组成应用层消息的消息数据的传输过程进行并行化处理,每当一个区块链节点接收到来自其上一个区块链节点的一条消息数据时,当前的区块链节点就可以立即复制该消息数据并将该消息数据转发给其下一个或多个区块链节点,而无需等待当前的区块链节点接收到完整的区块链应用层消息,并且在向下一个或多个区块链节点转发消息数据的同时,当前的区块链节点可以并行地等待接收与完整的应用层消息相关联的其他消息数据、组装合并这些消息数据以产生最终的完整的应用层消息,并将应用层消息传递给区块链系统中的上层模块用于进一步的处理,从而可以省去在广播应用层消息的每一跳中用来等待接收与完整的应用层消息相应的所有消息数据的时间、用来组合形成应用层消息并对应用层消息进行校验等处理的时间、以及用来将应用层消息再次拆分成一条或多条消息数据以待传输到下一个区块链节点的时间,换句话说,通过尽可能减少节点跳跃次数或减少节点收包处理流程,使得在某个节点上看,无需关注对应用层消息的处理和转发逻辑,从而减少了传输时延。尤其是当区块链网络中包含较多的区块链节点、广播的深度较深时,这种传输方式可以显著地减少整体的传输时延,例如可以将传 输时延降低30%以上。
此外,本说明书一个或多个实施例还提出了一种区块链节点,该区块链节点可以是例如图1至图3中所示的第一区块链节点910、第二区块链节点920或第三区块链节点930。以第二区块链节点920为例,其可以包括通讯模块和区块链系统的网络模块(第二网络模块924)。其中,通信模块可以被配置为:接收来自不同于区块链节点的第一区块链节点的消息数据;和每当区块链节点接收到一条消息数据时,复制一条消息数据并将一条消息数据转发给不同于区块链节点和第一区块链节点的第三区块链节点。网络模块可以被配置为在区块链节点接收到与完整的应用层消息相应的所有消息数据后,根据所有消息数据产生应用层消息。
在一些实施例中,通信模块可以包括网卡(例如,第二网卡921)和缓冲区(例如,第二缓冲区923)。网卡可以被配置为接收来自不同于区块链节点的第一区块链节点的消息数据,且网卡还可以被配置为将一条消息数据发送给不同于区块链节点和第一区块链节点的第三区块链节点。此外,缓冲区可以被配置为存储根据消息数据转换所得的消息数据包,缓冲区中的消息数据包被配置为发送给不同于区块链节点和第一区块链节点的第三区块链节点。
在一些实施例中,区块链节点还可以包括区块链系统的上层模块(例如,第二上层模块925),该上层模块可以被配置为从网络模块获取应用层消息,并对应用层消息进行预设处理。具体而言,上层模块可以包括共识层模块、应用层模块、激励层模块和合约层模块中的至少一者。
如上文所述,消息数据的复制和转发中的至少一者与应用层消息的产生和预设处理中的至少一者可以是并行进行的。其中,预设处理可以包括验证、加密和解密中的至少一者。
进一步地,本说明书一个或多个实施例还提出了一种区块链系统,该区块链系统可以包括如上所述的区块链节点。其中,区块链系统的区块链网络可以具有树状拓扑。
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable GateArray,FPGA))就是这样一种集成电路,其逻辑功能由使用者对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(JavaHardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、AtmelAT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同 功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为服务器系统。当然,本申请不排除随着未来计算机技术的发展,实现上述实施例功能的计算机例如可以为个人计算机、膝上型计算机、车载人机交互设备、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。
虽然本说明书一个或多个实施例提供了如实施例或流程图所述的方法操作步骤,但基于常规或者无创造性的手段可以包括更多或者更少的操作步骤。实施例中列举的步骤顺序仅仅为众多步骤执行顺序中的一种方式,不代表唯一的执行顺序。在实际中的装置或终端产品执行时,可以按照实施例或者附图所示的方法顺序执行或者并行执行(例如并行处理器或者多线程处理的环境,甚至为分布式数据处理环境)。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、产品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、产品或者设备所固有的要素。在没有更多限制的情况下,并不排除在包括所述要素的过程、方法、产品或者设备中还存在另外的相同或等同要素。例如若使用到第一,第二等词语用来表示名称,而并不表示任何特定的顺序。
为了描述的方便,描述以上装置时以功能分为各种模块分别描述。当然,在实施本说明书一个或多个时可以把各模块的功能在同一个或多个软件和/或硬件中实现,也可以将实现同一功能的模块由多个子模块或子单元的组合实现等。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其他的形式。
本发明是参照根据本发明实施例的方法、装置(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flashRAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储、石墨烯存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备 访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
本领域技术人员应明白,本说明书一个或多个实施例可提供为方法、系统或计算机程序产品。因此,本说明书一个或多个实施例可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本说明书一个或多个实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本说明书一个或多个实施例可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本本说明书一个或多个实施例,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本说明书的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。
以上所述仅为本说明书一个或多个实施例的实施例而已,并不用于限制本本说明书一个或多个实施例。对于本领域技术人员来说,本说明书一个或多个实施例可以有各种更改和变化。凡在本说明书的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在权利要求范围之内。

Claims (23)

  1. 一种用于区块链网络的消息广播方法,所述区块链网络包括至少第一区块链节点、第二区块链节点和第三区块链节点,所述消息广播方法包括:
    所述第二区块链节点接收来自所述第一区块链节点的消息数据;
    每当所述第二区块链节点接收到一条消息数据时,复制所述一条消息数据并将所述一条消息数据转发给所述第三区块链节点;以及
    在所述第二区块链节点接收到与完整的应用层消息相应的所有消息数据后,根据所述所有消息数据产生所述应用层消息。
  2. 根据权利要求1所述的消息广播方法,其中,消息数据的复制和转发中的至少一者与应用层消息的产生是并行进行的。
  3. 根据权利要求1所述的消息广播方法,其中,所述应用层消息包括区块消息和共识消息中的至少一者。
  4. 根据权利要求1所述的消息广播方法,其中,每当所述第二区块链节点接收到一条消息数据时,复制所述一条消息数据并将所述一条消息数据转发给所述第三区块链节点包括:
    每当所述第二区块链节点的第二网卡接收到来自所述第一区块链节点的第一网卡的一条消息数据时,所述第二区块链节点复制所述一条消息数据并将所述一条消息数据发送给所述第三区块链节点的第三网卡。
  5. 根据权利要求1所述的消息广播方法,其中,每当所述第二区块链节点接收到一条消息数据时,复制所述一条消息数据并将所述一条消息数据转发给所述第三区块链节点包括:
    每当所述第二区块链节点的第二网卡接收到来自所述第一区块链节点的第一网卡的一条消息数据时,所述第二区块链节点的第二内核从所述第二网卡接收所述一条消息数据;
    所述第二内核将所述一条消息数据转换为一个消息数据包,并将所述一个消息数据包存储到所述第二区块链节点的第二缓冲区中;以及
    所述第二区块链节点在所述第二缓冲区中复制所述一个消息数据包并将所述一个消息数据包发送给所述第三区块链节点。
  6. 根据权利要求1所述的消息广播方法,其中,所述第二区块链节点基于传输控制协议/互联网络协议TCP/IP与所述第一区块链节点和所述第三区块链节点通信。
  7. 根据权利要求1所述的消息广播方法,其中,在所述第二区块链节点接收到与完整的应用层消息相应的所有消息数据后,根据所述所有消息数据产生所述应用层消息包括:
    在所述第二区块链节点的区块链系统的第二网络模块接收到与完整的应用层消息相应的所有消息数据后,根据所述所有消息数据产生所述应用层消息。
  8. 根据权利要求1所述的消息广播方法,还包括:
    所述第二区块链节点对所述应用层消息进行预设处理。
  9. 根据权利要求8所述的消息广播方法,其中,消息数据的复制和转发中的至少一者与应用层消息的预设处理是并行进行的。
  10. 根据权利要求8所述的消息广播方法,其中,所述预设处理包括验证、加密和解密中的至少一者。
  11. 根据权利要求8所述的消息广播方法,其中,所述第二区块链节点对所述应用层消息进行预设处理包括:
    所述第二区块链节点的区块链系统的第二上层模块从所述第二区块链节点的区块链系统的第二网络模块获取所述应用层消息;
    所述第二上层模块对所述应用层消息进行预设处理。
  12. 根据权利要求11所述的消息广播方法,其中,所述第二上层模块包括共识层模块、应用层模块、激励层模块和合约层模块中的至少一者。
  13. 根据权利要求1所述的消息广播方法,其中,所述区块链网络具有树状拓扑,所述第二区块链节点为所述第一区块链节点的邻居节点,且所述第三区块链节点为所述第二区块链节点的邻居节点。
  14. 一种区块链节点,包括:
    通信模块,所述通信模块被配置为:
    接收来自不同于所述区块链节点的第一区块链节点的消息数据;和
    每当所述区块链节点接收到一条消息数据时,复制所述一条消息数据并将所述一条消息数据转发给不同于所述区块链节点和所述第一区块链节点的第三区块链节点;以及
    区块链系统的网络模块,所述网络模块被配置为在所述区块链节点接收到与完整的应用层消息相应的所有消息数据后,根据所述所有消息数据产生所述应用层消息。
  15. 根据权利要求14所述的区块链节点,其中,消息数据的复制和转发中的至少一者与应用层消息的产生是并行进行的。
  16. 根据权利要求14所述的区块链节点,其中,所述通信模块包括:
    网卡,所述网卡被配置为接收来自不同于所述区块链节点的第一区块链节点的消息数据;以及
    缓冲区,所述缓冲区被配置为存储根据消息数据转换所得的消息数据包。
  17. 根据权利要求16所述的区块链节点,其中,所述网卡还被配置为将所述一条消息数据发送给不同于所述区块链节点和所述第一区块链节点的第三区块链节点。
  18. 根据权利要求16所述的区块链节点,其中,所述缓冲区中的消息数据包被配置为发送给不同于所述区块链节点和所述第一区块链节点的第三区块链节点。
  19. 根据权利要求14所述的区块链节点,还包括:
    区块链系统的上层模块,所述上层模块被配置为从所述网络模块获取所述应用层消息,并对所述应用层消息进行预设处理。
  20. 根据权利要求19所述的区块链节点,其中,所述预设处理包括验证、加密和解密中的至少一者。
  21. 根据权利要求19所述的区块链节点,其中,所述上层模块包括共识层模块、应用层模块、激励层模块和合约层模块中的至少一者。
  22. 一种区块链系统,包括根据权利要求14至21中任一项所述的区块链节点。
  23. 根据权利要求22所述的区块链系统,其中,所述区块链系统的区块链网络具有树状拓扑。
PCT/CN2022/135445 2022-02-25 2022-11-30 用于区块链网络的消息广播方法、区块链节点和区块链系统 WO2023160089A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210180901.8A CN114390063B (zh) 2022-02-25 2022-02-25 用于区块链网络的消息广播方法、区块链节点和区块链系统
CN202210180901.8 2022-02-25

Publications (1)

Publication Number Publication Date
WO2023160089A1 true WO2023160089A1 (zh) 2023-08-31

Family

ID=81204826

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/135445 WO2023160089A1 (zh) 2022-02-25 2022-11-30 用于区块链网络的消息广播方法、区块链节点和区块链系统

Country Status (2)

Country Link
CN (1) CN114390063B (zh)
WO (1) WO2023160089A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114390063B (zh) * 2022-02-25 2023-09-29 蚂蚁区块链科技(上海)有限公司 用于区块链网络的消息广播方法、区块链节点和区块链系统
CN116170388A (zh) * 2022-12-30 2023-05-26 蚂蚁区块链科技(上海)有限公司 一种区块链网络的转发表生成方法及其数据传输方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110493020A (zh) * 2019-07-05 2019-11-22 深圳壹账通智能科技有限公司 基于区块链技术的广播消息传输方法、装置和系统
CN112565389A (zh) * 2020-11-30 2021-03-26 网易(杭州)网络有限公司 基于区块链的消息广播方法、装置、电子设备及存储介质
US20210200750A1 (en) * 2018-12-28 2021-07-01 Hefei Dappworks Technology Co., Ltd. Method and device of processing data for blockchain, and blockchain system
CN114390063A (zh) * 2022-02-25 2022-04-22 蚂蚁区块链科技(上海)有限公司 用于区块链网络的消息广播方法、区块链节点和区块链系统

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11960371B2 (en) * 2014-06-04 2024-04-16 Pure Storage, Inc. Message persistence in a zoned system
EP3635607B1 (en) * 2017-06-07 2024-04-24 nChain Licensing AG Computer-implemented system and method for managing transactions over a blockchain network
GB201711879D0 (en) * 2017-07-24 2017-09-06 Nchain Holdings Ltd Computer-implemented system and method
CN109784857B (zh) * 2019-01-16 2020-09-25 杭州基尔区块链科技有限公司 基于区块链的数据处理方法、装置和系统
US10951697B2 (en) * 2019-06-07 2021-03-16 Holo Limited Holochain—A framework for distributed applications

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210200750A1 (en) * 2018-12-28 2021-07-01 Hefei Dappworks Technology Co., Ltd. Method and device of processing data for blockchain, and blockchain system
CN110493020A (zh) * 2019-07-05 2019-11-22 深圳壹账通智能科技有限公司 基于区块链技术的广播消息传输方法、装置和系统
CN112565389A (zh) * 2020-11-30 2021-03-26 网易(杭州)网络有限公司 基于区块链的消息广播方法、装置、电子设备及存储介质
CN114390063A (zh) * 2022-02-25 2022-04-22 蚂蚁区块链科技(上海)有限公司 用于区块链网络的消息广播方法、区块链节点和区块链系统

Also Published As

Publication number Publication date
CN114390063A (zh) 2022-04-22
CN114390063B (zh) 2023-09-29

Similar Documents

Publication Publication Date Title
WO2023160089A1 (zh) 用于区块链网络的消息广播方法、区块链节点和区块链系统
KR102272117B1 (ko) 블록체인 기반 데이터 프로세싱 방법 및 디바이스
Kobo et al. Fragmentation-based distributed control system for software-defined wireless sensor networks
EP3937422B1 (en) Dedicated blockchain node devices and automatic blockchain construction methods and apparatuses
KR102566892B1 (ko) 블록체인 합의 방법, 디바이스 및 시스템
CN111541784B (zh) 一种基于区块链一体机的交易处理方法及装置
US11616636B2 (en) Hash updating methods and apparatuses of blockchain integrated station
CN111541726B (zh) 一种基于区块链一体机的重放交易识别方法及装置
CN111541783B (zh) 一种基于区块链一体机的交易转发方法及装置
US11665234B2 (en) Methods and apparatuses for synchronizing data based on blockchain integrated station
US11463553B2 (en) Methods and apparatuses for identifying to-be-filtered transaction based on blockchain integrated station
WO2023207085A1 (zh) 用于跨区块链交互的系统及方法
CN106411842B (zh) 在内容中心网络堆栈中传输状态
CN114844904B (zh) 用于跨区块链交互的系统及方法
WO2020257123A1 (en) Systems and methods for blockchain-based authentication
CN115174572B (zh) 区块链中的数据组播方法、区块链节点和存储介质
CN114844905B (zh) 用于跨区块链交互的系统及方法
CN113726875B (zh) 一种基于区块链一体机的交易处理方法及装置
CN115174573B (zh) 区块链系统中的数据广播方法、节点和区块链系统
WO2024092930A1 (zh) 区块链系统中的交易执行方法和节点
WO2024092932A1 (zh) 交易执行方法和区块链节点
CN115567541B (zh) 区块链网络、节点集合的维护方法及装置
US20230289337A1 (en) Trustless omnichain communication protocol platforms
US20210200928A1 (en) MULTI-PHASE TOPOLOGY SYNTHESIS OF A NETWORK-ON-CHIP (NoC)
CN115086325A (zh) 区块链节点分组方法和区块链节点

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22928349

Country of ref document: EP

Kind code of ref document: A1