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

Transaction broadcasting method, apparatus and storage medium Download PDF

Info

Publication number
CN112053154A
CN112053154A CN202010911963.2A CN202010911963A CN112053154A CN 112053154 A CN112053154 A CN 112053154A CN 202010911963 A CN202010911963 A CN 202010911963A CN 112053154 A CN112053154 A CN 112053154A
Authority
CN
China
Prior art keywords
transaction
node
full message
message node
block link
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.)
Granted
Application number
CN202010911963.2A
Other languages
Chinese (zh)
Other versions
CN112053154B (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

Images

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 invention provides a transaction broadcasting method, equipment and a storage medium, which relate to the technical field of block chains and the like, and the method comprises the following steps: determining a full message node and a non-full message node connected with a 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 the non-full message node, and judging whether a second transaction corresponding to the second transaction hash exists locally: and if not, monitoring whether a second transaction is received. The application reduces the bandwidth consumed by the transaction broadcast.

Description

Transaction broadcasting method, apparatus and storage medium
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a transaction broadcasting method, device, and storage medium.
Background
In the prior art of blockchain, the transaction broadcasting mechanism is generally divided into two types, the first type: after receiving the transaction, the node forwards the received transaction to other nodes connected with the node; secondly, after receiving the transaction, the node judges whether the transaction turn is smaller than the first numerical value, if so, the received transaction is forwarded to other nodes connected with the node, and if not, the transaction hash of the received transaction is forwarded to other nodes connected with the node.
If a node establishes connection with 25 nodes, when the round of transactions of the first mode and the second mode is less than the first value at the same time, the node needs to broadcast the transactions to the 25 nodes at the same time, which consumes a large amount of bandwidth and is easy to cause network congestion, and when the network messages are too much, the whole blockchain network may be affected in a catastrophic manner.
Disclosure of Invention
In view of the above-mentioned drawbacks and deficiencies in the prior art, it is desirable to provide a transaction broadcasting method, apparatus, and storage medium that reduce the bandwidth consumed by transaction broadcasting.
In a first aspect, the present invention provides a transaction broadcasting method for a blockchain node, where the method includes:
receiving first request information for establishing full message nodes sent by a first block chain node, and judging whether the connection number of the first full message nodes of the current node is smaller than a first numerical value:
if so, returning first homonymy information to the first block link point so that the first block link point determines the current node as a full message node connected with the first block link node and updates the second full message node connection number of the first block link node; and the number of the first and second groups,
determining the first block link point 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 numerical value, sending second request information for establishing the full message node to the second block chain node so that the second block chain node can judge whether the connection number of the third full message node of the second block chain node is smaller than the first numerical value: if yes, returning second agreement information and updating the connection number of the third full message node; and the number of the first and second groups,
after receiving second agreement information, determining the second block link point as a full message node connected with the current node, and updating the connection number of the first full message node;
determining other connected block chain link points 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 the non-full message node, and judging whether a second transaction corresponding to the second transaction hash exists locally: and if not, monitoring whether a second transaction is received.
In a second aspect, the present invention 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 according to embodiments of the present invention.
In a third aspect, the present invention also provides a storage medium storing a computer program that causes a computer to execute a transaction broadcasting method provided according to embodiments of the present invention.
The transaction broadcasting method, the transaction broadcasting equipment and the transaction broadcasting storage medium provided by the embodiments of the invention determine the full message node and the non-full message node 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 the non-full message node, and judging whether a second transaction corresponding to the second transaction hash exists locally: and if not, monitoring whether a second transaction is received or not, and reducing 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 following detailed description of non-limiting embodiments thereof, 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 invention.
Fig. 2 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 is a flowchart of a transaction broadcasting method according to an embodiment of the present invention. As shown in fig. 1, in this embodiment, the present invention provides a transaction broadcasting method suitable for a blockchain node, where the method includes:
s111: receiving first request information for establishing full message nodes sent by a first block chain node, and judging whether the connection number of the first full message nodes of the current node is smaller than a first numerical value:
if yes, go to step S112: returning first homonymy information to the first block link point so that the first block link point determines the current node as a full message node connected with the first block link node and updates the second full message node connection number of the first block link node; and the number of the first and second groups,
s113: determining the first block link point 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 numerical value, sending second request information for establishing the full message node to the second block chain node so that the second block chain node can judge whether the connection number of the third full message node of the second block chain node is smaller than the first numerical value: if yes, returning second agreement information and updating the connection number of the third full message node; and the number of the first and second groups,
s132: after receiving second agreement information, determining the second block link point 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 block chain link points 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 the non-full message node, and judging whether a second transaction corresponding to the second transaction hash exists locally: and if not, monitoring whether a second transaction is received.
Specifically, the first numerical value is taken as 3 as an example; assuming that the current node is N0, the connected nodes are N1-N25, and the current full message node connection number of N0 is 1 (the connected full message node is N25); n0 sends request information for establishing full message nodes to N1 (the connection number of the full message nodes at the moment of N1 is 1), and returns agreement information to N0; the N1 receives the request information for establishing the full message node sent by the N2 and the N3 in sequence (the connection number of the full message node at this time of the N2 is 1).
N0 if the current connection number of the full message nodes is 1 and is less than 3, then N0 executes step S131 and sends request information for establishing the full message nodes to N1;
n1 judges whether the full message node connection number of N1 is less than 3:
since the connection number of the full message nodes at the moment of N1 is 1 and is less than 3, returning agreement information, and updating the connection number of the full message nodes of N1 to 2; and the number of the first and second groups,
n0 executes step S132, and upon receiving the agreement information sent by N1, determines N1 as the full message node to which N0 is connected, and updates the full message node connection number of N0 to 2.
N0 executes step S111, receives the request message for establishing full message node sent by N2, and N0 determines whether the number of full message node connections of N0 is less than 3:
since the connection number of the full message nodes at this time is 2 and is less than 3, step S112 is executed to return agreement information to N2;
n2 determines N0 as the full message node to which N2 is connected and updates the full message node connection number of N2 to 2; and the number of the first and second groups,
n0 performs step S113, determines 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, receives the request message for establishing full message node sent by N3, and N0 determines whether the number of full message node connections of N0 is less than 3:
since the connection number of the full message nodes is 3 at this time and is not less than 3, the consent information is not returned.
N0 executes step S15 to determine N3 to N24 as the non-all message nodes to which N0 is connected.
N0 executes step S17, receives the transaction tx1, sends tx1 to N1, N2 and N25, and sends hash (tx1) to N3-N24.
The N0 executes step S19, receives the hash (tx2) sent by N3, and determines whether the transaction tx2 corresponding to the hash (tx2) exists locally: if not, it is monitored whether tx2 is received.
The above embodiment exemplifies the transaction broadcasting principle of the present invention with the first value being 3, and in further embodiments, the first value may be configured according to actual requirements, for example, configured to be 4, so that the same technical effect may be achieved.
The above-described embodiments reduce the bandwidth consumed by the transaction broadcast.
Preferably, the first value is calculated from the number of connected block link points and a preconfigured number of cycles. Assuming that the first value is X and the number of preconfigured cycles is 3, the power of 3 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:
and after the second time length, sending the first transaction hash to each connected non-full message node again.
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 time length, requesting the second transaction from the non-full message node sending the second transaction hash;
and when the non-full message node sending the second transaction hash returns the second transaction, storing the second transaction.
Taking the embodiment shown in fig. 1 as an example, if the transaction tx2 corresponding to the hash (tx2) is not received by N0 in 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 the connected full message node due to a special requirement, at this time, 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 establishment of the full message node to one full message node (for example, N10) of N1, N2, N25, N10;
n10, upon receiving the request information, determines N0 as the non-full message node to which N10 is connected and updates the full message node connection number of N10;
n0 determines N10 as the connected non-full message node and updates N0 to have a full message node connection number of 3.
Fig. 2 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
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 that 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 section 208 into a Random Access Memory (RAM) 203. In the RAM203, various programs and data necessary for the operation of the apparatus 200 are also stored. The CPU201, ROM202, and RAM203 are connected to each other via 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 portion 206 including a keyboard, a mouse, and the like; an output section 207 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 208 including a hard disk and the like; and a communication section 209 including a network interface card such as a LAN card, a modem, or the like. The communication section 209 performs communication processing via a network such as the internet. A 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 mounted on the drive 210 as necessary, so that a computer program read out therefrom is mounted into the storage section 208 as necessary.
In particular, according to an embodiment 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 through the communication section 209 and/or installed from the removable medium 211.
As yet another aspect, the present application also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the apparatus of the above-described embodiment; or it may be a separate computer readable storage medium not incorporated into the device. The computer readable storage medium stores one or more programs for use by one or more processors in performing the methods described in the present application.
The flowchart 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 invention. 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 described in the embodiments of the present application may be implemented by software or hardware. The described units or modules may also be provided in a processor, for example, each of the described units may be a software program provided in a computer or a mobile intelligent device, or may be a separately configured hardware device. Wherein the designation of a unit or module does not in some way constitute a limitation of the unit or module itself.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the present application. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (6)

1. A transaction broadcasting method, wherein the method is applied to a blockchain node, and wherein the method comprises:
receiving first request information for establishing full message nodes sent by a first block chain node, and judging whether the connection number of the first full message nodes of the current node is smaller than a first numerical value:
if so, returning first homonymy information to the first block link point so that the first block link point determines the current node as a full message node connected with the first block link node and updates the second full message node connection number of the first block link node; and the number of the first and second groups,
determining the first block link point as a full message node connected with the current node, and updating the connection number of the first full message node;
when the number of connections of the first full message node is less than the first numerical value, sending second request information for establishing the full message node to a second block link point, so that the second block link point can judge whether the number of connections of a third full message node of the second block link node is less than the first numerical value: if yes, returning second consent information and updating the third full message node connection number; and the number of the first and second groups,
after receiving the second agreement information, determining the second block link point as a full message node connected with the current node, and updating the connection number of the first full message node;
determining other connected block chain link points 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: and if not, monitoring whether the second transaction is received.
2. The method of claim 1, wherein the first value is calculated from the number of connected block link points and a preconfigured number of cycles.
3. The method of claim 1 or 2, further comprising:
and after a second time length, sending the first transaction hash to each connected non-full message node again.
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 time length, requesting the second transaction from a non-full message node sending 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, characterized in that the apparatus comprises:
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 recited in 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 true CN112053154A (en) 2020-12-08
CN112053154B 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)

