WO2020029755A1 - 交易校验方法、装置、存储介质及电子设备 - Google Patents

交易校验方法、装置、存储介质及电子设备 Download PDF

Info

Publication number
WO2020029755A1
WO2020029755A1 PCT/CN2019/096043 CN2019096043W WO2020029755A1 WO 2020029755 A1 WO2020029755 A1 WO 2020029755A1 CN 2019096043 W CN2019096043 W CN 2019096043W WO 2020029755 A1 WO2020029755 A1 WO 2020029755A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
verification
information
identification information
party
Prior art date
Application number
PCT/CN2019/096043
Other languages
English (en)
French (fr)
Inventor
李承宇
张天佑
郝学武
Original Assignee
北京三快在线科技有限公司
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 北京三快在线科技有限公司 filed Critical 北京三快在线科技有限公司
Priority to JP2021506545A priority Critical patent/JP2021533502A/ja
Priority to US17/266,942 priority patent/US20210304201A1/en
Publication of WO2020029755A1 publication Critical patent/WO2020029755A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3239Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD
    • 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/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3821Electronic credentials
    • 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/2246Trees, e.g. B+trees
    • 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/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • 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/08Payment architectures
    • G06Q20/12Payment architectures specially adapted for electronic shopping systems
    • 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/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • 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/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
    • 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

