Smart contract-based order processing method and apparatus, and storage medium

By using smart contracts to process orders on the blockchain, the problems of low efficiency and low accuracy in the existing technology are solved, and efficient, accurate and automated order processing is achieved.

WO2025112484A1PCT designated stage expired Publication Date: 2025-06-05SHENZHEN QIANHAI HUANRONG LIANYI INFORMATION TECHNOLOGY SERVICES CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/100706
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-11-28
Filing Date
2024-06-21
Publication Date
2025-06-05

AI Technical Summary

Technical Problem

In the prior art, order processing efficiency is low and the accuracy is not high, mainly due to negligence and slow processing speed caused by manual review.

Method used

The order processing method based on smart contracts is adopted to write transaction action information, transaction condition information and transaction resources into the smart contract on the blockchain. The smart contract automatically determines whether the order meets the transaction conditions, and automatically executes transaction processing when the conditions are met.

Benefits of technology

It improves the efficiency and accuracy of order processing, realizes transaction openness and traceability, reduces manual errors, and improves the automation level of order processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024100706_05062025_PF_FP_ABST
    Figure CN2024100706_05062025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of order processing, and discloses a smart contract-based order processing method and apparatus, and a storage medium. The method comprises: in response to a transaction request of a first user for a target order, determining transaction action information, transaction condition information and a transaction resource which correspond to the target order; writing the transaction action information and the transaction condition information into a transaction smart contract on a preset blockchain, storing the transaction resource into the transaction smart contract, and triggering the execution of the transaction smart contract, wherein the execution process is that: on the basis of the transaction action information and the transaction condition information, the transaction smart contract determines whether the target order meets a preset condition of a successful transaction; and receiving the determination result which is sent by the transaction smart contract and indicates whether the target order meets the preset condition, and if the determination result is that the target order meets the preset condition, sending the transaction resource stored in the transaction smart contract to a second user.
Need to check novelty before this filing date? Find Prior Art

Description

Order processing method, device and storage medium based on smart contract

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on November 28, 2023, with application number 202311625119.3, and invention name “Order processing method, device and storage medium based on smart contract”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of order processing technology, and in particular to an order processing method, device, and storage medium based on smart contracts. Background Art

[0003] In international trade activities, due to the lack of trust between buyers and sellers, for example, the buyer is worried that the seller will not ship the goods as required by the contract after the advance payment is made, and the seller is also worried that the buyer will not pay after the goods are shipped or the shipping documents are submitted. Based on this, the transaction orders of the buyer and seller need to be processed to ensure the transaction security of both parties.

[0004] Currently, order transactions are completed offline, with manual review of transaction orders. However, this manual order processing method results in low order processing efficiency. Furthermore, due to staff negligence, errors may occur in order processing, resulting in low order processing accuracy.

[0005] Application Contents

[0006] This application provides an order processing method, device and storage medium based on smart contracts, which mainly aims to improve the processing efficiency and accuracy of orders.

[0007] According to a first aspect of the present application, a smart contract-based order processing method is provided, comprising:

[0008] In response to a transaction request from a first user for a target order, determining transaction action information, transaction condition information, and transaction resources corresponding to the target order;

[0009] Writing the transaction action information and the transaction condition information into a transaction smart contract on a preset blockchain, storing the transaction resources in the transaction smart contract, and triggering the execution of the transaction smart contract. The execution process of the transaction smart contract is as follows: the transaction smart contract determines whether the target order meets the preset conditions for a successful transaction based on the transaction action information and the transaction condition information;

[0010] Receive a judgment result of whether the target order sent by the transaction smart contract meets the preset condition; if the judgment result is that the target order meets the preset condition, send the transaction resources stored in the transaction smart contract to the second user.

[0011] In some embodiments, the transaction smart contract determines whether the target order meets the preset conditions for a successful transaction based on the transaction action information and the transaction condition information, including:

[0012] Determining a transaction rule corresponding to the target order based on the transaction condition information;

[0013] Based on the transaction rules, the transaction action information is polled, and based on the polling result, it is determined whether the target order meets the preset conditions for a successful transaction.

[0014] In some embodiments, determining the transaction rules corresponding to the target order based on the transaction condition information includes:

[0015] Determining the condition type to which the transaction condition information belongs;

[0016] A rule conversion template corresponding to the condition type is determined, and based on the rule conversion template, the transaction condition information is converted into a transaction rule corresponding to the target order.

[0017] In some embodiments, the transaction action information includes: the transaction resource receiving address corresponding to the second user, the transaction end time, and the determination of whether the target order meets the preset conditions for a successful transaction based on the patrol result, including:

[0018] Determining a sustainability indicator score corresponding to the transaction resource receiving address, and determining whether the sustainability indicator score is greater than a preset score threshold;

[0019] Determining whether the transaction end time is less than a preset time threshold;

[0020] If the sustainability index score is greater than a preset score threshold and the transaction end time is less than a preset time threshold, it is determined that the target order meets the preset conditions for a successful transaction.

[0021] In some embodiments, the method further comprises:

[0022] If the sustainability index score is less than or equal to a preset score threshold, or the transaction end time is greater than or equal to a preset time threshold, it is determined that the target order does not meet the preset conditions for a successful transaction.

[0023] In some embodiments, after receiving the determination result of whether the target order sent by the transaction smart contract satisfies the preset condition, the method further includes:

[0024] If the judgment result is that the target order does not meet the preset condition, the transaction resource is returned to the first user.

[0025] In some embodiments, before writing the transaction action information and the transaction condition information into the transaction smart contract on the preset blockchain, the method further includes:

[0026] Determining whether the transaction condition information consists of an action type element and a time type element;

[0027] If the transaction condition information consists of the action type element and the time type element, determining a write interface for the transaction smart contract on the preset blockchain;

[0028] Writing the transaction action information and the transaction condition information into a transaction smart contract on a preset blockchain includes:

[0029] Based on the write interface, the transaction action information and the transaction condition information are written into the transaction smart contract on the preset blockchain.

[0030] According to a second aspect of the present application, there is provided an order processing device based on a smart contract, comprising:

[0031] a determining unit configured to determine, in response to a first user's transaction request for a target order, transaction action information, transaction condition information, and transaction resources corresponding to the target order;

[0032] a writing unit, configured to write the transaction action information and the transaction condition information into a transaction smart contract on a preset blockchain, store the transaction resources in the transaction smart contract, and trigger execution of the transaction smart contract, wherein the execution process of the transaction smart contract is as follows: the transaction smart contract determines whether the target order meets preset conditions for a successful transaction based on the transaction action information and the transaction condition information;

[0033] The sending unit is configured to receive a judgment result of whether the target order sent by the transaction smart contract meets the preset condition, and if the judgment result is that the target order meets the preset condition, send the transaction resources stored in the transaction smart contract to the second user.

[0034] According to a third aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned order processing method based on smart contracts is implemented.

[0035] According to a fourth aspect of the present application, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned smart contract-based order processing method when executing the program.

[0036] According to an order processing method, device and storage medium based on a smart contract provided by the present application, compared with the current order transaction process which is completed through offline processing, that is, the manual review of transaction orders, the present application determines the transaction action information, transaction condition information and transaction resources corresponding to the target order in response to the transaction request of the first user for the target order; then writes the transaction action information and the transaction condition information to the transaction smart contract on the preset blockchain, stores the transaction resources in the transaction smart contract, and triggers the execution of the transaction smart contract. The execution process of the transaction smart contract is as follows: the transaction smart contract determines whether the target order meets the preset conditions for a successful transaction based on the transaction action information and the transaction condition information; and finally receives the judgment result of whether the target order meets the preset conditions sent by the transaction smart contract. If the judgment result is that the target order meets the preset conditions, the transaction resources stored in the transaction smart contract are sent to the second user. Based on blockchain technology, the transaction processing of orders is written into the smart contract of the blockchain. Each action of order transaction processing is recorded and executed through the smart contract. When the transaction conditions are met, the transaction processing is automatically executed, which makes the transaction public and traceable. The order processing is managed based on the smart contract, and the order processing status is monitored in real time. When the order meets the set conditions, the transaction processing is automatically executed, which realizes the automation of order processing and improves the efficiency and accuracy of order processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0038] FIG1 shows a flow chart of an order processing method based on a smart contract provided in an embodiment of the present application;

[0039] FIG2 shows a flow chart of another order processing method based on smart contracts provided in an embodiment of the present application;

[0040] FIG3 shows a schematic diagram of a process for writing transaction condition information into a transaction smart contract according to an embodiment of the present application;

[0041] FIG4 shows a schematic structural diagram of an order processing device based on a smart contract provided in an embodiment of the present application;

[0042] FIG5 shows a schematic structural diagram of another smart contract-based order processing device provided in an embodiment of the present application;

[0043] FIG6 shows a schematic diagram of the physical structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that, unless there is a conflict, the embodiments and features in the embodiments of the present application can be combined with each other.

[0045] At present, the transaction process of orders is completed offline, that is, the transaction orders are manually reviewed, resulting in low order processing efficiency. At the same time, due to the negligence of staff, order processing errors may occur, resulting in low order processing accuracy.

[0046] To solve the above problems, an embodiment of the present application provides an order processing method based on a smart contract, as shown in FIG1 , the method comprising:

[0047] 101. In response to a transaction request from a first user for a target order, determine transaction action information, transaction condition information, and transaction resources corresponding to the target order.

[0048] Among them, the first user can be a buyer user, the target order can be any commodity order, the transaction action information refers to the transaction start time, transaction process information, transaction address and other information, the transaction conditions are pre-set condition information related to the target order transaction, a transaction consists of multiple conditions, for example, the allowed start time of the transaction, the allowed end time, the allowed initial state, the action state, the conditions that the seller's address should meet, etc. The transaction resources refer to the fees that the buyer should pay after the transaction is completed.

[0049] In some embodiments, when a buyer completes an order for a certain product, a transaction request for the target order is triggered. At this time, the transaction action information, transaction condition information, transaction resources and other information corresponding to the target order are determined, and then a smart contract is constructed. The above-mentioned transaction action information, transaction condition information, transaction resources, etc. are written into the smart contract. Through this contract architecture, different types of transaction conditions are regularized to achieve scalability of condition types. Each action of the transaction is recorded through the smart contract, and the transfer is automatically executed when the transaction conditions are met, thereby improving the efficiency and accuracy of order transactions.

[0050] 102. Writing the transaction action information and transaction condition information into the transaction smart contract on the preset blockchain, storing the transaction resources into the transaction smart contract, and triggering the execution of the transaction smart contract. The execution process of the transaction smart contract is as follows: the transaction smart contract determines whether the target order meets the preset conditions for a successful transaction based on the transaction action information and transaction condition information.

[0051] For the embodiment of the present application, in order to realize the automatic execution of order transactions based on the smart contract on the blockchain, it is necessary to write the transaction action information and transaction conditions corresponding to the target order into the transaction smart contract. At the same time, in order to realize the effective supervision of transaction resources, it is also necessary to store the transaction resources in the transaction smart contract and start the transaction execution of the target order by the transaction smart contract. When a transaction action occurs, the interface of the transaction smart contract is called to record the trade action. The smart contract will judge the current situation of the transaction based on the transaction action type and condition rules. When the polling service polls the transactions in the transaction smart contract, the transactions that meet the conditions are triggered for execution, and the transactions that do not meet the conditions are put on hold. In the process of processing the target order transaction, the payment transaction is initiated by the buyer. The buyer, seller, and bank act as the executors of the transaction action, and the contract acts as the fund and transaction status saver. The transaction contract that meets the conditions will be executed, thereby realizing the automatic execution of the order transaction processing and improving the efficiency and accuracy of the order transaction processing.

[0052] The transaction smart contract consists of four layers, including: transaction contract, condition processing contract, condition contract, and rule contract. Among them, the functions of the transaction contract are: order transaction request, transaction resource storage, execution of order transaction, etc.; the functions of the condition processing contract are: registration condition contract, registration conditions, storage condition index, query of transaction condition status, etc.; the functions of the condition contract are: storage conditions, execution of condition actions; the functions of the rule contract are: storage rules, modification of rules, and query of rule instance status. After the transaction condition information is written to the transaction smart contract, the transaction condition information can be changed as needed.

[0053] 103. Receive a determination result sent by the transaction smart contract on whether the target order satisfies a preset condition. If the determination result is that the target order satisfies the preset condition, send the transaction resources stored in the transaction smart contract to the second user.

[0054] Among them, the second user refers to the seller user. For the embodiment of the present application, in the transaction smart contract, it is possible to judge whether the target order meets the preset conditions for a successful transaction based on the transaction condition information and the transaction action information, and receive the judgment result sent by the transaction smart contract. After receiving the judgment result, the next transaction action is executed. For example, if the judgment result received by the service is that the target order meets the preset conditions for a successful transaction, then the transaction resources stored in the transaction smart contract need to be automatically sent to the second user. If the target order does not meet the preset conditions for a successful transaction, the transaction resources need to be returned to the first user. Therefore, by moving the order transaction processing to the transaction smart contract of the blockchain for execution, the problems of low processing efficiency and low processing accuracy caused by manual processing can be avoided, so that the embodiment of the present application can realize the automated execution of order transaction processing, thereby improving the processing efficiency and processing accuracy of order transactions.

[0055] According to an order processing method based on smart contracts provided by the present application, compared with the current order transaction process which is completed through offline processing, that is, the manual review of transaction orders, the present application determines the transaction action information, transaction condition information, and transaction resources corresponding to the target order in response to the first user's transaction request for the target order; then writes the transaction action information and the transaction condition information to the transaction smart contract on the preset blockchain, stores the transaction resources in the transaction smart contract, and triggers the execution of the transaction smart contract. The execution process of the transaction smart contract is as follows: the transaction smart contract determines whether the target order meets the preset conditions for a successful transaction based on the transaction action information and the transaction condition information; and finally receives the judgment result of whether the target order meets the preset conditions sent by the transaction smart contract. If the judgment result is that the target order meets the preset conditions, the transaction resources stored in the transaction smart contract are sent to the second user. Based on blockchain technology, the transaction processing of orders is written into the smart contract of the blockchain. Each action of order transaction processing is recorded and executed through the smart contract. When the transaction conditions are met, the transaction processing is automatically executed, which makes the transaction public and traceable. The order processing is managed based on the smart contract, and the order processing status is monitored in real time. When the order meets the set conditions, the transaction processing is automatically executed, which realizes the automation of order processing and improves the efficiency and accuracy of order processing.

[0056] Furthermore, to better illustrate the above-mentioned order processing process, as a refinement and extension of the above-mentioned embodiment, the embodiment of the present application provides another order processing method based on a smart contract, as shown in FIG2 , the method comprising:

[0057] 201. In response to a transaction request from a first user for a target order, determine transaction action information, transaction condition information, and transaction resources corresponding to the target order.

[0058] For the embodiment of the present application, when a transaction request for a target order is received from a first user, it is necessary to determine the transaction action information, transaction condition information and transaction resources corresponding to the target order, wherein the transaction resource information refers to the funds paid by the user for the target order. When the first user has not received the goods in the target order, the transaction is not completed. At this time, it is necessary to supervise the funds paid in advance by the first user. The transaction funds can be sent to the second user only when the transaction action information meets the transaction condition information. Among them, the first user refers to the seller user for the target order, the second user refers to the seller user for the target order, and the transaction action information refers to the entire process information of the transaction.

[0059] 202. Write the transaction action information and transaction condition information into a transaction smart contract on a preset blockchain, and store the transaction resources in the transaction smart contract.

[0060] For the embodiment of the present application, in order to realize the automated execution of order transactions, it is necessary to write the transaction action information, transaction condition information and transaction resources corresponding to the target order into the transaction smart contract of the preset blockchain. Before writing into the transaction smart contract, in order to ensure the availability of the transaction conditions, the transaction condition information needs to be checked. Based on this, the method includes: determining whether the transaction condition information is composed of an action type element and a time type element; if the transaction condition information is composed of the action type element and the time type element, determining the write interface of the transaction smart contract on the preset blockchain; based on the write interface, writing the transaction action information and the transaction condition information into the transaction smart contract on the preset blockchain.

[0061] After determining the transaction condition information corresponding to the target order, it is also necessary to determine whether the transaction condition information is composed of a time element and an action type element. If the transaction condition information is composed of the above elements, then the transaction condition information is determined to meet the standard. At this time, it is necessary to determine the information writing interface of the transaction smart contract, and based on the writing interface, write the transaction action information and transaction condition information to the transaction smart contract on the preset blockchain. The transaction smart contract will execute the entire transaction process of the target order, thereby realizing the automated execution of the transaction and improving the processing efficiency and accuracy of the order transaction. Taking international trade transactions as an example, an example of the process of writing transaction condition information and transaction resources into the transaction smart contract can be shown in Figure 3, where Normal acondtion in Figure 3 represents normal conditions, and the user in the figure refers to the first user.

[0062] 203. Trigger the execution of the transaction smart contract. During the execution of the transaction smart contract, the transaction rules corresponding to the target order are determined based on the transaction condition information.

[0063] 204. Based on the transaction rules, the transaction action information is polled, and based on the polling results, it is determined whether the target order meets the preset conditions for a successful transaction.

[0064] The transaction action information includes: the transaction resource receiving address corresponding to the second user, the transaction end time, etc.

[0065] For the embodiment of the present application, after the transaction action information, transaction condition information and transaction resources are written to the blockchain, the execution of the transaction smart contract is triggered. At this time, the transaction smart contract executes the order transaction. During the execution of the transaction smart contract, the transaction conditions need to be converted into transaction rules. Based on this, step 203 includes: determining the condition type to which the transaction condition information belongs; determining a rule conversion template corresponding to the condition type, and based on the rule conversion template, converting the transaction condition information into the transaction rules corresponding to the target order.

[0066] A transaction consists of multiple conditions. A condition should be composed of time elements and work elements. These combinations can be abstracted into a rule. Different condition types correspond to different rule conversion templates. By converting the transaction condition information according to the standard conversion format in the rule conversion template, the transaction rules corresponding to the target order can be obtained. The rules are then registered in the rule contract. By converting conditions of the same type into a unified rule, it is easier to calculate the transaction status, adapt to more transaction types, and provide contract scalability. The converted rules can be shown as follows:

[0067] struct Rule (struct rule) {

[0068] Id(number);

[0069] startTime; / / allowed start time

[0070] endTime; / / allowed end time

[0071] rt; / / Rule initial state WaitForFail, WaitForSuccess

[0072] approved; / / action status

[0073] denied; / / action status

[0074] },

[0075] Meanwhile, Table 1 shows some examples after converting the time element into rules:

[0076] Table 1 Example of conditional transfer rules for time elements

[0077] For example, begintime=0 indicates 1970-01-01 08:00:00, lasttime=4070908800 indicates 2099-01-01 08:00:00, and daytimestamp=86400 indicates 1 day.

[0078] In addition, Table 2 shows some examples after converting action elements into rules:

[0079] Table 2 Example of conditional transition rules for action elements

[0080] Among them, WaitForSuccess means that after the action status is satisfied, it will succeed if it waits until the start time, and WaitForFail means that after the action status is satisfied, it will fail if it waits until the end time. At the same time, the following table shows the rule status change logic:

[0081] Table 3 Rule status change logic

[0082] Among them, RuleType: rule type, timeInRange: time in the range, BeforeTimeInRange: before the time in the range, InTimeInRange: within the time range, AfterTimeInRange: after the time in the range, denied: refused to execute, Waiting: waiting for execution, True: correct (agree to execute), False: wrong (reject execution), approved: agreed to execute. Therefore, the embodiment of the present application is based on blockchain technology, moving the offline transaction scenario to the blockchain network, achieving the openness and traceability of transactions, managing transaction conditions based on smart contracts, realizing the registrability of condition types, enhancing the scalability of the contract architecture, establishing a mapping relationship from transactions to conditions and conditions to rules, abstracting conditions into a common rule, unifying the processing logic of condition status, realizing real-time monitoring of transaction status, and automatically executing transactions when transactions meet the set conditions, thereby realizing transaction automation. For example, a buyer wants to buy goods, and the bank acts as an intermediary. The buyer first deposits money into the bank. The transaction is completed under the following conditions: when the buyer confirms (acknowledge) receipt of the goods (with a time limit) and the bank does not reject (object) the transaction (with a time limit), the money will be transferred to the buyer. The buyer's condition is converted into a rule: time period: startTime, endTime, initial state WaitForFail (failure if endTime is not executed), action state: waiting for approved. When the buyer receives the goods, the user executes the acknowledge action of the payment condition contract, and the corresponding rule approved becomes true. The bank's condition is converted into a rule: time period: startTime, endTime, initial state WaitForSuccess (success if startTime is reached), action state: waiting for denied. When the bank rejects the transaction, the object action of the payment condition contract is executed, and the corresponding rule denied becomes true. The two rules are connected by and to determine the transaction status.

[0083] It should be noted that the above examples are merely one implementation state of the embodiments of the present application, and the embodiments of the present application are not limited to the above examples.

[0084] Furthermore, after constructing the transaction rules, it is necessary to poll the transaction action information based on the transaction rules, and based on the polling results, determine whether the target order meets the preset conditions for a successful transaction. Based on this, step 204 includes: determining the sustainability index score corresponding to the transaction resource receiving address, and determining whether the sustainability index score is greater than a preset score threshold; determining whether the transaction end time is less than a preset time threshold; if the sustainability index score is greater than the preset score threshold, and the transaction end time is less than the preset time threshold, then determining that the target order meets the preset conditions for a successful transaction.

[0085] The preset scoring threshold and the preset time threshold are set according to actual needs. The transaction resource receiving address may be the resource receiving address of the second user. The ESG (Environmental, Social, Governance) score of the resource receiving address is obtained, and it is determined whether the ESG score is greater than the preset scoring threshold, and whether the transaction end time is less than the preset time threshold. Only when the ESG score is greater than the preset scoring threshold and the transaction end time is less than the preset time threshold can it be determined that the target order meets the preset conditions for a successful transaction. At this time, the transaction resources can be sent to the second user. If the sustainability indicator score is less than or equal to the preset scoring threshold, or the transaction end time is greater than or equal to the preset time threshold, it is determined that the target order does not meet the preset conditions for a successful transaction, and the transaction resources are returned to the first user.

[0086] 205. Receive a determination result from the transaction smart contract as to whether the target order satisfies a preset condition. If the determination result is that the target order satisfies the preset condition, send the transaction resources stored in the transaction smart contract to the second user.

[0087] For the embodiment of the present application, after the transaction smart contract determines whether the target order meets the preset conditions for a successful transaction, it receives the judgment result sent by the transaction smart contract. If the judgment result is that the target order meets the preset conditions, the transaction resources stored in the transaction smart contract are sent to the second user. If the judgment result is that the target order does not meet the preset conditions, the transaction resources are returned to the first user to avoid causing loss of transaction resources to the first user.

[0088] According to another smart contract-based order processing method provided by the present application, compared with the current order transaction process that is completed through offline processing, that is, the manual review of transaction orders, the present application determines the transaction action information, transaction condition information, and transaction resources corresponding to the target order in response to the first user's transaction request for the target order; then writes the transaction action information and the transaction condition information to the transaction smart contract on the preset blockchain, and stores the transaction resources in the transaction smart contract, and triggers the execution of the transaction smart contract. The execution process of the transaction smart contract is: the transaction smart contract determines whether the target order meets the preset conditions for a successful transaction based on the transaction action information and the transaction condition information; and finally receives the judgment result of whether the target order meets the preset conditions sent by the transaction smart contract. If the judgment result is that the target order meets the preset conditions, the transaction resources stored in the transaction smart contract are sent to the second user. Based on blockchain technology, the transaction processing of orders is written into the smart contract of the blockchain. Each action of order transaction processing is recorded and executed through the smart contract. When the transaction conditions are met, the transaction processing is automatically executed, which makes the transaction public and traceable. The order processing is managed based on the smart contract, and the order processing status is monitored in real time. When the order meets the set conditions, the transaction processing is automatically executed, which realizes the automation of order processing and improves the efficiency and accuracy of order processing.

[0089] Furthermore, as an implementation of FIG1 , an embodiment of the present application provides an order processing device based on a smart contract, as shown in FIG4 , wherein the device includes: a determination unit 31 , a writing unit 32 and a sending unit 33 .

[0090] The determining unit 31 may be configured to determine the transaction action information, transaction condition information, and transaction resources corresponding to the target order in response to the first user's transaction request for the target order.

[0091] The writing unit 32 can be configured to write the transaction action information and the transaction condition information into a transaction smart contract on a preset blockchain, store the transaction resources in the transaction smart contract, and trigger the execution of the transaction smart contract. The execution process of the transaction smart contract is as follows: the transaction smart contract determines whether the target order meets the preset conditions for a successful transaction based on the transaction action information and the transaction condition information.

[0092] The sending unit 33 can be configured to receive a judgment result of whether the target order sent by the transaction smart contract meets the preset conditions, and if the judgment result is that the target order meets the preset conditions, the transaction resources stored in the transaction smart contract are sent to the second user.

[0093] In some embodiments, in order to determine whether the target order meets the preset conditions for a successful transaction, as shown in FIG5 , the writing unit 32 includes a determination module 321 and a patrol module 322 .

[0094] The determining module 321 may be configured to determine a transaction rule corresponding to the target order based on the transaction condition information.

[0095] The patrol module 322 may be configured to poll the transaction action information based on the transaction rules, and determine whether the target order meets the preset conditions for a successful transaction based on the patrol result.

[0096] In some embodiments, in order to determine the transaction rules corresponding to the target order, the determination module 321 includes a determination submodule and a conversion submodule.

[0097] The determining submodule may be configured to determine the condition type to which the transaction condition information belongs.

[0098] The conversion submodule may be configured to determine a rule conversion template corresponding to the condition type, and convert the transaction condition information into a transaction rule corresponding to the target order based on the rule conversion template.

[0099] In some embodiments, in order to determine whether the target order meets the preset conditions for a successful transaction, the patrol module 322 can be configured to determine the sustainability index score value corresponding to the transaction resource receiving address, and determine whether the sustainability index score value is greater than a preset score threshold; determine whether the transaction end time is less than a preset time threshold; if the sustainability index score value is greater than the preset score threshold, and the transaction end time is less than the preset time threshold, then it is determined that the target order meets the preset conditions for a successful transaction.

[0100] In some embodiments, in order to determine whether the target order meets the preset conditions for a successful transaction, the patrol module 322 can also be configured to determine that the target order does not meet the preset conditions for a successful transaction if the sustainability indicator score is less than or equal to a preset score threshold, or the transaction end time is greater than or equal to a preset time threshold.

[0101] In some embodiments, if the target order does not meet the judgment result of the preset condition, the device further includes: a return unit 34.

[0102] The returning unit 34 may be configured to return the transaction resource to the first user if the judgment result is that the target order does not meet the preset condition.

[0103] In some embodiments, in order to determine whether the transaction conditions are compliant, the device further includes: a determination unit 35 .

[0104] The determining unit 35 may be configured to determine whether the transaction condition information consists of an action type element and a time type element.

[0105] The determining unit 31 may also be configured to determine a writing interface for the transaction smart contract on the preset blockchain if the transaction condition information consists of the action type element and the time type element.

[0106] The writing unit 32 may also be configured to write the transaction action information and the transaction condition information into a transaction smart contract on a preset blockchain based on the writing interface.

[0107] It should be noted that for other corresponding descriptions of the various functional modules involved in the smart contract-based order processing device provided in the embodiment of the present application, please refer to the corresponding description of the method shown in Figure 1, and will not be repeated here.

[0108] Based on the method shown in Figure 1 above, accordingly, an embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, which implements the following steps when executed by a processor: in response to a first user's transaction request for a target order, determining the transaction action information, transaction condition information, and transaction resources corresponding to the target order; writing the transaction action information and the transaction condition information to a transaction smart contract on a preset blockchain, and storing the transaction resources in the transaction smart contract, and triggering the execution of the transaction smart contract. The execution process of the transaction smart contract is: the transaction smart contract determines whether the target order meets the preset conditions for a successful transaction based on the transaction action information and the transaction condition information; receives a judgment result sent by the transaction smart contract on whether the target order meets the preset conditions; if the judgment result is that the target order meets the preset conditions, the transaction resources stored in the transaction smart contract are sent to the second user.

[0109] Based on the embodiment of the method shown in FIG1 and the apparatus shown in FIG4 , an embodiment of the present application further provides a physical structure diagram of a computer device, as shown in FIG6 . The computer device includes: a processor 41, a memory 42, and a computer program stored in the memory 42 and executable on the processor, wherein the memory 42 and the processor 41 are both disposed on a bus 43. When the processor 41 executes the program, the following steps are implemented: in response to a transaction request for a target order by a first user, determining transaction action information, transaction condition information, and transaction resources corresponding to the target order; writing the transaction action information and the transaction condition information to a transaction smart contract on a preset blockchain, storing the transaction resources in the transaction smart contract, and triggering execution of the transaction smart contract. The execution process of the transaction smart contract is as follows: the transaction smart contract determines whether the target order meets preset conditions for a successful transaction based on the transaction action information and the transaction condition information; and receiving a judgment result sent by the transaction smart contract on whether the target order meets the preset conditions. If the judgment result is that the target order meets the preset conditions, the transaction resources stored in the transaction smart contract are sent to the second user.

