CN113438092A - Transaction broadcasting method and system - Google Patents

Transaction broadcasting method and system Download PDF

Info

Publication number
CN113438092A
CN113438092A CN202110731113.9A CN202110731113A CN113438092A CN 113438092 A CN113438092 A CN 113438092A CN 202110731113 A CN202110731113 A CN 202110731113A CN 113438092 A CN113438092 A CN 113438092A
Authority
CN
China
Prior art keywords
transaction
node
hash
information
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.)
Granted
Application number
CN202110731113.9A
Other languages
Chinese (zh)
Other versions
CN113438092B (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.)
Shanghai Wanxiang Blockchain Inc
Original Assignee
Shanghai Wanxiang Blockchain Inc
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 Shanghai Wanxiang Blockchain Inc filed Critical Shanghai Wanxiang Blockchain Inc
Priority to CN202110731113.9A priority Critical patent/CN113438092B/en
Publication of CN113438092A publication Critical patent/CN113438092A/en
Application granted granted Critical
Publication of CN113438092B publication Critical patent/CN113438092B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/1854Arrangements for providing special services to substations for broadcast or conference, e.g. multicast with non-centralised forwarding system, e.g. chaincast
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/123Applying verification of the received information received data contents, e.g. message integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/126Applying verification of the received information the source of the received data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Abstract

The invention provides a transaction broadcasting method and a system, which comprises the following validity checking steps: after receiving the transaction sent by the user, the node checks the validity of the transaction; a judging step: judging whether the transaction exists in the node, and if so, ignoring the transaction; if not, entering a transaction source judgment step; a step of judging transaction sources: judging whether the transaction source is a user or other nodes, and if the judgment result is that the transaction source is the user, broadcasting the complete information of the transaction to other consensus nodes according to the information of the consensus nodes; and if the judgment result is other nodes, broadcasting the hash of the transaction to other consensus nodes according to the information of the consensus nodes. The invention ensures that each consensus node can only receive the complete information of one transaction as far as possible on the premise of ensuring that the complete information of the transaction is rapidly transmitted among the consensus nodes. By broadcasting the transaction and the transaction hash in stages, the transmission of repeated transaction information in the network is greatly reduced, and the influence of the transaction broadcast on block consensus is reduced.

Description

