CN112541825A - Transaction processing method and device based on block chain and electronic equipment - Google Patents

Transaction processing method and device based on block chain and electronic equipment Download PDF

Info

Publication number
CN112541825A
CN112541825A CN202011463198.9A CN202011463198A CN112541825A CN 112541825 A CN112541825 A CN 112541825A CN 202011463198 A CN202011463198 A CN 202011463198A CN 112541825 A CN112541825 A CN 112541825A
Authority
CN
China
Prior art keywords
transaction
transaction information
local cache
block
timestamp
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
CN202011463198.9A
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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202011463198.9A priority Critical patent/CN112541825A/en
Publication of CN112541825A publication Critical patent/CN112541825A/en
Pending legal-status Critical Current

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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • G06F16/2315Optimistic concurrency control
    • G06F16/2322Optimistic concurrency control using timestamps
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2457Query processing with adaptation to user needs
    • G06F16/24578Query processing with adaptation to user needs using ranking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Abstract

The application provides a transaction processing method and device based on a block chain and electronic equipment, wherein the method comprises the following steps: removing the transaction record with the future timestamp smaller than the block timestamp in the local cache according to the block timestamp of the latest commonly-identified block; storing the removed transaction record in a persistent hash table; storing the transaction record of the latest consensus block in a local cache; when transaction information sent by a client is received, whether the transaction information exists in a local cache and a persistent hash table or not is judged, and if not, the transaction information is added into a queue to be identified. The technical scheme provided by the embodiment can avoid repeated transactions and can also avoid transaction omission.

Description