[0110] Through the technical solution of the present application, the present application determines the transaction action information, transaction condition information, and transaction resources corresponding to the target order in response to the first user's transaction request for the target order; then writes the transaction action information and the transaction condition information to the transaction smart contract on the preset blockchain, and stores the transaction resources in the transaction smart contract, and triggers the execution of the transaction smart contract. The execution process of the transaction smart contract is: the transaction smart contract determines whether the target order meets the preset conditions for a successful transaction based on the transaction action information and the transaction condition information; and finally receives the judgment result of whether the target order meets the preset conditions sent by the transaction smart contract. If the judgment result is that the target order meets the preset conditions, the transaction resources stored in the transaction smart contract are sent to the second user. Based on blockchain technology, the transaction processing of orders is written into the smart contract of the blockchain. Each action of order transaction processing is recorded and executed through the smart contract. When the transaction conditions are met, the transaction processing is automatically executed, which makes the transaction public and traceable. The order processing is managed based on the smart contract, and the order processing status is monitored in real time. When the order meets the set conditions, the transaction processing is automatically executed, which realizes the automation of order processing and improves the efficiency and accuracy of order processing.

[0111] Obviously, those skilled in the art should understand that the modules or steps of the present application described above can be implemented using a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices. In some embodiments, they can be implemented using program codes executable by the computing device, so that they can be stored in a storage device and executed by the computing device. In some cases, the steps shown or described can be performed in a different order than herein, or they can be made into separate integrated circuit modules, or multiple modules or steps can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0112] The above description is merely a preferred embodiment of the present application and is not intended to limit the present application. Persons skilled in the art will readily appreciate that various modifications and variations are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application shall be included within the scope of protection of the present application.

Claims

1. An order processing method based on smart contracts, wherein: include: In response to a transaction request from a first user for a target order, determining transaction action information, transaction condition information, and transaction resources corresponding to the target order; The transaction action information and the transaction condition information are written into a transaction smart contract on a preset blockchain, the transaction resources are stored in the transaction smart contract, and the execution of the transaction smart contract is triggered. The execution process of the transaction smart contract is as follows: the transaction smart contract determines that the target order meets the preset conditions for a successful transaction based on the transaction action information and the transaction condition information; Receive the result that the target order sent by the transaction smart contract meets the preset condition, and send the transaction resources stored in the transaction smart contract to the second user.

2. The method according to claim 1, wherein: The transaction smart contract determines, based on the transaction action information and the transaction condition information, that the target order meets the preset conditions for a successful transaction, including: Based on the transaction condition information, determining a transaction rule corresponding to the target order; Based on the transaction rules, the transaction action information is polled, and based on the polling results, it is determined that the target order meets the preset conditions for a successful transaction.

3. The method according to claim 2, wherein: The determining, based on the transaction condition information, a transaction rule corresponding to the target order includes: Determine the condition type to which the transaction condition information belongs; A rule conversion template corresponding to the condition type is determined, and based on the rule conversion template, the transaction condition information is converted into a transaction rule corresponding to the target order.

4. The method according to claim 2, wherein: The transaction action information includes: the transaction resource receiving address and transaction end time corresponding to the second user; the determination based on the patrol result that the target order meets the preset conditions for a successful transaction includes: Determine a sustainability indicator score corresponding to the transaction resource receiving address; If the sustainability index score value is greater than a preset score threshold, and the transaction end time is less than a preset time threshold, it is determined that the target order meets the preset conditions for a successful transaction.

5. The method according to claim 4, wherein: The method further comprises: If the sustainability index score is less than or equal to a preset score threshold, or the transaction end time is greater than or equal to a preset time threshold, it is determined that the target order does not meet the preset conditions for a successful transaction.

6. The method according to claim 1, wherein: The method further comprises: If the transaction smart contract determines, based on the transaction action information and the transaction condition information, that the target order does not meet the preset conditions for a successful transaction, the transaction resources are returned to the first user.

7. The method according to claim 1, wherein: Before writing the transaction action information and the transaction condition information into the transaction smart contract on the preset blockchain, the method further includes: If the transaction condition information consists of an action type element and a time type element, determining a writing interface of the transaction smart contract on the preset blockchain; The step of writing the transaction action information and the transaction condition information into a transaction smart contract on a preset blockchain includes: Based on the write interface, the transaction action information and the transaction condition information are written into the transaction smart contract on the preset blockchain.

8. An order processing device based on smart contracts, wherein: The device comprises: a determination unit, configured to determine, in response to a transaction request of a first user for a target order, transaction action information, transaction condition information, and transaction resources corresponding to the target order; A writing unit is configured to write the transaction action information and the transaction condition information into a transaction smart contract on a preset blockchain, store the transaction resources into the transaction smart contract, and trigger the execution of the transaction smart contract, wherein the execution process of the transaction smart contract is as follows: the transaction smart contract determines that the target order meets the preset conditions for a successful transaction based on the transaction action information and the transaction condition information; The sending unit is configured to receive the result that the target order sent by the transaction smart contract meets the preset condition, and send the transaction resources stored in the transaction smart contract to the second user.

