CN113643030B - Transaction processing method, device and equipment - Google Patents

Transaction processing method, device and equipment Download PDF

Info

Publication number
CN113643030B
CN113643030B CN202110929666.5A CN202110929666A CN113643030B CN 113643030 B CN113643030 B CN 113643030B CN 202110929666 A CN202110929666 A CN 202110929666A CN 113643030 B CN113643030 B CN 113643030B
Authority
CN
China
Prior art keywords
transaction
information
record information
reverse
user
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.)
Active
Application number
CN202110929666.5A
Other languages
Chinese (zh)
Other versions
CN113643030A (en
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.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202110929666.5A priority Critical patent/CN113643030B/en
Publication of CN113643030A publication Critical patent/CN113643030A/en
Application granted granted Critical
Publication of CN113643030B publication Critical patent/CN113643030B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Computer Security & Cryptography (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The embodiment of the specification provides a transaction processing method, a device and equipment, wherein the method comprises the following steps: receiving a reverse transaction request sent by terminal equipment of a first user; wherein the reverse transaction request includes transaction information including a forward transaction identification of a forward transaction associated with the reverse exchange; the forward transaction is a transaction of transferring resources from a first user to a second user when all transaction elements of the transaction are successfully locked; reverse transaction is a transaction in which all or part of the resources transferred by the first user to the second user are returned to the first user; inquiring transaction record information associated with the forward transaction identification from the blockchain; and if the transaction information meets the transaction condition according to the transaction record information, performing reverse transaction processing according to the transaction information.

Description

Transaction processing method, device and equipment
This patent application is application number: 202010140399.9, filing date: the invention relates to a method, a device and equipment for transaction processing, which are divided into Chinese patent application of 03 month 03 in 2020.
Technical Field
The present document relates to the field of computer technologies, and in particular, to a transaction processing method, apparatus, and device.
Background
With the continuous development of the internet technology, online shopping is widely carried into the life of people with the characteristics of convenience, time saving, labor saving and the like. The trade of commodity refund due to dissatisfaction with purchased commodity, errors in ordering, etc. is not unfamiliar to people. Typically, the merchandise exchange transaction will be based on the transaction information of the merchandise purchase transaction. However, the transaction information of the current commodity purchase transaction is usually maintained by a centralized transaction platform, and there is a risk of losing or damaging the transaction information, which further affects the performance of commodity refund transaction.
Disclosure of Invention
One or more embodiments of the present specification provide a transaction processing method. The method includes receiving a reverse transaction request sent by a terminal device of a first user. Wherein the reverse transaction request includes transaction information. The transaction information includes a forward transaction identification of a forward transaction associated with the reverse exchange. And the forward transaction is a transaction of transferring resources from the first user to the second user when all transaction elements of the transaction are successfully locked by the user corresponding to the transaction elements. The reverse transaction is a transaction in which all or part of the resources transferred by the first user to the second user are returned to the first user. And inquiring the associated transaction record information from the blockchain according to the forward transaction identification. And if the transaction information meets the transaction condition according to the transaction record information, performing reverse transaction processing according to the transaction information.
One or more embodiments of the present specification provide a transaction processing apparatus. The device comprises a receiving module which receives a reverse transaction request sent by terminal equipment of a first user. Wherein the reverse transaction request includes transaction information. The transaction information includes a forward transaction identification of a forward transaction associated with the reverse exchange. And the forward transaction is a transaction of transferring resources from the first user to the second user when all transaction elements of the transaction are successfully locked by the user corresponding to the transaction elements. The reverse transaction is a transaction in which all or part of the resources transferred by the first user to the second user are returned to the first user. The apparatus also includes a query module that queries the blockchain for associated transaction record information based on the forward transaction identification. The device also comprises a processing module which performs reverse transaction processing according to the transaction information if the transaction information is determined to meet the transaction condition according to the transaction record information.
One or more embodiments of the present specification provide a transaction processing device. The apparatus includes a processor. The device further comprises a memory arranged to store computer executable instructions. The computer-executable instructions, when executed, receive a reverse transaction request sent by a terminal device of a first user. Wherein the reverse transaction request includes transaction information. The transaction information includes a forward transaction identification of a forward transaction associated with the reverse exchange. And the forward transaction is a transaction of transferring resources from the first user to the second user when all transaction elements of the transaction are successfully locked by the user corresponding to the transaction elements. The reverse transaction is a transaction in which all or part of the resources transferred by the first user to the second user are returned to the first user. And inquiring the associated transaction record information from the blockchain according to the forward transaction identification. And if the transaction information meets the transaction condition according to the transaction record information, performing reverse transaction processing according to the transaction information.
One or more embodiments of the present specification provide a storage medium. The storage medium is for storing computer-executable instructions. The computer-executable instructions, when executed, receive a reverse transaction request sent by a terminal device of a first user. Wherein the reverse transaction request includes transaction information. The transaction information includes a forward transaction identification of a forward transaction associated with the reverse exchange. And the forward transaction is a transaction of transferring resources from the first user to the second user when all transaction elements of the transaction are successfully locked by the user corresponding to the transaction elements. The reverse transaction is a transaction in which all or part of the resources transferred by the first user to the second user are returned to the first user. And inquiring the associated transaction record information from the blockchain according to the forward transaction identification. And if the transaction information meets the transaction condition according to the transaction record information, performing reverse transaction processing according to the transaction information.
Drawings
For a clearer description of one or more embodiments of the present description or of the solutions of the prior art, the drawings that are necessary for the description of the embodiments or of the prior art will be briefly described, it being apparent that the drawings in the description that follow are only some of the embodiments described in the description, from which, for a person skilled in the art, other drawings can be obtained without inventive faculty.
FIG. 1 is a schematic diagram of a first scenario of a transaction processing method according to one or more embodiments of the present disclosure;
FIG. 2 is a schematic diagram of a second scenario of a transaction processing method according to one or more embodiments of the present disclosure;
FIG. 3 is a schematic diagram of a third scenario of a transaction processing method according to one or more embodiments of the present disclosure;
FIG. 4 is a first flow diagram of a transaction processing method according to one or more embodiments of the present disclosure;
FIG. 5 is a second flow diagram of a transaction processing method according to one or more embodiments of the present disclosure;
FIG. 6 is a third flow diagram of a transaction processing method according to one or more embodiments of the present disclosure;
FIG. 7 is a fourth flow diagram of a transaction processing method according to one or more embodiments of the present disclosure;
FIG. 8 is a fifth flow diagram of a transaction processing method according to one or more embodiments of the present disclosure;
FIG. 9 is a sixth flow diagram of a transaction processing method according to one or more embodiments of the present disclosure;
FIG. 10 is a schematic diagram of a module composition of a transaction processing device according to one or more embodiments of the present disclosure;
fig. 11 is a schematic structural diagram of a transaction processing device according to one or more embodiments of the present disclosure.
Detailed Description
In order to enable a person skilled in the art to better understand the technical solutions in one or more embodiments of the present specification, the technical solutions in one or more embodiments of the present specification will be clearly and completely described below with reference to the drawings in one or more embodiments of the present specification, and it is obvious that the described embodiments are only some embodiments of the present specification, not all embodiments. All other embodiments, which can be made by one or more embodiments of the present disclosure without inventive faculty, are intended to be within the scope of the present disclosure.
Fig. 1 is a schematic application scenario of a transaction processing method according to one or more embodiments of the present disclosure, where, as shown in fig. 1, the scenario includes: a terminal device of a first user, a transaction processing node and a blockchain; the terminal equipment of the first user can be a mobile phone, a tablet computer, a desktop computer, a portable notebook computer and the like; the terminal device of the first user is in communication connection with the transaction processing node via a wireless network.
Specifically, after the terminal equipment of the first user performs data communication with the transaction processing node to complete a forward transaction, the terminal equipment responds to the reverse transaction operation of the first user and sends a reverse transaction request to the transaction processing node according to the determined transaction information; when all transaction elements of the transaction are successfully locked, transferring resources from the first user to the second user, and reversing the transaction to return all or part of the resources transferred from the first user to the second user to the first user; the transaction information includes a forward transaction identification of a forward transaction associated with the reverse exchange. When a transaction processing node receives a reverse transaction request sent by terminal equipment of a first user, inquiring transaction record information associated with a forward transaction identifier from a blockchain; and determining whether transaction information included in the reverse transaction request meets transaction conditions according to the queried transaction record information, and if so, performing reverse transaction processing according to the transaction information and sending a processing result to terminal equipment of the first user.
Further, in one or more embodiments of the present disclosure, the transaction processing node may be a first blockchain node in a blockchain, and a corresponding application scenario diagram of the transaction processing method is shown in fig. 2.
Further, in one or more embodiments of the present disclosure, the transaction processing node may be a transaction platform for processing a transaction, and correspondingly, as shown in fig. 3, an application scenario of the transaction processing method may further include at least one blockchain node (only one is shown in fig. 3), where the transaction platform performs data interaction with the blockchain node, and queries, through the blockchain node, transaction record information associated with a forward transaction identifier from the blockchain.
Therefore, the transaction record information is stored in the blockchain, and based on the characteristics of tamper resistance, disclosure and investigation of the blockchain, the data security of the transaction record information is ensured, so that an effective data basis is provided for the related processing of the reverse transaction, and the effective processing of the reverse transaction is ensured; furthermore, the forward transaction associated with the reverse transaction is to transfer resources when all transaction elements of the transaction are locked successfully, but not directly, so that transaction failure caused by that a certain transaction element does not meet the transaction condition is effectively avoided.
Based on the application scenario architecture, one or more embodiments of the present disclosure provide a transaction processing method. Fig. 4 is a flow diagram of a transaction processing method according to one or more embodiments of the present disclosure, where the method of fig. 4 can be performed by the transaction processing node of fig. 1, and as shown in fig. 4, the method includes the steps of:
Step S102, receiving a reverse transaction request sent by terminal equipment of a first user; wherein the reverse transaction request includes transaction information including a forward transaction identification of a forward transaction associated with the reverse exchange; the forward transaction is a transaction of transferring resources from a first user to a second user when all transaction elements of the transaction are successfully locked; reverse transaction is a transaction in which all or part of the resources transferred by the first user to the second user are returned to the first user;
the transaction information further comprises resource transfer information, wherein the resource transfer information comprises information such as a first quantity of resources to be returned.
Step S104, inquiring transaction record information associated with the forward transaction identifier from the blockchain;
step S106, if the transaction information meets the transaction condition according to the transaction record information, performing reverse transaction processing according to the transaction information.
Further, if the transaction information does not meet the transaction condition according to the transaction record information, the request failure information is sent to the terminal equipment.
It should be noted that, when the transaction processing node is a transaction platform, step S104 may include: the transaction platform transmits a query request to the block chain link according to the forward transaction identifier included in the reverse transaction request, so that the block chain node queries transaction record information associated with the forward transaction identifier from the block chain, and transmits the queried transaction record information to the transaction platform; accordingly, step S106 may include: and if the transaction platform determines that the transaction information included in the reverse transaction request meets the transaction condition according to the received transaction record information, performing reverse transaction processing according to the transaction information. Or step S104 includes: the transaction platform transmits a verification request to the block chain link point according to transaction information included in the reverse transaction request, so that the block chain link point queries transaction record information associated with the forward transaction identifier from the block chain based on intelligent contracts in the block chain, determines whether the transaction information meets transaction conditions according to the queried transaction record information, and transmits a determination result to the transaction platform; correspondingly, step S106 includes: and if the received determination result indicates that the transaction information meets the transaction condition, performing reverse transaction processing according to the transaction information.
In one or more embodiments of the present disclosure, by storing transaction record information in a blockchain, based on characteristics of the blockchain, such as non-tamperability, disclosure, and searchability, data security of the transaction record information is ensured, so that an effective data basis is provided for related processing of reverse transaction, and effective processing of reverse transaction is ensured; furthermore, the forward transaction associated with the reverse transaction is to transfer resources when all transaction elements of the transaction are locked successfully, but not directly, so that transaction failure caused by that a certain transaction element does not meet the transaction condition is effectively avoided.
Considering the previous successful forward transaction, a plurality of data management operations such as inventory updating, red package management, and credit increase and decrease are often involved. In order to avoid transaction failure caused by failure of data management operation of one or more layers, in one or more embodiments of the present disclosure, when a transaction processing node receives a forward transaction request sent by a terminal device, locking information of each transaction element associated with a transaction is first determined, and a transaction element locking request is sent to a second terminal device of a user corresponding to the transaction element according to the locking information, so as to lock each transaction element associated with the transaction, and if response data returned by each second terminal device indicates that the transaction element locking is successful, resources are transferred from a resource account of a first user to a resource account of a second user according to the forward transaction request; if the response data returned by the at least one second terminal device represents that the transaction element is locked to fail, performing transaction rollback processing; each transaction record information of the transaction is stored in the blockchain, and transaction processing such as reverse transaction is performed based on the transaction record information in the blockchain in the following. The resource may be an entity resource (e.g., currency), or may be a virtual resource (e.g., point).
As an example, the forward transaction request includes forward transaction identification and forward transaction information, where the forward transaction information includes information such as a first user transferring 70 an integration to a second user and redeeming a coupon identified as Y for a milk 1 bin of brand X provided by the second user; the transaction processing node determines that transaction elements related to the transaction comprise milk and coupons according to the transaction information, determines that locking information of the milk comprises a brand X and a box 1, and determines that locking information of the coupons comprises an identifier Y; according to the forward transaction identification and the determined locking information, a transaction element locking request is respectively sent to a second terminal device of a second user and a second terminal device of a coupon management user; the second terminal equipment of the second user inquires the stock quantity of the milk of the brand X and takes the stock quantity of the milk of the brand X as state information of the milk of the brand X according to the received transaction element locking request, for example, the inquired stock is 5, the milk of the brand X is confirmed to be in a tradable state, 1 box of the milk of the brand X is locked, the brand X and the quantity 1 box are recorded in an associated mode with the forward transaction identifier, and response data representing that the locking operation is successful are returned; further, when the second terminal device of the coupon management user receives the transaction element locking request, detecting whether the coupon marked as Y is in the validity period and is used as the state information of the coupon, for example, in the validity period, determining that the coupon is in a tradable state, locking the coupon so that other transactions cannot use the coupon, associating the mark Y of the coupon with the forward transaction mark, recording, and returning response data representing that the locking operation is successful. The transaction processing node determines that each transaction element is successfully locked according to each response data returned by the second terminal equipment, and then 70 points are transferred from the resource account of the first user to the resource account of the second user; and determining the resource account of the first user as a resource transfer-out account, determining the resource account of the second user as a resource transfer-in account, associating records according to the account information of the resource transfer-out account, the account information of the resource transfer-in account, the second quantity of transferred resources and the like, determining the recorded information as first recorded information of forward transaction, and storing the first recorded information into a blockchain.
Therefore, based on the forward transaction request, when all transaction elements of the transaction are successfully locked, the resource transfer is performed instead of directly, and the transaction failure caused by the fact that a certain transaction element does not meet the transaction condition is effectively avoided.
After the forward transaction is successful, the user may conduct a reverse transaction based on the successful forward transaction as desired. To secure transactions, the reverse transaction request includes: ciphertext data of the transaction information, wherein the ciphertext data is obtained by encrypting the transaction information by adopting a private key of a first user; accordingly, as shown in fig. 5, step S102 includes:
Step S102', receiving a reverse transaction request sent by terminal equipment of a first user; the reverse transaction request comprises ciphertext data of transaction information, and the transaction information comprises a forward transaction identifier of a forward transaction associated with the reverse transaction; the forward transaction is a transaction of transferring resources from a first user to a second user when all transaction elements of the transaction are successfully locked; reverse transaction is a transaction in which all or part of the resources transferred by the first user to the second user are returned to the first user;
in response, as shown in fig. 5, step S104 includes:
Step S104-2, obtaining a public key corresponding to the private key of the first user;
Optionally, the reverse transaction request further includes digital identity information of the first user, such as DID (english: decentralized Identifiers; chinese: decentralized identity or distributed identity), and the step S104-2 may include: inquiring a corresponding document (DID doc) from the blockchain according to the digital identity information of the first user, and acquiring a public key of the first user from the document; or sending a key acquisition request to a designated security mechanism according to the digital identity information of the first user, so that the designated security mechanism acquires an associated public key from the association relationship between the pre-stored digital identity information and the public key according to the digital identity information of the first user, and sends the acquired public key to a transaction processing node.
Step S104-4, decrypting the ciphertext data by using the obtained public key to obtain transaction information;
Step S104-6, acquiring a forward transaction identifier from the obtained transaction information;
step S104-8, inquiring the associated transaction record information from the blockchain according to the obtained forward transaction identification.
By encrypting the transaction information by adopting the private key of the first user and sending the ciphertext data of the transaction information to the transaction processing node, the transaction safety is ensured, and risks such as malicious tampering of the transaction information are avoided.
Considering that the user may perform a reverse transaction operation based on a failed transaction due to a misoperation, step S106 includes:
step S106-2, if the transaction record information is determined to comprise the first record information and the resource transfer information in the transaction record information is matched with the resource transfer information in the transaction information, determining that the transaction information meets the transaction condition; wherein the first record information characterizes the forward transaction as being in a successful transaction state.
Specifically, whether the queried transaction record information comprises first record information is determined, if not, the transaction information is determined to not meet the transaction condition, and request failure information is sent to terminal equipment of a first user; if yes, determining whether the resource transfer record information in the queried transaction record information is matched with the resource transfer information in the transaction information, if not, determining that the transaction information does not meet the transaction condition, and sending request failure information to the terminal equipment of the first user; if so, determining that the transaction information meets the transaction condition, and executing step S106-4.
And S106-4, performing reverse transaction processing according to the transaction information.
Further, it is contemplated that in practice, the user may conduct one or more reverse transactions based on the same forward transaction, and thus the transaction record information queried from the blockchain according to the forward transaction identifier may include the first record information of the forward transaction, or may include both the first record information of the forward transaction and the second record information of the reverse transaction processed based on the forward transaction.
When the queried transaction record information includes the first record information, that is, when the first user performs the reverse transaction operation for the first time, as shown in fig. 7, step S106-2 includes:
step S106-2-2, determining whether the queried transaction record information comprises first record information, if yes, executing step S106-2-4, otherwise, sending request failure information to terminal equipment of a first user;
step S106-2-4, determining resource transfer-in account information, resource transfer-out account information and first quantity of resources to be returned according to the resource transfer information in the transaction information;
optionally, the resource transfer information in the transaction information includes resource transfer-in account information, resource transfer-out account information, and a first amount of resources to be returned, and correspondingly, step S106-2-4 includes: and acquiring the resource transfer-in account information, the resource transfer-out account information and the first quantity of the resources to be returned from the resource transfer information included in the transaction information. Or the resource transfer information in the transaction information comprises the user identification of the first user, the user identification of the second user and the first quantity of the resources to be returned, and the association relation between the user identification and the account information of the resource account is prestored in the transaction processing node; correspondingly, step S106-2-4 comprises: acquiring a user identifier of a first user, a user identifier of a second user and a first quantity of resources to be returned from resource transfer information included in transaction information; acquiring associated account information from the stored association relation according to the user identification of the first user, and determining the acquired account information as resource transfer account information; and acquiring associated account information from the stored association relation according to the user identification of the second user, and determining the acquired account information as resource transfer account information.
Step S106-2-6, verifying whether the determined resource transfer-in account information is the same as the resource transfer-out account information included in the first record information, if so, executing step S106-2-8, otherwise, sending request failure information to the terminal equipment of the first user;
Step S106-2-8, verifying whether the determined resource transfer-out account information is the same as the resource transfer-in account information included in the first record information, if so, executing step S106-2-10, otherwise, sending request failure information to the terminal equipment of the first user;
Step S106-2-10, verifying whether the determined first quantity is not greater than the second quantity of transferred resources included in the first transaction record information, if so, executing step S106-4, otherwise, sending request failure information to the terminal device of the first user.
That is, when the verification results in steps S106-2-6 to S106-2-10 are yes, it is determined that the resource transfer information in the transaction record information matches the resource transfer information in the transaction information. It should be noted that the execution sequence of steps S106-2-6 to S106-2-10 is not limited to the above sequence, and may be set according to the needs in practical applications.
Further, when the queried transaction record information includes the first record information and the second record information of the reverse transaction processed based on the forward transaction, that is, when the first user does not perform the reverse transaction operation for the first time, as shown in fig. 8, the following steps S106-2-12 are further included on the basis of the foregoing steps S106-2-2 to S106-2-8:
Step S106-2-12, verifying whether the third quantity is not greater than the second quantity of transferred resources included in the first record information, wherein the third quantity is the total quantity of resources to be returned and returned resources included in the second record information, if yes, executing step S106-4, otherwise, sending request failure information to the terminal equipment of the first user.
Determining whether the forward transaction associated with the reverse transaction is in a successful state or not by determining whether the queried transaction record information comprises the first record information; by verifying whether the resource transfer information in the transaction record information is matched with the resource transfer information in the transaction information, the validity of the transaction information is ensured.
Further, when it is determined that the forward transaction associated with the reverse transaction is in a successful state and the transaction information is valid, the reverse transaction processing can be performed according to the transaction information, and specifically, the performing the reverse transaction processing according to the transaction information in step S106 includes: transferring a first amount of resources from the determined resource transfer account to the determined resource transfer account, and sending request success information to the first terminal device.
In order to trace back the reverse transaction and provide a valid verification basis for the reverse transaction initiated based on the same forward transaction, as shown in fig. 9, step S106 further includes:
Step S108, generating second record information of the reverse transaction according to the reverse transaction identification and the transaction information included in the reverse transaction request;
Step S110, the second record information is saved in the blockchain.
By storing the first recorded information and the second recorded information into the blockchain, the data security of the recorded information is ensured, and the problems that the transaction cannot be effectively processed due to data loss and the like are avoided.
In a specific embodiment, the transaction processing method may include the steps of:
Step S202, receiving a reverse transaction request sent by terminal equipment of a first user; the reverse transaction request comprises ciphertext data of transaction information, and the transaction information comprises a forward transaction identifier of a forward transaction associated with the reverse transaction; the forward transaction is a transaction of transferring resources from a first user to a second user when all transaction elements of the transaction are successfully locked; reverse transaction is a transaction in which all or part of the resources transferred by the first user to the second user are returned to the first user;
step S204, obtaining a public key corresponding to the private key of the first user, and decrypting ciphertext data included in the reverse transaction request by adopting the obtained public key to obtain transaction information;
step S206, acquiring a forward transaction identifier from the acquired transaction information, and inquiring associated transaction record information from the blockchain according to the acquired forward transaction identifier;
Step S208, determining whether the queried transaction record information comprises first record information, if yes, executing step S210, otherwise, sending request failure information to terminal equipment of a first user;
Step S210, determining whether the queried transaction record information comprises second record information of reverse transaction processed based on forward transaction, if yes, executing step S212, otherwise, executing step S222;
step S212, determining resource transfer-in account information, resource transfer-out account information and first quantity of resources to be returned according to the resource transfer information in the transaction information;
Step S214, verifying whether the determined resource transfer-in account information is the same as the resource transfer-out account information included in the first record information, if so, executing step S216, otherwise, sending request failure information to the terminal equipment of the first user;
Step S216, verifying whether the determined resource transfer-out account information is the same as the resource transfer-in account information included in the first record information, if so, executing step S218, otherwise, sending request failure information to the terminal equipment of the first user;
step S218, determining the total number of the resources to be returned and the returned resources included in the second record information, and taking the total number as a third number;
Step S220, verifying whether the third quantity is not more than the second quantity of transferred resources included in the first record information, if yes, executing step S230, otherwise, sending request failure information to the terminal equipment of the first user;
step S222, determining resource transfer-in account information, resource transfer-out account information and first quantity of resources to be returned according to the resource transfer information in the transaction information;
step S224, verifying whether the determined resource transfer-in account information is the same as the resource transfer-out account information included in the first record information, if so, executing step S226, otherwise, sending request failure information to the terminal equipment of the first user;
Step S226, verifying whether the determined resource transfer-out account information is the same as the resource transfer-in account information included in the first record information, if so, executing step S228, otherwise, sending request failure information to the terminal equipment of the first user;
Step S228, verifying whether the determined first quantity is not greater than the second quantity of transferred resources included in the first transaction record information, if yes, executing step S230, otherwise, sending request failure information to the terminal device of the first user;
step S230, transferring a first amount of resources from the determined resource transfer account to the determined resource transfer account;
step S232, generating second record information of the reverse transaction according to the reverse transaction identification and the transaction information included in the reverse transaction request, storing the second record information into the blockchain, and sending request success information to the first terminal equipment.
It should be noted that, the specific implementation process of the steps S202 to S232 may be referred to the above related description, and the repetition is not repeated here.
In one or more embodiments of the present disclosure, by storing transaction record information in a blockchain, based on characteristics of the blockchain, such as non-tamperability, disclosure, and searchability, data security of the transaction record information is ensured, so that an effective data basis is provided for related processing of reverse transaction, and effective processing of reverse transaction is ensured; furthermore, the forward transaction associated with the reverse transaction is to transfer resources when all transaction elements of the transaction are locked successfully, but not directly, so that transaction failure caused by that a certain transaction element does not meet the transaction condition is effectively avoided.
Corresponding to the transaction processing methods described in fig. 4 to 9, one or more embodiments of the present disclosure further provide a transaction processing device based on the same technical concept. Fig. 10 is a schematic block diagram of a transaction processing device according to one or more embodiments of the present disclosure, where the device is configured to perform the transaction processing methods described in fig. 4 to 9, and as shown in fig. 10, the device includes:
A receiving module 301, which receives a reverse transaction request sent by a terminal device of a first user; wherein the reverse transaction request includes transaction information including a forward transaction identification of a forward transaction associated with the reverse exchange; the forward transaction is a transaction of transferring resources from the first user to the second user when all transaction elements of the transaction are successfully locked; the reverse transaction is a transaction in which part or all of the resources transferred from the first user to the second user are returned to the first user;
a query module 302 that queries the blockchain for transaction record information associated with the forward transaction identification;
and the processing module 303 is used for performing reverse transaction processing according to the transaction information if the transaction information is determined to meet the transaction condition according to the transaction record information.
According to the transaction processing device provided by one or more embodiments of the specification, the transaction record information is stored in the blockchain, so that the data security of the transaction record information is ensured based on the characteristics of non-tampering, disclosure and searchability of the blockchain, and further, an effective data basis is provided for the related processing of reverse transaction, and the effective processing of the reverse transaction is ensured; furthermore, the forward transaction associated with the reverse transaction is to transfer resources when all transaction elements of the transaction are locked successfully, but not directly, so that transaction failure caused by that a certain transaction element does not meet the transaction condition is effectively avoided.
Optionally, the transaction module 303 determines that the transaction information meets a transaction condition if it is determined that the transaction record information includes first record information and resource transfer information in the transaction record information matches resource transfer information in the transaction information; wherein the first record information characterizes the forward transaction as being in a successful transaction state.
Optionally, the transaction record information includes: the first record information;
The transaction module 303 determines, according to the resource transfer information in the transaction information, the resource transfer account information and the first quantity of the resources to be returned; and
Verifying whether the determined resource transfer-in account information is the same as the resource transfer-out account information included in the first record information;
verifying whether the determined resource transfer-out account information is the same as the resource transfer-in account information included in the first record information;
Verifying whether the determined first quantity is not greater than a second quantity of transferred resources included in the first transaction record information;
And if the verification results are all yes, determining that the resource transfer information in the transaction record information is matched with the resource transfer information in the transaction information.
Optionally, the transaction record information includes: the first record information and the second record information of the reverse transaction processed based on the forward transaction;
The transaction module 303 determines, according to the resource transfer information in the transaction information, the resource transfer account information and the first quantity of the resources to be returned; and
Verifying whether the determined resource transfer-in account information is the same as the resource transfer-out account information included in the first record information;
verifying whether the determined resource transfer-out account information is the same as the resource transfer-in account information included in the first record information;
Verifying whether a third amount is not greater than a second amount of transferred resources included in the first record information; wherein the third number is the total number of returned resources included in the resources to be returned and the second record information;
And if the verification results are all yes, determining that the resource transfer information in the transaction record information is matched with the resource transfer information in the transaction information.
Optionally, the transaction information further includes: a reverse transaction identifier of the reverse transaction; the apparatus further comprises: a generating module;
The generation module generates second record information of the reverse transaction according to the reverse transaction identifier and the transaction information; and
And saving the second record information into the blockchain.
Optionally, the reverse transaction request includes: ciphertext data of the transaction information, wherein the ciphertext data is obtained by encrypting the transaction information by adopting a private key of the first user;
the obtaining module 302 obtains a public key corresponding to the private key; and
Decrypting the ciphertext data by adopting the obtained public key to obtain the transaction information;
Acquiring the forward transaction identifier from the obtained transaction information;
and inquiring associated transaction record information from the blockchain according to the obtained forward transaction identification.
Optionally, the apparatus further comprises: a transmitting module;
And the sending module is used for sending request failure information to the terminal equipment if the transaction information is determined to not meet the transaction condition according to the transaction record information.
According to the transaction processing device provided by one or more embodiments of the specification, the transaction record information is stored in the blockchain, so that the data security of the transaction record information is ensured based on the characteristics of non-tampering, disclosure and searchability of the blockchain, and further, an effective data basis is provided for the related processing of reverse transaction, and the effective processing of the reverse transaction is ensured; furthermore, the forward transaction associated with the reverse transaction is to transfer resources when all transaction elements of the transaction are locked successfully, but not directly, so that transaction failure caused by that a certain transaction element does not meet the transaction condition is effectively avoided.
It should be noted that, in the present specification, the embodiment about the transaction processing device and the embodiment about the transaction processing method in the present specification are based on the same inventive concept, so the specific implementation of this embodiment may refer to the implementation of the corresponding transaction processing method, and the repetition is omitted.
Further, according to the transaction processing method described in fig. 4 to 9, based on the same technical concept, one or more embodiments of the present disclosure further provide a transaction processing device, which is configured to perform the transaction processing method described above, and fig. 11 is a schematic structural diagram of a transaction processing device provided in one or more embodiments of the present disclosure.
As shown in fig. 11, the transaction processing device may have a relatively large difference due to different configurations or performances, and may include one or more processors 401 and a memory 402, where the memory 402 may store one or more storage applications or data. Wherein the memory 402 may be transient storage or persistent storage. The application program stored in the memory 402 may include one or more modules (not shown), each of which may include a series of computer executable instructions in the transaction processing device. Still further, the processor 401 may be arranged to communicate with the memory 402 and execute a series of computer executable instructions in the memory 402 on the transaction processing device. The transaction processing device may also include one or more power supplies 403, one or more wired or wireless network interfaces 404, one or more input/output interfaces 405, one or more keyboards 406, and the like.
In a particular embodiment, the transaction processing includes a memory, and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for the transaction processing device, and configured to be executed by the one or more processors, the one or more programs comprising computer-executable instructions for:
Receiving a reverse transaction request sent by terminal equipment of a first user; wherein the reverse transaction request includes transaction information including a forward transaction identification of a forward transaction associated with the reverse exchange; the forward transaction is a transaction of transferring resources from the first user to the second user when all transaction elements of the transaction are successfully locked; the reverse transaction is a transaction in which all or part of the resources transferred by the first user to the second user are returned to the first user;
querying transaction record information associated with the forward transaction identification from a blockchain;
And if the transaction information meets the transaction condition according to the transaction record information, performing reverse transaction processing according to the transaction information.
According to the transaction processing equipment provided by one or more embodiments of the specification, the transaction record information is stored in the blockchain, so that the data security of the transaction record information is ensured based on the characteristics of non-tampering, disclosure and searchability of the blockchain, and further, an effective data basis is provided for the related processing of reverse transaction, and the effective processing of the reverse transaction is ensured; furthermore, the forward transaction associated with the reverse transaction is to transfer resources when all transaction elements of the transaction are locked successfully, but not directly, so that transaction failure caused by that a certain transaction element does not meet the transaction condition is effectively avoided.
Optionally, the computer executable instructions, when executed, determine from the transaction record information that the transaction information satisfies a transaction condition, comprising:
if the transaction record information comprises first record information and the resource transfer information in the transaction record information is matched with the resource transfer information in the transaction information, determining that the transaction information meets a transaction condition; wherein the first record information characterizes the forward transaction as being in a successful transaction state.
Optionally, the transaction record information includes, when executed: the first record information;
determining that the resource transfer information in the transaction record information matches the resource transfer information in the transaction information includes:
Determining resource transfer-in account information, resource transfer-out account information and first quantity of resources to be returned according to the resource transfer information in the transaction information;
verifying whether the determined resource transfer-in account information is the same as the resource transfer-out account information included in the first record information; and
Verifying whether the determined resource transfer-out account information is the same as the resource transfer-in account information included in the first record information;
Verifying whether the determined first quantity is not greater than a second quantity of transferred resources included in the first transaction record information;
And if the verification results are all yes, determining that the resource transfer information in the transaction record information is matched with the resource transfer information in the transaction information.
Optionally, the transaction record information includes, when executed: the first record information and the second record information of the reverse transaction processed based on the forward transaction;
determining that the resource transfer information in the transaction record information matches the resource transfer information in the transaction information includes:
Determining resource transfer-in account information, resource transfer-out account information and first quantity of resources to be returned according to the resource transfer information in the transaction information;
verifying whether the determined resource transfer-in account information is the same as the resource transfer-out account information included in the first record information; and
Verifying whether the determined resource transfer-out account information is the same as the resource transfer-in account information included in the first record information;
Verifying whether a third amount is not greater than a second amount of transferred resources included in the first record information; wherein the third number is the total number of returned resources included in the resources to be returned and the second record information;
And if the verification results are all yes, determining that the resource transfer information in the transaction record information is matched with the resource transfer information in the transaction information.
Optionally, the transaction information further comprises, when executed: a reverse transaction identifier of the reverse transaction;
after the reverse transaction processing is performed according to the transaction information, the method further comprises the following steps:
Generating second record information of the reverse transaction according to the reverse transaction identifier and the transaction information;
and saving the second record information into the blockchain.
Optionally, the computer executable instructions, when executed, cause the reverse transaction request to include: ciphertext data of the transaction information, wherein the ciphertext data is obtained by encrypting the transaction information by adopting a private key of the first user;
the querying transaction record information associated with the forward transaction identification from a blockchain comprises:
Obtaining a public key corresponding to the private key;
decrypting the ciphertext data by adopting the obtained public key to obtain the transaction information;
Acquiring the forward transaction identifier from the obtained transaction information;
and inquiring associated transaction record information from the blockchain according to the obtained forward transaction identification.
Optionally, the computer executable instructions, when executed, further comprise:
And if the transaction information does not meet the transaction condition according to the transaction record information, sending request failure information to the terminal equipment.
According to the transaction processing equipment provided by one or more embodiments of the specification, the transaction record information is stored in the blockchain, so that the data security of the transaction record information is ensured based on the characteristics of non-tampering, disclosure and searchability of the blockchain, and further, an effective data basis is provided for the related processing of reverse transaction, and the effective processing of the reverse transaction is ensured; furthermore, the forward transaction associated with the reverse transaction is to transfer resources when all transaction elements of the transaction are locked successfully, but not directly, so that transaction failure caused by that a certain transaction element does not meet the transaction condition is effectively avoided.
It should be noted that, the embodiments of the transaction processing device in the present specification and the embodiments of the transaction processing method in the present specification are based on the same inventive concept, so the specific implementation of the embodiments may refer to the implementation of the corresponding transaction processing method, and the repetition is omitted.
Further, according to the method shown in fig. 4 to 9, based on the same technical concept, one or more embodiments of the present disclosure further provide a storage medium for storing computer executable instructions, where in a specific embodiment, the storage medium may be a U-disc, an optical disc, a hard disk, etc., and the computer executable instructions stored in the storage medium can implement the following flow when executed by a processor:
Receiving a reverse transaction request sent by terminal equipment of a first user; wherein the reverse transaction request includes transaction information including a forward transaction identification of a forward transaction associated with the reverse exchange; the forward transaction is a transaction of transferring resources from the first user to the second user when all transaction elements of the transaction are successfully locked; the reverse transaction is a transaction in which all or part of the resources transferred by the first user to the second user are returned to the first user;
querying transaction record information associated with the forward transaction identification from a blockchain;
And if the transaction information meets the transaction condition according to the transaction record information, performing reverse transaction processing according to the transaction information.
When the computer executable instructions stored in the storage medium provided by one or more embodiments of the present disclosure are executed by the processor, by storing the transaction record information in the blockchain, based on the characteristics of the blockchain, such as non-tamper and disclosure, the data security of the transaction record information is ensured, and further, an effective data basis is provided for the related processing of the reverse transaction, and the effective processing of the reverse transaction is ensured; furthermore, the forward transaction associated with the reverse transaction is to transfer resources when all transaction elements of the transaction are locked successfully, but not directly, so that transaction failure caused by that a certain transaction element does not meet the transaction condition is effectively avoided.
Optionally, the computer executable instructions stored on the storage medium, when executed by the processor, determine that the transaction information satisfies a transaction condition according to the transaction record information, including:
if the transaction record information comprises first record information and the resource transfer information in the transaction record information is matched with the resource transfer information in the transaction information, determining that the transaction information meets a transaction condition; wherein the first record information characterizes the forward transaction as being in a successful transaction state.
Optionally, the storage medium stores computer executable instructions that, when executed by the processor, the transaction record information includes: the first record information;
determining that the resource transfer information in the transaction record information matches the resource transfer information in the transaction information includes:
Determining resource transfer-in account information, resource transfer-out account information and first quantity of resources to be returned according to the resource transfer information in the transaction information;
verifying whether the determined resource transfer-in account information is the same as the resource transfer-out account information included in the first record information; and
Verifying whether the determined resource transfer-out account information is the same as the resource transfer-in account information included in the first record information;
Verifying whether the determined first quantity is not greater than a second quantity of transferred resources included in the first transaction record information;
And if the verification results are all yes, determining that the resource transfer information in the transaction record information is matched with the resource transfer information in the transaction information.
Optionally, the storage medium stores computer executable instructions that, when executed by the processor, the transaction record information includes: the first record information and the second record information of the reverse transaction processed based on the forward transaction;
determining that the resource transfer information in the transaction record information matches the resource transfer information in the transaction information includes:
Determining resource transfer-in account information, resource transfer-out account information and first quantity of resources to be returned according to the resource transfer information in the transaction information;
verifying whether the determined resource transfer-in account information is the same as the resource transfer-out account information included in the first record information; and
Verifying whether the determined resource transfer-out account information is the same as the resource transfer-in account information included in the first record information;
Verifying whether a third amount is not greater than a second amount of transferred resources included in the first record information; wherein the third number is the total number of returned resources included in the resources to be returned and the second record information;
And if the verification results are all yes, determining that the resource transfer information in the transaction record information is matched with the resource transfer information in the transaction information.
Optionally, the storage medium stores computer executable instructions that when executed by the processor, the transaction information further includes: a reverse transaction identifier of the reverse transaction;
after the reverse transaction processing is performed according to the transaction information, the method further comprises the following steps:
Generating second record information of the reverse transaction according to the reverse transaction identifier and the transaction information;
and saving the second record information into the blockchain.
Optionally, the storage medium stores computer executable instructions that, when executed by the processor, the reverse transaction request comprises: ciphertext data of the transaction information, wherein the ciphertext data is obtained by encrypting the transaction information by adopting a private key of the first user;
the querying transaction record information associated with the forward transaction identification from a blockchain comprises:
Obtaining a public key corresponding to the private key;
decrypting the ciphertext data by adopting the obtained public key to obtain the transaction information;
Acquiring the forward transaction identifier from the obtained transaction information;
and inquiring associated transaction record information from the blockchain according to the obtained forward transaction identification.
Optionally, the storage medium stores computer executable instructions that, when executed by the processor, further comprise:
And if the transaction information does not meet the transaction condition according to the transaction record information, sending request failure information to the terminal equipment.
When the computer executable instructions stored in the storage medium provided by one or more embodiments of the present disclosure are executed by the processor, by storing the transaction record information in the blockchain, based on the characteristics of the blockchain, such as non-falsification, disclosure, and the like, the data security of the transaction record information is ensured, thereby providing an effective data basis for the related processing of the reverse transaction, and ensuring the effective processing of the reverse transaction; furthermore, the forward transaction associated with the reverse transaction is to transfer resources when all transaction elements of the transaction are locked successfully, but not directly, so that transaction failure caused by that a certain transaction element does not meet the transaction condition is effectively avoided.
It should be noted that, the embodiments related to the storage medium in the present specification and the embodiments related to the transaction processing method in the present specification are based on the same inventive concept, so the specific implementation of this embodiment may refer to the implementation of the corresponding transaction processing method, and the repetition is not repeated.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
In the 30 s of the 20 th century, improvements to one technology could clearly be distinguished as improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) or software (improvements to the process flow). However, with the development of technology, many improvements of the current method flows can be regarded as direct improvements of hardware circuit structures. Designers almost always obtain corresponding hardware circuit structures by programming improved method flows into hardware circuits. Therefore, an improvement of a method flow cannot be said to be realized by a hardware entity module. For example, a programmable logic device (Programmable Logic Device, PLD) (e.g., field programmable gate array (Field Programmable GATE ARRAY, FPGA)) is an integrated circuit whose logic functions are determined by user programming of the device. A designer programs to "integrate" a digital system onto a PLD without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, such programming is mostly implemented with "logic compiler (logic compiler)" software, which is similar to the software compiler used in program development and writing, and the original code before being compiled is also written in a specific programming language, which is called hardware description language (Hardware Description Language, HDL), but HDL is not just one, but a plurality of kinds, such as ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language), and VHDL (Very-High-SPEED INTEGRATED Circuit Hardware Description Language) and Verilog are currently most commonly used. It will also be apparent to those skilled in the art that a hardware circuit implementing the logic method flow can be readily obtained by merely slightly programming the method flow into an integrated circuit using several of the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application SPECIFIC INTEGRATED Circuits (ASICs), programmable logic controllers, and embedded microcontrollers, examples of controllers include, but are not limited to, the following microcontrollers: ARC625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller may thus be regarded as a kind of hardware component, and means for performing various functions included therein may also be regarded as structures within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each unit may be implemented in the same piece or pieces of software and/or hardware when implementing the embodiments of the present specification.
One skilled in the relevant art will recognize that one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present description is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the specification. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
One or more embodiments of the present specification may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. One or more embodiments of the specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing description is by way of example only and is not intended to limit the present disclosure. Various modifications and changes may occur to those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. that fall within the spirit and principles of the present document are intended to be included within the scope of the claims of the present document.