Definitions

  • the present disclosure relates to the field of computer technology, and in particular, to a transaction verification method, a transaction verification device, a computer-readable storage medium, and an electronic device.
  • the verification method in related technologies is to obtain a number corresponding to the order, and use this number in Query in the transaction center database to complete the verification.
  • the verification method in the related technology relies too much on the transaction center database. Once the relevant data stored in the transaction center database is tampered with or malfunctions, problems occur in the verification process. Moreover, the verification method in the related art only uses a number as the verification voucher, the number is likely to be forged, there is a problem with data security, and it is difficult to guarantee the authenticity of the verification.
  • the purpose of the present disclosure is to provide a transaction verification method, a transaction verification device, a computer-readable storage medium, and an electronic device, so as to at least to some extent overcome the insufficient data security, calibration, and correction due to the limitations and defects of related technologies. Technical issues that are difficult to verify by authenticity.
  • a transaction verification method including:
  • the method further includes:
  • the method further includes:
  • the verification path includes ordered child node information for verifying the verification identification information.
  • the generating verification identification information according to the transaction information includes:
  • the transaction information is encrypted to obtain verification identification information.
  • the acquiring a transaction result according to the transaction information includes:
  • the acquiring a transaction result according to the calling status of each data interface includes:
  • the encrypting the transaction information to obtain verification identification information includes:
  • the transaction information is encrypted by using a hash algorithm to obtain verification identification information.
  • the storing the verification identification information as a leaf node in a verification block of a tree structure includes:
  • the check identification information is stored in a leaf node of the Merkel tree.
  • the reference condition includes: the verification identification information to be saved reaches a reference quantity.
  • the reference condition includes that: a reference time is reached from a creation time of a previous check block.
  • a transaction verification device including:
  • a first obtaining module configured to obtain transaction information and generate verification identification information according to the transaction information
  • a saving module configured to save the check identification information as a leaf node in a check block of a tree structure
  • a second acquisition module configured to acquire root node information of the check block and a check path of the check identification information in the check block
  • a sending module configured to send the verification identification information, root node information, and verification path to a first transaction party involved in the transaction information for the first transaction party to verify the transaction information .
  • the sending module is further configured to send the verification identification information to a second transaction party involved in the transaction information, so that the second transaction party The transaction information is verified.
  • the apparatus further includes:
  • a broadcasting module configured to broadcast the verification block to a blockchain network for the first transaction party, the second transaction party, or the first transaction party and the second transaction party to pass through the blockchain network The transaction information is verified.
  • the verification path includes ordered child node information for verifying the verification identification information.
  • the apparatus further includes:
  • a third obtaining module configured to obtain a transaction result according to the transaction information
  • the first obtaining module is configured to encrypt the transaction information to obtain verification identification information when the transaction result is a successful transaction.
  • the third obtaining module is configured to obtain, from the transaction information, the calling states of multiple data interfaces involved in the transaction generating link; according to the respective data interfaces, Call status and get transaction results.
  • the third obtaining module is configured to: when the calling status of each data interface is a successful call, the transaction result is a successful transaction; when the calling status of any data interface is When the call fails, the transaction result is a transaction failure.
  • the first obtaining module is configured to encrypt the transaction information by using a hash algorithm to obtain verification identification information.
  • the saving module is configured to create a Merkel tree-based check block when a reference condition is satisfied; and store the check identification information in the default block. Kerr tree leaves.
  • the reference condition includes: the verification identification information to be saved reaches a reference quantity.
  • the reference condition includes that: a reference time is reached from a creation time of a previous check block.
  • a computer-readable storage medium on which a computer program is stored, and the computer program, when executed by a processor, implements any one of the transaction verification methods described above.
  • an electronic device including a processor and a memory; wherein the memory is configured to store executable instructions of the processor, and the processor is configured to be executed by executing the executable instructions Any of the transaction verification methods described above.
  • the transaction verification method converts transaction information of multiple transactions into corresponding verification identification information, and stores the verification identification information in a verification block of a tree structure, and each verification area
  • the specific structure of the tree structure in the block is directly related to the verification identification information stored on each leaf node, so it can be used as verification credentials for transaction information.
  • the tree-structured check block can store multiple transaction information that has nothing to do with it, so as to prevent the problem of transaction information being tampered or forged, which improves the security of data storage, and also improves the calibration. The authenticity of the test results.
  • FIG. 1 schematically illustrates a flowchart of steps of a transaction verification method in an exemplary embodiment of the present disclosure.
  • FIG. 2 schematically illustrates a flowchart of some steps of a transaction verification method in another exemplary embodiment of the present disclosure.
  • FIG. 3 schematically illustrates a flowchart of some steps of a transaction verification method in another exemplary embodiment of the present disclosure.
  • FIG. 4 schematically illustrates a partial flowchart of a transaction verification method in another exemplary embodiment of the present disclosure.
  • FIG. 5 schematically illustrates a partial flowchart of a transaction verification method in another exemplary embodiment of the present disclosure.
  • FIG. 6 schematically illustrates a flowchart of a transaction verification method in an application scenario in an exemplary embodiment of the present disclosure.
  • FIG. 7 schematically illustrates a method for creating a verification block in a transaction verification method in an exemplary embodiment of the present disclosure.
  • FIG. 8 schematically illustrates a Merkel tree structure of a transaction verification method in an application scenario according to an exemplary embodiment of the present disclosure.
  • FIG. 9 schematically illustrates a transaction verification process of the transaction verification method in an application scenario in an exemplary embodiment of the present disclosure.
  • FIG. 10 schematically illustrates a composition block diagram of a transaction verification device in an exemplary embodiment of the present disclosure.
  • FIG. 11 schematically illustrates a composition block diagram of a transaction verification device in an exemplary embodiment of the present disclosure.
  • FIG. 12 schematically illustrates a composition block diagram of a transaction verification device in an exemplary embodiment of the present disclosure.
  • FIG. 13 schematically illustrates a program product in an exemplary embodiment of the present disclosure.
  • FIG. 14 schematically illustrates a module diagram of an electronic device in an exemplary embodiment of the present disclosure.
  • An exemplary embodiment of the present disclosure first provides a transaction verification method, which can be used to verify a transaction order completed between a consumer and a merchant, and the transaction order may be generated through an online transaction.
  • the order can also be an order generated through offline transactions.
  • this method can also be used to verify online transactions or offline transactions in which multiple transaction parties participate together, which is not specifically limited in this disclosure.
  • the transaction verification method provided by this exemplary embodiment may mainly include the following steps:
  • Step S110 Acquire transaction information, and generate verification identification information according to the transaction information.
  • the transaction information may include basic information such as order number, transaction time, identity information of each transaction party, and a summary of the transaction content.
  • the transaction information may also include data interface information to be called during the process of generating the transaction order, and call status information of each data interface, where the call status information may include call success or call failure.
  • verification identification information may be generated.
  • the verification identification information may be information obtained by processing data in the transaction information through a specified algorithm.
  • the verification identification information may be information obtained by encrypting transaction information, thereby improving data security.
  • the generated verification identification information should also be different.
  • the format of the verification identification information can be standardized to facilitate data processing. For example, you can format the check identification information as a fixed-length character string.
  • the verification identification information may also be set to any other format as required, and this exemplary embodiment does not specifically limit this.
  • Step S120 Save the check identification information as a leaf node in a check block of the tree structure.
  • the block body of the check block may be a storage area with a tree structure, and all check identification information will be stored as leaf nodes in the storage area of the tree structure.
  • a child node can be obtained by performing a specified operation on two or more leaf nodes located at the lowest level of the tree structure, and a parent node can be obtained after continuing to perform operations on two or more child nodes. After layer-by-layer calculations, a root node will eventually be obtained, thereby forming a complete tree structure.
  • the tree structure may be a binary tree structure or a multi-tree tree structure, and the operations performed between the child nodes of each layer may be the same or different.
  • Step S130 Acquire the root node information of the check block and the check path of the check identification information in the check block.
  • this step will obtain the specific position of the verification identification information in the verification block, that is, the root node information and verification of the verification block where the verification identification information is located.
  • the verification path of the identification information in the verification block A verification block will store the verification identification information for multiple transactions, and the number of verification identification information stored in each verification block will have a certain limit. When certain conditions are met, a new school can be formed. Verification block.
  • this step by acquiring the root node information of the verification block, it is possible to know which of the plurality of verification blocks holds the verification identification information, and obtaining the verification path of the verification identification information in the verification block can further The storage location of the verification identification information in the verification block is accurately located.
  • Step S140 Send the verification identification information, the root node information, and the verification path to the first transaction party involved in the transaction information for the first transaction party to verify the transaction information.
  • the verification identification information generated in step S110 and the root node information and the verification path obtained in step S130 are sent to the first transaction party involved in the transaction information together.
  • the first transaction party may be any one or several transaction objects involved in the transaction information.
  • this step can send related data such as verification identification information, root node information, and verification path to either the consumer or the merchant, that is, the buyer or
  • this step can also send related data to consumers and merchants at the same time.
  • the first transaction party may be any one or several transaction parties of the multiple transaction parties.
  • the first transaction party can verify the corresponding transaction information by using the verification identification information, the root node information, and the verification path.
  • the verification method may be to use the received root node information to find the lowest leaf node from the root node of the verification block along the verification path, and determine whether the information stored on the leaf node is consistent with the received verification identification information;
  • the root node of the found check block is compared with the received root node information, and when the two are consistent, it can be regarded as a check pass.
  • other methods for verifying transaction information by using verification identification information, root node information, and verification path may also be used in this step, which is not specifically limited in this exemplary embodiment.
  • the transaction verification method converts transaction information of multiple transactions into corresponding verification identification information, and stores the verification identification information in a verification block of a tree structure, each verification area
  • the specific structure of the tree structure in the block is directly related to the verification identification information stored on each leaf node, so it can be used as verification credentials for transaction information.
  • the tree-structured check block can store multiple transaction information that has nothing to do with it, so as to prevent the problem of transaction information being tampered or forged, which improves the security of data storage, and also improves the calibration. The authenticity of the test results.
  • the transaction verification method in this exemplary embodiment may further include one or more of the following steps:
  • Step S250 Send the verification identification information to the second transaction party involved in the transaction information for the second transaction party to verify the transaction information.
  • This step sends the verification identification information corresponding to the transaction information to the second transaction party involved in the transaction information, where the second transaction party is a different transaction party from the first transaction party.
  • the second transaction party may be a consumer.
  • the verification method may be sending the verification identification information to the first transaction party, and then the first transaction party finds the corresponding root node information and the verification path according to the verification identification information.
  • the first transaction party can verify the transaction, and then return the verification result to the second transaction party; in addition, the first transaction party can also directly find the root node found
  • the information and verification path are returned to the second transaction party, and then the second transaction party verifies the transaction according to the verification identification information, the root node information and the verification path.
  • Step S260 Broadcast the verification block to the blockchain network for the first transaction party, the second transaction party, or the first transaction party and the second transaction party to verify the transaction information through the blockchain network.
  • each verification block can include a block header in addition to the block body of the tree structure. The block header is used to store the identification information of the current block.
  • the identification information of the current block may be generated based on one or more of a variety of data such as the identification information of the previous block, the root node information of the tree structure in the current block, the time stamp, and a random number.
  • the block header can also store various data such as the identification information of the previous block, the root node information of the tree structure in the current block, timestamps, and random numbers.
  • This exemplary embodiment provides multiple verification methods for multiple transaction objects.
  • the security of data storage can be improved, and the authenticity of each transaction information Will be greatly guaranteed in the blockchain network.
  • the verification path obtained in step S130 may include: an ordered array of child node information for verifying the verification identification information. For example, you can first obtain the shortest path between the root node and the corresponding leaf node on the tree structure, and then obtain all the child node information on the path in turn. Arrange them in order.
  • the verification path may also be other ordered child node information capable of verifying the verification identification information, which is not specifically limited in this disclosure.
  • step S110 generating verification identification information according to the transaction information in step S110 may include the following steps:
  • Step S311 Acquire a transaction result according to the transaction information.
  • This step first obtains a transaction result according to the transaction information, where the transaction result includes a successful transaction or a failed transaction.
  • the transaction result includes a successful transaction or a failed transaction.
  • the transaction may fail.
  • the transaction result is a transaction failure, there is no need to generate verification identification information.
  • encrypt the transaction information to obtain verification identification information.
  • step S311 When the transaction result obtained in step S311 is that the transaction is successful, then this step will encrypt the transaction information, and the corresponding verification identification information can be obtained after encryption.
  • symmetric encryption algorithms such as DES algorithm, 3DES algorithm, TDEA algorithm, Blowfish algorithm, RC5 algorithm, and IDEA algorithm can be used to encrypt transaction information.
  • Non-secure encryption algorithms such as RSA algorithm, Elgamal algorithm, backpack algorithm, and elliptic curve encryption algorithm can also be used.
  • Symmetric encryption algorithm In addition, other arbitrary encryption algorithms may also be used, and this exemplary embodiment does not specifically limit this.
  • a hash encryption algorithm such as MD5, SHA-1, SHA-256, or SHA-512 may be used to encrypt the transaction information.
  • the use of a hash encryption algorithm can unify the data format, which is conducive to the establishment and preservation of the tree structure check block.
  • step S311 Obtaining a transaction result according to the transaction information may further include the following steps:
  • Step S4111 Acquire the calling status of multiple data interfaces involved in the transaction generating link from the transaction information.
  • This step obtains the calling status of multiple data interfaces from the transaction information of the transaction to obtain the transaction result.
  • the calling status of the data interface includes calling success or calling failure.
  • Data interfaces are various interfaces that need to be called on the transaction generation link.
  • an online transaction may involve multiple platform systems such as funding platforms, marketing platforms, shopping carts, and trading platforms.
  • the funding platform can provide various data interfaces for funds, such as coupons, red envelopes, and balances, for marketing.
  • the platform can provide a variety of data interfaces such as product display, event display, price display, etc.
  • the shopping cart can provide data interfaces such as establishing subscription relationships and updating product status.
  • the trading platform can provide price inquiry, inventory inquiry, fund inquiry, payment channel selection, funds Swap and other data interfaces.
  • the success of a transaction depends on the success of each data interface.
  • Step S4112. Acquire a transaction result according to the calling status of each data interface.
  • step S4111 After the calling status of each data interface is obtained in step S4111, this step will evaluate the overall calling result to obtain the transaction result. If each of the data interfaces involved has been successfully called, the transaction result is a successful transaction. If any one of the data interface calls fails, the transaction result is a transaction failure.
  • a consensus mechanism (Proof of Invocation, referred to as POI consensus mechanism) based on an interface call is used to evaluate the transaction result.
  • POI consensus mechanism Proof of Invocation
  • the interface call is considered to be consensus, and the transaction result is a successful transaction; when any data interface call fails, the interface call is not considered to be a consensus, and the transaction result is a transaction failure.
  • the transaction results are evaluated based on the POI consensus mechanism, and the evaluation results obtained are safe and reliable.
  • step S120 another transaction verification method is provided. Referring to FIG. 5, on the basis of any of the above embodiments, step S120.
  • the verification identification information is stored as a leaf node in a verification block of a tree structure, which may include the following steps:
  • Step S521. When the reference condition is satisfied, a Merkel tree-based check block is created.
  • the reference condition may be that the verification identification information to be saved reaches a reference quantity.
  • the reference condition may be set to 64 verification identification information to be saved. Then when the number of check identification information to be saved reaches 64, a check block for saving the 64 pieces of check identification information is created and the counting is restarted; when the number of check identification information waiting to be saved reaches 64 again When a check is made, a new check block is created, and so on.
  • the method of creating a verification block based on a reference number is suitable for use when the transaction volume is relatively stable.
  • the reference condition when the reference condition is that the verification identification information to be saved reaches a reference quantity, the reference quantity may be adjusted according to actual transaction conditions.
  • the reference quantity can be set to the average transaction volume per minute on the current trading system. In this way, the creation speed of the check block can be basically maintained at one per minute. While saving resources, it can also reduce the delay of data verification.
  • the reference condition can also be set to reach the reference time from the creation time of the previous check block. For example, you can directly set the reference time to 1 minute, no matter how much verification identification information is stored in the current verification block, a new verification block will be generated every minute, and subsequent verification identification information They will also be stored in the new check block.
  • the reference time-based verification block creation method is suitable for use in the case of large fluctuations in transaction volume, which can avoid the problem of long waiting time for verification identification information.
  • other arbitrary reference conditions can also be used to control the creation method and speed of the check block, which is not specifically limited in this exemplary embodiment.
  • Step S522. Save the verification identification information in a leaf node of the Merkel tree.
  • this step saves the verification identification information to be saved in the leaf nodes of the Merkel tree.
  • the Merkle Tree also known as Hash Tree
  • the Merkle Tree is a A hash binary tree for storing hash values. If the verification identification information is a hash value obtained by using a hash encryption algorithm on the transaction information, the verification identification information can be directly stored in the leaf node of the Merkel tree, and if the verification identification information is other data Form, then you can first hash the check identification information to get a hash value, and then store the corresponding hash value in the leaf node of the Merkel tree.
  • the verification block based on Merkel tree can quickly induct and save a large amount of transaction information, at the same time, it can also ensure the integrity of large-scale data, improve the security of data storage, and ensure the accuracy of transaction information verification.
  • this application scenario involves a two-party transaction on a transaction system in which a first transaction party and a second transaction party participate together, wherein the first transaction party is a merchant and the second transaction party is a consumer.
  • the system calls the data interface on the transaction generation link to vote in the background, and each time the data interface on the link is successfully called, he casts his own vote.
  • the voting results when each data interface is called successfully, the transaction can be judged to be successful, and then the order of the transaction can be saved on a checklist, and each checklist corresponds to a check block.
  • the check list can be operated on the chain, that is, the check block is broadcast to the blockchain network.
  • the transaction system will send messages to merchants and consumers, and merchants and consumers can verify transaction information based on the received messages.
  • the verification process can be local verification by the merchant, or system background verification through the blockchain network.
  • To place an order on the successful order information is to record the key information (order number, hash encryption information, etc.) in the order on the check sheet.
  • key information order number, hash encryption information, etc.
  • A1, B1, C1, A2, B2, C2, A3, B3, and C3 each represent a transaction order, and the order information of each order will be saved on the checklist.
  • the order capacity of the verification order can be specified as N. When the number of orders in the verification order reaches N, a Merkel tree as shown in FIG. 8 can be created.
  • M-A1 is a hash value obtained by hashing the order information of order A1
  • M-B1 is a hash value obtained by hashing the order information of order B1
  • the hash value M-C3 can be combined with itself and then hashed to get the hash value M-C3C3, and so on. Kerr tree for completion. Repeat the above two hash process, and finally get the root node hash value.
  • each time a successful transaction completes an order three pieces of order-related information can be sent to the merchant: verification identification information (for example, it can be the SHA256 value that uniquely corresponds to the order obtained after the hash operation). ), Root node information and verification path.
  • the verification identification information is sent to the consumer.
  • the current order is A3
  • the verification identification information sent to consumers and merchants is M-A3.
  • the root node information sent to the merchant is M-A1B1C1A2B2C2A3B3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3 at the top of the tree structure, and the verification path can be the child nodes arranged in order from bottom to top: M-B3, M-B2C2, M- A1B1C1A2 and M-C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3, that is, the dotted box in the figure.
  • One kind of verification method may be to perform serial merging and hash operations on the verification identification information and each of the child nodes M-B3, M-B2C2, M-A1B1C1A2, and M-C3C3C3C3C3C3C3C3C3C3C3C3 in the verification path in order to determine the final result.
  • the merchant can also perform background verification through the blockchain network, that is, determine whether the transaction is stored in the verification block on the blockchain network. Transaction information, as long as the transaction information is found on any verification block, it can also be judged that the verification is successful, and the transaction is successful and authentic.
  • the transaction verification device 1000 may mainly include: a first obtaining module 1010, a saving module 1020, a second obtaining module 1030, and a sending module 1040.
  • the first obtaining module 1010 is configured to obtain transaction information and generate verification identification information according to the transaction information.
  • the storage module 1020 is configured to save the verification identification information as a leaf node in a verification block of a tree structure.
  • the second obtaining module 1030 is configured to obtain the root node information of the verification block and the verification path of the verification identification information in the verification block; the sending module 1040 is configured to convert the verification identification information, root node information, and verification The path is sent to the first transaction party involved in the transaction information for the first transaction party to verify the transaction information.
  • the sending module 1040 is further configured to send the verification identification information to a second transaction party involved in the transaction information for the second transaction party to verify the transaction information.
  • the apparatus further includes:
  • the broadcasting module 1050 is configured to broadcast the verification block to the blockchain network, so that the first transaction party, the second transaction party, or the first transaction party and the second transaction party can verify the transaction information through the blockchain network. Check.
  • the verification path includes ordered child node information for verifying verification identification information.
  • the device further includes:
  • a third obtaining module 1060 configured to obtain a transaction result according to the transaction information
  • the first obtaining module 1010 is configured to encrypt the transaction information to obtain verification identification information when the transaction result is a successful transaction.
  • the third obtaining module 1060 is configured to obtain the calling states of multiple data interfaces involved in the transaction generating link from the transaction information; according to the calling states of the respective data interfaces, Get transaction results.
  • the third obtaining module 1060 is configured to: when the calling status of each data interface is called successfully, the transaction result is successful; when the calling status of any data interface is called When it fails, the transaction result is a transaction failure.
  • the first obtaining module 1010 is configured to encrypt transaction information using a hash algorithm to obtain verification identification information.
  • the saving module 1020 is configured to create a Merkel tree-based check block when a reference condition is satisfied; and save check identification information in a leaf of the Merkel tree. Node.
  • the reference condition includes: the verification identification information to be saved reaches a reference quantity.
  • the reference condition includes that: a reference time is reached from a creation time of a previous check block.
  • modules or units of the device for action execution are mentioned in the detailed description above, this division is not mandatory.
  • the features and functions of two or more modules or units described above may be embodied in one module or unit.
  • the features and functions of a module or unit described above can be further divided into multiple modules or units to be embodied.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned transaction verification method of the present disclosure can be implemented.
  • aspects of the present disclosure may also be implemented in the form of a program product, which includes program code; the program product may be stored in a non-volatile storage medium (which may be a CD-ROM, U, U Disk or mobile hard disk, etc.) or on the network; when the program product runs on a computing device (may be a personal computer, server, terminal device, or network device, etc.), the program code is used to make the computing The device performs the method steps in the above-described exemplary embodiments of the present disclosure.
  • a program product 1100 for implementing the above method according to an embodiment of the present disclosure may adopt a portable compact disk read-only memory (CD-ROM) and include a program code, and may be implemented in a computing device such as a personal computer. Computer, server, terminal device, or network device).
  • a computing device such as a personal computer. Computer, server, terminal device, or network device.
  • the program product of the present disclosure is not limited thereto.
  • the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in combination with an instruction execution system, apparatus, or device.
  • the program product may adopt any combination of one or more readable media.
  • the readable medium may be a readable signal medium or a readable storage medium.
  • the readable storage medium may be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing.
  • the readable signal medium may include a data signal in baseband or propagated as part of a carrier wave, which carries readable program code. Such a propagated data signal may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the readable signal medium may also be any readable medium other than a readable storage medium, and the readable medium may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device.
  • the program code contained on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
  • the program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, which include object-oriented programming languages, such as Java, C ++, and the like, as well as conventional procedural A programming language, such as C or a similar programming language.
  • the program code may be executed entirely on the user computing device, partly on the user computing device, as an independent software package, partly on the user computing device, partly on a remote computing device, or entirely on the remote computing device or On the server.
  • the remote computing device can be connected to the user computing device through any kind of network (including a local area network (LAN) or wide area network (WAN), etc.); or it can be connected to an external computing device, such as using Internet services Provider to connect via the Internet.
  • LAN local area network
  • WAN wide area network
  • an electronic device including at least one processor and at least one memory for storing executable instructions of the processor; wherein the processor is It is configured to execute the method steps in the above-described exemplary embodiments of the present disclosure via execution of the executable instructions.
  • the electronic device 1200 in this exemplary embodiment is described below with reference to FIG. 14.
  • the electronic device 1200 is merely an example, and should not impose any limitation on the functions and scope of use of the embodiments of the present disclosure.
  • the electronic device 1200 is represented in the form of a general-purpose computing device.
  • the components of the electronic device 1200 may include, but are not limited to, at least one processing unit 1210, at least one storage unit 1220, a bus 1230 connecting different system components (including the processing unit 1210 and the storage unit 1220), and a display unit 1240.
  • the storage unit 1220 stores program code, and the program code can be executed by the processing unit 1210, so that the processing unit 1210 executes method steps in the foregoing exemplary embodiments in the present disclosure.
  • the storage unit 1220 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit 1221 (RAM) and / or a cache storage unit 1222, and may further include a read-only storage unit 1223 (ROM).
  • RAM random access storage unit
  • ROM read-only storage unit
  • the storage unit 1220 may also include a program / utility tool 1224 having a set (at least one) of program modules 1225.
  • program modules include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. These Each or some combination of examples may include an implementation of a network environment.
  • the bus 1230 may be one or more of several types of bus structures, including a memory unit bus or a memory unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local area using any bus structure in various bus structures bus.
  • the electronic device 1200 may also communicate with one or more external devices 1300 (such as a keyboard, pointing device, Bluetooth device, etc.), and may also communicate with one or more devices that enable a user to interact with the electronic device 1200, and / or with Any device (eg, router, modem, etc.) that enables the electronic device 1200 to communicate with one or more other computing devices. This communication can be performed through an input / output (I / O) interface 1250. And, the electronic device 1200 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 1260. As shown in FIG.
  • LAN local area network
  • WAN wide area network
  • public network such as the Internet
  • the network adapter 1260 can communicate with other modules of the electronic device 1200 through the bus 1230. It should be understood that although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives And data backup storage systems.

Abstract

本公开涉及一种交易校验方法、交易校验装置、计算机可读存储介质及电子设备。本公开实施例中的交易校验方法包括:获取交易信息,根据所述交易信息生成校验标识信息;将所述校验标识信息作为叶子节点保存在树形结构的校验区块中;获取所述校验区块的根节点信息以及所述校验标识信息在所述校验区块中的校验路径;将所述校验标识信息、根节点信息以及校验路径,发送至所述交易信息中涉及的第一交易方,以供第一交易方对所述交易信息进行校验。本公开实施例提供的交易校验方法提高了数据存储的安全性,同时也提高了校验结果的真实性。

Description

交易校验方法、装置、存储介质及电子设备
本公开要求于2018年08月07日提交的申请号为201810889456.6、发明名称为“交易校验方法、装置、存储介质及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本公开中。
技术领域
本公开涉及计算机技术领域,具体涉及一种交易校验方法、交易校验装置、计算机可读存储介质及电子设备。
背景技术
消费者和商户在利用线下支付系统完成一笔交易订单后,有时会需要对该订单进行校验,相关技术中的校验方法是获取一个与该订单一一对应的编号,使用这个编号在交易中心数据库中进行查询以完成校验。
相关技术中的校验方法过度依赖交易中心数据库,一旦交易中心数据库中存储的相关数据被篡改或者出现故障,那么校验过程便会出现问题。而且相关技术中的校验方法仅仅使用一个编号作为校验凭证,该编号极有可能被伪造,数据安全性存在问题,校验真实性也难以保证。
由此可见,目前亟需一种新型的交易校验方法,以解决相关技术中存在的技术问题。
需要说明的是,在上述背景技术部分公开的信息仅用于加强对本公开的背景的理解,因此可以包括不构成对本领域普通技术人员已知的现有技术的信息。
发明内容
本公开的目的在于提供一种交易校验方法、交易校验装置、计算机可读存储介质及电子设备,进而至少在一定程度上克服由于相关技术的限制和缺陷而导致的数据安全性不足、校验真实性难以保证的技术问题。
根据本公开的一个方面,提供一种交易校验方法,包括:
获取交易信息,根据所述交易信息生成校验标识信息;
将所述校验标识信息作为叶子节点保存在树形结构的校验区块中;
获取所述校验区块的根节点信息以及所述校验标识信息在所述校验区块中的校验路径;
将所述校验标识信息、根节点信息以及校验路径,发送至所述交易信息中涉及的第一交易方,以供第一交易方对所述交易信息进行校验。
在本公开的一种示例性实施方式中,所述方法还包括:
将所述校验标识信息发送至所述交易信息中涉及的第二交易方,以供第二交易方对所述交易信息进行校验。
在本公开的一种示例性实施方式中,所述方法还包括:
将所述校验区块广播至区块链网络,以供所述第一交易方、第二交易方或第一交易方和第二交易方通过所述区块链网络对所述交易信息进行校验。
在本公开的一种示例性实施方式中,所述校验路径包括:用于对所述校验标识信息进行校验的有序排列的子节点信息。
在本公开的一种示例性实施方式中,所述根据所述交易信息生成校验标识信息,包括:
根据所述交易信息获取交易结果;
当所述交易结果为交易成功时,对所述交易信息进行加密得到校验标识信息。
在本公开的一种示例性实施方式中,所述根据所述交易信息获取交易结果,包括:
从所述交易信息中获取在交易生成链路上涉及的多个数据接口的调用状态;
根据各个数据接口的调用状态,获取交易结果。
在本公开的一种示例性实施方式中,所述根据各个数据接口的调用状态,获取交易结果,包括:
当各个数据接口的调用状态均为调用成功时,交易结果为交易成功;
当任一数据接口的调用状态为调用失败时,交易结果为交易失败。
在本公开的一种示例性实施方式中,所述对所述交易信息进行加密得到校验标识信息,包括:
使用哈希算法对所述交易信息进行加密得到校验标识信息。
在本公开的一种示例性实施方式中,所述将所述校验标识信息作为叶子节点保存在树形结构的校验区块中,包括:
在满足参考条件时,创建基于默克尔树的校验区块;
将所述校验标识信息保存在所述默克尔树的叶子节点中。
在本公开的一种示例性实施方式中,所述参考条件包括:待保存的校验标识信息达到参考数量。
在本公开的一种示例性实施方式中,所述参考条件包括:距离上一校验区块的创建时间达到参考时间。
根据本公开的一个方面,提供一种交易校验装置,包括:
第一获取模块,被配置为获取交易信息,根据所述交易信息生成校验标识信息;
保存模块,被配置为将所述校验标识信息作为叶子节点保存在树形结构的校验区块中;
第二获取模块,被配置为获取所述校验区块的根节点信息以及所述校验标识信息在所述校验区块中的校验路径;
发送模块,被配置为将所述校验标识信息、根节点信息以及校验路径,发送至所述交易信息中涉及的第一交易方,以供第一交易方对所述交易信息进行校验。
在本公开的一种示例性实施方式中,所述发送模块,还被配置为将所述校验标识信息发送至所述交易信息中涉及的第二交易方,以供第二交易方对所述交易信息进行校验。
在本公开的一种示例性实施方式中,所述装置还包括:
广播模块,被配置为将所述校验区块广播至区块链网络,以供所述第一交易方、第二交易方或第一交易方和第二交易方通过所述区块链网络对所述交易信息进行校验。
在本公开的一种示例性实施方式中,所述校验路径包括:用于对所述校验标识信息进行校验的有序排列的子节点信息。
在本公开的一种示例性实施方式中,所述装置还包括:
第三获取模块,被配置为根据所述交易信息获取交易结果;
所述第一获取模块,被配置为当所述交易结果为交易成功时,对所述交易信息进行加密得到校验标识信息。
在本公开的一种示例性实施方式中,所述第三获取模块,被配置为从所述交易信息中获取在交易生成链路上涉及的多个数据接口的调用状态;根据各个数据接口的调用状态,获取交易结果。
在本公开的一种示例性实施方式中,所述第三获取模块,被配置为当各个数据接口的调用状态均为调用成功时,交易结果为交易成功;当任一数据接口的调用状态为调用失败时,交易结果为交易失败。
在本公开的一种示例性实施方式中,所述第一获取模块,被配置为使用哈希算法对所述交易信息进行加密得到校验标识信息。
在本公开的一种示例性实施方式中,所述保存模块,被配置为在满足参考条件时,创建基于默克尔树的校验区块;将所述校验标识信息保存在所述默克尔树的叶子节点中。
在本公开的一种示例性实施方式中,所述参考条件包括:待保存的校验标识信息达到 参考数量。
在本公开的一种示例性实施方式中,所述参考条件包括:距离上一校验区块的创建时间达到参考时间。
根据本公开的一个方面,提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以上任一所述的交易校验方法。
根据本公开的一个方面,提供一种电子设备,包括处理器和存储器;其中,存储器用于存储所述处理器的可执行指令,所述处理器被配置为经由执行所述可执行指令来执行以上任一所述的交易校验方法。
本公开实施例所提供的交易校验方法通过将多笔交易的交易信息转换为对应的校验标识信息,将校验标识信息保存在树形结构的校验区块中,每个校验区块中树形结构的具体构成形式与各个叶子节点上保存的校验标识信息直接相关,因此可以作为交易信息的校验凭证。另外,树形结构的校验区块可以将原本毫无关系的多笔交易信息进行关联保存,从而防止出现交易信息被篡改或者伪造的问题,提高了数据存储的安全性,同时也提高了校验结果的真实性。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1示意性示出本公开一种示例性实施方式中交易校验方法的步骤流程图。
图2示意性示出本公开另一示例性实施方式中交易校验方法的部分步骤流程图。
图3示意性示出本公开另一示例性实施方式中交易校验方法的部分步骤流程图。
图4示意性示出本公开另一示例性实施方式中交易校验方法的部分步骤流程图。
图5示意性示出本公开另一示例性实施方式中交易校验方法的部分步骤流程图。
图6示意性示出本公开示例性实施方式中交易校验方法在一种应用场景下的流程框图。
图7示意性示出本公开示例性实施方式中交易校验方法在一种应用场景下的校验区块创建方法示意图。
图8示意性示出本公开示例性实施方式中交易校验方法在一种应用场景下的默克尔树 结构示意图。
图9示意性示出本公开示例性实施方式中交易校验方法在一种应用场景下的交易校验过程示意图。
图10示意性示出本公开示例性实施方式中交易校验装置的组成框图。
图11示意性示出本公开示例性实施方式中交易校验装置的组成框图。
图12示意性示出本公开示例性实施方式中交易校验装置的组成框图。
图13示意性示出本公开示例性实施方式中一种程序产品的示意图。
图14示意性示出本公开示例性实施方式中一种电子设备的模块示意图。
具体实施方式
现在将参考附图更全面地描述示例实施例。然而,示例实施例能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施例使得本公开将更加全面和完整,并将示例实施例的构思全面地传达给本领域的技术人员。所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施方式中。
此外,附图仅为本公开的示意性图解,并非一定是按比例绘制。图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。附图中所示的一些方框图是功能实体,不一定必须与物理或逻辑上独立的实体相对应。可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。
本公开的示例性实施方式中首先提供一种交易校验方法,该方法可以用于对消费者与商户二者之间完成的交易订单进行校验,该交易订单可以是经过线上交易产生的订单,也可以是经过线下交易产生的订单。除此之外,该方法也可以用于对多个交易方共同参与的线上交易或者线下交易进行校验,本公开对此不做特殊限定。
参考图1所示,本示例性实施方式提供的交易校验方法主要可以包括以下步骤:
步骤S110.获取交易信息,根据交易信息生成校验标识信息。
本步骤首先获取一笔交易订单中涉及的交易信息,该交易信息可以包括订单编号、交易时间、各个交易方的身份信息、交易内容的摘要等基础信息。另外,对于利用电子交易系统完成的交易,该交易信息还可以包括交易订单生成过程中需要调用的数据接口信息以及各个数据接口的调用状态信息,其中调用状态信息可以包括调用成功或者调用失败。然后,根据获取到的交易信息,可以生成与该交易信息相对应的校验标识信息。校验标识信息可以是通过指定的算法对交易信息中的数据进行处理后得到的信息。例如,校验标识信 息可以是对交易信息进行加密后得到的信息,从而可以提高数据安全性。针对不同的交易信息,所生成的校验标识信息也应当是不同的。可以对校验标识信息的格式进行规范,从而方便进行数据处理。例如,可以将校验标识信息的格式设置为固定长度的字符串。另外,也可以根据需要将校验标识信息设置为其他任意格式,本示例性实施方式对此不做特殊限定。
步骤S120.将校验标识信息作为叶子节点保存在树形结构的校验区块中。
由步骤S110生成校验标识信息后,本步骤将利用校验区块对其进行存储。其中校验区块的区块主体可以是具有树形结构的存储区域,所有的校验标识信息都将作为叶子节点保存在该树形结构的存储区域内。通过对位于树形结构最底层的两个或者多个叶子节点做指定运算后可以得到一个子节点,继续对两个或者多个子节点进行运算后可以得到一个父节点。经过逐层向上运算,最终将得到一个根节点,从而形成一个完整的树形结构。该树形结构可以是二叉树结构,也可以是多叉树结构,其中各层子节点之间进行的运算可以是相同的,也可以是不同的。
步骤S130.获取校验区块的根节点信息以及校验标识信息在校验区块中的校验路径。
当步骤S120完成对校验标识信息的存储后,本步骤将获取该校验标识信息在校验区块中的具体位置,即获取校验标识信息所在校验区块的根节点信息以及校验标识信息在校验区块中的校验路径。一个校验区块中会保存多笔交易的校验标识信息,而且每个校验区块中保存的校验标识信息的数量会有一定限制,在满足一定条件时,便可以形成新的校验区块。本步骤通过获取校验区块的根节点信息可以获知保存校验标识信息的是众多校验区块中的哪一个,而获取校验标识信息在校验区块中的校验路径则可以进一步对校验标识信息在校验区块中的保存位置进行准确定位。
步骤S140.将校验标识信息、根节点信息以及校验路径,发送至交易信息中涉及的第一交易方,以供第一交易方对交易信息进行校验。
本步骤将步骤S110中生成的校验标识信息以及由步骤S130中获取到的根节点信息和校验路径共同发送给交易信息中涉及的第一交易方。其中,第一交易方可以是交易信息中涉及的任意一个或者几个交易对象。举例而言,对于由消费者和商户参与的双方交易,本步骤可以将校验标识信息、根节点信息以及校验路径等相关数据单独发送给消费者或者商户中的任意一个,亦即买方或者卖方中的任意一个,另外本步骤也可以将相关数据同时发送给消费者和商户。对于由多个交易方共同参与的多方交易,第一交易方可以是多个交易方中的任意一个或者几个交易方。第一交易方在接收到相关数据后可以利用校验标识信息、根节点信息以及校验路径对相应的交易信息进行校验。校验的方法可以是利用接收到的根 节点信息从校验区块的根节点沿校验路径找到最底层的叶子节点,判断叶子节点上保存的信息是否与接收到的校验标识信息一致;另外也可以利用接收到的校验标识信息从最底层的叶子节点沿着校验路径向上逐层进行校验,最终找到校验区块的根节点。之后,将找到的校验区块的根节点与接收到的根节点信息进行对比,当二者一致时便可以视为校验通过。除此之外,本步骤也可以采用其他利用校验标识信息、根节点信息以及校验路径对交易信息进行校验的方法,本示例性实施方式对此不做特殊限定。
本示例性实施方式提供的交易校验方法通过将多笔交易的交易信息转换为对应的校验标识信息,将校验标识信息保存在树形结构的校验区块中,每个校验区块中树形结构的具体构成形式与各个叶子节点上保存的校验标识信息直接相关,因此可以作为交易信息的校验凭证。另外,树形结构的校验区块可以将原本毫无关系的多笔交易信息进行关联保存,从而防止出现交易信息被篡改或者伪造的问题,提高了数据存储的安全性,同时也提高了校验结果的真实性。
在本公开的另一示例性实施方式中,提供另一种交易校验方法。参考图2所示,在以上实施例的基础上,本示例性实施方式中的交易校验方法还可以包括以下步骤中的一个或者多个:
步骤S250.将校验标识信息发送至交易信息中涉及的第二交易方,以供第二交易方对交易信息进行校验。
本步骤把与交易信息相对应的校验标识信息发送给交易信息中涉及的第二交易方,其中第二交易方是与第一交易方不同的交易方。例如,如果第一交易方是商户,那么第二交易方可以是消费者。当第二交易方接收到校验标识信息后,可以根据需要对交易信息进行校验。校验的方法可以是将校验标识信息发送给第一交易方,然后由第一交易方根据该校验标识信息查找到对应的根节点信息和校验路径。查找到相关数据后,可以由第一交易方对该笔交易进行校验,然后将校验结果返回给第二交易方;除此之外,第一交易方也可以直接将查找到的根节点信息和校验路径返回给第二交易方,然后由第二交易方根据校验标识信息、根节点信息和校验路径对该笔交易进行校验。
步骤S260.将校验区块广播至区块链网络,以供第一交易方、第二交易方或第一交易方和第二交易方通过区块链网络对交易信息进行校验。
除了由第一交易方、第二交易方或第一交易方和第二交易方根据相关的校验标识信息、根节点信息和校验路径等数据各自进行本地校验以外,本步骤将保存有校验标识信息的校验区块广播至区块链网络上,如此一来,第一交易方、第二交易方或第一交易方和第二交易方均可以通过区块链网络对交易信息进行校验。作为组成区块链网络的区块,每个校验 区块除了包括树形结构的区块主体以外,还可以包括区块头,区块头用于对当前区块的标识信息进行存储。其中,当前区块的标识信息可以根据上一区块的标识信息、当前区块中树形结构的根节点信息、时间戳、随机数等多种数据中的一个或者多个进行运算生成。另外,区块头也可以对上一区块的标识信息、当前区块中树形结构的根节点信息、时间戳、随机数等多种数据进行单独存储。当第一交易方、第二交易方或第一交易方和第二交易方需要进行交易校验时,可以根据已有数据从区块链网络中查找该笔交易是否真实存在,从而完成对交易信息的校验。例如,已有数据为校验标识信息、根节点信息和校验路径等。
本示例性实施方式为多个交易对象提供了多种校验方法,特别是通过将校验区块广播至区块链网络的方式,可以提高数据存储的安全性,每笔交易信息的真实性都将在区块链网络中得到极大地保证。
在以上示例性实施方式中,步骤S130中获取的校验路径可以包括:用于对校验标识信息进行校验的有序排列的子节点信息。例如,可以首先获取树形结构上连接根节点与对应叶子节点之间的最短路径,然后依次获取该路径上涉及的所有子节点信息,按照由根节点至叶子节点或者由叶子节点至根节点的顺序对其进行排列。另外,校验路径也可以是其他能够对校验标识信息进行校验的有序排列的子节点信息,本公开对此不做特殊限定。
在本公开的另一示例性实施方式中,提供另一种交易校验方法。参考图3所示,在以上任一实施例的基础上,步骤S110中的根据交易信息生成校验标识信息可以包括以下步骤:
步骤S311.根据交易信息获取交易结果。
本步骤首先根据交易信息获取交易结果,其中交易结果包括交易成功或者交易失败。当出现因网络故障、网络延迟、系统故障等问题使得交易中断或者其他任何交易异常的情况时,都可能会导致交易失败。当交易结果为交易失败时,无需生成校验标识信息。
步骤S312.当交易结果为交易成功时,对交易信息进行加密得到校验标识信息。
当步骤S311中获取的交易结果是交易成功时,那么本步骤将对交易信息进行加密处理,加密后可以得到对应的校验标识信息。其中,对交易信息进行加密时可以使用DES算法、3DES算法、TDEA算法、Blowfish算法、RC5算法、IDEA算法等对称加密算法,也可以使用RSA算法、Elgamal算法、背包算法、椭圆曲线加密算法等非对称加密算法。另外,还可以使用其他任意的加密算法,本示例性实施方式对此不做特殊限定。
示例性地,本步骤可以使用MD5、SHA-1、SHA-256、SHA-512等哈希加密算法对交易信息进行加密。使用哈希加密算法可以统一数据格式,有利于树形结构校验区块的建立和保存。
本示例性实施方式通过在交易成功时对交易信息进行加密,一方面可以提高数据安全 性,避免数据被篡改,另一方面可以统一数据保存类型和数据保存格式,提高数据处理效率。
在本公开的另一示例性实施方式中,提供另一种交易校验方法。参考图4所示,在上一实施例的基础上,步骤S311.根据交易信息获取交易结果可以进一步包括以下步骤:
步骤S4111.从交易信息中获取在交易生成链路上涉及的多个数据接口的调用状态。
本步骤从该笔交易的交易信息中获取多个数据接口的调用状态,以获取交易结果。其中,数据接口的调用状态包括调用成功或者调用失败。数据接口是在交易生成链路上涉及的需要调用的各个接口。举例而言,一笔线上交易可能涉及资金平台、营销平台、购物车、交易平台等多个平台系统,资金平台可以提供优惠券、红包、余额等多种可用于支付的资金数据接口,营销平台可以提供商品展示、活动展示、价格展示等多种数据接口,购物车可以提供建立订阅关系、更新商品状态等数据接口,交易平台可以提供价格查询、库存查询、资金查询、支付渠道选择、资金划转等数据接口。一笔交易能否顺利进行取决于各个数据接口是否能够调用成功。
步骤S4112.根据各个数据接口的调用状态,获取交易结果。
由步骤S4111获取到各个数据接口的调用状态后,本步骤将对整体的调用结果进行评估,以获取交易结果。如果其中涉及的各个数据接口均已成功调用,那么交易结果为交易成功。如果其中任意一个数据接口调用失败,那么交易结果为交易失败。
本示例性实施方式采用基于接口调用的共识机制(Proof of Invocation,简称POI共识机制)对交易结果做出评估。当各个数据接口均调用成功时,则认为接口调用达到共识,此时交易结果为交易成功;当存在任意一个数据接口调用失败时,则认为接口调用未达到共识,此时交易结果为交易失败。基于POI共识机制对交易结果进行评估,得到的评估结果安全可靠。
在本公开的另一示例性实施方式中,提供另一种交易校验方法。参考图5所示,在以上任一实施例的基础上,步骤S120.将校验标识信息作为叶子节点保存在树形结构的校验区块中,可以包括以下步骤:
步骤S521.在满足参考条件时,创建基于默克尔树的校验区块。
本步骤首先判断当前是否满足参考条件,当判断满足参考条件时,创建基于默克尔树的校验区块。其中,参考条件可以是待保存的校验标识信息达到参考数量,例如,可以将参考条件设置为待保存的校验标识信息达到64条。那么当需要保存的校验标识信息的数量达到64条时,便创建一个用于保存这64条校验标识信息的校验区块并重新开始计数;当等待保存的校验标识信息再次达到64条时,便再创建一个新的校验区块,以此类推。基于 参考数量的校验区块创建方式适合在交易量较为平稳的情况下使用。示例性地,当参考条件是待保存的校验标识信息达到参考数量时,该参考数量可以根据实际交易情况作出调整。例如,可以将参考数量设置为当前交易系统上平均每分钟的交易量,如此一来,便可以将校验区块的创建速度基本保持在每分钟一个。节约资源的同时,还可以降低数据校验的延迟。另外,本步骤也可以将参考条件设置为距离上一校验区块的创建时间达到参考时间。例如,可以直接将参考时间设置为1分钟,那么不管当前校验区块中保存了多少数量的校验标识信息,每分钟都将固定产生一个新的校验区块,后续的校验标识信息也都将被保存在新的校验区块内。基于参考时间的校验区块创建方式适合在交易量起伏波动较大的情况下使用,可以避免校验标识信息保存等待时间过长的问题。除了参考数量和参考时间两种条件之外,也可以采用其他任意的参考条件对校验区块的创建方式和创建速度进行控制,本示例性实施方式对此不做特殊限定。
步骤S522.将校验标识信息保存在默克尔树的叶子节点中。
由步骤S521完成校验区块的创建后,本步骤将待保存的校验标识信息保存在默克尔树的叶子节点中,默克尔树(Merkle Tree,也被称作Hash Tree)是一种用于保存哈希值的哈希二叉树。如果校验标识信息是对交易信息使用哈希加密算法进行运算得到的哈希值,那么可以直接将校验标识信息保存在默克尔树的叶子节点中,而如果校验标识信息是其他数据形式,那么可以首先对校验标识信息进行哈希运算得到哈希值后,将对应的哈希值保存在默克尔树的叶子节点中。完成叶子节点的存储后,可以将每两个相邻的叶子节点上存储的哈希值两两串联合并得到一个字符串后,再对该字符串进行哈希运算并将得到的哈希值保存在向上一层的子节点中。同样地,再将两个相邻子节点串联合并后进行哈希运算,然后将得到的哈希值保存在再向上一层的父节点中,以此类推,直至获得根节点,根节点中同样保存有一个哈希值。
基于默克尔树的校验区块能够快速地对大量的交易信息进行归纳保存,同时也可以保证大规模数据的完整性,提高数据保存的安全性,保证交易信息校验的准确性。
需要说明的是,虽然以上示例性实施方式以特定顺序描述了本公开中方法的各个步骤,但是,这并非要求或者暗示必须按照该特定顺序来执行这些步骤,或者必须执行全部的步骤才能实现期望的结果。附加地或者备选地,可以省略某些步骤,将多个步骤合并为一个步骤执行,以及/或者将一个步骤分解为多个步骤执行等。
下面结合一种应用场景对以上示例性实施方式中的交易校验方法做出详细说明。
参考图6所示,本应用场景涉及由第一交易方和第二交易方共同参与的在某交易系统上进行的双方交易,其中第一交易方为商家,第二交易方为消费者。当消费者向商家发起 交易时,系统后台调用交易生成链路上的数据接口进行投票,每当链路上的数据接口调用成功时便投出自己的一票。根据投票结果,当各个数据接口均调用成功时,可以判断交易成功,然后可以将该笔交易的订单保存至校验单上,每一个校验单即对应于一个校验区块。之后便可以对校验单进行上链操作,即将校验区块广播至区块链网络。与此同时,交易系统将分别向商家和消费者发送消息,商家和消费者可以根据接收到的消息对交易信息进行校验。校验的过程可以是由商家端进行本地校验,另外也可以通过区块链网络进行系统后台校验。
对交易成功的订单信息进行上单操作,就是将订单中的关键信息(订单编号、哈希加密信息等)记录在校验单上。例如,可以使用SHA-256加密算法对订单信息进行加密,每笔交易订单都将得到一个唯一的SHA256值。参考图7所示,A1、B1、C1、A2、B2、C2、A3、B3、C3各代表一笔交易订单,每个订单的订单信息都将被保存在校验单上。根据交易系统的每分钟交易量,可以规定校验单的订单容量为N个,当校验单中的订单数量达到N个时,便可以创建如图8所示的默克尔树。其中,M-A1是对订单A1的订单信息进行哈希运算得到的哈希值,M-B1是对订单B1的订单信息进行哈希运算得到的哈希值,在将M-A1与M-B1串联合并后再次进行哈希运算将得到哈希值M-A1B1。对于最后一笔订单C3,由于没有其他订单可以与其配对,因此可以将哈希值M-C3与其自身进行串联合并后再做哈希运算以得到哈希值M-C3C3,以此类推,对默克尔树进行补全。重复以上两两哈希的过程,最终将得到根节点哈希值。
参考图9所示,每成功交易完成一笔订单,都可以向商家发送三个与订单相关的信息:校验标识信息(例如,可以是通过哈希运算后得到的与订单唯一对应的SHA256值)、根节点信息和校验路径。同时向消费者发送校验标识信息。仍以图8为例,当前订单为A3,那么发送给消费者和商户的校验标识信息即为M-A3。相应地,发送给商家的根节点信息即为树形结构顶部的M-A1B1C1A2B2C2A3B3C3C3C3C3C3C3C3C3,而校验路径可以是自底部向顶部依次有序排列的各个子节点:M-B3、M-B2C2、M-A1B1C1A2和M-C3C3C3C3C3C3C3C3,即图中虚线框部分。
如果交易出现异常,例如,消费者收到交易成功的消息,而商家端却显示交易失败,那么此时消费者可以主动或者根据商家要求向商家出示校验标识信息,此时商家可以通过消费者提供的校验标识信息找到对应的根节点信息和校验路径。然后商家便可以使用校验标识信息和对应的根节点信息、校验路径对交易信息进行校验。其中一种校验方法可以是,将校验标识信息与校验路径上的各个子节点M-B3、M-B2C2、M-A1B1C1A2以及M-C3C3C3C3C3C3C3C3依次进行串联合并和哈希运算,判断最终得到的哈希值是否与根节 点信息相同。如果相同,那么可以认为校验通过,交易成功且真实有效。除此之外,在商家端接收消息滞后或者消息丢失等特殊情况下,商家还可以通过区块链网络进行后台校验,即判断区块链网络上的校验区块中是否保存有该笔交易信息,只要在任意一个校验区块上找到该交易信息,那么也可以判断校验通过,交易成功且真实有效。
在本公开的示例性实施方式中,还提供一种交易校验装置。参考图10所示,交易校验装置1000主要可以包括:第一获取模块1010、保存模块1020、第二获取模块1030和发送模块1040。其中,第一获取模块1010被配置为获取交易信息,根据交易信息生成校验标识信息;保存模块1020被配置为将校验标识信息作为叶子节点保存在树形结构的校验区块中;第二获取模块1030被配置为获取校验区块的根节点信息以及校验标识信息在校验区块中的校验路径;发送模块1040被配置为将校验标识信息、根节点信息以及校验路径,发送至交易信息中涉及的第一交易方,以供第一交易方对交易信息进行校验。
在本公开的一种示例性实施方式中,发送模块1040,还被配置为将校验标识信息发送至交易信息中涉及的第二交易方,以供第二交易方对交易信息进行校验。
在本公开的一种示例性实施方式中,参考图11所示,该装置还包括:
广播模块1050,被配置为将校验区块广播至区块链网络,以供第一交易方、第二交易方或第一交易方和第二交易方通过区块链网络对交易信息进行校验。
在本公开的一种示例性实施方式中,校验路径包括:用于对校验标识信息进行校验的有序排列的子节点信息。
在本公开的一种示例性实施方式中,参考图12所示,该装置还包括:
第三获取模块1060,被配置为根据交易信息获取交易结果;
第一获取模块1010,被配置为当交易结果为交易成功时,对交易信息进行加密得到校验标识信息。
在本公开的一种示例性实施方式中,第三获取模块1060,被配置为从交易信息中获取在交易生成链路上涉及的多个数据接口的调用状态;根据各个数据接口的调用状态,获取交易结果。
在本公开的一种示例性实施方式中,第三获取模块1060,被配置为当各个数据接口的调用状态均为调用成功时,交易结果为交易成功;当任一数据接口的调用状态为调用失败时,交易结果为交易失败。
在本公开的一种示例性实施方式中,第一获取模块1010,被配置为使用哈希算法对交易信息进行加密得到校验标识信息。
在本公开的一种示例性实施方式中,保存模块1020,被配置为在满足参考条件时,创 建基于默克尔树的校验区块;将校验标识信息保存在默克尔树的叶子节点中。
在本公开的一种示例性实施方式中,参考条件包括:待保存的校验标识信息达到参考数量。
在本公开的一种示例性实施方式中,参考条件包括:距离上一校验区块的创建时间达到参考时间。
上述交易校验装置的细节已经在对应的交易校验方法中进行了详细的描述,因此此处不再赘述。
应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本公开的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。
在本公开的示例性实施方式中,还提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时可实现本公开的上述的交易校验方法。在一些可能的实施方式中,本公开的各个方面还可以实现为一种程序产品的形式,其包括程序代码;该程序产品可以存储在一个非易失性存储介质(可以是CD-ROM、U盘或者移动硬盘等)中或网络上;当所述程序产品在一台计算设备(可以是个人计算机、服务器、终端装置或者网络设备等)上运行时,所述程序代码用于使所述计算设备执行本公开中上述各示例性实施例中的方法步骤。
参见图13所示,根据本公开的实施方式的用于实现上述方法的程序产品1100,其可以采用便携式紧凑磁盘只读存储器(CD-ROM)并包括程序代码,并可以在计算设备(例如个人计算机、服务器、终端装置或者网络设备等)上运行。然而,本公开的程序产品不限于此。在本示例性实施例中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。
所述程序产品可以采用一个或者多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。
可读存储介质例如可以为但不限于电、磁、光、电磁、红外线或半导体的系统、装置或器件、或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件或者上述的任意合适的组合。
可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可 读程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。可读信号介质还可以是可读存储介质以外的任意可读介质,该可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。
可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、有线、光缆、RF等,或者上述的任意合适的组合。
可以以一种或多种程序设计语言的任意组合来编写用于执行本公开操作的程序代码,所述程序设计语言包括面向对象的程序设计语言,诸如Java、C++等,还包括常规的过程式程序设计语言,诸如C语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户计算设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络(包括局域网(LAN)或广域网(WAN)等)连接到用户计算设备;或者,可以连接到外部计算设备,例如利用因特网服务提供商来通过因特网连接。
在本公开的示例性实施方式中,还提供一种电子设备,所述电子设备包括至少一个处理器以及至少一个用于存储所述处理器的可执行指令的存储器;其中,所述处理器被配置为经由执行所述可执行指令来执行本公开中上述各示例性实施例中的方法步骤。
下面结合图14对本示例性实施方式中的电子设备1200进行描述。电子设备1200仅仅为一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
参见图14所示,电子设备1200以通用计算设备的形式表现。电子设备1200的组件可以包括但不限于:至少一个处理单元1210、至少一个存储单元1220、连接不同系统组件(包括处理单元1210和存储单元1220)的总线1230、显示单元1240。
其中,存储单元1220存储有程序代码,所述程序代码可以被处理单元1210执行,使得处理单元1210执行本公开中上述各示例性实施例中的方法步骤。
存储单元1220可以包括易失性存储单元形式的可读介质,例如随机存取存储单元1221(RAM)和/或高速缓存存储单元1222,还可以进一步包括只读存储单元1223(ROM)。
存储单元1220还可以包括具有一组(至少一个)程序模块1225的程序/实用工具1224,这样的程序模块包括但不限于:操作系统、一个或者多个应用程序、其他程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。
总线1230可以为表示几类总线结构中的一种或多种,包括存储单元总线或者存储单元控制器、外围总线、图形加速端口、处理单元或者使用各种总线结构中的任意总线结构的 局域总线。
电子设备1200也可以与一个或多个外部设备1300(例如键盘、指向设备、蓝牙设备等)通信,还可以与一个或者多个使得用户可以与该电子设备1200交互的设备通信,和/或与使得该电子设备1200能与一个或多个其他计算设备进行通信的任何设备(例如路由器、调制解调器等)通信。这种通信可以通过输入/输出(I/O)接口1250进行。并且,电子设备1200还可以通过网络适配器1260与一个或者多个网络(例如局域网(LAN)、广域网(WAN)和/或公共网络,例如因特网)通信。如图12所示,网络适配器1260可以通过总线1230与电子设备1200的其他模块通信。应当明白,尽管图中未示出,可以结合电子设备1200使用其他硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。
本领域技术人员能够理解,本公开的各个方面可以实现为系统、方法或程序产品。因此,本公开的各个方面可以具体实现为以下形式,即:完全的硬件实施方式、完全的软件实施方式(包括固件、微代码等),或硬件和软件结合的实施方式,这里可以统称为“电路”、“模块”或“系统”。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由所附的权利要求指出。
上述所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施方式中,如有可能,各实施例中所讨论的特征是可互换的。在上面的描述中,提供许多具体细节从而给出对本公开的实施方式的充分理解。然而,本领域技术人员将意识到,可以实践本公开的技术方案而没有特定细节中的一个或更多,或者可以采用其它的方法、组件、材料等。在其它情况下,不详细示出或描述公知结构、材料或者操作以避免模糊本公开的各方面。

Claims (24)

  1. 一种交易校验方法,其特征在于,包括:
    获取交易信息,根据所述交易信息生成校验标识信息;
    将所述校验标识信息作为叶子节点保存在树形结构的校验区块中;
    获取所述校验区块的根节点信息以及所述校验标识信息在所述校验区块中的校验路径;
    将所述校验标识信息、根节点信息以及校验路径,发送至所述交易信息中涉及的第一交易方,以供第一交易方对所述交易信息进行校验。
  2. 根据权利要求1所述的交易校验方法,其特征在于,所述方法还包括:
    将所述校验标识信息发送至所述交易信息中涉及的第二交易方,以供第二交易方对所述交易信息进行校验。
  3. 根据权利要求1所述的交易校验方法,其特征在于,所述方法还包括:
    将所述校验区块广播至区块链网络,以供所述第一交易方、第二交易方或第一交易方和第二交易方通过所述区块链网络对所述交易信息进行校验。
  4. 根据权利要求1所述的交易校验方法,其特征在于,所述校验路径包括:用于对所述校验标识信息进行校验的有序排列的子节点信息。
  5. 根据权利要求1所述的交易校验方法,其特征在于,所述根据所述交易信息生成校验标识信息,包括:
    根据所述交易信息获取交易结果;
    当所述交易结果为交易成功时,对所述交易信息进行加密得到校验标识信息。
  6. 根据权利要求5所述的交易校验方法,其特征在于,所述根据所述交易信息获取交易结果,包括:
    从所述交易信息中获取在交易生成链路上涉及的多个数据接口的调用状态;
    根据各个数据接口的调用状态,获取交易结果。
  7. 根据权利要求6所述的交易校验方法,其特征在于,所述根据各个数据接口的调用状态,获取交易结果,包括:
    当各个数据接口的调用状态均为调用成功时,交易结果为交易成功;
    当任一数据接口的调用状态为调用失败时,交易结果为交易失败。
  8. 根据权利要求5所述的交易校验方法,其特征在于,所述对所述交易信息进行加密得到校验标识信息,包括:
    使用哈希算法对所述交易信息进行加密得到校验标识信息。
  9. 根据权利要求1所述的交易校验方法,其特征在于,所述将所述校验标识信息作为叶子节点保存在树形结构的校验区块中,包括:
    在满足参考条件时,创建基于默克尔树的校验区块;
    将所述校验标识信息保存在所述默克尔树的叶子节点中。
  10. 根据权利要求9所述的交易校验方法,其特征在于,所述参考条件包括:待保存的校验标识信息达到参考数量。
  11. 根据权利要求9所述的交易校验方法,其特征在于,所述参考条件包括:距离上一校验区块的创建时间达到参考时间。
  12. 一种交易校验装置,其特征在于,包括:
    第一获取模块,被配置为获取交易信息,根据所述交易信息生成校验标识信息;
    保存模块,被配置为将所述校验标识信息作为叶子节点保存在树形结构的校验区块中;
    第二获取模块,被配置为获取所述校验区块的根节点信息以及所述校验标识信息在所述校验区块中的校验路径;
    发送模块,被配置为将所述校验标识信息、根节点信息以及校验路径,发送至所述交易信息中涉及的第一交易方,以供第一交易方对所述交易信息进行校验。
  13. 根据权利要求12所述的装置,其特征在于,所述发送模块,还被配置为将校验标识信息发送至交易信息中涉及的第二交易方,以供第二交易方对交易信息进行校验。
  14. 根据权利要求12所述的装置,其特征在于,所述装置还包括:
    广播模块,被配置为将校验区块广播至区块链网络,以供第一交易方、第二交易方或第一交易方和第二交易方通过区块链网络对交易信息进行校验。
  15. 根据权利要求12所述的装置,其特征在于,所述校验路径包括:用于对校验标识信息进行校验的有序排列的子节点信息。
  16. 根据权利要求12所述的装置,其特征在于,所述装置还包括:
    第三获取模块,被配置为根据交易信息获取交易结果;
    第一获取模块,被配置为当交易结果为交易成功时,对交易信息进行加密得到校验标识信息。
  17. 根据权利要求16所述的装置,其特征在于,所述第三获取模块,被配置为从交易信息中获取在交易生成链路上涉及的多个数据接口的调用状态;根据各个数据接口的调用状态,获取交易结果。
  18. 根据权利要求17所述的装置,其特征在于,所述第三获取模块,被配置为当各个 数据接口的调用状态均为调用成功时,交易结果为交易成功;当任一数据接口的调用状态为调用失败时,交易结果为交易失败。
  19. 根据权利要求16所述的装置,其特征在于,所述第一获取模块,被配置为使用哈希算法对交易信息进行加密得到校验标识信息。
  20. 根据权利要求12所述的装置,其特征在于,所述保存模块,被配置为在满足参考条件时,创建基于默克尔树的校验区块;将校验标识信息保存在默克尔树的叶子节点中。
  21. 根据权利要求20所述的装置,其特征在于,所述参考条件包括:待保存的校验标识信息达到参考数量。
  22. 根据权利要求20所述的装置,其特征在于,所述参考条件包括:距离上一校验区块的创建时间达到参考时间。
  23. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1-11中任意一项所述的交易校验方法。
  24. 一种电子设备,其特征在于,包括:
    处理器;
    存储器,用于存储所述处理器的可执行指令;
    其中,所述处理器被配置为经由执行所述可执行指令来执行权利要求1-11中任意一项所述的交易校验方法。
PCT/CN2019/096043 2018-08-07 2019-07-15 交易校验方法、装置、存储介质及电子设备 WO2020029755A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2021506545A JP2021533502A (ja) 2018-08-07 2019-07-15 取引検証方法、装置、記憶媒体及び電子機器
US17/266,942 US20210304201A1 (en) 2018-08-07 2019-07-15 Transaction verification method and apparatus, storage medium, and electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810889456.6A CN109087101B (zh) 2018-08-07 2018-08-07 交易校验方法、装置、存储介质及电子设备
CN201810889456.6 2018-08-07

Publications (1)

Publication Number Publication Date
WO2020029755A1 true WO2020029755A1 (zh) 2020-02-13

Family

ID=64833704

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/096043 WO2020029755A1 (zh) 2018-08-07 2019-07-15 交易校验方法、装置、存储介质及电子设备

Country Status (4)

Country Link
US (1) US20210304201A1 (zh)
JP (1) JP2021533502A (zh)
CN (1) CN109087101B (zh)
WO (1) WO2020029755A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112819467A (zh) * 2021-02-23 2021-05-18 中国信息通信研究院 一种隐私交易方法、装置及系统

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109087101B (zh) * 2018-08-07 2021-09-07 北京三快在线科技有限公司 交易校验方法、装置、存储介质及电子设备
CN111401672B (zh) * 2019-01-02 2023-11-28 中国移动通信有限公司研究院 一种基于区块链的合法性校验方法、设备及系统
CN109767245A (zh) * 2019-01-08 2019-05-17 中国联合网络通信集团有限公司 消费信息核对方法、设备及存储介质
CN110349019B (zh) * 2019-06-03 2020-11-10 创新先进技术有限公司 一种块链式账本中的验证方法、装置及设备
US11115189B2 (en) 2019-06-03 2021-09-07 Advanced New Technologies Co., Ltd. Verifying a blockchain-type ledger
US10896171B2 (en) * 2019-06-13 2021-01-19 Tyson York Winarski Big data blockchains with Merkle trees
US11533127B1 (en) * 2019-09-20 2022-12-20 Kaleidoscope Blockchain, Inc. Determining data availability
US11356274B2 (en) * 2019-09-20 2022-06-07 Kaleidoscope Blockchain, Inc. Verifying a set of remotely stored data
CN113283914A (zh) * 2020-02-18 2021-08-20 北京沃东天骏信息技术有限公司 虚拟资产的校验方法、装置、电子设备和存储介质
CN111311283B (zh) * 2020-02-20 2021-02-05 宁波甜宝生物信息技术有限公司 基于区块链和云计算的化妆品溯源生产工艺方法
CN112131235A (zh) * 2020-09-21 2020-12-25 中国电子科技网络信息安全有限公司 一种区块链系统内交易可信校验实现方法
CN112150150B (zh) * 2020-09-30 2023-08-08 重庆市科学技术研究院 一种基于区块链的电子票券交易系统及方法
CN112702400A (zh) * 2020-12-15 2021-04-23 北京链飞未来科技有限公司 一种基于多级默克尔树的区块链跨链交易验证方法
CN113704271A (zh) * 2021-09-03 2021-11-26 杭州复杂美科技有限公司 默克尔树生成方法、非法节点识别方法、设备和存储介质
CN115049402B (zh) * 2022-08-17 2022-10-25 国网区块链科技(北京)有限公司 一种交易风险参数计算方法、区块链验证节点及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107247773A (zh) * 2017-06-07 2017-10-13 北京邮电大学 一种基于区块链的在分布式数据库中进行交易查询的方法
CN108009810A (zh) * 2017-12-27 2018-05-08 光载无限(北京)科技有限公司 一种可信数字资产交易方法
CN108171511A (zh) * 2017-12-26 2018-06-15 陈晶 一种具有隐私保护功能的区块链模型
CN108197226A (zh) * 2017-12-29 2018-06-22 山大地纬软件股份有限公司 Mptc账户状态树以及mptc区块链快速检索方法
CN109087101A (zh) * 2018-08-07 2018-12-25 北京三快在线科技有限公司 交易校验方法、装置、存储介质及电子设备

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9973341B2 (en) * 2015-01-23 2018-05-15 Daniel Robert Ferrin Method and apparatus for the limitation of the mining of blocks on a block chain
CN107145768B (zh) * 2016-03-01 2021-02-12 华为技术有限公司 版权管理方法和系统
CN106407795B (zh) * 2016-09-05 2019-05-14 北京众享比特科技有限公司 数据存在认证系统、认证方法及验证方法
CN106650496B (zh) * 2016-12-16 2020-03-31 杭州嘉楠耘智信息科技有限公司 一种数据处理方法及装置
US10291408B2 (en) * 2016-12-23 2019-05-14 Amazon Technologies, Inc. Generation of Merkle trees as proof-of-work
CN107077674B (zh) * 2016-12-29 2021-06-11 达闼机器人有限公司 交易验证处理方法、装置及节点设备
US10824759B1 (en) * 2017-01-25 2020-11-03 State Farm Mutual Automobile Insurance Company Systems and methods for verifying agent sales data via blockchain
GB201709518D0 (en) * 2017-06-15 2017-08-02 Nchain Holdings Ltd Computer-implemented system and method
US11146380B2 (en) * 2017-08-03 2021-10-12 Parity Technologies Ltd. Methods and systems for a heterogeneous multi-chain framework
CN107807951B (zh) * 2017-09-18 2020-10-13 联动优势科技有限公司 一种区块链生成方法、数据验证方法、节点及系统
GB201720946D0 (en) * 2017-12-15 2018-01-31 Nchain Holdings Ltd Computer-implemented system and method
CN112491551B (zh) * 2018-06-29 2023-01-20 创新先进技术有限公司 基于区块链的数据验证方法及装置、电子设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107247773A (zh) * 2017-06-07 2017-10-13 北京邮电大学 一种基于区块链的在分布式数据库中进行交易查询的方法
CN108171511A (zh) * 2017-12-26 2018-06-15 陈晶 一种具有隐私保护功能的区块链模型
CN108009810A (zh) * 2017-12-27 2018-05-08 光载无限(北京)科技有限公司 一种可信数字资产交易方法
CN108197226A (zh) * 2017-12-29 2018-06-22 山大地纬软件股份有限公司 Mptc账户状态树以及mptc区块链快速检索方法
CN109087101A (zh) * 2018-08-07 2018-12-25 北京三快在线科技有限公司 交易校验方法、装置、存储介质及电子设备

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112819467A (zh) * 2021-02-23 2021-05-18 中国信息通信研究院 一种隐私交易方法、装置及系统

Also Published As

Publication number Publication date
CN109087101B (zh) 2021-09-07
US20210304201A1 (en) 2021-09-30
CN109087101A (zh) 2018-12-25
JP2021533502A (ja) 2021-12-02

Similar Documents

Publication Publication Date Title
WO2020029755A1 (zh) 交易校验方法、装置、存储介质及电子设备
AU2021204210B2 (en) Method and system for validation of hashed data via acceptance frames
AU2020201891B2 (en) Method and system for gross settlement by use of an opaque blockchain
CA3004424C (en) Method and system for processing of a blockchain transaction in a transaction processing network
CA3004423C (en) Method and system for use of a blockchain in a transaction processing network
US11928679B2 (en) Method and system for authorization using a public ledger and encryption keys
US11182851B2 (en) Inter-ledger messaging in a blockchain
JP2023164828A (ja) ブロックチェーンを使用する取引口座データ保守
EP3414718A1 (en) Method and system for offline blockchain exchanges

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19846485

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021506545

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19846485

Country of ref document: EP

Kind code of ref document: A1