[go: up one dir, main page]

CN109903050A - Transaction De-weight method, transaction building method, equipment and storage medium - Google Patents

Transaction De-weight method, transaction building method, equipment and storage medium Download PDF

Info

Publication number
CN109903050A
CN109903050A CN201910157811.5A CN201910157811A CN109903050A CN 109903050 A CN109903050 A CN 109903050A CN 201910157811 A CN201910157811 A CN 201910157811A CN 109903050 A CN109903050 A CN 109903050A
Authority
CN
China
Prior art keywords
transaction
height
block
parameter
hash
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910157811.5A
Other languages
Chinese (zh)
Inventor
王志文
彭军
吴思进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN201910157811.5A priority Critical patent/CN109903050A/en
Publication of CN109903050A publication Critical patent/CN109903050A/en
Priority to PCT/CN2020/075944 priority patent/WO2020177536A1/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention provides a kind of transaction De-weight method, transaction building method, equipment and storage medium, which includes: the transaction height radix that the first transaction is generated according to the time-out information of the first transaction to be packaged;Wherein, the first block height when time-out information is traded according to construction first generates;According to transaction height radix, the permission packetization interval for allowing to be packaged lower limit parameter and allowing to be packaged the first transaction of upper limit parameter generation being pre-configured;Judge whether the first transaction is expired with the second block height currently according to permission packetization interval: it is no, then according to transaction height radix, the duplicate checking section for allowing packing lower limit parameter and the second block height generation first to trade before execution first is traded;And search whether that there are the transaction Hash of the first transaction in the transaction Hash of each block in duplicate checking section: being not execute the first transaction then.The application, which only need to carry out match query to a small amount of historical trading Hash, can be completed transaction duplicate removal, improve system performance.

Description

Transaction De-weight method, transaction building method, equipment and storage medium
Technical field
This application involves block chain technical fields, and in particular to a kind of transaction De-weight method, transaction building method, equipment and Storage medium.
Background technique
In block catenary system, block is the basic unit for forming block chain, and block is usually packaged by more transactions and At, thus the property relationship of trading processing the execution performance of entire block catenary system.
Honeysuckle problem in order to prevent, block chain node is before executing transaction, it will usually go to pending transaction Weight, i.e., whether query history block had executed the transaction, and the same transaction being performed will not be executed once again.
In currently existing scheme, the processing to transaction duplicate removal is usually directly to inquire database, and matching, which whether there is, to be repeated Transaction Hash.
The defect of above-mentioned existing scheme is, on the one hand, with the growth of block height, i.e. number of blocks increases, and needs It wants the historical trading Hash amount of match query to increase substantially, the performance of every transaction processing is seriously affected, to influence system Performance;On the other hand, it likewise as needing the historical trading Hash amount of match query to increase substantially, needs to obtain from database and go through History transaction Hash, and database access efficiency itself is lower, is restricted system performance, issued transaction amount (tps) per second It can not be promoted.
Summary of the invention
In view of drawbacks described above in the prior art or deficiency, it is intended to provide a kind of and needs to a small amount of historical trading Hash The transaction De-weight method of transaction duplicate removal, transaction building method, equipment and storage medium can be ensured by carrying out match query;Go forward side by side one Step expectation is realized without accessing database with lifting system performance.
In a first aspect, the present invention provides a kind of transaction De-weight method, it is suitable for block chain node, this method comprises:
The transaction height radix of the first transaction is generated according to the time-out information of the first transaction to be packaged;Wherein, time-out letter The first block height when breath is traded according to construction first generates;
According to transaction height radix, be pre-configured allow be packaged lower limit parameter and allow be packaged upper limit parameter generate first hand over Easy permission packetization interval;
Judge whether the first transaction is expired according to permission packetization interval and the second current block height:
It is no, then before execution first is traded according to transaction height radix, allow to be packaged lower limit parameter and the second block height Generate the duplicate checking section of the first transaction;And
Search whether that there are the transaction Hash of the first transaction in the transaction Hash of each block in duplicate checking section:
It is not execute the first transaction then.
Second aspect, the present invention provide a kind of transaction building method, are suitable for user terminal, comprising:
When construction first is traded, the first current block height is obtained, the first transaction is generated according to the first block height Time-out information;
Wherein, time-out information is used for the transaction height base for block chain link point in the transaction previous existence of packing first at the first transaction Number, according to transaction height radix, be pre-configured allow be packaged lower limit parameter and allow be packaged upper limit parameter generate first transaction Allow packetization interval, the second block height according to permission packetization interval and at this time judges whether the first transaction is expired: it is no, then exist It executes before the first transaction according to transaction height radix, allow to be packaged lower limit parameter and the second block height and generate looking into for the first transaction Weight section;And search whether that there are the transaction Hash of the first transaction in the transaction Hash of each block in duplicate checking section: being, The first transaction is not executed then.
The third 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 method that embodiment provides.
Fourth 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 method that each embodiment provides according to the present invention.
Transaction De-weight method, transaction building method, equipment and the storage medium that many embodiments of the present invention provide pass through root Block height time-out information generated when according to construction transaction generates transaction height radix, pre- further according to transaction height cardinal sum The bound parameter of configuration determines the validity period section of transaction, and being each transaction dynamic configuration, size is joined no more than bound The validity period section of the sum of number, therefore only need to carry out duplicate checking in validity period section and can ensure duplicate removal, realize an only needs pair A small amount of historical trading Hash, which carries out match query, can ensure transaction duplicate removal, to improve the performance of block catenary system;
Transaction De-weight method, transaction building method, equipment and the storage medium that some embodiments of the invention provide are further By caching the transaction Hash of (at least) a block of the sum of newest bound parameter, and duplicate checking is carried out in the buffer, further It realizes and transaction duplicate removal can be completed without accessing database, further improve system performance;
Transaction De-weight method, transaction building method, equipment and the storage medium that some embodiments of the invention provide are further Time-out information is constructed by using existing timeout parameter in certain block catenary systems and offset parameter, to pass through reusing transaction Existing field realize above-mentioned transaction duplicate removal mechanism and further improve system without constructing new field in transaction Performance;
Transaction De-weight method, transaction building method, equipment and the storage medium that some embodiments of the invention provide are further It is less than the timeout parameter of offset parameter by configuring when constructing off-line trading, block chain node is allow to identify off-line trading And using the existing duplicate removal scheme being compatible with, to realize compatible to the duplicate removal of off-line trading.
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 De-weight method that one embodiment of the invention provides.
Fig. 2 is a kind of flow chart of preferred embodiment of method shown in Fig. 1.
Fig. 3 is a kind of flow chart for transaction building method that one embodiment of the invention provides.
Fig. 4 is a kind of flow chart of preferred embodiment of method shown in Fig. 3.
Fig. 5 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 De-weight 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 De-weight method, it is suitable for block chain node, it should Method includes:
S103: the transaction height radix of the first transaction is generated according to the time-out information of the first transaction to be packaged;Wherein, surpass When information according to construction first trade when the first block height generate;
S104: according to transaction height radix, be pre-configured allow be packaged lower limit parameter and allow be packaged upper limit parameter generate The permission packetization interval of first transaction;
S105: judge whether the first transaction is expired according to permission packetization interval and the second current block height:
It is no, then follow the steps S106: before execution first is traded according to transaction height radix, allow be packaged lower limit parameter and Second block height generates the duplicate checking section of the first transaction;And
S107: search whether that there are the transaction Hash of the first transaction in the transaction Hash of each block in duplicate checking section:
It is not execute the first transaction then.
By taking the user terminal of user's first constructs a transaction tx1 when the block height of the first block chain is 4050 as an example:
The time-out information of tx1 includes timeout parameter expire and offset parameter flag, and the user terminal of user's first is in construction tx1 When get the current block height 4050 of the first block chain, configure 0x100000 for the offset parameter flag of tx1, and will The timeout parameter expire of tx1 is configured to 0x101000;
After the node of first block chain receives tx1, tx1 is broadcasted in the network of the first block chain;
When the block height of the first block chain reaches 4080, the tx1 in memory pool is packed into block by node A, this Shi Jiedian A executes above-mentioned transaction De-weight method:
In step s 103, the difference for calculating the timeout parameter expire and offset parameter flag of tx1, generates the friendship of tx1 Easy height radix txHeight=0x1000 (4096);
In step S104, according to the transaction height radix (4096) of tx1, be pre-configured allow be packaged lower limit parameter (30) With the permission packetization interval [4066,4186] for allowing to be packaged upper limit parameter (90) generation tx1;
In step s105, sentenced according to permission packetization interval [4066,4186] and the second current block height (4080) Whether disconnected tx1 is expired:
If the second current block height is not packaged tx1 not within the scope of the permission packetization interval of tx1;Its In, it will be appreciated by those skilled in the art that it is (current such as when node B processing tx1 how to handle the transaction being packaged that needs to be delayed Second block height less than 4066) and expired transaction (such as when node C processing tx1, the second current block height is big In 4186), details are not described herein again;
If tx1 is bundled in block by the second current block height within the scope of the permission packetization interval of tx1, and Before executing tx1 execute step S106: according to the transaction height radix (4096) of tx1, be pre-configured allow be packaged lower limit parameter (30) and currently the duplicate checking section [4066,4080] of the second block height (4080) generation tx1;
In step s 107, search whether exist in the transaction Hash for 15 blocks that block height is 4066-4080 The transaction Hash of tx1:
It is then to illustrate that tx1 has been packed into a certain block of 15 blocks, and have been carried out, is not repeated Execute tx1;
It is no, then execute tx1.
Specifically, in the present embodiment, each node of the first block chain is cached with (allows under packing not less than 120 respectively Limit parameter and allow to be packaged the sum of upper limit parameter) the transaction Hash of newest block, node A is cached with block height at this time and is The transaction Hash of the block of 3961-4080, therefore only need directly to be searched in the buffer in step s 107, without Database is visited again to read the transaction Hash for 15 blocks that block height is 4066-4080;In another embodiment, block The node of chain can also be configured to not cache the transaction Hash of several blocks according to actual needs, and pass through in step s 107 The transaction Hash for 15 blocks that block height is 4066-4080 is read from database to be searched.
Wherein, since the data volume of the transaction Hash of a transaction is 32 bytes, number of transaction included by each block It is limited, therefore the data volume of the transaction Hash of 120 blocks is also limited, storage will not cause shadow to system performance in the buffer It rings;In more embodiments, when be packaged lower limit parameter and allow to be packaged upper limit parameter be configured to different numerical value when, as long as no matching It is set to too big numerical value, system performance will not equally be impacted.
In the above-described embodiments, it with the user terminal of user's first when constructing tx1, trades in the first block chain of multiplexing existing Timeout field expire and offset field flag, the node of the first block chain generates the transaction of tx1 by the difference both calculated For height radix, the generating mode of structure of deal and height radix of trading to scheme provided by the present invention has carried out example The elaboration of property;In more embodiments, friendship is generated by the way of the different field that can also be traded in multiplexing different blocks chain Easy transaction height radix, or, increasing a field newly directly to record transaction height radix of transaction etc. no in structure of deal Same mode.
In the above-described embodiments, using first to generate in step S104 and S105 allows packetization interval, judges again currently The second block height whether allow packetization interval within the scope of mode;It in another embodiment, can also be by step S104 Merge with S105, directly judge whether the second block height is not less than transaction height radix and allows to be packaged the difference of lower limit parameter, And second block height whether be not more than transaction height radix and allow to be packaged the sum of upper limit parameter, it can be achieved that identical skill Art effect.
In the above-described embodiments, it is to allow packing lower limit parameter to be configured to 30, packing upper limit parameter is allowed to be configured to 90 Example, has carried out illustrative elaboration to the above method;In more embodiments, it will can also allow to be packaged lower limit according to actual needs Parameter and allow to be packaged any positive integer that upper limit parameter is configured in zone of reasonableness (it will be understood by those skilled in the art that full Pedal system demand, typically without being configured to too big number), it can be achieved that identical technical effect.
Block height time-out information generated when above-described embodiment according to construction by trading generates transaction height base Number determines the validity period section of transaction further according to the bound parameter that transaction height cardinal sum is pre-configured, dynamic for each transaction State is configured with validity period section of the size no more than the sum of bound parameter, therefore only need to carry out duplicate checking in validity period section and be It can ensure duplicate removal, realize and only need to carry out match query to a small amount of historical trading Hash to ensure transaction duplicate removal, thus Improve the performance of block catenary system;
And further by caching the transaction Hash of (at least) a block of the sum of newest bound parameter, and in the buffer Duplicate checking is carried out, is furthermore achieved and transaction duplicate removal can be completed without accessing database, further improve system performance;
Above-mentioned transaction duplicate removal mechanism is further also realized by the existing field of reusing transaction, without the structure in transaction New field is made, system performance is further improved.
Fig. 2 is a kind of flow chart of preferred embodiment of method shown in Fig. 1.As shown in Fig. 2, in a preferred embodiment In, this method further include:
S101: whether the difference of the timeout parameter and offset parameter that judge the first transaction is greater than 0:
Extremely, S103-S107 is thened follow the steps;
It is no, it thens follow the steps S102: being searched whether in the transaction Hash of all history blocks before execution first is traded There are the transaction Hash of the first transaction:
It is not execute the first transaction then.
Specifically, by taking the user terminal of user's second constructs an off-line trading tx2 as an example:
Since the user terminal of user's second is not online when constructing tx2, the current block that can not get the first block chain is high Degree, therefore can not be by generating the time-out information of tx2 according to current block height, the user terminal of user's second is by the inclined of tx2 at this time Shifting parameter flag is configured to 0x10000, and configures 0x1010 for the timeout parameter expire of tx2;
The node of first block chain is equally broadcasted in the network of the first block chain after receiving tx2;
By taking the tx2 in memory pool is packed into block when block height is 4100 by node D as an example:
In step s101, judge whether the difference of the timeout parameter expire and offset parameter flag of tx2 are greater than 0:
It is that above-mentioned steps S103-S107 then is executed to tx2;
It is no, then step S102 is executed to tx2: reading the friendship for all history blocks that block height is 1-4100 from database Easy Hash, and wherein searching whether the transaction Hash there are tx2:
It is not execute tx2 then;
It is no, then execute tx2.
Above-described embodiment is further less than the timeout parameter of offset parameter by configuring when constructing off-line trading, makes block Chain node can identify off-line trading and using the existing duplicate removal scheme being compatible with, to realize the duplicate removal to off-line trading It is compatible.
Fig. 3 is a kind of flow chart for transaction building method that one embodiment of the invention provides.Method shown in Fig. 3 can cooperate Method shown in FIG. 1 executes.
As shown in figure 3, in the present embodiment, the present invention also provides a kind of transaction building methods, it is suitable for user terminal, packet It includes:
S201: when construction first is traded, the first current block height is obtained;
S203: the time-out information of the first transaction is generated according to the first block height.
Wherein, time-out information is used for the transaction height base for block chain link point in the transaction previous existence of packing first at the first transaction Number, according to transaction height radix, be pre-configured allow be packaged lower limit parameter and allow be packaged upper limit parameter generate first transaction Allow packetization interval, the second block height according to permission packetization interval and at this time judges whether the first transaction is expired: it is no, then exist It executes before the first transaction according to transaction height radix, allow to be packaged lower limit parameter and the second block height and generate looking into for the first transaction Weight section;And search whether that there are the transaction Hash of the first transaction in the transaction Hash of each block in duplicate checking section: being, The first transaction is not executed then.
Preferably, above-mentioned time-out information includes timeout parameter and offset parameter;It is above-mentioned to generate the according to the first block height The time-out information of one transaction includes: generation offset parameter;And it generates and is greater than the super of the sum of offset parameter and first block height When parameter.
The transaction duplicate removal principle of method shown in Fig. 3 can refer to method shown in FIG. 1, and details are not described herein again.
Fig. 4 is a kind of flow chart of preferred embodiment of method shown in Fig. 3.Method shown in Fig. 4 can cooperate shown in Fig. 2 Method execute.
As shown in figure 4, in a preferred embodiment, the above method further include:
S205: when the first block height can not be got, timeout parameter is configured with less than offset parameter;
Wherein, whether timeout parameter and offset parameter are also used to judge time-out information according to the first block for block chain link point Height generates: it is no, then search whether that there are the first transaction in the transaction Hash of all history blocks before execution first is traded Transaction Hash: be not execute the first transaction then.
The transaction duplicate removal principle of method shown in Fig. 4 can refer to method shown in Fig. 2, and details are not described herein again.
Fig. 5 is a kind of structural schematic diagram for equipment that one embodiment of the invention provides.
As shown in figure 5, present invention also provides a kind of equipment 500, including one or more centres as on the other hand Unit (CPU) 501 is managed, can be added according to the program being stored in read-only memory (ROM) 502 or from storage section 508 The program that is downloaded in random access storage device (RAM) 503 and execute various movements appropriate and processing.In RAM503, also deposit It contains equipment 500 and operates required various programs and data.CPU501, ROM502 and RAM503 pass through the phase each other of bus 504 Even.Input/output (I/O) interface 505 is also connected to bus 504.
I/O interface 505 is connected to lower component: the importation 506 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 507 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 508 including hard disk etc.; And the communications portion 509 of the network interface card including LAN card, modem etc..Communications portion 509 via such as because The network of spy's net executes communication process.Driver 510 is also connected to I/O interface 505 as needed.Detachable media 511, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 510, in order to read from thereon Computer program be mounted into storage section 508 as needed.
Particularly, in accordance with an embodiment of the present disclosure, the method for any of the above-described embodiment description may be implemented as computer Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be tangibly embodied in machine readable Computer program on medium, the computer program include the program code for executing the above method.In such implementation In example, which can be downloaded and installed from network by communications portion 509, and/or from detachable media 511 It 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 by one or more than one processor is described in method provided by the present application.
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 (9)

