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

Transaction processing method, device and equipment Download PDF

Info

Publication number
CN112016921B
CN112016921B CN202010851539.3A CN202010851539A CN112016921B CN 112016921 B CN112016921 B CN 112016921B CN 202010851539 A CN202010851539 A CN 202010851539A CN 112016921 B CN112016921 B CN 112016921B
Authority
CN
China
Prior art keywords
transaction
information
user
processing
record information
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
CN202010851539.3A
Other languages
Chinese (zh)
Other versions
CN112016921A (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 CN202010851539.3A priority Critical patent/CN112016921B/en
Publication of CN112016921A publication Critical patent/CN112016921A/en
Application granted granted Critical
Publication of CN112016921B publication Critical patent/CN112016921B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Accounting & Taxation (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (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 transaction request sent by terminal equipment of a first user; the transaction request comprises transaction information of a transaction between a first user and a second user, and the related record information of the transaction is stored in the block chain; determining transaction elements associated with the transaction according to the transaction information; locking the determined transaction elements; and if the locking processing fails, performing transaction rollback processing and sending transaction failure information to the terminal equipment of the first user.

Description

Transaction processing method, device and equipment
This patent application is application number: 202010140398.4, filing date: 3/2020, the invention relates to a divisional application of the Chinese patent application entitled "transaction processing method, apparatus and device".
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a transaction processing method, apparatus, and device.
Background
With the continuous development of internet technology, online shopping has been widely entered into people's lives with the characteristics of convenience, time saving, labor saving and the like. In order to promote the enthusiasm of online shopping of users, some merchants also put forward shopping strategies such as red envelope, points and the like, so that one successful online shopping, namely one successful transaction, involves data management operations of multiple levels such as inventory updating, red envelope management, point increase and decrease and the like. However, in the current transaction process, a user usually makes a purchase order and pays after selecting a good commodity to be purchased, so that a transaction failure phenomenon occurs due to failure of data management operation of one or more layers.
Disclosure of Invention
One or more embodiments of the present specification provide a transaction processing method. The method includes receiving a transaction request sent by a terminal device of a first user. Wherein the transaction request includes transaction information for a transaction between the first user and a second user. The transaction information includes a first amount of resources to be transferred. And the related record information of the transaction is stored in the block chain. And locking the transaction elements related to the transaction according to the transaction information. And if the locking processing fails, performing transaction rollback processing and sending transaction failure information to the terminal equipment. Wherein, after receiving the transaction request sent by the terminal device of the first user, the method further comprises transferring the first amount of resources from the resource account of the first user to the designated hosting account. The processing for transaction rollback includes transferring the first amount of resources from the escrow account to the resource account of the first user.
One or more embodiments of the present specification provide a transaction processing device. The apparatus includes a receiving module that receives a transaction request sent by a terminal device of a first user. The transaction request comprises transaction information of transaction between the first user and the second user. The transaction information includes a first amount of resources to be transferred. And the related record information of the transaction is stored in the block chain. The apparatus also includes a locking module that locks transaction elements associated with the transaction. The device also comprises a processing module, and if the locking processing fails, the device performs transaction rollback processing and sends transaction failure information to the terminal equipment. If the device further comprises a first transfer module, the first transfer module transfers the first amount of resources from the resource account of the first user to the designated hosting account after the receiving module receives the transaction request sent by the terminal device of the first user. The processing module transfers the first amount of resources from the escrow account to the resource account of the first user.
One or more embodiments of the present specification provide a transaction processing device. The apparatus includes a processor. The apparatus also comprises a memory arranged to store computer executable instructions. The computer executable instructions, when executed, cause the processor to receive a transaction request sent by a terminal device of a first user. Wherein the transaction request includes transaction information for a transaction between the first user and a second user. The transaction information includes a first amount of resources to be transferred. And the related record information of the transaction is stored in the block chain. And locking the transaction elements related to the transaction according to the transaction information. And if the locking processing fails, performing transaction rollback processing and sending transaction failure information to the terminal equipment. And if the transaction request sent by the terminal equipment of the first user is received, transferring the first quantity of resources from the resource account of the first user to the appointed hosting account. The conducting a transaction rollback process includes transferring the first amount of resources from the escrow account to the resource account of the first user.
One or more embodiments of the present specification provide a storage medium. The storage medium is used to store computer-executable instructions. The computer-executable instructions, when executed by the processor, receive a transaction request sent by a terminal device of a first user. Wherein the transaction request includes transaction information for a transaction between the first user and a second user. The transaction information includes a first amount of resources to be transferred. And the related record information of the transaction is stored in the block chain. And locking the transaction elements related to the transaction according to the transaction information. And if the locking processing fails, performing transaction rollback processing and sending transaction failure information to the terminal equipment. And if the transaction request sent by the terminal equipment of the first user is received, transferring the first quantity of resources from the resource account of the first user to the appointed hosting account. The conducting a transaction rollback process includes transferring the first amount of resources from the escrow account to the resource account of the first user.
Drawings
In order to more clearly illustrate one or more embodiments or prior art solutions of the present specification, the drawings that are needed in the description of the embodiments or prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present specification, and that other drawings can be obtained by those skilled in the art without inventive exercise.
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 illustrating a third scenario of a transaction processing method according to one or more embodiments of the present disclosure;
fig. 4 is a first flowchart of a transaction processing method according to one or more embodiments of the present disclosure;
fig. 5 is a second flowchart of a transaction processing method according to one or more embodiments of the present disclosure;
FIG. 6 is a third flowchart of a transaction processing method according to one or more embodiments of the disclosure;
fig. 7 is a fourth flowchart illustrating a transaction processing method according to one or more embodiments of the disclosure;
fig. 8 is a fifth flowchart of a transaction processing method according to one or more embodiments of the present disclosure;
fig. 9 is a sixth flowchart of a transaction processing method according to one or more embodiments of the present disclosure;
fig. 10 is a schematic block diagram 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 make those skilled in the art better understand the technical solutions in one or more embodiments of the present disclosure, the technical solutions in one or more embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in one or more embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from one or more of the embodiments described herein without making any inventive step, shall fall within the scope of protection of this document.
Fig. 1 is a schematic view of an application scenario of a transaction processing method according to one or more embodiments of the present specification, as shown in fig. 1, the scenario includes: a terminal device, a transaction processing node and a blockchain of a first user; 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 equipment of the first user is in communication connection with the transaction processing node through a wireless network.
Specifically, the terminal device of the first user sends a transaction request to the transaction processing node in response to the transaction operation of the first user; the transaction request comprises transaction information of a transaction between a first user and a second user; the transaction processing node determines transaction elements associated with the transaction according to the transaction information; the transaction processing node locks the determined transaction element, performs transaction rollback processing when the locking processing fails, and sends transaction failure information to the terminal equipment of the first user; wherein, the relevant record information of the transaction is stored in the block chain. Therefore, when the transaction processing node receives a transaction request, the transaction elements related to the transaction are firstly locked rather than directly processed, and transaction failure caused by the fact that a certain transaction element does not meet transaction conditions can be effectively avoided; when the locking processing fails, transaction rollback processing is carried out, and the locked transaction elements can be released timely without influencing the transaction elements to participate in other transactions; moreover, the related record information of the transaction is stored in the block chain, so that the traceability of the transaction is ensured, and an effective data basis is provided for the related processing of the transaction.
Further, in one or more embodiments of the present specification, the transaction processing node may be a first blockchain node in a blockchain, and a schematic application scenario diagram of the transaction processing method is shown in fig. 2.
Further, in one or more embodiments of the present specification, the transaction processing node may also 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).
Based on the application scenario architecture, one or more embodiments of the present specification provide a transaction processing method; fig. 4 is a flow diagram of a transaction processing method provided in one or more embodiments of the present disclosure, where the method in fig. 4 can be executed by the transaction processing node in fig. 1, as shown in fig. 4, and the method includes the following steps:
step S102, receiving a transaction request sent by a terminal device of a first user; the transaction request comprises transaction information of transaction between the first user and the second user, and the related record information of the transaction is stored in the block chain;
the transaction information comprises information such as transaction identification, transaction content and the like, wherein the transaction content comprises commodity information of transaction commodities, commodity quantity, first quantity of resources to be transferred, use information of additional resources and the like; the resource to be transferred can be an entity resource (such as currency) or a virtual resource (such as credit); additional resources such as coupons, red packs, etc.
Step S104, determining transaction elements related to the transaction according to the transaction information;
wherein the transaction elements differ from transaction to transaction; for example, the transaction information includes a milk 1 box of brand X, a first user transfers a first amount of resources to be transferred to a second user, and the like, and the transaction element associated with the transaction is determined to be milk according to the transaction information; as another example, the transaction information includes a milk 1 box of brand X, the first user transfers a first amount of resources to be transferred to the second user, and an additional resource identified as Y, and the transaction element that determines the transaction association from the transaction information includes the milk and the additional resource.
Step S106, locking the determined transaction elements;
and step S108, if the locking processing fails, performing transaction rollback processing and sending transaction failure information to the terminal equipment of the first user.
In one or more embodiments of the present description, when a transaction request is received, a transaction element associated with a transaction is first locked, rather than directly processed, so that a transaction failure caused by a certain transaction element not meeting a transaction condition can be effectively avoided; when the locking processing fails, transaction rollback processing is carried out, and the locked transaction elements can be released in time without influencing the transaction elements to participate in other transactions; moreover, the related record information of the transaction is stored in the block chain, so that the traceability of the transaction is ensured, and an effective data basis is provided for the related processing of the transaction.
Generally, different transaction elements are maintained and managed by different users, such as a merchant for maintaining and managing inventory data of commodities, a publishing user of virtual resources for maintaining and managing the quantity, the valid period and the like of the virtual resources; based on this, as shown in fig. 5, in one or more embodiments of the present specification, step S106 includes:
step S106-2, a transaction element locking request is sent to terminal equipment of a related user corresponding to the transaction element, so that the terminal equipment of the related user returns response data based on the determined first state information of the transaction element, and the transaction element is locked when the first state information represents that the transaction element is in a tradable state; wherein the related users comprise second users;
specifically, locking information of each transaction element is determined according to transaction information, and a transaction element locking request is sent to corresponding terminal equipment of a related user according to the determined locking information and a transaction identifier included in the transaction information; when terminal equipment of a related user corresponding to the transaction element receives a transaction element locking request, determining the transaction element to be locked according to the locking information, and determining first state information of the transaction element to be locked; and returning response data representing the locking operation success or the locking operation failure according to the determined first state information and the transaction identification, and locking the transaction element when the first state information represents that the transaction element is in a tradable state.
For example, the transaction information includes the first user transferring 70 points to the second user and redeeming a coupon identified as Y for brand X milk 1 box provided by the second user; determining transaction elements related to the transaction according to the transaction information to comprise milk and a coupon, determining that locking information of the milk comprises brand X and 1 box, and determining that locking information of the coupon comprises identification Y; according to the transaction identifier and the determined locking information, a transaction element locking request is respectively sent to the terminal equipment of the second user and the terminal equipment of the coupon management user; the terminal equipment of the second user inquires the inventory quantity of the milk of the brand X and uses the inventory quantity as first state information of the milk of the brand X according to the received transaction element locking request, for example, the inquired inventory quantity is zero, the milk of the brand X is determined to be in a non-tradable state, and response data representing locking operation failure are returned; further, when the terminal device of the coupon management user receives the transaction element locking request, whether the coupon identified as Y is in the valid period and serves as the first state information of the coupon is detected, for example, the coupon is in the valid period, the coupon is determined to be in a tradable state, the coupon is locked so that other transactions cannot use the coupon, the identification Y of the coupon is recorded in association with the transaction identification, and response data representing that the locking operation is successful is returned.
Step S106-4, determining whether transaction conditions of the transaction are met or not according to the received response data, and if yes, determining that the locking processing is successful; if not, determining that the locking processing fails.
Specifically, when each response data represents that the corresponding transaction element locking operation is successful, it is determined that the locking processing is successful, and when at least one response data represents that the corresponding transaction element locking operation is failed, it is determined that the locking processing is failed.
Still by way of example, when the transaction processing node receives response data returned by the terminal device of the second user and response data returned by the terminal device of the coupon management user, the response data is analyzed to obtain response data returned by the terminal device of the second user, which represents that the locking operation fails, and then it is determined that the locking processing fails, and transaction rollback processing is performed and transaction failure information is sent to the terminal device of the first user.
Further, in one or more embodiments of the present description, as shown in fig. 6, if it is determined that the locking process is successful, the following steps are performed:
step S110, transaction processing is carried out according to the transaction information;
step S112, generating transaction success record information according to the transaction information;
and step S114, storing the transaction success record information into the block chain, and sending the transaction success information to the terminal equipment of the first user.
When the transaction is successful, the transaction may be referred to as a forward transaction. By storing the transaction success record information into the block chain, the traceability of the transaction is ensured, and an effective data basis is provided for reverse transaction processing; the reverse transaction is the reverse process of the forward transaction, and if the forward transaction is commodity purchase, the reverse transaction is return commodity, namely return commodity.
In order to avoid excessive operations to the second user in the rollback processing process, in one or more embodiments of the present specification, a first manner is adopted to process a resource to be transferred, that is, a managed account is set in advance, and after a transaction processing node receives a transaction request sent by a terminal device of a first user, the resource is transferred from the resource account of the first user to the managed account, so as to lock the resource. For convenience of description, in the following embodiments, a transaction processing node is taken as a transaction platform, and a block chain node is further included in a transaction processing scene for example; specifically, as shown in fig. 7, after step S102, the method may further include:
step S103-2, transferring a first amount of resources from the resource account of the first user to the designated hosting account;
specifically, when the resource to be transferred is controlled by the trading platform (for example, the resource to be transferred is a credit issued by the trading platform), the trading platform transfers the resource of the first quantity from the resource account of the first user to the designated hosting account according to the account information of the resource account of the first user included in the trading information, so as to lock the resource of the first quantity. When the resource to be transferred is managed and controlled by a designated organization (for example, the resource to be transferred is entity money managed and controlled by a financial organization), the transaction platform sends a resource transfer request to the terminal device of the user of the designated organization according to the transaction information, so that the terminal device of the user of the designated organization transfers the resource of a first quantity from the resource account of the first user to the designated hosting account according to the transaction information and returns a transfer result, so as to lock the resource of the first quantity. It should be noted that, when the resource to be transferred is managed by the designated organization, step S103-2 may be executed simultaneously with step S106-2.
Step S103-4, first resource transfer record information is generated according to the transaction information, and the first resource transfer record is stored in a block chain; wherein the first resource transfer record information comprises a transaction identifier;
specifically, when the transaction platform determines that the transfer of the resource to be transferred is successful, taking a resource account of a first user as a resource transfer-out account, taking a hosting account as a resource transfer-in account, correlating and recording information such as account information of the resource transfer-out account, account information of the resource transfer-in account, first resource transfer time and the like, and determining the recorded information as a first resource transfer record; and sending the first resource transfer record to the block chain node so that the block chain node stores the first resource transfer record information into the block chain.
Corresponding to step S103-2 and step S103-4, as shown in fig. 7, step S108 includes:
step S108-2, if the first resource transfer record information is inquired from the block chain according to the transaction identifier and the transaction success record information is not inquired, transferring a first amount of resources from the escrow account to the resource account of the first user;
specifically, the transaction platform sends a query request to the block chain link points according to the transaction identifier, so that the block chain link points query corresponding record information from the block chain according to the transaction identifier included in the query request, and return the queried record information to the transaction platform; and the transaction platform receives the record information returned by the blockchain node, if the received record information does not comprise the transaction success record information and the last record information is the first resource transfer record information according to the sequence of the time of storing the record information into the blockchain, the transaction rollback processing condition is determined to be met, and a first amount of resources are transferred from the escrow account to the resource account of the first user so as to release the locked first amount of resources of the first user. Or the transaction platform sends a query request to the block chain nodes according to the transaction identifier so that the block chain nodes query corresponding record information from the block chain according to the transaction identifier included in the query request, and if the block chain nodes determine that the queried record information does not include transaction success record information and the last record information is first resource transfer record information according to the sequence of the time of storing the record information into the block chain, the transaction platform sends a query result representing that the transaction rollback processing condition is met to the transaction platform; after receiving the query result sent by the blockchain node, the transaction platform transfers a first amount of resources from the escrow account to the resource account of the first user.
Further, when the resource to be transferred is controlled by the trading platform, the trading platform transfers the resource of the first quantity from the escrow account to the resource account of the first user according to the account information of the resource account of the first user, which is included in the trading information, so as to release the resource of the first quantity. When the resources to be transferred are managed and controlled by the appointed organization, the transaction platform sends a resource release request to the terminal equipment of the user of the appointed organization according to the transaction information, so that the terminal equipment of the user of the appointed organization transfers the resources with the first quantity from the hosting account to the resource account of the first user according to the resource release request, and the resources with the first quantity are released.
Step S108-4, generating second resource transfer record information according to the transaction information, and storing the second resource transfer record information into the block chain;
specifically, the transaction platform determines the escrow account as a resource transfer-out account, determines the resource account of the first user as a resource transfer-in account, performs relevant recording on information such as a transaction identifier, account information of the resource transfer-out account, account information of the resource transfer-in account, second resource transfer time and the like, determines the recorded information as second resource transfer record information, and transmits the second resource transfer record information to the block link point, so that the block link point stores the second resource transfer record information into the block chain, and the rollback processing is traced based on the record information in the block chain in the follow-up process.
And step S108-6, sending transaction failure information to the terminal equipment of the first user.
Further, step S108 may further include: and sending a resource release request to the terminal equipment of the relevant user corresponding to the response data representing the successful resource locking according to the transaction identifier, so that the terminal equipment of the relevant user determines the associated locked transaction element according to the transaction identifier included in the resource release request and releases the locked transaction element.
Therefore, after the transaction platform receives a transaction request sent by the terminal device of the first user, the resources to be transferred are transferred from the resource account of the first user to the hosting account, so that when transaction rollback processing is carried out, only corresponding resources are transferred from the hosting account to the resource account of the first user without participation of a second user, thereby not only reducing operation of the second user and improving experience of the second user, but also improving transaction rollback processing efficiency.
Further, corresponding to the above steps S108-2 to S108-6, as shown in fig. 7, the step S110 includes:
at step S110-2, a first amount of resources is transferred from the escrow account to a resource account of a second user.
Further, step S110 may further include: sending a transaction element processing request to terminal equipment of a related user corresponding to the transaction element according to the transaction identifier so that the terminal equipment of the related user can perform transaction processing on the locked transaction element associated with the transaction identifier; as in the above example, the terminal device of the coupon management user is caused to update the state information of the corresponding coupon and the like by causing the terminal device of the second user to perform stock reduction processing, and causing the second user to perform product delivery processing and the like.
Further, corresponding to the steps S108-2 to S108-6, as shown in fig. 7, the step S112 includes:
and step S112-2, determining the escrow account as a resource transfer-out account, determining the resource account of the second user as a resource transfer-in account, recording information such as the transaction identification, the account information of the resource transfer-out account, the account information of the resource transfer-in account, the third resource transfer time and the like in an associated manner, and determining the recorded information as transaction success record information.
In the first processing mode of the resources to be transferred, the resources of the first user for transaction are locked based on the escrow account, and the record information of the resource locking operation is stored in the block chain, so that the second user is not required to participate in transaction rollback processing, and the transaction rollback processing efficiency is improved; and transaction rollback processing can be traced based on the record information in the blockchain.
In one or more embodiments of the present application, the resource to be transferred may also be processed in a second manner, that is, after it is determined that the locking process of the transaction element is successful, the resource is transferred from the resource account of the first user to the resource account of the second user. Specifically, as shown in fig. 8, after step S102, the method may further include:
step S103-6, storing the transaction identification and the second state information into a first specified database in a correlated manner; wherein the second state information characterizes that the transaction is in a locked processing state of the transaction element;
correspondingly, as shown in fig. 8, step S108 includes:
step S108-8, if the second state information stored in the first appointed database in the correlated mode is inquired according to the transaction identifier and the transaction success record information is not inquired from the blockchain, the transaction identifier and the third state information are stored in the first appointed database in the correlated mode; wherein the third state information characterizes that the transaction is in a transaction failure state;
specifically, the transaction platform determines whether the second state information stored in a correlated manner is inquired from the first designated database according to the transaction identifier, and sends an inquiry request to the block chain link point according to the transaction identifier, so that the block chain link point inquires corresponding record information from the block chain according to the transaction identifier, and returns the inquired transaction record information to the transaction platform; the transaction platform receives the record information returned by the block link points; and if the second state information stored in association is determined to be inquired from the first specified database and the received record information does not include transaction success record information, determining that the transaction rollback processing condition is met, and storing the transaction identifier and the third state information in association to the first specified database. When the corresponding record information is inquired from the block chain according to the transaction identifier, and the inquired record information does not comprise the transaction success record information, the block chain link point can send an inquiry result representing that the transaction rollback processing condition is met to the transaction platform; correspondingly, when the transaction platform receives the query result and determines that the second state information stored in the first appointed database in the correlated manner is queried, the transaction platform stores the transaction identifier and the third state information in the first appointed database in the correlated manner.
And step S108-10, sending transaction failure information to the terminal equipment of the first user.
Further, step S108 may further include: and sending a resource release request to the terminal equipment of the relevant user corresponding to the response data representing the successful resource locking according to the transaction identifier, so that the terminal equipment of the relevant user determines the associated locked transaction element according to the transaction identifier included in the resource release request and releases the locked transaction element.
Further, corresponding to step S108-8 and step S108-10, as shown in fig. 8, the foregoing step S110 includes:
step S110-4, transferring a first amount of resources from the resource account of the first user to the resource account of the second user;
further, corresponding to step S108-8 and step S108-10, as shown in fig. 8, the aforementioned step S112 includes:
step S112-4, determining the resource account of the first user as a resource transfer-in account and determining the resource account of the second user as a resource transfer-out account; and performing associated recording on the transaction identification, the account information of the resource transferred into the account, the account information of the resource transferred out of the account, the fourth resource transfer time and other information, and determining the recorded information as the transaction success recording information.
In the second processing mode of the resources to be transferred, in the locking and rollback processing process of the transaction elements, the transaction platform only records the state information of the transaction request without performing other operations, so that the transaction rollback processing efficiency is improved; and after the transaction is successfully processed, the transaction success record information is stored to the block chain, so that the traceability of the transaction is ensured.
In the two processing modes of the resources to be transferred, after the locking processing is determined to be successful, the corresponding resources are transferred to the second user, and the transaction success record information is stored in the block chain. In another or more embodiments of the present application, the resource to be transferred may also be processed in a third manner, that is, after receiving the transaction request, the resource of the first user for performing the transaction is directly transferred to the second user. Specifically, as shown in fig. 9, after step S102, the method further includes:
s103-8, transferring a first amount of resources from the resource account of the first user to the resource account of the second user;
for a specific implementation of this step, reference may be made to the foregoing implementation of transferring the first amount of resources from the resource account of the first user to the hosting account, which is not described herein again. It should be noted that, when the resource to be transferred is managed by the specified organization, step S103-8 may be executed simultaneously with step S106-2.
S103-10, generating third transaction record information according to the transaction information, and storing the third transaction record information into the block chain; wherein the third transaction record information includes a transaction identification;
specifically, the transaction platform determines the resource account of the first user as a resource transfer-out account and determines the resource account of the second user as a resource transfer-in account; and (4) recording information such as the transaction identification, the account information of the resource transfer-out account, the account information of the resource transfer-in account, the fifth resource transfer time and the like in an associated manner, and determining the recorded information as third transaction record information. It should be noted that, when the locking process fails, the third transaction record information is used as a data basis for the transaction rollback process; when the locking process is successful, the third transaction record information is transaction success record information, and can be used for transaction description.
Corresponding to the above step S103-8 and step S103-10, as shown in fig. 9, step S108 includes:
step S108-12, if the third transaction record information is inquired from the block chain according to the transaction identification, transferring a first amount of resources from the resource account of the second user to the resource account of the first user;
specifically, the transaction platform sends a query request to the block chain link point according to the transaction identifier, so that the block chain link point queries corresponding last piece of record information from the block chain according to the transaction identifier, and sends the queried last piece of record information to the transaction platform; and if the transaction platform determines that the received transaction information is the third transaction record information, transferring the first amount of resources from the resource account of the second user to the resource account of the first user. Or the transaction platform sends a query request to the block chain link point according to the transaction identifier so that the block chain link point queries the corresponding last record information from the block chain according to the transaction identifier, and if the block chain link point determines that the queried last record information is the third transaction record information, a query result representing that the transaction rollback processing condition is met is returned; and after receiving the query result sent by the blockchain node, the transaction platform transfers the first amount of resources from the resource account of the second user to the resource account of the first user. For the process of transferring the first amount of resources from the resource account of the second user to the resource account of the first user, reference may be made to the foregoing process of transferring the first amount of resources from the hosting account to the resource account of the first user, which is not described herein again.
Step S108-14, generating fourth transaction record information according to the transaction information, and storing the fourth transaction record information into a block chain;
specifically, the transaction platform determines the resource account of the second user as a resource transfer-out account and determines the resource account of the first user as a resource transfer-in account; recording information such as the transaction identification, the account information of the resource transfer-out account, the account information of the resource transfer-in account, the sixth resource transfer time and the like in an associated manner, and determining the recorded information as fourth transaction record information; and sending the fourth transaction record information to the block chain link point so that the block chain link point stores the fourth transaction record information into the block chain.
And step S108-16, sending transaction failure information to the terminal equipment of the first user.
Further, step S108 may further include: and sending a resource release request to the terminal equipment of the relevant user corresponding to the response data representing the successful resource locking according to the transaction identifier, so that the terminal equipment of the relevant user determines the associated locked transaction element according to the transaction identifier included in the resource release request and releases the locked transaction element.
Further, corresponding to the above step S108-12 to step S108-16, as shown in fig. 9, the method further includes: if the locking process is successful, executing the following steps:
step S116, the transaction identification and the fourth state information are stored in a second specified database in a related mode; wherein the fourth state information represents that the transaction is in a transaction successful state;
and step S118, sending transaction success information to the terminal equipment of the first user.
The second designated database and the first designated database may be the same database or different databases.
In the third processing mode of the resources to be transferred, after the transaction platform receives the transaction request, the resources are directly transferred from the resource account of the first user to the resource account of the second user, and third transaction record information is stored in the block chain; when transaction rollback processing is carried out, transferring corresponding resources from the resource account of the second user to the resource account of the first user, and storing fourth transaction record information into the block chain; compared with the first processing mode and the second processing mode, the method has the advantages that the managed account is not required to be maintained, the state information in the designated database is maintained only when the transaction is successful, and the operation is relatively simple from the viewpoint; however, during the rollback process, the second user is typically required to confirm the transfer of the resource to the first user, i.e., to participate in the second user. In practical application, any one or a combination of several of the above processing modes can be selected by self according to needs to process the resources to be transferred.
It should be noted that, when the transaction processing node is the first blockchain node, the implementation process of the transaction processing method may refer to the implementation processes of the foregoing embodiments, and details are not described here.
In one or more embodiments of the present description, when a transaction request is received, a transaction element associated with a transaction is first locked, rather than directly processed, so that a transaction failure caused by a certain transaction element not meeting a transaction condition can be effectively avoided; when the locking processing fails, transaction rollback processing is carried out, and the locked transaction elements can be released in time without influencing the transaction elements to participate in other transactions; moreover, by storing the relevant record information of the transaction into the block chain, the traceability of the transaction is ensured, and an effective data basis is provided for the relevant processing of the transaction.
On the basis of the same technical concept, one or more embodiments of the present specification further provide a transaction processing apparatus corresponding to the transaction processing methods described in fig. 4 to 9. Fig. 10 is a schematic diagram of module components of a transaction processing apparatus according to one or more embodiments of the present disclosure, the apparatus being configured to execute the transaction processing method described in fig. 4 to 9, and as shown in fig. 10, the apparatus includes:
a receiving module 201, which receives a transaction request sent by a terminal device of a first user; the transaction request comprises transaction information of a transaction between the first user and the second user, and the related record information of the transaction is stored in a block chain;
a determining module 202, configured to determine, according to the transaction information, a transaction element associated with the transaction;
a locking module 203, which performs locking processing on the determined transaction elements;
and the processing module 204, if the locking processing fails, performs transaction rollback processing and sends transaction failure information to the terminal device.
In the transaction processing device provided in one or more embodiments of the present specification, when a transaction request is received, a transaction element associated with a transaction is first locked, instead of directly performing transaction processing, so that a transaction failure caused by a certain transaction element not meeting a transaction condition can be effectively avoided; when the locking processing fails, transaction rollback processing is carried out, and the locked transaction elements can be released in time without influencing the transaction elements to participate in other transactions; moreover, by storing the relevant record information of the transaction into the block chain, the traceability of the transaction is ensured, and an effective data basis is provided for the relevant processing of the transaction.
Optionally, the locking module 203 sends a transaction element locking request to a terminal device of a relevant user corresponding to the transaction element, so that the terminal device of the relevant user returns response data based on the determined first state information of the transaction element, and locks the transaction element when the first state information indicates that the transaction element is in a tradable state; wherein the associated user comprises the second user; and (c) a second step of,
determining whether a transaction condition of the transaction is satisfied according to the response data;
if so, determining that the locking processing is successful; if not, determining that the locking processing fails.
Optionally, if the locking process is successful, the processing module 204 performs a transaction process according to the transaction information; and the number of the first and second groups,
generating transaction success record information according to the transaction information;
and storing the transaction success record information into the block chain, and sending the transaction success information to the terminal equipment of the first user.
Optionally, the transaction information includes: a transaction identification and a first amount of resources to be transferred; the device further comprises: a first transfer module;
the first transfer module, after the receiving module 201 receives the transaction request sent by the terminal device of the first user, transfers the first amount of resources from the resource account of the first user to the designated hosting account; and the number of the first and second groups,
generating first resource transfer record information according to the transaction information, and storing the first resource transfer record into the block chain; wherein the first resource transfer record information comprises the transaction identification;
the processing module 204, if the first resource transfer record is queried from the block chain according to the transaction identifier and the transaction success record information is not queried, transferring the first amount of resources from the escrow account to the resource account of the first user; and the number of the first and second groups,
and generating second resource transfer record information according to the transaction information, and storing the second resource transfer record information into the block chain.
Optionally, the processing module 204 transfers the first amount of resources from the escrow account to the resource account of the second user if the locking process is successful.
Optionally, the transaction information includes: a transaction identification and a first amount of resources to be transferred; the device further comprises: a storage module;
the storage module is configured to store the transaction identifier and the second state information in a first designated database in an associated manner after the receiving module 201 receives a transaction request sent by a terminal device of a first user; wherein the second state information characterizes the transaction as being in a locked processing state of the transaction element;
the processing module 204, if the second state information stored in association is queried from the first specified database according to the transaction identifier and the transaction success record information is not queried from the block chain, stores the transaction identifier and the third state information in association to the first specified database; wherein the third state information characterizes the transaction as being in a transaction failed state.
Optionally, the processing module 204 transfers the first amount of resources from the resource account of the first user to the resource account of the second user if the locking process is successful.
Optionally, the apparatus further comprises: a second transfer module;
the second transfer module, after the receiving module 201 receives the transaction request sent by the terminal device of the first user, transfers the first amount of resources from the resource account of the first user to the resource account of the second user; and (c) a second step of,
generating third transaction record information according to the transaction information, and storing the third transaction record information into the block chain; wherein the third transaction record information includes the transaction identification;
the processing module 204, if the third transaction record information is queried from the block chain according to the transaction identifier, transfers the first amount of resources from the resource account of the second user to the resource account of the first user; and (c) a second step of,
and generating fourth transaction record information according to the transaction information, and storing the fourth transaction record information into the block chain.
Optionally, if the locking process is successful, the processing module 204 stores the transaction identifier and the fourth state information in association with a second designated database; wherein the fourth state information characterizes the transaction as being in a transaction successful state.
In the transaction processing device provided in one or more embodiments of the present specification, when a transaction request is received, a transaction element associated with a transaction is first locked, instead of directly performing the transaction processing, so that a transaction failure caused by a certain transaction element not meeting a transaction condition can be effectively avoided; when the locking processing fails, transaction rollback processing is carried out, and the locked transaction elements can be released in time without influencing the transaction elements to participate in other transactions; moreover, by storing the relevant record information of the transaction into the block chain, the traceability of the transaction is ensured, and an effective data basis is provided for the relevant processing of the transaction.
It should be noted that the embodiment of the transaction processing apparatus in this specification and the embodiment of the transaction processing method in this specification are based on the same inventive concept, and therefore, for specific implementation of this embodiment, reference may be made to the implementation of the corresponding transaction processing method, and repeated descriptions are omitted.
Further, on the basis of the same technical concept, corresponding to the transaction processing methods described in fig. 4 to 9, one or more embodiments of the present specification further provide a transaction processing device, where the transaction processing device is configured to execute the transaction processing method, and fig. 11 is a schematic structural diagram of the transaction processing device provided in one or more embodiments of the present specification.
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 301 and a memory 302, and one or more stored applications or data may be stored in the memory 302. Wherein memory 302 may be transient storage or persistent storage. The application program stored in memory 302 may include one or more modules (not shown), each of which may include a series of computer-executable instructions in a transaction processing device. Still further, the processor 301 may be configured to communicate with the memory 302 to execute a series of computer-executable instructions in the memory 302 on a transaction processing device. The transaction processing device may also include one or more power sources 303, one or more wired or wireless network interfaces 304, one or more input-output interfaces 305, one or more keyboards 306, and the like.
In one particular embodiment, the transaction processing apparatus 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 apparatus, and the one or more programs configured to be executed by the one or more processors include computer-executable instructions for:
receiving a transaction request sent by terminal equipment of a first user; the transaction request comprises transaction information of a transaction between the first user and the second user, and the related record information of the transaction is stored in a block chain;
determining transaction elements associated with the transaction according to the transaction information;
locking the determined transaction element;
and if the locking processing fails, performing transaction rollback processing and sending transaction failure information to the terminal equipment.
When a transaction request is received, the transaction processing device provided in one or more embodiments of the present specification firstly locks transaction elements associated with a transaction, rather than directly performs transaction processing, so that a transaction failure caused by a certain transaction element not meeting a transaction condition can be effectively avoided; when the locking processing fails, transaction rollback processing is carried out, and the locked transaction elements can be released timely without influencing the transaction elements to participate in other transactions; moreover, the related record information of the transaction is stored in the block chain, so that the traceability of the transaction is ensured, and an effective data basis is provided for the related processing of the transaction.
Optionally, the computer-executable instructions, when executed, lock processing the determined transaction element, comprising:
sending a transaction element locking request to terminal equipment of a related user corresponding to the transaction element, so that the terminal equipment of the related user returns response data based on the determined first state information of the transaction element, and locking the transaction element when the first state information represents that the transaction element is in a tradable state; wherein the associated user comprises the second user;
determining whether a transaction condition of the transaction is satisfied according to the response data;
if so, determining that the locking processing is successful; if not, determining that the locking processing fails.
Optionally, the computer executable instructions, when executed, further comprise:
if the locking processing is successful, transaction processing is carried out according to the transaction information; and the number of the first and second groups,
generating transaction success record information according to the transaction information;
and storing the transaction success record information into the block chain, and sending the transaction success information to the terminal equipment of the first user.
Optionally, the computer executable instructions, when executed, the transaction information comprises: a transaction identification and a first amount of resources to be transferred;
after receiving the transaction request sent by the terminal device of the first user, the method further includes:
transferring the first amount of resources from the first user's resource account to a designated hosting account; and the number of the first and second groups,
generating first resource transfer record information according to the transaction information, and storing the first resource transfer record into the block chain; wherein the first resource transfer record information comprises the transaction identification;
the performing transaction rollback processing comprises:
if the first resource transfer record information is inquired from the block chain according to the transaction identification and the transaction success record information is not inquired, transferring the first quantity of resources from the escrow account to the resource account of the first user; and the number of the first and second groups,
and generating second resource transfer record information according to the transaction information, and storing the second resource transfer record information into the block chain.
Optionally, when executed, the computer-executable instructions perform transaction processing according to the transaction information, including:
transferring the first amount of resources from the escrow account to the resource account of the second user.
Optionally, the computer executable instructions, when executed, the transaction information comprises: a transaction identification and a first amount of resources to be transferred;
after receiving the transaction request sent by the terminal device of the first user, the method further includes:
storing the transaction identification and the second state information into a first designated database in a correlated manner; wherein the second state information characterizes the transaction as being in a locked processing state of the transaction element;
the performing transaction rollback processing comprises:
if the second state information stored in the first appointed database in a correlated mode is inquired according to the transaction identifier and the transaction success record information is not inquired from the block chain, the transaction identifier and the third state information are stored in the first appointed database in a correlated mode; wherein the third state information characterizes the transaction as being in a transaction failed state.
Optionally, when executed, the computer-executable instructions perform transaction processing according to the transaction information, including:
transferring the first amount of resources from the first user's resource account to the second user's resource account.
Optionally, the computer executable instructions, when executed, the transaction information comprises: a transaction identification and a first amount of resources to be transferred;
after receiving the transaction request sent by the terminal device of the first user, the method includes:
transferring the first amount of resources from the first user's resource account to the second user's resource account;
generating third transaction record information according to the transaction information, and storing the third transaction record information into the block chain; wherein the third transaction record information includes the transaction identification;
the performing transaction rollback processing includes:
if the third transaction record information is inquired from the block chain according to the transaction identification, transferring the first quantity of resources from the resource account of the second user to the resource account of the first user;
and generating fourth transaction record information according to the transaction information, and storing the fourth transaction record information into the block chain.
Optionally, the computer executable instructions, when executed, further comprise:
if the locking processing is successful, the transaction identification and the fourth state information are stored in a second specified database in a correlated mode; wherein the fourth state information characterizes the transaction as being in a transaction successful state.
One or more embodiments of the present disclosure provide a transaction processing device, which, when receiving a transaction request, first locks transaction elements associated with a transaction, rather than directly performs transaction processing, so that failure of the transaction due to a certain transaction element not meeting a transaction condition can be effectively avoided; when the locking processing fails, transaction rollback processing is carried out, and the locked transaction elements can be released in time without influencing the transaction elements to participate in other transactions; moreover, the related record information of the transaction is stored in the block chain, so that the traceability of the transaction is ensured, and an effective data basis is provided for the related processing of the transaction.
It should be noted that the embodiment of the transaction processing device in this specification and the embodiment of the transaction processing method in this specification are based on the same inventive concept, and therefore, for specific implementation of this embodiment, reference may be made to implementation of the corresponding transaction processing method, and repeated details are not described again.
Further, based on the same technical concept, corresponding to the methods shown in fig. 4 to fig. 8, one or more embodiments of the present specification further provide a storage medium for storing computer-executable instructions, where in a specific embodiment, the storage medium may be a usb disk, an optical disk, a hard disk, and the like, and the storage medium stores computer-executable instructions that, when executed by a processor, implement the following processes:
receiving a transaction request sent by terminal equipment of a first user; the transaction request comprises transaction information of a transaction between the first user and the second user, and the related record information of the transaction is stored in a block chain;
determining transaction elements associated with the transaction according to the transaction information;
locking the determined transaction element;
and if the locking processing fails, performing transaction rollback processing and sending transaction failure information to the terminal equipment.
When the computer-executable instructions stored in the storage medium in one or more embodiments of the present specification are executed by the processor, and when a transaction request is received, the transaction element associated with a transaction is first locked, rather than being directly processed, so that a transaction failure caused by a certain transaction element not meeting a transaction condition can be effectively avoided; when the locking processing fails, transaction rollback processing is carried out, and the locked transaction elements can be released in time without influencing the transaction elements to participate in other transactions; moreover, the related record information of the transaction is stored in the block chain, so that the traceability of the transaction is ensured, and an effective data basis is provided for the related processing of the transaction.
Optionally, the storage medium stores computer executable instructions that, when executed by the processor, perform locking processing on the determined transaction element, including:
sending a transaction element locking request to terminal equipment of a related user corresponding to the transaction element, so that the terminal equipment of the related user returns response data based on the determined first state information of the transaction element, and locking the transaction element when the first state information represents that the transaction element is in a tradable state; wherein the associated user comprises the second user;
determining whether a transaction condition of the transaction is satisfied according to the response data;
if so, determining that the locking processing is successful; if not, determining that the locking processing fails.
Optionally, the storage medium stores computer-executable instructions that, when executed by the processor, further comprise:
if the locking processing is successful, transaction processing is carried out according to the transaction information; and the number of the first and second groups,
generating transaction success record information according to the transaction information;
and storing the transaction success record information into the block chain, and sending the transaction success information to the terminal equipment of the first user.
Optionally, the storage medium stores computer-executable instructions that, when executed by the processor, cause the transaction information to include: a transaction identification and a first amount of resources to be transferred;
after receiving the transaction request sent by the terminal device of the first user, the method further includes:
transferring the first amount of resources from the first user's resource account to a designated hosting account; and the number of the first and second groups,
generating first resource transfer record information according to the transaction information, and storing the first resource transfer record into the block chain; wherein the first resource transfer record information comprises the transaction identification;
the performing transaction rollback processing comprises:
if the first resource transfer record information is inquired from the block chain according to the transaction identification and the transaction success record information is not inquired, transferring the first quantity of resources from the escrow account to the resource account of the first user; and (c) a second step of,
and generating second resource transfer record information according to the transaction information, and storing the second resource transfer record information into the block chain.
Optionally, the storage medium stores computer executable instructions which, when executed by the processor, perform transaction processing according to the transaction information, including:
transferring the first amount of resources from the hosting account to a resource account of the second user.
Optionally, the storage medium stores computer-executable instructions that, when executed by the processor, cause the transaction information to include: a transaction identification and a first amount of resources to be transferred;
after receiving the transaction request sent by the terminal device of the first user, the method further includes:
storing the transaction identification and the second state information into a first designated database in a correlated manner; wherein the second state information characterizes the transaction as being in a locked processing state of the transaction element;
the performing transaction rollback processing includes:
if the second state information stored in the first appointed database in a correlated mode is inquired according to the transaction identifier and the transaction success record information is not inquired from the block chain, the transaction identifier and the third state information are stored in the first appointed database in a correlated mode; wherein the third state information characterizes the transaction as being in a transaction failed state.
Optionally, the storage medium stores computer-executable instructions that, when executed by the processor, perform transaction processing according to the transaction information, including:
transferring the first amount of resources from the first user's resource account to the second user's resource account.
Optionally, the storage medium stores computer-executable instructions that, when executed by the processor, cause the transaction information to include: a transaction identification and a first amount of resources to be transferred;
after the receiving of the transaction request sent by the terminal device of the first user, the method includes:
transferring the first amount of resources from the first user's resource account to the second user's resource account;
generating third transaction record information according to the transaction information, and storing the third transaction record information into the block chain; wherein the third transaction record information includes the transaction identification;
the performing transaction rollback processing comprises:
if the third transaction record information is inquired from the block chain according to the transaction identification, transferring the first amount of resources from the resource account of the second user to the resource account of the first user;
and generating fourth transaction record information according to the transaction information, and storing the fourth transaction record information into the block chain.
Optionally, the storage medium stores computer-executable instructions that, when executed by the processor, further comprise:
if the locking processing is successful, the transaction identification and the fourth state information are stored in a second specified database in a correlated mode; wherein the fourth state information characterizes the transaction as being in a transaction successful state.
When the computer-executable instructions stored in the storage medium provided by one or more embodiments of the present specification are executed by a processor, when a transaction request is received, a transaction element associated with a transaction is first locked, rather than directly processed, so that a transaction failure caused by a certain transaction element not meeting a transaction condition can be effectively avoided; when the locking processing fails, transaction rollback processing is carried out, and the locked transaction elements can be released timely without influencing the transaction elements to participate in other transactions; moreover, the related record information of the transaction is stored in the block chain, so that the traceability of the transaction is ensured, and an effective data basis is provided for the related processing of the transaction.
It should be noted that the embodiment of the storage medium in this specification and the embodiment of the transaction processing method in this specification are based on the same inventive concept, and therefore, for specific implementation of this embodiment, reference may be made to implementation of the corresponding transaction processing method, and repeated details are not described again.
The foregoing description has been directed to specific embodiments of this 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 may also be possible or may be advantageous.
In the 30's of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to the software compiler used in program development, but the original code before compiling is also written in a specific Programming Language, which is called Hardware Description Language (HDL), and the HDL is not only one kind but many kinds, such as abel (advanced boot Expression Language), ahdl (alternate Language Description Language), communication, CUPL (computer universal Programming Language), HDCal (Java Hardware Description Language), langa, Lola, mylar, HDL, PALASM, rhydl (runtime Description Language), vhjhdul (Hardware Description Language), and vhygl-Language, which are currently used commonly. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using 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 that stores computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, 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 divided into various units by function, respectively. Of course, the functions of the various elements may be implemented in the same one or more pieces of software and/or hardware in practicing embodiments of the present description.
One skilled in the 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 description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The description has been presented with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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 a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
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 computer storage media 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 that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
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 an … …" 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 description 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.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the system embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points.
The above description is only an example of this document and is not intended to limit this document. Various modifications and changes may occur to those skilled in the art from this document. Any modifications, equivalents, improvements, etc. which come within the spirit and principle of the disclosure are intended to be included within the scope of the claims of this document.

Claims (13)

1. A transaction processing method, comprising:
receiving a transaction request sent by terminal equipment of a first user; the transaction request comprises transaction information of transaction between the first user and the second user, wherein the transaction information comprises a transaction identifier and a first quantity of resources to be transferred; the related record information of the transaction is stored in a block chain;
according to the transaction information, locking transaction elements related to the transaction;
if the locking processing fails, transaction rollback processing is carried out, and transaction failure information is sent to the terminal equipment;
wherein, after receiving the transaction request sent by the terminal device of the first user, the method further comprises:
transferring the first amount of resources from the first user's resource account to a designated hosting account; generating first resource transfer record information according to the transaction information, and storing the first resource transfer record information into the block chain; wherein the first resource transfer record information comprises the transaction identification;
then the performing transaction rollback processing comprises:
if the first resource transfer record information is inquired from the block chain according to the transaction identification and the transaction success record information is not inquired, transferring the first quantity of resources from the escrow account to the resource account of the first user; and the transaction success record information is generated after transaction processing is carried out according to the transaction information when the locking processing is determined to be successful.
2. The method of claim 1, the locking the transaction element associated with the transaction according to the transaction information, comprising:
determining transaction elements associated with the transaction according to the transaction information;
sending a transaction element locking request to the determined terminal equipment of the relevant user corresponding to the transaction element, so that the terminal equipment of the relevant user returns response data based on the determined first state information of the transaction element, and when the first state information represents that the transaction element is in a tradable state, locking the transaction element; wherein the associated user comprises the second user;
determining whether the transaction condition of the transaction is met according to the response data;
if so, determining that the locking processing is successful; if not, determining that the locking processing fails.
3. The method of claim 1, further comprising, after the transferring the first amount of resources from the escrow account to the resource account of the first user:
and generating second resource transfer record information according to the transaction information, and storing the second resource transfer record information into the block chain.
4. The method of claim 1, the transaction processing according to the transaction information, comprising:
transferring the first amount of resources from the hosting account to a resource account of the second user.
5. The method according to claim 1, further comprising, after receiving the transaction request sent by the terminal device of the first user:
storing the transaction identification and the second state information into a first designated database in a related manner; wherein the second state information characterizes the transaction as being in a locked processing state of the transaction element;
then the performing transaction rollback processing comprises:
if the second state information stored in the first appointed database in a correlated mode is inquired according to the transaction identifier and the transaction success record information is not inquired from the block chain, the transaction identifier and the third state information are stored in the first appointed database in a correlated mode; when the transaction success record information is determined that the locking processing is successful, transaction processing is carried out according to the transaction information to generate information; the third state information characterizes that the transaction is in a transaction failure state.
6. The method of claim 5, the processing of transactions according to the transaction information, comprising:
transferring the first amount of resources from the first user's resource account to the second user's resource account.
7. The method according to claim 1, further comprising, after receiving the transaction request sent by the terminal device of the first user:
transferring the first amount of resources from the first user's resource account to the second user's resource account;
generating third transaction record information according to the transaction information, and storing the third transaction record information into the block chain; wherein the third transaction record information includes the transaction identification;
then the performing transaction rollback processing includes:
if the third transaction record information is inquired from the block chain according to the transaction identification, transferring the first quantity of resources from the resource account of the second user to the resource account of the first user;
and generating fourth transaction record information according to the transaction information, and storing the fourth transaction record information into the block chain.
8. The method of claim 7, further comprising:
if the locking processing is successful, the transaction identification and the fourth state information are stored in a second specified database in a correlated mode; wherein the fourth state information characterizes the transaction as being in a transaction successful state.
9. A transaction processing device comprising:
the receiving module is used for receiving a transaction request sent by terminal equipment of a first user; the transaction request comprises transaction information of a transaction between the first user and the second user, wherein the transaction information comprises a transaction identifier and a first quantity of resources to be transferred; the related record information of the transaction is stored in a block chain;
the locking module is used for locking the transaction elements related to the transaction;
the processing module is used for carrying out transaction rollback processing and sending transaction failure information to the terminal equipment if the locking processing fails;
if the device further comprises: a first transfer module;
the first transfer module transfers the first amount of resources from the resource account of the first user to the designated hosting account after the receiving module receives the transaction request sent by the terminal device of the first user; generating first resource transfer record information according to the transaction information, and storing the first resource transfer record information into the block chain; wherein the first resource transfer record information comprises the transaction identification;
the processing module, if the first resource transfer record information is inquired from the block chain according to the transaction identifier and the transaction success record information is not inquired, transfers the first amount of resources from the escrow account to the resource account of the first user; and the transaction success record information is generated after transaction processing is carried out according to the transaction information when the locking processing is determined to be successful.
10. The apparatus of claim 9, if the apparatus further comprises: a storage module;
the storage module is used for storing the transaction identifier and the second state information into a first specified database in a correlation manner after the receiving module receives a transaction request sent by the terminal equipment of the first user; wherein the second state information characterizes the transaction as being in a locked processing state of the transaction element;
the processing module is used for storing the transaction identifier and the third state information into the first designated database in a correlated manner if the second state information stored in the first designated database in a correlated manner is inquired according to the transaction identifier and the transaction success record information is not inquired from the block chain; wherein the third state information characterizes the transaction as being in a transaction failed state.
11. The apparatus of claim 9, if the apparatus further comprises: a second transfer module;
the second transfer module transfers the first amount of resources from the resource account of the first user to the resource account of the second user after the receiving module receives the transaction request sent by the terminal device of the first user; and the number of the first and second groups,
generating third transaction record information according to the transaction information, and storing the third transaction record information into the block chain; wherein the third transaction record information includes the transaction identification;
if the third transaction record information is queried from the block chain according to the transaction identifier, the processing module transfers the first amount of resources from the resource account of the second user to the resource account of the first user; and the number of the first and second groups,
and generating fourth transaction record information according to the transaction information, and storing the fourth transaction record information into the block chain.
12. A transaction processing device comprising:
a processor; and (c) a second step of,
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
receiving a transaction request sent by terminal equipment of a first user; the transaction request comprises transaction information of a transaction between the first user and the second user, wherein the transaction information comprises a transaction identifier and a first quantity of resources to be transferred; the related record information of the transaction is stored in a block chain;
according to the transaction information, locking transaction elements related to the transaction;
if the locking processing fails, transaction rollback processing is carried out, and transaction failure information is sent to the terminal equipment;
wherein, after receiving the transaction request sent by the terminal device of the first user, the method further comprises:
transferring the first amount of resources from the first user's resource account to a designated hosting account; generating first resource transfer record information according to the transaction information, and storing the first resource transfer record information into the block chain; wherein the first resource transfer record information comprises the transaction identification;
then the performing transaction rollback processing includes:
if the first resource transfer record information is inquired from the block chain according to the transaction identification and the transaction success record information is not inquired, transferring the first quantity of resources from the escrow account to the resource account of the first user; and the transaction success record information is generated after transaction processing is carried out according to the transaction information when the locking processing is determined to be successful.
13. A storage medium storing computer-executable instructions that when executed by a processor implement the following:
receiving a transaction request sent by terminal equipment of a first user; the transaction request comprises transaction information of transaction between the first user and the second user, wherein the transaction information comprises a transaction identifier and a first quantity of resources to be transferred; the related record information of the transaction is stored in a block chain;
locking the transaction elements related to the transaction according to the transaction information;
if the locking processing fails, transaction rollback processing is carried out, and transaction failure information is sent to the terminal equipment;
wherein, after receiving the transaction request sent by the terminal device of the first user, the method further comprises:
transferring the first amount of resources from the first user's resource account to a designated hosting account; generating first resource transfer record information according to the transaction information, and storing the first resource transfer record information into the block chain; wherein the first resource transfer record information comprises the transaction identification;
then the performing transaction rollback processing includes:
if the first resource transfer record information is inquired from the block chain according to the transaction identification and the transaction success record information is not inquired, transferring the first quantity of resources from the escrow account to the resource account of the first user; and the transaction success record information is generated after transaction processing is carried out according to the transaction information when the locking processing is determined to be successful.
CN202010851539.3A 2020-03-03 2020-03-03 Transaction processing method, device and equipment Active CN112016921B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010851539.3A CN112016921B (en) 2020-03-03 2020-03-03 Transaction processing method, device and equipment

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010851539.3A CN112016921B (en) 2020-03-03 2020-03-03 Transaction processing method, device and equipment
CN202010140398.4A CN110992038B (en) 2020-03-03 2020-03-03 Transaction processing method, device and equipment

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN202010140398.4A Division CN110992038B (en) 2020-03-03 2020-03-03 Transaction processing method, device and equipment

Publications (2)

Publication Number Publication Date
CN112016921A CN112016921A (en) 2020-12-01
CN112016921B true CN112016921B (en) 2022-08-19

Family

ID=70081337

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202010851539.3A Active CN112016921B (en) 2020-03-03 2020-03-03 Transaction processing method, device and equipment
CN202010140398.4A Active CN110992038B (en) 2020-03-03 2020-03-03 Transaction processing method, device and equipment

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202010140398.4A Active CN110992038B (en) 2020-03-03 2020-03-03 Transaction processing method, device and equipment

Country Status (1)

Country Link
CN (2) CN112016921B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111597077B (en) * 2020-05-13 2022-04-29 腾讯科技(深圳)有限公司 Data processing method, data processing device, computer equipment and storage medium
CN111340631B (en) 2020-05-15 2020-12-01 支付宝(杭州)信息技术有限公司 Asset transfer method, device, equipment and system
CN111768303A (en) * 2020-06-01 2020-10-13 支付宝实验室(新加坡)有限公司 Transaction processing method, device, equipment and system
CN111784879B (en) * 2020-07-09 2022-04-05 杭州复杂美科技有限公司 Access control method, device and storage medium
CN112200573B (en) * 2020-10-14 2021-08-17 北京天德科技有限公司 Block chain transaction design method capable of rolling back
CN112381650B (en) * 2020-11-18 2024-02-27 西安纸贵互联网科技有限公司 Cross-chain interoperation transaction processing method, device, electronic equipment and storage medium
CN112529714A (en) * 2020-12-22 2021-03-19 深圳市富途网络科技有限公司 Using method of financial instrument and related product
CN113781154A (en) * 2021-03-19 2021-12-10 北京京东拓先科技有限公司 Information rollback method, system, electronic equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109598611A (en) * 2018-10-09 2019-04-09 阿里巴巴集团控股有限公司 A kind of processing method of transaction, transaction gateway, trading server and transaction system

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106203894A (en) * 2015-04-30 2016-12-07 阿里巴巴集团控股有限公司 The processing method of the inventory information of merchandise items and system
CN107292688A (en) * 2016-03-31 2017-10-24 阿里巴巴集团控股有限公司 A kind of method for processing business and device
CN106899698B (en) * 2017-04-11 2020-12-18 张铮文 Cross-chain interoperation method between block chains
US10585873B2 (en) * 2017-05-08 2020-03-10 Sap Se Atomic processing of compound database transactions that modify a metadata entity
WO2020014551A1 (en) * 2018-07-11 2020-01-16 Dan Kikinis System and method for secure storage of digital assets to facilitate electronic transactions
CN108805712B (en) * 2018-05-29 2021-03-23 创新先进技术有限公司 Asset transfer rollback processing method and device and electronic equipment
CN110766401A (en) * 2018-07-27 2020-02-07 翟红鹰 Digital asset transaction method, device, computer equipment and storage medium
CN109685489B (en) * 2018-12-28 2021-06-01 杭州云象网络技术有限公司 Cross-chain transaction method for assets between block chains
CN110264346A (en) * 2019-05-06 2019-09-20 阿里巴巴集团控股有限公司 Processing method, device and the equipment of assets consumer requests
CN110287205A (en) * 2019-06-21 2019-09-27 中国银联股份有限公司 A kind of across the fragment transaction data processing method of block chain and device
CN110532068A (en) * 2019-07-18 2019-12-03 政采云有限公司 A kind of management method of distributed transaction
CN110599143B (en) * 2019-07-31 2021-05-28 腾讯科技(深圳)有限公司 Data processing method, related device and medium
CN110473100B (en) * 2019-08-15 2023-07-11 深圳前海微众银行股份有限公司 Transaction processing method and device based on blockchain system
CN110599182B (en) * 2019-09-27 2023-08-22 腾讯科技(深圳)有限公司 Resource management method and device
CN114819958A (en) * 2019-10-31 2022-07-29 支付宝(杭州)信息技术有限公司 Transaction processing method, device and equipment based on block chain

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109598611A (en) * 2018-10-09 2019-04-09 阿里巴巴集团控股有限公司 A kind of processing method of transaction, transaction gateway, trading server and transaction system

Also Published As

Publication number Publication date
CN112016921A (en) 2020-12-01
CN110992038B (en) 2020-08-21
CN110992038A (en) 2020-04-10

Similar Documents

Publication Publication Date Title
CN112016921B (en) Transaction processing method, device and equipment
CN110471984B (en) Service processing method and device based on block chain and electronic equipment
KR102226257B1 (en) Method and device for writing service data to a blockchain system
CN107424069B (en) Wind control feature generation method, risk monitoring method and equipment
CN110020542B (en) Data reading and writing method and device and electronic equipment
CN106899666B (en) Data processing method and device for service identification
CN108173706B (en) Service marking method, device and equipment under multi-service system
CN110992040A (en) Transaction processing method, device and equipment
CN111028084A (en) Transaction processing method, device and equipment based on block chain
CN110992188B (en) Transaction processing method, device and equipment
CN108599973B (en) Log association method, device and equipment
CN111489145B (en) Resource transfer method, device and equipment based on block chain
CN111738737B (en) Method, device and equipment for generating digital property right certificate
TW201941086A (en) Data caching method, device and system
CN113495797A (en) Message queue and consumer dynamic creation method and system
CN116385063A (en) Rights and interests sharing processing method and device
CN111768303A (en) Transaction processing method, device, equipment and system
CN110992039B (en) Transaction processing method, device and equipment
CN111402058B (en) Data processing method, device, equipment and medium
CN110992164B (en) Transaction processing method, device, system and equipment based on block chain
CN111539730A (en) Data processing method and device based on block chain and electronic equipment
CN113610640B (en) Event wind control method, device, equipment and storage medium based on alliance chain
CN113436017B (en) Transaction processing method, device and equipment
CN114862380B (en) Quota sharing processing method and device
CN111414162B (en) Data processing method, device and equipment thereof

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40041496

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant