CN113810378B - Transaction preprocessing method based on consensus sequencing - Google Patents

Transaction preprocessing method based on consensus sequencing Download PDF

Info

Publication number
CN113810378B
CN113810378B CN202110952352.7A CN202110952352A CN113810378B CN 113810378 B CN113810378 B CN 113810378B CN 202110952352 A CN202110952352 A CN 202110952352A CN 113810378 B CN113810378 B CN 113810378B
Authority
CN
China
Prior art keywords
transaction
block
node
sequencing
transaction information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110952352.7A
Other languages
Chinese (zh)
Other versions
CN113810378A (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.)
Guangdong Zhongke Intelligent Blockchain Technology Co ltd
Original Assignee
Guangdong Zhongke Intelligent 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 Guangdong Zhongke Intelligent Blockchain Technology Co ltd filed Critical Guangdong Zhongke Intelligent Blockchain Technology Co ltd
Priority to CN202110952352.7A priority Critical patent/CN113810378B/en
Publication of CN113810378A publication Critical patent/CN113810378A/en
Application granted granted Critical
Publication of CN113810378B publication Critical patent/CN113810378B/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
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • 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
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Business, Economics & Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Marketing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a transaction preprocessing method based on consensus sequencing, which comprises the following steps: all verification nodes receive and buffer transaction information from a client, and perform consensus sequencing on the transaction information by using a sequencing node to obtain a transaction number result; and each verification node pre-executes the transaction information in sequence according to the transaction number result, stores the transaction execution result in stages, acquires a corresponding block from the verification node according to the transaction execution result, performs block extraction, and completes verification on the block according to the block extraction information by using the consensus node, so that the problem of blocking in the traditional transaction processing mechanism is solved, the problem that the transaction quantity which can be verified by single consensus is limited due to the problems of block size and the like is also avoided, and finally, the transaction processing speed is improved.

Description

