CN109919622A - Transaction replacement method, equipment and storage medium - Google Patents

Transaction replacement method, equipment and storage medium Download PDF

Info

Publication number
CN109919622A
CN109919622A CN201910135410.XA CN201910135410A CN109919622A CN 109919622 A CN109919622 A CN 109919622A CN 201910135410 A CN201910135410 A CN 201910135410A CN 109919622 A CN109919622 A CN 109919622A
Authority
CN
China
Prior art keywords
transaction
predecessor
preparatory
trading pit
traded
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
CN201910135410.XA
Other languages
Chinese (zh)
Other versions
CN109919622B (en
Inventor
吴思进
陈德海
王志文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Fuzamei Technology Co Ltd
Original Assignee
Hangzhou Fuzamei Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Fuzamei Technology Co Ltd filed Critical Hangzhou Fuzamei Technology Co Ltd
Priority to CN201910135410.XA priority Critical patent/CN109919622B/en
Publication of CN109919622A publication Critical patent/CN109919622A/en
Priority to PCT/CN2020/075946 priority patent/WO2020169059A1/en
Priority to US17/432,076 priority patent/US20220131873A1/en
Application granted granted Critical
Publication of CN109919622B publication Critical patent/CN109919622B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • 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/23Updating
    • G06F16/2308Concurrency control
    • 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/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • H04L63/1466Active attacks involving interception, injection, modification, spoofing of data unit addresses, e.g. hijacking, packet injection or TCP sequence number attacks
    • 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
    • H04L2463/00Additional details relating to network architectures or network communication protocols for network security covered by H04L63/00
    • H04L2463/121Timestamp

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Business, Economics & Management (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Technology Law (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The present invention provides a kind of transaction replacement method, equipment and storage medium, this method comprises: by trading for transaction configuration predecessor's Transaction Information selection predecessor to be replaced of preparatory trading pit to be deposited, when the predecessor to be replaced trades still in preparatory trading pit, the predecessor's transactional marking that will be replaced is discarded, and the transaction is stored in preparatory trading pit;When receiving the confirmation signal of the transaction, which is stored in trading pit, and, when the transaction is packaged, all predecessors for deleting the transaction trade.Transaction content can be modified before entering trading pit the invention enables the transaction, and prevents predecessor from trading and returns.

Description

Transaction replacement method, equipment and storage medium
Technical field
This application involves block chain technical fields, and in particular to a kind of transaction replacement method, equipment and storage medium.
Background technique
In block chain process of exchange, user needs to fill in sender address, recipient address, number of deals when sending transaction The information such as amount are traded.In currently existing scheme, these information need to determine before transaction is submitted, and transaction is Yi Dan submitted Transaction Information can not be just changed, user is likely to result in irremediable loss after maloperation;
In view of the above-mentioned problems, some mechanisms propose the method for transaction replacement, the transaction before the replacement in trading pit is deleted It removes, replaced transaction is put into trading pit and waits packing;But there are certain delays for different nodes in block chain, own Node not can guarantee strong synchronized relation, for example, when node A delete replacement before transaction, by it is replaced transaction be put into transaction Pond and after waiting packing, and the transaction before the replacement of node B passback is received, the transaction before replacement can be put into again by node A Trading pit simultaneously waits packing, if two transactions are finally all packaged, causes transaction abnormal.
Summary of the invention
In view of drawbacks described above in the prior art or deficiency, transaction can be modified before being intended to provide a kind of trade into trading pit Content, and transaction replacement method, equipment and the storage medium for preventing transaction from returning.
In a first aspect, the present invention provides a kind of transaction replacement method, comprising:
The first transaction that user terminal is sent is received, and whether is empty determination by first predecessor's Transaction Information of the first transaction First transaction of preparatory trading pit to be deposited is the first kind transaction for replacing predecessor's transaction or the second class for not replacing predecessor's transaction Transaction:
If the first transaction is that the second class is traded, the first transaction is stored in preparatory trading pit;
If the first transaction is that the first kind is traded, predecessor's transaction according to the first transaction of first predecessor's Transaction Information inquiry is It is no in preparatory trading pit:
Being is then discarded by first predecessor's transactional marking, and the first transaction is stored in preparatory trading pit;And
The first confirmation message for being used to confirm the first transaction that user terminal is sent is received, the first transaction is stored in trading pit, And generate the second confirmation message and the other nodes for being sent to block chain that the first transaction has confirmed that;Or, receiving its of block chain First transaction is stored in trading pit by the second confirmation signal that its node is sent;
After the first transaction is packaged, traded according to the first predecessor of the first transaction of first predecessor's Transaction Information inquiry;
It is traded according to the inquiry of predecessor's Transaction Information of the transaction inquired with the presence or absence of a upper predecessor, recycles current step It is rapid to trade until inquiring less than predecessor;
The predecessor's transaction deleting the first predecessor transaction and respectively inquiring.
Second aspect, the present invention provide a kind of transaction replacement method, comprising:
The first node for trading and being sent to block chain is generated, so that the node of block chain receives the first transaction, and is passed through It is that replacement predecessor hands over that whether first predecessor's Transaction Information of the first transaction, which is empty the first transaction for determining preparatory trading pit to be deposited, The second class transaction that predecessor trades is not replaced in easy first kind transaction:
If the first transaction is that the second class is traded, the first transaction is stored in preparatory trading pit;
If the first transaction is that the first kind is traded, predecessor's transaction according to the first transaction of first predecessor's Transaction Information inquiry is It is no in preparatory trading pit:
Being is then discarded by first predecessor's transactional marking, and the first transaction is stored in preparatory trading pit;And
The first confirmation message for confirming the first transaction is sent to the node of block chain, so that the node of block chain receives First transaction is stored in trading pit by the first confirmation message, and is generated first the second confirmation message for having confirmed that of transaction and be sent to Other nodes of block chain;
After the first transaction is packaged, traded according to the first predecessor of the first transaction of first predecessor's Transaction Information inquiry;
It is traded according to the inquiry of predecessor's Transaction Information of the transaction inquired with the presence or absence of a upper predecessor, recycles current step It is rapid to trade until inquiring less than predecessor;
The predecessor's transaction deleting the first predecessor transaction and respectively inquiring.
The third aspect, the present invention provide a kind of transaction replacement method, comprising:
The first transaction that user terminal is sent is received, and whether is empty determination by first predecessor's Transaction Information of the first transaction First transaction of preparatory trading pit to be deposited is the first kind transaction for replacing predecessor's transaction or the second class for not replacing predecessor's transaction Transaction:
If the first transaction is that the second class is traded, the first transaction is stored in preparatory trading pit;
If the first transaction is that the first kind is traded, predecessor's transaction according to the first transaction of first predecessor's Transaction Information inquiry is It is no in preparatory trading pit:
It is that then the first transaction is stored in preparatory trading pit;
The third confirmation signal for being used to confirm the first transaction that user terminal is sent is received, the first transaction is stored in trading pit, And generate the 4th confirmation message and the other nodes for being sent to block chain that the first transaction has confirmed that;Or, receiving its of block chain First transaction is stored in trading pit by the 4th confirmation signal that its node is sent;
It is replacement predecessor that whether first predecessor's Transaction Information by the first transaction, which is empty determining first transaction to be packaged, The first kind transaction of transaction or the second class transaction for not replacing predecessor's transaction:
If the first transaction is that the second class is traded, it is packaged the first transaction;
If the first transaction is that the first kind is traded, handed over according to the first predecessor of the first transaction of first predecessor's Transaction Information inquiry Easily;
It is traded according to the inquiry of predecessor's Transaction Information of the transaction inquired with the presence or absence of a upper predecessor, recycles current step It is rapid to trade until inquiring less than predecessor;
The predecessor's transaction deleting the first predecessor transaction and respectively inquiring, and it is packaged the first transaction.
Fourth aspect, the present invention provide a kind of transaction replacement method, comprising:
The first node for trading and being sent to block chain is generated, so that the node of block chain receives the first transaction, and is passed through It is that replacement predecessor hands over that whether first predecessor's Transaction Information of the first transaction, which is empty the first transaction for determining preparatory trading pit to be deposited, The second class transaction that predecessor trades is not replaced in easy first kind transaction:
If the first transaction is that the second class is traded, the first transaction is stored in preparatory trading pit;
If the first transaction is that the first kind is traded, predecessor's transaction according to the first transaction of first predecessor's Transaction Information inquiry is It is no in preparatory trading pit:
It is that then the first transaction is stored in preparatory trading pit;
The third confirmation signal for confirming the first transaction is sent to the node of block chain, so that the node of block chain receives First transaction is stored in trading pit by third confirmation signal, and is generated the first the 4th confirmation message for having confirmed that of transaction and be sent to Other nodes of block chain, and whether be empty determining first transaction to be packaged by first predecessor's Transaction Information of the first transaction It is the first kind transaction for replacing predecessor's transaction or the second class transaction for not replacing predecessor's transaction:
If the first transaction is that the second class is traded, it is packaged the first transaction;
If the first transaction is that the first kind is traded, traded according to the predecessor of the first transaction of first predecessor's Transaction Information inquiry;
It is traded according to the inquiry of predecessor's Transaction Information of the transaction inquired with the presence or absence of a upper predecessor, recycles current step It is rapid to trade until inquiring less than predecessor;
The predecessor's transaction deleting the first predecessor transaction and respectively inquiring, and be packaged and state the first transaction.
5th aspect, the present invention also provides a kind of equipment, including one or more processors and memory, wherein memory Comprising can by instruction that the one or more processors execute so that the one or more processors execute it is each according to the present invention The transaction replacement method that embodiment provides.
6th aspect, the present invention also provides a kind of storage medium for being stored with computer program, which makes to count Calculation machine executes the transaction replacement method that each embodiment provides according to the present invention.
Transaction replacement method, equipment and the storage medium that many embodiments of the present invention provide are by for preparatory transaction to be deposited Transaction configuration predecessor's Transaction Information selection predecessor to be replaced transaction in pond, when the predecessor to be replaced trades still in preparatory trading pit When middle, the predecessor's transactional marking that will be replaced is discarded, and the transaction is stored in preparatory trading pit;When receiving the transaction really When recognizing signal, which is stored in trading pit, and, when the transaction is packaged, what all predecessors for deleting the transaction traded Method so that the transaction can modify transaction content before entering trading pit, and prevents predecessor from trading and returns;
Transaction replacement method, equipment and the storage medium that some embodiments of the invention provide further pass through judgement and send the Whether the first address of one transaction and the second address for sending the first predecessor transaction are identical: being, then by first predecessor's transactional marking It is discarded, and the first transaction is stored in the method in preparatory trading pit, prevent different users is from maliciously sending the first transaction Replacement is not belonging to the first predecessor transaction of oneself, to improve the safety of block catenary system, further improves user experience;
Transaction replacement method, equipment and the storage medium that some embodiments of the invention provide, which further pass through, calculates exchange The quantity of the predecessor's transaction possessed, and be compared with the threshold value of the quantity of predecessor's transaction of system pre-configuration, if before transaction The quantity of body transaction is greater than the threshold value of the quantity for the predecessor's transaction being pre-configured, the then method for abandoning transaction, to constrain a transaction There cannot be excessive predecessor's transaction, deliver easily replacement predecessor transaction to prevent certain malicious users from not stopping paying out and cause to trade in advance Pond congestion further improves user experience to improve the safety of block catenary system;
Transaction replacement method, equipment and the storage medium that some embodiments of the invention provide are further by configuring preparatory friendship The threshold value of the storage duration of Yi Chizhong transaction;When monitoring waiting time of the transaction of preparatory trading pit and whether being more than the waiting of configuration Long threshold value: being, then the method for deleting transaction, deletes and stores the too long transaction of duration in preparatory trading pit, discharges transaction in advance The memory space in pond further improves user experience to improve the safety of block catenary system.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the application's is other Feature, objects and advantages will become more apparent upon:
Fig. 1 is a kind of flow chart for transaction replacement method that one embodiment of the invention provides.
Fig. 2 is the flow chart of step S15 in a kind of preferred embodiment of method shown in Fig. 1.
Fig. 3 is the flow chart of step S15 in a kind of preferred embodiment of method shown in Fig. 1.
Fig. 4 is the flow chart of step S12 in a kind of preferred embodiment of method shown in Fig. 1.
Fig. 5 is a kind of flow chart for transaction replacement method that one embodiment of the invention provides.
Fig. 6 is the flow chart of step S211 in a kind of preferred embodiment of method shown in Fig. 5.
Fig. 7 is a kind of structural schematic diagram for equipment that one embodiment of the invention provides.
Specific embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to Convenient for description, part relevant to invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is a kind of flow chart for transaction replacement method that one embodiment of the invention provides.
As shown in Figure 1, in the present embodiment, the present invention provides a kind of transaction replacement method, comprising:
Whether S12: receiving the first transaction that user terminal is sent, and be empty by first predecessor's Transaction Information of the first transaction The first transaction for determining preparatory trading pit to be deposited is to replace the first kind transaction of predecessor's transaction or do not replace the of predecessor's transaction The transaction of two classes:
If the first transaction is that the second class is traded, S13 is thened follow the steps: the first transaction is stored in preparatory trading pit;
If the first transaction is that the first kind is traded, S14 is thened follow the steps: according to the first transaction of first predecessor's Transaction Information inquiry Predecessor trade whether in preparatory trading pit:
It is to then follow the steps S15: is discarded by first predecessor's transactional marking, and the first transaction is stored in preparatory trading pit In;And
S16: receiving the first confirmation message for being used to confirm the first transaction that user terminal is sent, by the first transaction deposit transaction Pond, and generate the second confirmation message and the other nodes for being sent to block chain that the first transaction has confirmed that;Or, receiving block chain First transaction is stored in trading pit by the second confirmation signal that other nodes are sent;
S17: it after the first transaction is packaged, is handed over according to the first predecessor of the first transaction of first predecessor's Transaction Information inquiry Easily;
S18: it is traded according to the inquiry of predecessor's Transaction Information of the transaction inquired with the presence or absence of a upper predecessor, circulation is worked as Preceding step is until inquiry is traded less than predecessor;
S19: the predecessor's transaction deleting the first predecessor transaction and respectively inquiring.
Specifically, the first transaction that user generates and sends is configured with predecessor's Transaction Information predecessor and discarded letter Cease discard;First predecessor's Transaction Information is the transaction Hash of predecessor's transaction of the first transaction, when the first no predecessor of transaction hands over Predecessor's Transaction Information of Yi Shi, first transaction are configured to sky;Discard information is used to identify the discarded state of transaction;User sends The first confirmation message for confirm the first transaction be the first transaction through user's signature transaction Hash, node A generation the The second confirmation message that one transaction has confirmed that, the second confirmation message are consistent with the first confirmation message;
Indicate that transaction is not discarded when state is false to discard, for expression transaction is discarded when discarded state is true;It is false If there are 100 transaction tx_1~tx_100 in current trading pit in advance, do not trade in trading pit;User's first generate tx_101 and Tx_102, and it is sent to the node A of block chain;Wherein, the predecessor of tx_101 is sky, the predecessor of tx_102 It is hash (tx_60) for hash (tx_80), the predecessor of tx_80, the predecessor of tx_60 is sky;User's first is true Recognize tx_102 it is errorless after, send sig (hash (tx_102)) to the node A of block chain, the second confirmation message and the first confirmation letter Breath is consistent, is also sig (hash (tx_102));
User's first generates tx_101 and tx_102, and is sent to the node A of block chain;
When node A receives tx_101:
In step s 12, node A receives the tx_101 that user's first is sent, and by the predecessor of tx_101 whether It is to replace the first kind transaction of predecessor's transaction or do not replace what predecessor traded for the empty tx_101 for determining preparatory trading pit to be deposited The transaction of second class:
Since the predecessor of tx_101 is sky, tx_101 is the transaction of the second class, thens follow the steps S13: by tx_101 It is stored in preparatory trading pit.
When node A receives tx_102:
In step s 12, node A receive user's first send tx_102, and by tx_102 and predecessor be The no tx_102 for empty determining preparatory trading pit to be deposited is to replace the first kind transaction or do not replace predecessor's transaction that predecessor trades The second class transaction:
Since the predecessor of tx_102 is hash (tx_80), tx_102 is first kind transaction, is thened follow the steps S14: tx_80 is traded whether in preparatory trading pit according to the predecessor that hash (tx_80) inquires tx_102:
Due to there are 100 transaction tx_1~tx_100, tx_80 in preparatory trading pit in current trading pit in advance, then hold Row step S15: by tx_80 labeled as discarding, the discard of tx_80 is updated to true by false, and tx_102 is stored in advance In first trading pit;And
In step s 16, node A receives the sig (hash (tx_102)) that user's first is sent, and tx_102 is stored in and is traded Pond, and generate first the second confirmation message for having confirmed that of transaction, since the second confirmation message is consistent with the first confirmation message, also for Sig (hash (tx_102)), therefore sig (hash (tx_102)) is sent to other nodes of block chain by node A;Or, node A The second confirmation signal sig (hash (tx_102)) that other nodes of block chain are sent is received, tx_102 is stored in trading pit;
In step S17, node A inquires the first predecessor of tx_102 according to hash (tx_80) after tx_102 is packaged Transaction is hash (tx_80);
In step S18, node A is according to the inquiry of predecessor's Transaction Information of the transaction inquired with the presence or absence of before upper one Body transaction, circulation current procedures are until inquiry is traded less than predecessor;According to the predecessor of tx_80 inquiry with the presence or absence of upper One predecessor's transaction, the predecessor of tx_80 are hash (tx_60), and the upper predecessor transaction of tx_80 is tx_60;Again It is traded according to the predecessor of tx_60 inquiry with the presence or absence of a upper predecessor, inquires predecessor's transaction less than tx_60, circulation Terminate;
In step S19, node A deletes tx_80 and tx_60.
Prevent transaction return principle are as follows: when another node of block chain, it is assumed that be node B, due to network delay or its Tx_80 is returned to node A by its problem;If tx_102 is not packaged also at this time, node A judges, exists in preparatory trading pit Tx_80, and tx_80 has been labeled as discarding, node A abandons the tx_80 of node B passback;If tx_102 is packaged at this time, hand in advance The tx_80 and tx_60 of Yi Chizhong has been deleted, and node A checks whether node B is consistent with the block height of oneself, due to node A It has been packaged tx_102, and node B is naturally larger than the block height of node B still in tx_80 stage, the block height of node A is returned Degree, node A abandon the tx_80 of node B passback.
Above-described embodiment configures predecessor's Transaction Information by the transaction for preparatory trading pit to be deposited and selects before being replaced Body transaction, when the predecessor to be replaced trades still in preparatory trading pit, the predecessor's transactional marking that will be replaced is discarded, and will The transaction is stored in preparatory trading pit;When receiving the confirmation signal of the transaction, which is stored in trading pit, and, when this When transaction is packaged, the method for all predecessors transaction for deleting the transaction, so that the transaction can modify transaction before entering trading pit Content, and prevent predecessor from trading and return.
Fig. 2 is the flow chart of step S15 in a kind of preferred embodiment of method shown in Fig. 1.As shown in Fig. 2, excellent one It selects in embodiment, step S15 includes:
S151: judge to send the first address of the first transaction and whether the second address for sending the first predecessor transaction be identical:
It is to then follow the steps S152: is discarded by first predecessor's transactional marking, and the first transaction is stored in preparatory trading pit In.
Specifically, it is assumed that the first address for sending tx_102 is identical as the second address of tx_80 is sent;
When node A receives tx_102:
In step S151, node A judge send tx_102 the first address with transmission tx_80 the second address whether phase It is same:
Since the first address for sending tx_102 is identical as the second address of tx_80 is sent, S152 is thened follow the steps: will Tx_80 is labeled as discarding, and tx_102 is stored in preparatory trading pit.
The first predecessor that above-described embodiment prevents different users to be not belonging to oneself from maliciously sending the first transaction replacement Transaction improves the safety of block catenary system, further improves user experience.
Fig. 3 is the flow chart of step S15 in a kind of preferred embodiment of method shown in Fig. 1.As shown in figure 3, excellent one It selects in embodiment, step S15 includes:
S153: trading according to the inquiry of predecessor's Transaction Information of the transaction inquired with the presence or absence of a upper predecessor, circulation Current procedures are until inquiry is traded less than predecessor;
S154: counting the quantity of each predecessor transaction, and adds one to calculate the first summation;
S155: judge whether the first summation is greater than the threshold value of the quantity of predecessor's transaction of pre-configuration:
It is no, then it executes S157: being discarded by first predecessor's transactional marking, and the first transaction is stored in preparatory trading pit;
It is then to execute S156: abandons the first transaction.
Specifically, it is assumed that the threshold value of the quantity of predecessor's transaction of pre-configuration is 3;
In step S153, node A whether there is upper one according to the inquiry of predecessor's Transaction Information of the transaction inquired Predecessor's transaction, circulation current procedures are until inquiry is traded less than predecessor;It whether there is according to the predecessor of tx_80 inquiry Upper predecessor transaction, the predecessor of tx_80 are hash (tx_60), and the upper predecessor transaction of tx_80 is tx_60; It is traded again according to the predecessor of tx_60 inquiry with the presence or absence of a upper predecessor, inquires predecessor's transaction less than tx_60, follow Ring terminates;
In step S154, the quantity of each predecessor transaction is counted, and adds one to calculate the first summation, predecessor's transaction Quantity is 1, and adding first summation of calculating is 2;
In step S155, judge whether the first summation is greater than the threshold value of the quantity of predecessor's transaction of pre-configuration:
Since 2 are not more than 3, S157 is executed: tx_80 being labeled as discarding, and tx_102 is stored in preparatory trading pit.
Above-described embodiment is expounded the present embodiment so that the threshold value of the quantity for the predecessor's transaction being pre-configured is 3 as an example, In more embodiments, other numerical value can also be configured by the threshold value of the quantity of predecessor's transaction according to actual needs, for example, Be configured to 5, be configured to 0 or negative (be not allow for additional predecessor in addition to the first predecessor transaction is outer and trade), it can be achieved that identical Technical effect.
Above-described embodiment, which constrains a transaction, cannot have excessive predecessor's transaction, to prevent certain malicious users from not stopping paying out It delivers easily replacement predecessor transaction and causes preparatory trading pit congestion, to improve the safety of block catenary system, further improve and use Family experience.
Fig. 4 is the flow chart of step S12 in a kind of preferred embodiment of method shown in Fig. 1.As shown in figure 4, excellent one It selects in embodiment, step S12 includes:
S122: judge whether the transaction amount in preparatory trading pit is less than the threshold value that transaction is stored in preparatory trading pit:
It is no, then it executes S124: abandoning first transaction.
Specifically, it is assumed that node A successively receives tx_101 and tx_102, when node A receives tx_101, preparatory trading pit In transaction amount be less than in preparatory trading pit and store the threshold value of transaction, friendship when node A receives tx_102, in preparatory trading pit Easily sum is not less than the threshold value for storing transaction in preparatory trading pit;
When node A receives tx_102:
In step S122, node A judges whether the transaction amount in preparatory trading pit is less than in preparatory trading pit and stores The threshold value of transaction:
It is no, then S124 is executed, tx_102 is abandoned.
In more embodiments, the threshold value that transaction is stored in preparatory trading pit can be configured according to actual needs, it can be achieved that phase Same technical effect.
In a preferred embodiment, the first threshold for the storage duration traded in preparatory trading pit is configured;Monitoring is handed in advance Whether the waiting time of the transaction of Yi Chi is more than the first threshold: being then to delete the transaction.
Specifically, it with the first threshold for the storage duration traded in preparatory trading pit for 10 minutes, is handed in preparatory trading pit Easy waiting time starts when entering preparatory trading pit for the transaction for timing, it is assumed that the waiting time of preparatory tx_1 is more than 10 Minute;
The waiting time that node A monitors tx_1 is more than 10 minutes, and node A deletes tx_1.
In the above-described embodiments, when node A receives a transaction, waiting time of the transaction in preparatory trading pit is Terminated from the time of entering preparatory trading pit to the transaction from the time of the transaction enters preparatory trading pit plus 10 minutes.
Above-described embodiment with the first threshold for the storage duration traded in preparatory trading pit for 10 minutes, in preparatory trading pit The waiting time of transaction is that the transaction starts to be expounded the present embodiment for timing when entering preparatory trading pit, more In embodiment, first threshold can also be configured according to actual needs, for example, 5 minutes;When the waiting that will be traded in preparatory trading pit Length is configured to start calendar scheduling at the time of the transaction is received by node, it can be achieved that identical technical effect.
Above-described embodiment, which is deleted, stores the too long transaction of duration in preparatory trading pit, the storage for discharging preparatory trading pit is empty Between, to improve the safety of block catenary system, further improve user experience.
In the present embodiment, a kind of transaction replacement method that one embodiment of the invention provides, comprising:
The first node for trading and being sent to block chain is generated, so that the node of block chain receives the first transaction, and is passed through It is that replacement predecessor hands over that whether first predecessor's Transaction Information of the first transaction, which is empty the first transaction for determining preparatory trading pit to be deposited, The second class transaction that predecessor trades is not replaced in easy first kind transaction:
If the first transaction is that the second class is traded, the first transaction is stored in preparatory trading pit;
If the first transaction is that the first kind is traded, predecessor's transaction according to the first transaction of first predecessor's Transaction Information inquiry is It is no in preparatory trading pit:
Being is then discarded by first predecessor's transactional marking, and the first transaction is stored in preparatory trading pit;And
The first confirmation message for confirming the first transaction is sent to the node of block chain, so that the node of block chain receives First transaction is stored in trading pit by the first confirmation message, and is generated first the second confirmation message for having confirmed that of transaction and be sent to Other nodes of block chain;
After the first transaction is packaged, traded according to the first predecessor of the first transaction of first predecessor's Transaction Information inquiry;
It is traded according to the inquiry of predecessor's Transaction Information of the transaction inquired with the presence or absence of a upper predecessor, recycles current step It is rapid to trade until inquiring less than predecessor;
The predecessor's transaction deleting the first predecessor transaction and respectively inquiring.
The transaction replacement principle of above-described embodiment can refer to method shown in FIG. 1, and details are not described herein again.
Fig. 5 is a kind of flow chart for transaction replacement method that one embodiment of the invention provides.As shown in figure 5, in this implementation In example, the present invention provides a kind of transaction replacement method, comprising:
S202: receive user terminal send first transaction, and by first transaction first predecessor's Transaction Information whether be Sky determines that the first transaction of preparatory trading pit to be deposited is the first kind transaction or do not replace predecessor's transaction that replacement predecessor trades The transaction of second class:
If the first transaction is that the second class is traded, S203 is thened follow the steps: the first transaction is stored in preparatory trading pit;
If the first transaction is that the first kind is traded, S204 is thened follow the steps: being handed over according to first predecessor's Transaction Information inquiry first Whether easy predecessor trades in preparatory trading pit:
It is to then follow the steps S205: the first transaction is stored in preparatory trading pit;
S206: the third confirmation signal for being used to confirm the first transaction that user terminal is sent is received, the first transaction deposit is handed over Yi Chi, and generate the 4th confirmation message and the other nodes for being sent to block chain that the first transaction has confirmed that;Or, receiving block chain Other nodes send the 4th confirmation signal, by first transaction be stored in trading pit;
S207: it is replacement that whether first predecessor's Transaction Information by the first transaction, which is empty determining first transaction to be packaged, The first kind transaction of predecessor's transaction or the second class transaction for not replacing predecessor's transaction:
If the first transaction is that the second class is traded, S208 is thened follow the steps: being packaged the first transaction;
If the first transaction is that the first kind is traded, S209 is thened follow the steps: being handed over according to first predecessor's Transaction Information inquiry first Easy the first predecessor transaction;
S210: trading according to the inquiry of predecessor's Transaction Information of the transaction inquired with the presence or absence of a upper predecessor, circulation Current procedures are until inquiry is traded less than predecessor;
S211: the predecessor's transaction deleting the first predecessor transaction and respectively inquiring, and it is packaged the first transaction.
Specifically, the first transaction that user generates and sends is configured with predecessor's Transaction Information predecessor;First predecessor Transaction Information is the transaction Hash of predecessor's transaction of the first transaction, when first transaction no predecessor transaction, first transaction Predecessor's Transaction Information is configured to sky;User send for confirm the third confirmation message of the first transaction for the through user's signature The transaction Hash of one transaction, node A generate the 4th confirmation message that the first transaction has confirmed that, the 4th confirmation message and third confirm Information is consistent;
Assuming that there are 100 transaction tx_201~tx_300 in current trading pit in advance, do not trade in trading pit;User's first Tx_301 and tx_302 is generated, and is sent to the node A of block chain;Wherein, the predecessor of tx_301 is sky, tx_302 Predecessor be hash (tx_280), the predecessor of tx_280 is hash (tx_260), tx_260's Predecessor is sky;After user's first confirms that tx_301 is errorless, sig (hash (tx_301)) is sent to the node A of block chain, Second confirmation message is consistent with the first confirmation message, is also sig (hash (tx_301));After user's first sends tx_302, it is believed that Tx_280 is only correctly, after user's first confirms that tx_280 is errorless, sends sig (hash (tx_280)) to the node A of block chain, Second confirmation message is consistent with the first confirmation message, is also sig (hash (tx_280));
User's first generates tx_301 and tx_302, and is sent to the node A of block chain;
When node A receives tx_301:
In step S202, node A receives the tx_301 that user's first is sent, and the predecessor for passing through tx_301 is The no tx_301 for empty determining preparatory trading pit to be deposited is to replace the first kind transaction or do not replace predecessor's transaction that predecessor trades The second class transaction:
Since the predecessor of tx_301 is sky, tx_301 is the transaction of the second class, thens follow the steps S203: by tx_ The 301 preparatory trading pits of deposit;
In step S206, node A receives the sig (hash (tx_301)) that user's first is sent, and the first transaction deposit is handed over Yi Chi, and the 4th confirmation message and the other nodes for being sent to block chain that the first transaction has confirmed that are generated, due to the 4th confirmation Information is consistent with third confirmation message, is also sig (hash (tx_301)), therefore node A sends sig (hash (tx_301)) To other nodes of block chain;Or, node A receives the 4th confirmation signal sig (hash (tx_ that other nodes of block chain are sent 301) tx_301), is stored in trading pit;
In step S207, whether the predecessor that node A passes through tx_301 is that empty determining tx_301 to be packaged is The first kind transaction of replacement predecessor transaction or the second class transaction for not replacing predecessor's transaction:
Since the predecessor of tx_301 is sky, tx_301 is the transaction of the second class, thens follow the steps S208: being packaged tx_ 301。
When node A receives tx_302:
In step S202, node A receives the tx_302 that user's first is sent, and the predecessor for passing through tx_302 is The no tx_302 for empty determining preparatory trading pit to be deposited is to replace the first kind transaction or do not replace predecessor's transaction that predecessor trades The second class transaction:
Since the predecessor of tx_302 is hash (tx_280), tx_302 is first kind transaction, is thened follow the steps S204: tx_280 is traded whether in preparatory trading pit according to the predecessor that hash (tx_280) inquires tx_302:
It is to then follow the steps S205: tx_302 is stored in preparatory trading pit;
In step S206, node A receives the sig (hash (tx_280)) that user's first is sent, and tx_280 is stored in and is traded Pond, and the 4th confirmation message and the other nodes for being sent to block chain that the first transaction has confirmed that are generated, due to the 4th confirmation letter Breath is consistent with third confirmation message, is also sig (hash (tx_280)), therefore sig (hash (tx_280)) is sent to by node A Other nodes of block chain;Or, node A receives the 4th confirmation signal sig (hash (tx_ that other nodes of block chain are sent 280) tx_280), is stored in trading pit;
In step S207, whether the predecessor that node A passes through tx_280 is empty determining first transaction to be packaged It is the first kind transaction for replacing predecessor's transaction or the second class transaction for not replacing predecessor's transaction:
Since the predecessor of tx_280 is hash (tx_260), tx_280 is first kind transaction, is thened follow the steps S209: the first predecessor transaction that tx_280 is inquired according to hash (tx_260) is tx_260;
In step S210, node A whether there is upper one according to the inquiry of predecessor's Transaction Information of the transaction inquired Predecessor's transaction, circulation current procedures are until inquiry is traded less than predecessor;It whether there is according to the predecessor of tx_260 inquiry Upper predecessor transaction, inquires predecessor's transaction less than tx_260, and circulation terminates;
In step S211, node A deletes tx_260, and is packaged the first transaction.
Prevent transaction return principle are as follows: when another node of block chain, it is assumed that be node B, due to network delay or its Tx_260 is returned to node A by its problem;If tx_280 is not packaged also at this time, node A judges, deposits in preparatory trading pit The tx_260 of node B passback is abandoned in tx_260, node A;If tx_280 is packaged at this time, the tx_260 in preparatory trading pit is It deletes, node A checks whether node B is consistent with the block height of oneself, and since node A has been packaged tx_280, and node B still locates In the passback tx_260 stage, the block height of node A is naturally larger than the block height of node B, and node A abandons node B passback tx_260。
Above-described embodiment is traded by the first predecessor of the first transaction and is believed by receiving the first transaction of user terminal transmission It is before replacing the first kind transaction of predecessor's transaction or not replacing that whether breath, which is empty the first transaction for determining preparatory trading pit to be deposited, The second class transaction of body transaction: if the first transaction is that the second class is traded, the first transaction is stored in preparatory trading pit;If first hands over It easily trades, then whether is traded in preparatory trading pit according to the predecessor of the first transaction of first predecessor's Transaction Information inquiry for the first kind In: it is that then the first transaction is stored in preparatory trading pit;The third for confirming the first transaction that user terminal is sent is received to confirm First transaction is stored in trading pit by signal, and is generated the first the 4th confirmation message for having confirmed that of transaction and be sent to block chain Other nodes;Or, the 4th confirmation signal that the other nodes for receiving block chain are sent, is stored in trading pit for the first transaction;Pass through It is to replace the first kind of predecessor's transaction that whether first predecessor's Transaction Information of the first transaction, which is empty determining first transaction to be packaged, Transaction or the second class transaction for not replacing predecessor's transaction: if the first transaction is that the second class is traded, it is packaged the first transaction;If first Transaction is that the first kind is traded, then is traded according to the first predecessor of the first transaction of first predecessor's Transaction Information inquiry;According to being inquired To transaction predecessor's Transaction Information inquiry with the presence or absence of a upper predecessor trade, circulation current procedures until inquiry less than predecessor Transaction;The predecessor's transaction deleting the first predecessor transaction and respectively inquiring, and the method for being packaged the first transaction, are handed over so that transaction enters Yi Chiqian can modify transaction content, and prevent transaction from returning, and, the specified transaction for needing to confirm of user's alternative, into one Step improves user experience.
Fig. 6 is the flow chart of step S211 in a kind of preferred embodiment of method shown in Fig. 5.As shown in fig. 6, excellent one It selects in embodiment, step S211 includes:
S2112: the predecessor's transaction deleting the first predecessor transaction and respectively inquiring;
S2113: the first transaction Hash of the first transaction is calculated, according to the first transaction hash query with the presence or absence of the first transaction The first subsequent transaction:
It is to then follow the steps S2114: transaction Hash is calculated according to the transaction inquired, and is breathed out according to calculated transaction Uncommon inquiry whether there is the latter subsequent transaction, and circulation current procedures are up to inquiry is less than subsequent transaction;
S2115: the subsequent transaction deleting the first subsequent transaction and respectively inquiring, and it is packaged the first transaction;
Wherein, predecessor's Transaction Information of the first subsequent transaction is consistent with the first transaction Hash.
Specifically, in step S2112, node A deletes tx_260;
In step S2113, node A calculates the transaction Hash of tx_280, hash (tx_280) is obtained, according to hash (tx_ 280) inquiry whether there is the subsequent transaction of tx_280:
Since the predecessor of tx_302 is hash (tx_280), inquiring tx_302 is the subsequent of tx_280 Transaction executes step S2114, whether there is the latter subsequent transaction according to calculated transaction hash query, recycles current step Suddenly until inquiry is less than subsequent transaction;Node A calculates the transaction Hash of tx_302, hash (tx_302) is obtained, according to hash (tx_302) subsequent transaction of the inquiry less than tx_302, circulation terminate;
In step S2115, node A deletes tx_302, and is packaged tx_280.
In a preferred embodiment, the first transaction is stored in preparatory trading pit includes:
Judge whether the first address for sending the first transaction and the second address for sending the first predecessor transaction are identical:
It is that then the first transaction is stored in preparatory trading pit.
The transaction replacement principle of above-described embodiment can refer to method shown in Fig. 2, and details are not described herein again.
In a preferred embodiment, if the first transaction is that the first kind is traded, the first transaction, which is stored in preparatory trading pit, includes:
It is traded according to the inquiry of predecessor's Transaction Information of the transaction inquired with the presence or absence of a upper predecessor, recycles current step It is rapid to trade until inquiring less than predecessor;
The quantity of each predecessor transaction is counted, and adds one to calculate the first summation;
Judge whether the first summation is greater than the threshold value of the quantity of predecessor's transaction of pre-configuration:
It is no, then the first transaction is stored in preparatory trading pit;
It is then to abandon the first transaction.
The transaction replacement principle of above-described embodiment can refer to method shown in Fig. 3, and details are not described herein again.
In a preferred embodiment, the first transaction that user terminal is sent is received, and is handed over by the first predecessor of the first transaction It is to replace the first kind transaction of predecessor's transaction or do not replace that whether easy information, which is empty the first transaction for determining preparatory trading pit to be deposited, Change the second class transaction of predecessor's transaction, further includes:
Judge whether the transaction amount in preparatory trading pit is less than the threshold value that transaction is stored in preparatory trading pit:
It is no, then abandon first transaction.
The transaction replacement principle of above-described embodiment can refer to method shown in Fig. 4, and details are not described herein again.
In a preferred embodiment, the first threshold for the storage duration traded in preparatory trading pit is configured;Monitoring is handed in advance Whether the waiting time of the transaction of Yi Chi is more than the first threshold: being then to delete the transaction.
Specifically, it with the first threshold for the storage duration traded in preparatory trading pit for 10 minutes, is handed in preparatory trading pit Easy waiting time starts when entering preparatory trading pit for the transaction for timing, it is assumed that the waiting time of tx_201 is more than in advance 10 minutes;
The waiting time that node A monitors tx_201 is more than 10 minutes, and node A deletes tx_201.
In the above-described embodiments, when node A receives a transaction, waiting time of the transaction in preparatory trading pit is Terminated from the time of entering preparatory trading pit to the transaction from the time of the transaction enters preparatory trading pit plus 10 minutes.
In the present embodiment, a kind of transaction replacement method that one embodiment of the invention provides, comprising:
The first node for trading and being sent to block chain is generated, so that the node of block chain receives the first transaction, and is passed through It is that replacement predecessor hands over that whether first predecessor's Transaction Information of the first transaction, which is empty the first transaction for determining preparatory trading pit to be deposited, The second class transaction that predecessor trades is not replaced in easy first kind transaction:
If the first transaction is that the second class is traded, the first transaction is stored in preparatory trading pit;
If the first transaction is that the first kind is traded, predecessor's transaction according to the first transaction of first predecessor's Transaction Information inquiry is It is no in preparatory trading pit:
It is that then the first transaction is stored in preparatory trading pit;
The third confirmation signal for confirming the first transaction is sent to the node of block chain, so that the node of block chain receives First transaction is stored in trading pit by third confirmation signal, and is generated the first the 4th confirmation message for having confirmed that of transaction and be sent to Other nodes of block chain, and whether be empty determining first transaction to be packaged by first predecessor's Transaction Information of the first transaction It is the first kind transaction for replacing predecessor's transaction or the second class transaction for not replacing predecessor's transaction:
If the first transaction is that the second class is traded, it is packaged the first transaction;
If the first transaction is that the first kind is traded, traded according to the predecessor of the first transaction of first predecessor's Transaction Information inquiry;
It is traded according to the inquiry of predecessor's Transaction Information of the transaction inquired with the presence or absence of a upper predecessor, recycles current step It is rapid to trade until inquiring less than predecessor;
The predecessor's transaction deleting the first predecessor transaction and respectively inquiring, and be packaged and state the first transaction.
The transaction replacement principle of above-described embodiment can refer to method shown in fig. 5, and details are not described herein again.
Fig. 7 is a kind of structural schematic diagram for equipment that one embodiment of the invention provides.
As shown in fig. 7, present invention also provides a kind of equipment 700, including one or more centres as on the other hand Unit (CPU) 701 is managed, can be added according to the program being stored in read-only memory (ROM) 702 or from storage section 708 The program that is downloaded in random access storage device (RAM) 703 and execute various movements appropriate and processing.In RAM703, also deposit It contains equipment 700 and operates required various programs and data.CPU701, ROM702 and RAM703 pass through the phase each other of bus 704 Even.Input/output (I/O) interface 705 is also connected to bus 704.
I/O interface 705 is connected to lower component: the importation 706 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 707 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 708 including hard disk etc.; And the communications portion 709 of the network interface card including LAN card, modem etc..Communications portion 709 via such as because The network of spy's net executes communication process.Driver 710 is also connected to I/O interface 705 as needed.Detachable media 711, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 710, in order to read from thereon Computer program be mounted into storage section 708 as needed.
Particularly, in accordance with an embodiment of the present disclosure, the transaction replacement method of any of the above-described embodiment description can be implemented For computer software programs.For example, embodiment of the disclosure includes a kind of computer program product comprising be tangibly embodied in Computer program on machine readable media, the computer program include the program code for executing transaction replacement method. In such embodiments, which can be downloaded and installed from network by communications portion 709, and/or from Detachable media 711 is mounted.
As another aspect, present invention also provides a kind of computer readable storage medium, the computer-readable storage mediums Matter can be computer readable storage medium included in the device of above-described embodiment;It is also possible to individualism, it is unassembled Enter the computer readable storage medium in equipment.Computer-readable recording medium storage has one or more than one program, should Program is used to execute the transaction replacement method for being described in the application by one or more than one processor.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, this is depending on related function.Also it wants It is noted that the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart, Ke Yitong The dedicated hardware based system of functions or operations as defined in executing is crossed to realize, or by specialized hardware and can be calculated The combination of machine instruction is realized.
Being described in the embodiment of the present application involved unit or module can be realized by way of software, can also be with It is realized by way of hardware.Described unit or module also can be set in the processor, for example, each unit can To be the software program being arranged in computer or intelligent movable equipment, it is also possible to the hardware device being separately configured.Wherein, this The title of a little units or module does not constitute the restriction to the unit or module itself under certain conditions.
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.Those skilled in the art Member is it should be appreciated that invention scope involved in the application, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from the application design, appointed by above-mentioned technical characteristic or its equivalent feature Other technical solutions of meaning combination and formation.Such as features described above and (but being not limited to) disclosed herein have similar functions Technical characteristic replaced mutually and the technical solution that is formed.

Claims (15)

1. a kind of transaction replacement method characterized by comprising
The first transaction that user terminal is sent is received, and whether the first predecessor's Transaction Information traded by described first is empty determination First transaction of preparatory trading pit to be deposited is to replace the first kind transaction of predecessor's transaction or do not replace the of predecessor's transaction The transaction of two classes:
If first transaction is that second class is traded, first transaction is stored in the preparatory trading pit;
If first transaction is that the first kind is traded, according to first predecessor Transaction Information inquiry, first transaction Predecessor trade whether in the preparatory trading pit:
Being is then discarded by first predecessor transactional marking, and first transaction is stored in the preparatory trading pit;With And
The first confirmation message for being used to confirm first transaction that user terminal is sent is received, by the first transaction deposit transaction Pond, and generate the second confirmation message and the other nodes for being sent to block chain that the first transaction has confirmed that;Or, receiving the block Second confirmation signal that other nodes of chain are sent, by the first transaction deposit trading pit;
After first transaction is packaged, the first predecessor of first transaction is inquired according to first predecessor Transaction Information Transaction;
It is traded according to the inquiry of predecessor's Transaction Information of the transaction inquired with the presence or absence of a upper predecessor, circulation current procedures are straight It trades to inquiry less than predecessor;
The predecessor's transaction deleting the first predecessor transaction and respectively inquiring.
2. it by first predecessor transactional marking is discarded the method according to claim 1, wherein described, and First transaction is stored in the preparatory trading pit and includes:
Judge whether the first address for sending first transaction and the second address for sending the first predecessor transaction are identical:
Being is then discarded by first predecessor transactional marking, and first transaction is stored in the preparatory trading pit.
3. it by first predecessor transactional marking is discarded the method according to claim 1, wherein described, and First transaction is stored in the preparatory trading pit and includes:
It is traded according to the inquiry of predecessor's Transaction Information of the transaction inquired with the presence or absence of a upper predecessor, circulation current procedures are straight It trades to inquiry less than predecessor;
The quantity of each predecessor's transaction is counted, and adds one to calculate the first summation;
Judge whether first summation is greater than the threshold value of the quantity of predecessor's transaction of pre-configuration:
It is no, then it is discarded by first predecessor transactional marking, and first transaction is stored in the preparatory trading pit;
It is then to abandon first transaction.
4. the method according to claim 1, wherein the first of the reception user terminal transmission trades, and passing through It is to replace that whether first predecessor's Transaction Information of first transaction, which is empty first transaction for determining preparatory trading pit to be deposited, It changes the first kind transaction of predecessor's transaction or does not replace the second class transaction of predecessor's transaction, further includes:
Judge whether the transaction amount in the preparatory trading pit is less than the threshold value that transaction is stored in the preparatory trading pit:
It is no, then abandon first transaction.
5. the method according to claim 1, wherein further include:
Configure the first threshold for the storage duration traded in the preparatory trading pit;
Whether the waiting time for monitoring the transaction of the preparatory trading pit is more than the first threshold: being then to delete the transaction.
6. a kind of transaction replacement method characterized by comprising
The first node for trading and being sent to block chain is generated, so that the node of the block chain receives first transaction, and Whether the first predecessor's Transaction Information traded by described first is empty first transaction for determining preparatory trading pit to be deposited It is the first kind transaction for replacing predecessor's transaction or the second class transaction for not replacing predecessor's transaction:
If first transaction is that second class is traded, first transaction is stored in the preparatory trading pit;
If first transaction is that the first kind is traded, according to first predecessor Transaction Information inquiry, first transaction Predecessor trade whether in the preparatory trading pit:
Being is then discarded by first predecessor transactional marking, and first transaction is stored in the preparatory trading pit;With And
The first confirmation message for confirming first transaction is sent to the node of the block chain, for the block chain Node receives first confirmation message, by the first transaction deposit trading pit, and generates the first transaction has confirmed that second Confirmation message and the other nodes for being sent to block chain;
After first transaction is packaged, the first predecessor of first transaction is inquired according to first predecessor Transaction Information Transaction;
It is traded according to the inquiry of predecessor's Transaction Information of the transaction inquired with the presence or absence of a upper predecessor, circulation current procedures are straight It trades to inquiry less than predecessor;
The predecessor's transaction deleting the first predecessor transaction and respectively inquiring.
7. a kind of transaction replacement method characterized by comprising
The first transaction that user terminal is sent is received, and whether the first predecessor's Transaction Information traded by described first is empty determination First transaction of preparatory trading pit to be deposited is to replace the first kind transaction of predecessor's transaction or do not replace the of predecessor's transaction The transaction of two classes:
If first transaction is that second class is traded, first transaction is stored in the preparatory trading pit;
If first transaction is that the first kind is traded, according to first predecessor Transaction Information inquiry, first transaction Predecessor trade whether in the preparatory trading pit:
It is that then first transaction is stored in the preparatory trading pit;
The third confirmation signal for being used to confirm first transaction that the user terminal is sent is received, first transaction is stored in Trading pit, and generate the 4th confirmation message and the other nodes for being sent to block chain that the first transaction has confirmed that;Or, described in receiving The 4th confirmation signal that other nodes of block chain are sent, by the first transaction deposit trading pit;
It is replacement that whether the first predecessor's Transaction Information traded by described first, which is empty determining first transaction to be packaged, The first kind transaction of predecessor's transaction or the second class transaction for not replacing predecessor's transaction:
If first transaction is that second class is traded, it is packaged first transaction;
If first transaction is that the first kind is traded, according to first predecessor Transaction Information inquiry, first transaction The first predecessor transaction;
It is traded according to the inquiry of predecessor's Transaction Information of the transaction inquired with the presence or absence of a upper predecessor, circulation current procedures are straight It trades to inquiry less than predecessor;
The predecessor's transaction deleting the first predecessor transaction and respectively inquiring, and it is packaged first transaction.
8. the method according to the description of claim 7 is characterized in that the transaction that predecessor's Transaction Information includes predecessor's transaction is breathed out It is uncommon, the predecessor's transaction deleting the first predecessor transaction and respectively inquiring, and be packaged first transaction and include:
The predecessor's transaction deleting the first predecessor transaction and respectively inquiring;
The the first transaction Hash for calculating first transaction is handed over according to the first transaction hash query with the presence or absence of described first The first easy subsequent transaction:
It is transaction Hash then to be calculated according to the transaction inquired, and according to calculated transaction hash query with the presence or absence of latter A subsequent transaction, circulation current procedures are until inquire less than subsequent transaction;
The subsequent transaction deleting first subsequent transaction and respectively inquiring, and it is packaged first transaction;
Wherein, predecessor's Transaction Information of first subsequent transaction is consistent with the first transaction Hash.
9. the method according to the description of claim 7 is characterized in that if it is described first transaction be the first kind trade, it is described First transaction is stored in the preparatory trading pit and includes:
Judge whether the first address for sending first transaction and the second address for sending the first predecessor transaction are identical:
It is that then first transaction is stored in the preparatory trading pit.
10. the method according to the description of claim 7 is characterized in that if it is described first transaction be the first kind trade, it is described First transaction is stored in the preparatory trading pit and includes:
It is traded according to the inquiry of predecessor's Transaction Information of the transaction inquired with the presence or absence of a upper predecessor, circulation current procedures are straight It trades to inquiry less than predecessor;
The quantity of each predecessor's transaction is counted, and adds one to calculate the first summation;
Judge whether first summation is greater than the threshold value of the quantity of predecessor's transaction of pre-configuration:
It is no, then first transaction is stored in the preparatory trading pit;
It is then to abandon first transaction.
11. the method according to the description of claim 7 is characterized in that the first of the reception user terminal transmission trades, and passing through It is to replace that whether first predecessor's Transaction Information of first transaction, which is empty first transaction for determining preparatory trading pit to be deposited, It changes the first kind transaction of predecessor's transaction or does not replace the second class transaction of predecessor's transaction, further includes:
Judge whether the transaction amount in the preparatory trading pit is less than the threshold value that transaction is stored in the preparatory trading pit:
It is no, then abandon first transaction.
12. the method according to the description of claim 7 is characterized in that further include:
Configure the first threshold for the storage duration traded in the preparatory trading pit;
Whether the waiting time for configuring the transaction of the preparatory trading pit is more than the first threshold: being then to delete the transaction.
13. a kind of transaction replacement method characterized by comprising
The first node for trading and being sent to block chain is generated, so that the node of the block chain receives first transaction, and Whether the first predecessor's Transaction Information traded by described first is empty first transaction for determining preparatory trading pit to be deposited It is the first kind transaction for replacing predecessor's transaction or the second class transaction for not replacing predecessor's transaction:
If first transaction is that second class is traded, first transaction is stored in the preparatory trading pit;
If first transaction is that the first kind is traded, according to first predecessor Transaction Information inquiry, first transaction Predecessor trade whether in the preparatory trading pit:
It is that then first transaction is stored in the preparatory trading pit;
The third confirmation signal for confirming first transaction is sent to the node of the block chain, for the block chain Node receives the third confirmation signal, by the first transaction deposit trading pit, and generates the first transaction has confirmed that the 4th Confirmation message and the other nodes for being sent to block chain, and whether be empty by the described first first predecessor's Transaction Information traded Determining that be packaged described first is traded is the first kind transaction for replacing predecessor's transaction or the second class friendship for not replacing predecessor's transaction It is easy:
If first transaction is that second class is traded, it is packaged first transaction;
If first transaction is that the first kind is traded, according to first predecessor Transaction Information inquiry, first transaction Predecessor transaction;
It is traded according to the inquiry of predecessor's Transaction Information of the transaction inquired with the presence or absence of a upper predecessor, circulation current procedures are straight It trades to inquiry less than predecessor;
The predecessor's transaction deleting the first predecessor transaction and respectively inquiring, and be packaged and state the first transaction.
14. a kind of equipment, which is characterized in that the equipment includes:
One or more processors;
Memory, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors Execute such as method of any of claims 1-13.
15. a kind of storage medium for being stored with computer program, which is characterized in that realize when the program is executed by processor as weighed Benefit requires method described in any one of 1-13.
CN201910135410.XA 2019-02-22 2019-02-22 Transaction replacement method, apparatus and storage medium Active CN109919622B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN201910135410.XA CN109919622B (en) 2019-02-22 2019-02-22 Transaction replacement method, apparatus and storage medium
PCT/CN2020/075946 WO2020169059A1 (en) 2019-02-22 2020-02-20 Transaction replacement method, device and storage medium
US17/432,076 US20220131873A1 (en) 2019-02-22 2020-02-20 Transaction Replacement Method, Device, and Storage Medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910135410.XA CN109919622B (en) 2019-02-22 2019-02-22 Transaction replacement method, apparatus and storage medium

Publications (2)

Publication Number Publication Date
CN109919622A true CN109919622A (en) 2019-06-21
CN109919622B CN109919622B (en) 2020-10-23

Family

ID=66962191

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910135410.XA Active CN109919622B (en) 2019-02-22 2019-02-22 Transaction replacement method, apparatus and storage medium

Country Status (3)

Country Link
US (1) US20220131873A1 (en)
CN (1) CN109919622B (en)
WO (1) WO2020169059A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020169059A1 (en) * 2019-02-22 2020-08-27 杭州复杂美科技有限公司 Transaction replacement method, device and storage medium
CN111639939A (en) * 2020-06-08 2020-09-08 杭州复杂美科技有限公司 Block restoring method, equipment and storage medium
CN113449903A (en) * 2020-03-27 2021-09-28 丰田自动车株式会社 Information processing apparatus, information processing method, and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2953076A1 (en) * 2014-06-04 2015-12-09 MONI Limited System and method for executing financial transactions
CN108234470A (en) * 2017-12-28 2018-06-29 江苏通付盾科技有限公司 Block packaging method and system, electronic equipment, storage medium in block chain network
CN108462582A (en) * 2018-02-09 2018-08-28 北京欧链科技有限公司 Feedback method for treating in block chain and device
CN109345251A (en) * 2018-08-24 2019-02-15 深圳壹账通智能科技有限公司 Negotiable block chain method of commerce, device, equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6364132B2 (en) * 2015-03-31 2018-07-25 ナスダック, インコーポレイテッドNasdaq, Inc. Blockchain transaction recording system and method
CN107423163B (en) * 2017-03-24 2020-10-16 北京瑞卓喜投科技发展有限公司 Error surveying method and system for block chain of overall serial added blocks
CN108846753B (en) * 2018-06-06 2021-11-09 北京京东尚科信息技术有限公司 Method and apparatus for processing data
CN109919622B (en) * 2019-02-22 2020-10-23 杭州复杂美科技有限公司 Transaction replacement method, apparatus and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2953076A1 (en) * 2014-06-04 2015-12-09 MONI Limited System and method for executing financial transactions
US20150356555A1 (en) * 2014-06-04 2015-12-10 Antti Pennanen System and method for executing financial transactions
CN108234470A (en) * 2017-12-28 2018-06-29 江苏通付盾科技有限公司 Block packaging method and system, electronic equipment, storage medium in block chain network
CN108462582A (en) * 2018-02-09 2018-08-28 北京欧链科技有限公司 Feedback method for treating in block chain and device
CN109345251A (en) * 2018-08-24 2019-02-15 深圳壹账通智能科技有限公司 Negotiable block chain method of commerce, device, equipment and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020169059A1 (en) * 2019-02-22 2020-08-27 杭州复杂美科技有限公司 Transaction replacement method, device and storage medium
CN113449903A (en) * 2020-03-27 2021-09-28 丰田自动车株式会社 Information processing apparatus, information processing method, and system
CN113449903B (en) * 2020-03-27 2024-03-08 丰田自动车株式会社 Information processing apparatus, information processing method, and information processing system
CN111639939A (en) * 2020-06-08 2020-09-08 杭州复杂美科技有限公司 Block restoring method, equipment and storage medium

Also Published As

Publication number Publication date
WO2020169059A1 (en) 2020-08-27
US20220131873A1 (en) 2022-04-28
CN109919622B (en) 2020-10-23

Similar Documents

Publication Publication Date Title
CN109919622A (en) Transaction replacement method, equipment and storage medium
US7774420B2 (en) Managing on-demand email storage
US9848047B2 (en) High density hosting for messaging service
EP2817779B1 (en) Time-managed electronic mail messages
US8903925B2 (en) Scheduled messages in a scalable messaging system
CN109034801A (en) A kind of privacy method of commerce and system, equipment and can storage medium
JP2018077847A (en) Reminder method and device of chat room base
CN105991408B (en) A kind of message treatment method, device and processing server
CN109741060A (en) Information inquiry system, method, device, electronic equipment and storage medium
CN109447641A (en) To the method and apparatus of block chain browser transport block chain data
EP3357206B1 (en) Modification of delivered email content
US9853927B2 (en) Enforcing resource quota in mail transfer agent within multi-tenant environment
JP6060094B2 (en) sort
CN109194565A (en) A kind of message read states reminding method and device
CN107528789A (en) Method for dispatching message and device
CN110443610A (en) For reducing method and system, equipment and the storage medium of trading group repeated broadcast
CN109872139A (en) Transaction replacement method, equipment and storage medium
WO2020156482A1 (en) Transaction replacing method, transaction queuing method, device, and storage medium
WO2016107102A1 (en) Short message concurrent sending service processing method and apparatus
CN109614411A (en) Date storage method, equipment and storage medium
CN113760521A (en) Virtual resource allocation method and device
US8874646B2 (en) Message managing system, message managing method and recording medium storing program for that method execution
CN109981460A (en) A kind of service-oriented converged network, calculating, storage integral method and device
US20180130022A1 (en) Message management system and method
CN109271103A (en) A kind of method and system carrying out data mixing storage in big data storage system

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