Cited By (1)

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

Citations (4)

* 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
US20180077520A1 (en) * 2016-09-15 2018-03-15 WiSilica Inc. Wireless control of multiple actor devices by multiple controller devices with communication security
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180077520A1 (en) * 2016-09-15 2018-03-15 WiSilica Inc. Wireless control of multiple actor devices by multiple controller devices with communication security
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
于雷;金岩;: "区块链全局账本数据的拆分技术研究", 高技术通讯, no. 2 *

Cited By (2)

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

Also Published As

Publication number Publication date
CN112053154B (en) 2023-11-28

Similar Documents

Publication Publication Date Title
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
CN111798316A (en) Parallel chain consensus method, device and storage medium
CN113194146B (en) Leader node determination method, computer device, and storage 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
CN113760536A (en) Data caching method and device, electronic equipment and computer readable medium
CN112053154B (en) Transaction broadcasting method, apparatus and storage medium
CN112583585A (en) Transaction execution method, apparatus and storage medium
CN112055077B (en) Block link access method, device and storage medium
US11416283B2 (en) Method and apparatus for processing data in process of expanding or reducing capacity of stream computing system
CN110322350B (en) Method, device, equipment and storage medium for cutting hollow block in consensus network
CN114884915B (en) Message processing method, device and equipment based on gray release
WO2022048409A1 (en) Performance measurement method, broadcast performance adjustment method, device, and storage medium
CN110990490B (en) Method, device, equipment and medium for checking in blockchain network
CN109981320B (en) Method and device for managing configuration information
CN113205418B (en) Cross-chain transaction method, computer device and storage medium
CN114390099B (en) Content distribution method and edge server
CN116436855B (en) Data information processing method, device, electronic equipment and medium
CN114827167B (en) Node selection and transaction transmission method, device and storage medium
CN115842691B (en) Message sequence assurance method, device and equipment for distributed group communication
CN115174588B (en) Bandwidth control method, device, apparatus, storage medium and program product
CN116996481B (en) Live broadcast data acquisition method and device, electronic equipment and storage medium
CN113379550B (en) Block execution method, computer device and 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