Transaction preprocessing method based on consensus sequencing
Technical Field
The invention relates to the technical field of data processing, in particular to a transaction preprocessing method based on consensus sequencing.
Background
In the course, the existing consensus algorithm and the blocking transaction processing mechanism waste too much time, which becomes a main obstacle to the performance improvement of the alliance chain. In addition, in the consensus stage, the transaction amount that can be verified by single consensus is limited due to the problem of the block size and the like, so that the transaction processing speed of the alliance link network is too slow.
Disclosure of Invention
The invention provides a transaction preprocessing method based on consensus sequencing, which solves the problem of blocking in the traditional transaction processing mechanism, improves the transaction performance, avoids limiting the transaction quantity which can be verified by single consensus due to the problems of block size and the like, and finally improves the transaction processing speed.
A transaction preprocessing method based on consensus ranking, comprising:
step 1: all verification nodes receive and buffer transaction information from a client, and the transaction information is subjected to consensus sequencing by utilizing a sequencing node to obtain a transaction number result;
step 2: each verification node sequentially pre-executes the transaction information according to the transaction number result and stores the transaction execution result in stages;
and 3, step 3: and according to the transaction execution result, acquiring the corresponding block from the verification node to perform block output, and completing the verification of the block according to the block output information by using the consensus node.
In one possible way of realisation,
in step 1, the consensus sequencing of the transaction information by using a sequencing node to obtain a transaction number result comprises the following steps:
and checking the transaction information based on the sequencing node, and sequencing the transaction information according to a time sequence after removing illegal transaction information to obtain a transaction number result.
In one possible way of realisation of the invention,
in step 1, after obtaining the transaction number result, the method further comprises:
step 101: broadcasting the transaction number in the transaction number result and a key value of the transaction information corresponding to the transaction number to a verification node, and verifying whether the transaction information exists in the client;
step 102: if yes, arranging the transaction information to carry out sequencing execution preparation;
step 103: otherwise, removing the corresponding transaction information from the sequencing node, and performing sequencing execution preparation.
In one possible way of realisation of the invention,
in step 2, the step of storing the transaction execution result in stages comprises:
and storing the preset transaction execution result once to a storage point closest to the verification node.
In one possible way of realisation,
in step 3, obtaining a corresponding block from the verification node for block delivery according to the transaction execution result includes:
according to the transaction numbering result, orderly packaging the transaction execution result to obtain a corresponding block, and broadcasting the block to each verification node;
the packaging method comprises the steps that in a preset time period, when the number of transaction execution results of a client exceeds a preset threshold value, the transaction execution results are packaged immediately, and if the number of the transaction execution results does not exceed the preset threshold value, the transaction execution results are packaged according to the preset time period.
In one possible way of realisation,
the verification of the block is completed by utilizing the consensus node according to the block information, and the verification comprises the following steps:
based on the block information, the consensus node acquires a broadcast signature, a transaction number interval, a block hash value and a block number of the block, compares the broadcast signature, the transaction number interval, the block hash value and the block number with a standard state, and completes verification.
In one possible way of realisation of the invention,
checking the transaction information, and removing illegal transaction information comprises the following steps:
pre-dividing transaction categories, and determining a transaction difficulty level set according to the data size and the transaction type of the transaction under each category;
defining a notice text transacted under each transaction difficulty level, and segmenting the notice text to form a single sentence text;
determining the part of speech of the vocabulary in the single sentence text to obtain part of speech characteristic data, and extracting the vocabulary of the single sentence text according to a preset part of speech processing method to obtain a keyword;
dividing the keywords according to word senses, and determining the frequency of the keywords under each word sense;
selecting a keyword set corresponding to the keyword frequency greater than a preset frequency as a target keyword;
establishing a transaction rule model based on the target keywords;
analyzing the transaction information, acquiring a transaction event, and extracting a to-be-detected keyword associated with the target keyword in the transaction event;
inputting the keywords to be detected into the transaction rule model, and judging whether the transaction events meet transaction rules;
if yes, judging the transaction event to be a legal transaction;
otherwise, judging the transaction event as illegal transaction, and deleting the illegal transaction.
In one possible way of realisation of the invention,
in step 1, after the transaction information is consensus-sequenced by using a sequencing node, the method further comprises the following steps:
matching the transaction information subjected to consensus sequencing with the transaction information before consensus sequencing, and judging whether the transaction information subjected to consensus sequencing is different from the transaction information before consensus sequencing;
if the transaction information is different, extracting the transaction information with the difference as the unsorted transaction information, and acquiring a target verification node corresponding to the unsorted transaction information;
sending the unordered transaction information from the target verification node to the sequencing node, and establishing a first association label of the sequencing node and the unordered transaction information on the target verification node;
setting an event reminder based on the first associated tag, and reminding the sequencing node to sequence the unordered transaction information;
after a preset reminding time interval, judging whether the unordered transaction information is ordered or not;
if so, removing the first associated label;
otherwise, the target verification node broadcasts the unordered transaction information to the verification nodes, second associated labels of the sequencing nodes and the unordered transaction information are established at all the verification nodes, and sequencing reminding is carried out on the sequencing nodes based on the second associated labels;
after the preset reminding time interval, judging whether the unordered transaction information is ordered again;
if so, removing the first associated label and the second associated label;
and otherwise, removing the first associated label and the second associated label, sending the unordered transaction information to a raft node, and reselecting the sorting node by using the raft node.
In one possible way of realisation,
comparing the broadcast signature, the transaction number interval, the block hash value, the block number and the standard state, and completing verification comprises:
the consensus node searches a verification node corresponding to a block to be verified and acquires a public key of the corresponding verification node;
analyzing the broadcast signature to obtain a private key of the corresponding verification node carried in the broadcast signature;
verifying the public key and the private key of the corresponding verification node;
if the broadcast signature is successfully verified, storing a transaction number interval, a block hash value and a block number corresponding to the block to be verified;
otherwise, indicating that the verification fails;
after the broadcast signature is successfully verified, inquiring standard block information corresponding to the block to be verified from a client, and calculating a standard hash value of the standard block based on the standard block information;
judging whether the block hash value is consistent with a standard hash value or not;
if so, indicating that the verification of the block to be verified is successful, and storing the block to be verified according to the transaction number interval and the block number corresponding to the block to be verified;
otherwise, authentication failure is indicated.
In one possible way of realisation of the invention,
sequencing the transaction information according to the time sequence, and obtaining a transaction number result comprises the following steps:
sorting the transaction information according to a time sequence, and acquiring conflict transaction information for judging whether time conflict exists in the sorting process;
if so, arranging different threads for the conflict transaction information, and marking the corresponding threads on the set transaction number;
otherwise, directly obtaining the transaction number result.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
FIG. 1 is a flow chart of a transaction pre-processing method based on consensus ranking according to an embodiment of the present invention;
FIG. 2 is a flow chart of the consensus sequencing in an embodiment of the present invention;
fig. 3 is a flowchart of transaction number result acquisition in the embodiment of the present invention.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
Example 1
The embodiment of the invention provides a transaction preprocessing method based on consensus ranking, which comprises the following steps of:
step 1: all verification nodes receive and buffer transaction information from a client, and the transaction information is subjected to consensus sequencing by utilizing a sequencing node to obtain a transaction number result;
step 2: each verification node pre-executes the transaction information in sequence according to the transaction number result and stores the transaction execution result in stages;
and step 3: and according to the transaction execution result, acquiring the corresponding block from the verification node to perform block discharge, and completing the verification of the block according to the block discharge information by using the consensus node.
In this embodiment, the verification node is configured to perform an operation of executing transaction information, and the consensus node is configured to verify the block according to a result of executing the transaction.
In this embodiment, the step-wise storing of the transaction execution result is, for example, storing the result once every N transactions, and when the corresponding transaction result needs to be obtained, obtaining the nearest storage point and executing the remaining transactions, so that the storage space can be saved, and the performance is not greatly affected.
In this embodiment, the blocking out the block corresponding to the client specifically includes: setting a threshold value, immediately packaging the blocks when the transaction executed locally by the client exceeds the threshold value, and otherwise, outputting the blocks at certain time intervals.
In this embodiment, the consensus node is used to perform consensus sequencing on the transaction information, specifically, after receiving a transaction, the sequencing node performs simple check and then sequences the transaction in a time sequence, and broadcasts a transaction number and a key value pair of the transaction to other verifier nodes, the verifier node receives the key value pair and then checks whether the transaction exists locally, if so, the sequencing is performed, otherwise, the corresponding transaction is pulled from the sequencing node, and in the time of sequencing the transaction information, if a conflict transaction occurs, the conflict transaction can be divided into different threads, and then the thread numbers corresponding to the transaction numbers are performed together with the transaction number, so that the problem that the transaction processing speed is too slow due to transaction blocking can be solved.
In the embodiment, the verification of the block is specifically that after the block is successfully verified, information such as a start transaction number, an end transaction number, a block hash value and the like of the block is broadcast to other consensus nodes, each consensus node locally obtains a corresponding transaction result according to the information sent by a miner, calculates the block hash value, and then compares the block hash value with the result of the miner to complete verification, so that the problem that the size of the block limits the number of transactions which can be verified by single consensus is avoided, and the transaction processing speed is improved.
In this embodiment, the flow of the scheme may be, for example: client → order sequence → broadcast sequence → node pre-executes transaction and saves result → if the transaction amount is too large, miners continuously pack the processed transaction and broadcast → agree with the block of the batch (one-time agree), wherein the sequence flow is shown in fig. 2.
The specific technical details comprise:
A. transaction sending and caching: the client broadcasts the transaction according to the old method of the Etherhouse, so that all verification nodes can receive the transaction and cache the transaction.
B. Consensus sequencing: and the sequencing node performs simple check after receiving the transaction, then sequences the transaction in time sequence, broadcasts the transaction number and the key value pair of the transaction hash to other verifiers, the verifiers check whether the transaction exists locally after receiving the key value pair, if so, sequencing is performed, otherwise, the corresponding transaction is pulled from the order node.
C. Pre-execution of the transaction: the verification node executes the transactions in sequence through the received transaction serial numbers, saves the execution result state of each transaction, deletes the old state after the block is landed, or caches the execution result in stages, for example, the result is stored every N transactions, and when the corresponding transaction result needs to be obtained, the nearest storage point is obtained and the rest transactions are executed, so that the storage space can be saved, and the performance cannot be greatly influenced.
D. Block discharging: setting a threshold value, immediately packaging the blocks when the locally executed transaction of the miners exceeds the threshold value, and otherwise, discharging the blocks at certain time intervals. And after the block is successfully output, broadcasting information such as the initial transaction number, the ending transaction number, the block hash and the like of the block to other consensus nodes, wherein each consensus node locally acquires a corresponding transaction result according to the information sent by the miners, calculates the block hash, and then compares the block hash with the result of the miners to finish verification.
E. Receiving a block: the block packed by miners can be verified only by broadcasting the signature, the block hash, the transaction number interval and the block number, and the other parameters are determined according to the situation (the state root can be selected for directly comparing the final state, but if the element for generating the block hash can be determined, the block hash can be directly used for verification), because the transaction execution result exists locally, the final state can be directly compared, and the verification can be completed.
F. Illegal transactions: miners and other common identification nodes directly skip illegal transactions, the situation that data are inconsistent due to bad transactions in normal nodes is avoided, and if the situation is judged to be a fault in the order node sequencing stage, the miners and other common identification nodes initiate voting for switching order nodes based on the transaction. When the consensus node fails to verify the block or cannot receive the block for a long time, the block of the batch is discarded, and the miner switching (for example: the pbft protocol viewchange) is initiated.
The beneficial effect of above-mentioned design is: the transaction information is subjected to consensus sequencing through the consensus nodes, the blocking problem in the traditional transaction processing mechanism is solved, each node can execute the existing transaction smoothly, the transaction information is pre-executed and is cached in a staged mode, the transaction performance is improved, the block verification is completed through the consensus nodes, the problem that the block size and the like limit the transaction quantity which can be verified by single consensus, and finally the transaction processing speed is improved.
Example 2
Based on the embodiment 1, the embodiment of the present invention provides a transaction preprocessing method based on consensus sequencing, wherein in step 1, performing consensus sequencing on the transaction information by using a sequencing node, and obtaining a transaction number result includes:
and checking the transaction information based on the sequencing node, and sequencing the transaction information according to a time sequence after removing illegal transaction information to obtain a transaction number result.
The beneficial effect of above-mentioned design is: the transaction information is checked, illegal transaction information is removed, time is saved for the process of sequencing the transaction information due to interference of the illegal transaction information, the running speed of the whole system is influenced, and the transaction processing speed is improved.
Example 3
Based on embodiment 1, an embodiment of the present invention provides a transaction preprocessing method based on consensus ranking, as shown in fig. 3, in step 1, after obtaining a transaction number result, the method further includes:
step 101: broadcasting the transaction number in the transaction number result and a key value of the transaction information corresponding to the transaction number to a verification node, and verifying whether the transaction information exists in the client;
step 102: if yes, arranging the transaction information to carry out sequencing execution preparation;
step 103: otherwise, removing the corresponding transaction information from the sequencing node, and performing sequencing execution preparation.
The beneficial effect of above-mentioned design is: and the sorted transaction numbers can be matched with the corresponding transaction information, so that the transaction execution is smoothly carried out.
Example 4
Based on embodiment 1, an embodiment of the present invention provides a transaction preprocessing method based on consensus ranking, where in step 2, the step of performing staged storage on a transaction execution result includes: and storing the preset transaction execution result once to a storage point closest to the verification node.
The beneficial effect of above-mentioned design is: when a certain transaction execution result is to be obtained, the corresponding transaction is obtained from the primary storage result of the storage point, and the rest transactions are executed to obtain the transaction execution result, so that the storage space can be saved, and the transaction processing performance is improved.
Example 5
Based on embodiment 1, an embodiment of the present invention provides a transaction preprocessing method based on consensus ranking, where in step 3, obtaining a corresponding block from the verification node according to a transaction execution result and performing block fetching includes:
according to the transaction number result, orderly packaging the transaction execution result to obtain a corresponding block, and broadcasting the block to each verification node;
the packaging method comprises the steps that in a preset time period, when the number of transaction execution results of a client exceeds a preset threshold value, the transaction execution results are packaged immediately, and if the number of the transaction execution results does not exceed the preset threshold value, the transaction execution results are packaged according to the preset time period.
The beneficial effect of above-mentioned design is: the blocks are packaged according to the transaction execution times and the transaction execution time, so that the size of the blocks and the included transaction execution times are ensured to be within a normal range, and the block verification cannot be influenced due to the fact that the blocks are too large.
Example 6
Based on embodiment 1, an embodiment of the present invention provides a transaction preprocessing method based on consensus ranking, where the verification of the block according to the block information by using a consensus node includes:
based on the block information, the consensus node acquires a broadcast signature, a transaction number interval, a block hash value and a block number of the block, compares the broadcast signature, the transaction number interval, the block hash value and the block number with a standard state, and completes verification.
In this embodiment, the broadcast signature information is obtained by signing the identification information of the block with a private key of the verification node.
The beneficial effect of above-mentioned design is: the block is verified through the consensus node, the standard states are directly compared, the problem that the transaction quantity which can be verified by single consensus is limited due to the problems of the size of the block and the like is avoided, and finally the transaction processing speed is improved.
Example 7
On the basis of the embodiment 2, the embodiment of the invention provides a transaction preprocessing method based on consensus sequencing, which is used for checking the transaction information and removing illegal transaction information and comprises the following steps:
pre-dividing transaction categories, and determining a transaction difficulty level set according to the data size and the transaction type of the transaction under each category;
defining a notice text transacted under each transaction difficulty level, and dividing the notice text into a single sentence text;
determining the part of speech of the vocabulary in the single sentence text to obtain part of speech characteristic data, and extracting the vocabulary of the single sentence text according to a preset part of speech processing method to obtain a keyword;
dividing the keywords according to word senses, and determining the frequency of the keywords under each word sense;
selecting a keyword set corresponding to the keyword frequency greater than a preset frequency as a target keyword;
establishing a transaction rule model based on the target keywords;
analyzing the transaction information, acquiring a transaction event, and extracting keywords to be detected related to the target keywords in the transaction event;
inputting the keywords to be detected into the transaction rule model, and judging whether the transaction events meet transaction rules;
if yes, judging the transaction event to be a legal transaction;
otherwise, judging the transaction event as illegal transaction, and deleting the illegal transaction.
In this embodiment, the categories of transactions include exchanges, investments, return on investment, and the like, and the types of transactions include, for example, exchanges including: virtual exchange and physical exchange; the investment expenditure comprises cheque expenditure, share expenditure and the like, and the return on investment comprises: monetary returns, item returns, etc.
In the embodiment, the notice text defining the transaction under each transaction difficulty level can be set with different transaction rules according to the data size and the transaction type of the specific transaction information, so that the condition that the same transaction rules are set for the transaction information at one time roughly and the detection precision of illegal transactions is low is avoided.
In this embodiment, the part-of-speech processing method may, for example, remove the vocabularies with parts-of-speech being the exclamatory words and the prepositions words, remove the irrelevant vocabularies, and improve the quality of the keywords.
In the embodiment, the target keywords are extracted from the notice text to establish the transaction rule model, so that the analysis capability of the notice text is improved, and the accuracy of the transaction rule model is ensured.
In this embodiment, the keywords to be detected, which are associated with the target keywords in the transaction event, may be extracted as words having the same or opposite word senses as the target keywords.
In this embodiment, the keyword to be detected is input into the transaction rule model, and the determination of whether the transaction event satisfies the transaction rule is specifically a determination of whether the similarity between the keyword to be detected and the transaction rule is legal if the similarity is greater than a preset similarity, and a determination of illegal five-day transaction if the similarity is not greater than the preset similarity is made.
The beneficial effect of above-mentioned design is: the transaction information is checked, and illegal transaction information is removed, so that the phenomenon that time is consumed too much in the process of sequencing the transaction information due to interference of the illegal transaction information, the running speed of the whole system is influenced, and the transaction processing speed is improved.
Example 8
Based on embodiment 1, an embodiment of the present invention provides a transaction preprocessing method based on consensus ranking, where in step 1, after performing consensus ranking on transaction information by using a ranking node, the method further includes:
matching the transaction information subjected to consensus sequencing with the transaction information before consensus sequencing, and judging whether the transaction information subjected to consensus sequencing is different from the transaction information before consensus sequencing;
if the transaction information is different, extracting the transaction information with the difference as the unsorted transaction information, and acquiring a target verification node corresponding to the unsorted transaction information;
sending the unordered transaction information from the target verification node to the sequencing node, and establishing a first association label of the sequencing node and the unordered transaction information on the target verification node;
setting an event reminder based on the first associated tag, and reminding the sequencing node to sequence the unordered transaction information;
after a preset reminding time interval, judging whether the unordered transaction information is ordered or not;
if so, removing the first associated label;
otherwise, the target verification node broadcasts the unordered transaction information to the verification nodes, second associated labels of the sequencing nodes and the unordered transaction information are established at all the verification nodes, and sequencing reminding is carried out on the sequencing nodes based on the second associated labels;
after the preset reminding time interval, judging whether the unordered transaction information is ordered again;
if so, removing the first associated label and the second associated label;
otherwise, the first associated label and the second associated label are removed, the transaction information which is not sequenced is sent to a raft node, and the raft node is used for reselecting the sequencing node.
In the embodiment, the first associated tag and the second associated tag are established, so that the accuracy of the object of the event reminder is ensured.
In this embodiment, the method for reselecting the sorting nodes by using the raft nodes specifically selects an optimal sorting node for consensus sorting by using a raft algorithm for the raft nodes.
In the embodiment, when the reminding of the target verification node is not effective, all the verification nodes are used for reminding the sequencing nodes, so that the reminding strength is improved, and the sequencing nodes are more likely to sequence the transaction information which is not sequenced.
The beneficial effects of the data design scheme are as follows: whether the transaction information is subjected to sequencing by the sequencing node is judged, and the information which is not sequenced is subjected to sequencing again, so that the comprehensiveness of transaction execution is ensured, and the transaction is ensured to be executed without blockage.
Example 9
Based on embodiment 6, an embodiment of the present invention provides a transaction preprocessing method based on consensus ranking, where comparing the broadcast signature, the transaction number interval, the block hash value, the block number, and the standard state, and completing verification includes:
the consensus node searches a verification node corresponding to a block to be verified and acquires a public key of the corresponding verification node;
analyzing the broadcast signature to obtain a private key of the corresponding verification node carried in the broadcast signature;
verifying the public key and the private key of the corresponding verification node;
if the broadcast signature is successfully verified, storing a transaction number interval, a block hash value and a block number corresponding to the block to be verified;
otherwise, indicating that the verification fails;
after the broadcast signature is successfully verified, inquiring standard block information corresponding to the block to be verified from a client, and calculating a standard hash value of the standard block based on the standard block information;
judging whether the block hash value is consistent with a standard hash value or not;
if so, indicating that the verification of the block to be verified is successful, and storing the block to be verified according to the transaction number interval and the block number corresponding to the block to be verified;
otherwise, authentication failure is indicated.
In this embodiment, the block to be verified is stored according to the transaction number interval and the block number corresponding to the block to be verified, so that the block can be conveniently searched and called.
The beneficial effect of above-mentioned design is: the block verification is completed through the consensus node, the standard states are directly compared, the limitation of the transaction quantity which can be verified by single consensus due to the problems of the block size and the like is avoided, and finally, the transaction processing speed is improved.
Example 10
On the basis of the embodiment 2, an embodiment of the present invention provides a transaction preprocessing method based on consensus ranking, where the ranking of the transaction information according to a time sequence to obtain a transaction number result includes:
sorting the transaction information according to a time sequence, and acquiring conflict transaction information for judging whether time conflict exists in the sorting process;
if so, arranging different threads for the conflict transaction information, and marking the corresponding threads on the set transaction number;
otherwise, directly obtaining the transaction number result.
The beneficial effect of above-mentioned design is: by sequencing the transaction information, if conflict transactions occur, the conflict transactions can be divided into different threads, transaction numbers are marked, the thread numbers corresponding to the transaction numbers can be executed together, and the problem that the transaction processing speed is too slow due to transaction blocking is solved.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (9)

1. A transaction preprocessing method based on consensus ranking, comprising:
step 1: all verification nodes receive and buffer transaction information from a client, and the transaction information is subjected to consensus sequencing by utilizing a sequencing node to obtain a transaction number result;
step 2: each verification node sequentially pre-executes the transaction information according to the transaction number result and stores the transaction execution result in stages;
and step 3: according to the transaction execution result, acquiring a corresponding block from the verification node for block discharging, and completing verification of the block according to block discharging information by using a consensus node;
in step 1, after the transaction information is consensus-sequenced by using a sequencing node, the method further comprises the following steps:
matching the transaction information subjected to consensus sequencing with the transaction information before consensus sequencing, and judging whether the transaction information subjected to consensus sequencing is different from the transaction information before consensus sequencing;
if the transaction information is different, extracting the transaction information with the difference as the unsorted transaction information, and acquiring a target verification node corresponding to the unsorted transaction information;
sending the unordered transaction information from the target verification node to the sequencing node, and establishing a first association label of the sequencing node and the unordered transaction information on the target verification node;
setting an event reminder based on the first associated tag, and reminding the sequencing node to sequence the unordered transaction information;
after a preset reminding time interval, judging whether the unordered transaction information is ordered or not;
if so, removing the first associated label;
otherwise, the target verification node broadcasts the unordered transaction information to the verification nodes, second associated labels of the sequencing nodes and the unordered transaction information are established at all the verification nodes, and sequencing reminding is carried out on the sequencing nodes based on the second associated labels;
after the preset reminding time interval, judging whether the unordered transaction information is ordered again;
if so, removing the first associated label and the second associated label;
and otherwise, removing the first associated label and the second associated label, sending the unordered transaction information to a raft node, and reselecting the sorting node by using the raft node.
2. The transaction preprocessing method according to claim 1, wherein in step 1, the step of performing consensus ranking on the transaction information by using a ranking node to obtain a transaction number result comprises:
and checking the transaction information based on the sequencing node, and sequencing the transaction information according to a time sequence after removing illegal transaction information to obtain a transaction number result.
3. The method of claim 1, wherein the step 1 of obtaining the transaction number result further comprises:
step 101: broadcasting the transaction number in the transaction number result and a key value of the transaction information corresponding to the transaction number to a verification node, and verifying whether the transaction information exists in the client;
step 102: if yes, arranging the transaction information to carry out sequencing execution preparation;
step 103: otherwise, removing the transaction number corresponding to the transaction information from the sequencing node, and performing sequencing execution preparation.
4. The method as claimed in claim 1, wherein the step 2 of saving transaction execution results in stages comprises:
and storing the preset transaction execution result once to a storage point closest to the verification node.
5. The method of claim 1, wherein the step 3 of obtaining the corresponding block from the verification node for blocking according to the transaction execution result comprises:
according to the transaction number result, orderly packaging the transaction execution result to obtain a corresponding block, and broadcasting the block to each verification node;
the packaging method comprises the steps that in a preset time period, when the number of transaction execution results of a client exceeds a preset threshold value, the transaction execution results are packaged immediately, and if the number of the transaction execution results does not exceed the preset threshold value, the transaction execution results are packaged according to the preset time period.
6. The method of claim 1, wherein the validating the block according to the block-out information by the consensus node comprises:
and based on the block output information, the consensus node acquires a broadcast signature, a transaction number interval, a block hash value and a block number of the block, compares the broadcast signature, the transaction number interval, the block hash value and the block number with a standard state, and completes verification.
7. The transaction preprocessing method based on consensus ranking as claimed in claim 2, wherein the checking the transaction information and the rejecting illegal transaction information comprises:
pre-dividing transaction categories, and determining a transaction difficulty level set according to the data size and the transaction type of the transaction under each category;
defining a notice text transacted under each transaction difficulty level, and dividing the notice text into a single sentence text;
determining the part of speech of the vocabulary in the single sentence text to obtain part of speech characteristic data, and extracting the vocabulary of the single sentence text according to a preset part of speech processing method to obtain a keyword;
dividing the keywords according to word senses, and determining the frequency of the keywords under each word sense;
selecting a keyword set corresponding to the keyword frequency greater than a preset frequency as a target keyword;
establishing a transaction rule model based on the target keywords;
analyzing the transaction information, acquiring a transaction event, and extracting a to-be-detected keyword associated with the target keyword in the transaction event;
inputting the keywords to be detected into the transaction rule model, and judging whether the transaction events meet transaction rules;
if yes, judging the transaction event to be a legal transaction;
otherwise, judging the transaction event as illegal transaction, and deleting the illegal transaction.
8. The method of claim 6, wherein comparing the broadcast signature, the transaction number interval, the block hash value, and the block number with a standard status, and the verification comprises:
the consensus node searches a verification node corresponding to a block to be verified and acquires a public key of the corresponding verification node;
analyzing the broadcast signature to obtain a private key of the corresponding verification node carried in the broadcast signature;
verifying the public key and the private key of the corresponding verification node;
if the broadcast signature is successfully verified, storing a transaction number interval, a block hash value and a block number corresponding to the block to be verified;
otherwise, indicating that the verification fails;
after the broadcast signature is successfully verified, inquiring standard block information corresponding to the block to be verified from a client, and calculating a standard hash value of the standard block based on the standard block information;
judging whether the block hash value is consistent with a standard hash value or not;
if so, indicating that the verification of the block to be verified is successful, and storing the block to be verified according to the transaction number interval and the block number corresponding to the block to be verified;
otherwise, authentication failure is indicated.
9. The transaction preprocessing method according to claim 2, wherein the sorting of the transaction information according to time sequence to obtain the transaction number result comprises:
sequencing the transaction information according to a time sequence, and acquiring conflict transaction information for judging whether time conflict exists in the sequencing process;
if so, arranging different threads for the conflict transaction information, and marking the corresponding threads on the set transaction number;
otherwise, directly obtaining the transaction number result.
CN202110952352.7A 2021-08-19 2021-08-19 Transaction preprocessing method based on consensus sequencing Active CN113810378B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110952352.7A CN113810378B (en) 2021-08-19 2021-08-19 Transaction preprocessing method based on consensus sequencing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110952352.7A CN113810378B (en) 2021-08-19 2021-08-19 Transaction preprocessing method based on consensus sequencing

