CN112988414A - Block chain transaction batch broadcasting method, computer equipment and storage medium - Google Patents

Block chain transaction batch broadcasting method, computer equipment and storage medium Download PDF

Info

Publication number
CN112988414A
CN112988414A CN202110174639.1A CN202110174639A CN112988414A CN 112988414 A CN112988414 A CN 112988414A CN 202110174639 A CN202110174639 A CN 202110174639A CN 112988414 A CN112988414 A CN 112988414A
Authority
CN
China
Prior art keywords
transaction
node
broadcast
broadcasting
transactions
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.)
Pending
Application number
CN202110174639.1A
Other languages
Chinese (zh)
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 CN202110174639.1A priority Critical patent/CN112988414A/en
Publication of CN112988414A publication Critical patent/CN112988414A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a block chain transaction batch broadcasting method, computer equipment and a storage medium, wherein the method comprises the following steps: receiving a first transaction and a first broadcast filtering list sent by a first node, and recording the first node and each node of the first broadcast filtering list into a local filtering list of the first transaction; carrying out legal verification and duplicate removal verification on the first transaction through a memory pool module: storing the first transaction into a transaction queue to be broadcasted after each item passes the verification; taking out a plurality of transactions from the transaction queue to be broadcasted, and respectively generating a second broadcast filtering list of each second transaction according to each broadcast object node and the local filtering list of each second transaction; broadcasting to each broadcasting object node: respectively judging whether the local filtering list of each second transaction comprises a third node: if yes, removing the second transaction; and broadcasting the rest transactions after filtering and the corresponding second broadcast filtering list to the third node. The invention can improve the efficiency of transaction broadcasting and greatly reduce repeated broadcasting.

Description