Transaction processing method and device based on block chain and electronic equipment
Technical Field
The present disclosure relates to the field of blockchain technologies, and in particular, to a method and an apparatus for processing transactions based on blockchain, 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.
If A and B are to complete a transaction, A needs to send transaction information to the block chain node, and the block chain node can pack the transaction information to generate a new block. In order to avoid repeated packing of transactions, the existing block chain node sets a condition window, and the transactions which do not meet the condition window cannot be packed, but the condition can cause that a certain transaction is not executed, but the transactions cannot be identified in the future because the condition window which does not meet the condition is removed, so that the transaction omission is caused.
Disclosure of Invention
The embodiment of the application provides a transaction processing method based on a block chain, which is used for avoiding the generation of transaction omission and repeated transactions at the same time
The embodiment of the application provides a transaction processing method based on a block chain, which comprises the following steps:
removing the transaction record with the future timestamp smaller than the block timestamp in the local cache according to the block timestamp of the latest commonly-identified block;
storing the removed transaction record in a persistent hash table;
storing the transaction record of the latest consensus block in a local cache;
when transaction information sent by a client is received, whether the transaction information exists in a local cache and a persistent hash table or not is judged, and if not, the transaction information is added into a queue to be identified.
In an embodiment, the determining whether the transaction information exists in the local cache and the persistent hash table, and if not, adding the transaction information into a queue to be identified includes
Judging whether transaction records with the same identification exist in the local cache or not according to the unique identification of the transaction information;
if the transaction records with the same identification do not exist in the local cache, judging whether the future timestamp of the transaction information is greater than or equal to the current system timestamp;
if the future timestamp of the transaction information is smaller than the current system timestamp, judging whether the transaction information exists in the persistent hash table;
and if the transaction information does not exist in the persistent hash table, adding the transaction information into a queue to be identified.
In one embodiment, after the determining whether the same identified transaction record exists in the local cache, the method further comprises:
and if the transaction records with the same identification exist in the local cache, returning response information that the transaction is processing to the client.
In one embodiment, after the determining whether the future timestamp of the transaction information is greater than or equal to the current system timestamp, the method further comprises:
if the future timestamp of the transaction information is larger than or equal to the current system timestamp, detecting whether the transaction records with the same identification exist in the local cache again;
and if the transaction records with the same identification do not exist in the local cache after rechecking, adding the transaction information into the queue to be identified.
In one embodiment, after the detecting again whether the same identified transaction record already exists in the local cache, the method further includes:
and if the transaction records with the same identification exist in the local cache after rechecking, returning response information that the transaction is being processed to the client.
In one embodiment, after the determining whether the transaction information is present in the persistent hash table, the method further comprises:
and if the transaction information exists in the persistent hash table, stopping executing the transaction information.
In one embodiment, before the determining whether the future timestamp of the transaction information is greater than or equal to the current system timestamp, the method further comprises:
generating a future timestamp of the transaction information based on the block timestamp and the maximum future time window of the most recently recognized block.
An embodiment of the present application further provides a transaction processing apparatus based on a blockchain, including:
the record removing module is used for removing the transaction record of which the future time stamp is smaller than the block time stamp in the local cache according to the block time stamp of the latest commonly-identified block;
a persistent storage module for storing the removed transaction record in a persistent hash table;
the cache module is used for storing the transaction record of the latest consensus block in a local cache;
and the transaction duplication checking module is used for judging whether the transaction information exists in a local cache and a persistent hash table or not when receiving the transaction information sent by the client, and adding the transaction information into a queue to be identified if the transaction information does not exist.
An embodiment of the present application further provides an electronic device, where the electronic device includes:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to execute the above blockchain based transaction processing method.
The embodiment of the present application further 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 transaction processing method based on a blockchain.
According to the technical scheme provided by the embodiment, the blocks with successful historical consensus are stored through the persistent hash table, the blocks with successful latest consensus are stored through the local cache, whether the transaction information exists in the local cache and the persistent hash table or not is judged, if the transaction information does not exist, the transaction information is considered to be not packaged and known together, and then the transaction information is added into the queue to be known together, so that repeated transactions can be avoided, and transaction omission can be avoided.
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 transaction processing method based on a blockchain 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 processing method based on a blockchain according to an embodiment of the present application;
FIG. 4 is a detailed flowchart of step S340 in the corresponding embodiment of FIG. 3;
FIG. 5 is a detailed flowchart illustrating the determination of whether transaction information has been executed according to an embodiment of the present disclosure;
fig. 6 is a block diagram of a transaction processing device 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 transaction processing method based on a blockchain 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 client 11 and the block chain node 12, and the plurality of block chain nodes 12 are connected through a network. The software application may be a shopping-type software application, a money transfer-type software application, or the like. 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.
According to the conventional transaction anti-replay mechanism, after the transaction information X is packaged, if a transaction record Y earlier than the transaction information X is received, the transaction record Y is considered to be executed and does not participate in packaging. But the transaction record Y is not executed, so there is a transaction omission.
In the embodiment of the present application, the blockchain node 12 removes the transaction record with the future timestamp smaller than the block timestamp in the local cache according to the block timestamp of the latest commonly recognized block; storing the removed transaction record in a persistent hash table; the transaction record of the latest consensus block is stored in a local cache. The persistent hash table thus stores records of executed transactions, and the local cache stores records of transactions for the most recently identified block.
The client 11 may broadcast transaction information to a blockchain network (comprising a plurality of blockchain nodes 12). When the block node 12 receives the transaction information sent by the client 11, it can be determined whether the transaction information exists in the local cache and the persistent hash table. Therefore, whether the transaction information is replayed or not can be judged, and if the transaction information does not exist, the transaction information is added into the queue to be identified. Therefore, transaction information which is not executed can not be missed, and can be added into a queue to be identified, and the designated block chain node 12 carries out packaging identification.
Fig. 2 is a schematic frame diagram of an electronic device provided in an embodiment of the present application. The electronic device may be used as a blockchain node 12, and the electronic device 100 may be configured to execute the method for processing a transaction based on a blockchain provided in the embodiment of the present application. As shown in fig. 2, the electronic device 100 includes: one or more processors 102, and one or more memories 104 storing instructions executable by the processors 102. Wherein the processor 102 is configured to execute the transaction processing method based on blockchain provided by the following embodiments of the present application.
The processor 102 may be a gateway, or may be an intelligent terminal, or may be a device including a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), or other form of processing unit having data processing capability and/or instruction execution capability, and may process data of other components in the electronic device 100, and may control other components in the electronic device 100 to perform desired functions.
The memory 104 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, Random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium and executed by processor 102 to implement the blockchain transaction processing methods described below. Various applications and various data, such as various data used and/or generated by the applications, may also be stored in the computer-readable storage medium.
In one embodiment, the electronic device 100 shown in FIG. 2 may also include an input device 106, an output device 108, and a data acquisition device 110, which are interconnected via a bus system 112 and/or other form of connection mechanism (not shown). It should be noted that the components and structure of the electronic device 100 shown in fig. 2 are exemplary only, and not limiting, and the electronic device may have other components and structures as desired.
The input device 106 may be a device used by a user to input instructions and may include one or more of a keyboard, a mouse, a microphone, a touch screen, and the like. The output device 108 may output various information (e.g., images or sounds) to the outside (e.g., a user), and may include one or more of a display, a speaker, and the like. The data acquisition device 110 may acquire an image of a subject and store the acquired image in the memory 104 for use by other components. Illustratively, the data acquisition device 110 may be a camera.
In an embodiment, the components in the exemplary electronic device 100 for implementing the blockchain transaction processing method of the embodiment of the present application may be integrally disposed, or may be disposed separately, such as integrally disposing the processor 102, the memory 104, the input device 106 and the output device 108, and disposing the data acquisition device 110 separately.
In an embodiment, the example electronic device 100 for implementing the blockchain transaction processing method of the embodiment of the present application may be implemented as a computer, a server, or an ore machine.
Fig. 3 is a flowchart illustrating a method for processing a transaction based on a blockchain according to an embodiment of the present disclosure, where the method may be applied to a blockchain node. As shown in fig. 3, the method includes the following steps S310 to S340.
Step S310: and removing the transaction record with the future timestamp smaller than the block timestamp in the local cache according to the block timestamp of the latest commonly-identified block.
In the blockchain technique, multiple transactions can be packed into one block for storage, and multiple transactions generated subsequently are packed into another block. Multiple blockchain nodes may agree on a packed block. The latest consensus block is the block that is successfully agreed at the latest. The chunk timestamp refers to the generation time of the latest successfully-identified chunk. For example, the blockchain network may include blockchain node A, B, C, D for a total of four nodes. In the embodiment of the present application, for example, the blockchain node a may receive the block packed by the blockchain node (one of the nodes in the blockchain network) and the block timestamp. The block chain node a may also pack the blocks, generate a block timestamp, and send the packed blocks to other nodes for consensus. The blockchain node a may delete the transaction records with future timestamps less than the block timestamp in the local cache at the stage of linking the latest identified block n. Taking the block link node a as an example, the local cache refers to the memory of the block link node a.
The transaction record may include information such as the transaction amount, transfer account, etc. When the client sends the transaction record to the block link point, the block link point generates a Timestamp, called future Timestamp, for the transaction record. The future Timestamp is the value of the maximum future window added to the generation Timestamp of the last block when the client sends the transaction record (i.e., future Timestamp + maxfurturetimestamp). For example, the maximum future window time may be 1800000 milliseconds, i.e., half an hour. The transaction record may include information such as the transaction amount, transfer account, etc.
When a new block is successfully identified, the block chain node deletes the transaction record with the future timestamp smaller than the block timestamp in the local cache according to the block timestamp of the latest identified block, so that the transaction record with the time before the block generation time does not exist in the local cache, namely the earlier transaction record in the local cache is deleted.
Step S320: storing the removed transaction record in a persistent hash table.
The persistent hash table is used to store completed transaction records. The transaction records removed from the local cache may be placed in the Flush persistence Queue, and then all transaction records in the Flush persistence Queue may be stored in the persistent Hash Table.
Step S330: and storing the transaction record of the latest consensus block in a local cache.
Therefore, the transaction record of the latest successfully-identified block is always stored in the local cache. And the persistent hash table stores transaction records of blocks which are historically generated before the blocks which are latest and successfully identified. The persistent hash table may be stored in a local disk, and the speed of reading the local disk is relatively slow compared to the speed of reading the memory.
Step S340: when transaction information sent by a client is received, whether the transaction information exists in a local cache and a persistent hash table or not is judged, and if not, the transaction information is added into a queue to be identified.
For the blockchain node a, the transaction information may be sent to the blockchain node a by the client, or sent to the blockchain node B by the client, and then forwarded to other nodes by the blockchain node B, so that the blockchain node a may receive the transaction information sent by the client. For differentiation, the currently received transaction data is referred to as transaction information. The transaction data stored in the persistent hash table and the local cache is referred to as a transaction record.
In an embodiment, whether transaction records with the same hash value exist in the local cache and the persistent hash table may be determined according to a unique identifier (such as a hash value) of the transaction information, and if transaction records with the same hash value do not exist in the local cache and the persistent hash table, it may be considered that the transaction information sent by the client is not packaged and identified, so the transaction information may be added to the queue to be identified. The block chain node can extract a plurality of transaction information from the queue to be identified in sequence for packaging and identifying.
According to the technical scheme provided by the embodiment, the blocks with successful historical consensus are stored through the persistent hash table, the blocks with successful latest consensus are stored through the local cache, whether the transaction information exists in the local cache and the persistent hash table or not is judged, if the transaction information does not exist, the transaction information is considered to be not packaged and known together, and then the transaction information is added into the queue to be known together, so that repeated transactions can be avoided, and transaction omission can be avoided.
In an embodiment, as shown in fig. 4, the step S340 may include the following steps S341 to S344.
Step S341: and judging whether the local cache has transaction records with the same identification or not according to the unique identification of the transaction information.
The same transaction information has only one same identifier, and if the transaction information is different, the identifiers are different. The unique identifier may be a hash value of the transaction information calculated by a hash algorithm. The block link node can judge whether a transaction record of the hash value exists in the local cache or not according to the hash value of the transaction information.
Step S342: and if the transaction records with the same identification do not exist in the local cache, judging whether the future timestamp of the transaction information is greater than or equal to the current system timestamp.
The future timestamp of the transaction information is generated according to the block timestamp and the maximum future time window of the current latest consensus block when the transaction information is sent to the block chain node. Therefore, before judging whether the future timestamp of the transaction information is larger than or equal to the current system timestamp or not, when the client sends the transaction information to the block chain node, the block chain node generates the future timestamp for the transaction information. The current system timestamp refers to the system time of the blockchain node. If the blockchain node judges that the transaction record which is the same as the unique identifier of the transaction information does not exist in the local cache, whether the future timestamp of the transaction information is larger than or equal to the current system timestamp can be continuously judged.
Step S343: and if the future time stamp of the transaction information is smaller than the current system time stamp, judging whether the transaction information exists in the persistent hash table.
Similarly, whether the unique identifier exists in the persistent hash table can be judged according to the unique identifier of the transaction information.
Step S344: and if the transaction information does not exist in the persistent hash table, adding the transaction information into a queue to be identified.
Fig. 5 is a schematic detailed flowchart of determining whether transaction information has been executed according to an embodiment of the present application, as shown in fig. 5:
step S501: and judging whether the local cache has transaction records with the same identification or not according to the unique identification of the transaction information. If yes, go to step S502; if not, executing step S503;
step S502: and returning response information that the transaction is processed to the client.
Step S503: and judging whether the future timestamp of the transaction information is greater than or equal to the current system timestamp. If yes, go to step S504; if not, executing step S505;
step S504: detecting whether the transaction records with the same identification exist in the local cache again;
if so, step S502 is performed. If not, step S506 is performed.
Step S505: and judging whether the transaction information exists in the persistent hash table. If yes, go to step S507; if not, go to step S506;
step S506: and adding the transaction information into a to-be-consensus queue.
Step S507: execution of the transaction information is stopped. The transaction information can be considered to belong to repeated transactions, and can be directly discarded without processing.
The following is an embodiment of the apparatus of the present application, which can be used to execute the above embodiment of the transaction processing 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 processing method based on blockchain of the present application.
Fig. 6 is a block diagram of a transaction processing device based on a blockchain according to an embodiment of the present application, as shown in fig. 6, the device includes:
a record removing module 610, configured to remove, according to the block timestamp of the latest commonly-identified block, a transaction record in the local cache whose future timestamp is smaller than the block timestamp;
a persistent storage module 620, configured to store the removed transaction record in a persistent hash table;
a cache module 630, configured to store the transaction record of the latest consensus block in a local cache;
and the transaction duplication checking module 640 is configured to, when transaction information sent by a client is received, determine whether the transaction information exists in a local cache and a persistent hash table, and if not, add the transaction information to a queue to be identified.
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 processing 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 (10)