Publications (2)

Publication Number Publication Date
CN113810378A CN113810378A (en) 2021-12-17
CN113810378B true CN113810378B (en) 2023-04-07

Family

ID=78941558

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110952352.7A Active CN113810378B (en) 2021-08-19 2021-08-19 Transaction preprocessing method based on consensus sequencing

Country Status (1)

Country Link
CN (1) CN113810378B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114331732B (en) * 2022-03-15 2022-05-24 北京微芯感知科技有限公司 Consensus message compression method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106682907A (en) * 2016-12-10 2017-05-17 江苏恒为信息科技有限公司 Comparison and consensus method for block chain data
CN110417502A (en) * 2019-07-31 2019-11-05 中国工商银行股份有限公司 A kind of block chain nodal clock common recognition method and device
CN111629039A (en) * 2020-05-20 2020-09-04 中国银联股份有限公司 Block chain consensus method, client, endorsement node and sequencing node

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111723406B (en) * 2020-06-08 2023-04-28 上海朝夕网络技术有限公司 Block chain consensus algorithm and system
CN112150146B (en) * 2020-09-22 2023-11-03 京东科技控股股份有限公司 Block processing method, device, equipment and storage medium of block chain
CN112184244A (en) * 2020-09-29 2021-01-05 壹链盟生态科技有限公司 Block chain-based consensus achieving method and device and storage medium
CN113205417B (en) * 2021-04-27 2022-10-25 华东师范大学 Alliance chain oriented transaction parallel processing method and system
CN113139871A (en) * 2021-05-07 2021-07-20 新晨科技股份有限公司 Adaptive consensus on block chain method, apparatus and computer readable storage medium
CN113256417B (en) * 2021-05-14 2022-07-12 杭州链网科技有限公司 Transaction sharing-based consensus block method and system
CN113489681B (en) * 2021-06-08 2022-06-21 湖南大学 Block link point data consistency consensus method, device, equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106682907A (en) * 2016-12-10 2017-05-17 江苏恒为信息科技有限公司 Comparison and consensus method for block chain data
CN110417502A (en) * 2019-07-31 2019-11-05 中国工商银行股份有限公司 A kind of block chain nodal clock common recognition method and device
CN111629039A (en) * 2020-05-20 2020-09-04 中国银联股份有限公司 Block chain consensus method, client, endorsement node and sequencing node