Block chain transaction batch broadcasting method, computer equipment and storage medium
Technical Field
The application relates to the technical field of internet, in particular to a block chain transaction batch broadcasting method, computer equipment and a storage medium.
Background
In the prior art blockchain system, when blockchain nodes broadcast transactions to each other, only one transaction is sent at a time. Each transaction broadcast by a node requires a separate initiation of a protocol.
For example, for node a, when node a needs to broadcast m transactions to n nodes, node a needs to start m routines, perform m × n network communications, and release m routines.
In the above process, each time of starting the coroutine, releasing the coroutine and network communication consumes a certain time, and when the number of transactions is too large, the total time consumption of broadcasting the transactions is large, which results in low broadcasting efficiency of the transactions.
The applicant has proposed a scheme for improving the efficiency of transaction broadcasting through mass broadcasting transactions in another application filed recently, which can solve the above problems, but still has a problem that a large number of transactions repeatedly broadcasted result in a large waste of bandwidth. For example, after node A broadcasts 20 transactions tx1-tx20 to nodes B-D, node D broadcasts 30 transactions tx1-tx30 to nodes E-G, and when node G broadcasts a transaction, node G knows neither that node A, B, C already has tx1-tx20 nor that node E, F already has tx1-tx30, which would result in node G broadcasting a duplicate transaction to these nodes if any one or more of nodes A, B, C, E, F were in node G's broadcast object list.
Disclosure of Invention
In view of the above-mentioned drawbacks or deficiencies in the prior art, it is desirable to provide a blockchain transaction mass broadcasting method, a computer device, and a storage medium that reduce repeated transactions of broadcasting while improving broadcasting efficiency.
In a first aspect, the present invention provides a blockchain transaction batch broadcasting method applicable to blockchain nodes, where the blockchain nodes are configured with transaction broadcast filters, the method including:
receiving a first transaction and a first broadcast filtering list of the first transaction sent by a first node, and recording each second node recorded by the first node and the first broadcast filtering list into a local filtering list of the first transaction in a transaction broadcast filter;
carrying out legal verification and duplicate removal verification on the first transaction through a memory pool module of the current node:
if all the verification items pass, storing the first transaction into a transaction queue to be broadcasted;
taking out a plurality of transactions from the transaction queue to be broadcasted, and respectively generating a second broadcast filtering list of each second transaction according to each broadcast object node and a local filtering list of each second transaction in the plurality of transactions;
broadcasting a plurality of transactions to each broadcasting object node respectively through the following steps:
before broadcasting a plurality of transactions to the third node, respectively judging whether the local filtering list of each second transaction comprises the third node:
if yes, removing the second transaction from the plurality of transactions;
and broadcasting the rest transactions after filtering and the corresponding second broadcast filtering list to the third node.
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 blockchain transaction bulk 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 the blockchain transaction batch broadcasting method according to the embodiments of the present invention.
On one hand, the block chain transaction batch broadcasting method, the computer equipment and the storage medium provided by the embodiments of the invention realize that multiple transactions are broadcasted in single network communication with other nodes by configuring the transaction broadcasting filter for storing the local filtering list of each transaction and filtering the transactions through the transaction broadcasting filter before the multiple transactions are broadcasted to other nodes, thereby greatly reducing the times of network communication and improving the broadcasting efficiency of the transactions; on the other hand, a broadcast filtering list of the transaction to be broadcast is generated according to each broadcast object node and the local filtering list of the transaction to be broadcast, the transaction to be broadcast and the corresponding broadcast filtering list are broadcast together, so that the node receiving the transaction can update the local filtering list of the transaction according to the broadcast filtering list, and repeated broadcast of the transaction is greatly reduced;
the block chain transaction batch broadcasting method, the computer equipment and the storage medium provided by some embodiments of the invention further realize that the time consumption of starting the coroutine for many times and releasing the coroutine for many times is avoided in the process of broadcasting the transaction by configuring a resident coroutine to circularly execute the broadcasting transaction, thereby further improving the broadcasting efficiency of the transaction.
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 block chain transaction batch 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 block chain transaction batch broadcasting method according to an embodiment of the present invention.
As shown in fig. 1, in the present embodiment, the present invention provides a blockchain transaction bulk broadcasting method suitable for blockchain nodes, where the blockchain nodes are configured with transaction broadcast filters, the method including:
s11: receiving a first transaction and a first broadcast filtering list of the first transaction sent by a first node, and recording each second node recorded by the first node and the first broadcast filtering list into a local filtering list of the first transaction in a transaction broadcast filter;
s13: carrying out legal verification and duplicate removal verification on the first transaction through a memory pool module of the current node:
if the items are verified, step S15 is executed: storing the first transaction into a transaction queue to be broadcasted;
s17: taking out a plurality of transactions from the transaction queue to be broadcasted, and respectively generating a second broadcast filtering list of each second transaction according to each broadcast object node and a local filtering list of each second transaction in the plurality of transactions;
s19: broadcasting a plurality of transactions to each broadcasting object node respectively through the following steps:
s191: before broadcasting a plurality of transactions to the third node, respectively judging whether the local filtering list of each second transaction comprises the third node:
if yes, go to step S193: removing the second transaction from the plurality of transactions;
s195: and broadcasting the rest transactions after filtering and the corresponding second broadcast filtering list to the third node.
The above method is exemplarily illustrated below by the following steps that after the node A broadcasts the transaction tx1-tx20 to the node B, C, D, and the node D broadcasts the transaction tx1-tx30 to the node E, F, G, the node G broadcasts the transaction tx6-tx50 to the node B, D, F, H.
In step S11, node G receives tx1-tx30 broadcast by node D, and the first broadcast filter list TransList _ tx1-TransList _ tx2 corresponding to tx1-tx30, respectively, in the transaction broadcast filter:
recording nodes recorded by node D and TransList _ tx1 (including at least node A, B, C, D, E, F, G according to the method of the present application) into a local filter list LocalList _ tx1 of tx 1;
……
recording nodes (also including at least node A, B, C, D, E, F, G) recorded by node D and TransList _ tx6 into a local filter list LocalList _ tx6 of tx 6;
……
recording nodes recorded by node D and TransList _ tx21 (including at least node D, E, F, G according to the method of the present application) into a local filter list LocalList _ tx21 of tx 21;
……
the nodes recorded by node D and the TransList _ tx30 (again including at least node D, E, F, G) are recorded into the local filter list LocalList _ tx30 of tx 30.
In step S13, the node G performs validity verification and duplicate transaction removal verification on tx1-tx30 through the memory pool module of the node:
tx1-tx5 failed to verify, then tx1-tx5 are not broadcast to other nodes;
and each item of tx6-tx30 passes the verification, the step S15 is executed to store the verified tx6-tx30 in the transaction queue to be broadcast.
In step S17, the node G fetches tx6-tx50 from the transaction queue to be broadcast, and generates a second broadcast filter list for each transaction according to the local filter list LocalList _ tx6-LocalList _ tx50 for each transaction in each broadcast object node B, D, F, H and tx6-tx50, respectively:
generate TransList _ tx 6' (including at least node A, B, C, D, E, F, G, H) from node B, D, F, H and LocalList _ tx 6;
……
generate TransList _ tx 21' (including at least node B, D, E, F, G, H) from node B, D, F, H and LocalList _ tx 21;
……
in step S19, the node G broadcasts tx6-tx50 to the node B, D, F, H, respectively, by the method described below:
when broadcasting the transaction to the node B:
respectively judging whether the local filtering lists LocalList _ tx6-LocalList _ tx50 of tx6-tx50 comprise the node B:
localList _ tx6-localList _ tx20 includes node B, removing tx6-tx20 from tx6-tx 50;
the tx21-tx50 remaining after filtering and the corresponding second broadcast filter list TransList _ tx21 '-TransList _ tx 50' are broadcast to node B.
When broadcasting the transaction to the node D/F:
respectively judging whether the local filtering lists LocalList _ tx6-LocalList _ tx50 of tx6-tx50 comprise nodes D/F:
LocalList _ tx6-LocalList _ tx30 includes node D/F, removing tx6-tx30 from tx6-tx 50;
the tx31-tx50 remaining after filtering and the corresponding second broadcast filter list TransList _ tx31 '-TransList _ tx 50' are broadcast to node D/F.
When broadcasting the transaction to node H:
respectively judging whether the local filtering lists LocalList _ tx6-LocalList _ tx50 of tx6-tx50 comprise a node H:
neither localList _ tx6-localList _ tx50 includes node H;
the tx6-tx50 remaining after filtering and the corresponding second broadcast filter list TransList _ tx6 '-TransList _ tx 50' are broadcast to node H.
As can be seen from the above examples, the method claimed in the present application can avoid the node G from broadcasting its already existing transactions tx6-tx20 to the node B, and simultaneously avoid the node G from broadcasting its already existing transactions tx6-tx30 to the node D/F, thereby realizing a great reduction in duplicate broadcasting of transactions.
It should be noted that the transactions in the transaction queue to be broadcasted usually originate from the transactions broadcasted by other nodes in the current blockchain network, and may also include the transactions generated by the current node itself, the transactions sent by the user side outside the chain, the transactions sent by the parallel chain node corresponding to the current node, and so on.
In addition, the trigger mechanism for the step S17 to take out the transaction from the transaction queue to be broadcast may be configured as any one of the following, or other different trigger mechanisms commonly used in the art, according to actual requirements:
taking out a plurality of transactions when the transaction queue to be broadcasted is monitored to be a non-empty queue;
taking out a plurality of transactions regularly;
and taking out a plurality of transactions when the number of the transactions in the transaction queue to be broadcasted is not less than a certain threshold value.
The transaction configuration quantity limit may also be fetched from the transaction queue to be broadcasted in step S17 according to actual requirements, or the quantity limit may not be configured:
may be configured to fetch all transactions in the transaction queue to be broadcast;
it may also be configured to take out from the pending broadcast transaction queue a number of transactions that are not greater than a certain threshold.
On one hand, the transaction broadcast filter storing the local filtering list of each transaction is configured, and the transaction broadcast filter is used for filtering before broadcasting multiple transactions to other nodes, so that the multiple transactions are broadcasted in single network communication with other nodes, the network communication frequency is greatly reduced, and the transaction broadcasting efficiency is improved; on the other hand, a broadcast filtering list of the transaction to be broadcast is generated according to each broadcast object node and the local filtering list of the transaction to be broadcast, the transaction to be broadcast and the corresponding broadcast filtering list are broadcast together, so that the node receiving the transaction can update the local filtering list of the transaction according to the broadcast filtering list, and repeated broadcast of the transaction is greatly reduced.
In a preferred embodiment, the block link points are executed through a resident subroutine loop in step S19.
Specifically, compared with the processing method of starting a new coroutine when broadcasting is needed and releasing the coroutine after broadcasting is finished, configuring a resident coroutine for executing the step S19 in a loop can effectively reduce the time consumption for starting and releasing the coroutine, thereby further improving the broadcasting efficiency of the transaction.
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 unit 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 (5)

1. A blockchain transaction batch broadcasting method, wherein a blockchain node is configured with a transaction broadcasting filter, and the method is applied to a blockchain node, and the method comprises the following steps:
receiving a first transaction sent by a first node and a first broadcast filtering list of the first transaction, and recording each second node recorded by the first node and the first broadcast filtering list into a local filtering list of the first transaction in the transaction broadcast filter;
carrying out legal verification and duplicate removal verification on the first transaction through a memory pool module of the current node:
if all the verification items pass, storing the first transaction into a transaction queue to be broadcasted;
taking out a plurality of transactions from the transaction queue to be broadcasted, and respectively generating a second broadcast filtering list of each second transaction according to each broadcast object node and a local filtering list of each second transaction in the plurality of transactions;
broadcasting the plurality of transactions to the broadcasting object nodes respectively by:
before broadcasting the multiple transactions to a third node, respectively judging whether a local filtering list of each second transaction comprises the third node:
if yes, removing the second transaction from the plurality of transactions;
and broadcasting the rest transactions after filtering and the corresponding second broadcast filtering list to the third node.
2. The method of claim 1, wherein said broadcasting said plurality of transactions to each of said broadcast object nodes is performed through a resident coroutine cycle by the following steps.
3. The method of claim 1, wherein the retrieving of the plurality of transactions from the transaction queue to be broadcast comprises:
and taking out a plurality of transactions which are not more than a first number from the transaction queue to be broadcasted.
4. A computer device, the device 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 recited in any of claims 1-3.
5. 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-3.
CN202110174639.1A 2021-02-07 2021-02-07 Block chain transaction batch broadcasting method, computer equipment and storage medium Pending CN112988414A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110174639.1A CN112988414A (en) 2021-02-07 2021-02-07 Block chain transaction batch broadcasting method, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110174639.1A CN112988414A (en) 2021-02-07 2021-02-07 Block chain transaction batch broadcasting method, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112988414A true CN112988414A (en) 2021-06-18