1.一种交易去重方法,适用于区块链节点,其特征在于,所述方法包括:1. A transaction deduplication method, suitable for blockchain nodes, characterized in that the method comprises: 根据待打包的第一交易的超时信息生成所述第一交易的交易高度基数;其中,所述超时信息根据构造所述第一交易时的第一区块高度生成;The transaction height base of the first transaction is generated according to the timeout information of the first transaction to be packaged; wherein, the timeout information is generated according to the first block height when the first transaction is constructed; 根据所述交易高度基数、预配置的允许打包下限参数和允许打包上限参数生成所述第一交易的允许打包区间;Generate the allowable packing interval of the first transaction according to the transaction height base, the preconfigured allowable packing lower limit parameter and the allowable packing upper limit parameter; 根据所述允许打包区间和当前的第二区块高度判断所述第一交易是否过期:Determine whether the first transaction has expired according to the allowable packaging interval and the current second block height: 否,则在执行所述第一交易前根据所述交易高度基数、所述允许打包下限参数和所述第二区块高度生成所述第一交易的查重区间;以及,No, before executing the first transaction, generate the duplicate checking interval of the first transaction according to the transaction height base, the allowable packaging lower limit parameter and the second block height; and, 在所述查重区间的各区块的交易哈希中查找是否存在所述第一交易的交易哈希:Find out whether the transaction hash of the first transaction exists in the transaction hash of each block in the duplicate checking interval: 是,则不执行所述第一交易。Yes, the first transaction is not executed. 2.根据权利要求1所述的方法,其特征在于,区块链节点缓存有不小于第一数量个最新区块的交易哈希,所述第一数量为所述允许打包下限参数和所述允许打包上限参数之和;2 . The method according to claim 1 , wherein the blockchain node caches transaction hashes of no less than a first number of latest blocks, and the first number is the allowable packaging lower limit parameter and the The sum of the upper bound parameters is allowed to be packed; 所述在所述查重区间的各区块的交易哈希中查找是否存在所述第一交易的交易哈希包括:The searching for whether the transaction hash of the first transaction exists in the transaction hash of each block in the duplicate checking interval includes: 在所缓存的所述查重区间的各区块的交易哈希中查找是否存在所述第一交易的交易哈希。Find out whether there is a transaction hash of the first transaction in the cached transaction hashes of each block in the duplicate checking interval. 3.根据权利要求1所述的方法,其特征在于,所述超时信息包括超时参数和偏移参数,所述超时参数大于所述偏移参数与所述第一区块高度之和;3. The method according to claim 1, wherein the timeout information comprises a timeout parameter and an offset parameter, and the timeout parameter is greater than the sum of the offset parameter and the height of the first block; 所述根据待打包的第一交易的超时信息生成所述第一交易的交易高度基数包括:The generating the transaction height base of the first transaction according to the timeout information of the first transaction to be packaged includes: 通过计算所述第一交易的超时参数与偏移参数之差生成所述第一交易的交易高度基数。The transaction height base of the first transaction is generated by calculating the difference between the timeout parameter and the offset parameter of the first transaction. 4.根据权利要求3所述的方法,其特征在于,还包括:4. The method of claim 3, further comprising: 判断所述第一交易的超时参数与偏移参数之差是否大于0:Determine whether the difference between the timeout parameter of the first transaction and the offset parameter is greater than 0: 是,则执行所述根据待打包的第一交易的超时信息生成所述第一交易的交易高度基数,及后续步骤;If yes, then execute the generating of the transaction height base of the first transaction according to the timeout information of the first transaction to be packaged, and the subsequent steps; 否,则在执行所述第一交易前在所有历史区块的交易哈希中查找是否存在所述第一交易的交易哈希:If not, before executing the first transaction, check whether the transaction hash of the first transaction exists in the transaction hashes of all historical blocks: 是,则不执行所述第一交易。Yes, the first transaction is not executed. 5.一种交易构造方法,适用于用户端,其特征在于,所述方法包括:5. A transaction construction method, suitable for a user terminal, characterized in that the method comprises: 在构造第一交易时,获取当前的第一区块高度,根据所述第一区块高度生成所述第一交易的超时信息;When constructing the first transaction, obtain the current first block height, and generate the timeout information of the first transaction according to the first block height; 其中,所述超时信息用于供区块链节点在打包所述第一交易前生成所述第一交易的交易高度基数,根据所述交易高度基数、预配置的允许打包下限参数和允许打包上限参数生成所述第一交易的允许打包区间,根据所述允许打包区间和此时的第二区块高度判断所述第一交易是否过期:否,则在执行所述第一交易前根据所述交易高度基数、所述允许打包下限参数和所述第二区块高度生成所述第一交易的查重区间;以及,在所述查重区间的各区块的交易哈希中查找是否存在所述第一交易的交易哈希:是,则不执行所述第一交易。Wherein, the timeout information is used for the blockchain node to generate the transaction height base of the first transaction before packaging the first transaction. The parameter generates the allowable packing interval of the first transaction, and judges whether the first transaction has expired according to the allowable packing interval and the height of the second block at this time: No, before executing the first transaction, according to the The transaction height base, the allowable packing lower limit parameter and the second block height generate the duplicate checking interval of the first transaction; Transaction hash of the first transaction: Yes, the first transaction is not executed. 6.根据权利要求5所述的方法,其特征在于,所述超时信息包括超时参数和偏移参数;6. The method according to claim 5, wherein the timeout information comprises a timeout parameter and an offset parameter; 所述根据所述第一区块高度生成所述第一交易的超时信息包括:The generating the timeout information of the first transaction according to the first block height includes: 生成偏移参数;generate offset parameters; 生成大于所述偏移参数与所述第一区块高度之和的超时参数。A timeout parameter greater than the sum of the offset parameter and the first block height is generated. 7.根据权利要求6所述的方法,其特征在于,还包括:7. The method of claim 6, further comprising: 在无法获取到所述第一区块高度时,将所述超时参数配置为小于所述偏移参数;When the height of the first block cannot be obtained, configure the timeout parameter to be smaller than the offset parameter; 其中,所述超时参数和所述偏移参数还用于供区块链节点判断所述超时信息是否根据所述第一区块高度生成:否,则在执行所述第一交易前在所有历史区块的交易哈希中查找是否存在所述第一交易的交易哈希:是,则不执行所述第一交易。Wherein, the timeout parameter and the offset parameter are also used for the blockchain node to judge whether the timeout information is generated according to the first block height: if not, then all the historical Check whether the transaction hash of the first transaction exists in the transaction hash of the block: if yes, the first transaction will not be executed. 8.一种设备,其特征在于,所述设备包括:8. A device, characterized in that the device comprises: 一个或多个处理器;one or more processors; 存储器,用于存储一个或多个程序,memory for storing one or more programs, 当所述一个或多个程序被所述一个或多个处理器执行时,使得所述一个或多个处理器执行如权利要求1-7中任一项所述的方法。The one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-7. 9.一种存储有计算机程序的存储介质,其特征在于,该程序被处理器执行时实现如权利要求1-7中任一项所述的方法。9. A storage medium storing a computer program, characterized in that, when the program is executed by a processor, the method according to any one of claims 1-7 is implemented.
CN201910157811.5A 2019-03-02 2019-03-02 Transaction De-weight method, transaction building method, equipment and storage medium Pending CN109903050A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910157811.5A CN109903050A (en) 2019-03-02 2019-03-02 Transaction De-weight method, transaction building method, equipment and storage medium
PCT/CN2020/075944 WO2020177536A1 (en) 2019-03-02 2020-02-20 Transaction deduplication method, transaction construction method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910157811.5A CN109903050A (en) 2019-03-02 2019-03-02 Transaction De-weight method, transaction building method, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN109903050A true CN109903050A (en) 2019-06-18