1. A blockchain-based transaction processing method, the method comprising:
removing the transaction record with the future timestamp smaller than the block timestamp in the local cache according to the block timestamp of the latest commonly-identified block;
storing the removed transaction record in a persistent hash table;
storing the transaction record of the latest consensus block in a local cache;
when transaction information sent by a client is received, whether the transaction information exists in a local cache and a persistent hash table or not is judged, and if not, the transaction information is added into a queue to be identified.
2. The method of claim 1, wherein said determining whether the transaction information exists in a local cache and a persistent hash table, and if not, adding the transaction information to a queue to be consensus comprises
Judging whether transaction records with the same identification exist in the local cache or not according to the unique identification of the transaction information;
if the transaction records with the same identification do not exist in the local cache, judging whether the future timestamp of the transaction information is greater than or equal to the current system timestamp;
if the future timestamp of the transaction information is smaller than the current system timestamp, judging whether the transaction information exists in the persistent hash table;
and if the transaction information does not exist in the persistent hash table, adding the transaction information into a queue to be identified.
3. The method of claim 2, wherein after said determining whether the same identified transaction record exists in the local cache, the method further comprises:
and if the transaction records with the same identification exist in the local cache, returning response information that the transaction is processing to the client.
4. The method of claim 2, wherein after the determining whether the future timestamp of the transaction information is greater than or equal to the current system timestamp, the method further comprises:
if the future timestamp of the transaction information is larger than or equal to the current system timestamp, detecting whether the transaction records with the same identification exist in the local cache again;
and if the transaction records with the same identification do not exist in the local cache after rechecking, adding the transaction information into the queue to be identified.
5. The method of claim 4, wherein after said re-detecting whether the same identified transaction record already exists in the local cache, the method further comprises:
and if the transaction records with the same identification exist in the local cache after rechecking, returning response information that the transaction is being processed to the client.
6. The method of claim 2, wherein after the determining whether the transaction information is present in the persistent hash table, the method further comprises:
and if the transaction information exists in the persistent hash table, stopping executing the transaction information.
7. The method of claim 1, prior to the determining whether the future timestamp of the transaction information is greater than or equal to a current system timestamp, the method further comprising:
generating a future timestamp of the transaction information based on the block timestamp and the maximum future time window of the most recently recognized block.
8. A blockchain-based transaction processing apparatus, comprising:
the record removing module is used for removing the transaction record of which the future time stamp is smaller than the block time stamp in the local cache according to the block time stamp of the latest commonly-identified block;
a persistent storage module for storing the removed transaction record in a persistent hash table;
the cache module is used for storing the transaction record of the latest consensus block in a local cache;
and the transaction duplication checking module is used for judging whether the transaction information exists in a local cache and a persistent hash table or not when receiving the transaction information sent by the client, and adding the transaction information into a queue to be identified if the transaction information does not exist.
9. 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 processing method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the storage medium stores a computer program executable by a processor to perform the blockchain based transaction processing method of any one of claims 1 to 7.
CN202011463198.9A 2020-12-09 2020-12-09 Transaction processing method and device based on block chain and electronic equipment Pending CN112541825A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011463198.9A CN112541825A (en) 2020-12-09 2020-12-09 Transaction processing method and device based on block chain and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011463198.9A CN112541825A (en) 2020-12-09 2020-12-09 Transaction processing method and device based on block chain and electronic equipment

Publications (1)

Publication Number Publication Date
CN112541825A true CN112541825A (en) 2021-03-23

Family

ID=75020101

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011463198.9A Pending CN112541825A (en) 2020-12-09 2020-12-09 Transaction processing method and device based on block chain and electronic equipment

Country Status (1)

Country Link
CN (1) CN112541825A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112860712A (en) * 2021-04-13 2021-05-28 深圳前海移联科技有限公司 Transaction database construction method and system based on block chain and electronic equipment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017204943A1 (en) * 2016-05-24 2017-11-30 Mastercard International Incorporated Method and system for an efficient consensus mechanism for permissioned blockchains using audit guarantees
CN110008738A (en) * 2019-02-21 2019-07-12 网易(杭州)网络有限公司 For the caching method of block chain contract data, device, medium and calculate equipment
CN110569305A (en) * 2019-08-27 2019-12-13 网易(杭州)网络有限公司 Block synchronization method, device, medium and computing equipment
CN110647582A (en) * 2019-09-17 2020-01-03 腾讯科技(深圳)有限公司 Method and device for block chain network consensus checking, storage medium and computer equipment
CN110708171A (en) * 2019-12-13 2020-01-17 腾讯科技(深圳)有限公司 Block chain consensus voting method, device, equipment and storage medium
US20200076625A1 (en) * 2018-08-30 2020-03-05 International Business Machines Corporation High precision timestamps in blockchain
CN111066046A (en) * 2019-04-26 2020-04-24 阿里巴巴集团控股有限公司 Replay attack resistant authentication protocol
CN111183446A (en) * 2019-09-02 2020-05-19 阿里巴巴集团控股有限公司 Centralized account book system based on block chain management
CN111600720A (en) * 2020-05-20 2020-08-28 腾讯科技(深圳)有限公司 Data processing method, device and equipment based on block chain and readable storage medium
CN111782644A (en) * 2020-07-27 2020-10-16 江苏工程职业技术学院 Scientific research data management control system and method based on block chain technology

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017204943A1 (en) * 2016-05-24 2017-11-30 Mastercard International Incorporated Method and system for an efficient consensus mechanism for permissioned blockchains using audit guarantees
US20200076625A1 (en) * 2018-08-30 2020-03-05 International Business Machines Corporation High precision timestamps in blockchain
CN110008738A (en) * 2019-02-21 2019-07-12 网易(杭州)网络有限公司 For the caching method of block chain contract data, device, medium and calculate equipment
CN111066046A (en) * 2019-04-26 2020-04-24 阿里巴巴集团控股有限公司 Replay attack resistant authentication protocol
CN110569305A (en) * 2019-08-27 2019-12-13 网易(杭州)网络有限公司 Block synchronization method, device, medium and computing equipment
CN111183446A (en) * 2019-09-02 2020-05-19 阿里巴巴集团控股有限公司 Centralized account book system based on block chain management
CN110647582A (en) * 2019-09-17 2020-01-03 腾讯科技(深圳)有限公司 Method and device for block chain network consensus checking, storage medium and computer equipment
CN110708171A (en) * 2019-12-13 2020-01-17 腾讯科技(深圳)有限公司 Block chain consensus voting method, device, equipment and storage medium
CN111600720A (en) * 2020-05-20 2020-08-28 腾讯科技(深圳)有限公司 Data processing method, device and equipment based on block chain and readable storage medium
CN111782644A (en) * 2020-07-27 2020-10-16 江苏工程职业技术学院 Scientific research data management control system and method based on block chain technology

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘伟;蔺宏宇;: "区块链技术原理及基于区块链技术的知识产权服务浅析", 产权导刊, no. 11, pages 65 - 69 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112860712A (en) * 2021-04-13 2021-05-28 深圳前海移联科技有限公司 Transaction database construction method and system based on block chain and electronic equipment
CN112860712B (en) * 2021-04-13 2024-02-09 深圳前海移联科技有限公司 Block chain-based transaction database construction method, system and electronic equipment