Family

ID=76347917

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110174639.1A Pending CN112988414A (en) 2021-02-07 2021-02-07 Block chain transaction batch broadcasting method, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112988414A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108876384A (en) * 2018-09-19 2018-11-23 联动优势科技有限公司 A kind of processing method and processing device of transaction data
CN110109741A (en) * 2019-05-09 2019-08-09 北京旷视科技有限公司 Management method, device, electronic equipment and the storage medium of cycle task
CN110650097A (en) * 2019-09-20 2020-01-03 腾讯科技(深圳)有限公司 Data broadcasting method and device and computer readable storage medium
CN110910139A (en) * 2019-12-04 2020-03-24 北汽蓝谷信息技术有限公司 Trusted hardware based on block chain and high-performance decentralized anonymous encryption algorithm

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108876384A (en) * 2018-09-19 2018-11-23 联动优势科技有限公司 A kind of processing method and processing device of transaction data
CN110109741A (en) * 2019-05-09 2019-08-09 北京旷视科技有限公司 Management method, device, electronic equipment and the storage medium of cycle task
CN110650097A (en) * 2019-09-20 2020-01-03 腾讯科技(深圳)有限公司 Data broadcasting method and device and computer readable storage medium
CN110910139A (en) * 2019-12-04 2020-03-24 北汽蓝谷信息技术有限公司 Trusted hardware based on block chain and high-performance decentralized anonymous encryption algorithm

Similar Documents

Publication Publication Date Title
CN109377232B (en) DAG-based block chain transaction sequencing method and device
CN110113408B (en) Block synchronization method, equipment and storage medium
CN108804545B (en) Distributed global unique ID generation method and device
CN111861471A (en) Parallel chain consensus method, parallel chain block rollback method, device and storage medium
CN110083745B (en) Data query method, device and storage medium
CN111324449A (en) Transaction storage and broadcasting method, device and storage medium of memory pool
CN111242780A (en) Method, device and storage medium for sending consensus transaction
EP2829972B1 (en) Method and apparatus for allocating stream processing unit
CN112965809A (en) Deep learning task processing system and method
CN112988414A (en) Block chain transaction batch broadcasting method, computer equipment and storage medium
CN111400043A (en) Transaction pool management method, device and storage medium
CN113094395A (en) Data query method, computer device and storage medium
CN110275780B (en) Method and apparatus for restricting flow
CN110807058B (en) Method and system for exporting data
CN109067864B (en) Notification message pushing method and device and electronic equipment
CN109146672B (en) Matching method and device based on production mode
CN109308219B (en) Task processing method and device and distributed computer system
CN108920144B (en) Message processing method and device
CN115563160A (en) Data processing method, data processing device, computer equipment and computer readable storage medium
CN112769583A (en) Block chain broadcasting method, computer device and storage medium
CN111292028A (en) Inventory information processing method and system, computer system and readable storage medium
CN111209311A (en) Method and apparatus for processing data
CN112702227B (en) Heartbeat event detection method, device, equipment and computer readable storage medium
CN108021688A (en) A kind of data processing method and device
CN110535922B (en) State data storage method and parallel chain block generation method

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