Family

ID=66946178

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910157811.5A Pending CN109903050A (en) 2019-03-02 2019-03-02 Transaction De-weight method, transaction building method, equipment and storage medium

Country Status (2)

Country Link
CN (1) CN109903050A (en)
WO (1) WO2020177536A1 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110910091A (en) * 2019-11-19 2020-03-24 腾讯科技(深圳)有限公司 Data processing method, device and medium
CN110992009A (en) * 2019-12-04 2020-04-10 杭州复杂美科技有限公司 Delayed transaction advanced processing method, device and storage medium
WO2020177536A1 (en) * 2019-03-02 2020-09-10 杭州复杂美科技有限公司 Transaction deduplication method, transaction construction method, device and storage medium
CN113190567A (en) * 2021-04-28 2021-07-30 支付宝(杭州)信息技术有限公司 Transaction detection method and device
CN113688122A (en) * 2021-06-09 2021-11-23 上海万物新生环保科技集团有限公司 Data deduplication method and equipment
WO2022148320A1 (en) * 2021-01-11 2022-07-14 杭州复杂美科技有限公司 Transaction execution method, computer device, and storage medium
CN117009313A (en) * 2022-04-28 2023-11-07 腾讯科技(深圳)有限公司 Transaction processing method and device based on blockchain, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160218879A1 (en) * 2015-01-23 2016-07-28 Daniel Robert Ferrin Method and apparatus for the limitation of the mining of blocks on a block chain
CN106991607A (en) * 2017-03-29 2017-07-28 杭州秘猿科技有限公司 A kind of unordered transaction control method based on block chain account model
CN108764870A (en) * 2018-05-29 2018-11-06 阿里巴巴集团控股有限公司 Blockchain-based transaction processing method, device, and electronic equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106815722B (en) * 2016-12-22 2021-05-07 中钞信用卡产业发展有限公司杭州区块链技术研究院 Blockchain-based information processing method and device
US10560270B2 (en) * 2017-05-03 2020-02-11 International Business Machines Corporation Optimal data storage configuration in a blockchain
CN109150598B (en) * 2018-08-10 2021-09-03 上交所技术有限责任公司 BFT consensus algorithm bandwidth utilization rate improvement method based on block slice
CN109903050A (en) * 2019-03-02 2019-06-18 杭州复杂美科技有限公司 Transaction De-weight method, transaction building method, equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160218879A1 (en) * 2015-01-23 2016-07-28 Daniel Robert Ferrin Method and apparatus for the limitation of the mining of blocks on a block chain
CN106991607A (en) * 2017-03-29 2017-07-28 杭州秘猿科技有限公司 A kind of unordered transaction control method based on block chain account model
CN108764870A (en) * 2018-05-29 2018-11-06 阿里巴巴集团控股有限公司 Blockchain-based transaction processing method, device, and electronic equipment

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020177536A1 (en) * 2019-03-02 2020-09-10 杭州复杂美科技有限公司 Transaction deduplication method, transaction construction method, device and storage medium
CN110910091A (en) * 2019-11-19 2020-03-24 腾讯科技(深圳)有限公司 Data processing method, device and medium
CN110992009A (en) * 2019-12-04 2020-04-10 杭州复杂美科技有限公司 Delayed transaction advanced processing method, device and storage medium
WO2022148320A1 (en) * 2021-01-11 2022-07-14 杭州复杂美科技有限公司 Transaction execution method, computer device, and storage medium
CN113190567A (en) * 2021-04-28 2021-07-30 支付宝(杭州)信息技术有限公司 Transaction detection method and device
CN113688122A (en) * 2021-06-09 2021-11-23 上海万物新生环保科技集团有限公司 Data deduplication method and equipment
CN117009313A (en) * 2022-04-28 2023-11-07 腾讯科技(深圳)有限公司 Transaction processing method and device based on blockchain, equipment and storage medium

