CN112053154B - Transaction broadcasting method, apparatus and storage medium - Google Patents

Transaction broadcasting method, apparatus and storage medium Download PDF

Info

Publication number
CN112053154B
CN112053154B CN202010911963.2A CN202010911963A CN112053154B CN 112053154 B CN112053154 B CN 112053154B CN 202010911963 A CN202010911963 A CN 202010911963A CN 112053154 B CN112053154 B CN 112053154B
Authority
CN
China
Prior art keywords
node
transaction
full message
full
nodes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010911963.2A
Other languages
Chinese (zh)
Other versions
CN112053154A (en
Inventor
李邦柱
王志文
吴思进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Fuzamei Technology Co Ltd
Original Assignee
Hangzhou Fuzamei Technology Co Ltd
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 Hangzhou Fuzamei Technology Co Ltd filed Critical Hangzhou Fuzamei Technology Co Ltd
Priority to CN202010911963.2A priority Critical patent/CN112053154B/en
Publication of CN112053154A publication Critical patent/CN112053154A/en
Application granted granted Critical
Publication of CN112053154B publication Critical patent/CN112053154B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • 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
    • 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/1804Arrangements for providing special services to substations for broadcast or conference, e.g. multicast for stock exchange and similar applications

Abstract

The application provides a transaction broadcasting method, a device and a storage medium, which relate to the technical field of block chains and the like, and the method comprises the following steps: determining all-message nodes and non-all-message nodes connected with the current node; receiving a first transaction, sending the first transaction to each connected full message node, and sending a first transaction hash of the first transaction to each connected non-full message node; receiving a second transaction hash sent by a non-full message node, and judging whether a second transaction corresponding to the second transaction hash exists locally or not: if not, then monitoring whether a second transaction is received. The application reduces the bandwidth consumed by transactional broadcasting.

Description

Transaction broadcasting method, apparatus and storage medium
Technical Field
The application relates to the technical field of blockchains, in particular to a transaction broadcasting method, transaction broadcasting equipment and a storage medium.
Background
In the existing blockchain technology, the transaction broadcasting mechanism is generally divided into two types, the first: after receiving the transaction, the node forwards the received transaction to other nodes connected with the node; and secondly, after the node receives the transaction, judging whether the round of the transaction is smaller than a first numerical value, if so, forwarding the received transaction to other nodes connected with the node, and if not, forwarding the transaction hash of the received transaction to other nodes connected with the node.
If a node establishes a connection with 25 nodes, at the same time, when the round of the transactions in the first manner and the second manner is smaller than the first value, the node needs to broadcast the transactions to 25 nodes at the same time, which consumes a large amount of bandwidth, is easy to cause network congestion, and when there are too many network messages, the network may have catastrophic effects on the whole blockchain network.
Disclosure of Invention
In view of the foregoing drawbacks or deficiencies of the prior art, it is desirable to provide a transaction broadcasting method, apparatus and storage medium that reduces the bandwidth consumed by transaction broadcasting.
In a first aspect, the present application provides a transaction broadcasting method applicable to a blockchain node, the method comprising:
receiving first request information for establishing all message nodes sent by a first blockchain node, and judging whether the connection number of the first all message nodes of the current node is smaller than a first value or not:
if yes, returning first identical information to the first block chain link point so that the first block chain link point can determine the current node as a full message node connected with the first block chain node and update the second full message node connection number of the first block chain node; the method comprises the steps of,
determining the first blockchain node as a full message node connected with the current node, and updating the connection number of the first full message node;
when the connection number of the first full message node is smaller than the first value, second request information for establishing the full message node is sent to the second block chain node so that the second block chain node can judge whether the connection number of a third full message node of the second block chain node is smaller than the first value or not: if yes, returning second agreement information and updating the third full message node connection number; the method comprises the steps of,
after receiving the second agreement information, determining the second blockchain node as a full message node connected with the current node, and updating the connection number of the first full message node;
determining other connected blockchain nodes except the connected full message node as non-full message nodes connected with the current node;
receiving a first transaction, sending the first transaction to each connected full message node, and sending a first transaction hash of the first transaction to each connected non-full message node;
receiving a second transaction hash sent by a non-full message node, and judging whether a second transaction corresponding to the second transaction hash exists locally or not: if not, then monitoring whether a second transaction is received.
In a second aspect, the present application also provides an apparatus comprising one or more processors and a memory, wherein the memory contains instructions executable by the one or more processors to cause the one or more processors to perform a transaction broadcast method provided in accordance with embodiments of the present application.
In a third aspect, the present application also provides a storage medium storing a computer program for causing a computer to execute the transaction broadcasting method provided according to the embodiments of the present application.
The transaction broadcasting method, the transaction broadcasting equipment and the transaction broadcasting storage medium provided by the embodiments of the application are characterized in that all message nodes and non-all message nodes connected with a current node are determined; receiving a first transaction, sending the first transaction to each connected full message node, and sending a first transaction hash of the first transaction to each connected non-full message node; receiving a second transaction hash sent by a non-full message node, and judging whether a second transaction corresponding to the second transaction hash exists locally or not: if not, the method for monitoring whether the second transaction is received reduces the bandwidth consumed by the transaction broadcast.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the accompanying drawings in which:
fig. 1 is a flowchart of a transaction broadcasting method according to an embodiment of the present application.
Fig. 2 is a schematic structural diagram of an apparatus according to an embodiment of the present application.
Detailed Description
The application is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be noted that, for convenience of description, only the portions related to the application are shown in the drawings.
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
Fig. 1 is a flowchart of a transaction broadcasting method according to an embodiment of the present application. As shown in fig. 1, in this embodiment, the present application provides a transaction broadcasting method applicable to a blockchain node, where the method includes:
s111: receiving first request information for establishing all message nodes sent by a first blockchain node, and judging whether the connection number of the first all message nodes of the current node is smaller than a first value or not:
if yes, step S112 is executed: returning first identical information to the first block link point so that the first block link point can determine the current node as a full message node connected with the first block chain node and update the second full message node connection number of the first block chain node; the method comprises the steps of,
s113: determining the first blockchain node as a full message node connected with the current node, and updating the connection number of the first full message node;
s131: when the connection number of the first full message node is smaller than the first value, second request information for establishing the full message node is sent to the second block chain node so that the second block chain node can judge whether the connection number of a third full message node of the second block chain node is smaller than the first value or not: if yes, returning second agreement information and updating the third full message node connection number; the method comprises the steps of,
s132: after receiving the second agreement information, determining the second blockchain node as a full message node connected with the current node, and updating the connection number of the first full message node;
s15: determining other connected blockchain nodes except the connected full message node as non-full message nodes connected with the current node;
s17: receiving a first transaction, sending the first transaction to each connected full message node, and sending a first transaction hash of the first transaction to each connected non-full message node;
s19: receiving a second transaction hash sent by a non-full message node, and judging whether a second transaction corresponding to the second transaction hash exists locally or not: if not, then monitoring whether a second transaction is received.
Specifically, taking the first value as 3 as an example; assuming that the current node is N0, the connected nodes are N1-N25, and the number of the current full message node connections of N0 is 1 (the connected full message node is N25); n0 sends request information for establishing all message nodes to N1 (the number of all message node connection at the time of N1 is 1), and returns consent information to N0; and N1 receives request information for establishing all message nodes sent by N2 and N3 in sequence (the connection number of all message nodes at the moment of N2 is 1).
N0 current total message node connection number is 1 and less than 3, then N0 executes step S131, and sends request information for establishing total message node to N1;
n1 judges whether the connection number of all message nodes of N1 is less than 3:
because the connection number of the all-message node of N1 is 1 and is smaller than 3, the agreement information is returned, and the connection number of the all-message node of N1 is updated to be 2; the method comprises the steps of,
n0 performs step S132, after receiving the consent information sent by N1, determining N1 as the full message node to which N0 is connected, and updating the number of full message node connections of N0 to be 2.
N0 executes step S111 to receive the request information for establishing the full message node sent by N2, where N0 determines whether the number of full message node connections of N0 is less than 3:
because the connection number of all the message nodes is 2 and less than 3, executing step S112, and returning the consent information to N2;
n2 determines N0 as a full message node connected with N2, and updates the connection number of the full message node of N2 to be 2; the method comprises the steps of,
n0 performs step S113 to determine N2 as the full message node to which N0 is connected, and updates the full message node connection number to 3.
N0 executes step S111 to receive the request information for establishing the full message node sent by N3, where N0 determines whether the number of full message node connections of N0 is less than 3:
since the number of all message node connections at this time is 3, not less than 3, no consent information is returned.
N0 performs step S15 to determine N3 to N24 as non-full message nodes to which N0 is connected.
N0 performs step S17, receives transaction tx1, sends tx1 to N1, N2 and N25, and sends hash (tx 1) to N3-N24.
N0 executes step S19 to receive the hash (tx 2) sent by N3, and determine whether there is a transaction tx2 corresponding to the hash (tx 2) locally: if not, then it is monitored whether tx2 is received.
In the above embodiment, the transaction broadcasting principle shown in the present application is exemplarily illustrated by taking the first value as 3, and in more embodiments, the first value may be further configured according to actual needs, for example, configured as 4, so that the same technical effects can be achieved.
The above-described embodiments reduce the bandwidth consumed by transactional broadcasting.
Preferably, the first value is calculated from the number of connected blockchain nodes and a preconfigured number of cycles. Assuming that the first value is X and the number of preconfigured cycles is 3, the 3 rd power of X is 25, and since the first value is an integer, the first value is calculated to be 3.
Preferably, the method shown in fig. 1 further comprises:
after a second period of time, the first transaction hash is again sent to the connected non-full message nodes.
The above embodiments are used to ensure that each connected non-full message node receives the first transaction hash in time.
Preferably, monitoring whether the second transaction is received comprises:
when a second transaction corresponding to the second transaction hash is not received within a third duration, requesting the second transaction from a non-full message node which sends the second transaction hash;
the second transaction is stored when the non-full message node that sent the second transaction hash returns the second transaction.
Taking the embodiment shown in fig. 1 as an example, if N0 does not receive the transaction tx2 corresponding to the hash (tx 2) within the third duration, N0 requests tx2 from N3.
It should be noted that, taking the embodiment shown in fig. 1 as an example, if N0 further determines N10 as a connected full message node due to a special requirement, the number of full message node connections of N0 is 4 (the full message nodes are N1, N2, N25, N10), and when the special requirement ends, N0 sends request information for canceling to establish the full message node to one full message node (for example, N10) of N1, N2, N25, N10;
n10 determines N0 as a non-full message node connected with N10 and updates the full message node connection number of N10 after receiving the request information;
n0 determines N10 as the non-full message node connected and updates the full message node connection number of N0 to be 3.
Fig. 2 is a schematic structural diagram of an apparatus according to an embodiment of the present application.
As shown in fig. 2, as another aspect, the present application also provides an apparatus 200 including one or more Central Processing Units (CPUs) 201, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 202 or a program loaded from a storage portion 208 into a Random Access Memory (RAM) 203. In the RAM203, various programs and data required for the operation of the apparatus 200 are also stored. The CPU201, ROM202, and RAM203 are connected to each other through a bus 204. An input/output (I/O) interface 205 is also connected to bus 204.
The following components are connected to the I/O interface 205: an input section 206 including a keyboard, a mouse, and the like; an output portion 207 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker, and the like; a storage section 208 including a hard disk or the like; and a communication section 209 including a network interface card such as a LAN card, a modem, and the like. The communication section 209 performs communication processing via a network such as the internet. The drive 210 is also connected to the I/O interface 205 as needed. A removable medium 211 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed on the drive 210 as needed, so that a computer program read out therefrom is installed into the storage section 208 as needed.
In particular, according to embodiments of the present disclosure, the method described in any of the above embodiments may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing any of the methods described above. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 209, and/or installed from the removable medium 211.
As still another aspect, the present application also provides a computer-readable storage medium, which may be a computer-readable storage medium contained in the apparatus of the above-described embodiment; or may be a computer-readable storage medium, alone, that is not assembled into a device. The computer-readable storage medium stores one or more programs for use by one or more processors to perform the methods described herein.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules involved in the embodiments of the present application may be implemented in software or in hardware. The described units or modules may also be provided in a processor, for example, each of the units may be a software program provided in a computer or a mobile smart device, or may be separately configured hardware devices. Wherein the names of the units or modules do not in some cases constitute a limitation of the units or modules themselves.
The above description is only illustrative of the preferred embodiments of the present application and of the principles of the technology employed. It will be appreciated by persons skilled in the art that the scope of the application referred to in the present application is not limited to the specific combinations of the technical features described above, but also covers other technical features formed by any combination of the technical features described above or their equivalents without departing from the spirit of the application. Such as the above-mentioned features and the technical features disclosed in the present application (but not limited to) having similar functions are replaced with each other.

Claims (6)

1. A transaction broadcasting method, the method being applicable to blockchain nodes, the method comprising:
receiving first request information for establishing all message nodes sent by a first blockchain node, and judging whether the connection number of the first all message nodes of the current node is smaller than a first value or not:
if yes, returning first identical information to the first blockchain node so that the first blockchain node can determine the current node as a full-message node connected with the first blockchain node and update the second full-message node connection number of the first blockchain node; the method comprises the steps of,
determining the first blockchain node as a full message node connected with a current node, and updating the connection number of the first full message node;
when the connection number of the first full message node is smaller than the first value, sending second request information for establishing the full message node to a second block chain node so that the second block chain node can judge whether the connection number of a third full message node of the second block chain node is smaller than the first value or not: if yes, returning second agreement information and updating the third full message node connection number; the method comprises the steps of,
after receiving the second agreement information, determining the second blockchain node as a full message node connected with a current node, and updating the connection number of the first full message node;
determining other connected blockchain nodes except the connected full message node as non-full message nodes connected with the current node;
receiving a first transaction, sending the first transaction to all connected message nodes, and sending a first transaction hash of the first transaction to all connected non-message nodes;
receiving a second transaction hash sent by a non-full message node, and judging whether a second transaction corresponding to the second transaction hash exists locally or not: if not, monitoring whether the second transaction is received.
2. The method of claim 1, wherein the first value is calculated from a number of connected blockchain nodes and a preconfigured number of cycles.
3. The method according to claim 1 or 2, further comprising:
after a second period of time, the first transaction hash is again sent to the connected non-full message nodes.
4. The method of claim 1 or 2, wherein the monitoring whether the second transaction is received comprises:
when a second transaction corresponding to the second transaction hash is not received within a third duration, requesting the second transaction from a non-full message node which sends the second transaction hash;
and storing the second transaction when the non-full message node sending the second transaction hash returns the second transaction.
5. An apparatus, the apparatus comprising:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-4.
6. A storage medium storing a computer program, characterized in that the program, when executed by a processor, implements the method according to any one of claims 1-4.
CN202010911963.2A 2020-09-02 2020-09-02 Transaction broadcasting method, apparatus and storage medium Active CN112053154B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010911963.2A CN112053154B (en) 2020-09-02 2020-09-02 Transaction broadcasting method, apparatus and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010911963.2A CN112053154B (en) 2020-09-02 2020-09-02 Transaction broadcasting method, apparatus and storage medium

Publications (2)

Publication Number Publication Date
CN112053154A CN112053154A (en) 2020-12-08
CN112053154B true CN112053154B (en) 2023-11-28

Family

ID=73607202

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010911963.2A Active CN112053154B (en) 2020-09-02 2020-09-02 Transaction broadcasting method, apparatus and storage medium

Country Status (1)

Country Link
CN (1) CN112053154B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112600905B (en) * 2020-12-09 2023-04-14 杭州复杂美科技有限公司 Transaction broadcasting and block generating method, apparatus and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107197036A (en) * 2017-06-22 2017-09-22 广东网金控股股份有限公司 A kind of consistent processing method of information based on block chain and terminal
WO2018090331A1 (en) * 2016-11-18 2018-05-24 深圳前海达闼云端智能科技有限公司 Blockchain network, article transaction method and apparatus, and node device
CN111464630A (en) * 2020-03-31 2020-07-28 杭州复杂美科技有限公司 Transaction broadcasting method, apparatus and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10313861B2 (en) * 2016-09-15 2019-06-04 WiSilica Inc. Wireless control of multiple actor devices by multiple controller devices with communication security

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018090331A1 (en) * 2016-11-18 2018-05-24 深圳前海达闼云端智能科技有限公司 Blockchain network, article transaction method and apparatus, and node device
CN107197036A (en) * 2017-06-22 2017-09-22 广东网金控股股份有限公司 A kind of consistent processing method of information based on block chain and terminal
CN111464630A (en) * 2020-03-31 2020-07-28 杭州复杂美科技有限公司 Transaction broadcasting method, apparatus and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
区块链全局账本数据的拆分技术研究;于雷;金岩;;高技术通讯(第Z2期);全文 *

Also Published As

Publication number Publication date
CN112053154A (en) 2020-12-08

Similar Documents

Publication Publication Date Title
CN111798316B (en) Parallel chain consensus method, apparatus and storage medium
CN111464630B (en) Transaction broadcasting method, apparatus and storage medium
CN111798238B (en) Parallel chain consensus method, apparatus and storage medium
CN110083745B (en) Data query method, device and storage medium
CN110944058B (en) Block chain intranet node relay connection method
CN112416632B (en) Event communication method and device, electronic equipment and computer readable medium
CN111324449A (en) Transaction storage and broadcasting method, device and storage medium of memory pool
CN111858641A (en) Transaction processing method and device, electronic equipment and readable storage medium
CN112053154B (en) Transaction broadcasting method, apparatus and storage medium
CN112583585A (en) Transaction execution method, apparatus and storage medium
CN112131013A (en) Monitoring method, device, equipment and storage medium of call chain in distributed system
CN112055077B (en) Block link access method, device and storage medium
CN108874531B (en) Method, device and system for fusing service and electronic equipment
CN114884915B (en) Message processing method, device and equipment based on gray release
US10402234B2 (en) Fine-grain synchronization in data-parallel jobs
CN110502891B (en) Method, device, medium and electronic equipment for acquiring process memory leakage
CN113778850A (en) Data processing method and device, electronic equipment and computer readable medium
CN114827167B (en) Node selection and transaction transmission method, device and storage medium
CN112052250A (en) Performance measurement method, broadcast performance adjustment method, device and storage medium
CN113205418B (en) Cross-chain transaction method, computer device and storage medium
CN113468053B (en) Application system testing method and device
CN113590611B (en) Block execution method, computer device, and storage medium
CN116700956B (en) Request processing method, apparatus, electronic device and computer readable medium
CN115842691B (en) Message sequence assurance method, device and equipment for distributed group communication
CN112818060B (en) Data synchronization method, device, electronic equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant