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

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

Info

Publication number
CN113762956A
CN113762956A CN202010504776.2A CN202010504776A CN113762956A CN 113762956 A CN113762956 A CN 113762956A CN 202010504776 A CN202010504776 A CN 202010504776A CN 113762956 A CN113762956 A CN 113762956A
Authority
CN
China
Prior art keywords
transaction
transactions
target
user terminal
node
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
CN202010504776.2A
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.)
Futaihua Industry Shenzhen Co Ltd
Hon Hai Precision Industry Co Ltd
Original Assignee
Futaihua Industry Shenzhen Co Ltd
Hon Hai Precision Industry 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 Futaihua Industry Shenzhen Co Ltd, Hon Hai Precision Industry Co Ltd filed Critical Futaihua Industry Shenzhen Co Ltd
Priority to CN202010504776.2A priority Critical patent/CN113762956A/en
Priority to US17/335,346 priority patent/US20210383371A1/en
Publication of CN113762956A publication Critical patent/CN113762956A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists
    • 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/2379Updates performed during online database operations; commit processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/389Keeping log of transactions for guaranteeing non-repudiation of a transaction
    • 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
    • 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
    • G06Q2220/00Business processing using cryptography

Abstract

The invention relates to a block chain-based transaction method and device and electronic equipment. According to the scheme, the server screens out target transactions related to related account numbers of the transactions from a transaction pool and a block chain, determines that the transactions are correct when calculation results of the target transactions are correct, judges whether the transactions are correct according to balance of the related account numbers when the target transactions related to the related account numbers of the transactions are not screened out from the transaction pool and the block chain, packs the transactions into blocks and links the blocks to the block chain through nodes when the transactions are correct and confirmation information of successful transactions sent by a user terminal is received, so that processing efficiency of the block chain is improved, and the requirement of the block chain on times of commercial transactions is met.

Description

Transaction method and device based on block chain and electronic equipment
Technical Field
The invention relates to the technical field of block chains, in particular to a transaction method and device based on a block chain and electronic equipment.
Background
After the appearance of bitcoin in 2008, the blockchain technology is developed day by day, however, the current blockchain technology still cannot achieve the transaction number per second required by the application of the commercial grade, namely 30000 ten thousand transaction numbers per second. Thus, the existing blockchain has low processing efficiency.
Disclosure of Invention
In view of the foregoing, there is a need for a transaction method, a transaction device and an electronic device based on a blockchain, so as to improve the processing efficiency of the blockchain in processing transactions and meet the requirement of number of transactions in commerce.
A first aspect of the present application provides a blockchain-based transaction method, the method including:
the method comprises the steps that a server receives a transaction sent by a user terminal, wherein the transaction comprises a transaction type, an associated account number and a transaction state;
the server extracts a transaction type, a related account number and a transaction state from the transaction and judges whether the transaction type is financial transfer or not;
when the transaction category is financial transfer, the server accesses a transaction pool and/or a block chain through a node and judges whether a target transaction related to the associated account number is screened out from the transaction pool and/or the block chain;
when the target transaction related to the associated account is screened out, the server sequentially calculates the result of the target transaction according to the time sequence and judges whether the transaction is correct according to the result of the target transaction, the transaction state of the correct transaction is marked as a to-be-linked chain, and the marked transaction is sent to the user terminal for the user terminal to confirm; and
the server receives confirmation information of transaction success or transaction failure sent by the user terminal, marks the transaction state of the transaction as confirmed when the confirmation information of transaction success is received, packs the transaction into blocks through the node and links the blocks to the block chain.
Preferably, the method further comprises:
and when the transaction category is stored for a transaction record, the server accesses the transaction pool and/or the block chain through the node, screens out all target transactions related to the transactions from the transaction pool and/or the block chain, sequentially calculates the result of the target transactions according to the time sequence, and packs the transactions corresponding to the target transactions with correct calculation results into blocks and links the blocks to the block chain through the node.
Preferably, the method further comprises:
when the target transaction related to the associated account is not screened out, the server reads the balance of the associated account of the transaction from the block chain through the node, judges whether the transaction is correct or not according to the balance of the associated account, marks the transaction state of the correct transaction as a to-be-linked chain, and sends the marked transaction to the user terminal for the user terminal to confirm.
Preferably, the method further comprises:
and the server marks the transaction state of the transaction as failure when receiving the information of transaction failure, and sends the marked transaction to the user terminal through the node.
Preferably, the step of the server sequentially calculating the result of the target transaction according to the time sequence and judging whether the transaction is correct according to the result of the target transaction includes:
whether the contents of the target transaction are consistent or not is calculated in sequence according to the time sequence;
determining that the transaction is correct when the contents of the target transaction are consistent; and
determining that the transaction is incorrect when the content of the transaction is inconsistent.
Preferably, said marking the transaction status of the transaction as confirmed and packaging the transaction as blockchain uplink to the blockchain by the node upon receiving confirmation information that the transaction was successful comprises:
and the server transmits the transaction with the transaction state of waiting for uplink to the transaction pool through the node, extracts the transaction from the transaction pool through the node when receiving confirmation information of successful transaction sent by the user terminal, and packs the transaction into blocks and transmits the blocks to the block chain through the node.
Preferably, the method further comprises:
the server marks the transaction state of the incorrect transaction as failure, sends the marked transaction to the user terminal and informs the user terminal to delete the transaction.
Preferably, the step of the server reading the balance of the associated account of the transaction from the block chain through the node and judging whether the transaction is correct according to the balance of the associated account includes:
and when the balance of an transfer account number in the related account numbers of the transaction is not less than the transfer amount, determining that the transaction is correct, otherwise, determining that the transaction is incorrect.
A second aspect of the present application provides a blockchain-based transaction apparatus, the apparatus including:
the receiving module is used for receiving a transaction sent by a user terminal, wherein the transaction comprises a transaction type, an associated account number and a transaction state;
the transaction type judging module is used for extracting a transaction type, a related account number and a transaction state from the transaction and judging whether the transaction type is financial transfer or not;
the screening module is used for accessing a transaction pool and/or a block chain through a node and judging whether a target transaction related to the associated account number is screened out from the transaction pool and/or the block chain when the transaction category is financial transfer;
the transaction result judging module is used for sequentially calculating the results of the target transactions according to a time sequence and judging whether the transactions are correct or not according to the results of the target transactions when the target transactions related to the associated account are screened out, marking the transaction state of the correct transactions as a to-be-linked chain, and sending the marked transactions to the user terminal for the user terminal to confirm; and
and the uplink module is used for receiving confirmation information of transaction success or transaction failure sent by the user terminal, marking the transaction state of the transaction as confirmed when the confirmation information of transaction success is received, and packaging the transaction into blocks through the node and uplink the blocks to the block chain.
A third aspect of the application provides an electronic device comprising a processor and a memory, the processor being configured to implement the blockchain based transaction method when executing a computer program stored in the memory.
In the scheme, the server determines that the transaction is correct when a target transaction related to the related account number of the transaction is screened out from the transaction pool and the block chain and the calculation result of the target transaction is correct, determines whether the transaction is correct according to the balance of the related account number when the target transaction related to the related account number of the transaction is not screened out from the transaction pool and the block chain, and packs the transaction into blocks to be linked up to the block chain through the node when the transaction is correct and confirmation information of successful transaction sent by a user terminal is received, so that the processing efficiency of the block chain is improved, and the requirement of the number of times of commercial transactions of the block chain is met.
Drawings
Fig. 1 is a flowchart of a transaction method based on a blockchain according to an embodiment of the present invention.
Fig. 2 is an application environment diagram of a transaction method based on a blockchain according to an embodiment of the present invention.
Fig. 3 is a block diagram of a transaction device based on a blockchain according to an embodiment of the present invention.
Fig. 4 is a schematic diagram of an electronic device according to an embodiment of the invention.
Detailed Description
In order that the above objects, features and advantages of the present invention can be more clearly understood, a detailed description of the present invention will be given below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments and features of the embodiments of the present application may be combined with each other without conflict.
In the following description, numerous specific details are set forth to provide a thorough understanding of the present invention, and the described embodiments are merely a subset of the embodiments of the present invention, rather than a complete embodiment. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
Preferably, the blockchain-based transaction method is applied to one or more electronic devices. The electronic device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The electronic device may be a desktop computer, a notebook computer, a tablet computer, a cloud server, or other computing device. The device can be in man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch pad or voice control equipment and the like.
Example 1
Fig. 1 is a flow chart of a blockchain-based transaction method according to an embodiment of the invention. The order of the steps in the flow chart may be changed and some steps may be omitted according to different needs.
Referring to fig. 1, the block chain-based transaction method specifically includes the following steps:
in step S11, the server 2 receives the transaction sent by the user terminal 1, where the transaction includes a transaction type, an associated account number, and a transaction status.
Referring to fig. 2, an application environment diagram of a transaction method based on a blockchain according to an embodiment of the invention is shown. The method is applied in the server 2 and the node 3. In this embodiment, the server 2 and the node 3 are two different devices, and the server 2 is in communication connection with the node 3. In another embodiment, the server 2 and the node 3 are the same device. The server 2 is in communication connection with the user terminal 1, and receives the transaction sent by the user terminal 1. In this embodiment, the server 2 may be in communication connection with a plurality of user terminals 1, and receive the transaction sent by each user terminal 1. In this embodiment, the server 2 may be expanded into a plurality according to the traffic demand. The node 3 is in communication with a transaction pool 4 and a blockchain 5, respectively, and is capable of accessing the transaction pool 4 and the blockchain 5. In this embodiment, there are a plurality of nodes 3, and the server 2 accesses the transaction pool 4 and the block chain 5 through different nodes 3. In this embodiment, the transaction pool 4 and the blockchain 5 store transaction records of various transactions. In this embodiment, the server 2 and the node 3, the user terminal 1 and the server 2, the node and the transaction pool, and the node 3 and the block chain 5 may be connected through a 4G/5G network communication.
In this embodiment, the user terminal 1 encapsulates the transaction according to a preset manner, and sends the encapsulated transaction to the server 2. In this embodiment, the encapsulating, by the user terminal 1, the transaction according to a preset manner includes: and packaging the transaction into a transaction containing a transaction number, a transaction state, a transaction category, an associated account number, transaction content and a check code. In this embodiment, the transaction number is used to identify a transaction. The transaction number is a number composed of letters and numbers, and may be denoted as "Tx 4939", for example. The transaction status is used to indicate the status of the transaction. In this embodiment, the transaction status includes release in progress, pending uplink, confirmed, and failed. The transaction category is used to indicate a type of transaction. In this embodiment, the transaction category includes financial transfer and transaction record storage. The associated account number is used to indicate an account number associated with the transaction, and may be denoted as "user account a" or "user account B", for example. The check code is used to check the correctness of the transaction. In this embodiment, the check code is a Hash (Hash) value. In this embodiment, when the user terminal 1 transmits a transaction to the server 2, the state of the transaction is in the middle of distribution.
In step S12, the server 2 extracts a transaction type, an associated account number, and a transaction status from the transaction, and determines whether the transaction type is a financial transfer. In this embodiment, step S13 is performed when it is determined that the transaction type is financial transfer, and step S18 is performed when it is determined that the transaction type is transaction record saving.
In step S13, the server 2 accesses the transaction pool 4 and/or the blockchain 5 through the node 3 and determines whether to filter out the target transaction related to the associated account from the transaction pool 4 and/or the blockchain 5. In this embodiment, step S14 is executed when the target transaction related to the associated account is screened out, otherwise step S15 is executed.
Step S14, the server 2 sequentially calculates the result of the target transaction according to the time sequence and determines whether the transaction is correct according to the result of the target transaction, marks the transaction status of the correct transaction as to-be-linked, and sends the marked transaction to the user terminal 1 for the user terminal 1 to confirm. In the present embodiment, step S16 is executed after step S14 is executed.
For example, when determining that the associated account numbers of the transactions are a user account number a and a user account number B, the server 2 accesses the transaction pool 4 and/or the blockchain 5 through the node 3, screens out target transactions related to the user account number a and the user account number B, sequentially calculates results of the target transactions according to a time sequence, determines whether the transactions are correct according to the results of the target transactions, marks a transaction state of the correct transactions as a to-be-linked transaction, and sends the marked transactions to the user terminal 1 for the user terminal 1 to confirm.
In this embodiment, the step of the server 2 sequentially calculating the result of the target transaction according to the time sequence and determining whether the transaction is correct according to the result of the target transaction includes: whether the contents of the target transaction are consistent or not is calculated in sequence according to the time sequence; determining that the transaction is correct when the contents of the target transaction are consistent; and determining that the transaction is incorrect when the content of the transaction is inconsistent.
Step S15, the server 2 reads the balance of the associated account of the transaction from the blockchain 5 through the node 3, determines whether the transaction is correct according to the balance of the associated account, marks the transaction status of the correct transaction as a to-be-linked chain, and sends the marked transaction to the user terminal 1 for the user terminal 1 to confirm. In the present embodiment, step S16 is executed after step S15 is executed.
In this embodiment, the step of the server 2 reading the balance of the associated account of the transaction from the blockchain 5 through the node 3 and determining whether the transaction is correct according to the balance of the associated account includes: and when the balance of an transfer account number in the related account numbers of the transaction is not less than the transfer amount, determining that the transaction is correct, otherwise, determining that the transaction is incorrect.
In step S16, the server 2 receives the confirmation information of the transaction success or transaction failure sent by the user terminal 1, and when the confirmation information of the transaction success is received, marks the transaction status of the transaction as confirmed and packs the transaction into blocks through the node 3 to be uplinked to the block chain 5.
In this embodiment, the marking the transaction status of the transaction as confirmed when receiving the confirmation information of successful transaction and packaging the transaction as a block uplink to the block chain 5 through the node 3 includes: the server 2 transmits the transaction with the transaction state of waiting for uplink to the transaction pool 4 through the node 3, extracts the transaction from the transaction pool 4 through the node 3 when receiving the confirmation information of successful transaction sent by the user terminal 1, and packs the transaction into blocks and transmits the blocks to the block chain 5 through the node 3.
Step S17, the server 2 marks the transaction status of the transaction as failure when receiving the information of transaction failure, and sends the marked transaction to the user terminal 1 through the node 3.
Step S18, the server 2 accesses the transaction pool 4 and/or the blockchain 5 through the node 3, screens out all target transactions associated with the transactions from the transaction pool 4 and/or the blockchain 5, sequentially calculates results of the target transactions according to a time sequence, and packs the transactions corresponding to the target transactions with correct calculation results into blockchains through the node 3 and transmits the blockchains to the blockchain 5.
In this embodiment, the method further includes: the server 2 marks the transaction status of the incorrect transaction as a failure, sends the marked transaction to the user terminal 1, and notifies the user terminal 1 to delete the transaction.
In the scheme, the server 2 determines that the transaction is correct when a target transaction related to the associated account of the transaction is screened from the transaction pool 4 and the blockchain 5 and the calculation result of the target transaction is correct, determines whether the transaction is correct according to the balance of the associated account when the target transaction related to the associated account of the transaction is not screened from the transaction pool 4 and the blockchain 5, and packages the transaction into blocks through the node 3 to be linked up to the blockchain 5 when the transaction is correct and confirmation information of successful transaction sent by the user terminal 1 is received, so that the processing efficiency of the blockchain is improved, and the requirement of the number of times of commercial transactions of the blockchain is met.
Example 2
Fig. 3 is a block diagram of a transaction device 30 based on a block chain according to an embodiment of the present invention.
In some embodiments, the blockchain based transaction device 30 runs in the server 2. The blockchain-based transaction device 30 may include a plurality of functional modules composed of program code segments. Program code for various program segments in the blockchain based transaction device 30 may be stored in memory and executed by at least one processor to perform blockchain based transaction functions.
In this embodiment, the blockchain-based transaction device 30 may be divided into a plurality of functional modules according to the functions performed by the blockchain-based transaction device. Referring to fig. 3, the blockchain-based transaction apparatus 30 may include a receiving module 301, a transaction type determining module 302, a screening module 303, a transaction result determining module 304, an uplink module 305, and a notification module 306. The module referred to herein is a series of computer program segments capable of being executed by at least one processor and capable of performing a fixed function and is stored in memory. In some embodiments, the functionality of the modules will be described in greater detail in subsequent embodiments.
The receiving module 301 is configured to receive a transaction sent by a user terminal 1, where the transaction includes a transaction type, an associated account number, and a transaction status.
In this embodiment, the server 2 and the node 3 are two different devices, and the server 2 is in communication connection with the node 3. In another embodiment, the server 2 and the node 3 are the same device. The server 2 is in communication connection with the user terminal 1, and receives the transaction sent by the user terminal 1. In this embodiment, the server 2 may be in communication connection with a plurality of user terminals 1, and receive the transaction sent by each user terminal 1. In this embodiment, the server 2 may be expanded into a plurality according to the traffic demand. The node 3 is in communication with a transaction pool 4 and a blockchain 5, respectively, and is capable of accessing the transaction pool 4 and the blockchain 5. In this embodiment, there are a plurality of nodes 3, and the server 2 accesses the transaction pool 4 and the block chain 5 through different nodes 3. In this embodiment, the transaction pool 4 and the blockchain 5 store transaction records of various transactions. In this embodiment, the server 2 and the node 3, the user terminal 1 and the server 2, the node and the transaction pool, and the node 3 and the block chain 5 may be connected through a 4G/5G network communication.
In this embodiment, the user terminal 1 encapsulates the transaction according to a preset manner, and sends the encapsulated transaction to the server 2. In this embodiment, the encapsulating, by the user terminal 1, the transaction according to a preset manner includes: and packaging the transaction into a transaction containing a transaction number, a transaction state, a transaction category, an associated account number, transaction content and a check code. In this embodiment, the transaction number is used to identify a transaction. The transaction number is a number composed of letters and numbers, and may be denoted as "Tx 4939", for example. The transaction status is used to indicate the status of the transaction. In this embodiment, the transaction status includes release in progress, pending uplink, confirmed, and failed. The transaction category is used to indicate a type of transaction. In this embodiment, the transaction category includes financial transfer and transaction record storage. The associated account number is used to indicate an account number associated with the transaction, and may be denoted as "user account a" or "user account B", for example. The check code is used to check the correctness of the transaction. In this embodiment, the check code is a Hash (Hash) value. In this embodiment, when the user terminal 1 transmits a transaction to the server 2, the state of the transaction is in the middle of distribution.
The transaction type determination module 302 is configured to extract a transaction type, an associated account number, and a transaction status from the transaction, and determine whether the transaction type is a financial transfer.
The screening module 303 is configured to access a transaction pool 4 and/or blockchain 5 through a node 3 when the transaction type is determined to be a financial transfer and determine whether to screen a target transaction related to the associated account number from the transaction pool 4 and/or blockchain 5.
The transaction result determining module 304 is configured to sequentially calculate the target transaction results according to a time sequence when the target transaction related to the associated account is screened out, determine whether the transaction is correct according to the target transaction results, mark a transaction state of the correct transaction as a to-be-linked chain, and send the marked transaction to the user terminal 1 for the user terminal 1 to confirm.
For example, when determining that the associated account numbers of the transactions are the user account number a and the user account number B, the transaction result determination module 304 accesses the transaction pool 4 and/or the blockchain 5 through the node 3, screens out target transactions related to the user account number a and the user account number B, sequentially calculates results of the target transactions according to a time sequence, determines whether the transactions are correct according to the results of the target transactions, marks a transaction state of the correct transactions as a to-be-linked chain, and sends the marked transactions to the user terminal 1 for the user terminal 1 to confirm.
In this embodiment, the transaction result determining module 304 sequentially calculates the result of the target transaction according to the time sequence and determines whether the transaction is correct according to the result of the target transaction, including: whether the contents of the target transaction are consistent or not is calculated in sequence according to the time sequence; determining that the transaction is correct when the contents of the target transaction are consistent; and determining that the transaction is incorrect when the content of the transaction is inconsistent.
The transaction result determination module 304 is further configured to, when a target transaction related to the associated account is not screened out, read the balance of the associated account of the transaction from the block chain 5 through the node 3, determine whether the transaction is correct according to the balance of the associated account, mark a correct transaction state as a to-be-linked chain, and send the marked transaction to the user terminal 1 for the user terminal 1 to confirm.
In this embodiment, the step of the transaction result determining module 304, through the node 3, reading the balance of the associated account of the transaction from the block chain 5, and determining whether the transaction is correct according to the balance of the associated account includes: and when the balance of an transfer account number in the related account numbers of the transaction is not less than the transfer amount, determining that the transaction is correct, otherwise, determining that the transaction is incorrect.
The uplink module 305 is configured to receive a confirmation message of transaction success or transaction failure sent by the ue 1, and when the confirmation message of transaction success is received, mark the transaction status of the transaction as confirmed and package the transaction into blocks through the node 3 and uplink the blocks to the block chain 5.
In this embodiment, the marking the transaction status of the transaction as confirmed when receiving the confirmation information of successful transaction and packaging the transaction as a block uplink to the block chain 5 through the node 3 includes: the server 2 transmits the transaction with the transaction state of waiting for uplink to the transaction pool 4 through the node 3, extracts the transaction from the transaction pool 4 through the node 3 when receiving the confirmation information of successful transaction sent by the user terminal 1, and packs the transaction into blocks and transmits the blocks to the block chain 5 through the node 3.
The uplink module 305 is further configured to, when it is determined that the transaction type is a transaction record and is stored, access the transaction pool 4 and/or the blockchain 5 through the node 3 by the server 2, screen out all target transactions associated with the transactions from the transaction pool 4 and/or the blockchain 5, sequentially calculate results of the target transactions according to a time sequence, and uplink the transactions corresponding to the target transactions with correct calculation results to the blockchain 5 through the node 3.
The notification module 306 marks the transaction status of the transaction as failure when receiving the information of transaction failure, and sends the marked transaction to the user terminal 1 through the node 3.
In this embodiment, the notification module 306 is further configured to mark the transaction status of the incorrect transaction as failure, send the marked transaction to the user terminal 1, and notify the user terminal 1 to delete the transaction.
In the scheme, the server 2 determines that the transaction is correct when a target transaction related to the associated account of the transaction is screened from the transaction pool 4 and the blockchain 5 and the calculation result of the target transaction is correct, determines whether the transaction is correct according to the balance of the associated account when the target transaction related to the associated account of the transaction is not screened from the transaction pool 4 and the blockchain 5, and packages the transaction into blocks through the node 3 to be linked up to the blockchain 5 when the transaction is correct and confirmation information of successful transaction sent by the user terminal 1 is received, so that the processing efficiency of the blockchain is improved, and the requirement of the number of times of commercial transactions of the blockchain is met.
Example 3
Fig. 4 is a schematic diagram of an electronic device 6 according to an embodiment of the invention.
The electronic device 6 comprises a memory 61, a processor 62 and a computer program 63 stored in the memory 61 and executable on the processor 62. The processor 62, when executing the computer program 63, implements the steps in the above embodiment of the blockchain-based transaction method, such as the steps S11-S18 shown in fig. 1. Alternatively, the processor 62, when executing the computer program 63, implements the functions of the modules/units in the above-described block chain-based transaction apparatus embodiments, such as the modules 301 to 306 in fig. 3.
Illustratively, the computer program 63 may be partitioned into one or more modules/units that are stored in the memory 61 and executed by the processor 62 to carry out the invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 63 in the electronic device 6. For example, the computer program 63 can be divided into a receiving module 301, a transaction type determining module 302, a screening module 303, a transaction result determining module 304, an uplink module 305 and a notification module 306 shown in fig. 3, and the specific functions of each module are described in embodiment 2.
In the present embodiment, the electronic device 6 and the server 2 are the same device. It will be appreciated by those skilled in the art that the schematic diagram is merely an example of the electronic device 6, and does not constitute a limitation of the electronic device 6, and may include more or less components than those shown, or combine certain components, or different components, for example, the electronic device 6 may further include an input-output device, a network access device, a bus, etc.
The Processor 62 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor 62 may be any conventional processor or the like, the processor 62 being the control center for the electronic device 6, with various interfaces and lines connecting the various parts of the overall electronic device 6.
The memory 61 may be used for storing the computer programs 63 and/or modules/units, and the processor 62 may implement various functions of the electronic device 6 by running or executing the computer programs and/or modules/units stored in the memory 61 and calling data stored in the memory 61. The memory 61 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the stored data area may store data (such as audio data, a phonebook, etc.) created according to the use of the electronic device 6, and the like. In addition, the memory 61 may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
The integrated modules/units of the electronic device 6, if implemented in the form of software functional modules and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and which, when executed by a processor, may implement the steps of the above-described embodiments of the method. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
In the embodiments provided in the present invention, it should be understood that the disclosed electronic device and method can be implemented in other ways. For example, the above-described embodiments of the electronic device are merely illustrative, and for example, the division of the modules is only one logical functional division, and there may be other divisions when the actual implementation is performed.
In addition, each functional module in each embodiment of the present invention may be integrated into the same processing module, or each module may exist alone physically, or two or more modules may be integrated into the same module. The integrated module can be realized in a hardware form, and can also be realized in a form of hardware and a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is to be understood that the word "comprising" does not exclude other modules or steps, and the singular does not exclude the plural. Several modules or electronic devices recited in the electronic device claims may also be implemented by one and the same module or electronic device by means of software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A blockchain based transaction method, the method comprising:
the method comprises the steps that a server receives a transaction sent by a user terminal, wherein the transaction comprises a transaction type, an associated account number and a transaction state;
the server extracts a transaction type, a related account number and a transaction state from the transaction and judges whether the transaction type is financial transfer or not;
when the transaction category is financial transfer, the server accesses a transaction pool and/or a block chain through a node and judges whether a target transaction related to the associated account number is screened out from the transaction pool and/or the block chain;
when the target transaction related to the associated account is screened out, the server sequentially calculates the result of the target transaction according to the time sequence and judges whether the transaction is correct according to the result of the target transaction, the transaction state of the correct transaction is marked as a to-be-linked chain, and the marked transaction is sent to the user terminal for the user terminal to confirm; and
the server receives confirmation information of transaction success or transaction failure sent by the user terminal, marks the transaction state of the transaction as confirmed when the confirmation information of transaction success is received, packs the transaction into blocks through the node and links the blocks to the block chain.
2. The blockchain-based transaction method of claim 1, the method further comprising:
and when the transaction category is stored for a transaction record, the server accesses the transaction pool and/or the block chain through the node, screens out all target transactions related to the transactions from the transaction pool and/or the block chain, sequentially calculates the result of the target transactions according to the time sequence, and packs the transactions corresponding to the target transactions with correct calculation results into blocks and links the blocks to the block chain through the node.
3. The blockchain-based transaction method of claim 1, the method further comprising:
when the target transaction related to the associated account is not screened out, the server reads the balance of the associated account of the transaction from the block chain through the node, judges whether the transaction is correct or not according to the balance of the associated account, marks the transaction state of the correct transaction as a to-be-linked chain, and sends the marked transaction to the user terminal for the user terminal to confirm.
4. The blockchain-based transaction method of claim 1, the method further comprising:
and the server marks the transaction state of the transaction as failure when receiving the information of transaction failure, and sends the marked transaction to the user terminal through the node.
5. The blockchain-based transaction method of claim 1, wherein the server sequentially calculates the result of the target transaction according to a time sequence and determines whether the transaction is correct according to the result of the target transaction comprises:
whether the contents of the target transaction are consistent or not is calculated in sequence according to the time sequence;
determining that the transaction is correct when the contents of the target transaction are consistent; and
determining that the transaction is incorrect when the content of the transaction is inconsistent.
6. The blockchain-based transaction method of claim 1, wherein the marking the transaction status of the transaction as confirmed and packaging the transaction as blocks uplink to the blockchain through the node upon receiving confirmation information that the transaction was successful comprises:
and the server transmits the transaction with the transaction state of waiting for uplink to the transaction pool through the node, extracts the transaction from the transaction pool through the node when receiving confirmation information of successful transaction sent by the user terminal, and packs the transaction into blocks and transmits the blocks to the block chain through the node.
7. The blockchain-based transaction method of claim 1, the method further comprising:
the server marks the transaction state of the incorrect transaction as failure, sends the marked transaction to the user terminal and informs the user terminal to delete the transaction.
8. The blockchain-based transaction method according to claim 3, wherein the step of the server reading the balance of the associated account number of the transaction from the blockchain through the node and determining whether the transaction is correct according to the balance of the associated account number includes:
and when the balance of an transfer account number in the related account numbers of the transaction is not less than the transfer amount, determining that the transaction is correct, otherwise, determining that the transaction is incorrect.
9. A blockchain based transaction apparatus, the apparatus comprising:
the receiving module is used for receiving a transaction sent by a user terminal, wherein the transaction comprises a transaction type, an associated account number and a transaction state;
the transaction type judging module is used for extracting a transaction type, a related account number and a transaction state from the transaction and judging whether the transaction type is financial transfer or not;
the screening module is used for accessing a transaction pool and/or a block chain through a node and judging whether a target transaction related to the associated account number is screened out from the transaction pool and/or the block chain when the transaction category is financial transfer;
the transaction result judging module is used for sequentially calculating the results of the target transactions according to a time sequence and judging whether the transactions are correct or not according to the results of the target transactions when the target transactions related to the associated account are screened out, marking the transaction state of the correct transactions as a to-be-linked chain, and sending the marked transactions to the user terminal for the user terminal to confirm; and
and the uplink module is used for receiving confirmation information of transaction success or transaction failure sent by the user terminal, marking the transaction state of the transaction as confirmed when the confirmation information of transaction success is received, and packaging the transaction into blocks through the node and uplink the blocks to the block chain.
10. An electronic device, characterized in that: the electronic device comprises a processor and a memory, the processor being configured to implement the blockchain based transaction method of any one of claims 1 to 8 when executing a computer program stored in the memory.
CN202010504776.2A 2020-06-05 2020-06-05 Transaction method and device based on block chain and electronic equipment Pending CN113762956A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010504776.2A CN113762956A (en) 2020-06-05 2020-06-05 Transaction method and device based on block chain and electronic equipment
US17/335,346 US20210383371A1 (en) 2020-06-05 2021-06-01 Method of recording transactions based on blockchain and electronic device using the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010504776.2A CN113762956A (en) 2020-06-05 2020-06-05 Transaction method and device based on block chain and electronic equipment