Also Published As

Publication number Publication date
CN113810378A (en) 2021-12-17

Similar Documents

Publication Publication Date Title
CN108519970B (en) Method for identifying sensitive information in text, electronic device and readable storage medium
CN103257957B (en) A kind of text similarity recognition methods and device based on Chinese word segmentation
CN106296195A (en) A kind of Risk Identification Method and device
CN113810378B (en) Transaction preprocessing method based on consensus sequencing
CN107832444B (en) Event discovery method and device based on search log
CN111814455A (en) Search term error correction pair construction method, terminal and storage medium
CN109543408A (en) A kind of Malware recognition methods and system
CN111783460A (en) Enterprise abbreviation extraction method and device, computer equipment and storage medium
CN110765760A (en) Legal case distribution method and device, storage medium and server
CN113268768A (en) Desensitization method, apparatus, device and medium for sensitive data
CN111047092A (en) Dispute case victory rate prediction method and device, computer equipment and storage medium
CN110222015A (en) A kind of reading of file data, querying method, device and readable storage medium storing program for executing
CN112328469B (en) Function level defect positioning method based on embedding technology
CN113536777A (en) Extraction method, device and equipment of news keywords and storage medium
CN101576872A (en) Chinese text processing method and device thereof
CN111368894B (en) FCBF feature selection method and application thereof in network intrusion detection
CN107169065B (en) Method and device for removing specific content
CN114049215A (en) Abnormal transaction identification method, device and application
CN114579711A (en) Method, device, equipment and storage medium for identifying fraud application program
CN114840872A (en) Secret text desensitization method and device, computer equipment and readable storage medium
CN114064893A (en) Abnormal data auditing method, device, equipment and storage medium
CN109214843A (en) A kind of intention checking method, device and server
CN109829713B (en) Mobile payment mode identification method based on common drive of knowledge and data
CN111553817A (en) Analysis method and system for goodness of fit of complaint reporting case and treatment department
CN115587599B (en) Quality detection method and device for machine translation corpus

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