Transaction broadcasting method and system
Technical Field
The present invention relates to the field of blockchains, and in particular, to a transaction broadcasting method and system.
Background
Under the high concurrency condition, the occupation of the transmission bandwidth by the transaction broadcast influences the efficiency of inter-node block consensus to a certain extent, thereby reducing the transaction processing efficiency of the whole network. And by broadcasting the transaction and the transaction hash in stages, the transmission of repeated transaction information in the network can be greatly reduced. The difficulties existing in the scheme are as follows: ensuring the rapid propagation of transaction information between nodes and reducing the propagation of repeated transactions in the network.
The invention patent with patent document CN110443610A discloses a method, system, device and storage medium for reducing repeated broadcasting of transaction groups, and belongs to the technical field of block chains. The method comprises the steps of receiving a transaction group, recording an identification which is enough to uniquely identify the transaction group and a node name which is used for sending the transaction group to a first block chain node; judging whether a transaction group exists or not; if so, broadcasting the transaction group to at least one blockchain node connected with the first blockchain node except the node sending the transaction group to the first blockchain node; if not, verifying whether the transaction group passes; if not, no processing is carried out; if so, broadcasting the transaction group to at least one blockchain node connected to the first blockchain node, except for the node that sent the transaction group to the first blockchain node. Aiming at the technical problem that one node receives the same complete transaction group for multiple times and occupies unnecessary network bandwidth, the method and the device reduce repeated broadcasting of the transaction group and reduce occupation of block chain network bandwidth resources.
The patent document CN110336676A discloses a method, a system, a device and a storage medium for broadcasting blockchain transactions, and belongs to the technical field of blockchain. When the second block chain link point generates a first transaction and the round i is set to be zero, broadcasting the first transaction and the round i to the block chain node connected with the second block chain link point; after the second block chain node receives a second transaction and the Turn i sent by the first block chain node, judging whether i is less than Turn is true; if yes, i is i +1, and a second transaction and a turn i are broadcasted to a block chain node connected with a second block chain node; if not, broadcasting the second transaction hash value, or broadcasting part of bytes of the second transaction hash value to the block chain nodes connected with the second block chain link points. The method aims to solve the technical problem that in the prior art, one node of the transaction receives the same complete transaction content for multiple times and occupies network bandwidth. According to the scheme, after a certain turn of broadcasting, the file size of the broadcast transaction can be reduced, so that the blockchain network works stably, and the bandwidth occupation of the blockchain network is reduced.
But both of the above schemes lack the processing of the node to receive the identity broadcast by the other node.
Disclosure of Invention
In view of the defects in the prior art, the present invention provides a transaction broadcasting method and system.
The invention provides a transaction broadcasting method, which comprises the following steps:
and (3) validity checking: after receiving the transaction sent by the user, the node checks the validity of the transaction;
a judging step: judging whether the transaction exists in the node, and if so, ignoring the transaction; if the transaction does not exist, entering a transaction source judgment step;
a step of judging transaction sources: judging whether the transaction source is a user or other nodes, and if the judgment result is that the transaction source is the user, broadcasting the complete information of the transaction to other consensus nodes according to the information of the consensus nodes; and if the judgment result is other nodes, broadcasting the hash of the transaction to other consensus nodes according to the information of the consensus nodes.
Preferably, the method further comprises a hash judgment step: the node receives the transaction hash broadcast by other nodes, judges whether the node has a transaction corresponding to the transaction hash, and ignores the transaction if the judgment result is yes; and if the judgment result is negative, storing the transaction hash and the node information for sending the transaction hash in a transaction list to be requested.
Preferably, the method further comprises the step of hash extraction: extracting transaction hashes meeting set conditions, judging whether complete information of the transaction exists locally at the node according to the transaction hashes, and if so, ignoring the transaction hashes; and if the judgment result is negative, requesting the complete information of the transaction to the node sending the transaction hash.
Preferably, the setting conditions include: a transaction trigger time.
Preferably, the method further comprises the step of integrating: when transaction complete information is requested, multiple transaction hashes are integrated into one request.
The invention provides a transaction broadcasting system, which comprises the following modules:
a validity checking module: after receiving the transaction sent by the user, the node checks the validity of the transaction;
a judging module: judging whether the transaction exists in the node, and if so, ignoring the transaction; if the transaction does not exist, entering a transaction source judgment module;
a transaction source judgment module: judging whether the transaction source is a user or other nodes, and if the judgment result is that the transaction source is the user, broadcasting the complete information of the transaction to other consensus nodes according to the information of the consensus nodes; and if the judgment result is other nodes, broadcasting the hash of the transaction to other consensus nodes according to the information of the consensus nodes.
Preferably, the method further comprises the step of: the node receives the transaction hash broadcast by other nodes, judges whether the node has a transaction corresponding to the transaction hash, and ignores the transaction if the judgment result is yes; and if the judgment result is negative, storing the transaction hash and the node information for sending the transaction hash in a transaction list to be requested.
Preferably, the hash extraction module is further included: extracting transaction hashes meeting set conditions, judging whether complete information of the transaction exists locally at the node according to the transaction hashes, and if so, ignoring the transaction hashes; and if the judgment result is negative, requesting the complete information of the transaction to the node sending the transaction hash.
Preferably, the setting conditions include: a transaction trigger time.
Preferably, the system further comprises an integration module: when transaction complete information is requested, multiple transaction hashes are integrated into one request.
Compared with the prior art, the invention has the following beneficial effects:
1. the invention ensures that each consensus node can only receive the complete information of one transaction as far as possible on the premise of ensuring that the complete information of the transaction is rapidly transmitted among the consensus nodes.
2. The invention greatly reduces the transmission of repeated transaction information in the network by broadcasting transaction and transaction hash in stages, thereby reducing the influence of transaction broadcast on block consensus.
3. The received transaction hashes are processed in stages, the received node information of the transaction hashes is combined, the same node is integrated to obtain a request of complete transaction through the transaction hashes, a plurality of different transaction hashes are sent at one time, and the request times of the complete transaction are reduced; under normal conditions, the request of multiple complete transactions is not made to the same transaction hash at the same time.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments with reference to the following drawings:
FIG. 1 is a flow chart illustrating the steps of a transaction broadcasting method according to the present invention.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will assist those skilled in the art in further understanding the invention, but are not intended to limit the invention in any way. It should be noted that it would be obvious to those skilled in the art that various changes and modifications can be made without departing from the spirit of the invention. All falling within the scope of the present invention.
As shown in fig. 1, the present invention provides a practical transaction broadcasting scheme, which mainly includes a transaction broadcasting module. The transaction broadcasting module comprises: broadcast transaction, broadcast transaction hash, request for complete transaction information according to transaction hash, and the like.
In a federation chain scenario, the number of consensus nodes tends to be limited, and the consensus node information is queryable. After a node receives a transaction sent by a user, the validity of the transaction is checked firstly, if the transaction is valid and the transaction does not exist in a local transaction pool and a local block of the node, the current node broadcasts the transaction to other nodes through a transaction broadcasting module, when the transaction broadcasting module of the node receives the transaction sent by the user, common identification nodes are screened out from all the nodes linked with the current node, and complete transaction information is broadcasted to the common identification nodes
After receiving the transactions broadcasted by other nodes, the node judges whether the transaction exists locally or not through transaction hash, if so, the transaction is ignored, otherwise, part of consensus nodes are randomly screened out from all nodes which are kept to be linked with the current node, and the hash of the transaction is sent to the screened consensus nodes;
when the node receives transaction hashes sent by other common identification nodes, whether the transaction exists locally or not is judged according to the transaction hashes, if yes, the transaction hashes are ignored, otherwise, the transaction hashes and the node information for sending the transaction hashes are stored in a set of transactions to be requested, the transaction broadcasting module is responsible for regularly scanning the set of transactions to be requested, the transaction hashes meeting conditions (which can be waiting for sufficient time to wait for complete transaction information broadcasted by other nodes) are extracted, whether the complete information of the transaction exists locally or not is judged according to the transaction hashes again, if yes, the transaction hashes are ignored, otherwise, the complete information of the transaction is requested to the node for sending the transaction hashes.
The transaction broadcasting module can integrate a plurality of transaction hashes into a request when transaction complete information is requested; when transaction complete information is requested, a strategy of timeout retry can be added for each transaction, and the transaction complete information is requested from other optional nodes.
Further, the application scenario of the present invention is biased to the alliance chain scenario, and the nodes are divided into the consensus node and the data backup node (not participating in the block consensus), so that the purpose of broadcasting the transaction between the consensus nodes is to broadcast the transaction faster during the transaction broadcasting, and the number of times of receiving the same complete transaction by the node is reduced as much as possible.
First, the present invention describes in detail the processing flow after the current node receives the transaction unique identifier broadcast by other nodes.
When the node receives the transaction unique identification information (incomplete transaction information) broadcast by other common identification nodes, judging whether the transaction exists locally according to the transaction unique identification information, if so, ignoring the transaction unique identification information, otherwise, storing the transaction unique identification information, the node information for sending the transaction unique identification information and the timestamp in a transaction key value set to be requested (taking the transaction unique identification information as a key), if so, updating the value corresponding to the transaction unique identification information in the set, and adding the node information into the original data.
The transaction broadcasting module is responsible for regularly scanning a transaction key value set to be requested, taking out transaction unique identification information meeting a condition (which can be waiting for sufficient time to wait for complete transaction information broadcasted by other nodes) from the transaction key value set to be requested, temporarily storing related content of the transaction unique identification in a queued node key value set (the key is a node, and the value is a list of the transaction unique identification information to be sent to the node) according to the node information, and then traversing the queued node key value set to create a coroutine for each node to send the list of the transaction unique identification information to the corresponding node to obtain the complete information of the transaction.
The invention links each node newly added into the block chain network and the related information data, subsequently can obtain the node information and the attribute in the block chain network, and can judge whether the node is a common identification node or a data backup node according to the node attribute. When the transaction needs to be broadcasted to other nodes, the common node is preferentially selected from the node information list maintained in the node to broadcast the message.
Those skilled in the art will appreciate that, in addition to implementing the system and its various devices, modules, units provided by the present invention as pure computer readable program code, the system and its various devices, modules, units provided by the present invention can be fully implemented by logically programming method steps in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Therefore, the system and various devices, modules and units thereof provided by the invention can be regarded as a hardware component, and the devices, modules and units included in the system for realizing various functions can also be regarded as structures in the hardware component; means, modules, units for performing the various functions may also be regarded as structures within both software modules and hardware components for performing the method.
The foregoing description of specific embodiments of the present invention has been presented. It is to be understood that the present invention is not limited to the specific embodiments described above, and that various changes or modifications may be made by one skilled in the art within the scope of the appended claims without departing from the spirit of the invention. The embodiments and features of the embodiments of the present application may be combined with each other arbitrarily without conflict.

Claims (10)

1. A transaction broadcasting method, comprising the steps of:
and (3) validity checking: after receiving the transaction sent by the user, the node checks the validity of the transaction;
a judging step: judging whether the transaction exists in the node, and if so, ignoring the transaction; if the transaction does not exist, entering a transaction source judgment step;
a step of judging transaction sources: judging whether the transaction source is a user or other nodes, and if the judgment result is that the transaction source is the user, broadcasting the complete information of the transaction to other consensus nodes according to the information of the consensus nodes; and if the judgment result is other nodes, broadcasting the hash of the transaction to other consensus nodes according to the information of the consensus nodes.
2. The transaction broadcasting method according to claim 1, further comprising a hash determination step of: the node receives the transaction hash broadcast by other nodes, judges whether the node has a transaction corresponding to the transaction hash, and ignores the transaction if the judgment result is yes; and if the judgment result is negative, storing the transaction hash and the node information for sending the transaction hash in a transaction list to be requested.
3. The transaction broadcasting method according to claim 2, further comprising a hash extraction step of: extracting transaction hashes meeting set conditions, judging whether complete information of the transaction exists locally at the node according to the transaction hashes, and if so, ignoring the transaction hashes; and if the judgment result is negative, requesting the complete information of the transaction to the node sending the transaction hash.
4. The transaction broadcasting method according to claim 3, wherein the setting condition includes: a transaction trigger time.
5. The transaction broadcasting method according to claim 1, further comprising the step of integrating: when transaction complete information is requested, multiple transaction hashes are integrated into one request.
6. A transaction broadcasting system, comprising:
a validity checking module: after receiving the transaction sent by the user, the node checks the validity of the transaction;
a judging module: judging whether the transaction exists in the node, and if so, ignoring the transaction; if the transaction does not exist, entering a transaction source judgment module;
a transaction source judgment module: judging whether the transaction source is a user or other nodes, and if the judgment result is that the transaction source is the user, broadcasting the complete information of the transaction to other consensus nodes according to the information of the consensus nodes; and if the judgment result is other nodes, broadcasting the hash of the transaction to other consensus nodes according to the information of the consensus nodes.
7. The transaction broadcasting system of claim 6, further comprising a hash determination module: the node receives the transaction hash broadcast by other nodes, judges whether the node has a transaction corresponding to the transaction hash, and ignores the transaction if the judgment result is yes; and if the judgment result is negative, storing the transaction hash and the node information for sending the transaction hash in a transaction list to be requested.
8. The transaction broadcasting system of claim 7, further comprising a hash extraction module: extracting transaction hashes meeting set conditions, judging whether complete information of the transaction exists locally at the node according to the transaction hashes, and if so, ignoring the transaction hashes; and if the judgment result is negative, requesting the complete information of the transaction to the node sending the transaction hash.
9. The transaction broadcasting system according to claim 8, wherein the setting condition includes: a transaction trigger time.
10. The transaction broadcasting system of claim 6, further comprising an integration module: when transaction complete information is requested, multiple transaction hashes are integrated into one request.
CN202110731113.9A 2021-06-29 2021-06-29 Transaction broadcasting method and system Active CN113438092B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110731113.9A CN113438092B (en) 2021-06-29 2021-06-29 Transaction broadcasting method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110731113.9A CN113438092B (en) 2021-06-29 2021-06-29 Transaction broadcasting method and system