Publications (1)

Publication Number Publication Date
CN113762956A true CN113762956A (en) 2021-12-07

Family

ID=78784001

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010504776.2A Pending CN113762956A (en) 2020-06-05 2020-06-05 Transaction method and device based on block chain and electronic equipment

Country Status (2)

Country Link
US (1) US20210383371A1 (en)
CN (1) CN113762956A (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230131813A1 (en) * 2021-10-27 2023-04-27 Mastercard International Incorporated Method and system for authorization and settlement in blockchain transactions
CN114529412A (en) * 2022-02-23 2022-05-24 支付宝(杭州)信息技术有限公司 Resource processing method and device based on block chain
CN115545935B (en) * 2022-11-18 2023-02-28 中国信息通信研究院 Block chain transaction account processing method and device, equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108665359A (en) * 2017-03-29 2018-10-16 中国移动通信有限公司研究院 Block chain processing method, accounting nodes and verification node
CN108764906A (en) * 2018-05-30 2018-11-06 深圳市元征科技股份有限公司 A kind of server and its block chain transaction confirmation method, device, storage medium
CN108876616A (en) * 2018-06-13 2018-11-23 众安信息技术服务有限公司 Exchange information processing method, device and assets based on block chain register settlement system
CN108924130A (en) * 2018-07-02 2018-11-30 上海达家迎信息科技有限公司 A kind of verification method of block data, device, equipment and storage medium

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2016255340A1 (en) * 2015-02-27 2017-07-06 Visa International Service Association Transaction signing utilizing asymmetric cryptography
CN110033363B (en) * 2018-12-14 2024-01-23 创新先进技术有限公司 Event processing method and device based on block chain and electronic equipment
EP3559819B1 (en) * 2018-12-29 2022-03-09 Advanced New Technologies Co., Ltd. Visual blockchain browser
CN110599177A (en) * 2019-09-23 2019-12-20 腾讯科技(深圳)有限公司 Transaction verification method and related equipment
CN110585698B (en) * 2019-09-29 2021-10-08 腾讯科技(深圳)有限公司 Virtual asset transaction method and related device
CN111161073A (en) * 2019-12-30 2020-05-15 腾讯科技(深圳)有限公司 Resource exchange method, device, computer readable storage medium and computer equipment
CN111161078A (en) * 2020-01-06 2020-05-15 江苏恒为信息科技有限公司 One-to-many block chain transfer realization method
CN111309745B (en) * 2020-02-10 2022-04-22 腾讯科技(深圳)有限公司 Virtual resource processing method and device, electronic equipment and storage medium
CN111275905A (en) * 2020-03-05 2020-06-12 链农(深圳)信息科技有限公司 Currency processing method and device of block chain system and hardware equipment
CN111028084A (en) * 2020-03-11 2020-04-17 支付宝(杭州)信息技术有限公司 Transaction processing method, device and equipment based on block chain
US11941622B2 (en) * 2020-05-29 2024-03-26 Mastercard International Incorporated Method and system for employing blockchain for fraud prevention in bulk purchases

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108665359A (en) * 2017-03-29 2018-10-16 中国移动通信有限公司研究院 Block chain processing method, accounting nodes and verification node
CN108764906A (en) * 2018-05-30 2018-11-06 深圳市元征科技股份有限公司 A kind of server and its block chain transaction confirmation method, device, storage medium
CN108876616A (en) * 2018-06-13 2018-11-23 众安信息技术服务有限公司 Exchange information processing method, device and assets based on block chain register settlement system
CN108924130A (en) * 2018-07-02 2018-11-30 上海达家迎信息科技有限公司 A kind of verification method of block data, device, equipment and storage medium

Also Published As

Publication number Publication date
US20210383371A1 (en) 2021-12-09

Similar Documents

Publication Publication Date Title
CN113762956A (en) Transaction method and device based on block chain and electronic equipment
EP3719668A1 (en) Block chain-based data processing method and device
EP3859644A1 (en) Block chain-based data check system and method, computing device, and storage medium
CN108376364B (en) Payment system account checking method and device and terminal device
CN109146095A (en) The treating method and apparatus of multiservice system problem
CN112667695A (en) Insurance data information generation method and device, server and storage medium
CN112989433A (en) Verification method based on Java Bean verification rule and related equipment
CN111651140B (en) Service method and device based on workflow
CN106415637A (en) Commission allocation method and system
CN111723159A (en) Data verification method and device based on block chain
CN108062235A (en) Data processing method and device
CN111444216A (en) Data block deleting method based on centralized block chain type account book
CN112686678A (en) Method, device, equipment and storage medium for determining false order
CN113407551A (en) Data consistency determining method, device, equipment and storage medium
US11526716B2 (en) Barcode generation methods and apparatuses
CN111324645A (en) Data processing method and device for block chain
CN110471896A (en) A kind of data processing method, system and server
CN116049318A (en) Data storage method and communication device
TWI810464B (en) A blockchain-based transaction method, a blockchain-based transaction device and electronic device
CN111369282B (en) Resource processing method and device
CN112817742B (en) Data migration method, device, equipment and storage medium
CN108616416A (en) Student side cut-in method, teacher side, system and medium based on teaching software
CN103984779A (en) Data updating method and device
CN112258184A (en) Method and device for freezing area block chain network, electronic equipment and readable storage medium
CN111026613A (en) Log processing method and device

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