CN112036875A - Sequencing block transaction method and system - Google Patents

Sequencing block transaction method and system Download PDF

Info

Publication number
CN112036875A
CN112036875A CN201910475180.1A CN201910475180A CN112036875A CN 112036875 A CN112036875 A CN 112036875A CN 201910475180 A CN201910475180 A CN 201910475180A CN 112036875 A CN112036875 A CN 112036875A
Authority
CN
China
Prior art keywords
transaction
block
thread
list
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
CN201910475180.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.)
Benchainless Technology (Shenzhen) Co.,Ltd.
Original Assignee
Xiamen Instinct Blockchain 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 Xiamen Instinct Blockchain Technology Co ltd filed Critical Xiamen Instinct Blockchain Technology Co ltd
Priority to CN201910475180.1A priority Critical patent/CN112036875A/en
Publication of CN112036875A publication Critical patent/CN112036875A/en
Pending legal-status Critical Current

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/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a sequencing block transaction method, which comprises the steps of extracting transaction information after a block is received, circularly extracting feature points of transaction, grouping and removing duplication according to different feature points, extracting a list after duplication removal and circularly removing duplication; after the list circulation is finished, extracting a grouping list, uniformly distributing groups to each thread according to the number of threads, acquiring a grouping list on the corresponding thread and circulating the threads, wherein the threads are synchronously performed with the network; when the thread circulation is finished, the execution results of the corresponding threads are obtained and summarized, and the transaction processing of the receiving block is finished.

Description

Sequencing block transaction method and system
Technical Field
The present invention relates to the field of blockchain technology, and in particular, to a method and system for sequencing block transaction.
Background
Blockchains are an infrastructure of the application age, and the performance of blockchains determines the efficiency of the infrastructure, in which the first most important efficiency index is the transaction processing performance, so the processing speed of transactions determines the efficiency of the infrastructure. In practical applications, increasing the transaction processing speed brings a series of corollary problems, among which the problem caused by the inconsistency of the transaction processing speed between the block output and the block input is the most serious, because it may cause the blockchain to gradually cause the non-block output node to not keep up with the blockchain network under the condition that all nodes are configured identically, and even may cause the blockchain network to stop running, especially in the accounting type blockchain. Therefore, how to solve the problem of different speeds of the transactions in the block when the block is taken out and when the block is taken in is an urgent problem to be solved.
Disclosure of Invention
The invention aims to provide a sequencing block transaction method and a sequencing block transaction system, which have more processing points than a block output point when receiving the block, so that a plurality of concurrent processing points can be realized, the speed when receiving the block exceeds the speed when outputting the block, and the problem that the synchronization cannot be kept up due to the performance problem among nodes with the same configuration is solved.
A method of sequencing block transactions including receiving a block, extracting and processing transactions, and performing transaction grouping, the transaction method comprising:
s1: after receiving the block, extracting transaction information, circularly extracting feature points of the transaction, grouping and removing the duplicate of transaction types according to different feature points, extracting a list after removing the duplicate and circularly removing the duplicate;
s2: after the list circulation is finished, extracting a grouping list, uniformly distributing groups to each thread according to the number of threads, acquiring a grouping list on the corresponding thread and circulating the threads, wherein the threads are synchronously performed with the network;
s3: and after the thread circulation is finished, acquiring and summarizing the execution results of the corresponding threads to finish the transaction processing of the receiving block.
Further, the characteristic points comprise transaction types, transaction senders and transaction receivers, and after the classification is carried out according to the transaction senders and the transaction receivers, the same senders and the same receivers are classified into groups with correlation, and the groups of different senders and receivers are classified into different groups.
Further, the process of the loop thread includes sending the packet list to the loading thread, looping the correspondingly loaded packet list, and obtaining and summarizing the execution result of the correspondingly loaded packet after the loop packet list is finished.
Further, the process of cycling the corresponding loaded grouping list includes extracting the transaction, analyzing the transaction body and executing the transaction command, wherein the transaction body analysis and the transaction command execution are on the corresponding threads.
The invention provides a sequencing block trading system based on the method, which comprises:
a transaction grouper: when the transaction grouping device is in the receiving block, the transaction grouping device extracts transaction information, performs grouping duplicate removal according to a sender, a receiver and a transaction type of each transaction, acquires a grouping list and circulates, and extracts a grouped list after list circulation is completed;
a transaction processor: used for processing transactions according to a specific sequence, calculating the grouping quantity and the thread quantity after obtaining the grouped list, obtaining and summarizing a thread circulation grouping list and a grouping execution result through a circulation thread, obtaining and summarizing the thread execution result after finishing the thread circulation,
the sequencing block transaction system includes, but is not limited to, transaction groupers and transaction processors that are cross-meshed with each other.
Further, the transaction grouper includes:
a transaction extraction module: the block transaction analysis buffer is used for extracting transactions from the received blocks and putting the transactions into the transaction analysis buffer for block transaction association analysis;
a relationship analysis module: the classification comprises a transaction type classification, a sender classification and a receiver classification, wherein after classification, the same sender and receiver are classified into groups with correlation, and different senders and receivers are classified into different groups;
the transaction combination module: and the system is used for recombining the transactions according to the classification relation, and comprises an analysis result of the extraction relation analysis module, and a transaction queue is recombined according to the marked transactions with the association relation for processing by a subsequent transaction processor.
Further, the transaction processor includes:
a multithreading management module: the method comprises the steps that the number of threads capable of processing transactions in parallel is distributed according to the grouping condition of the transactions and the number of CPUs of nodes, when the number of groups of the transactions exceeds the number of threads of the CPUs, the number of threads executed by the transactions is created according to the number of the threads of the CPUs, the threads are recycled and created, and the grouped transaction sequence is put into the threads;
a transaction execution module: the system comprises a thread manager, a multithread management module and a result collection module, wherein the thread manager is used for creating a thread, analyzing a transaction body and executing a transaction command, the analyzing and executing process is operated in the thread created by the thread manager, an execution result is returned to the multithread management module, and the multithread management module sends the result to the result collection module;
a result collection module: and the system is used for receiving the results generated by the transaction execution module and summarizing all the transaction execution results.
Further, the result collection module includes, in the summary process:
when some special error results may affect the transaction exception of the continuous execution of the whole transaction, the result collection module sends a notification to the multithreading management module, and requests the multithreading management module to stop all subsequent operations on the corresponding thread and close the transaction execution module on the corresponding thread.
The invention starts from solving the problem that the speed of the transaction in the block is different when the block is output and received, ensures the normal operation of the block chain, and respectively solves the problem that the speed of the block transaction is consistent when the block is output and the block is received, or preferentially ensures that the block receiving speed is higher than the block outputting speed when the block transaction is inconsistent, so that the problem that the block network cannot be followed due to the performance problem can be ensured to be generated between the nodes with the same performance configuration.
Drawings
FIG. 1 is a flow chart illustrating a method for sequencing block transaction according to the present invention;
FIG. 2 is a flow chart of the operation of the sequenced block transaction system transaction grouper of the present invention;
figure 3 is a flow chart of the operation of the transaction processor of the sequenced block transaction system as referred to in the present invention,
wherein: 101 a transaction extraction module; 102 a transaction analysis module; 103 a transaction combination module; 201 a multithread management module; 202 a transaction execution module; 203 result collection module
Detailed Description
The invention is described in further detail below with reference to the figures and specific examples. It should be noted that the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
As shown in fig. 1-3, in order to ensure that the speeds of the outgoing block and the receiving block are consistent, the present invention needs to process both the outgoing block and the receiving block by the same method, and to ensure that the speed of the receiving block is greater than the speed of the outgoing block, a processing method that can increase the speed in the processing of the receiving block needs to be ensured, and a low-level method that gives a block speed reduction is not used, because this not only cannot solve the synchronization problem, but also will significantly reduce the performance of the whole block chain network. By combining the common requirements of the two, all the requirements can be covered only by realizing that the block receiving speed is greater than the block outputting speed, and the target is realized.
To achieve this, the process of sequencing block transactions includes:
s1: after receiving the block, extracting transaction information, circularly extracting feature points of the transaction, grouping and removing the duplicate of transaction types according to different feature points, extracting a list after removing the duplicate and circularly removing the duplicate;
s2: after the list circulation is finished, extracting a grouping list, uniformly distributing groups to each thread according to the number of threads, acquiring a grouping list on the corresponding thread and circulating the threads, wherein the threads are synchronously performed with the network;
s3: and after the thread circulation is finished, acquiring and summarizing the execution results of the corresponding threads to finish the transaction processing of the receiving block.
The characteristic points comprise transaction types, transaction senders and transaction receivers, the nodes are classified into groups with correlation for the same senders and receivers after being classified according to the transaction senders and the transaction receivers, and the groups of different senders and receivers are classified into different groups.
The circulation thread process comprises the steps of sending and loading the packet list into the thread, circulating the correspondingly loaded packet list, and obtaining and summarizing the execution result of the correspondingly loaded packet after the circulation of the packet list is finished.
And the process of cycling the corresponding loaded grouping list comprises the steps of extracting the transaction, analyzing the transaction body and executing the transaction command, wherein the transaction body is analyzed and the transaction command is executed on the corresponding thread.
In the invention, aiming at the confirmation of the transaction in the block when the block is received, the processing speed is improved by adopting a mode of grouping the whole transactions in advance. In the block-out process, since the node does not know which transactions can be processed in the current block, when processing each transaction, whether the transaction is processed by the related party of the current transaction or not is judged, if so, the related party of the current transaction waits, and if not, the related party of the current transaction is directly processed. In the invention, the processing speed of receiving the block is improved by omitting the judgment time and reducing the waiting time.
In the process of realizing that the block receiving speed is greater than the block outputting speed, the key of the processing is that more processing points are arranged during the block receiving than the block outputting, so that a plurality of concurrences can be realized, and the block receiving speed is higher than the block outputting speed. And the block receiving speed is faster than the block outputting speed under the same equipment as long as the transaction processing speed is optimized for the part of the excess known information because the block is determined already when the block is received.
In order to implement the above described sequence block transaction method, the present invention further provides a sequence block transaction system, which specifically includes two logic units, the first logic unit is a transaction grouper, and the second logic unit is a transaction processor.
In the transaction grouper, known transactions are grouped and only work when receiving blocks, and the blocks are not passed through the transaction grouper when being output. The transaction grouping device comprises three modules, namely a transaction extraction module 101, a relation analysis module 102 and a transaction combination module 103.
The transaction extracting module 101 is configured to extract transactions from the received block, and place the extracted transactions into a transaction analysis buffer for use in the subsequent transaction association analysis. In the relation analysis module 102, the classification related to the transaction is extracted, including a transaction type classification, a sender and a receiver classification, the classification is carried out on the same sender and receiver, the same sender and receiver are classified into groups with correlation, and the groups of different senders and receivers are classified into different groups. The transaction combination module 103 is configured to recombine the transactions according to the classification relationship, including extracting the analysis result of the relationship analysis module 102, and recombining the transaction queue according to the transactions marked therein and having the relationship, for processing by the subsequent transaction processing unit.
In the transaction processor, for processing transactions in a particular order. The system comprises three modules, namely a multithreading management module 201, a transaction execution module 202 and a result collection module 203. In the multithread management module 201, the thread number capable of processing transaction in parallel is allocated according to the grouping condition of transaction and the number of CPUs of the nodes, when the number of the transaction groups exceeds the number of the threads of the CPUs, the number of the threads for executing transaction is created according to the number of the threads of the CPUs, and is recovered and created when appropriate, and the grouped transaction sequence is put into the threads. In the transaction execution module 202, it is used to parse the transaction body and execute the transaction command, this parsing and execution process is in the thread created by the thread manager, and its execution result will be returned to the multithread management module 201, and the result will be sent to the result collection module 203 by it. In the result collecting module 203, for receiving the results generated by the transaction executing module 202 and aggregating the results of all transaction executions, for some special transaction exceptions that may affect the overall transaction to continue execution, the result collecting module 203 will send a notification to the multithread managing module 201 in time to request it to immediately stop all subsequent things of the thread and close the transaction executing module 202 in the thread.
The invention aims to solve the problem caused by different speeds of block outgoing and block receiving of transactions in a block, and from the aim, in order to ensure normal operation of a block chain, the invention respectively solves the problem that the speeds of block outgoing and block receiving of block transactions are kept consistent or the speed of block receiving is preferentially ensured to be higher than the speed of block outgoing when the speeds are inconsistent, so that the problem that a block network cannot be followed due to performance problems among nodes with the same performance configuration can be ensured.
The above-mentioned embodiments are only preferred embodiments of the present invention, and do not limit the technical scope of the present invention, so that the changes and modifications made by the claims and the specification of the present invention should fall within the scope of the present invention.

Claims (8)

1. A method of sequencing block transactions including receiving a block, extracting and processing transactions, and performing transaction grouping, the method comprising:
s1: after receiving the block, extracting transaction information, circularly extracting feature points of the transaction, grouping and removing the duplicate of transaction types according to different feature points, extracting a list after removing the duplicate and circularly removing the duplicate;
s2: after the list circulation is finished, extracting a grouping list, uniformly distributing groups to each thread according to the number of threads, acquiring a grouping list on the corresponding thread and circulating the threads, wherein the threads are synchronously performed with the network;
s3: and after the thread circulation is finished, acquiring and summarizing the execution results of the corresponding threads to finish the transaction processing of the receiving block.
2. A method for sequencing block trading according to claim 1, wherein said signature points include a trade type, a trade sender and a trade receiver, and are classified according to the trade sender and the trade receiver, and then are classified into groups having correlation with the same sender and receiver, and the groups of different senders and receivers are classified into different groups.
3. A method for sequencing block transactions as in claim 1 wherein said looping thread process includes sending a list of packets to a load thread, looping through the list of correspondingly loaded packets, and upon completion of looping through the list of correspondingly loaded packets, obtaining and summarizing the results of execution of the correspondingly loaded packets.
4. A method for sequencing block transactions according to claim 3 and wherein said looping through said loaded packet list includes fetching transactions, parsing transaction bodies and executing transaction commands, said parsing transaction bodies and executing transaction commands being on corresponding threads.
5. A sequenced block transaction system, said system comprising:
a transaction grouper: when the transaction grouping device is in the receiving block, the transaction grouping device extracts transaction information, performs grouping duplicate removal according to a sender, a receiver and a transaction type of each transaction, acquires a grouping list and circulates, and extracts a grouped list after list circulation is completed;
a transaction processor: used for processing transactions according to a specific sequence, calculating the grouping quantity and the thread quantity after obtaining the grouped list, obtaining and summarizing a thread circulation grouping list and a grouping execution result through a circulation thread, obtaining and summarizing the thread execution result after finishing the thread circulation,
the sequencing block transaction system includes, but is not limited to, transaction groupers and transaction processors that are cross-meshed with each other.
6. A sequencing block transaction system according to claim 5, wherein said transaction grouper comprises:
a transaction extraction module: the block transaction analysis buffer is used for extracting transactions from the received blocks and putting the transactions into the transaction analysis buffer for block transaction association analysis;
a relationship analysis module: the classification comprises a transaction type classification, a sender classification and a receiver classification, wherein after classification, the same sender and receiver are classified into groups with correlation, and different senders and receivers are classified into different groups;
the transaction combination module: and the system is used for recombining the transactions according to the classification relation, and comprises an analysis result of the extraction relation analysis module, and a transaction queue is recombined according to the marked transactions with the association relation for processing by a subsequent transaction processor.
7. A sequencing block transaction system according to claim 5, wherein said transaction processor comprises:
a multithreading management module: the method comprises the steps that the number of threads capable of processing transactions in parallel is distributed according to the grouping condition of the transactions and the number of CPUs of nodes, when the number of groups of the transactions exceeds the number of threads of the CPUs, the number of threads executed by the transactions is created according to the number of the threads of the CPUs, the threads are recycled and created, and the grouped transaction sequence is put into the threads;
a transaction execution module: the system comprises a thread manager, a multithread management module and a result collection module, wherein the thread manager is used for creating a thread, analyzing a transaction body and executing a transaction command, the analyzing and executing process is operated in the thread created by the thread manager, an execution result is returned to the multithread management module, and the multithread management module sends the result to the result collection module;
a result collection module: and the system is used for receiving the results generated by the transaction execution module and summarizing all the transaction execution results.
8. A sequencing block transaction system according to claim 7, wherein said result collection module includes in the aggregation process:
when some special error results may affect the transaction exception of the continuous execution of the whole transaction, the result collection module sends a notification to the multithreading management module, and requests the multithreading management module to stop all subsequent operations on the corresponding thread and close the transaction execution module on the corresponding thread.
CN201910475180.1A 2019-06-03 2019-06-03 Sequencing block transaction method and system Pending CN112036875A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910475180.1A CN112036875A (en) 2019-06-03 2019-06-03 Sequencing block transaction method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910475180.1A CN112036875A (en) 2019-06-03 2019-06-03 Sequencing block transaction method and system

Publications (1)

Publication Number Publication Date
CN112036875A true CN112036875A (en) 2020-12-04

Family

ID=73575760

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910475180.1A Pending CN112036875A (en) 2019-06-03 2019-06-03 Sequencing block transaction method and system

Country Status (1)

Country Link
CN (1) CN112036875A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107678865A (en) * 2017-09-20 2018-02-09 中国银行股份有限公司 The verification method and system of block chain based on transaction packet
US20180293556A1 (en) * 2017-04-05 2018-10-11 Samsung Sds Co., Ltd. Method and system for processing blockchain-based real-time transaction
CN109427012A (en) * 2017-08-22 2019-03-05 汇链丰(北京)科技有限公司 A kind of transaction and verification method based on block chain
CN109658249A (en) * 2018-12-27 2019-04-19 链极智能科技(上海)有限公司 A kind of block chain performance optimization method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180293556A1 (en) * 2017-04-05 2018-10-11 Samsung Sds Co., Ltd. Method and system for processing blockchain-based real-time transaction
CN109427012A (en) * 2017-08-22 2019-03-05 汇链丰(北京)科技有限公司 A kind of transaction and verification method based on block chain
CN107678865A (en) * 2017-09-20 2018-02-09 中国银行股份有限公司 The verification method and system of block chain based on transaction packet
CN109658249A (en) * 2018-12-27 2019-04-19 链极智能科技(上海)有限公司 A kind of block chain performance optimization method

Similar Documents

Publication Publication Date Title
CN106802826B (en) Service processing method and device based on thread pool
CN107688496B (en) Task distributed processing method and device, storage medium and server
CN110908788B (en) Spark Streaming based data processing method and device, computer equipment and storage medium
CN103412786B (en) High performance server architecture system and data processing method thereof
CN109445944A (en) A kind of network data acquisition processing system and its method based on DPDK
CN112148455B (en) Task processing method, device and medium
CN111078436B (en) Data processing method, device, equipment and storage medium
CN107623731A (en) A kind of method for scheduling task, client, service cluster and system
CN115129480B (en) Scalar processing unit and access control method thereof
CN110221914B (en) File processing method and device
CN112581289A (en) Data processing method, device, equipment and computer readable storage medium
CN110516738B (en) Distributed comparison clustering method and device, electronic equipment and storage medium
CN112422448A (en) FPGA accelerator card network data transmission method and related components
CN113626173B (en) Scheduling method, scheduling device and storage medium
CN114157500A (en) Data packet processing method, electronic device and storage medium
CN114529413A (en) Processing method of block chain transaction, block chain node and electronic equipment
CN113672410A (en) Data processing method and electronic device
CN110502337B (en) Optimization system for shuffling stage in Hadoop MapReduce
CN117472517A (en) Method for distributed processing of FTP files based on Flink
CN112380001A (en) Log output method, load balancing device and computer readable storage medium
CN112036875A (en) Sequencing block transaction method and system
CN114756629B (en) Multi-source heterogeneous data interaction analysis engine and method based on SQL
CN114997418A (en) Data processing method and device, electronic equipment and storage medium
CN113839839B (en) Method and system for testing multi-thread concurrent communication
CN112905351B (en) GPU and CPU load scheduling method, device, equipment and 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
TA01 Transfer of patent application right

Effective date of registration: 20210401

Address after: Room 2201, 703c, Desai science and technology building, 9789 Shennan Avenue, high tech Zone community, Yuehai street, Nanshan District, Shenzhen, Guangdong 518000

Applicant after: Benchainless Technology (Shenzhen) Co.,Ltd.

Address before: 361006 unit 202, No.50, anling 2nd Road, Huli District, Xiamen City, Fujian Province

Applicant before: XIAMEN INSTINCT BLOCKCHAIN TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right