Multi-party bartering method, device and storage medium based on blockchain

Through blockchain and smart contract technology, the trust and matching problems in matter exchange are solved, efficient and transparent multi-party matter exchange is achieved, and the credibility and efficiency of transactions are improved.

CN114565437BActive Publication Date: 2025-01-14YIZHI (SHANGHAI) CULTURAL COMMUNICATION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210203722.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-03
Publication Date
2025-01-14
Estimated Expiration
2042-03-03

AI Technical Summary

Technical Problem

In the existing methods of material exchange, there is a lack of an effective trust mechanism and matching mechanism, which leads to losses suffered when intermediary intervention and low matching efficiency.

Method used

A multi-party exchange method based on blockchain is adopted to generate redemption orders through smart contracts, freeze commodity tokens, build matching relationships, and introduce parallel processing mechanisms to improve matching efficiency.

Benefits of technology

It improves the credibility and efficiency of material exchange, ensures the transparency and fairness of transactions, and can even be efficiently matched in multi-party exchanges, reducing transaction costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114565437B_ABST
    Figure CN114565437B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of computer technology, and in particular, relates to a multi-party barter method, device and storage medium based on blockchain. The present invention utilizes the open, fair and tamper-proof characteristics of blockchain and smart contract technology to realize a solution for barter, thereby improving the credibility of barter. At the same time, in the absence of perfectly matched orders, multi-party barter transactions are realized through a matching mechanism. In the barter method based on blockchain provided by the present invention, the user's ownership of the item is proved by a commodity token, and the item is recorded in the blockchain to ensure authenticity. At the same time, smart contracts are used to implement the demand matching and exchange process of barter, which is more trustworthy. In addition, by introducing a parallel mechanism, it is ensured that when the number of orders in battery replacement increases, efficient matching can still be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer technology, and in particular to a multi-party barter method, device and storage medium based on blockchain. Background Art

[0002] In the course of human history, barter was once very popular. Although currently it is mainly exchanged with general equivalents as the intermediate medium, this exchange method is more widely applicable and universal. However, in many scenarios in modern society, barter has better efficiency, such as the mutual replacement of old or second-hand goods. Since the current mainstream currency is used as the medium for exchange, both parties will suffer certain losses. For example, Zhang San has game card A and wants to get game card B, and Li Si has game card B and wants to get game card A. The most mainstream method at present should be that Zhang San sells card A to a second-hand game card vendor, and then buys card B at a higher price. Li Si also sells card B and then buys card A. In this process, the second-hand vendors usually charge low and sell high to make profits. In this way, Zhang San and Li Si have to bear certain losses. If barter is adopted, Zhang San can exchange card A for card B from Li Si, and each can meet their own needs. However, in this process, how to match the needs of Zhang San and Li Si, and the trust issues between the two need to be further resolved. Summary of the invention

[0003] In order to solve the above problems, the present invention provides a multi-party barter method, device and storage medium based on blockchain, providing a decentralized, open and transparent barter solution that can be applied to multi-party exchanges.

[0004] The present invention adopts the following technical solutions:

[0005] In a first aspect, the present invention provides a multi-party barter method based on blockchain, the method comprising:

[0006] The first user generates a first exchange order in the commodity system; wherein the data structure of the first exchange order includes: number, owner, timestamp, provided commodity list, expected commodity list, status, complete matching order, one-way forward matching order list and one-way reverse matching order list, wherein the one-way forward matching order list and the one-way reverse matching order list are both generated by the barter smart contract, wherein the one-way forward matching order list is a collection of exchange orders whose provided commodity list cannot satisfy the expected commodity list of the first exchange order but whose expected commodity list matches the provided commodity list of the first exchange order, and the one-way reverse matching order list is a collection of exchange orders whose provided commodity list satisfies the expected commodity list of the first exchange order but whose expected commodity list cannot match the provided commodity list of the first exchange order;

[0007] The commodity system sends the first exchange order to the barter smart contract of the blockchain system. The barter smart contract freezes the commodity token of the commodity list provided in the first exchange order from the user address of the first user according to the information of the first exchange order sent by the commodity system. If the freezing is successful, proceed to the next step; otherwise, it prompts the first user that the commodity assets provided are insufficient;