Also Published As

Publication number Publication date
WO2020177536A1 (en) 2020-09-10

Similar Documents

Publication Publication Date Title
CN109903050A (en) Transaction De-weight method, transaction building method, equipment and storage medium
CN109408551B (en) Data query method and system, consensus method and system, device and storage medium
US11455304B2 (en) Graph-based predictive cache
US10872095B2 (en) Aggregation framework system architecture and method
US12026160B2 (en) Query plan cache in database systems
CN109359222A (en) Date storage method and system, equipment and storage medium
US20070266029A1 (en) Recovery segment identification in a computing infrastructure
US20110320394A1 (en) Creation and Revision of Network Object Graph Topology for a Network Performance Management System
US20150278295A1 (en) Aggregation framework system architecture and method
CN109726174A (en) Data archiving method, system, equipment and storage medium
CN111859027A (en) Graph computing method and device
WO2017053904A1 (en) Distributed graph database
CN106981024B (en) Transaction limit calculation processing system and processing method thereof
CN110036381B (en) In-memory data search technology
CN107729371A (en) The data directory and querying method of block chain, device, equipment and storage medium
US20250021556A1 (en) Multi-phase query plan caching
CN109213604A (en) A kind of management method and device of data source
CN118349178A (en) Data storage method, device, electronic device and computer readable medium
CN110502472A (en) A kind of the cloud storage optimization method and its system of large amount of small documents
CN109614411A (en) Date storage method, equipment and storage medium
CN110209744A (en) Relevant database and its operating method and device based on alliance's chain
CN113609130B (en) Method, device, electronic equipment and storage medium for acquiring gateway access data
CN115935016A (en) A multi-source heterogeneous data management method, system, storage medium and electronic equipment
CN102833295B (en) Data manipulation method and device in distributed cache system
CN117216075B (en) Method and device for constructing father-son document of express order and electronic equipment

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190618