9. A computer-readable storage medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the following steps are implemented: In response to a transaction request from a first user for a target order, determining transaction action information, transaction condition information, and transaction resources corresponding to the target order; The transaction action information and the transaction condition information are written into a transaction smart contract on a preset blockchain, the transaction resources are stored in the transaction smart contract, and the execution of the transaction smart contract is triggered. The execution process of the transaction smart contract is as follows: the transaction smart contract determines that the target order meets the preset conditions for a successful transaction based on the transaction action information and the transaction condition information; Receive the result that the target order sent by the transaction smart contract meets the preset condition, and send the transaction resources stored in the transaction smart contract to the second user.

10. The computer-readable storage medium of claim 9, wherein: The transaction smart contract determines, based on the transaction action information and the transaction condition information, that the target order meets the preset conditions for a successful transaction, including: Based on the transaction condition information, determining a transaction rule corresponding to the target order; Based on the transaction rules, the transaction action information is polled, and based on the polling results, it is determined that the target order meets the preset conditions for a successful transaction.

11. The computer-readable storage medium of claim 10, wherein: The determining, based on the transaction condition information, a transaction rule corresponding to the target order includes: Determine the condition type to which the transaction condition information belongs; A rule conversion template corresponding to the condition type is determined, and based on the rule conversion template, the transaction condition information is converted into a transaction rule corresponding to the target order.

12. The computer-readable storage medium of claim 10, wherein: The transaction action information includes: the transaction resource receiving address and transaction end time corresponding to the second user; the determination based on the patrol result that the target order meets the preset conditions for a successful transaction includes: Determine a sustainability indicator score corresponding to the transaction resource receiving address; If the sustainability index score value is greater than a preset score threshold, and the transaction end time is less than a preset time threshold, it is determined that the target order meets the preset conditions for a successful transaction.

13. The computer-readable storage medium of claim 12, wherein: When the computer program is executed by a processor, the following steps are also implemented: If the sustainability index score is less than or equal to a preset score threshold, or the transaction end time is greater than or equal to a preset time threshold, it is determined that the target order does not meet the preset conditions for a successful transaction.

14. The computer-readable storage medium of claim 9, wherein: When the computer program is executed by a processor, the following steps are implemented: If the transaction smart contract determines, based on the transaction action information and the transaction condition information, that the target order does not meet the preset conditions for a successful transaction, the transaction resources are returned to the first user.

15. The computer-readable storage medium of claim 9, wherein: When the computer program is executed by a processor, the following steps are implemented: Before writing the transaction action information and the transaction condition information into the transaction smart contract on the preset blockchain, if the transaction condition information consists of an action type element and a time type element, determining a writing interface of the transaction smart contract on the preset blockchain; The step of writing the transaction action information and the transaction condition information into a transaction smart contract on a preset blockchain includes: Based on the write interface, the transaction action information and the transaction condition information are written into the transaction smart contract on the preset blockchain.

16. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the computer program is executed by a processor, the following steps are implemented: In response to a transaction request from a first user for a target order, determining transaction action information, transaction condition information, and transaction resources corresponding to the target order; The transaction action information and the transaction condition information are written into a transaction smart contract on a preset blockchain, the transaction resources are stored in the transaction smart contract, and the execution of the transaction smart contract is triggered. The execution process of the transaction smart contract is as follows: the transaction smart contract determines that the target order meets the preset conditions for a successful transaction based on the transaction action information and the transaction condition information; Receive the result that the target order sent by the transaction smart contract meets the preset condition, and send the transaction resources stored in the transaction smart contract to the second user.

17. The computer device of claim 16, wherein: The transaction smart contract determines, based on the transaction action information and the transaction condition information, that the target order meets the preset conditions for a successful transaction, including: Based on the transaction condition information, determining a transaction rule corresponding to the target order; Based on the transaction rules, the transaction action information is polled, and based on the polling results, it is determined that the target order meets the preset conditions for a successful transaction.

18. The computer device of claim 17, wherein: The determining, based on the transaction condition information, a transaction rule corresponding to the target order includes: Determine the condition type to which the transaction condition information belongs; A rule conversion template corresponding to the condition type is determined, and based on the rule conversion template, the transaction condition information is converted into a transaction rule corresponding to the target order.

19. The computer device of claim 17, wherein: The transaction action information includes: the transaction resource receiving address and transaction end time corresponding to the second user; the determination based on the patrol result that the target order meets the preset conditions for a successful transaction includes: Determine a sustainability indicator score corresponding to the transaction resource receiving address; If the sustainability index score value is greater than a preset score threshold, and the transaction end time is less than a preset time threshold, it is determined that the target order meets the preset conditions for a successful transaction.

20. The computer device of claim 19, wherein: The program also implements the following steps: If the sustainability index score is less than or equal to a preset score threshold, or the transaction end time is greater than or equal to a preset time threshold, it is determined that the target order does not meet the preset conditions for a successful transaction.

Citation Information

Patent Citations

  • Universal game prop trading system and method based on block chain smart contracts

    CN109432781A

  • Contract signing and executing method and device based on block chain

    CN111985007A

  • Contract execution method and device based on block chain, equipment and storage medium

    CN112070503A

  • Digital currency transaction method and device, electronic equipment and readable storage medium

    CN112132559A

  • Order processing method and device based on smart contract, and storage medium

    CN117710047A