[0008] After the freezing is successful, the barter smart contract determines whether there are already unfinished exchange orders in the exchange order pool. If not, the first exchange order is directly placed in the exchange order pool; if there are already exchange orders, the exchange orders in the exchange order pool are matched with the first exchange order one by one in chronological order, the status of the first exchange order is updated, and the corresponding matching relationship is established; if the target order is found, the establishment of the matching relationship is stopped immediately, and the status of the target order and the first exchange order are set to be fully matched, and they are set to be fully matched with each other, wherein the target order is an exchange order in which the provided product list fully matches the expected product list of the first exchange order, and the expected product list fully matches the provided product list of the first exchange order; the frozen product token corresponding to the first exchange order in the user address of the first user is exchanged and unfrozen with the frozen product token corresponding to the target order in the user address of the second user, and the target order is deleted from the exchange order pool, and the status of the first exchange order and the target order is modified; wherein the second user is the initiator of the target order.

[0009] If the target order is still not found after traversing the exchange order pool, the matching relationship is built, starting from the first exchange order, and traversing the exchange orders in the one-way positive matching list level by level in the order of the timestamps of the exchange orders. If the first exchange order can be found, the traversal is stopped immediately, and the exchange orders at all levels are recorded in sequence, and the recorded exchange orders are deleted from the exchange order pool. Then, according to the recorded exchange orders, the frozen assets are exchanged to the corresponding accounts of the parties in the order of the records, and the multi-party asset exchange is completed;

[0010] If the first exchange order is not found after traversing the exchange orders in the one-way positive matching list level by level, the first exchange order is added to the exchange order pool.

[0011] Preferably, when there are already redemption orders in the redemption order pool, the number M of redemption orders in the redemption order pool is obtained. If M is greater than a preset parallel processing threshold N, X processing threads are started, and each thread processes S pending redemption orders, wherein S is equal to M / X and rounded up. If a sub-thread target order is found, it is determined whether the target order has been set. If not, the found sub-thread target order is directly set as the target order. Otherwise, the release time of the currently found sub-thread target order is compared with the release time of the sub-thread target order that has been set as the target order, and the sub-thread target order with an earlier release time is used as the final target order, wherein the sub-thread target order is the target order of the first redemption order in the processing thread.

[0012] In a second aspect, a computer device is provided, comprising one or more processors;

[0013] a memory for storing one or more programs,

[0014] When the one or more programs are executed by the one or more processors, the one or more processors execute the method as described in the first aspect above.

[0015] According to a third aspect, a storage medium storing a computer program is provided, and when the program is executed by a processor, the method described in the first aspect is implemented.

[0016] The beneficial effects of the present invention are that the open, fair and tamper-proof characteristics of the blockchain and the smart contract technology are utilized to realize a barter solution, thereby improving the credibility of the barter. At the same time, in the absence of perfectly matched orders, multi-party barter transactions are realized through a matching mechanism. In the blockchain-based barter method provided by the present invention, the user's ownership of the item is proved by a commodity token, and the item is recorded in the blockchain to ensure authenticity. At the same time, the smart contract is used to implement the barter demand matching and exchange process, which is more trustworthy. In addition, by introducing a parallel mechanism, it is ensured that when the number of orders in the battery swap increases, efficient matching can still be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 A flowchart of a multi-party barter method based on blockchain provided in one embodiment of the present invention;

[0018] Figure 2 A schematic diagram of the structure of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0019] The present invention is further described in detail below in conjunction with specific embodiments and the accompanying drawings of the specification. Those of ordinary skill in the art will be able to implement the present invention based on these descriptions. In addition, the embodiments of the present invention involved in the following description are usually only embodiments of a part of the present invention, rather than all of the embodiments. Therefore, based on the embodiments in the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative work should fall within the scope of protection of the present invention. It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other. Unless otherwise specified, the methods briefly described in the embodiments of the present invention are methods mastered by those skilled in the art.

[0020] Figure 1 A flowchart of a multi-party barter method based on blockchain provided in one embodiment of the present invention.