Publications (2)

Publication Number Publication Date
CN113438092A true CN113438092A (en) 2021-09-24
CN113438092B CN113438092B (en) 2022-03-01

Family

ID=77757833

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110731113.9A Active CN113438092B (en) 2021-06-29 2021-06-29 Transaction broadcasting method and system

Country Status (1)

Country Link
CN (1) CN113438092B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114826801A (en) * 2022-03-03 2022-07-29 杭州复杂美科技有限公司 Block broadcasting method, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109586934A (en) * 2018-12-27 2019-04-05 链极智能科技(上海)有限公司 A kind of block chain bottom-layer network transaction Synchronous fluorimetry method
CN110430066A (en) * 2019-07-15 2019-11-08 杭州复杂美科技有限公司 For reducing method, equipment and the storage medium of block chain transaction repeated broadcast
CN110650097A (en) * 2019-09-20 2020-01-03 腾讯科技(深圳)有限公司 Data broadcasting method and device and computer readable storage medium
US20200151840A1 (en) * 2018-11-14 2020-05-14 Micah McCrary-Dennis Peer-to-peer scholarship, mentorship, and apprenticeship distributed application, method, and system using a blockchain
CN111464630A (en) * 2020-03-31 2020-07-28 杭州复杂美科技有限公司 Transaction broadcasting method, apparatus and storage medium
CN112929432A (en) * 2021-02-01 2021-06-08 杭州复杂美科技有限公司 Broadcasting method, equipment and storage medium based on repeated broadcasting history

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200151840A1 (en) * 2018-11-14 2020-05-14 Micah McCrary-Dennis Peer-to-peer scholarship, mentorship, and apprenticeship distributed application, method, and system using a blockchain
CN109586934A (en) * 2018-12-27 2019-04-05 链极智能科技(上海)有限公司 A kind of block chain bottom-layer network transaction Synchronous fluorimetry method
CN110430066A (en) * 2019-07-15 2019-11-08 杭州复杂美科技有限公司 For reducing method, equipment and the storage medium of block chain transaction repeated broadcast
CN110650097A (en) * 2019-09-20 2020-01-03 腾讯科技(深圳)有限公司 Data broadcasting method and device and computer readable storage medium
CN111464630A (en) * 2020-03-31 2020-07-28 杭州复杂美科技有限公司 Transaction broadcasting method, apparatus and storage medium
CN112929432A (en) * 2021-02-01 2021-06-08 杭州复杂美科技有限公司 Broadcasting method, equipment and storage medium based on repeated broadcasting history

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114826801A (en) * 2022-03-03 2022-07-29 杭州复杂美科技有限公司 Block broadcasting method, equipment and storage medium

