Processing method, device and equipment for offline transaction

文档序号:487948 发布日期:2022-01-04 浏览:2次 中文

阅读说明:本技术 一种离线交易的处理方法、装置及设备 (Processing method, device and equipment for offline transaction ) 是由 徐登伟 辛知 万小飞 朱丙营 郑显义 崔显军 于 2021-10-28 设计创作,主要内容包括:本说明书实施例公开了一种离线交易的处理方法、装置及设备,所述方法应用于终端设备,所述终端设备设置有可信执行环境,包括:在获取到离线交易场景下的目标交易的交易信息的情况下,将目标交易的交易信息存储于可信执行环境中,并在可信执行环境中生成目标交易的交易状态标记,将目标交易的交易状态标记设置为交易中,在目标交易完成的情况下,将可信执行环境中的目标交易的交易状态标记由交易中设置为交易完成,最终,可以基于目标交易的交易信息和目标交易的交易状态标记的信息对目标交易执行具有预设清算有效期的交易清算处理。(The embodiment of the specification discloses a processing method, a device and equipment for off-line transaction, wherein the method is applied to terminal equipment, the terminal equipment is provided with a trusted execution environment, and the method comprises the following steps: under the condition that the transaction information of the target transaction under the offline transaction scene is acquired, the transaction information of the target transaction is stored in the trusted execution environment, the transaction state mark of the target transaction is generated in the trusted execution environment, the transaction state mark of the target transaction is set to be in the transaction, under the condition that the target transaction is completed, the transaction state mark of the target transaction in the trusted execution environment is set to be in the transaction completion from the transaction, and finally, the transaction clearing processing with the preset clearing validity period can be executed on the target transaction based on the transaction information of the target transaction and the information of the transaction state mark of the target transaction.)

1. A processing method of an offline transaction is applied to a terminal device, the terminal device is provided with a trusted execution environment, and the method comprises the following steps:

under the condition that the transaction information of the target transaction under the offline transaction scene is acquired, storing the transaction information of the target transaction in the trusted execution environment;

generating a transaction state flag of the target transaction in the trusted execution environment, setting the transaction state flag of the target transaction as transaction in progress, and setting the transaction state flag of the target transaction in the trusted execution environment as transaction completion from transaction in progress when the target transaction is completed;

and executing transaction clearing processing with a preset clearing validity period on the target transaction based on the transaction information of the target transaction and the information of the transaction state mark of the target transaction.

2. The method of claim 1, further comprising:

acquiring a transaction completion message of the target transaction provided by the terminal equipment, and acquiring a notification message of the transaction completion of the target transaction provided by the other party of the target transaction;

and if the transaction completion message and the notification message of the target transaction are acquired, determining that the target transaction is completed.

3. The method according to claim 1 or 2, wherein the performing of the transaction clearing process with a preset clearing validity period for the target transaction based on the transaction information of the target transaction and the information of the transaction status flag of the target transaction comprises:

and sending the transaction information of the target transaction and the information of the transaction state mark of the target transaction to enable the transaction information based on the target transaction and the information of the transaction state mark of the target transaction and the preset clearing validity period corresponding to the target transaction to execute transaction clearing processing on the target transaction.

4. The method of claim 3, further comprising:

and if the trusted execution environment of the terminal equipment of the other party of the target transaction is detected to comprise the transaction information of the first transaction of which the transaction state is marked as transaction completion and the transaction clearing processing is not executed to the request, acquiring the transaction information of the first transaction from the terminal equipment of the other party of the target transaction, and sending the transaction information of the first transaction to the target terminal equipment so as to enable the transaction information based on the first transaction to execute the transaction clearing processing on the first transaction.

5. The method of claim 4, the transaction status indicia of the target transaction being provided in transaction information of the target transaction.

6. The method of claim 5, further comprising:

and under the condition of receiving the sent notification message that the transaction clearing processing of the target transaction is completed, logging out the transaction information of the target transaction and the transaction state mark of the target transaction, which are stored in the trusted execution environment.

7. The method of claim 6, the logging out transaction information of the target transaction and a transaction status flag of the target transaction stored in the trusted execution environment upon receiving the sent notification message that the transaction clearing process of the target transaction is complete, comprising:

under the condition that the sent notification message that the transaction clearing processing of the target transaction is completed is received, whether the transaction information of the target transaction stored in the trusted execution environment meets a preset logout condition is judged, wherein the logout condition is constructed based on a storage duration and/or a transaction type corresponding to the target transaction;

and if so, logging off the transaction information of the target transaction and the transaction state mark of the target transaction stored in the trusted execution environment.

8. A processing method of off-line transaction is applied to a server, and the method comprises the following steps:

receiving transaction information of a target transaction and information of a transaction state mark of the target transaction, which are sent by a terminal device, wherein the transaction information of the target transaction and the information of the transaction state mark of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction under an offline transaction scene, the transaction state mark of the target transaction is generated and set as a transaction state mark in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and the transaction state mark of the target transaction in the trusted execution environment is set as transaction completion from the transaction when the target transaction is completed;

and executing transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction, the transaction information of the target transaction, the information of the transaction state mark of the target transaction and the preset clearing validity period corresponding to the target transaction, wherein the information of the transaction party, the transaction information of the target transaction and the information of the transaction state mark of the target transaction belong to the terminal equipment.

9. The method according to claim 8, wherein the executing of the transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction to which the terminal device belongs, the transaction information of the target transaction, and the information of the transaction status flag of the target transaction, and the preset clearing validity period corresponding to the target transaction comprises:

if the transaction party in the target transaction to which the terminal device belongs is a transaction initiator and the transaction state of the target transaction is marked as transaction completion, receiving related information for performing transaction clearing on the target transaction, which is sent by the target party of the target transaction, within the preset clearing validity period;

and if the related information for carrying out transaction clearing on the target transaction, which is sent by the target party of the target transaction, is received within the preset clearing validity period, carrying out transaction clearing processing on the target transaction based on the transaction information of the target transaction and the received related information for carrying out transaction clearing on the target transaction, which is sent by the target party.

10. The method according to claim 8, wherein the executing of the transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction to which the terminal device belongs, the transaction information of the target transaction, and the information of the transaction status flag of the target transaction, and the preset clearing validity period corresponding to the target transaction comprises:

and if the transaction party in the target transaction to which the terminal equipment belongs is the target party, the transaction state mark of the target transaction is transaction completion, and the transaction information of the target transaction and the information of the transaction state mark of the target transaction are received in the preset clearing validity period, executing transaction clearing processing on the target transaction based on the transaction information of the target transaction.

11. The method according to any one of claims 8-10, further comprising:

receiving transaction information of a first transaction sent by the terminal device, wherein the transaction information of the first transaction is transaction information which is detected by the terminal device that a trusted execution environment of the terminal device of the other party of the target transaction includes a transaction state mark as transaction completion and does not execute transaction clearing processing to the request;

performing a transaction clearing process on the first transaction based on the transaction information for the first transaction.

12. The method of claim 11, further comprising:

receiving a transaction arbitration request of the target transaction sent by the terminal device, wherein the transaction arbitration request is sent when the transaction state of the target transaction in the trusted execution environment is marked as transaction in progress;

acquiring related information for transaction clearing of the target transaction within the preset clearing validity period based on the transaction arbitration request;

and if the relevant information for carrying out transaction clearing on the target transaction is not acquired within the preset clearing validity period, executing transaction arbitration processing corresponding to the transaction arbitration request.

13. A processing method of off-line transaction is applied to a blockchain system, and the method comprises the following steps:

acquiring rule information for executing transaction clearing processing on a target transaction, generating a corresponding first intelligent contract based on the rule information for executing the transaction clearing processing on the target transaction, and deploying the first intelligent contract into the blockchain system;

receiving transaction information of a target transaction and information of a transaction state mark of the target transaction, which are sent by a terminal device, wherein the transaction information of the target transaction and the information of the transaction state mark of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction under an offline transaction scene, the transaction state mark of the target transaction is generated and set as a transaction state mark in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and the transaction state mark of the target transaction in the trusted execution environment is set as transaction completion from the transaction when the target transaction is completed;

and calling the first intelligent contract, and executing transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction, the transaction information of the target transaction, the information of the transaction state mark of the target transaction and the preset clearing validity period corresponding to the target transaction, wherein the information of the transaction party in the target transaction belongs to the terminal equipment.

14. The method of claim 13, further comprising:

receiving transaction information of a first transaction sent by the terminal device, wherein the transaction information of the first transaction is transaction information which is detected by the terminal device that a trusted execution environment of the terminal device of the other party of the target transaction includes a transaction state mark as transaction completion and does not request the blockchain system to execute transaction clearing processing;

and calling a second intelligent contract which is deployed in advance in the blockchain system, and executing transaction clearing processing on the first transaction based on the transaction information of the first transaction.

15. The method of claim 13 or 14, further comprising:

receiving a transaction arbitration request of the target transaction sent by the terminal device, wherein the transaction arbitration request is sent when the transaction state of the target transaction in the trusted execution environment is marked as transaction in progress;

calling a third intelligent contract which is pre-deployed in the block chain system, and acquiring related information for transaction clearing of the target transaction within the preset clearing validity period based on the transaction arbitration request;

and if the related information for carrying out transaction clearing on the target transaction is not acquired within the preset clearing validity period, executing transaction arbitration processing corresponding to the transaction arbitration request based on the third intelligent contract.

16. An apparatus for processing an offline transaction, the apparatus being provided with a trusted execution environment, the apparatus comprising:

the information acquisition module is used for storing the transaction information of the target transaction in the trusted execution environment under the condition of acquiring the transaction information of the target transaction in an off-line transaction scene;

the state marking module is used for generating a transaction state mark of the target transaction in the trusted execution environment, setting the transaction state mark of the target transaction as a transaction, and setting the transaction state mark of the target transaction in the trusted execution environment as a transaction completion from the transaction in case of completion of the target transaction;

and the clearing module is used for executing transaction clearing processing with a preset clearing effective period on the target transaction based on the transaction information of the target transaction and the information of the transaction state mark of the target transaction.

17. An apparatus for processing an offline transaction, the apparatus comprising:

the first information receiving module is used for receiving transaction information of a target transaction and information of a transaction state mark of the target transaction, wherein the transaction information of the target transaction and the information of the transaction state mark of the target transaction are sent by a terminal device and stored in a trusted execution environment of the terminal device, the target transaction is a transaction under an offline transaction scene, the transaction state mark of the target transaction is generated and set as a transaction state mark in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and the transaction state mark of the target transaction in the trusted execution environment is set to be completed by the transaction when the target transaction is completed;

and the first clearing module is used for executing transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction, the transaction information of the target transaction, the information of the transaction state mark of the target transaction and the preset clearing validity period corresponding to the target transaction, wherein the information of the transaction party, the transaction information of the target transaction and the information of the transaction state mark of the target transaction belong to the terminal equipment.

18. A device for processing an offline transaction, the device being a device in a blockchain system, the device comprising:

the contract deployment module is used for acquiring rule information for executing transaction clearing processing on the target transaction, generating a corresponding first intelligent contract based on the rule information for executing the transaction clearing processing on the target transaction, and deploying the first intelligent contract into the blockchain system;

the first information receiving module is used for receiving transaction information of a target transaction and information of a transaction state mark of the target transaction, wherein the transaction information of the target transaction and the information of the transaction state mark of the target transaction are sent by a terminal device and stored in a trusted execution environment of the terminal device, the target transaction is a transaction under an offline transaction scene, the transaction state mark of the target transaction is generated and set as a transaction state mark in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and the transaction state mark of the target transaction in the trusted execution environment is set to be completed by the transaction when the target transaction is completed;

and the first clearing module calls the first intelligent contract and executes transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction, the transaction information of the target transaction, the information of the transaction state mark of the target transaction and the preset clearing validity period corresponding to the target transaction, wherein the information of the transaction party in the target transaction belongs to the terminal equipment.

19. A processing device for an offline transaction, the processing device for the offline transaction being provided with a trusted execution environment, comprising:

a processor; and

a memory arranged to store computer executable instructions that, when executed, cause the processor to:

under the condition that the transaction information of the target transaction under the offline transaction scene is acquired, storing the transaction information of the target transaction in the trusted execution environment;

generating a transaction state flag of the target transaction in the trusted execution environment, setting the transaction state flag of the target transaction as transaction in progress, and setting the transaction state flag of the target transaction in the trusted execution environment as transaction completion from transaction in progress when the target transaction is completed;

and executing transaction clearing processing with a preset clearing validity period on the target transaction based on the transaction information of the target transaction and the information of the transaction state mark of the target transaction.

20. A processing device for an offline transaction, the processing device for the offline transaction comprising:

a processor; and

a memory arranged to store computer executable instructions that, when executed, cause the processor to:

receiving transaction information of a target transaction and information of a transaction state mark of the target transaction, which are sent by a terminal device, wherein the transaction information of the target transaction and the information of the transaction state mark of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction under an offline transaction scene, the transaction state mark of the target transaction is generated and set as a transaction state mark in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and the transaction state mark of the target transaction in the trusted execution environment is set as transaction completion from the transaction when the target transaction is completed;

and executing transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction, the transaction information of the target transaction, the information of the transaction state mark of the target transaction and the preset clearing validity period corresponding to the target transaction, wherein the information of the transaction party, the transaction information of the target transaction and the information of the transaction state mark of the target transaction belong to the terminal equipment.

21. A processing device for an offline transaction, the device being a device in a blockchain system, the processing device for an offline transaction comprising:

a processor; and

a memory arranged to store computer executable instructions that, when executed, cause the processor to:

acquiring rule information for executing transaction clearing processing on a target transaction, generating a corresponding first intelligent contract based on the rule information for executing the transaction clearing processing on the target transaction, and deploying the first intelligent contract into the blockchain system;

receiving transaction information of a target transaction and information of a transaction state mark of the target transaction, which are sent by a terminal device, wherein the transaction information of the target transaction and the information of the transaction state mark of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction under an offline transaction scene, the transaction state mark of the target transaction is generated and set as a transaction state mark in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and the transaction state mark of the target transaction in the trusted execution environment is set as transaction completion from the transaction when the target transaction is completed;

and calling the first intelligent contract, and executing transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction, the transaction information of the target transaction, the information of the transaction state mark of the target transaction and the preset clearing validity period corresponding to the target transaction, wherein the information of the transaction party in the target transaction belongs to the terminal equipment.

22. A storage medium for storing computer-executable instructions, which when executed by a processor implement the following:

under the condition of acquiring the transaction information of the target transaction in an off-line transaction scene, storing the transaction information of the target transaction in a trusted execution environment of terminal equipment;

generating a transaction state flag of the target transaction in the trusted execution environment, setting the transaction state flag of the target transaction as transaction in progress, and setting the transaction state flag of the target transaction in the trusted execution environment as transaction completion from transaction in progress when the target transaction is completed;

and executing transaction clearing processing with a preset clearing validity period on the target transaction based on the transaction information of the target transaction and the information of the transaction state mark of the target transaction.

23. A storage medium for storing computer-executable instructions, which when executed by a processor implement the following:

receiving transaction information of a target transaction and information of a transaction state mark of the target transaction, which are sent by a terminal device, wherein the transaction information of the target transaction and the information of the transaction state mark of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction under an offline transaction scene, the transaction state mark of the target transaction is generated and set as a transaction state mark in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and the transaction state mark of the target transaction in the trusted execution environment is set as transaction completion from the transaction when the target transaction is completed;

and executing transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction, the transaction information of the target transaction, the information of the transaction state mark of the target transaction and the preset clearing validity period corresponding to the target transaction, wherein the information of the transaction party, the transaction information of the target transaction and the information of the transaction state mark of the target transaction belong to the terminal equipment.

24. A storage medium for storing computer-executable instructions, which when executed by a processor implement the following:

acquiring rule information for executing transaction clearing processing on a target transaction, generating a corresponding first intelligent contract based on the rule information for executing the transaction clearing processing on the target transaction, and deploying the first intelligent contract into a blockchain system;

receiving transaction information of a target transaction and information of a transaction state mark of the target transaction, which are sent by a terminal device, wherein the transaction information of the target transaction and the information of the transaction state mark of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction under an offline transaction scene, the transaction state mark of the target transaction is generated and set as a transaction state mark in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and the transaction state mark of the target transaction in the trusted execution environment is set as transaction completion from the transaction when the target transaction is completed;

and calling the first intelligent contract, and executing transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction, the transaction information of the target transaction, the information of the transaction state mark of the target transaction and the preset clearing validity period corresponding to the target transaction, wherein the information of the transaction party in the target transaction belongs to the terminal equipment.

Technical Field

The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, and a device for processing an offline transaction.

Background

Under the condition that the network cannot be connected, the use of the offline transaction is an important supplement to the network transaction, and especially under certain specific scenes (such as basements, planes and the like), the transaction is different from the common transaction process, namely, a transaction list corresponding to transaction information related to the transaction is generated in real time at a service end, so that the reliability and the stability of the transaction are greatly guaranteed.

For the off-line transaction (especially the transaction performed when the terminal devices of both parties are in the off-line state), the corresponding transaction order needs to be generated in the terminal devices of both parties, and when the terminal devices are reconnected to the network, the transaction order is sent to the server for processing. Because the transaction information may be simultaneously present in the terminal devices of the two parties to the transaction, if some reasons cause inconsistency of the transaction information in the terminal devices of the two parties to the transaction, loss of the transaction information, or long-term offline state of the terminal devices, the transaction may not be traced, thereby causing transaction disputes and resource loss, and thus the transaction security is low.

Disclosure of Invention

The purpose of the embodiments of the present specification is to provide a technical scheme for offline transaction, which can effectively avoid transaction disputes, reduce capital loss, and improve transaction security.

In order to implement the above technical solution, the embodiments of the present specification are implemented as follows:

an embodiment of the present specification provides a processing method for an offline transaction, which is applied to a terminal device, where the terminal device is provided with a trusted execution environment, and the method includes: under the condition that the transaction information of the target transaction in the offline transaction scene is acquired, the transaction information of the target transaction is stored in the trusted execution environment. And generating a transaction state mark of the target transaction in the trusted execution environment, setting the transaction state mark of the target transaction as transaction completion, and setting the transaction state mark of the target transaction in the trusted execution environment as transaction completion from transaction completion under the condition that the target transaction is completed. And executing transaction clearing processing with a preset clearing validity period on the target transaction based on the transaction information of the target transaction and the information of the transaction state mark of the target transaction.

The processing method for the offline transaction provided by the embodiment of the specification is applied to a server, and the method comprises the following steps: receiving transaction information of a target transaction and information of a transaction state mark of the target transaction, which are sent by a terminal device, wherein the transaction information of the target transaction and the information of the transaction state mark of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction under an offline transaction scene, the transaction state mark of the target transaction is generated and set as a transaction state mark in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and the transaction state mark of the target transaction in the trusted execution environment is set as transaction completion from the transaction when the target transaction is completed. And executing transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction, the transaction information of the target transaction, the information of the transaction state mark of the target transaction and the preset clearing validity period corresponding to the target transaction, wherein the information of the transaction party, the transaction information of the target transaction and the information of the transaction state mark of the target transaction belong to the terminal equipment.

An embodiment of the present specification provides a processing method for an offline transaction, which is applied to a blockchain system, and the method includes: acquiring rule information for executing transaction clearing processing on a target transaction, generating a corresponding first intelligent contract based on the rule information for executing transaction clearing processing on the target transaction, and deploying the first intelligent contract into the blockchain system. Receiving transaction information of a target transaction and information of a transaction state mark of the target transaction, which are sent by a terminal device, wherein the transaction information of the target transaction and the information of the transaction state mark of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction under an offline transaction scene, the transaction state mark of the target transaction is generated and set as a transaction state mark in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and the transaction state mark of the target transaction in the trusted execution environment is set as transaction completion from the transaction when the target transaction is completed. And calling the first intelligent contract, and executing transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction, the transaction information of the target transaction, the information of the transaction state mark of the target transaction and the preset clearing validity period corresponding to the target transaction, wherein the information of the transaction party in the target transaction belongs to the terminal equipment.

An embodiment of the present specification provides an apparatus for processing an offline transaction, where the apparatus is provided with a trusted execution environment, and the apparatus includes: the information acquisition module is used for storing the transaction information of the target transaction in the trusted execution environment under the condition of acquiring the transaction information of the target transaction in an offline transaction scene. And the state marking module is used for generating a transaction state mark of the target transaction in the trusted execution environment, setting the transaction state mark of the target transaction as a transaction, and setting the transaction state mark of the target transaction in the trusted execution environment as a transaction completion from the transaction in case of completion of the target transaction. And the clearing module is used for executing transaction clearing processing with a preset clearing effective period on the target transaction based on the transaction information of the target transaction and the information of the transaction state mark of the target transaction.

An embodiment of the present specification provides an apparatus for processing an offline transaction, where the apparatus includes: the first information receiving module is used for receiving transaction information of a target transaction and information of a transaction state mark of the target transaction, wherein the transaction information of the target transaction and the information of the transaction state mark of the target transaction are sent by a terminal device and stored in a trusted execution environment of the terminal device, the target transaction is a transaction under an offline transaction scene, the transaction state mark of the target transaction is generated and set as a transaction state mark in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and the transaction state mark of the target transaction in the trusted execution environment is set to be completed by the transaction when the target transaction is completed. And the first clearing module is used for executing transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction, the transaction information of the target transaction, the information of the transaction state mark of the target transaction and the preset clearing validity period corresponding to the target transaction, wherein the information of the transaction party, the transaction information of the target transaction and the information of the transaction state mark of the target transaction belong to the terminal equipment.

An apparatus for processing an offline transaction provided in an embodiment of the present specification is an apparatus in a blockchain system, and the apparatus includes: and the contract deployment module is used for acquiring rule information for executing transaction clearing processing on the target transaction, generating a corresponding first intelligent contract based on the rule information for executing the transaction clearing processing on the target transaction, and deploying the first intelligent contract into the blockchain system. The first information receiving module is used for receiving transaction information of a target transaction and information of a transaction state mark of the target transaction, wherein the transaction information of the target transaction and the information of the transaction state mark of the target transaction are sent by a terminal device and stored in a trusted execution environment of the terminal device, the target transaction is a transaction under an offline transaction scene, the transaction state mark of the target transaction is generated and set as a transaction state mark in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and the transaction state mark of the target transaction in the trusted execution environment is set to be completed by the transaction when the target transaction is completed. And the first clearing module calls the first intelligent contract and executes transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction, the transaction information of the target transaction, the information of the transaction state mark of the target transaction and the preset clearing validity period corresponding to the target transaction, wherein the information of the transaction party in the target transaction belongs to the terminal equipment.

An embodiment of the present specification provides a processing device for an offline transaction, where the processing device for an offline transaction is provided with a trusted execution environment, and the processing device includes: a processor; and a memory arranged to store computer executable instructions that, when executed, cause the processor to: under the condition that the transaction information of the target transaction in the offline transaction scene is acquired, the transaction information of the target transaction is stored in the trusted execution environment. And generating a transaction state mark of the target transaction in the trusted execution environment, setting the transaction state mark of the target transaction as transaction completion, and setting the transaction state mark of the target transaction in the trusted execution environment as transaction completion from transaction completion under the condition that the target transaction is completed. And executing transaction clearing processing with a preset clearing validity period on the target transaction based on the transaction information of the target transaction and the information of the transaction state mark of the target transaction.

An embodiment of this specification provides a processing device for an offline transaction, including: a processor; and a memory arranged to store computer executable instructions that, when executed, cause the processor to: receiving transaction information of a target transaction and information of a transaction state mark of the target transaction, which are sent by a terminal device, wherein the transaction information of the target transaction and the information of the transaction state mark of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction under an offline transaction scene, the transaction state mark of the target transaction is generated and set as a transaction state mark in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and the transaction state mark of the target transaction in the trusted execution environment is set as transaction completion from the transaction when the target transaction is completed. And executing transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction, the transaction information of the target transaction, the information of the transaction state mark of the target transaction and the preset clearing validity period corresponding to the target transaction, wherein the information of the transaction party, the transaction information of the target transaction and the information of the transaction state mark of the target transaction belong to the terminal equipment.

An embodiment of the present specification provides an offline transaction processing device, where the device is a device in a blockchain system, and the offline transaction processing device includes: a processor; and a memory arranged to store computer executable instructions that, when executed, cause the processor to: acquiring rule information for executing transaction clearing processing on a target transaction, generating a corresponding first intelligent contract based on the rule information for executing transaction clearing processing on the target transaction, and deploying the first intelligent contract into the blockchain system. Receiving transaction information of a target transaction and information of a transaction state mark of the target transaction, which are sent by a terminal device, wherein the transaction information of the target transaction and the information of the transaction state mark of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction under an offline transaction scene, the transaction state mark of the target transaction is generated and set as a transaction state mark in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and the transaction state mark of the target transaction in the trusted execution environment is set as transaction completion from the transaction when the target transaction is completed. And calling the first intelligent contract, and executing transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction, the transaction information of the target transaction, the information of the transaction state mark of the target transaction and the preset clearing validity period corresponding to the target transaction, wherein the information of the transaction party in the target transaction belongs to the terminal equipment.

Embodiments of the present specification also provide a storage medium, where the storage medium is used to store computer-executable instructions, and the executable instructions, when executed, implement the following processes: under the condition that the transaction information of the target transaction in the offline transaction scene is acquired, the transaction information of the target transaction is stored in a trusted execution environment of the terminal equipment. And generating a transaction state mark of the target transaction in the trusted execution environment, setting the transaction state mark of the target transaction as transaction completion, and setting the transaction state mark of the target transaction in the trusted execution environment as transaction completion from transaction completion under the condition that the target transaction is completed. And executing transaction clearing processing with a preset clearing validity period on the target transaction based on the transaction information of the target transaction and the information of the transaction state mark of the target transaction.

Embodiments of the present specification also provide a storage medium, where the storage medium is used to store computer-executable instructions, and the executable instructions, when executed, implement the following processes: receiving transaction information of a target transaction and information of a transaction state mark of the target transaction, which are sent by a terminal device, wherein the transaction information of the target transaction and the information of the transaction state mark of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction under an offline transaction scene, the transaction state mark of the target transaction is generated and set as a transaction state mark in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and the transaction state mark of the target transaction in the trusted execution environment is set as transaction completion from the transaction when the target transaction is completed. And executing transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction, the transaction information of the target transaction, the information of the transaction state mark of the target transaction and the preset clearing validity period corresponding to the target transaction, wherein the information of the transaction party, the transaction information of the target transaction and the information of the transaction state mark of the target transaction belong to the terminal equipment.

Embodiments of the present specification also provide a storage medium, where the storage medium is used to store computer-executable instructions, and the executable instructions, when executed, implement the following processes: acquiring rule information for executing transaction clearing processing on a target transaction, generating a corresponding first intelligent contract based on the rule information for executing the transaction clearing processing on the target transaction, and deploying the first intelligent contract into a blockchain system. Receiving transaction information of a target transaction and information of a transaction state mark of the target transaction, which are sent by a terminal device, wherein the transaction information of the target transaction and the information of the transaction state mark of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction under an offline transaction scene, the transaction state mark of the target transaction is generated and set as a transaction state mark in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and the transaction state mark of the target transaction in the trusted execution environment is set as transaction completion from the transaction when the target transaction is completed. And calling the first intelligent contract, and executing transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction, the transaction information of the target transaction, the information of the transaction state mark of the target transaction and the preset clearing validity period corresponding to the target transaction, wherein the information of the transaction party in the target transaction belongs to the terminal equipment.

Drawings

In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the present specification, and for those skilled in the art, other drawings can be obtained according to the drawings without any creative effort.

FIG. 1 illustrates an embodiment of a method for processing an offline transaction according to the present disclosure;

FIG. 2 is a schematic diagram of an offline transaction processing system according to the present disclosure;

FIG. 3 is a flow diagram illustrating another embodiment of a method for processing offline transactions;

FIG. 4 is a block diagram of another embodiment of a method for processing an offline transaction;

FIG. 5 is a flow diagram illustrating another embodiment of a method for processing an offline transaction;

FIG. 6A is a flowchart of another embodiment of a method for processing an offline transaction;

FIG. 6B is a schematic diagram of an offline transaction process according to the present disclosure;

FIG. 7 is a block diagram of an embodiment of an apparatus for processing an offline transaction according to the present disclosure;

FIG. 8 is another embodiment of an offline transaction processing device according to the present disclosure;

FIG. 9 is a schematic diagram of another embodiment of an apparatus for processing offline transactions;

fig. 10 is an embodiment of an offline transaction processing device according to the present disclosure.

Detailed Description

The embodiment of the specification provides a method, a device and equipment for processing offline transactions.

In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present specification, and not all of the embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present specification without any inventive step should fall within the scope of protection of the present specification.

Example one

As shown in fig. 1, an execution body of the method may be a terminal device, where the terminal device may be a mobile terminal device such as a mobile phone, a tablet computer, or the like, or a computer device such as a notebook computer or a desktop computer, and the terminal device may be a device used by a merchant (i.e., a target party of a transaction) for settling a commodity purchased by a user, or a device used by a transaction initiator. The terminal device may be provided with a trusted Execution environment, where the trusted Execution environment may be a tee (trusted Execution environment), and the trusted Execution environment may be implemented by a program written in a predetermined programming language (that is, may be implemented in the form of software), or may be composed of a designated hardware device and corresponding software, and the trusted Execution environment may be a secure operating environment for performing data processing. The method may specifically comprise the steps of:

in step S102, when the transaction information of the target transaction in the offline transaction scenario is acquired, the transaction information of the target transaction is stored in the trusted execution environment.

The offline transaction scenario may be a scenario in which both the terminal devices used by the two parties of the transaction are in an offline state (i.e., not connected to the network or not connected to the network), or a scenario in which both the parties of the transaction are in an offline state. The target transaction may be any transaction, for example, a user purchases a certain commodity in an offline store opened by a certain merchant, and the user settles the purchased commodity and the merchant through a payment application installed in a terminal device of the user, so as to form a transaction. The transaction information may include a plurality of different information, for example, the transaction information may include an identifier of a target transaction, a resource amount of the transaction (specifically, a transaction amount, etc.), account information of both parties of the transaction, and the like. The trusted execution environment may be a TEE, and the trusted execution environment of the TEE may be a data processing environment that is secure and isolated from other environments, i.e., processes executed in the trusted execution environment, and data generated during data processing, etc., may not be accessible to other execution environments or applications outside the executable environment. The trusted execution environment of the TEE may be implemented by creating a small operating system that may run independently in a trusted zone (e.g., TrustZone, etc.), and the TEE may directly provide services in the form of system calls (e.g., handled directly by the TrustZone kernel). The terminal device may include an REE (rich execution environment) and a TEE, an operating system installed in the terminal device may be run under the REE, such as an Android operating system, an iOS operating system, a Windows operating system, a Linux operating system, and the like, and the REE may have characteristics of strong function, good openness and extensibility, and may provide all functions of the terminal device, such as a camera function, a touch function, and the like, for an upper application program. The TEE has its own execution space, that is, there is an operating system under the TEE, the TEE has a higher security level than the REE, software and hardware resources in the terminal equipment which can be accessed by the TEE are separated from the REE, but the TEE can directly acquire the information of the REE, and the REE cannot acquire the information of the TEE. The TEE can perform authentication and other processing through the provided interface, so that user information (such as payment information, user privacy information and the like) cannot be tampered, passwords cannot be hijacked, and information such as fingerprints or faces cannot be stolen.

In implementation, under the condition that the network cannot be connected, the use of offline transaction is an important supplement to network transaction, and especially under some specific scenes (such as basements, remote mountainous areas, planes, and the like), different from a normal transaction process, that is, a transaction sheet (such as a bill or an order and the like) corresponding to transaction information related to the transaction is generated in real time at a service end, so that both the reliability and the stability of the transaction are greatly guaranteed, while for offline transaction (especially for transaction performed when terminal devices of both parties of the transaction are in an offline state), a corresponding transaction sheet needs to be generated in terminal devices of both parties of the transaction, and when the terminal devices are reconnected to the network, the transaction sheet is sent to the service end for processing. Because the transaction information may be simultaneously present in the terminal devices of the two parties to the transaction, if some reasons cause inconsistency of the transaction information in the terminal devices of the two parties to the transaction, or the transaction information is lost, or the terminal device is in an offline state for a long time (i.e., for a time greater than a preset time threshold), the transaction may not be traceable, thereby causing transaction disputes and resource loss, so that the transaction security is low. The embodiment of the present specification provides an implementable technical solution, which may specifically include the following contents:

for the terminal device of the transaction initiator, the transaction initiator may select a transaction object that needs to perform a transaction (for example, the transaction initiator may select a commodity that needs to be purchased in an off-line shop), and after the selection is completed, the selected object may be provided to a manager for settlement, and the manager may calculate the transferred resource (for example, the amount of money that needs to be paid, etc.) that is needed by the selected object. After the calculation is completed, the transaction initiator may provide information of the account for resource transfer to the administrator through the terminal device of the transaction initiator, and the manner of providing information by the terminal device of the transaction initiator may include a plurality of different manners, for example, information of the account for resource transfer may be provided to the administrator through a graphic code (which may be a barcode or a two-dimensional code, etc.), or information of the account for resource transfer may be provided to the administrator through a fingerprint, a voiceprint, a facial image, etc., which may be specifically set according to an actual situation, and this is not limited in this description embodiment. The terminal device of the transaction target party can acquire the information of the account, acquire the transaction information of the target transaction and send the transaction information to the transaction initiator for confirmation, and at the moment, the terminal device of the transaction initiator can acquire the transaction information of the target transaction and store the transaction information of the target transaction in a trusted execution environment of the terminal device of the transaction initiator.

For the terminal device of the transaction target party, based on the above process, the transaction initiator can select the object to be transacted, and then, the selected object can be provided to the manager for settlement, and the manager can calculate the resource to be transferred for the selected object. The transaction initiator can provide the account information of resource transfer to the manager through the terminal device of the transaction initiator, the terminal device of the transaction target can acquire the account information, meanwhile, the terminal device of the transaction target can also acquire the transaction information of the target transaction, and the transaction information of the target transaction can be stored in the trusted execution environment of the terminal device of the transaction target. It should be noted that, in the above case, the terminal device of the transaction destination may perform a pre-transfer process of resources (specifically, pre-deduction, etc.) to prevent the double flower from occurring.

In step S104, a transaction status flag of the target transaction is generated in the trusted execution environment, and is set as in-transaction, and in the case that the target transaction is completed, the transaction status flag of the target transaction in the trusted execution environment is set as transaction complete by in-transaction.

The transaction state flag may be used to mark information of a transaction state of a target transaction, and the transaction state flag may include a plurality of different presentation manners, for example, the transaction state flag may be presented in a data tag manner, or may also be presented in a manner of setting a state bit, where different information (such as numbers, letters, and the like) may be set in the state bit, the set information is different, and corresponding transaction states may be different, for example, a state bit of 0 indicates that the transaction state is in transaction, and a state bit of 1 indicates that the transaction state is completed, and the like.

In implementation, after the transaction information of the target transaction is stored in the trusted execution environment of the terminal device in the above manner, a transaction status flag (i.e. a transaction status flag of the target transaction) may be generated for the transaction information of the target transaction in the trusted execution environment, and at this time, since the target transaction is not completed yet, the transaction status flag of the target transaction may be set to be in transaction.

After the terminal device stores the transaction information of the target transaction in the trusted execution environment, the terminal device of the transaction target party can send the transaction information of the target transaction or information (such as an order and the like) related to the transaction information to the transaction initiator, the transaction initiator can determine whether the received information is wrong, if no, the transaction initiator can send a confirmation notice to the transaction target party through the terminal device of the transaction initiator, after the terminal device of the transaction target party receives the confirmation notice, resource transfer processing can be carried out based on the transaction information of the target transaction and the information of the account of resource transfer provided by the transaction initiator, after the resource transfer is successful, the target transaction can be determined to be completed, at this time, the terminal device of the transaction target party can set the transaction state flag of the target transaction in the trusted execution environment as transaction completion from the transaction, and in addition, the terminal device of the transaction initiator may also set a transaction status flag of the target transaction in the trusted execution environment from the transaction to transaction complete.

In step S106, a transaction clearing process having a preset clearing validity period is performed on the target transaction based on the transaction information of the target transaction and the information of the transaction status flag of the target transaction.

The clearing validity period may be a period in which both transaction parties initiate transaction clearing processing for a certain transaction, and the clearing validity period may include multiple types, for example, 3 days, 7 days, or 14 days, and may be set according to actual conditions, which is not limited in this description embodiment, and for a certain transaction, if both transaction parties initiate transaction clearing processing for the transaction within the clearing validity period, the transaction can be cleared, and if both transaction parties do not initiate transaction clearing processing for the transaction within the clearing validity period, the transaction clearing processing for the transaction can be refused, where the transaction clearing processing for the transaction can be performed by a terminal device of a transaction target party, or performed by another device (as shown in fig. 2) other than both transaction parties, and may be set according to actual conditions, the examples in this specification do not limit this.

In implementation, as shown in fig. 2, if the transaction status flag of the target transaction is transaction completion, a clearing process may be initiated at the transaction initiator and/or the terminal device of the transaction target based on the transaction information of the target transaction and the information of the transaction status flag of the target transaction, at this time, it may be determined whether the target transaction is within the clearing validity period based on the transaction time and other information in the transaction information of the target transaction, if so, a transaction clearing process with a preset clearing validity period may be performed on the target transaction based on the transaction information of the target transaction and the information of the transaction status flag of the target transaction, and if not, the transaction clearing process on the target transaction may be rejected.

The embodiment of the specification provides a processing method of an offline transaction, which is applied to a terminal device, wherein the terminal device is provided with a trusted execution environment, under the condition that transaction information of a target transaction under an offline transaction scene is acquired, the transaction information of the target transaction is stored in the trusted execution environment, a transaction state flag of the target transaction is generated in the trusted execution environment, the transaction state flag of the target transaction is set to be in transaction, under the condition that the target transaction is completed, the transaction state flag of the target transaction in the trusted execution environment is set to be transaction completed in the transaction, and finally, transaction clearing processing with a preset clearing validity period can be executed on the target transaction based on the transaction information of the target transaction and the information of the transaction state flag of the target transaction, so that the offline transaction is cleared based on the clearing validity period and the transaction state flag, therefore, the generation of transaction disputes can be effectively avoided, the loss of resources is reduced, and the transaction safety and the transaction experience are improved.

Example two

As shown in fig. 3, an execution body of the method may be a terminal device, where the terminal device may be a mobile terminal device such as a mobile phone and a tablet computer, or a computer device such as a notebook computer or a desktop computer, and the terminal device may be a device used by a merchant (i.e., a target party of a transaction) for settling a commodity purchased by a user, or a device used by a transaction initiator. The terminal device may be provided with a trusted execution environment, which may be a TEE, and the trusted execution environment may be implemented by a program written in a predetermined programming language (i.e., may be implemented in the form of software), or may be composed of a designated hardware device and corresponding software, and may be a secure operating environment for performing data processing. The method may specifically comprise the steps of:

in step S302, when the transaction information of the target transaction in the offline transaction scenario is acquired, the transaction information of the target transaction is stored in the trusted execution environment.

In step S304, a transaction status flag of the target transaction is generated in the trusted execution environment, and the transaction status flag of the target transaction is set to be in-transaction.

The transaction state flag of the target transaction is set in the transaction information of the target transaction, for example, a state bit may be set in the transaction information of the target transaction, and different transaction states may be represented by different numbers in the state bit, for example, if the state bit is 0, the transaction state is in transaction, and if the state bit is 1, the transaction state is transaction completion, and the like.

In step S306, a transaction completion message of the target transaction provided by the terminal device is acquired, and a notification message of transaction completion of the target transaction provided by another party of the target transaction is acquired.

If the terminal device is a terminal device of a transaction initiator, the other party of the target transaction can be a transaction target party, and if the terminal device is a terminal device of the transaction target party, the other party of the target transaction can be a transaction initiator.

In step S308, if the transaction completion message of the target transaction and the notification message are acquired, it is determined that the target transaction is completed.

In step S310, a transaction status flag of the target transaction in the trusted execution environment is set by the in-transaction to transaction complete.

In step S312, the transaction information of the target transaction and the information of the transaction status flag of the target transaction are sent to enable the transaction clearing process to be performed on the target transaction based on the transaction information of the target transaction and the information of the transaction status flag of the target transaction and the preset clearing validity period corresponding to the target transaction.

In implementation, if the transaction status flag of the target transaction is transaction completion, the terminal device of the transaction initiator and/or the transaction target may send the transaction information of the target transaction and the information of the transaction status flag of the target transaction to determine whether the target transaction is within the clearing validity period based on the information of the transaction time and the like in the transaction information of the target transaction, if so, perform a transaction clearing process with a preset clearing validity period on the target transaction based on the transaction information of the target transaction and the information of the transaction status flag of the target transaction, and if not, refuse to perform the transaction clearing process on the target transaction.

It should be noted that, in practical applications, considering that a transaction target party usually provides a transaction object to a transaction initiator after a transaction is successful or the transaction is completed, and meanwhile, the transaction initiator may also use a resource card (such as a bank card or a shopping card) to perform settlement, the networking opportunity of the transaction initiator cannot be determined, and the transaction target party is generally a terminal device such as a mobile phone or a pos machine, and has a large number of opportunities to connect to a network, so that the transaction target party should perform a transaction clearing duty, that is, the transaction clearing process may be subject to the transaction information provided by the transaction target party, and the transaction information provided by the transaction initiator is used as an auxiliary verification, thereby completing the transaction clearing process of the target transaction.

In step S314, in the case of receiving the transmitted notification message that the transaction clearing process of the target transaction is completed, the transaction information of the target transaction and the transaction status flag of the target transaction stored in the trusted execution environment are cancelled.

The processing manner of step S314 may be various, and an optional processing manner is provided below, and may specifically include the following processing of step a2 and step a 4.

In step a2, in the case of receiving the notification message that the transaction clearing process of the sent target transaction is completed, it is determined whether the transaction information of the target transaction stored in the trusted execution environment meets a preset logout condition, where the logout condition is constructed based on the storage duration and/or the transaction type corresponding to the target transaction.

The storage duration may be a duration in which the transaction information of the target transaction is stored in the trusted execution environment, specifically, 15 days or 30 days, for example. The transaction type may include a variety of types, such as internal resource transfer of an organization (e.g., payment between different accounts of a certain financial application, etc.), resource allocation (e.g., payment between accounts of a bank and other financial institutions except the bank, etc.), resource transfer across organizations, etc., which may be specifically set according to actual situations. The logout condition may be, for example, if the storage duration of the transaction information of the target transaction in the trusted execution environment exceeds 30 days and the transaction type corresponding to the target transaction is intra-institution resource transfer, a logout procedure is executed, or if the storage duration of the transaction information of the target transaction in the trusted execution environment exceeds 15 days and the transaction type corresponding to the target transaction is cross-institution resource transfer, a logout procedure is executed, and the like, which may be specifically set according to an actual situation, and this is not limited in this description embodiment.

In step A4, if yes, transaction information of the target transaction and the transaction status flag of the target transaction stored in the trusted execution environment are revoked.

In practical applications, the transaction initiator and the transaction target may further assist each other to complete the transaction clearing process, which may specifically include the following process of step S316.

In step S316, if it is detected that the trusted execution environment of the terminal device of the other party of the target transaction includes transaction information of the first transaction whose transaction status is marked as transaction completion and for which the transaction clearing process is not requested to be performed, the transaction information of the first transaction is acquired from the terminal device of the other party of the target transaction, and is sent to cause the transaction clearing process to be performed on the first transaction based on the transaction information of the first transaction.

Wherein the first transaction may be any transaction.

In the implementation, when only one of the two parties of the target transaction is connected with the network, during the process of performing the target transaction, the party connected with the network can assist the party not connected with the network to perform the synchronization of the transaction so as to complete the transaction clearing, specifically, when the terminal device (connected network) of the transaction target party of the target transaction scans the payment two-dimensional code provided by the mobile phone (not connected with the network) of the transaction initiator, the terminal device of the transaction target party can detect whether the trusted execution environment of the mobile phone of the transaction initiator includes the transaction information of the transaction of which the transaction state is marked as transaction completion and the transaction information of the transaction of which the transaction clearing processing is not requested to be executed, and if the trusted execution environment of the mobile phone of the transaction initiator includes the transaction information of which the transaction state is marked as transaction completion and the transaction information of the first transaction of which the transaction clearing processing is not requested to be executed, the transaction information of the first transaction is acquired from the trusted execution environment of the mobile phone of the transaction initiator, and transmitting transaction information of the first transaction to which a transaction clearing process may be performed based on the transaction information of the first transaction. Similarly, when the mobile phone (connected to the network) of the transaction initiator of the target transaction scans the two-dimensional payment code provided by the terminal device (not connected to the network) of the transaction target, the mobile phone of the transaction initiator may detect whether the trusted execution environment of the terminal device of the transaction target includes transaction information of a transaction whose transaction state is marked as transaction completion and for which the transaction is not requested to execute the transaction clearing process, and if it is detected that the trusted execution environment of the terminal device of the transaction target includes transaction information of a first transaction whose transaction state is marked as transaction completion and for which the transaction clearing process is not requested to be executed, obtain the transaction information of the first transaction from the trusted execution environment of the terminal device of the transaction target, and send the transaction information of the first transaction to the mobile phone of the transaction initiator, which may execute the transaction clearing process for the first transaction based on the transaction information of the first transaction.

The embodiment of the specification provides a processing method of an offline transaction, which is applied to a terminal device, wherein the terminal device is provided with a trusted execution environment, under the condition that transaction information of a target transaction under an offline transaction scene is acquired, the transaction information of the target transaction is stored in the trusted execution environment, a transaction state flag of the target transaction is generated in the trusted execution environment, the transaction state flag of the target transaction is set to be in transaction, under the condition that the target transaction is completed, the transaction state flag of the target transaction in the trusted execution environment is set to be transaction completed in the transaction, and finally, transaction clearing processing with a preset clearing validity period can be executed on the target transaction based on the transaction information of the target transaction and the information of the transaction state flag of the target transaction, so that the offline transaction is cleared based on the clearing validity period and the transaction state flag, therefore, the generation of transaction disputes can be effectively avoided, the loss of resources is reduced, and the transaction safety and the transaction experience are improved.

In addition, the corresponding recording rule of the transaction information is designed based on the transaction state mark, double spending (resource pre-transfer can be carried out if the transaction information exists) can be effectively prevented, asynchronous transaction information caused by network reasons is prevented, in addition, the transaction information synchronization rule based on the clearing validity period is set, arbitration of disputed transactions can be effectively carried out, in addition, the transaction information is synchronized based on the network of the terminal equipment of one party in the transaction, therefore, the synchronization time of the transaction information can be greatly increased, and uncontrollable transaction caused by overlong transaction recording offline time is prevented.

EXAMPLE III

As shown in fig. 4, an execution main body of the method may be a server, where the server may be a background server that provides access to a certain service (e.g., a service performing a transaction or a financial service) or a certain transaction object, specifically, the server may be a server of a payment service, or a server of a service related to financial or instant messaging, and the server may be the clearing server described in the second embodiment. A corresponding off-line transaction processing system may be as shown in fig. 2. The method may specifically comprise the steps of:

in step S402, transaction information of a target transaction and information of a transaction state flag of the target transaction sent by the terminal device are received, where the transaction information of the target transaction and the information of the transaction state flag of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction in an offline transaction scenario, the transaction state flag of the target transaction is generated and set as a transaction state flag in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and when the target transaction is completed, the transaction state flag of the target transaction in the trusted execution environment is set as transaction completion from the transaction.

In step S404, transaction clearing processing is performed on the target transaction based on the information of the transaction party in the target transaction to which the terminal device belongs, the transaction information of the target transaction, and the information of the transaction state flag of the target transaction, and the preset clearing validity period corresponding to the target transaction.

The embodiment of the present specification provides a processing method of an offline transaction, which receives transaction information of a target transaction and information of a transaction state flag of the target transaction sent by a terminal device, where the transaction information of the target transaction and the information of the transaction state flag of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction in an offline transaction scenario, the transaction state flag of the target transaction is generated and set as the transaction state flag in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and when the target transaction is completed, the transaction state flag of the target transaction in the trusted execution environment is set as a transaction completion from the transaction, and then, based on information of a transaction party in the target transaction to which the terminal device belongs, the transaction information of the target transaction and the information of the transaction state flag of the target transaction, and executing transaction clearing processing on the target transaction according to the preset clearing validity period corresponding to the target transaction, so that the offline transaction is cleared based on the clearing validity period and the transaction state mark, thereby effectively avoiding transaction disputes, reducing the investment loss and improving the transaction safety and transaction experience.

Example four

As shown in fig. 5, an execution main body of the method may be a server, where the server may be a background server that provides access to a certain service (e.g., a service performing a transaction or a financial service) or a certain transaction object, specifically, the server may be a server of a payment service, or a server of a service related to financial or instant messaging, and the server may be the clearing server described in the second embodiment. A corresponding off-line transaction processing system may be as shown in fig. 2. The method may specifically comprise the steps of:

in step S502, transaction information of a target transaction and information of a transaction state flag of the target transaction sent by the terminal device are received, where the transaction information of the target transaction and the information of the transaction state flag of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction in an offline transaction scenario, the transaction state flag of the target transaction is generated and set as a transaction state flag in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and when the target transaction is completed, the transaction state flag of the target transaction in the trusted execution environment is set as transaction completion from the transaction.

In practical applications, when the transaction status of the target transaction in the trusted execution environment is marked as in transaction, if the transaction initiator finds a repeat transaction or a transaction error, the transaction initiator may apply for transaction rollback, and at this time, the transaction initiator may initiate a transaction arbitration request, which may specifically include the following processing of steps S504 to S508.

In step S504, a transaction arbitration request of the target transaction sent by the terminal device is received, where the transaction arbitration request is sent when the transaction status of the target transaction in the trusted execution environment is marked as in-transaction.

In step S506, based on the transaction arbitration request, the related information of transaction clearing for the target transaction is obtained within the preset clearing validity period.

In implementation, after receiving a transaction arbitration request of a target transaction sent by a terminal device, a server may send a relevant notification message such as waiting for processing to the terminal device of a transaction initiator, and meanwhile, may determine whether the target transaction is within a preset clearing validity period based on transaction information of the target transaction, and if so, obtain relevant information for performing transaction clearing on the target transaction, specifically, transaction information of the target transaction, and the like, within the preset clearing validity period.

In step S508, if the relevant information for transaction clearing of the target transaction is not acquired within the preset clearing validity period, the transaction arbitration process corresponding to the transaction arbitration request is executed.

In implementation, if the relevant information for performing transaction clearing on the target transaction is not acquired within the preset clearing validity period, it indicates that the target transaction is an incomplete transaction, at this time, it may be determined that the transaction arbitration request submitted by the transaction initiator is valid, and the transaction arbitration process corresponding to the transaction arbitration request may be executed, for example, a transaction rollback may be performed on the target transaction, so as to perform processing such as refund on the transaction initiator.

In step S510, if the transaction party in the target transaction to which the terminal device belongs is the transaction initiator and the transaction status of the target transaction is marked as transaction completion, the related information for performing transaction clearing on the target transaction sent by the target party of the target transaction is received within the preset clearing validity period.

In step S512, if the related information for transaction clearing for the target transaction sent by the target party of the target transaction is received within the preset clearing validity period, a transaction clearing process is performed on the target transaction based on the transaction information for the target transaction and the received related information for transaction clearing for the target transaction sent by the target party.

In step S514, if the transaction party in the target transaction to which the terminal device belongs is the target party, the transaction status flag of the target transaction is transaction completion, and the transaction information of the target transaction and the information of the transaction status flag of the target transaction are received within the preset clearing validity period, the transaction clearing process is performed on the target transaction based on the transaction information of the target transaction.

In practical applications, the transaction initiator and the transaction target may further assist each other to complete the transaction clearing process, and specifically, the following processes of step S516 and step S518 may be included.

In step S516, transaction information of the first transaction sent by the terminal device is received, where the transaction information of the first transaction is transaction information that the terminal device detects that the trusted execution environment of the terminal device of the other party of the target transaction includes a transaction state that is marked as transaction completion and does not request execution of transaction clearing processing.

In step S518, a transaction clearing process is performed on the first transaction based on the transaction information of the first transaction.

The embodiment of the present specification provides a processing method of an offline transaction, which receives transaction information of a target transaction and information of a transaction state flag of the target transaction sent by a terminal device, where the transaction information of the target transaction and the information of the transaction state flag of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction in an offline transaction scenario, the transaction state flag of the target transaction is generated and set as the transaction state flag in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and when the target transaction is completed, the transaction state flag of the target transaction in the trusted execution environment is set as a transaction completion from the transaction, and then, based on information of a transaction party in the target transaction to which the terminal device belongs, the transaction information of the target transaction and the information of the transaction state flag of the target transaction, and executing transaction clearing processing on the target transaction according to the preset clearing validity period corresponding to the target transaction, so that the offline transaction is cleared based on the clearing validity period and the transaction state mark, thereby effectively avoiding transaction disputes, reducing the investment loss and improving the transaction safety and transaction experience.

In addition, the corresponding recording rule of the transaction information is designed based on the transaction state mark, double spending (resource pre-transfer can be carried out if the transaction information exists) can be effectively prevented, asynchronous transaction information caused by network reasons is prevented, in addition, the transaction information synchronization rule based on the clearing validity period is set, arbitration of disputed transactions can be effectively carried out, in addition, the transaction information is synchronized based on the network of the terminal equipment of one party in the transaction, therefore, the synchronization time of the transaction information can be greatly increased, and uncontrollable transaction caused by overlong transaction recording offline time is prevented.

EXAMPLE five

As shown in fig. 6A and fig. 6B, an execution main body of the method may be a blockchain system, and the blockchain system may be composed of a server and the like, where the server may be a background server for providing access to a certain service (such as a service for performing a transaction or a financial service) or a certain transaction object, and specifically, the server may be a server for a payment service, or a server for a service related to financial or instant messaging, and the like. The method may specifically comprise the steps of:

in step S602, rule information for executing transaction clearing processing on the target transaction is acquired, a corresponding first intelligent contract is generated based on the rule information for executing transaction clearing processing on the target transaction, and the first intelligent contract is deployed into the blockchain system.

Wherein the first intelligent contract may be a computer protocol intended to propagate, verify or execute contracts in an informational manner, the first intelligent contract allowing trusted interaction without third parties, the process of such interaction being traceable and irreversible, the first intelligent contract including agreements on which contract participants may execute rights and obligations agreed.

In implementation, in order to make traceability of the transaction clearing process performed on the target transaction better, a specified blockchain system may be created or added, so that the transaction clearing process may be performed on the target transaction based on the blockchain system, specifically, a corresponding application program may be installed in a blockchain node, an input box and/or a selection box and the like of rule information for performing the transaction clearing process on the target transaction may be set in the application program, and corresponding information may be set in the input box and/or the selection box. The blockchain system may then receive rule information to perform a transaction clearing process on the target transaction. The blockchain system may generate a corresponding first intelligent contract based on the rule information for executing the transaction clearing process on the target transaction, and may deploy the first intelligent contract into the blockchain system, so that the rule information for executing the transaction clearing process on the target transaction and the corresponding first intelligent contract are stored in the blockchain system, other users cannot tamper with the rule information for executing the transaction clearing process on the target transaction and the corresponding first intelligent contract, and the blockchain system executes the transaction clearing process on the target transaction through the first intelligent contract.

In step S604, transaction information of the target transaction and information of a transaction state flag of the target transaction sent by the terminal device are received, where the transaction information of the target transaction and the information of the transaction state flag of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction in an offline transaction scenario, the transaction state flag of the target transaction is generated and set as a transaction state flag in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and when the target transaction is completed, the transaction state flag of the target transaction in the trusted execution environment is set as transaction completion from the transaction.

In practical applications, when the transaction status of the target transaction in the trusted execution environment is marked as in-transaction, if the transaction initiator finds a duplicate transaction or a transaction error, the transaction initiator may apply for transaction rollback, and at this time, the transaction initiator may initiate a transaction arbitration request, which may specifically include the following processing of step B2 to step B6.

In step B2, a transaction arbitration request of the target transaction sent by the terminal device is received, the transaction arbitration request being sent when the transaction status of the target transaction in the trusted execution environment is marked as in-transaction.

In step B4, a third smart contract pre-deployed in the blockchain system is called, and based on the transaction arbitration request, information related to transaction clearing for the target transaction is obtained within a preset clearing validity period.

In implementation, the third intelligent contract may be provided with related rule information for acquiring, within a preset clearing validity period, related information for performing transaction clearing on the target transaction and related rule information for performing transaction arbitration processing corresponding to the transaction arbitration request, so that the corresponding processing may be implemented based on the rule information in the third intelligent contract, which may be referred to specifically for the above-mentioned related contents, and is not described herein again.

In step B6, if the relevant information for transaction clearing of the target transaction is not acquired within the preset clearing validity period, the transaction arbitration process corresponding to the transaction arbitration request is executed based on the third intelligent contract.

In step S606, a first intelligent contract is invoked, and transaction clearing processing is performed on the target transaction based on the information of the transaction party in the target transaction to which the terminal device belongs, the transaction information of the target transaction, the information of the transaction state flag of the target transaction, and the preset clearing validity period corresponding to the target transaction.

In implementation, the first intelligent contract may be provided with information of a transaction party in a target transaction, transaction information of the target transaction, information of a transaction state flag of the target transaction, and related rule information for executing transaction clearing processing on the target transaction based on a preset clearing validity period corresponding to the target transaction, so that the corresponding processing may be implemented based on the rule information in the first intelligent contract, which may be referred to as the related content specifically, and is not described herein again.

In practical applications, the specific processing of step S606 may be various, and two alternative processing manners are provided below, which may specifically include the following manner one and manner two.

The first method is as follows: the following step C2 and step C4 may be included.

In step C2, if the transaction party in the target transaction to which the terminal device belongs is the transaction initiator and the transaction status of the target transaction is marked as transaction completion, the related information of transaction clearing for the target transaction sent by the target party of the target transaction is received within the preset clearing validity period based on the first intelligent contract.

In step C4, if the information related to the transaction settlement for the target transaction sent by the target party of the target transaction is received within the preset settlement validity period, a transaction settlement process is performed on the target transaction based on the first intelligent contract, the transaction information of the target transaction and the received information related to the transaction settlement for the target transaction sent by the target party.

In implementation, the first intelligent contract may further include related information for performing transaction clearing on the target transaction, which is sent by the target party that receives the target transaction within a preset clearing validity period, and related rule information for performing transaction clearing processing on the target transaction based on the transaction information of the target transaction and the received related information for performing transaction clearing on the target transaction, which is sent by the target party, so that the corresponding processing may be implemented based on the rule information in the first intelligent contract, which may be referred to specifically for the above related contents, and details are not described herein again.

The second method comprises the following steps: and if the transaction party in the target transaction to which the terminal equipment belongs is the target party, the transaction state mark of the target transaction is transaction completion, and the transaction information of the target transaction and the information of the transaction state mark of the target transaction are received in the preset clearing validity period, executing transaction clearing processing on the target transaction based on the first intelligent contract and the transaction information of the target transaction.

In implementation, the first intelligent contract may further include related rule information for executing transaction clearing processing on the target transaction based on the transaction information of the target transaction, so that the corresponding processing may be implemented based on the rule information in the first intelligent contract, which may be referred to specifically for the above related contents, and is not described herein again.

In practical applications, the transaction initiator and the transaction target may further assist each other to complete the transaction clearing process, which may specifically include the following processes of step D2 and step D4.

In step D2, the transaction information of the first transaction sent by the terminal device is received, where the transaction information of the first transaction is the transaction information that the terminal device detects that the trusted execution environment of the terminal device of the other party of the target transaction includes the transaction state that is marked as transaction completion and does not request the blockchain system to execute the transaction clearing process.

In step D4, a second smart contract pre-deployed in the blockchain system is invoked, and a transaction clearing process is performed on the first transaction based on the transaction information of the first transaction.

In implementation, the second intelligent contract may be provided with relevant rule information for executing transaction clearing processing on the first transaction based on the transaction information of the first transaction, so that the corresponding processing may be implemented based on the rule information in the second intelligent contract, which may be referred to in detail for the above-mentioned relevant content, and is not described herein again.

The specific processing of step S606 may refer to the relevant contents in the above first and second embodiments, that is, various processing related to the above first and second embodiments may be implemented by the first smart contract.

The embodiment of the specification provides a processing method of off-line transaction, which includes the steps of obtaining rule information for executing transaction clearing processing on target transaction, generating a corresponding first intelligent contract based on the rule information for executing the transaction clearing processing on the target transaction, deploying the first intelligent contract into a blockchain system, calling the first intelligent contract when receiving transaction information of the target transaction and information of a transaction state mark of the target transaction sent by a terminal device, executing the transaction clearing processing on the target transaction based on information of a transaction party in the target transaction to which the terminal device belongs, the transaction information of the target transaction and the information of the transaction state mark of the target transaction and a preset clearing validity period corresponding to the target transaction, wherein the transaction information of the target transaction and the information of the transaction state mark of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction under an offline transaction scene, the transaction state flag of the target transaction is generated and set as a transaction state flag in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and the transaction state flag of the target transaction in the trusted execution environment is set to be completed from the transaction in the transaction under the condition that the target transaction is completed.

In addition, the corresponding recording rule of the transaction information is designed based on the transaction state mark, double spending (resource pre-transfer can be carried out if the transaction information exists) can be effectively prevented, asynchronous transaction information caused by network reasons is prevented, in addition, the transaction information synchronization rule based on the clearing validity period is set, arbitration of disputed transactions can be effectively carried out, in addition, the transaction information is synchronized based on the network of the terminal equipment of one party in the transaction, therefore, the synchronization time of the transaction information can be greatly increased, and uncontrollable transaction caused by overlong transaction recording offline time is prevented.

EXAMPLE six

Based on the same idea, the processing method for offline transaction provided in the embodiment of the present specification further provides a processing apparatus for offline transaction, where the apparatus is provided with a trusted execution environment, as shown in fig. 7.

The processing device of the off-line transaction comprises: an information acquisition module 701, a status marking module 702, and a clearing module 703, wherein:

the information acquisition module 701 is used for storing the transaction information of the target transaction in the trusted execution environment under the condition of acquiring the transaction information of the target transaction in an offline transaction scene;

a state flag module 702, configured to generate a transaction state flag of the target transaction in the trusted execution environment, set the transaction state flag of the target transaction as in-transaction, and set the transaction state flag of the target transaction in the trusted execution environment as transaction completion from in-transaction if the target transaction is completed;

a clearing module 703 for performing a transaction clearing process with a preset clearing validity period on the target transaction based on the transaction information of the target transaction and the information of the transaction status flag of the target transaction.

In an embodiment of this specification, the apparatus further includes:

the notification acquisition module is used for acquiring the transaction completion message of the target transaction provided by the device and acquiring the notification message of the transaction completion of the target transaction provided by the other party of the target transaction;

and the transaction determining module is used for determining that the target transaction is completed if the transaction completion message and the notification message of the target transaction are acquired.

In this embodiment of the present specification, the clearing module 703 sends the transaction information of the target transaction and the information of the transaction status flag of the target transaction to enable the transaction clearing processing to be performed on the target transaction based on the transaction information of the target transaction and the information of the transaction status flag of the target transaction and the preset clearing validity period corresponding to the target transaction.

In an embodiment of this specification, the apparatus further includes:

and the assistance module is used for acquiring the transaction information of the first transaction from the terminal equipment of the other party of the target transaction and sending the transaction information of the first transaction to the terminal equipment of the other party of the target transaction so as to enable the transaction information based on the first transaction to execute the transaction clearing processing on the first transaction if the trusted execution environment of the terminal equipment of the other party of the target transaction comprises the transaction information of the first transaction of which the transaction state is marked as transaction completion and the transaction clearing processing is not executed to the request.

In an embodiment of this specification, the transaction status flag of the target transaction is set in the transaction information of the target transaction.

In an embodiment of this specification, the apparatus further includes:

and the logout module is used for logging out the transaction information of the target transaction and the transaction state mark of the target transaction stored in the trusted execution environment under the condition of receiving the sent notification message that the transaction clearing processing of the target transaction is completed.

In an embodiment of this specification, the logout module includes:

the judging unit is used for judging whether the transaction information of the target transaction stored in the trusted execution environment meets a preset logout condition under the condition of receiving the sent notification message that the transaction clearing processing of the target transaction is completed, wherein the logout condition is constructed based on a storage time length and/or a transaction type corresponding to the target transaction;

and the logout unit is used for logging out the transaction information of the target transaction and the transaction state mark of the target transaction stored in the trusted execution environment if the transaction information of the target transaction and the transaction state mark of the target transaction are met.

The embodiment of the specification provides a processing device for off-line transactions, which is provided with a trusted execution environment, stores transaction information of a target transaction in the trusted execution environment under the condition that the transaction information of the target transaction in an off-line transaction scene is acquired, generates a transaction state flag of the target transaction in the trusted execution environment, sets the transaction state flag of the target transaction as in-transaction, sets the transaction state flag of the target transaction in the trusted execution environment as transaction completion from the transaction when the target transaction is completed, and finally executes transaction clearing processing with a preset clearing validity period on the basis of the transaction information of the target transaction and the information of the transaction state flag of the target transaction, so that the off-line transaction is cleared on the basis of the clearing validity period and the transaction state flag, thereby effectively avoiding transaction disputes, reduce the investment loss and improve the transaction safety and the transaction experience.

In addition, the corresponding recording rule of the transaction information is designed based on the transaction state mark, double spending (resource pre-transfer can be carried out if the transaction information exists) can be effectively prevented, asynchronous transaction information caused by network reasons is prevented, in addition, the transaction information synchronization rule based on the clearing validity period is set, arbitration of disputed transactions can be effectively carried out, in addition, the transaction information is synchronized based on the network of the terminal equipment of one party in the transaction, therefore, the synchronization time of the transaction information can be greatly increased, and uncontrollable transaction caused by overlong transaction recording offline time is prevented.

EXAMPLE seven

Based on the same idea, embodiments of the present specification further provide an offline transaction processing apparatus, where the apparatus is provided with a trusted execution environment, as shown in fig. 8.

The processing device of the off-line transaction comprises: a first information receiving module 801 and a first clearing module 802, wherein:

the first information receiving module 801 is configured to receive transaction information of a target transaction and information of a transaction state flag of the target transaction, which are sent by a terminal device, where the transaction information of the target transaction and the information of the transaction state flag of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction in an offline transaction scenario, the transaction state flag of the target transaction is generated and set as a transaction state flag in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and when the target transaction is completed, the transaction state flag of the target transaction in the trusted execution environment is set as transaction completion from the transaction;

the first clearing module 802 performs transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction to which the terminal device belongs, the transaction information of the target transaction, the information of the transaction status flag of the target transaction, and the preset clearing validity period corresponding to the target transaction.

In this embodiment, the first clearing module 802 includes:

a first information receiving unit, configured to receive, within the preset clearing validity period, related information for performing transaction clearing on the target transaction sent by a target party of the target transaction if the transaction party in the target transaction to which the terminal device belongs is a transaction initiator and a transaction state of the target transaction is marked as transaction completion;

and the first clearing unit is used for executing transaction clearing processing on the target transaction based on the transaction information of the target transaction and the received related information for performing transaction clearing on the target transaction, which is sent by the target party, if the related information for performing transaction clearing on the target transaction, which is sent by the target party, is received in the preset clearing validity period.

In this embodiment of this specification, if a transaction party in the target transaction to which the terminal device belongs is a target party, a transaction state flag of the target transaction is that the transaction is completed, and the transaction information of the target transaction and the information of the transaction state flag of the target transaction are received within the preset clearing validity period, the first clearing module 802 performs transaction clearing processing on the target transaction based on the transaction information of the target transaction.

In an embodiment of this specification, the apparatus further includes:

the second information receiving module is used for receiving the transaction information of the first transaction sent by the terminal equipment, wherein the transaction information of the first transaction is the transaction information which is detected by the terminal equipment that the trusted execution environment of the terminal equipment of the other party of the target transaction comprises a transaction state mark as transaction completion and does not execute transaction clearing processing to the request;

a second clearing module that performs a transaction clearing process on the first transaction based on the transaction information of the first transaction.

In an embodiment of this specification, the apparatus further includes:

the arbitration request module is used for receiving a transaction arbitration request of the target transaction, which is sent by the terminal equipment, wherein the transaction arbitration request is sent when the transaction state of the target transaction in the trusted execution environment is marked as in-transaction;

the information acquisition module is used for acquiring related information for transaction clearing of the target transaction within the preset clearing validity period based on the transaction arbitration request;

and the transaction arbitration module executes transaction arbitration processing corresponding to the transaction arbitration request if the relevant information for performing transaction clearing on the target transaction is not acquired within the preset clearing validity period.

The embodiment of the present specification provides an offline transaction processing apparatus, which receives transaction information of a target transaction and information of a transaction state flag of the target transaction sent by a terminal device, where the transaction information of the target transaction and the information of the transaction state flag of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction in an offline transaction scenario, the transaction state flag of the target transaction is generated and set as a transaction state flag in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and when the target transaction is completed, the transaction state flag of the target transaction in the trusted execution environment is set as a transaction completion from the transaction, and then, based on information of a transaction party in the target transaction to which the terminal device belongs, the transaction information of the target transaction and the information of the transaction state flag of the target transaction, and executing transaction clearing processing on the target transaction according to the preset clearing validity period corresponding to the target transaction, so that the offline transaction is cleared based on the clearing validity period and the transaction state mark, thereby effectively avoiding transaction disputes, reducing the investment loss and improving the transaction safety and transaction experience.

In addition, the corresponding recording rule of the transaction information is designed based on the transaction state mark, double spending (resource pre-transfer can be carried out if the transaction information exists) can be effectively prevented, asynchronous transaction information caused by network reasons is prevented, in addition, the transaction information synchronization rule based on the clearing validity period is set, arbitration of disputed transactions can be effectively carried out, in addition, the transaction information is synchronized based on the network of the terminal equipment of one party in the transaction, therefore, the synchronization time of the transaction information can be greatly increased, and uncontrollable transaction caused by overlong transaction recording offline time is prevented.

Example eight

Based on the same idea, the embodiments of the present disclosure further provide an offline transaction processing apparatus, which is an apparatus in a blockchain system, as shown in fig. 9.

The processing device of the off-line transaction comprises: a contract deployment module 901, a first information receiving module 902, and a first clearing module 903, wherein:

the contract deployment module 901 is configured to acquire rule information for executing transaction clearing processing on a target transaction, generate a corresponding first intelligent contract based on the rule information for executing transaction clearing processing on the target transaction, and deploy the first intelligent contract into the blockchain system;

the first information receiving module 902 is configured to receive transaction information of a target transaction and information of a transaction state flag of the target transaction, which are sent by a terminal device, where the transaction information of the target transaction and the information of the transaction state flag of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction in an offline transaction scenario, the transaction state flag of the target transaction is generated and set as a transaction state flag in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and when the target transaction is completed, the transaction state flag of the target transaction in the trusted execution environment is set as transaction completion from the transaction;

the first clearing module 903 calls the first intelligent contract, and executes transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction to which the terminal device belongs, the transaction information of the target transaction, the information of the transaction state flag of the target transaction, and the preset clearing validity period corresponding to the target transaction.

In an embodiment of this specification, the apparatus further includes:

the second information receiving module is used for receiving transaction information of a first transaction sent by the terminal equipment, wherein the transaction information of the first transaction is transaction information which is obtained by the terminal equipment detecting that a trusted execution environment of the terminal equipment of the other party of the target transaction includes a transaction state mark as transaction completion and does not request the blockchain system to execute transaction clearing processing;

and the second clearing module calls a second intelligent contract which is pre-deployed in the blockchain system and executes transaction clearing processing on the first transaction based on the transaction information of the first transaction.

In an embodiment of this specification, the apparatus further includes:

the arbitration request module is used for receiving a transaction arbitration request of the target transaction, which is sent by the terminal equipment, wherein the transaction arbitration request is sent when the transaction state of the target transaction in the trusted execution environment is marked as in-transaction;

the information acquisition module is used for calling a third intelligent contract which is pre-deployed in the block chain system and acquiring related information for transaction clearing of the target transaction within the preset clearing validity period based on the transaction arbitration request;

and the arbitration module executes transaction arbitration processing corresponding to the transaction arbitration request based on the third intelligent contract if the relevant information for performing transaction clearing on the target transaction is not acquired within the preset clearing validity period.

The embodiment of the specification provides an offline transaction processing device, which acquires rule information for executing transaction clearing processing on a target transaction, generates a corresponding first intelligent contract based on the rule information for executing the transaction clearing processing on the target transaction, deploys the first intelligent contract into a blockchain system, calls the first intelligent contract when receiving transaction information of the target transaction and information of a transaction state mark of the target transaction sent by a terminal device, and executes the transaction clearing processing on the target transaction based on information of a transaction party in the target transaction to which the terminal device belongs, the transaction information of the target transaction and the information of the transaction state mark of the target transaction, and a preset clearing validity period corresponding to the target transaction, wherein the transaction information of the target transaction and the information of the transaction state mark of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction under an offline transaction scene, the transaction state flag of the target transaction is generated and set as a transaction state flag in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and the transaction state flag of the target transaction in the trusted execution environment is set to be completed from the transaction in the transaction under the condition that the target transaction is completed.

In addition, the corresponding recording rule of the transaction information is designed based on the transaction state mark, double spending (resource pre-transfer can be carried out if the transaction information exists) can be effectively prevented, asynchronous transaction information caused by network reasons is prevented, in addition, the transaction information synchronization rule based on the clearing validity period is set, arbitration of disputed transactions can be effectively carried out, in addition, the transaction information is synchronized based on the network of the terminal equipment of one party in the transaction, therefore, the synchronization time of the transaction information can be greatly increased, and uncontrollable transaction caused by overlong transaction recording offline time is prevented.

Example nine

Based on the same idea, the processing apparatus for offline transaction provided in the embodiment of the present specification further provides a processing device for offline transaction, as shown in fig. 10.

The processing device for the offline transaction may be a terminal device, a server, or a device in the blockchain system provided in the above embodiments.

The processing device for offline transactions may have a large difference due to different configurations or performances, and may include one or more processors 1001 and a memory 1002, and the memory 1002 may store one or more stored applications or data. Memory 1002 may be, among other things, transient storage or persistent storage. The application stored in memory 1002 may include one or more modules (not shown), each of which may include a series of computer-executable instructions in a processing device for offline transactions. Still further, the processor 1001 may be configured to communicate with the memory 1002 to execute a series of computer-executable instructions in the memory 1002 on a processing device for an offline transaction. The processing apparatus for offline transactions may also include one or more power supplies 1003, one or more wired or wireless network interfaces 1004, one or more input-output interfaces 1005, one or more keyboards 1006.

In particular, in this embodiment, the processing device for offline transactions 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 processing device for offline transactions, and the one or more programs configured to be executed by the one or more processors include computer-executable instructions for:

the method is applied to the terminal equipment which is provided with a trusted execution environment, and comprises the following steps:

under the condition that the transaction information of the target transaction under the offline transaction scene is acquired, storing the transaction information of the target transaction in the trusted execution environment;

generating a transaction state flag of the target transaction in the trusted execution environment, setting the transaction state flag of the target transaction as transaction in progress, and setting the transaction state flag of the target transaction in the trusted execution environment as transaction completion from transaction in progress when the target transaction is completed;

and executing transaction clearing processing with a preset clearing validity period on the target transaction based on the transaction information of the target transaction and the information of the transaction state mark of the target transaction.

In the embodiment of this specification, the method further includes:

acquiring a transaction completion message of the target transaction provided by the terminal equipment, and acquiring a notification message of the transaction completion of the target transaction provided by the other party of the target transaction;

and if the transaction completion message and the notification message of the target transaction are acquired, determining that the target transaction is completed.

In an embodiment of the present specification, the executing, on the target transaction, a transaction clearing process with a preset clearing validity period based on the transaction information of the target transaction and the information of the transaction status flag of the target transaction includes:

and sending the transaction information of the target transaction and the information of the transaction state mark of the target transaction to enable the transaction information based on the target transaction and the information of the transaction state mark of the target transaction and the preset clearing validity period corresponding to the target transaction to execute transaction clearing processing on the target transaction.

In the embodiment of this specification, the method further includes:

and if the trusted execution environment of the terminal equipment of the other party of the target transaction is detected to comprise the transaction information of the first transaction of which the transaction state is marked as transaction completion and the transaction clearing processing is not executed to the request, acquiring the transaction information of the first transaction from the terminal equipment of the other party of the target transaction, and sending the transaction information of the first transaction to the target terminal equipment so as to enable the transaction information based on the first transaction to execute the transaction clearing processing on the first transaction.

In an embodiment of this specification, the transaction status flag of the target transaction is set in the transaction information of the target transaction.

In the embodiment of this specification, the method further includes:

and under the condition of receiving the sent notification message that the transaction clearing processing of the target transaction is completed, logging out the transaction information of the target transaction and the transaction state mark of the target transaction, which are stored in the trusted execution environment.

In this embodiment of this specification, in the case of receiving the sent notification message that the transaction clearing process of the target transaction is completed, the logging out the transaction information of the target transaction and the transaction status flag of the target transaction stored in the trusted execution environment includes:

under the condition that the sent notification message that the transaction clearing processing of the target transaction is completed is received, whether the transaction information of the target transaction stored in the trusted execution environment meets a preset logout condition is judged, wherein the logout condition is constructed based on a storage duration and/or a transaction type corresponding to the target transaction;

and if so, logging off the transaction information of the target transaction and the transaction state mark of the target transaction stored in the trusted execution environment.

Further, in particular in this embodiment, the processing device for offline transactions 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 processing device for offline transactions, and the one or more programs configured to be executed by the one or more processors include computer-executable instructions for:

receiving transaction information of a target transaction and information of a transaction state mark of the target transaction, which are sent by a terminal device, wherein the transaction information of the target transaction and the information of the transaction state mark of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction under an offline transaction scene, the transaction state mark of the target transaction is generated and set as a transaction state mark in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and the transaction state mark of the target transaction in the trusted execution environment is set as transaction completion from the transaction when the target transaction is completed;

and executing transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction, the transaction information of the target transaction, the information of the transaction state mark of the target transaction and the preset clearing validity period corresponding to the target transaction, wherein the information of the transaction party, the transaction information of the target transaction and the information of the transaction state mark of the target transaction belong to the terminal equipment.

In this embodiment of the present specification, the executing transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction to which the terminal device belongs, the transaction information of the target transaction, the information of the transaction state flag of the target transaction, and the preset clearing validity period corresponding to the target transaction includes:

if the transaction party in the target transaction to which the terminal device belongs is a transaction initiator and the transaction state of the target transaction is marked as transaction completion, receiving related information for performing transaction clearing on the target transaction, which is sent by the target party of the target transaction, within the preset clearing validity period;

and if the related information for carrying out transaction clearing on the target transaction, which is sent by the target party of the target transaction, is received within the preset clearing validity period, carrying out transaction clearing processing on the target transaction based on the transaction information of the target transaction and the received related information for carrying out transaction clearing on the target transaction, which is sent by the target party.

In this embodiment of the present specification, the executing transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction to which the terminal device belongs, the transaction information of the target transaction, the information of the transaction state flag of the target transaction, and the preset clearing validity period corresponding to the target transaction includes:

and if the transaction party in the target transaction to which the terminal equipment belongs is the target party, the transaction state mark of the target transaction is transaction completion, and the transaction information of the target transaction and the information of the transaction state mark of the target transaction are received in the preset clearing validity period, executing transaction clearing processing on the target transaction based on the transaction information of the target transaction.

In the embodiment of this specification, the method further includes:

receiving transaction information of a first transaction sent by the terminal device, wherein the transaction information of the first transaction is transaction information which is detected by the terminal device that a trusted execution environment of the terminal device of the other party of the target transaction includes a transaction state mark as transaction completion and does not execute transaction clearing processing to the request;

performing a transaction clearing process on the first transaction based on the transaction information for the first transaction.

In the embodiment of this specification, the method further includes:

receiving a transaction arbitration request of the target transaction sent by the terminal device, wherein the transaction arbitration request is sent when the transaction state of the target transaction in the trusted execution environment is marked as transaction in progress;

acquiring related information for transaction clearing of the target transaction within the preset clearing validity period based on the transaction arbitration request;

and if the relevant information for carrying out transaction clearing on the target transaction is not acquired within the preset clearing validity period, executing transaction arbitration processing corresponding to the transaction arbitration request.

Further, in particular in this embodiment, the processing device for offline transactions 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 processing device for offline transactions, and the one or more programs configured to be executed by the one or more processors include computer-executable instructions for:

acquiring rule information for executing transaction clearing processing on a target transaction, generating a corresponding first intelligent contract based on the rule information for executing the transaction clearing processing on the target transaction, and deploying the first intelligent contract into a blockchain system;

receiving transaction information of a target transaction and information of a transaction state mark of the target transaction, which are sent by a terminal device, wherein the transaction information of the target transaction and the information of the transaction state mark of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction under an offline transaction scene, the transaction state mark of the target transaction is generated and set as a transaction state mark in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and the transaction state mark of the target transaction in the trusted execution environment is set as transaction completion from the transaction when the target transaction is completed;

and calling the first intelligent contract, and executing transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction, the transaction information of the target transaction, the information of the transaction state mark of the target transaction and the preset clearing validity period corresponding to the target transaction, wherein the information of the transaction party in the target transaction belongs to the terminal equipment.

In the embodiment of this specification, the method further includes:

receiving transaction information of a first transaction sent by the terminal device, wherein the transaction information of the first transaction is transaction information which is detected by the terminal device that a trusted execution environment of the terminal device of the other party of the target transaction includes a transaction state mark as transaction completion and does not request the blockchain system to execute transaction clearing processing;

and calling a second intelligent contract which is deployed in advance in the blockchain system, and executing transaction clearing processing on the first transaction based on the transaction information of the first transaction.

In the embodiment of this specification, the method further includes:

receiving a transaction arbitration request of the target transaction sent by the terminal device, wherein the transaction arbitration request is sent when the transaction state of the target transaction in the trusted execution environment is marked as transaction in progress;

calling a third intelligent contract which is pre-deployed in the block chain system, and acquiring related information for transaction clearing of the target transaction within the preset clearing validity period based on the transaction arbitration request;

and if the related information for carrying out transaction clearing on the target transaction is not acquired within the preset clearing validity period, executing transaction arbitration processing corresponding to the transaction arbitration request based on the third intelligent contract.

The embodiment of the present specification provides an offline transaction processing device, which, when transaction information of a target transaction in an offline transaction scenario is obtained, stores the transaction information of the target transaction in a trusted execution environment, generates a transaction state flag of the target transaction in the trusted execution environment, sets the transaction state flag of the target transaction as in-transaction, and sets the transaction state flag of the target transaction in the trusted execution environment as transaction completion when the target transaction is completed, and finally, performs a transaction clearing process with a preset clearing validity period on the target transaction based on the transaction information of the target transaction and the transaction state flag of the target transaction, so as to perform the clearing process on the offline transaction based on the clearing validity period and the transaction state flag, thereby effectively avoiding the occurrence of transaction dispute and reducing investment loss, the transaction safety and the transaction experience are improved.

In addition, the corresponding recording rule of the transaction information is designed based on the transaction state mark, double spending (resource pre-transfer can be carried out if the transaction information exists) can be effectively prevented, asynchronous transaction information caused by network reasons is prevented, in addition, the transaction information synchronization rule based on the clearing validity period is set, arbitration of disputed transactions can be effectively carried out, in addition, the transaction information is synchronized based on the network of the terminal equipment of one party in the transaction, therefore, the synchronization time of the transaction information can be greatly increased, and uncontrollable transaction caused by overlong transaction recording offline time is prevented.

Example ten

Further, based on the methods shown in fig. 1 to fig. 6B, one or more embodiments of the present specification further provide a storage medium for storing computer-executable instruction information, in a specific embodiment, the storage medium may be a usb disk, an optical disk, a hard disk, and the like, and when the storage medium stores the computer-executable instruction information, the storage medium implements the following processes:

under the condition of acquiring the transaction information of the target transaction in an off-line transaction scene, storing the transaction information of the target transaction in a trusted execution environment of terminal equipment;

generating a transaction state flag of the target transaction in the trusted execution environment, setting the transaction state flag of the target transaction as transaction in progress, and setting the transaction state flag of the target transaction in the trusted execution environment as transaction completion from transaction in progress when the target transaction is completed;

and executing transaction clearing processing with a preset clearing validity period on the target transaction based on the transaction information of the target transaction and the information of the transaction state mark of the target transaction.

In the embodiment of this specification, the method further includes:

acquiring a transaction completion message of the target transaction provided by the terminal equipment, and acquiring a notification message of the transaction completion of the target transaction provided by the other party of the target transaction;

and if the transaction completion message and the notification message of the target transaction are acquired, determining that the target transaction is completed.

In an embodiment of the present specification, the executing, on the target transaction, a transaction clearing process with a preset clearing validity period based on the transaction information of the target transaction and the information of the transaction status flag of the target transaction includes:

and sending the transaction information of the target transaction and the information of the transaction state mark of the target transaction to enable the transaction information based on the target transaction and the information of the transaction state mark of the target transaction and the preset clearing validity period corresponding to the target transaction to execute transaction clearing processing on the target transaction.

In the embodiment of this specification, the method further includes:

and if the trusted execution environment of the terminal equipment of the other party of the target transaction is detected to comprise the transaction information of the first transaction of which the transaction state is marked as transaction completion and the transaction clearing processing is not executed to the request, acquiring the transaction information of the first transaction from the terminal equipment of the other party of the target transaction, and sending the transaction information of the first transaction to the target terminal equipment so as to enable the transaction information based on the first transaction to execute the transaction clearing processing on the first transaction.

In an embodiment of this specification, the transaction status flag of the target transaction is set in the transaction information of the target transaction.

In the embodiment of this specification, the method further includes:

and under the condition of receiving the sent notification message that the transaction clearing processing of the target transaction is completed, logging out the transaction information of the target transaction and the transaction state mark of the target transaction, which are stored in the trusted execution environment.

In this embodiment of this specification, in the case of receiving the sent notification message that the transaction clearing process of the target transaction is completed, the logging out the transaction information of the target transaction and the transaction status flag of the target transaction stored in the trusted execution environment includes:

under the condition that the sent notification message that the transaction clearing processing of the target transaction is completed is received, whether the transaction information of the target transaction stored in the trusted execution environment meets a preset logout condition is judged, wherein the logout condition is constructed based on a storage duration and/or a transaction type corresponding to the target transaction;

and if so, logging off the transaction information of the target transaction and the transaction state mark of the target transaction stored in the trusted execution environment.

In another specific embodiment, the storage medium may be a usb disk, an optical disk, a hard disk, or the like, and when executed by the processor, the storage medium stores computer-executable instruction information that implement the following processes:

receiving transaction information of a target transaction and information of a transaction state mark of the target transaction, which are sent by a terminal device, wherein the transaction information of the target transaction and the information of the transaction state mark of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction under an offline transaction scene, the transaction state mark of the target transaction is generated and set as a transaction state mark in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and the transaction state mark of the target transaction in the trusted execution environment is set as transaction completion from the transaction when the target transaction is completed;

and executing transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction, the transaction information of the target transaction, the information of the transaction state mark of the target transaction and the preset clearing validity period corresponding to the target transaction, wherein the information of the transaction party, the transaction information of the target transaction and the information of the transaction state mark of the target transaction belong to the terminal equipment.

In this embodiment of the present specification, the executing transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction to which the terminal device belongs, the transaction information of the target transaction, the information of the transaction state flag of the target transaction, and the preset clearing validity period corresponding to the target transaction includes:

if the transaction party in the target transaction to which the terminal device belongs is a transaction initiator and the transaction state of the target transaction is marked as transaction completion, receiving related information for performing transaction clearing on the target transaction, which is sent by the target party of the target transaction, within the preset clearing validity period;

and if the related information for carrying out transaction clearing on the target transaction, which is sent by the target party of the target transaction, is received within the preset clearing validity period, carrying out transaction clearing processing on the target transaction based on the transaction information of the target transaction and the received related information for carrying out transaction clearing on the target transaction, which is sent by the target party.

In this embodiment of the present specification, the executing transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction to which the terminal device belongs, the transaction information of the target transaction, the information of the transaction state flag of the target transaction, and the preset clearing validity period corresponding to the target transaction includes:

and if the transaction party in the target transaction to which the terminal equipment belongs is the target party, the transaction state mark of the target transaction is transaction completion, and the transaction information of the target transaction and the information of the transaction state mark of the target transaction are received in the preset clearing validity period, executing transaction clearing processing on the target transaction based on the transaction information of the target transaction.

In the embodiment of this specification, the method further includes:

receiving transaction information of a first transaction sent by the terminal device, wherein the transaction information of the first transaction is transaction information which is detected by the terminal device that a trusted execution environment of the terminal device of the other party of the target transaction includes a transaction state mark as transaction completion and does not execute transaction clearing processing to the request;

performing a transaction clearing process on the first transaction based on the transaction information for the first transaction.

In the embodiment of this specification, the method further includes:

receiving a transaction arbitration request of the target transaction sent by the terminal device, wherein the transaction arbitration request is sent when the transaction state of the target transaction in the trusted execution environment is marked as transaction in progress;

acquiring related information for transaction clearing of the target transaction within the preset clearing validity period based on the transaction arbitration request;

and if the relevant information for carrying out transaction clearing on the target transaction is not acquired within the preset clearing validity period, executing transaction arbitration processing corresponding to the transaction arbitration request.

In another specific embodiment, the storage medium may be a usb disk, an optical disk, a hard disk, or the like, and when executed by the processor, the storage medium stores computer-executable instruction information that implement the following processes:

acquiring rule information for executing transaction clearing processing on a target transaction, generating a corresponding first intelligent contract based on the rule information for executing the transaction clearing processing on the target transaction, and deploying the first intelligent contract into a blockchain system;

receiving transaction information of a target transaction and information of a transaction state mark of the target transaction, which are sent by a terminal device, wherein the transaction information of the target transaction and the information of the transaction state mark of the target transaction are stored in a trusted execution environment of the terminal device, the target transaction is a transaction under an offline transaction scene, the transaction state mark of the target transaction is generated and set as a transaction state mark in the transaction after the transaction information of the target transaction is stored in the trusted execution environment, and the transaction state mark of the target transaction in the trusted execution environment is set as transaction completion from the transaction when the target transaction is completed;

and calling the first intelligent contract, and executing transaction clearing processing on the target transaction based on the information of the transaction party in the target transaction, the transaction information of the target transaction, the information of the transaction state mark of the target transaction and the preset clearing validity period corresponding to the target transaction, wherein the information of the transaction party in the target transaction belongs to the terminal equipment.

In the embodiment of this specification, the method further includes:

receiving transaction information of a first transaction sent by the terminal device, wherein the transaction information of the first transaction is transaction information which is detected by the terminal device that a trusted execution environment of the terminal device of the other party of the target transaction includes a transaction state mark as transaction completion and does not request the blockchain system to execute transaction clearing processing;

and calling a second intelligent contract which is deployed in advance in the blockchain system, and executing transaction clearing processing on the first transaction based on the transaction information of the first transaction.

In the embodiment of this specification, the method further includes:

receiving a transaction arbitration request of the target transaction sent by the terminal device, wherein the transaction arbitration request is sent when the transaction state of the target transaction in the trusted execution environment is marked as transaction in progress;

calling a third intelligent contract which is pre-deployed in the block chain system, and acquiring related information for transaction clearing of the target transaction within the preset clearing validity period based on the transaction arbitration request;

and if the related information for carrying out transaction clearing on the target transaction is not acquired within the preset clearing validity period, executing transaction arbitration processing corresponding to the transaction arbitration request based on the third intelligent contract.

The embodiment of the specification provides a storage medium, which stores transaction information of a target transaction in a trusted execution environment when the transaction information of the target transaction in an offline transaction scene is acquired, and generates a transaction state flag of the target transaction in the trusted execution environment, sets the transaction state flag of the target transaction in the transaction, in the event that the target transaction is completed, a transaction status flag for the target transaction in the trusted execution environment is set from the in-transaction to transaction complete, and, ultimately, a transaction clearing process having a preset clearing validity period may be performed on the target transaction based on the transaction information of the target transaction and the information of the transaction status flag of the target transaction, such that the offline transaction is cleared based on the clearing validity period and the transaction status flag, therefore, the generation of transaction disputes can be effectively avoided, the loss of resources is reduced, and the transaction safety and the transaction experience are improved.

In addition, the corresponding recording rule of the transaction information is designed based on the transaction state mark, double spending (resource pre-transfer can be carried out if the transaction information exists) can be effectively prevented, asynchronous transaction information caused by network reasons is prevented, in addition, the transaction information synchronization rule based on the clearing validity period is set, arbitration of disputed transactions can be effectively carried out, in addition, the transaction information is synchronized based on the network of the terminal equipment of one party in the transaction, therefore, the synchronization time of the transaction information can be greatly increased, and uncontrollable transaction caused by overlong transaction recording offline time is prevented.

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 may 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 90 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 making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. 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 storing 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 an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: the ARC625D, 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, and are described separately. Of course, the functionality of the various elements may be implemented in the same one or more software and/or hardware implementations in implementing one or more embodiments of the present description.

As will be appreciated by one skilled in the art, 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, one or more embodiments of the present 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.

Embodiments of the present description are described 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 fraud case serial-parallel apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable fraud case serial-parallel 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 fraud case 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 fraud case serial-parallel 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.

As will be appreciated by one skilled in the art, 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, one or more embodiments of the present 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.

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, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.

The above description is only an example of the present specification, and is not intended to limit the present specification. Various modifications and alterations to this description will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the scope of the claims of the present specification.

42页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:地址溯源方法、装置及设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!