[0021] like Figure 1 As shown, this embodiment provides a multi-party barter method based on blockchain, including:

[0022] The first user generates a first exchange order in the commodity system; wherein the data structure of the first exchange order includes: number, owner, timestamp, provided commodity list, expected commodity list, status, complete matching order, one-way forward matching order list and one-way reverse matching order list, wherein the one-way forward matching order list and the one-way reverse matching order list are both generated by the barter smart contract, wherein the one-way forward matching order list is a collection of exchange orders whose provided commodity list cannot satisfy the expected commodity list of the first exchange order but whose expected commodity list matches the provided commodity list of the first exchange order, and the one-way reverse matching order list is a collection of exchange orders whose provided commodity list satisfies the expected commodity list of the first exchange order but whose expected commodity list cannot match the provided commodity list of the first exchange order;

[0023] The commodity system sends the first exchange order to the barter smart contract of the blockchain system. The barter smart contract freezes the commodity token of the commodity list provided in the first exchange order from the user address of the first user according to the information of the first exchange order sent by the commodity system. If the freezing is successful, proceed to the next step; otherwise, it prompts the first user that the commodity assets provided are insufficient;

[0024] After the freezing is successful, the barter smart contract determines whether there are already unfinished exchange orders in the exchange order pool. If not, the first exchange order is directly placed in the exchange order pool; if there are already exchange orders, the exchange orders in the exchange order pool are matched with the first exchange order one by one in chronological order, the status of the first exchange order is updated, and the corresponding matching relationship is established; if the target order is found, the establishment of the matching relationship is stopped immediately, and the status of the target order and the first exchange order are set to be fully matched, and they are set to be fully matched with each other, wherein the target order is an exchange order in which the provided product list fully matches the expected product list of the first exchange order, and the expected product list fully matches the provided product list of the first exchange order; the frozen product token corresponding to the first exchange order in the user address of the first user is exchanged and unfrozen with the frozen product token corresponding to the target order in the user address of the second user, and the target order is deleted from the exchange order pool, and the status of the first exchange order and the target order is modified; wherein the second user is the initiator of the target order.

[0025] If the target order is still not found after traversing the exchange order pool, the matching relationship is built, starting from the first exchange order, and traversing the exchange orders in the one-way positive matching list level by level in the order of the timestamps of the exchange orders. If the first exchange order can be found, the traversal is stopped immediately, and the exchange orders at all levels are recorded in sequence, and the recorded exchange orders are deleted from the exchange order pool. Then, according to the recorded exchange orders, the frozen assets are exchanged to the corresponding accounts of the parties in the order of the records, and the multi-party asset exchange is completed;

[0026] If the first exchange order is not found after traversing the exchange orders in the one-way positive matching list level by level, the first exchange order is added to the exchange order pool.

[0027] Furthermore, when there are already redemption orders in the redemption order pool, the number M of redemption orders in the redemption order pool is obtained. If M is greater than the preset parallel processing threshold N, X processing threads are started, and each thread processes S pending redemption orders, where S is equal to M / X and rounded up. If a sub-thread target order is found, it is determined whether the target order has been set. If not, the found sub-thread target order is directly set as the target order. Otherwise, the release time of the currently found sub-thread target order is compared with the release time of the sub-thread target order that has been set as the target order, and the sub-thread target order with an earlier release time is used as the final target order, where the sub-thread target order is the target order of the first redemption order in the processing thread.

[0028] Specifically, an example is given of a method for traversing the exchange orders in the one-way positive matching list step by step. For example, Zhang San provides product A and demands product B; Li Si provides product B and demands product C; Wang Wu provides product C and demands product A; the exchange orders of Li Si and Wang Wu have entered the exchange order pool, which also includes several exchange orders. Now Zhang San generates the first exchange order (provided product A, demanded product B). Assuming that there is no target order in the exchange order pool that completely matches the first exchange order, then after the barter smart contract completes the matching relationship, the exchange orders in the exchange order pool are configured with the one-way positive matching list corresponding to the current exchange order. For example, the one-way positive matching list of the first exchange order generated by Zhang San includes exchange order / Xiao Ming, exchange order / Li Si and exchange order / Xiao Er, the one-way positive matching list of the exchange order generated by Li Si includes exchange order / Xiao Hong, exchange order / Wang Wu and exchange order / Xiao Bai, and the one-way positive matching list of the exchange order generated by Wang Wu includes Exchange order / Xiaolu, the first exchange order and exchange order / Xiaohei; then the step-by-step traversal process starting from the first exchange order generated by Zhang San is as follows: first find the one-way positive matching list of the first exchange order, and obtain exchange order / Xiaoming, exchange order / Li Si and exchange order / Xiaoer, and then traverse and search the one-way positive matching list of exchange order / Xiaoming. For the convenience of exemplification, assume that exchange order / Xiaoming has no one-way positive matching exchange order, then go back and start searching the one-way positive matching list of exchange order / Li Si, and obtain exchange order / Xiaohong, exchange order / Wang Wu and exchange order / Xiaobai. Also for the convenience of exemplification, assume that exchange order / Xiaohong has no one-way positive matching exchange order, then search the one-way positive matching list of exchange order / Wang Wu to find the first exchange order, then a closed loop is formed, that is, the first exchange order-exchange order / Li Si-exchange order / Wang Wu-first exchange order, so that the barter needs of the three parties of Zhang San, Li Si and Wang Wu can be matched, so as to carry out the barter of the three parties.

[0029] More specifically, the present invention provides a method for bartering based on blockchain and smart contracts. The specific reference scheme is as follows:

[0030] Commodity system: user terminal (such as a shopping mall), where users can generate blockchain accounts, obtain commodity tokens, initiate exchange transactions, etc.

[0031] Blockchain system: provides blockchain and barter smart contracts. The commodity system calls the barter smart contract through the JRPC interface to complete the barter.

[0032] In order to achieve the matching of N-party barter, it is necessary to abstract and design the data structure of each exchange order, as follows:

[0033] Exchange order data structure design:

[0034] a. Redemption order number

[0035] b. Owner of the redemption order

[0036] c. New timestamp of the redemption order

[0037] d. List of goods provided for the exchange order (i.e. the list of goods that the owner wants to exchange)

[0038] e. The expected commodity list of the exchange order (i.e. the commodity list that the owner expects to exchange)

[0039] f. Status of the redemption order (full match, one-way match, or no match)

[0040] g. Completely matching order for exchange

[0041] h. List of one-way positive matching orders for exchange orders (if the goods provided by exchange order E meet the expected goods of exchange order F, and the goods provided by exchange order F cannot match the expected goods of exchange order E, then exchange order E is the one-way positive matching order for exchange order F)

[0042] i. List of one-way reverse matching orders for exchange orders (if the goods provided by exchange order E meet the expected goods of exchange order F, and the goods provided by exchange order F cannot match the expected goods of exchange order E, then exchange order F is the one-way reverse matching order of exchange order E)

[0043] The scheme exemplified in this embodiment includes at least the above two systems and the exchange order data structure is designed as above. The implementation process of multi-party barter is as follows:

[0044] 1. The commodity system sends the user's exchange order to the smart contract of the blockchain system. The barter smart contract freezes the commodity tokens of the commodity list from the user's address based on the exchange order information sent by the commodity system. If the exchange is successful, proceed to the next step; otherwise, it prompts that the user's commodity assets are insufficient.

[0045] 2. If the asset freezing in step 1 is successful, the barter smart contract will determine whether there is an unfinished exchange order in the exchange order pool. If not, the exchange order will be directly placed in the exchange order pool.

[0046] 3. If 2 determines that there is already an exchange order in the exchange order pool, then first obtain the exchange order from the resource pool in chronological order to match it with the current exchange order, update the status of the exchange order, and establish a matching relationship.

[0047] 4. If 3 finds that there is an exchange order that is a complete match with the current exchange order when building the matching relationship, stop building the matching relationship immediately, set the status of the exchange order and the current exchange order to a complete match, and set their respective complete match orders to each other; delete the exchange order from the exchange order pool, and then exchange the frozen assets to the other party's account according to the exchange order.

