Transaction method and system based on smart contract
By introducing an active query mechanism in cross-institutional transactions, the problem of inconsistent transaction data caused by failed receipt after successful payment is solved, thereby improving the consistency of data and the interaction capabilities between the payer and payee.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- THE PEOPLES BANK OF CHINA DIGITAL CURRENCY INST
- Filing Date
- 2024-11-12
- Publication Date
- 2026-05-12
AI Technical Summary
In cross-institutional smart contract transactions, a failure to receive payment after a successful payment can lead to inconsistencies in transaction data between the payer and the payee, impacting the user experience.
An active query mechanism is introduced, in which a query request is sent to the payment platform through the interconnected platform when the query conditions are met. The payment platform then provides the target payment result, and the payment platform processes the execution result of the payment smart contract based on the result.
It ensures consistency of transaction data between the payer and payee, enhances interactivity during the transaction process, and improves user experience.
Smart Images

Figure CN122022995A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital currency technology, and in particular to a transaction method and system based on smart contracts. Background Technology
[0002] In existing smart contract-based cryptocurrency transactions, the typical process for cross-institutional payments is as follows: after executing the payment smart contract, the payer initiates a transaction instruction to the payee through an interconnected platform. The payee institution then executes the receiving smart contract according to the instruction. However, during the receiving process, the payee may experience payment failure due to abnormal wallet status, exceeding limits, or other reasons. In other words, there may be an anomaly where the payer successfully deducts funds, but the payee is unable to credit the funds. In this anomaly, because smart contracts cannot perform reverse operations, inconsistencies in transaction data between the payer and payee may occur, thus impacting user experience. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a transaction method and system based on smart contracts. During cross-institutional transactions, when query conditions are met, the interconnection platform sends a query request for the target payment result to the receiving platform. The receiving platform can then relay the target payment result to the payment platform through the interconnection platform. The payment platform then processes the execution result of the payment smart contract based on the target payment result. This implements a proactive query mechanism for payment results during cross-institutional transactions, and the payment platform can process payment data based on the query results, thereby ensuring consistency between the transaction data of the payer and payee. Furthermore, the introduction of a proactive query mechanism enhances the interaction capabilities between the payer and payee during the transaction process, which is beneficial for improving the user experience.
[0004] To achieve the above objectives, according to one aspect of the present invention, a transaction method based on smart contracts is provided. The transaction method based on smart contracts provided by the present invention includes: a payment platform executing a payment smart contract according to a transaction request;
[0005] Based on the execution result of the payment smart contract, the payment platform sends a collection instruction to the interconnection platform, which instructs the collection platform to do so.
[0006] The interconnection platform sends a payment instruction to the payment platform, and the payment platform collects the payment according to the payment instruction;
[0007] If the query conditions are met, the interconnection platform sends a query request to the payment platform regarding the target payment result;
[0008] The payment platform, based on the query request, sends the target payment result back to the interconnection platform, which then sends the target payment result back to the payment platform.
[0009] The payment platform processes the execution results of the payment smart contract based on the target payment outcome.
[0010] Optionally, before the interconnection platform sends a query request for the payment result to the payment platform, the transaction method further includes:
[0011] If the interoperability platform does not receive the target payment result within a preset first time period, it presumes the payment result and sends the presumed payment result to the payment platform; the payment platform determines that the query conditions are met based on the presumed payment result and sends a query request to the interoperability platform.
[0012] Optionally, before the interconnection platform sends a query request for the payment result to the payment platform, the transaction method further includes: if the interconnection platform does not receive the target payment result within a preset second time period, it determines that the query conditions are met.
[0013] Optionally, before the interconnection platform sends a query request for the payment result to the payment platform, the transaction method further includes:
[0014] If the payment platform does not receive feedback from the interconnection platform within a preset third time period, it determines that the query conditions are met and sends a query request to the interconnection platform.
[0015] Optionally, the payment platform includes a payment collection device and a payment contract execution device; the payment platform collects payments according to payment instructions, including:
[0016] The payment receiving device receives a payment instruction and sends the payment instruction to the payment contract execution device, so that the payment contract execution device executes the first payment smart contract according to the payment instruction, and obtains and caches the payment contract data;
[0017] The payment receiving device calls the payment receiving wallet to receive payment based on the payment contract data;
[0018] The payment contract execution device processes the payment contract data based on the payment results from the payment wallet and sends the processing results to the payment device.
[0019] The payment receiving device reports the target payment result to the interconnection platform based on the processing results.
[0020] Optionally, if the payment receiving device does not receive the processing result from the payment contract execution device within a preset fourth time period, the payment receiving device shall report the payment failure to the interconnection platform.
[0021] Optionally, the fourth duration may be shorter than the first duration and / or the second duration.
[0022] Optionally, the payment platform sends a collection instruction to the interconnection platform based on the execution result of the payment smart contract, including:
[0023] The payment platform freezes the payment amount in the payment wallet and caches the payment contract data. Based on the cached results, it sends a collection instruction to the interconnection platform.
[0024] The payment platform processes the execution results of the payment smart contract based on the target payment outcome, including:
[0025] If the target payment result indicates successful payment, the payment platform will make payment based on the amount frozen in the payment wallet and submit the cached payment contract data.
[0026] If the target payment result indicates payment failure, delete the payment contract data and unfreeze the payment amount.
[0027] Optionally, the payment platform sends a collection instruction to the interconnection platform based on the execution result of the payment smart contract, including:
[0028] The payment platform calls the wallet to make the payment and submits the payment contract data based on the payment result; based on the submission result, it sends a collection instruction to the interconnection platform.
[0029] The payment platform processes the execution results of the payment smart contract based on the target payment outcome, including:
[0030] If the target payment result indicates that the payment has failed, the payment platform executes the second payment smart contract based on the target payment result and the submission result of the payment contract data, and calls the payment wallet to collect the payment. The amount collected is the same as the payment amount corresponding to the payment contract data.
[0031] To achieve the above objectives, according to another aspect of the present invention, a smart contract-based transaction system is provided. The smart contract-based transaction system provided by the present invention includes: a payment platform, an interconnection platform, and a collection platform; wherein,
[0032] The payment platform is configured to: execute the payment smart contract based on the transaction request; send a collection instruction to the interconnection platform based on the execution result of the payment smart contract, which instructs the collection platform; and process the execution result of the payment smart contract based on the target collection result.
[0033] The interconnection platform is configured to: send a payment instruction to the payment platform; and, if the query conditions are met, send a query request to the payment platform regarding the target payment result, and return the target payment result to the payment platform.
[0034] The payment platform is configured to: collect payments according to payment instructions; and, based on query requests, report the target payment results to the interconnection platform.
[0035] Optionally, the interconnection platform is also configured to: if the target payment result is not received within a preset first time period, presume a payment result and send the presumption to the payment platform;
[0036] The payment platform is configured to: determine whether the query conditions are met based on the estimated payment results, and send a query request to the interconnection platform.
[0037] Optionally, the interconnection platform is configured to determine that the query conditions are met if no target payment result is received within a preset second time period.
[0038] Optionally, the payment platform is configured to: if it does not receive feedback from the interconnection platform within a preset third time period, determine that the query conditions are met, and send a query request to the interconnection platform.
[0039] Optionally, the payment platform includes a payment collection device and a payment contract execution device;
[0040] The payment receiving device is configured to: receive payment instructions, send payment instructions to the payment contract execution device; call the payment wallet to receive payments based on the cached results of the payment contract data; and report the target payment result to the interconnection platform based on the processing results of the payment contract data.
[0041] The payment contract execution device is configured to: execute a first payment smart contract according to a payment instruction, obtain and cache payment contract data, and send the cached result to the payment device; and process the payment contract data according to the payment result of the payment wallet, and send the processing result to the payment device.
[0042] Optionally, the payment receiving device is configured to: if it does not receive the processing result from the payment contract execution device within a preset fourth time period, report the payment failure result to the interconnection platform.
[0043] Optionally, the fourth duration may be shorter than the first, second, and / or third durations.
[0044] Optionally, the payment platform is configured to: freeze the payment amount in the payment wallet, execute the payment smart contract according to the freezing result, obtain and cache the payment contract data, and send a collection instruction to the interconnection platform according to the cached result; and, if the target collection result indicates successful collection, make payment according to the frozen payment amount in the payment wallet and submit the cached payment contract data; if the target collection result indicates failed collection, delete the payment contract data and unfreeze the payment amount.
[0045] Optionally, the payment platform is configured to: execute a payment smart contract based on a transaction request, obtain and cache payment contract data; call a payment wallet to make payment based on the cached result, submit payment smart contract data based on the payment result, and send a collection instruction to the interconnection platform based on the submission result; and, if the target collection result indicates that the collection has failed, execute a second collection smart contract based on the target collection result and the submission result of the payment contract data, and call the payment wallet to collect the payment, with the collection amount being the same as the payment amount corresponding to the payment contract data.
[0046] To achieve the above objectives, according to another aspect of the present invention, a server for conducting transactions based on smart contracts is provided. The server for conducting transactions based on smart contracts according to an embodiment of the present invention includes: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement a smart contract-based transaction method according to an embodiment of the present invention.
[0047] To achieve the above objectives, according to another aspect of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium of the present invention stores a computer program thereon, which, when executed by a processor, implements a smart contract-based transaction method according to the present invention.
[0048] One embodiment of the above invention has the following advantages or beneficial effects: In cross-institutional transactions, when the query conditions are met, the interconnection platform sends a query request for the target payment result to the payment platform. The payment platform can then use the interconnection platform to send the target payment result back to the payment platform. The payment platform then processes the execution result of the payment smart contract based on the target payment result. This implements a proactive query mechanism for payment results in cross-institutional transactions, and the payment platform can process the payment data based on the query results, thereby ensuring consistency between the transaction data of the payer and payee. Furthermore, the introduction of a proactive query mechanism enhances the interaction capabilities between the payer and payee in the transaction process, which is beneficial for improving the user experience.
[0049] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description
[0050] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:
[0051] Figure 1 This is a schematic diagram of the main architecture of a smart contract-based transaction system according to an embodiment of the present invention;
[0052] Figure 2This is a schematic diagram illustrating the main steps of a smart contract-based transaction method according to an embodiment of the present invention;
[0053] Figure 3 This is a schematic diagram illustrating the main steps of a transaction method for querying target payment results on a payment platform according to an embodiment of the present invention;
[0054] Figure 4 This is a schematic diagram illustrating the main steps of a transaction method for querying target payment results on an interconnected platform according to an embodiment of the present invention;
[0055] Figure 5 This is a schematic diagram illustrating the main steps of another transaction method for querying target payment results on a payment platform according to an embodiment of the present invention;
[0056] Figure 6 This is a schematic diagram illustrating the main steps of a transaction method for querying target payment results on a payment platform according to an embodiment of the present invention;
[0057] Figure 7 This is a schematic diagram of the main steps of a transaction method with a timeout period set on a payment platform according to an embodiment of the present invention;
[0058] Figure 8 This is a schematic diagram of the main modules of a smart contract-based transaction system according to an embodiment of the present invention;
[0059] Figure 9 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;
[0060] Figure 10 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation
[0061] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0062] It should be noted that, unless otherwise specified, the embodiments of the present invention and the technical features thereof can be combined with each other.
[0063] The main purpose of this invention is to achieve data consistency between the payee and payer in cross-institutional transaction scenarios and to enhance the interaction capabilities between the two parties during the transaction process. Specifically, in cross-institutional transaction scenarios, such as... Figure 1As shown, the payment platform and the collection platform correspond to different institutions, and they communicate through an interconnection platform. For example, the collection platform and the payment platform correspond to different bank back-end systems, or they correspond to different payment institutions. Figure 2 This invention illustrates a smart contract-based transaction method according to an embodiment of the present invention, such as... Figure 2 As shown, this trading method mainly includes the following steps:
[0064] Step S201: The payment platform executes the payment smart contract based on the transaction request.
[0065] In this embodiment of the invention, a smart contract refers to a business agreement in the form of computer code that sets predetermined conditions, business logic and supporting execution mechanisms within a digital currency system. It can realize the automated execution of digital currency payment business when the preset conditions are met, and has characteristics such as consistency, verifiability and self-enforcement.
[0066] The payment platform can establish a communication connection with user terminals via the network to receive transaction requests initiated by the user terminals. The transaction request includes a payee identifier and a payer identifier. After receiving the transaction request, the payment platform can execute the corresponding payment smart contract based on the payer identifier, and realize the payment from the payment wallet according to the execution result of the payment smart contract.
[0067] Step S202: Based on the execution result of the payment smart contract, the payment platform sends a payment collection instruction to the interconnection platform, which instructs the payment collection platform.
[0068] The payment platform's collection instruction carries the recipient's identifier, which instructs the collection platform to send the collection instruction to the corresponding collection platform.
[0069] Step S203: The interconnection platform sends a payment instruction to the payment platform, and the payment platform collects the payment according to the payment instruction.
[0070] Step S204: If the query conditions are met, the interconnection platform sends a query request to the payment platform regarding the target payment result.
[0071] In this embodiment of the invention, the query request can be initiated by either the payment platform or the interconnection platform. Correspondingly, the step of determining whether the query conditions are met can be executed by either the payment platform or the interconnection platform.
[0072] In one embodiment of the present invention, if the interconnection platform does not receive the target payment result within a preset first time period, it presumes the payment result of the payment platform and sends the presumed payment result to the payment platform. Based on the presumed payment result, the payment platform determines that the query conditions are met and sends a query request to the interconnection platform. That is, when the payment platform receives the presumed payment result from the interconnection platform, the payment platform determines that the query conditions are met, then initiates a query request, which is forwarded by the interconnection platform to the payment platform to query the target payment result. For example, the target payment result sent by the payment platform to the interconnection platform may be lost due to network failure or device congestion, resulting in the interconnection platform failing to receive the target payment result within the first time period. In this case, the interconnection platform can send the presumed payment result to the payment platform. The interconnection platform can use any existing presumption logic to obtain the presumed payment result; this embodiment of the present invention does not limit this.
[0073] In another embodiment of the present invention, if the interconnection platform does not receive the target payment result within a preset second time period, it determines that the query conditions are met. That is, in this embodiment, if the interconnection platform does not receive the target payment result within the second time period, it directly sends a query request to the payment platform to obtain the target payment result from the payment recipient. Subsequently, the interconnection platform can directly send the target payment result to the payer platform. Before the payer platform receives the target payment result, it can also initiate a query request to the interconnection platform as needed. In other words, in this embodiment, the interconnection platform maintains the transaction status, and the payment platform can query the transaction status from the interconnection platform as needed.
[0074] Furthermore, feedback information sent by the interoperability platform to the payment platform (such as estimated or target payment results) may be lost due to network failures or equipment congestion, resulting in the payment platform failing to receive feedback information from the interoperability platform within a third time period. In this case, the payment platform can send a query request to the interoperability platform. That is, if the payment platform, after sending a payment instruction to the interoperability platform, does not receive either the estimated or target payment result forwarded by the interoperability platform within a third time period, the payment platform determines that the query conditions are met and initiates a query request to the interoperability platform.
[0075] In the three implementations described above, the first, second, and third durations can be set to the same value or different values. For example, the first, second, and third durations can all be set to 7 seconds to meet the requirements for transaction response time in typical transaction scenarios, avoiding excessive waiting time for users during transactions and thus improving user experience. Specifically, the starting recording time for the first and second durations can be the time when the interconnection platform sends a payment instruction to the payment platform, or the time when the interconnection platform receives a payment instruction from the payment platform; the starting recording time for the third duration can be the time when the payment platform sends a payment instruction to the interconnection platform.
[0076] Step S205: The receiving platform, based on the query request, sends the target payment result back to the interconnection platform, which then sends the target payment result back to the payment platform.
[0077] Step S206: The payment platform processes the execution result of the payment smart contract based on the target payment result.
[0078] Understandably, the target payment result represents the final state of the payment platform's receipt of funds, indicating whether the platform successfully or failed to receive payment during this transaction. Upon receiving this target payment result, the payment platform can process the execution result of the payment smart contract accordingly, based on whether the payment was successful or failed.
[0079] In this embodiment of the invention, to maintain data consistency between the payer and payee, the payment platform can first freeze the payment amount in its payment wallet, then execute the payment smart contract based on the freezing result, obtain and cache the payment contract data, instead of directly making payment or submitting the payment contract data. In this case, the execution result of the payment smart contract can be the cached result of the payment contract data. That is, after executing the payment smart contract, the payment platform obtains and caches the payment contract data, and then sends a collection instruction to the interconnection platform based on the cached result of the payment contract data. After the payment platform receives the target collection result from the receiving platform, if the target collection result indicates successful collection, the payment platform makes payment based on the frozen payment amount in its payment wallet to ensure successful payment, and submits the cached payment contract data; if the target collection result indicates failed collection, the payment contract data is deleted, and the payment amount in the payment wallet is unfrozen. This avoids the problem of data inconsistency caused by the receiving platform failing to collect payment after the payment platform submits the payment contract data, and also avoids the possibility that the payment platform cannot make payment after the receiving platform successfully collects payment by freezing the payment amount, thereby ensuring that the transaction data of the payer and payee are consistent. Specifically, the payment platform may include a payment device and a payment contract execution device. The payment device can communicate with the user terminal and the interconnection platform, and invoke the payment wallet to make payments. The payment contract execution device is responsible for providing the contract execution environment and executing the smart contract and processing the contract data within that environment. In this embodiment, after receiving a transaction request from the user terminal, the payment device can freeze the payment amount in the payment wallet and trigger the payment contract execution device to execute the payment smart contract. The payment contract execution device caches the payment contract data and returns the cached result to the payment device. The payment device can then generate and send a collection instruction to the interconnection platform based on the cached result. Subsequently, the payment device can receive a presumed collection result or a target collection result from the interconnection platform. Upon receiving the presumed collection result, the payment device sends a query request to the interconnection platform to obtain the target collection result from the collection platform. Upon receiving the target collection result, the payment device parses the target collection result to obtain the status of successful or failed collection. If payment is successfully received, the payment device makes payment according to the frozen amount and notifies the payment contract execution device to submit the cached payment contract data. Then, based on the submission result, the transaction status (transaction successful) is recorded. The steps of the payment device making payment based on the frozen amount and notifying the payment contract execution device to submit data can be performed simultaneously or sequentially. Preferably, the payment device first makes payment based on the frozen amount, and only after confirming successful payment does it notify the payment contract execution device to submit the payment contract data, ensuring data consistency within the payment platform. If payment fails, the payment device unfreezes the payment amount and notifies the payment contract execution device to delete the payment contract data. Then, based on the deletion result, the transaction status (transaction failed) is recorded, thereby achieving data consistency between the payer and payee.
[0080] In another embodiment of the present invention, after receiving a transaction request, the payment platform can execute a payment smart contract according to the transaction request, obtain and cache payment contract data; call the wallet to make payment according to the cached result, and submit the payment contract data according to the payment result. In this case, the execution result of the payment smart contract is the submission result of the payment contract data, and the payment platform can send a collection instruction to the interconnection platform according to the submission result. Subsequently, the payment platform can perform corresponding processing according to the target collection result of the collection platform sent by the interconnection platform. If the target collection result indicates successful collection, the paying platform can directly record the transaction status (transaction successful) according to the submission result of the payment contract data; if the target collection result indicates failed collection, the payment platform can re-initiate the collection process to realize the "reversal" of the payment process. Specifically, if the target collection result indicates failed collection, the payment platform executes a second collection smart contract according to the target collection result and the submission result of the payment contract data, and calls the payment wallet to collect the payment, with the collection amount being the same as the payment amount corresponding to the payment contract data. Exemplarily, the payment and "reversal" process of the payment platform can also be implemented through a payment device and a payment contract execution device. After receiving a transaction request from a user terminal, the payment device can trigger the payment contract execution device to execute the payment smart contract. The payment contract execution device first caches the payment contract data and returns the cached result to the payment device. The payment device can then use this cached result to call the payment wallet to make the payment. After successful deduction from the payment wallet, the payment contract execution device is triggered to submit the cached payment contract data. The payment contract execution device returns the submission result to the payment device, which can then send a collection instruction to the interconnection platform based on this submission result. Subsequently, the payment device can receive a presumed collection result or a target collection result from the interconnection platform. Upon receiving the presumed collection result, the payment device sends a query request to the interconnection platform to obtain the target collection result from the collection platform. Upon receiving the target collection result, the payment device parses the target collection result to obtain the status of successful or failed collection. If the payment is successful, the payment device directly records the transaction status (transaction successful). If the payment fails, the payment device triggers the payment contract execution device to execute the second payment smart contract. After executing the second payment smart contract, the payment contract execution device first caches the corresponding payment contract data and sends the cached result to the payment device. The payment device calls the payment wallet to collect the payment based on the cached result. The amount collected is the same as the payment amount corresponding to the previously executed payment contract data. After the payment is successful, the payment device triggers the payment contract execution device to submit its cached payment contract data, thereby achieving data consistency on the payment platform and ensuring data consistency within the payment platform.
[0081] In another embodiment of the present invention, similar to the payment platform, the collection platform also includes a collection device and a collection contract execution device. The collection device can communicate with the interconnection platform and call the collection wallet to collect payments. The collection contract execution device is responsible for providing a contract execution environment and executing smart contracts and processing contract data within that environment. In this embodiment, the collection device receives a collection instruction sent by the interconnection platform and sends the instruction to the collection contract execution device to trigger the execution device to execute the corresponding first collection smart contract according to the instruction, obtain and cache the collection contract data, and return the cached result to the collection device. The collection device can call the collection wallet to collect payments based on the cached result of the collection contract data and send the result to the collection contract execution device, allowing the execution device to process the collection contract data based on the result. For example, if the payment result indicates successful payment, the payment contract execution device submits its cached payment contract data and returns the submission result to the payment device, allowing the payment device to determine the target payment result as successful based on the submission result and send the target payment result to the interconnection platform. If the payment result sent by the payment device to the payment contract execution device indicates payment failure, the payment contract execution device deletes its cached payment contract data and returns the deletion result to the payment device, allowing the payment device to determine the target payment result as failed based on the deletion result and send the target payment result to the interconnection platform. Furthermore, the payment contract execution device may fail to process the payment smart contract, cache payment contract data, or submit payment contract data due to process or network anomalies. In this case, the payment contract execution device can directly return the processing failure result to the payment device, which then returns the failed target payment result to the interconnection platform based on the processing failure result.
[0082] It is worth noting that, under normal circumstances, the payment receiving device and the payment contract execution device can maintain a communication connection for message exchange. However, in cases of network failure or abnormal processing by the payment contract execution device, the payment contract execution device may be unable to promptly provide feedback on the processing results (such as payment contract data caching results, submission results, etc.) to the payment receiving device. In other words, in this situation, the payment receiving device cannot obtain the processing results from the payment contract execution device in a timely manner, which may reduce the timeliness of the payment receiving device sending the target payment result to the interconnection platform. To solve this problem, in one embodiment of the present invention, a fourth time period is configured in the payment receiving device. If the payment receiving device does not receive feedback on the processing results from the payment contract execution device within the preset fourth time period, the payment receiving device reports the payment failure result (i.e., the target payment result) to the interconnection platform, so that the interconnection platform can promptly report the corresponding target payment result to the payment platform. The situations in which the payment receiving device does not receive the processing results include: the payment receiving device does not receive the cached results, submission results, or deletion results of the payment smart contract. In other words, if the payment receiving device does not receive the cached, submitted, or deleted results of the payment contract data from the payment contract execution device within the fourth time period, it can report the target payment result indicating payment failure to the interconnection platform to improve the response efficiency during the transaction process. The fourth time period is configured to be the same as or less than the first, second, and / or third time periods in the aforementioned embodiments, ensuring that the target payment result is determined when the payment platform receives the query request, thereby reducing transaction waiting time. It is worth noting that in one embodiment of the present invention, the fourth time period is less than the first, second, and / or third time periods in the aforementioned embodiments. For example, if the first, second, and third time periods are configured to be 7 seconds, the fourth time period can be configured to be 300 ms to ensure that the transaction reaches its final state within a normal time, enabling the payment platform to obtain the target payment result in a timely manner. This ensures that both the payer and payee can reach an agreement on the final transaction state within a normal time and notify the user accordingly, thereby improving the user experience.
[0083] The transaction method provided by the embodiments of the present invention will be further illustrated below through two specific examples.
[0084] Example 1
[0085] In this embodiment, after receiving the target payment result from the receiving platform B, payment platform A calls its payment wallet to make the payment. Furthermore, when payment platform A receives the estimated payment result from the interconnection platform, it does not submit payment contract data based on this, but actively queries the receiving platform for the target payment result. The payment platform includes payment device a1 and payment contract execution device a2. Specifically, the transaction method provided in this embodiment of the invention may include, for example... Figure 3The steps shown are as follows:
[0086] Step S301: Payment device a1 obtains a transaction request, which indicates the payer identifier and the payee identifier.
[0087] Step S302: Payment device a1 freezes the payment amount in the payment wallet and sends the freezing result to payment contract execution device a2.
[0088] Step S303: Payment contract execution device a2 executes the payment smart contract, obtains and caches the payment contract data, and sends the cached result to payment device a1.
[0089] Step S304: Payment device a1 sends a payment instruction to the interconnection platform based on the cached result. The payment instruction includes the payee's identifier.
[0090] Step S305: The interconnection platform forwards the payment instruction to the payment platform B based on the payee's identifier, starts timing, and continuously monitors whether the target payment result is received from the payment platform B. If the recording time reaches the first duration t1 and the target payment result is not received, then step S306 is executed. If the target payment result is received before the first recording duration t1, then step S310 is executed.
[0091] Step S306: The interconnection platform sends the presumed payment result to payment device a1.
[0092] Step S307: Payment device a1 sends a query request for the target payment result to the interconnection platform based on the estimated payment result.
[0093] Step S308: The interconnection platform forwards the query request to the payment platform B.
[0094] Step S309: Payment platform B reports the target payment result to the interconnection platform based on the query request.
[0095] Step S310: The interconnection platform sends the target payment result to the payment device a1.
[0096] Step S311: Payment device a1 determines whether the payment is successful based on the target payment result. If the payment is successful, step S312 is executed; if the payment fails, step S313 is executed.
[0097] Step S312: Payment device a1 makes payment based on the frozen payment amount, and based on the successful payment result, triggers payment contract execution device a2 to submit payment contract data.
[0098] Step S313: Payment device a1 unfreezes the payment amount and triggers payment contract execution device a2 to delete the payment contract data based on the unfreezing result.
[0099] Example 2
[0100] In this embodiment, payment platform C can execute a complete payment process based on a transaction request. After receiving the target payment result from collection platform D, if the target payment result indicates payment failure, the payment process is then executed again to recover the payment amount, thereby maintaining data consistency between the payer and payee. The payment platform includes a payment device c1 and a payment contract execution device c2. Specifically, the transaction method provided in this embodiment of the invention may include, for example... Figure 4 The steps shown are as follows:
[0101] Step S401: Payment device c1 obtains a transaction request that indicates the payer identifier and the payee identifier.
[0102] Step S402: Payment device c1 sends the transaction request to payment contract execution device c2.
[0103] Step S403: Payment contract execution device c2 executes the payment smart contract, obtains and caches the payment contract data, and sends the cached result to payment device c1.
[0104] Step S404: Payment device c1 calls the payment wallet to make payment based on the cached result and sends the successful payment result to payment contract execution device c2.
[0105] Step S405: Payment contract execution device c2 submits the cached payment contract data and sends the submission result to payment device c1.
[0106] Step S406: Payment device c1 generates and sends a payment instruction to the interconnection platform based on the submission result. The payment instruction includes the payee's identifier.
[0107] Step S407: The interconnection platform forwards the payment instruction to the payment platform D based on the payee's identifier, starts timing, and continuously listens for whether the target payment result is received from the payment platform D. If the recorded time reaches the second duration t2 and the target payment result is not received, then step S408 is executed. If the target payment result is received before the recorded second duration t2, then step S410 is executed.
[0108] Step S408: The interconnection platform generates and sends a query request for the target payment result to the payment collection platform D.
[0109] Step S409: The payment platform D sends the target payment result back to the interconnection platform based on the query request.
[0110] Step S410: The interconnection platform sends the target payment result to the payment device c1.
[0111] Step S411: Payment device c1 determines whether the payment is successful based on the target payment result. If the payment is successful, step S412 is executed; if the payment fails, step S413 is executed.
[0112] Step S412: Payment device c1 records the status of a successful transaction.
[0113] Step S413: Payment device c1 sends the target payment result to payment contract execution device c2.
[0114] Step S414: Payment contract execution device c2 executes the second payment smart contract, obtains and caches the payment contract data, and sends the cached result to payment device c1.
[0115] Step S415: Payment device c1 calls the payment wallet to receive payment based on the cached result and sends the receipt result to payment contract execution device c2.
[0116] In this step, the amount received is the same as the amount paid in step S404.
[0117] Step S416: The payment contract execution device c2 submits the cached payment contract data based on the payment result and sends the submission result to the payment device c1.
[0118] Step S417: Payment device c1 records the transaction as failed based on the submission result.
[0119] Example 3
[0120] In this embodiment, a third time period t3 is configured in payment platform E. If payment platform E has not received a result (such as a presumed result or a target payment result) from the interconnection platform after the recorded time period t3, it can proactively initiate a query request to payment platform F through the interconnection platform. Furthermore, payment platform E does not submit payment contract data before receiving the target payment result; it only submits the payment contract data after receiving the target payment result indicating successful payment. Specifically, the transaction method provided in this embodiment mainly includes, as follows: Figure 5 The steps shown are as follows:
[0121] Step S501: Payment device e1 obtains a transaction request that indicates the payer identifier and the payee identifier.
[0122] Step S502: Payment device e1 freezes the payment amount in the payment wallet according to the transaction request and sends the transaction request to payment contract execution device e2.
[0123] Step S503: Payment contract execution device e2 executes the payment smart contract, obtains and caches the payment contract data, and sends the cached result to payment device e1.
[0124] Step S504: The payment device e1 sends a payment instruction to the interconnection platform according to the cached result, starts timing, and continuously listens for feedback information received from the interconnection platform. If the recording time reaches the third duration t3 and no feedback information is received, then step S506 is executed. If feedback information is received before the third recording duration t3, then step S510 is executed.
[0125] This feedback information may include the presumed payment result from the interconnection platform, or the target payment result from the payment platform forwarded by the interconnection platform. It is understood that if payment device e1 receives the presumed payment result from the interconnection platform before the third time interval, it can initiate a query request based on the presumed payment result, and the subsequent process will be the same as... Figure 3 The processes of steps S306-S312 are basically the same and will not be described again here. This embodiment three uses the feedback information received by the payment platform within the third time period as the target payment result (step S509) as an example for explanation.
[0126] Step S505: The interconnection platform forwards the payment instruction to the payment platform F based on the payee's identifier.
[0127] In this embodiment of the invention, the execution order of steps S504 and S505 is not important.
[0128] Step S506: The payment platform sends a query request to the interconnection platform regarding the target payment result.
[0129] Step S507: The interconnection platform forwards the query request to the payment platform F.
[0130] Step S508: The payment platform F reports the target payment result to the interconnection platform based on the query request.
[0131] Step S509: The interconnection platform sends the target payment result to the payment device e1.
[0132] Step S510: The payment device e1 determines whether the payment is successful based on the target payment result. If the payment is successful, step S511 is executed; if the payment fails, step S512 is executed.
[0133] Step S511: Payment device e1 makes payment based on the frozen payment amount, and based on the successful payment result, triggers payment contract execution device e2 to submit payment contract data.
[0134] Step S512: Payment device e1 unfreezes the payment amount and triggers payment contract execution device e2 to delete the payment contract data based on the unfreezing result.
[0135] Example 4
[0136] In this embodiment, a third time interval t3 is configured in the payment platform G. If the payment platform does not receive a result (such as a presumed result or a target payment result) from the interconnection platform after the recorded time interval t3, it can proactively initiate a query request to the collection platform H through the interconnection platform. Furthermore, the payment platform G can execute the complete payment process according to the transaction request. After receiving the target payment result from the collection platform H, if the target payment result indicates payment failure, the collection process is then executed again to recover the payment amount. Specifically, the transaction method provided in this embodiment mainly includes, as follows: Figure 6 The steps shown are as follows:
[0137] Step S601: Payment device g1 obtains a transaction request that indicates the payer identifier and the payee identifier.
[0138] Step S602: Payment device g1 sends the transaction request to payment contract execution device g2.
[0139] Step S603: Payment contract execution device g2 executes the payment smart contract, obtains and caches the payment contract data, and sends the cached result to payment device g1.
[0140] Step S604: Payment device g1 calls the payment wallet to make payment based on the cached result and sends the successful payment result to payment contract execution device g2.
[0141] Step S605: Payment contract execution device g2 submits the cached payment contract data and sends the submission result to payment device g1.
[0142] Step S606: Payment device g1 generates and sends a payment instruction to the interconnection platform based on the submission result. The payment instruction includes the payee's identifier.
[0143] Step S607: Payment device g1 starts timing and continuously listens for feedback information received from the interconnection platform. If the recording time reaches the third duration t3 and no feedback information is received, then step S609 is executed.
[0144] The feedback information may include the payment result presumed by the interconnection platform, or the target payment result forwarded by the interconnection platform from the payment platform. It is understood that if payment device g1 receives the target payment result from the interconnection platform before the third time interval, it can perform subsequent processing based on the success or failure status indicated by the target payment result. This subsequent processing is related to... Figure 4 The processes in steps S410-S417 are essentially the same and will not be repeated here. If the feedback information received by the payment platform within the third time period is the payment result presumed by the interconnection platform, it can initiate a query request to the interconnection platform based on the presumed payment result. The subsequent processing is the same as... Figure 4 The processes of steps S408-S417 shown are basically the same, and will not be repeated in this embodiment.
[0145] Step S608: The interconnection platform forwards the payment instruction to the payment platform F based on the payee's identifier.
[0146] In this embodiment of the invention, the execution order of steps S607 and S608 is not important.
[0147] Step S609: The payment platform sends a query request to the interconnection platform regarding the target payment result.
[0148] Step S610: The interconnection platform forwards the query request to the payment platform H.
[0149] Step S611: The payment platform H sends the target payment result back to the interconnection platform based on the query request.
[0150] Step S612: The interconnection platform sends the target payment result to the payment device g1.
[0151] Step S613: The payment device g1 determines whether the payment is successful based on the target payment result. If the payment is successful, step S614 is executed; if the payment fails, step S615 is executed.
[0152] Step S614: Payment device g1 records the status of a successful transaction.
[0153] Step S615: Payment device c1 sends the target payment result to payment contract execution device c2.
[0154] Step S616: Payment contract execution device g2 executes the second payment smart contract, obtains and caches the payment contract data, and sends the cached result to payment device g1.
[0155] Step S617: Payment device g1 calls the payment wallet to receive payment based on the cached result and sends the receipt result to payment contract execution device g2.
[0156] In this step, the amount received is the same as the amount paid in step S604.
[0157] Step S618: The payment contract execution device g2 submits the cached payment contract data based on the payment result and sends the submission result to the payment device g1.
[0158] Step S619: Payment device g1 records the transaction as failed based on the submission result.
[0159] Example 5
[0160] In this embodiment, a fourth time period t4 is configured in the payment platform K. If the payment device k1 in the payment platform K does not receive the processing result from the payment contract device k2 in the payment platform K within the fourth time period t4, the payment device k1 can send a payment failure result to the interconnection platform. The fourth time period t4 is shorter than the first time period t1, the second time period t2, and the third time period t3 in the above embodiments. This ensures that when the interconnection platform or the payment platform sends a query request, the payment platform K has already determined the target payment result, and can respond promptly to the query of the payment platform or the interconnection platform regarding the final state of the transaction. This ensures that both the payer and payee can reach an agreement on the final transaction state within a valid time and notify the user accordingly, improving the user experience. It is understood that in this embodiment of the invention, the payment platform J can adopt any of the payment methods provided in the above embodiments—calling the wallet to pay only after receiving the target payment result or executing the complete payment process according to the transaction request. This embodiment will not elaborate on the payment process. Furthermore, both the interconnection platform and the payment platform can initiate a query request when the query conditions are met. For example, the payment platform can initiate a query request if it receives a presumed payment result from the interconnection platform, or if it fails to receive feedback from the interconnection platform within the third time period t3; or if the interconnection platform does not receive the target payment result within the second time period t2, it can also initiate a query request. This embodiment uses the example of the payment platform initiating a query request upon receiving a presumed payment result to illustrate the transaction method provided by this invention. Figure 7 As shown, this trading method includes the following steps:
[0161] Step S701: Based on the successful payment result, payment platform J sends a collection instruction to the interconnection platform, which includes the recipient's identifier.
[0162] Step S702: The interconnection platform forwards the payment instruction to the payment device k1 according to the payee's identifier, starts timing, and continuously listens for whether the target payment result is received from the payment device k1. If the recording time reaches the first duration t1 and the target payment result is not received, then step S708 is executed. If the target payment result is received before the first recording duration t1, then step S712 is executed.
[0163] Step S703: The receiving device k1 sends the receiving instruction to the receiving contract execution device k2 and starts timing, and continuously listens for whether it receives the processing result from the receiving contract execution device k2. If the recording time reaches the fourth duration t4 and no processing result is received, then step S707 is executed. If the processing result is received before the recording time reaches the fourth duration t4, then step S705 is executed.
[0164] Step S704: The payment contract execution device k2 executes the first payment smart contract, obtains and caches the payment contract data, and sends the cached result to the payment device k1.
[0165] In this step, if the payment contract execution device k2 encounters an anomaly during contract execution, or if the payment contract execution device k2 encounters an anomaly during the sending of cached results, the payment device k1 may not receive the processing result (cached result of payment contract data) within the fourth time period t4. It is also understood that the execution order of this step S704 and step S703 is not sequential.
[0166] Step S705: The receiving device k1 calls the receiving wallet to receive payment based on the cached result, sends the receiving result to the receiving contract execution device k2, and starts timing. It continuously listens for whether it receives the processing result from the receiving contract execution device k2. If the recorded time reaches the fourth duration t4 and no processing result is received, then step S707 is executed.
[0167] It is understandable that if the payment receiving device k1 receives the processing result before the fourth recording time t4, it can send the target payment result (indicating successful or unsuccessful payment) to the interconnection platform based on the processing result. This embodiment mainly describes the situation where the payment receiving device k1 fails to receive the processing result in time, so the normal payment receiving process of the payment platform K will not be described in detail.
[0168] Step S706: The payment contract execution device k2 submits the payment contract data based on the payment result and sends the submission result to the payment device k1.
[0169] In this step, if the payment contract execution device k2 encounters an anomaly during the submission of payment contract data, or if the payment contract execution device k2 encounters an anomaly during the sending of the submission result, the payment device k1 may not receive the processing result (the submission result of the payment contract data) within the fourth time period t4. It is also understood that the execution order of steps S706 and S705 is not important.
[0170] Step S707: The payment receiving device k1 sends the target payment result of the failed payment to the interconnection platform.
[0171] During the process of the payment receiving device k1 sending the target payment result to the interconnection platform, the interconnection platform may fail to receive the target payment result due to network abnormalities or other reasons.
[0172] Step S708: The interconnection platform estimates the payment result and sends the estimated payment result to the payment platform J.
[0173] Step S709: Based on the estimated payment result, payment platform J sends a query request regarding the target payment result to the interconnection platform.
[0174] Step S710: The interconnection platform forwards the query request to the payment device k1.
[0175] Step S711: The payment receiving device k1 sends the target payment result back to the interconnection platform based on the query request.
[0176] Step S712: The interconnection platform sends the target payment result to the payment platform J.
[0177] Step S713: Payment platform J determines that the payment has failed based on the target payment result and records the transaction as failed.
[0178] According to the above embodiments, a proactive query mechanism for payment results is implemented in cross-institutional transactions. The payment platform can process the payment data based on the query results, thereby ensuring consistency between the transaction data of the payer and payee. Furthermore, the introduction of the proactive query mechanism enhances the interaction capabilities of the payer and payee in abnormal situations during the transaction process, which is beneficial to improving user experience. Further, by setting a timeout period (fourth duration) on the payment platform, the transaction is guaranteed to reach its final state within a normal timeframe. This also supports timely responses from the payment platform or interconnected platforms to queries regarding the final transaction state, enabling the payment platform to obtain the target payment result promptly. This ensures that both the payer and payee can reach an agreement on the final transaction status within a valid timeframe and notify the user accordingly, further improving user experience.
[0179] Based on the same inventive concept as the above embodiments, this invention also provides a smart contract-based transaction system, such as... Figure 8 As shown, the transaction system 800 may include: a payment platform 801, an interconnection platform 802, and a collection platform 803; wherein,
[0180] Payment platform 801 is configured to: execute a payment smart contract based on a transaction request; send a collection instruction to the interconnection platform 802 based on the execution result of the payment smart contract, the collection instruction instructing the collection platform; and process the execution result of the payment smart contract based on the target collection result.
[0181] The interconnection platform 802 is configured to: send a payment instruction to the payment platform 803; and, if the query conditions are met, send a query request to the payment platform 803 regarding the target payment result, and return the target payment result to the payment platform 801.
[0182] The payment platform 803 is configured to: collect payments according to payment instructions; and, based on query requests, report the target payment results to the interconnection platform 802.
[0183] In one embodiment of the present invention, the interconnection platform 802 is configured to: if the target payment result is not received within a preset first time period, presume the payment result and send the presumption of the payment result to the payment platform 801;
[0184] The payment platform 801 is configured to: determine whether the query conditions are met based on the estimated payment results, and send the query request to the interconnection platform 802.
[0185] In one embodiment of the present invention, the interconnection platform 802 is configured to: determine that the query conditions are met if the target payment result is not received within a preset second time period.
[0186] In one embodiment of the present invention, the payment platform 801 is configured to: if it does not receive feedback information from the interconnection platform 802 within a preset third time period, determine that the query conditions are met, and send a query request to the interconnection platform 802.
[0187] In one embodiment of the present invention, the payment platform 803 includes a payment collection device and a payment contract execution device;
[0188] The payment receiving device is configured to: receive payment instructions, send payment instructions to the payment contract execution device, and call the payment wallet to receive payments based on the cached results of the payment contract data; and report the target payment result to the interconnection platform based on the processing results of the payment contract data.
[0189] The payment contract execution device is configured to: execute a first payment smart contract according to a payment instruction, obtain and cache payment contract data, and send the cached result to the payment device; and process the payment contract data according to the payment result of the payment wallet, and send the processing result to the payment device.
[0190] In one embodiment of the present invention, the payment receiving device is further configured to: if it does not receive the processing result from the payment contract execution device within a preset fourth time period, report the payment failure result to the interconnection platform 802.
[0191] In one embodiment of the present invention, the fourth duration is less than the first duration, the second duration, and / or the third duration.
[0192] In one embodiment of the present invention, the payment platform 801 is configured to: freeze the payment amount in the payment wallet, execute the payment smart contract according to the freezing result, obtain and cache the payment contract data, and send a collection instruction to the interconnection platform 802 according to the cached result; if the target collection result indicates successful collection, make payment according to the frozen payment amount in the payment wallet and submit the cached payment contract data; if the target collection result indicates failed collection, delete the payment contract data and unfreeze the payment amount.
[0193] In one embodiment of the present invention, the payment platform 801 is configured to: execute a payment smart contract according to a transaction request, obtain and cache payment contract data; call a payment wallet to make payment according to the cached result, submit the payment contract data according to the payment result, and send a collection instruction to the interconnection platform according to the submission result; and, if the target collection result indicates that the collection has failed, execute a second collection smart contract according to the target collection result and the submission result of the payment contract data, and call the payment wallet to collect the payment, wherein the collection amount is the same as the payment amount corresponding to the payment contract data.
[0194] As can be seen from the smart contract-based transaction system provided in the above embodiments, an active query mechanism for payment results is implemented during cross-institutional transactions. The payment platform can process the payment data based on the query results, thereby ensuring consistency between the transaction data of the payer and payee. Furthermore, the introduction of the active query mechanism enhances the interaction capabilities of the payer and payee in abnormal situations during the transaction process, which is beneficial to improving user experience. Further, by setting a timeout period (fourth duration) on the payment platform, the transaction is guaranteed to reach its final state within a normal timeframe, and the system supports timely responses from the payment platform or interconnected platforms to queries regarding the final transaction state. This allows the payment platform to obtain the target payment result promptly, ensuring that both the payer and payee can reach an agreement on the final transaction state within a valid timeframe and notify the user accordingly, further enhancing user experience.
[0195] Figure 9 An exemplary system architecture 900 is shown, which can be applied to the smart contract-based transaction method or smart contract-based transaction system of the present invention.
[0196] like Figure 9As shown, the system architecture 900 may include terminal devices 901, 902, and 903, a network 904, and servers 905, 906, and 907. Network 904 serves as the medium for providing communication links between terminal devices 901, 902, and 903 and servers 905, 906, and 907. Network 904 may include various connection types, such as wired or wireless communication links or fiber optic cables. Servers 905, 906, and 907 may correspond to a payment platform, an interconnection platform, and a collection platform, respectively. Users can use terminal devices 901, 902, and 903 to interact with server 905 through network 904 to initiate transaction requests or receive transaction status. Various client applications may be installed on terminal devices 901, 902, and 903, such as shopping applications, payment applications, instant messaging tools, and social media platform software.
[0197] Terminal devices 901, 902, and 903 can be various electronic devices with displays that support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0198] It should be understood that Figure 9 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0199] The following is for reference. Figure 10 It shows a schematic diagram of the structure of a computer system 1000 suitable for implementing a terminal device of the present invention. Figure 10 The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0200] like Figure 10 As shown, the computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage section 1008 into a random access memory (RAM) 1003. The RAM 1003 also stores various programs and data required for the operation of the system 1000. The CPU 1001, ROM 1002, and RAM 1003 are interconnected via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0201] The following components are connected to I / O interface 1005: an input section 1006 including a keyboard, mouse, etc.; an output section 1007 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to I / O interface 1005 as needed. A removable medium 1011, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 1010 as needed so that computer programs read from it can be installed into storage section 1008 as needed.
[0202] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1009, and / or installed from removable medium 1011. When the computer program is executed by central processing unit (CPU) 1001, it performs the functions defined in the system of this invention.
[0203] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0204] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0205] The modules described in the embodiments of the present invention can be implemented in software or hardware. The described system can also be located in a processor; for example, it can be described as: a processor including a payment platform, an interconnection platform, and a collection platform. The names of these systems do not necessarily limit the system itself; for example, a payment platform can also be described as "a platform that makes payments based on transaction requests."
[0206] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to include: a payment platform executing a payment smart contract according to a transaction request; the payment platform sending a collection instruction to an interconnection platform based on the execution result of the payment smart contract, the collection instruction instructing the collection platform; the interconnection platform sending a collection instruction to the collection platform, the collection platform collecting payment according to the collection instruction; if query conditions are met, the interconnection platform sending a query request to the collection platform regarding a target collection result; the payment platform feeding back the target collection result to the interconnection platform based on the query request, the interconnection platform feeding back the target collection result to the payment platform; and the payment platform processing the execution result of the payment smart contract based on the target collection result.
[0207] According to the technical solution of this invention, an active query mechanism for payment results is implemented in cross-institutional transactions. The payment platform can process the payment data based on the query results, thereby ensuring consistency between the transaction data of the payer and payee. Furthermore, the introduction of the active query mechanism enhances the interaction capabilities of the payer and payee in abnormal situations during the transaction process, which is beneficial to improving user experience. Further, by setting a timeout period (fourth duration) on the payment platform, the transaction is guaranteed to reach its final state within a normal timeframe, and the payment platform or interconnected platform can respond promptly to the transaction final state query. This allows the payment platform to obtain the target payment result in a timely manner, ensuring that the payer and payee can reach an agreement on the final transaction status within a valid timeframe and notify the user accordingly, further improving user experience.
[0208] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A transaction method based on smart contracts, characterized in that, include: The payment platform executes the payment smart contract based on the transaction request; The payment platform sends a payment collection instruction to the interconnection platform based on the execution result of the payment smart contract, and the payment collection instruction instructs the payment collection platform. The interconnection platform sends the payment instruction to the payment platform, and the payment platform collects payment according to the payment instruction; If the query conditions are met, the interconnection platform sends a query request to the payment platform regarding the target payment result; The payment platform, based on the query request, sends the target payment result back to the interconnection platform, and the interconnection platform sends the target payment result back to the payment platform. The payment platform processes the execution result of the payment smart contract based on the target payment result.
2. The transaction method according to claim 1, characterized in that, Before the interconnection platform sends a query request regarding the target payment result to the payment platform, it also includes: If the interconnection platform does not receive the target payment result within a preset first time period, it presumes the payment result and sends the presumed payment result to the payment platform; the payment platform determines that the query conditions are met based on the presumed payment result and sends the query request to the interconnection platform.
3. The transaction method according to claim 1, characterized in that, Before the interconnection platform sends a query request regarding the target payment result to the payment platform, it also includes: If the interconnection platform does not receive the target payment result within a preset second time period, it determines that the query conditions are met. And / or, If the payment platform does not receive feedback from the interconnection platform within a preset third time period, it determines that the query conditions are met and sends the query request to the interconnection platform.
4. The transaction method according to claim 2 or 3, characterized in that, The payment platform includes a payment collection device and a payment contract execution device; the payment collection platform collects payments according to the payment instruction, including: The payment receiving device receives the payment instruction and sends the payment instruction to the payment contract execution device, so that the payment contract execution device executes the first payment smart contract according to the payment instruction, obtains and caches the payment contract data, and sends the cached result to the payment receiving device; The payment receiving device calls the payment receiving wallet to receive payment based on the cached result of the payment contract data; The payment contract execution device processes the payment contract data according to the payment result of the payment wallet and sends the processing result to the payment device. The payment receiving device reports the target payment result to the interconnection platform based on the processing result.
5. The transaction method according to claim 4, characterized in that, If the payment receiving device does not receive the processing result from the payment contract execution device within a preset fourth time period, the payment receiving device reports the payment failure result to the interconnection platform.
6. The transaction method according to claim 5, characterized in that, The fourth duration is less than the first duration, the second duration, and / or the third duration.
7. The transaction method according to claim 1, characterized in that, The payment platform sends a payment collection instruction to the interconnection platform based on the execution result of the payment smart contract, including: The payment platform freezes the payment amount in the payment wallet, executes the payment smart contract according to the freezing result, obtains and caches the payment contract data, and sends the payment collection instruction to the interconnection platform according to the caching result. The payment platform processes the execution result of the payment smart contract based on the target payment result, including: If the target payment result indicates successful payment, the payment platform makes payment based on the payment amount frozen in the payment wallet and submits the cached payment contract data; If the target payment result indicates payment failure, delete the payment contract data and unfreeze the payment amount.
8. The transaction method according to claim 1, characterized in that, The payment platform executes a payment smart contract based on a transaction request, and sends a collection instruction to the interconnection platform based on the execution result of the payment smart contract, including: The payment platform executes the payment smart contract according to the transaction request, obtains and caches the payment contract data; calls the payment wallet to make payment according to the cached result, submits the payment smart contract data according to the payment result, and sends the payment collection instruction to the interconnection platform according to the submission result. The payment platform processes the execution result of the payment smart contract based on the target payment result, including: If the target payment result indicates payment failure, the payment platform executes a second payment smart contract based on the target payment result and the submission result of the payment contract data, and calls the payment wallet to collect the payment. The amount collected is the same as the payment amount corresponding to the payment contract data.
9. A transaction system based on smart contracts, characterized in that, include: Payment platforms, interconnection platforms, and collection platforms; among them, The payment platform is configured to: execute a payment smart contract based on a transaction request; send a collection instruction to the interconnection platform based on the execution result of the payment smart contract, the collection instruction instructing the payment platform; and process the execution result of the payment smart contract based on the target collection result. The interconnection platform is configured to: send the payment instruction to the payment platform; and, if the query conditions are met, send a query request to the payment platform regarding the target payment result, and return the target payment result to the payment platform. The payment platform is configured to: collect payments according to the payment instruction; and, according to the query request, send the target payment result back to the interconnection platform.
10. The transaction system according to claim 9, characterized in that, The interconnection platform is also configured to: if the target payment result is not received within a preset first time period, presume a payment result and send the presumptiond payment result to the payment platform; The payment platform is configured to: determine whether the query conditions are met based on the estimated payment result, and send the query request to the interconnection platform.
11. The transaction system according to claim 9, characterized in that, The interconnection platform is configured to: determine that the query conditions are met if the target payment result is not received within a preset second time period; And / or, The payment platform is configured to: if it does not receive feedback information from the interconnection platform within a preset third time period, determine that the query conditions are met, and send the query request to the interconnection platform.
12. The transaction system according to claim 9 or 10, characterized in that, The payment platform includes a payment collection device and a payment contract execution device; The payment receiving device is configured to: receive a payment receiving instruction and send the payment receiving instruction to the payment contract execution device; And, based on the cached results of the payment contract data, call the payment wallet to collect payments; based on the processing results of the payment contract data, report the target payment result to the interconnection platform; The payment contract execution device is configured to: execute a first payment smart contract according to the payment instruction, obtain and cache payment contract data, and send the cached result to the payment device; and process the payment contract data according to the payment result of the payment wallet, and send the processing result to the payment device.
13. The transaction system according to claim 12, characterized in that, The payment receiving device is configured to: if it does not receive the processing result sent by the payment contract execution device within a preset fourth time period, it will report the payment failure result to the interconnection platform.
14. The transaction system according to claim 13, characterized in that, The fourth duration is less than the first duration, the second duration, and / or the third duration.
15. The transaction system according to claim 9, characterized in that, The payment platform is configured to: freeze the payment amount in the payment wallet, execute the payment smart contract according to the freezing result, obtain and cache the payment contract data, and send a payment collection instruction to the interconnection platform according to the caching result. And, if the target payment result indicates successful payment, make payment according to the payment amount frozen in the payment wallet and submit the cached payment contract data; If the target payment result indicates payment failure, delete the payment contract data and unfreeze the payment amount.
16. The transaction system according to claim 9, characterized in that, The payment platform is configured to: execute a payment smart contract according to a transaction request, obtain and cache payment contract data; call a payment wallet to make payment based on the cached result, submit the payment smart contract based on the payment result, and send the payment instruction to the interconnection platform based on the submission result; In addition, if the target payment result indicates payment failure, a second payment smart contract is executed based on the target payment result and the submission result of the payment contract data, and the payment wallet is invoked to collect the payment, with the collection amount being the same as the payment amount corresponding to the payment contract data.
17. A server for conducting transactions based on smart contracts, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the transaction method as described in any one of claims 1-8.
18. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the transaction method as described in any one of claims 1-8.