Claims (11)

1. A transaction processing method, applied to a transaction processing node in a blockchain, comprising:
Receiving a reverse transaction request sent by terminal equipment of a first user; the reverse transaction request is a transaction request which is sent to the transaction processing node by the terminal equipment and comprises transaction information, wherein the transaction information comprises a forward transaction identifier of a forward transaction associated with the reverse transaction; the forward transaction is a transaction of transferring resources from the first user to the second user when all transaction elements of the transaction are successfully locked by the user corresponding to the transaction elements; the reverse transaction is a transaction in which all or part of the resources transferred by the first user to the second user are returned to the first user;
Inquiring associated transaction record information from a blockchain according to the forward transaction identifier;
if the transaction information meets the transaction condition according to the transaction record information, performing reverse transaction processing according to the transaction information;
wherein the determining that the transaction information satisfies the transaction condition according to the transaction record information includes:
if the transaction record information comprises first record information and the resource transfer information in the transaction record information is matched with the resource transfer information in the transaction information, determining that the transaction information meets a transaction condition; wherein the first record information characterizes that the forward transaction is in a successful transaction state;
The reverse transaction request includes: ciphertext data of the transaction information, wherein the ciphertext data is obtained by encrypting the transaction information by adopting a private key of the first user;
the query of the associated transaction record information from the blockchain according to the forward transaction identification comprises the following steps:
Obtaining a public key corresponding to the private key;
Decrypting the ciphertext data by adopting the obtained public key to obtain the transaction information;
Acquiring the forward transaction identifier from the obtained transaction information;
and inquiring associated transaction record information from the blockchain according to the obtained forward transaction identification.
2. The method of claim 1, the method further comprising:
determining whether the transaction record information includes second record information for a reverse transaction processed based on the forward transaction;
if yes, matching the resource transfer information in the first record information and the second record information with the resource transfer information in the transaction information;
and if not, matching the resource transfer information in the first record information with the resource transfer information in the transaction information.
3. The method of claim 2, matching the resource transfer information in the first record information with the resource transfer information in the transaction information, comprising:
Determining resource transfer-in account information, resource transfer-out account information and first quantity of resources to be returned according to the resource transfer information in the transaction information;
verifying whether the determined resource transfer-in account information is the same as the resource transfer-out account information included in the first record information; and
Verifying whether the determined resource transfer-out account information is the same as the resource transfer-in account information included in the first record information;
verifying whether the determined first amount is not greater than a second amount of transferred resources included in the first record information;
And if the verification results are all yes, determining that the resource transfer information in the transaction record information is matched with the resource transfer information in the transaction information.
4. The method of claim 2, the matching the resource transfer information in the first record information and the second record information with the resource transfer information in the transaction information, comprising:
Determining resource transfer-in account information, resource transfer-out account information and first quantity of resources to be returned according to the resource transfer information in the transaction information;
verifying whether the determined resource transfer-in account information is the same as the resource transfer-out account information included in the first record information; and
Verifying whether the determined resource transfer-out account information is the same as the resource transfer-in account information included in the first record information;
Verifying whether a third amount is not greater than a second amount of transferred resources included in the first record information; wherein the third number is the total number of returned resources included in the resources to be returned and the second record information;
And if the verification results are all yes, determining that the resource transfer information in the transaction record information is matched with the resource transfer information in the transaction information.
5. The method of claim 1, the transaction information further comprising: a reverse transaction identifier of the reverse transaction;
after the corresponding reverse transaction processing is performed based on the transaction information, the method further comprises the following steps:
Generating second record information of the reverse transaction according to the reverse transaction identifier and the transaction information;
and saving the second record information into the blockchain.
6. The method of any one of claims 1-5, further comprising:
And if the transaction information does not meet the transaction condition according to the transaction record information, sending request failure information to the terminal equipment.
7. A transaction processing device for use in a transaction processing node in a blockchain, comprising:
The receiving module is used for receiving a reverse transaction request sent by the terminal equipment of the first user; the reverse transaction request is a transaction request which is sent to the transaction processing node by the midpoint equipment and comprises transaction information, wherein the transaction information comprises a forward transaction identifier of a forward transaction associated with the reverse exchange; the forward transaction is a transaction of transferring resources from the first user to the second user when all transaction elements of the transaction are successfully locked by the user corresponding to the transaction elements; the reverse transaction is a transaction in which all or part of the resources transferred by the first user to the second user are returned to the first user;
The inquiry module inquires the associated transaction record information from the blockchain according to the forward transaction identification;
The processing module is used for carrying out reverse transaction processing according to the transaction information if the transaction information is determined to meet the transaction condition according to the transaction record information;
The processing module determines that the transaction information meets a transaction condition if the transaction record information comprises first record information and the resource transfer information in the transaction record information is matched with the resource transfer information in the transaction information; wherein the first record information characterizes that the forward transaction is in a successful transaction state;
The reverse transaction request includes: ciphertext data of the transaction information, wherein the ciphertext data is obtained by encrypting the transaction information by adopting a private key of the first user;
the query of the associated transaction record information from the blockchain according to the forward transaction identification comprises the following steps:
Obtaining a public key corresponding to the private key;
Decrypting the ciphertext data by adopting the obtained public key to obtain the transaction information;
Acquiring the forward transaction identifier from the obtained transaction information;
and inquiring associated transaction record information from the blockchain according to the obtained forward transaction identification.
8. The device according to claim 7,
The processing module determines whether the transaction record information includes second record information for a reverse transaction processed based on the forward transaction;
if yes, matching the resource transfer information in the first record information and the second record information with the resource transfer information in the transaction information;
and if not, matching the resource transfer information in the first record information with the resource transfer information in the transaction information.
9. The apparatus of claim 7, the transaction information further comprising: a reverse transaction identifier of the reverse transaction; the device comprises: a generating module;
The generation module is used for generating second record information of the reverse transaction according to the reverse transaction identification and the transaction information after the transaction module performs reverse transaction processing according to the transaction information;
and saving the second record information into the blockchain.
10. A transaction processing device for use with a transaction processing node in a blockchain, comprising:
A processor; and
A memory arranged to store computer executable instructions that, when executed, cause the processor to:
Receiving a reverse transaction request sent by terminal equipment of a first user; the reverse transaction request is a transaction request which is sent to the transaction processing node by the terminal equipment and comprises transaction information, wherein the transaction information comprises a forward transaction identifier of a forward transaction associated with the reverse transaction; the forward transaction is a transaction of transferring resources from the first user to the second user when all transaction elements of the transaction are successfully locked by the user corresponding to the transaction elements; the reverse transaction is a transaction in which all or part of the resources transferred by the first user to the second user are returned to the first user;
Inquiring associated transaction record information from a blockchain according to the forward transaction identifier;
if the transaction information meets the transaction condition according to the transaction record information, performing reverse transaction processing according to the transaction information;
wherein the determining that the transaction information satisfies the transaction condition according to the transaction record information includes:
if the transaction record information comprises first record information and the resource transfer information in the transaction record information is matched with the resource transfer information in the transaction information, determining that the transaction information meets a transaction condition; wherein the first record information characterizes that the forward transaction is in a successful transaction state;
The reverse transaction request includes: ciphertext data of the transaction information, wherein the ciphertext data is obtained by encrypting the transaction information by adopting a private key of the first user;
the query of the associated transaction record information from the blockchain according to the forward transaction identification comprises the following steps:
Obtaining a public key corresponding to the private key;
Decrypting the ciphertext data by adopting the obtained public key to obtain the transaction information;
Acquiring the forward transaction identifier from the obtained transaction information;
and inquiring associated transaction record information from the blockchain according to the obtained forward transaction identification.
11. A storage medium for use in a transaction processing node in a blockchain, the storage medium for storing computer-executable instructions that when executed by a processor implement the following:
Receiving a reverse transaction request sent by terminal equipment of a first user; the reverse transaction request is a transaction request which is sent to the transaction processing node by the terminal equipment and comprises transaction information, wherein the transaction information comprises a forward transaction identifier of a forward transaction associated with the reverse transaction; the forward transaction is a transaction of transferring resources from the first user to the second user when all transaction elements of the transaction are successfully locked by the user corresponding to the transaction elements; the reverse transaction is a transaction in which all or part of the resources transferred by the first user to the second user are returned to the first user;
Inquiring associated transaction record information from a blockchain according to the forward transaction identifier;
if the transaction information meets the transaction condition according to the transaction record information, performing reverse transaction processing according to the transaction information;
wherein the determining that the transaction information satisfies the transaction condition according to the transaction record information includes:
if the transaction record information comprises first record information and the resource transfer information in the transaction record information is matched with the resource transfer information in the transaction information, determining that the transaction information meets a transaction condition; wherein the first record information characterizes that the forward transaction is in a successful transaction state;
The reverse transaction request includes: ciphertext data of the transaction information, wherein the ciphertext data is obtained by encrypting the transaction information by adopting a private key of the first user;
the query of the associated transaction record information from the blockchain according to the forward transaction identification comprises the following steps:
Obtaining a public key corresponding to the private key;
Decrypting the ciphertext data by adopting the obtained public key to obtain the transaction information;
Acquiring the forward transaction identifier from the obtained transaction information;
and inquiring associated transaction record information from the blockchain according to the obtained forward transaction identification.
CN202110929666.5A 2020-03-03 2020-03-03 Transaction processing method, device and equipment Active CN113643030B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110929666.5A CN113643030B (en) 2020-03-03 2020-03-03 Transaction processing method, device and equipment

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110929666.5A CN113643030B (en) 2020-03-03 2020-03-03 Transaction processing method, device and equipment
CN202010140399.9A CN110992039B (en) 2020-03-03 2020-03-03 Transaction processing method, device and equipment

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN202010140399.9A Division CN110992039B (en) 2020-03-03 2020-03-03 Transaction processing method, device and equipment

Publications (2)

Publication Number Publication Date
CN113643030A CN113643030A (en) 2021-11-12
CN113643030B true CN113643030B (en) 2024-05-28

Family

ID=70081326

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202010140399.9A Active CN110992039B (en) 2020-03-03 2020-03-03 Transaction processing method, device and equipment
CN202110929666.5A Active CN113643030B (en) 2020-03-03 2020-03-03 Transaction processing method, device and equipment

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202010140399.9A Active CN110992039B (en) 2020-03-03 2020-03-03 Transaction processing method, device and equipment

Country Status (1)

Country Link
CN (2) CN110992039B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111340631B (en) * 2020-05-15 2020-12-01 支付宝(杭州)信息技术有限公司 Asset transfer method, device, equipment and system
CN112200552B (en) * 2020-06-24 2022-08-16 支付宝(杭州)信息技术有限公司 Resource transfer method, device and equipment based on block chain

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017095833A1 (en) * 2015-11-30 2017-06-08 Erik Voorhees Systems and methods for improving security in blockchain-asset exchange
KR101841568B1 (en) * 2017-04-27 2018-05-04 주식회사 코인플러그 Method for issuing, using, refunding, settling and revocating electric voucher using updated status of balance database by respective blocks in blockchain, and server using the same
CN108320228A (en) * 2018-03-07 2018-07-24 物数(上海)信息科技有限公司 Transregional piece of chain transaction in assets method, platform, equipment and storage medium
CN110163634A (en) * 2019-04-29 2019-08-23 阿里巴巴集团控股有限公司 Withdrawing method and device, electronic equipment based on block chain
CN110472438A (en) * 2019-07-31 2019-11-19 阿里巴巴集团控股有限公司 Transaction data processing based on block chain, Transaction Inquiries method, device and equipment
CN110503435A (en) * 2019-07-31 2019-11-26 阿里巴巴集团控股有限公司 Transaction method for early warning, device and equipment based on block chain
CN110837491A (en) * 2019-11-25 2020-02-25 广州知弘科技有限公司 Block chain financial big data processing system and method

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106469377A (en) * 2015-08-21 2017-03-01 阿里巴巴集团控股有限公司 Return of goods information processing method and device
US11531974B2 (en) * 2016-08-17 2022-12-20 International Business Machines Corporation Tracking transactions through a blockchain
GB201706071D0 (en) * 2017-04-18 2017-05-31 Nchain Holdings Ltd Computer-implemented system and method
CN107038578B (en) * 2017-04-19 2020-10-16 浙江数秦科技有限公司 Multi-signature transaction information processing method in data transaction platform based on block chain
US11238460B2 (en) * 2017-04-28 2022-02-01 Mastercard International Incorporated Method and system for implementing chargebacks on a distributed ledger system
CN109409856A (en) * 2017-08-18 2019-03-01 阿里巴巴集团控股有限公司 Reimbursement information processing method and device
CN109544157A (en) * 2018-10-25 2019-03-29 腾讯科技(深圳)有限公司 Transaction processing method, device and system
CN109872137A (en) * 2019-01-30 2019-06-11 北京沃东天骏信息技术有限公司 A kind of electronic trade method, node and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017095833A1 (en) * 2015-11-30 2017-06-08 Erik Voorhees Systems and methods for improving security in blockchain-asset exchange
KR101841568B1 (en) * 2017-04-27 2018-05-04 주식회사 코인플러그 Method for issuing, using, refunding, settling and revocating electric voucher using updated status of balance database by respective blocks in blockchain, and server using the same
CN108320228A (en) * 2018-03-07 2018-07-24 物数(上海)信息科技有限公司 Transregional piece of chain transaction in assets method, platform, equipment and storage medium
CN110163634A (en) * 2019-04-29 2019-08-23 阿里巴巴集团控股有限公司 Withdrawing method and device, electronic equipment based on block chain
CN110472438A (en) * 2019-07-31 2019-11-19 阿里巴巴集团控股有限公司 Transaction data processing based on block chain, Transaction Inquiries method, device and equipment
CN110503435A (en) * 2019-07-31 2019-11-26 阿里巴巴集团控股有限公司 Transaction method for early warning, device and equipment based on block chain
CN110837491A (en) * 2019-11-25 2020-02-25 广州知弘科技有限公司 Block chain financial big data processing system and method

Also Published As

Publication number Publication date
CN110992039A (en) 2020-04-10
CN113643030A (en) 2021-11-12
CN110992039B (en) 2021-06-29

Similar Documents

Publication Publication Date Title
CN111340631B (en) Asset transfer method, device, equipment and system
CN110992038B (en) Transaction processing method, device and equipment
CN110020542B (en) Data reading and writing method and device and electronic equipment
CN110472438B (en) Transaction data processing and transaction inquiring method, device and equipment based on blockchain
CN111782668B (en) Data structure reading and updating method and device and electronic equipment
CN112241506B (en) User behavior backtracking method, device, equipment and system
CN110503435B (en) Transaction early warning method, device and equipment based on blockchain
CN111401871B (en) Transaction processing method, device, equipment and system
CN111859470B (en) Business data chaining method and device
CN110992188B (en) Transaction processing method, device and equipment
CN108074024B (en) Trusted data transmission method, device and system
CN111382980A (en) Logistics management method, device, equipment and system based on block chain
CN110992040A (en) Transaction processing method, device and equipment
CN111461623B (en) Block chain-based warehouse bill creating method, device and equipment
CN113643030B (en) Transaction processing method, device and equipment
CN113222667B (en) Equity sharing processing method and device
CN111768303A (en) Transaction processing method, device, equipment and system
CN111310137B (en) Block chain associated data evidence storing method and device and electronic equipment
CN110992164B (en) Transaction processing method, device, system and equipment based on block chain
CN113672784A (en) Vehicle information processing method, device and system based on block chain
CN114528353A (en) Method and apparatus for providing blockchain service
CN117974141A (en) Block chain wallet protection method and device, storage medium and electronic equipment
CN117950631A (en) Service data processing method, device and system
CN118279008A (en) Order processing method and device
CN115114334A (en) Method and device for querying data in block chain

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
GR01 Patent grant
GR01 Patent grant