[0048] 5. If 3 fails to find an exchange order that completely matches the current exchange order after traversing all the exchanges in the exchange order pool when building the matching relationship, then after completing the matching relationship construction, starting from the current exchange order, traverse the exchange orders in the one-way positive matching list step by step according to the time sequence of the exchange orders. If the current exchange order can be found, stop traversing immediately, and record each exchange order in the matching ring in order, delete these exchange orders from the exchange order pool, and then exchange the frozen assets to the accounts of each party in the order of one-way positive matching according to the exchange order, and complete the N-party asset exchange;

[0049] Considering the increase in the number of orders in the exchange order pool, a parallel mechanism can be introduced. Alternatively, after completing the construction of the matching relationship, this step takes the current exchange order as the starting point to obtain the one-way positive matching list of the exchange order. If the number T of the one-way positive matching list is greater than 1, T threads are started in parallel to traverse the exchange orders in the one-way positive matching list step by step according to the time sequence of the exchange order. If the current exchange order can be found, the traversal is stopped immediately to determine whether the global matching result is not set. If not set, it is directly set to the current matching result. Otherwise, the earliest matching order time of the current matching result and the global matching result is compared. If the current matching result is earlier, the global result is reset to the current matching result, otherwise no processing is performed. When all the existing orders are processed, the exchange orders in the matching ring are recorded in sequence, and these exchange orders are deleted from the exchange order pool. Then, according to the exchange order, the frozen assets are exchanged to the accounts of each party in the order of one-way positive matching to complete the N-party asset exchange.

[0050] 6. If 5 fails to find a circular dependency after traversing all the exchange orders, it means that there is no N-party exchange that meets the conditions, and the automatic matching process of this exchange is stopped.

[0051] 7. Repeat steps 1-6 for each new exchange order.

[0052] The beneficial effect of the method adopted in the present application is that it utilizes the open, fair and tamper-proof characteristics of blockchain and smart contract technology to realize the solution of barter, thereby improving the credibility of barter. The present invention provides a barter method based on blockchain, which proves the user's ownership of the item through commodity tokens and records it in the blockchain to ensure authenticity. At the same time, smart contracts are used to implement the demand matching and exchange process of barter, which is more trustworthy. In addition, by introducing a parallel mechanism, it is ensured that when the number of orders in the exchange order pool increases, efficient matching can still be achieved.

[0053] Figure 2 A schematic diagram of the structure of a device provided in one embodiment of the present invention.

[0054] like Figure 2 As shown, as another aspect, the present application also provides a computer device 100, including one or more central processing units (CPU) 101, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 102 or the program loaded from the storage part 108 to the random access memory (RAM) 103. In the RAM 103, various programs and data required for the operation of the device 100 are also stored. The CPU 101, the ROM 102, and the RAM 103 are connected to each other through a bus 104. An input / output (I / O) interface 105 is also connected to the bus 104.

[0055] The following components are connected to the I / O interface 105: an input section 106 including a keyboard, a mouse, etc.; an output section 107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 108 including a hard disk, etc.; and a communication section 109 including a network interface card such as a LAN card, a modem, etc. The communication section 109 performs communication processing via a network such as the Internet. A driver 110 is also connected to the I / O interface 105 as needed. A removable medium 111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the driver 110 as needed, so that a computer program read therefrom is installed into the storage section 108 as needed.

[0056] In particular, according to the embodiments disclosed in the present application, the method described in the above embodiment 1 can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program tangibly contained on a machine-readable medium, and the computer program includes a program code for executing the method described in any of the above embodiments. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 109, and / or installed from the removable medium 111.

[0057] As another aspect, the present application further provides a computer-readable storage medium, which may be a computer-readable storage medium included in the apparatus of the above embodiment; or a computer-readable storage medium that exists independently and is not assembled into the device. The computer-readable storage medium stores one or more programs, which are used by one or more processors to execute the method described in the present application.

[0058] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a dedicated hardware-based system that performs a specified function or operation, or can be realized by a combination of dedicated hardware and computer instructions.

