CN106886890B - Block chain-based timed transaction execution method - Google Patents

Block chain-based timed transaction execution method Download PDF

Info

Publication number
CN106886890B
CN106886890B CN201710066749.XA CN201710066749A CN106886890B CN 106886890 B CN106886890 B CN 106886890B CN 201710066749 A CN201710066749 A CN 201710066749A CN 106886890 B CN106886890 B CN 106886890B
Authority
CN
China
Prior art keywords
transaction
block
timing
height
queue
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
CN201710066749.XA
Other languages
Chinese (zh)
Other versions
CN106886890A (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 Rivtower Technology Co Ltd
Original Assignee
Hangzhou Rivtower 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 Rivtower Technology Co Ltd filed Critical Hangzhou Rivtower Technology Co Ltd
Priority to CN201710066749.XA priority Critical patent/CN106886890B/en
Publication of CN106886890A publication Critical patent/CN106886890A/en
Application granted granted Critical
Publication of CN106886890B publication Critical patent/CN106886890B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/22Payment schemes or models
    • G06Q20/223Payment schemes or models based on the use of peer-to-peer networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Accounting & Taxation (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer And Data Communications (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention discloses a block chain-based timed transaction execution method, which adds a 'timing height' and 'whether to be delayed' logic for transactions, records a 'timing queue' for each 'timing height' and a 'forward delay queue' function of a full chain to mark and buffer the timed transactions in blocks. Meanwhile, the nodes follow specific priorities and are sequentially processed according to the maximum capacity so as to achieve the function of timing transaction. The method solves the problem that a block chain has no timing mechanism, reduces the uncertainty that the transaction can be packed only when the transaction is broadcasted, and can enable a user to select whether the transaction is delayed or not by considering the problem of the maximum capacity of the block, thereby meeting different requirements of the user.

Description

Block chain-based timed transaction execution method
Technical Field
The invention adds a transaction execution sequence protocol, in particular rules and a method of a timing function thereof, on the basis of the existing block chain protocol.
Background
The block chain is a new distributed technology, and comprises transaction composition blocks which are sequentially arranged one by one, and a block composition chain which is sequentially arranged one by one, wherein each block comprises a self-increment height as a serial number, and a timestamp for recording the packing time. The security of the user data depends on a public and private key system, only the transaction signed by the user private key is a legal transaction, so that others cannot initiate the transaction instead, and each transaction only has a unique ID to ensure that the transaction cannot be initiated repeatedly.
Each operation of a user needs to actively sign and broadcast a new transaction into a network, but due to the distributed characteristic of the network, the transaction has various factors such as certain loss probability, time for broadcasting and accessing the network, time for packing and accessing the blocks by nodes, waiting for queuing when the network is congested, unfixed time interval for outputting the blocks and the like, so that the user cannot completely control the height at which the transaction is packed. If a user needs to pack a transaction at a certain time (height), the user can only manually initiate or write a client timing script mode at present, the transaction is broadcast near the time point, then a period of randomness time needs to be waited for to check the height of the transaction, and if the result of the block entry is not achieved for a long time, the transaction is inferred to have failed and needs to be initiated again.
Disclosure of Invention
The invention aims to overcome the defects in the prior art and provide a block chain-based timed transaction execution method.
The purpose of the invention is realized by the following technical scheme: a block chain-based timed transaction execution method comprises the following steps:
(1) when the block chain is started from the creation block, the timing queues of all heights are set to be empty, and the forward delay queues of the whole chain are set to be empty.
(2) Each time the node is started, the local "unprocessed transaction pool" is set to empty.
(3) When a user initiates each transaction, a 'timing height' field and a 'forward delay or not' field are designated, a transaction ID is generated, and then a signature broadcast is carried out.
(4) After receiving each transaction and verifying the signature, the node joins the local "unprocessed transaction pool" and continues broadcasting.
(5) Firstly, setting the block maximum capacity according to the block physical size or calculation amount limit, then extracting transactions according to the following priority and packaging:
(5.1) when a certain 'block-out height' packages the transaction, firstly, extracting the transaction from the head to the tail of the 'timing queue' of the current 'block-out height', and packaging according to 'block maximum capacity'. If the block capacity of the current height is insufficient, judging whether the field of the residual transactions in the timing queue of the current height is forward-delayed or not, adding the tail of the forward-delayed queue of the whole chain for the transactions of yes, and not operating for the transactions of no.
(5.2) if the transaction processing in the "timing queue" of the current "out-of-block height" is complete and the block still has capacity, then the transaction is extracted from the full chain "forward-delay queue" and packed.
(5.3) if the 'forward queue' of the full chain is processed and the block still has capacity, extracting the transaction from the 'unprocessed transaction pool' and packaging. If the timing height of the transaction is less than or equal to the block outlet height, packaging and executing the transaction; if it is greater than the "out-of-block height", the transaction is packed but not executed and added to the tail of the "timing queue" at that "timing height".
Further, in the above method, the user revokes the transaction by:
(1) the user may initiate a "revoke transaction" that revokes a timed transaction, specify a "to-be-revoked transaction ID," and sign the broadcast.
(2) When the node packs the 'cancel transaction', firstly, the 'to-be-cancelled transaction' is found according to the ID, the original initiating user is verified to be consistent with the initiating user of the 'cancel transaction', and the set 'timing height' is larger than the current 'block-out height', the transaction of the ID is deleted from the 'timing queue', otherwise, the transaction is illegally cancelled.
The invention has the beneficial effects that: the method solves the problem that a block chain has no timing mechanism, reduces the uncertainty that the transaction can be packed only when the transaction is broadcasted, and can enable a user to select whether the transaction is delayed or not by considering the problem of the maximum capacity of the block, thereby meeting different requirements of the user.
Drawings
FIG. 1 is a flow chart of the method of the present invention.
Detailed Description
The invention relates to a block chain-based timed transaction execution method, as shown in fig. 1, comprising the following steps:
step 1: when the block chain is started from the creation block, the timing queues of all heights are set to be empty, and the forward delay queues of the whole chain are set to be empty.
1.1: the queue is not required to be an actual data storage structure in the block, but only a logic structure of the chain, and can be directly cached in the memory without being stored on the chain.
Step 2: each time the node is started, the local "unprocessed transaction pool" is set to empty.
And step 3: when a user initiates each transaction, a 'timing height' field and a 'forward delay or not' field are designated, a transaction ID is generated, and then a signature broadcast is carried out.
The user needs to pay attention before setting the timing transaction at a certain height, if the existing 'timing queue' at the height may exceed the 'block maximum capacity', the subsequent transaction to be executed may be input into the 'forward delay queue' during execution, the packaging at the set height cannot be guaranteed, and the timing height may need to be modified. The user may set the "timing height" to 0 or other smaller value if he wishes to simply set the transaction to take effect immediately.
And 4, step 4: after receiving each transaction and verifying the signature, the node joins the local "unprocessed transaction pool" and continues broadcasting.
And 5: firstly, setting the block maximum capacity according to the block physical size or calculation amount limit, then extracting transactions according to the following priority and packaging:
step 5.1: when a certain 'block-out height' is used for packaging transaction, firstly, the transaction is extracted from the 'timing queue' of the current 'block-out height' from beginning to end, and the transaction is packaged according to 'maximum block capacity'. If the block capacity of the current height is insufficient, judging whether the field of the residual transactions in the timing queue of the current height is forward-delayed or not, adding the tail of the forward-delayed queue of the whole chain for the transactions of yes, and not operating for the transactions of no.
Step 5.2: if the transaction processing in the "timing queue" of the current "out-of-block height" is complete and the block still has capacity, the transaction is extracted from the full chain "forward-delay queue" and packed.
Step 5.3: if the 'forward queue' of the full chain is processed and the block still has capacity, then the transaction is extracted from the 'unprocessed transaction pool' and packed. If the timing height of the transaction is less than or equal to the block outlet height, packaging and executing the transaction; if it is greater than the "out-of-block height", the transaction is packed but not executed and added to the tail of the "timing queue" at that "timing height".
The packing sequence rule is a bottom-layer protocol, and as other nodes reserve the same timing queue and the same forward delay queue, the same sequence verification can be carried out according to the block maximum capacity of a new block so as to determine whether the block is legal or not.
In addition, the user may initiate a "revoke transaction" that revokes certain timed transactions, specify a "to-revoke transaction ID," and sign the broadcast. When the node packs the 'cancel transaction', firstly, the 'to-be-cancelled transaction' is found according to the ID, the original initiating user is verified to be consistent with the initiating user of the 'cancel transaction', and the set 'timing height' is larger than the current 'block-out height', the transaction of the ID is deleted from the 'timing queue', otherwise, the transaction is illegally cancelled.

Claims (2)

1. A block chain-based timed transaction execution method is characterized by comprising the following steps:
(1) when a block chain is started from a creation block, setting timing queues at all heights to be empty, and setting forward delay queues of the whole chain to be empty;
(2) when the node is started each time, setting a local unprocessed transaction pool to be empty;
(3) when a user initiates each transaction, a 'timing height' field and a 'whether forward delay' field are designated, a transaction ID is generated, and then signature broadcasting is carried out;
(4) after receiving each transaction and verifying the signature, the node adds the transaction into a local unprocessed transaction pool and continues broadcasting;
(5) firstly, setting the block maximum capacity according to the block physical size or calculation amount limit, then extracting transactions according to the following priority and packaging:
(5.1) when a certain 'block-out height' packages the transaction, firstly, extracting the transaction from the beginning to the end of a 'timing queue' of the current 'block-out height', and packaging according to 'maximum block capacity'; if the block capacity of the current height is insufficient, judging whether the field of the residual transaction in the timing queue of the current height is forward-delayed or not, adding the tail of a forward-delayed queue of the whole chain for the transaction with the positive value, and not operating for the transaction with the negative value;
(5.2) if the transaction processing in the timing queue of the current 'out-of-block height' is finished and the block still has capacity, extracting the transaction from the 'forward delay queue' of the full chain and packaging;
(5.3) if the processing of the 'forward delay queue' of the whole chain is finished and the block still has capacity, extracting the transaction from the 'unprocessed transaction pool' and packaging; if the timing height of the transaction is less than or equal to the block outlet height, packaging and executing the transaction; if it is greater than the "out-of-block height", the transaction is packed but not executed and added to the tail of the "timing queue" at that "timing height".
2. The method of claim 1, wherein the user revokes the transaction by:
(1) the user can initiate a 'cancel transaction' for canceling a certain timing transaction, designate a 'transaction ID to be canceled' and sign and broadcast;
(2) when the node packs the 'cancel transaction', firstly, the 'transaction to be canceled' is found according to the ID, the original initiating user is verified to be consistent with the initiating user of the 'cancel transaction', and the set 'timing height' is larger than the current 'block-out height', the transaction of the ID is deleted from the 'timing queue', otherwise, the transaction is illegally canceled.
CN201710066749.XA 2017-02-07 2017-02-07 Block chain-based timed transaction execution method Active CN106886890B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710066749.XA CN106886890B (en) 2017-02-07 2017-02-07 Block chain-based timed transaction execution method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710066749.XA CN106886890B (en) 2017-02-07 2017-02-07 Block chain-based timed transaction execution method

Publications (2)

Publication Number Publication Date
CN106886890A CN106886890A (en) 2017-06-23
CN106886890B true CN106886890B (en) 2020-07-17

Family

ID=59179175

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710066749.XA Active CN106886890B (en) 2017-02-07 2017-02-07 Block chain-based timed transaction execution method

Country Status (1)

Country Link
CN (1) CN106886890B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107688999B (en) * 2017-08-11 2020-11-13 杭州溪塔科技有限公司 Block chain-based parallel transaction execution method
CN108881433A (en) * 2018-06-15 2018-11-23 孙念 Information time controlled released or sending method and device based on block chain
CN109325762B (en) * 2018-08-30 2020-07-10 杭州复杂美科技有限公司 Parallel chain cross-chain transaction method, equipment and storage medium
CN109726146B (en) * 2018-12-29 2020-12-15 杭州趣链科技有限公司 Scalable caching method based on block height customizable elimination strategy
CN111078696A (en) * 2019-12-04 2020-04-28 杭州复杂美科技有限公司 Block generation method, device and storage medium
CN111324449A (en) * 2019-12-13 2020-06-23 杭州复杂美科技有限公司 Transaction storage and broadcasting method, device and storage medium of memory pool
CN110738497B (en) * 2019-12-19 2020-03-31 腾讯科技(深圳)有限公司 Data processing method and device, node equipment and storage medium
CN111415259B (en) * 2020-03-26 2024-02-06 杭州复杂美科技有限公司 Transaction queuing method, device and storage medium
CN111510450B (en) * 2020-04-13 2021-02-05 西安电子科技大学 Block chain link point identity verification method
CN112711600A (en) * 2020-12-30 2021-04-27 普华云创科技(北京)有限公司 Method and system for setting transaction delayed uplink

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007027488A2 (en) * 2005-08-29 2007-03-08 Harris Corporation System, methods, and program product to trace content genealogy
CN105469510B (en) * 2014-10-12 2018-01-09 吴思进 The encryption currency wallet that delay pays or given for change can be predicted
CN105719185B (en) * 2016-01-22 2019-02-15 杭州复杂美科技有限公司 The data comparison and common recognition method of block chain
CN105761146B (en) * 2016-01-24 2021-06-01 杭州复杂美科技有限公司 Block chain matching exchange
CN105976246A (en) * 2016-04-29 2016-09-28 北京太云科技有限公司 Block chain-based digital asset superposition method and device

Also Published As

Publication number Publication date
CN106886890A (en) 2017-06-23

Similar Documents

Publication Publication Date Title
CN106886890B (en) Block chain-based timed transaction execution method
CN106991607B (en) Disordered transaction control method based on block chain account model
US8018973B2 (en) Method to accurately and securely determine propagation delay and distance between sending and receiving node in packet network using cut-through approach and packet network node for executing the method
JP5514913B2 (en) Method for processing data packets within a flow-aware network node
CN103631661B (en) A kind of EMS memory management process and device
CN110738497B (en) Data processing method and device, node equipment and storage medium
US8391167B2 (en) Method to precisely and securely determine propagation delay and distance between sending and receiving node in packet network and packet network node system for executing the method
CN108400927B (en) Message pushing method and device for high-concurrency messages
CN103647726B (en) Message dispatching method and device thereof
JP2018514804A5 (en)
CN112463066B (en) Method and equipment for controlling burst service quality of distributed block storage logical volume
WO2017107812A1 (en) User log storage method and device
WO2017161967A1 (en) Method of monitoring data traffic in packets per second, device, and computer storage medium
CN110247942A (en) A kind of data transmission method for uplink, device and readable medium
CN115102908B (en) Method for generating network message based on bandwidth control and related device
US8717891B2 (en) Shaping apparatus and method
CN112995064B (en) Time-sensitive network message forwarding method, device, terminal and storage medium
US9166804B2 (en) Packet transmission control device, packet transmission control method, and program
CN105813037A (en) Short message parallel sending business processing method and device
CN110445580A (en) Data transmission method for uplink and device, storage medium, electronic device
US20160085683A1 (en) Data receiving device and data receiving method
CN106657092B (en) Service processing method and device based on SS L/T L S
CN113079114B (en) Data packet receiving method, device, terminal and storage medium
CN104427181A (en) Image forming apparatus and image forming method
TWI357571B (en) Method for accessing first-in-first-out buffer and

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200326

Address after: 310012 no.1001, 10 / F, block a, Huaxing Times Square, No.478, Wensan Road, Xihu District, Hangzhou City, Zhejiang Province

Applicant after: Hangzhou Xita Technology Co.,Ltd.

Address before: Seven 310030 Hangzhou Road, Zhejiang province Xihu District three Town Xiyuan No. 3 Building 3 Room 203

Applicant before: CRYPTAPE Co.,Ltd.

GR01 Patent grant
GR01 Patent grant