Similar Documents

Publication Publication Date Title
US11824996B2 (en) Parachain data synchronization method, device and storage medium
CN110188096B (en) Index creating method, device and equipment for data record
CN110569311B (en) Data synchronization method and device for database and computer storage medium
CN110162662B (en) Verification method, device and equipment for data records in block chain type account book
CN110162526B (en) Method, device and equipment for inquiring data records in block chain type account book
WO2018179586A1 (en) Analysis system, analysis method, and program
JP2011039818A (en) System, method and program for processing stream data
CN111444196B (en) Method, device and equipment for generating Hash of global state in block chain type account book
CN108667921B (en) Bank business recommendation information generation method and system based on network bypass
US9727394B2 (en) Establishing causality order of computer trace records
CN110347679B (en) Data storage method, device and equipment based on receipt
CN111639132B (en) Log synchronization method and equipment
CN111444192A (en) Method, device and equipment for generating Hash of global state in block chain type account book
CN107798039A (en) A kind of method of data synchronization and device
CN117278434A (en) Flow playback method and device and electronic equipment
CN112541825A (en) Transaction processing method and device based on block chain and electronic equipment
CN114416883A (en) Block chain light node data synchronization method, device, equipment and readable storage medium
CN111327466A (en) Alarm analysis method, system, equipment and medium
CN109359109B (en) Data processing method and system based on distributed stream computing
CN109284331B (en) Certificate making information acquisition method based on service data resources, terminal equipment and medium
CN107688978B (en) Method and device for detecting repeated order information
CN110442439B (en) Task process processing method and device and computer equipment
CN110545296A (en) Log data acquisition method, device and equipment
CN110266610B (en) Traffic identification method and device and electronic equipment
CN115695587A (en) Service data processing system, method, device and storage medium

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