[0059] The units or modules involved in the embodiments described in the present application may be implemented by software or by hardware. The units or modules described may also be arranged in a processor. For example, each of the units may be a software program arranged in a computer or a mobile smart device, or may be a separately configured hardware device. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.

[0060] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the concept of the present application. For example, the above features are replaced with the technical features with similar functions disclosed in the present application (but not limited to) to form a technical solution.

Claims

1. A multi-party barter method based on blockchain, characterized in that: The method comprises: The first user generates a first exchange order in the commodity system; wherein the data structure of the first exchange order includes: number, owner, timestamp, provided commodity list, expected commodity list, status, complete matching order, one-way forward matching order list and one-way reverse matching order list, wherein the one-way forward matching order list and the one-way reverse matching order list are both generated by the barter smart contract, wherein the one-way forward matching order list is a collection of exchange orders whose provided commodity list cannot satisfy the expected commodity list of the first exchange order but whose expected commodity list matches the provided commodity list of the first exchange order, and the one-way reverse matching order list is a collection of exchange orders whose provided commodity list satisfies the expected commodity list of the first exchange order but whose expected commodity list cannot match the provided commodity list of the first exchange order; The commodity system sends the first exchange order to the barter smart contract of the blockchain system. The barter smart contract freezes the commodity token of the commodity list provided in the first exchange order from the user address of the first user according to the information of the first exchange order sent by the commodity system. If the freezing is successful, proceed to the next step; otherwise, it prompts the first user that the commodity assets provided are insufficient; After the freezing is successful, the barter smart contract determines whether there are already unfinished exchange orders in the exchange order pool. If not, the first exchange order is directly placed in the exchange order pool; if there are already exchange orders, the exchange orders in the exchange order pool are matched with the first exchange order one by one in chronological order, the status of the first exchange order is updated, and the corresponding matching relationship is established; if the target order is found, the establishment of the matching relationship is stopped immediately, and the status of the target order and the first exchange order are set to be fully matched, and they are set to be fully matched with each other, wherein the target order is an exchange order in which the provided product list fully matches the expected product list of the first exchange order, and the expected product list fully matches the provided product list of the first exchange order; the frozen product token corresponding to the first exchange order in the user address of the first user is exchanged and unfrozen with the frozen product token corresponding to the target order in the user address of the second user, and the target order is deleted from the exchange order pool, and the status of the first exchange order and the target order is modified; wherein the second user is the initiator of the target order. If the target order is still not found after traversing the exchange order pool, the matching relationship is built, starting from the first exchange order, and traversing the exchange orders in the one-way positive matching list level by level in the order of the timestamps of the exchange orders. If the first exchange order can be found, the traversal is stopped immediately, and the exchange orders at all levels are recorded in sequence, and the recorded exchange orders are deleted from the exchange order pool. Then, according to the recorded exchange orders, the frozen assets are exchanged to the corresponding accounts of the parties in the order of the records, and the multi-party asset exchange is completed; If the first exchange order is not found after traversing the exchange orders in the one-way positive matching list level by level, the first exchange order is added to the exchange order pool.

2. A multi-party barter method based on blockchain according to claim 1, characterized in that: When there are already redemption orders in the redemption order pool, obtain the number M of redemption orders in the redemption order pool. If M is greater than the preset parallel processing threshold N, start X processing threads, and each thread processes S pending redemption orders, where S is equal to M / X and rounded up. If a sub-thread target order is found, determine whether the target order has been set. If not, directly set the found sub-thread target order as the target order. Otherwise, compare the release time of the currently found sub-thread target order with the release time of the sub-thread target order that has been set as the target order, and use the sub-thread target order with an earlier release time as the final target order, where the sub-thread target order is the target order of the first redemption order in the processing thread.

3. A computer device, characterized in that: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are caused to perform the method according to claim 1 or 2.

4. A storage medium storing a computer program, characterized in that: When the program is executed by a processor, the method according to claim 1 or 2 is implemented.

Citation Information

Patent Citations

  • Digital reward point service system and method and electronic device

    CN108846705A

  • Point transaction method and device based on block chain

    CN113034192A