CN112347193A - Transaction packaging method and device based on block chain and electronic equipment - Google Patents
Transaction packaging method and device based on block chain and electronic equipment Download PDFInfo
- Publication number
- CN112347193A CN112347193A CN202011368260.6A CN202011368260A CN112347193A CN 112347193 A CN112347193 A CN 112347193A CN 202011368260 A CN202011368260 A CN 202011368260A CN 112347193 A CN112347193 A CN 112347193A
- Authority
- CN
- China
- Prior art keywords
- transaction
- candidate block
- candidate
- consensus
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 61
- 238000004806 packaging method and process Methods 0.000 title claims abstract description 37
- 230000008569 process Effects 0.000 claims abstract description 21
- 238000012856 packing Methods 0.000 claims description 23
- 238000001514 detection method Methods 0.000 claims description 17
- 230000002265 prevention Effects 0.000 claims description 9
- 230000000977 initiatory effect Effects 0.000 claims description 7
- 238000004590 computer program Methods 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 5
- 230000000694 effects Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000002776 aggregation Effects 0.000 description 1
- 238000004220 aggregation Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000004069 differentiation Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000005065 mining Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
- G06F16/215—Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/389—Keeping log of transactions for guaranteeing non-repudiation of a transaction
Abstract
The application provides a block chain-based transaction packaging method and device and electronic equipment, and the method comprises the following steps: carrying out duplicate removal processing on a plurality of transaction records in the transaction set list; packaging the rest transaction records in the transaction set list to generate a plurality of candidate blocks; placing a plurality of candidate blocks into a candidate block queue; at the beginning of the consensus process, a given candidate block is pulled from the candidate block queue to initiate consensus. Therefore, in the packaging stage of the consensus process, the specified candidate block can be directly pulled from the candidate block queue to send the consensus, and the transaction record does not need to be pulled from the transaction pool to be packaged, so that the consensus efficiency is improved, and the consensus time is shortened.
Description
Technical Field
The present disclosure relates to the field of blockchain technologies, and in particular, to a method and an apparatus for packaging transactions based on blockchains, an electronic device, and a computer-readable storage medium.
Background
The blockchain is a distributed account book, and a technical scheme for collectively maintaining a reliable database in a decentralized and trust-removing mode.
One block record is a bill, and a plurality of transaction records are stored in the bill, which is the most powerful proof of specific activities of the buyer and the seller, such as the purchase record of us on the Taobao, and the bill for our consumption. The daily consumption records of people are continuously increased and cannot be always put in one block, so that with the increase of sales records, new blocks need to be continuously generated to store the data.
In order to avoid the situation that the same transaction record is repeatedly packed into a block, in the existing technical scheme of the block chain of the alliance chain, transaction anti-replay is firstly carried out, then transaction packing and serialization are carried out at the initial stage of consensus, and if the transaction data volume is large, the two processes can strictly influence the efficiency of consensus.
Disclosure of Invention
The embodiment of the application provides a transaction packaging method based on a block chain, which is used for improving consensus efficiency while preventing replay.
The embodiment of the application provides a transaction packaging method based on a block chain, which comprises the following steps:
carrying out duplicate removal processing on a plurality of transaction records in the transaction set list;
packaging the rest transaction records in the transaction set list to generate a plurality of candidate blocks;
placing the plurality of candidate blocks into a candidate block queue;
at the beginning of the consensus process, a given candidate block is pulled from the candidate block queue to initiate consensus.
In one embodiment, the deduplication processing of multiple transaction records in the transaction collection list includes:
and carrying out double-flower prevention detection on each transaction record, and removing the transaction records which fail to pass the double-flower prevention detection.
In one embodiment, the performing the anti-double-blossom detection on each transaction record and removing the transaction record which fails the anti-double-blossom detection includes:
locking each transaction record in sequence, judging whether the hash value of the locked transaction record is the same as the hash values of the other transaction records, and if so, removing the locked transaction record.
In an embodiment, the packaging the remaining transaction records in the transaction set list to generate a plurality of candidate blocks includes:
and arranging the rest transaction records in the transaction set list according to the time sequence, and packing the transaction records in sequence to generate a plurality of candidate blocks.
In one embodiment, the pulling of the specified candidate block from the candidate block queue initiates consensus, comprising:
and pulling the current first candidate block from the candidate block queue to initiate consensus.
In one embodiment, the pulling of the specified candidate block from the candidate block queue initiates consensus, comprising:
pulling the candidate block with the earliest current timestamp from the candidate block queue to initiate consensus.
In an embodiment, after the pulling of the specified candidate block from the candidate block queue initiates consensus, the method further comprises:
removing the designated candidate block in the candidate block queue;
after the designated candidate block is successfully identified, judging whether a transaction record with the same hash value exists in a transaction list contained in the current first candidate block in the candidate block queue and the transaction list contained in the designated candidate block;
and if so, removing the transaction records with the same hash value in the first candidate block.
In one embodiment, before the deduplication processing is performed on the plurality of transaction records in the transaction collection list, the method further includes:
receiving a transaction record sent by a client, and adding the transaction record into a queue to be detected;
and starting an asynchronous thread, and pulling a plurality of transaction records in the queue to be detected to form the transaction set list through the asynchronous thread.
In one embodiment, the de-duplication processing and the packing of the candidate tiles are performed iteratively by different asynchronous threads.
The embodiment of the application provides a trade packing apparatus based on block chain, includes:
the duplicate removal processing module is used for carrying out duplicate removal processing on a plurality of transaction records in the transaction set list;
the packing candidate module is used for packing the rest transaction records in the transaction set list to generate a plurality of candidate blocks;
the queue adding module is used for placing the candidate blocks into a candidate block queue;
and the consensus initiating module is used for pulling the specified candidate block from the candidate block queue to initiate consensus when a consensus process starts.
An embodiment of the present application provides an electronic device, which includes:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to execute the above block chain based transaction packaging method.
The embodiment of the present application provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is executable by a processor to implement the above block chain based transaction packaging method.
According to the technical scheme provided by the embodiment of the application, before the consensus process is started, the transaction records are packaged in advance in the anti-replay stage, so that in the packaging stage of the consensus process, the specified candidate blocks can be directly pulled from the candidate block queue to send the consensus, and the transaction records do not need to be pulled from the transaction pool to be packaged, so that the consensus efficiency is improved, and the consensus time is shortened.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic view of an application scenario of a block chain-based transaction packaging method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a framework of an electronic device provided by an embodiment of the present application;
fig. 3 is a schematic flowchart of a transaction packaging method based on a blockchain according to an embodiment of the present application;
fig. 4 is a schematic flow chart of a transaction packaging method based on a blockchain according to another embodiment of the present application;
fig. 5 is a block diagram of a transaction packaging apparatus based on a blockchain according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
Like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Fig. 1 is a schematic application scenario diagram of a block chain-based transaction packaging method according to an embodiment of the present application. As shown in fig. 1, the application scenario includes a plurality of clients 11 and a plurality of blockchain nodes 12. Blockchain nodes 12 refer to computers, handsets, mining machines, servers, etc. in a blockchain network. The client 11 may be a computer, smart phone, etc. running a software application. The software application may be a shopping-type software application, a money transfer-type software application, or the like. The client 11 and the block chain node 12, and the plurality of block chain nodes 12 are connected through a network. A P2P (peer-to-peer) network architecture is adopted between blockchain nodes 12. I.e., each blockchain node 12 is peer-to-peer with each other, the nodes collectively provide service, and there is no special node. In one embodiment, the blockchain nodes 12 may be members of a federation chain, and the consensus mechanism may employ a consensus algorithm such as equity certification or PBTF (pragmatine fault tolerance), the consensus process of which is controlled by a preselected node.
In the prior art, when a block chain node 12 receives a transaction record, transaction anti-double-blossom detection is firstly carried out, the detected transaction record is stored in a transaction pool, and then the transaction record is pulled from the transaction pool to be packaged at the stage of consensus starting, so that a block is generated. The packaging of the transaction at the beginning of the consensus takes more time, which affects the consensus progress.
In the embodiment of the application, the blockchain node 12 firstly performs deduplication processing on a plurality of transaction records in the transaction set list; then packaging the rest transaction records in the transaction set list to generate a plurality of candidate blocks; putting a plurality of candidate blocks into a candidate block queue; then, in the packing stage of the consensus process, a specified candidate block is pulled from the candidate block queue to initiate consensus. Therefore, in the consensus stage, the packed candidate blocks are directly pulled to initiate consensus, the blocks do not need to be packed, and the consensus efficiency is improved.
Fig. 2 is a schematic frame diagram of an electronic device provided in an embodiment of the present application. The electronic device 200 may be a blockchain node 12, the electronic device 200 comprising: a processor 220; a memory 210 for storing instructions executable by processor 220; wherein, the processor 220 is configured to execute the transaction packaging method based on the blockchain provided by the embodiment of the application.
The Memory 210 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk. The memory also stores a plurality of modules which are respectively executed by the processor to complete the following steps of the transaction packaging method based on the block chain.
Embodiments of the present application also provide a computer-readable storage medium, which stores a computer program executable by the processor 220 to implement the following method for packaging transactions based on blockchains.
Fig. 3 is a schematic flowchart of a transaction packaging method based on a blockchain according to an embodiment of the present disclosure. As shown in fig. 3, the method includes the following steps S310 to S340.
Step S310: and carrying out deduplication processing on the plurality of transaction records in the transaction collection list.
The transaction record may include the transaction amount, transaction account, etc., transaction time, etc. The deduplication processing refers to removing duplicate transaction records, for example, if transaction record x and transaction record y are duplicate, then transaction record x or transaction record y is removed, and the same transaction record only remains one.
The Transaction set List (List < Transaction > pendingTxns) may contain a large number of outstanding Transaction records. The blockchain node can start an asynchronous thread to perform deduplication processing on multiple transaction records in the transaction collection list.
In one embodiment, the deduplication process may be to perform anti-double-blossom detection on each transaction record and remove transaction records that fail the anti-double-blossom detection.
For example, if the same transaction record exists twice, it is equivalent to paying twice. The double-flower prevention detection refers to detecting whether the same transaction record exists, thereby avoiding repeated expenses. For example, the duplicate prevention detection for the transaction record x may be to determine whether a certain transaction record exists in the rest of transaction records (except the transaction record x) and is the same as the transaction record x, but if the transaction record x does not exist, the duplicate prevention detection for the transaction record x passes. Conversely, if present, transaction record A fails the anti-double blossom detection, and may be considered to be the same transaction record present.
In one embodiment, each transaction record may be locked in sequence, and whether the hash value of the locked transaction record is the same as the hash values of the other transaction records is determined, and if so, the locked transaction record is removed.
Wherein, the rest transaction records are the transaction records in the transaction aggregate list except the locked transaction records. And a large number of transaction records exist in the transaction set list, the transaction set list can be traversed, global locks are added to the transaction records one by one through the exclusive lock component, and whether the hash value of the locked transaction record is the same as the hash values of the other transaction records is judged. And if the hash value of a certain transaction record in the transaction records is the same as that of the locked transaction record, removing the locked transaction record. If the hash values of the other transaction records are different from the hash value of the locked transaction record, the global lock can be released, and the next transaction record is continuously locked until the judgment of all transaction records is completed. And ensuring that the hash values of the rest transaction records in the transaction set list are different, namely no repeated transaction records exist.
In an embodiment, before the step S310, when the tile chain node receives a transaction record sent by the client, the transaction record may be added to a pending checkqueue, and then an asynchronous thread is started, and the multiple transaction records in the pending queue are pulled by the asynchronous thread to form the transaction set list.
Asynchronous threads are those threads that can be executed synchronously (i.e., simultaneously) without waiting for another step to complete. The asynchronous thread may repeatedly perform the step of pulling all transaction records from the queue to be detected, with all the pulled transaction records forming a transaction set list.
In an embodiment, a first asynchronous thread may be configured, and "pull all transactions from a queue to be detected to form a transaction set list" is repeatedly executed, "configure a second asynchronous thread, and" repeatedly execute "deduplication processing (obtain a global lock, then traverse all transaction records of the transaction set list, perform double-flower prevention detection one by one, and remove transaction records in the transaction set list that do not pass double-flower prevention detection. A third asynchronous thread is configured to repeatedly perform the "transaction packing process" (i.e., steps S320 and S330 below). Through a plurality of asynchronous threads, a transaction set list is synchronously formed, and the transaction processing effect can be improved through deduplication processing and packaging processing.
Step S320: and packaging the rest transaction records in the transaction set list to generate a plurality of candidate blocks.
The remaining transaction records in the transaction aggregate list may be considered to have had duplicate transaction records removed. The candidate block is a block generated by packing the remaining transaction records in the transaction set list, and is distinguished from the common block, and the block generated by packing is called a candidate block.
A large number of transaction records exist in the transaction set list, and the data volume of each block is limited, so that a plurality of candidate blocks can be generated in a packaging mode. In an embodiment, the remaining transaction records in the transaction set list may be arranged according to a time sequence, and a plurality of candidate blocks may be generated by sequentially packing.
So that transaction records that are close in time can be packed into one candidate block. For example, after sorting the remaining transaction records in chronological order, every 10 minutes of transaction records may be packed to generate a candidate block. For example, 9: transaction records from 00-9:10 are packed to generate a first candidate block, transaction records from 9:10-9:20 are packed to generate a second candidate block, and so on.
According to the requirement, the rest transaction records can be packaged to generate a plurality of candidate blocks according to the size of the preset candidate blocks.
Step S330: placing the plurality of candidate blocks into a candidate block queue.
All the packed candidate blocks may be stored in a queue, which may be referred to as a candidate block queue for differentiation.
Step S340: at the beginning of the consensus process, a given candidate block is pulled from the candidate block queue to initiate consensus.
The candidate block queue may be a first-in-first-out mode, and the given candidate block may be the first candidate block in the candidate block queue. In an embodiment, each candidate block may be arranged in order according to the packing order. The candidate block packed first may be the first candidate block in the candidate block queue, and the specified candidate block may be the first candidate block in the candidate block queue, i.e., the oldest candidate block packed. As the candidate block queue changes, the first candidate block also changes over time. In the packaging stage of the consensus process, the block chain node can directly pull the current first candidate block from the candidate block queue to initiate consensus, so that a transaction list does not need to be pulled from a transaction pool to perform transaction packaging, and then serialization is performed.
In one embodiment, the designated candidate block may be the candidate block with the earliest current timestamp in the candidate block queue. The candidate block with the earliest current timestamp refers to the candidate block with the earliest timestamp in the candidate block queue at the current time. As the candidate block queue changes, the candidate block with the earliest current timestamp may also change. In an embodiment, the timestamp earliest candidate block may be the earliest packed candidate block. In one embodiment, in the packing stage of the consensus process, the block link node may directly pull the candidate block with the earliest current timestamp from the candidate block queue to initiate consensus, so that the transaction packing is performed without pulling the transaction list from the transaction pool, and then serialization is performed.
According to the technical scheme provided by the embodiment of the application, before the consensus process is started, the transaction records are packaged in advance in the anti-replay stage, so that in the packaging stage of the consensus process, the specified candidate blocks can be directly pulled from the candidate block queue to send the consensus, and the transaction records do not need to be pulled from the transaction pool to be packaged, so that the consensus efficiency is improved, and the consensus time is shortened.
In an embodiment, in order to ensure that the double flowers are protected against the hundred percent, as shown in fig. 4, after the step S340, the method provided in the embodiment of the present application further includes:
step S350: removing the designated candidate block in the candidate block queue.
For example, after a consensus is initiated for a given candidate block (e.g., the first candidate block), the first candidate block in the candidate block queue may be removed.
Step S360: and at the submission stage when the designated candidate block is successfully identified, judging whether a transaction list contained in the current first candidate block in the candidate block queue and the transaction list contained in the designated candidate block have transaction records with the same hash value.
Assuming that the order of the candidate block is candidate block a, candidate block B, candidate block C … …, and so on, when the candidate block is designated as candidate block a, then the current first candidate block after candidate block a is removed is candidate block B. After the candidate block a is successfully identified, the candidate block a is to be uplinked (i.e., committed) after the previous block with successful identification. After the candidate block a is successfully identified, the next candidate block initiating the identification is the candidate block B, so to further avoid the replay, it can be determined whether the transaction list of the candidate block B and the transaction list of the candidate block a have the same transaction record with the hash value. The hash value may be a unique identifier of the transaction record, and the hash values are the same and may be considered to be the same transaction record.
Step S370: and if so, removing the transaction records with the same hash value in the first candidate block.
If the transaction list of candidate blob B and the transaction list of candidate blob a have transaction records with the same hash value, then to avoid replay, the transaction records in candidate blob B with the same hash value may be removed. Therefore, after the candidate block B is linked up, the same transaction record does not exist with the candidate block a, so that the transaction is ensured not to be repeated. On the contrary, if there is no transaction record with the same hash value between the transaction list of the candidate block B and the transaction list of the candidate block a, the candidate block a is directly uplink-linked without performing deduplication on the candidate block B.
The following is an embodiment of the apparatus of the present application, which can be used to implement the above embodiment of the transaction packing method based on blockchain of the present application. For details not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the transaction packing method based on blockchain of the present application.
Fig. 5 is a block diagram of a transaction packaging apparatus based on a blockchain according to an embodiment of the present disclosure. As shown in fig. 5, the apparatus includes: a deduplication processing module 510, a packing candidate module 520, a join queue module 530, and a consensus initiation module 540.
A deduplication processing module 510, configured to perform deduplication processing on multiple transaction records in the transaction aggregation list;
a packing candidate module 520, configured to pack the remaining transaction records in the transaction set list to generate a plurality of candidate blocks;
a queue adding module 530, configured to place the candidate blocks into a candidate block queue;
a consensus initiating module 540, configured to pull the specified candidate block from the candidate block queue to initiate consensus when the consensus process starts.
The implementation process of the functions and actions of each module in the above device is specifically described in the implementation process of the corresponding step in the above transaction packing method based on the block chain, and is not described herein again.
In the embodiments provided in the present application, the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Claims (12)
1. A transaction packaging method based on a block chain is characterized by comprising the following steps:
carrying out duplicate removal processing on a plurality of transaction records in the transaction set list;
packaging the rest transaction records in the transaction set list to generate a plurality of candidate blocks;
placing the plurality of candidate blocks into a candidate block queue;
at the beginning of the consensus process, a given candidate block is pulled from the candidate block queue to initiate consensus.
2. The method of claim 1, wherein the deduplication processing of the plurality of transaction records in the transaction collection list comprises:
and carrying out double-flower prevention detection on each transaction record, and removing the transaction records which fail to pass the double-flower prevention detection.
3. The method of claim 2, wherein performing anti-double-blossom detection on each transaction record and removing transaction records with anti-double-blossom detection failed comprises:
locking each transaction record in sequence, judging whether the hash value of the locked transaction record is the same as the hash values of the other transaction records, and if so, removing the locked transaction record.
4. The method of claim 1, wherein packaging the remaining transaction records in the transaction set list to generate a plurality of candidate blocks comprises:
and arranging the rest transaction records in the transaction set list according to the time sequence, and packing the transaction records in sequence to generate a plurality of candidate blocks.
5. The method of claim 1, the pulling a specified candidate block from the candidate block queue initiating consensus, comprising:
and pulling the current first candidate block from the candidate block queue to initiate consensus.
6. The method of claim 1, the pulling a specified candidate block from the candidate block queue initiating consensus, comprising:
pulling the candidate block with the earliest current timestamp from the candidate block queue to initiate consensus.
7. The method of claim 1, wherein after the pulling of the specified candidate block from the candidate block queue initiates consensus, the method further comprises:
removing the designated candidate block in the candidate block queue;
after the designated candidate block is successfully identified, judging whether a transaction record with the same hash value exists in a transaction list contained in the current first candidate block in the candidate block queue and the transaction list contained in the designated candidate block;
and if so, removing the transaction records with the same hash value in the first candidate block.
8. The method of claim 1, wherein prior to said deduplication processing of a plurality of transaction records in a transaction collection list, the method further comprises:
receiving a transaction record sent by a client, and adding the transaction record into a queue to be detected;
and starting an asynchronous thread, and pulling a plurality of transaction records in the queue to be detected to form the transaction set list through the asynchronous thread.
9. The method of claim 1, wherein the de-duplication processing and the packing of the candidate tiles are performed iteratively by different asynchronous threads.
10. A blockchain-based transaction packaging apparatus, comprising:
the duplicate removal processing module is used for carrying out duplicate removal processing on a plurality of transaction records in the transaction set list;
the packing candidate module is used for packing the rest transaction records in the transaction set list to generate a plurality of candidate blocks;
the queue adding module is used for placing the candidate blocks into a candidate block queue;
and the consensus initiating module is used for pulling the specified candidate block from the candidate block queue to initiate consensus when a consensus process starts.
11. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the blockchain based transaction packaging method of any one of claims 1 to 9.
12. A computer-readable storage medium, wherein the storage medium stores a computer program executable by a processor to perform the blockchain based transaction packaging method of any one of claims 1 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011368260.6A CN112347193A (en) | 2020-11-27 | 2020-11-27 | Transaction packaging method and device based on block chain and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011368260.6A CN112347193A (en) | 2020-11-27 | 2020-11-27 | Transaction packaging method and device based on block chain and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112347193A true CN112347193A (en) | 2021-02-09 |
Family
ID=74365141
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011368260.6A Pending CN112347193A (en) | 2020-11-27 | 2020-11-27 | Transaction packaging method and device based on block chain and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112347193A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112765137A (en) * | 2021-04-07 | 2021-05-07 | 暗链科技(深圳)有限公司 | Block synchronization method based on block distributed block chain and electronic equipment |
CN112765681A (en) * | 2021-04-07 | 2021-05-07 | 暗链科技(深圳)有限公司 | Block distributed block chain generation method, storage medium and electronic device |
CN113190567A (en) * | 2021-04-28 | 2021-07-30 | 支付宝(杭州)信息技术有限公司 | Transaction detection method and device |
CN114416765A (en) * | 2022-03-28 | 2022-04-29 | 北京微芯感知科技有限公司 | Stepless prediction execution method and system for block chain transaction |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109150598A (en) * | 2018-08-10 | 2019-01-04 | 上交所技术有限责任公司 | A kind of BFT common recognition algorithm bandwidth utilization rate improved method based on block piece |
CN110046896A (en) * | 2019-04-26 | 2019-07-23 | 腾讯科技(深圳)有限公司 | A kind of block processes method and node and system |
CN110390524A (en) * | 2019-07-31 | 2019-10-29 | 中国工商银行股份有限公司 | Work data processing method, device, electronic equipment and storage medium in block chain |
CN110875893A (en) * | 2018-08-29 | 2020-03-10 | 深圳启元信息服务有限公司 | Consensus verification method, check node and block chain system |
CN111369358A (en) * | 2020-02-10 | 2020-07-03 | 杭州溪塔科技有限公司 | Block chain consensus method and device and electronic equipment |
-
2020
- 2020-11-27 CN CN202011368260.6A patent/CN112347193A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109150598A (en) * | 2018-08-10 | 2019-01-04 | 上交所技术有限责任公司 | A kind of BFT common recognition algorithm bandwidth utilization rate improved method based on block piece |
CN110875893A (en) * | 2018-08-29 | 2020-03-10 | 深圳启元信息服务有限公司 | Consensus verification method, check node and block chain system |
CN110046896A (en) * | 2019-04-26 | 2019-07-23 | 腾讯科技(深圳)有限公司 | A kind of block processes method and node and system |
CN110390524A (en) * | 2019-07-31 | 2019-10-29 | 中国工商银行股份有限公司 | Work data processing method, device, electronic equipment and storage medium in block chain |
CN111369358A (en) * | 2020-02-10 | 2020-07-03 | 杭州溪塔科技有限公司 | Block chain consensus method and device and electronic equipment |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112765137A (en) * | 2021-04-07 | 2021-05-07 | 暗链科技(深圳)有限公司 | Block synchronization method based on block distributed block chain and electronic equipment |
CN112765681A (en) * | 2021-04-07 | 2021-05-07 | 暗链科技(深圳)有限公司 | Block distributed block chain generation method, storage medium and electronic device |
CN113190567A (en) * | 2021-04-28 | 2021-07-30 | 支付宝(杭州)信息技术有限公司 | Transaction detection method and device |
CN114416765A (en) * | 2022-03-28 | 2022-04-29 | 北京微芯感知科技有限公司 | Stepless prediction execution method and system for block chain transaction |
CN114416765B (en) * | 2022-03-28 | 2022-06-14 | 北京微芯感知科技有限公司 | Block chain transaction stepless prediction execution method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112347193A (en) | Transaction packaging method and device based on block chain and electronic equipment | |
CN108182581B (en) | Accounting method and device for block chain | |
CN110046896B (en) | Block processing method, node and system | |
CN109558454B (en) | Parallel chain mining consensus method, apparatus and storage medium | |
US9367598B2 (en) | Merging an out of synchronization indicator and a change recording indicator in response to a failure in consistency group formation | |
EP3321819B1 (en) | Device, method and program for securely reducing an amount of records in a database | |
CN109271115B (en) | Storage sharing method and device and block chain distributed network topology | |
EP3258396A1 (en) | Data synchronization method, device and system | |
US11664974B2 (en) | Summary chains in distributed systems | |
US20210383007A1 (en) | Data deletion and obfuscation system | |
US20210226926A1 (en) | System and method for trigger-based scanning of cyber-physical assets | |
CN109492049A (en) | Data processing, block generation and synchronous method for block chain network | |
CN109684862B (en) | Data de-identification method and device and computer readable storage medium | |
CN107169055A (en) | The operating method and operating system of a kind of database table | |
CN106991606A (en) | transaction data processing method and device | |
WO2021012903A1 (en) | Data storage method and apparatus, computer device, and storage medium | |
CN106254373B (en) | Digital certificate synchronization method, digital signature server and digital certificate synchronization system | |
CN106294017A (en) | A kind of information security back-up method | |
CN109558064B (en) | Electronic invoice data chain synchronization method, device, medium and electronic equipment | |
CN114513498B (en) | File transmission verification method, device, computer equipment and storage medium | |
JP7114462B2 (en) | Network bridge for local transaction authorization | |
CN114757777A (en) | Optimal link selection method and device for block chain and electronic equipment | |
CN114528084A (en) | Task scheduling method and device, storage medium and computer equipment | |
CN114547655A (en) | Block chain node networking and device, and electronic equipment | |
CN112541825A (en) | Transaction processing method and device based on block chain 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 |