Also Published As

Publication number Publication date
CN113438092B (en) 2022-03-01

Similar Documents

Publication Publication Date Title
CN107332876B (en) Method and device for synchronizing block chain state
CN109242500B (en) Block chain transaction validity verification method and device and storage medium
CN110784346B (en) Reputation value-based PBFT consensus system and method
WO2022188831A1 (en) Block consensus method based on blockchain, and related device
US11410171B2 (en) Blockchain consensus method and device and electronic equipment
CN113438092B (en) Transaction broadcasting method and system
CN114157672B (en) S-PBFT simplified consensus protocol operation and parallel optimization method based on PBFT
CN112818409A (en) Block generation method and consensus node
WO2023040453A1 (en) Transaction information processing method and apparatus
WO2023011019A1 (en) Blockchain-based data processing method and apparatus, device, readable storage medium and computer program product
CN110569395A (en) stable and reliable block chain Byzantine consensus process design method
CN110445843B (en) Parallel chain block pushing method, device and storage medium
CN116633942A (en) Bayesian-busy fault tolerance consensus method for high-speed response client
US8250140B2 (en) Enabling connections for use with a network
CN111241069B (en) Block chain-based data flattening method and system
CN111526165A (en) Consensus method and system in alliance chain
CN115037472B (en) Transaction processing method and system based on double-layer DAG consensus mechanism and service equipment
CN114266573A (en) Asynchronous processing method and system for block chain information
CN112258184B (en) Method, apparatus, electronic device and readable storage medium for freezing blockchain network
CN112463310B (en) Transaction data processing method, system, equipment and medium based on node segmentation
CN111917826A (en) PBFT consensus algorithm based on block chain intellectual property protection
CN112953733B (en) Data management block chain communication resource integration consensus method
JPH103418A (en) Data coincidence system between electronic computer systems
CN112488836B (en) Transaction transmitting method, device, electronic equipment and readable storage medium
CN115002111B (en) Block chain consensus method based on group tree structure

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