CN111402053A - Transaction matching method, system, computer readable storage medium and computing device - Google Patents

Transaction matching method, system, computer readable storage medium and computing device Download PDF

Info

Publication number
CN111402053A
CN111402053A CN202010180361.4A CN202010180361A CN111402053A CN 111402053 A CN111402053 A CN 111402053A CN 202010180361 A CN202010180361 A CN 202010180361A CN 111402053 A CN111402053 A CN 111402053A
Authority
CN
China
Prior art keywords
order
transaction
taking
directed
directed graph
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010180361.4A
Other languages
Chinese (zh)
Inventor
沈敖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Timestamp Information Technology Co ltd
Original Assignee
Hangzhou Timestamp Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Timestamp Information Technology Co ltd filed Critical Hangzhou Timestamp Information Technology Co ltd
Priority to CN202010180361.4A priority Critical patent/CN111402053A/en
Publication of CN111402053A publication Critical patent/CN111402053A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application relates to a transaction matching method, and relates to the technical field of asset transactions. The transaction matching method comprises the following steps: taking the asset type as a vertex, forming a directed edge corresponding to a transaction on each order acquired from a block chain in advance between the vertices, taking the logarithm of the price of the order as the weight of the corresponding directed edge, and constructing a directed graph; carrying out negative ring detection on the directed graph; matching the detected order on the negative ring. By applying the scheme provided by the invention, the matching of multiple transaction pairs can be efficiently realized, and the possibility of transaction matching is favorably increased. Meanwhile, the invention also provides a transaction matching system, a computer readable storage medium and a computing device.

Description

Transaction matching method, system, computer readable storage medium and computing device
Technical Field
The present application relates to the field of asset transaction technologies, and in particular, to a transaction matching method, system, computer-readable storage medium, and computing device.
Background
With the continuous development of computer technology, asset trading is rapidly developed through the combination of the computer technology, and trading matching plays a very important role in an asset trading system. Most current transaction matching methods match deals with only one transaction pair. Generally, there is a trade pair A/B that makes a price first match for A- > B (sell A assets) and B- > A (buy A assets). When there are multiple transaction pairs (more than two) that can be traded with each other, for example, there are three transaction pairs of A/B, B/C and A/C (A, B, C is a different asset), the transactions can be done for three of A- > B, B- > C, C- > A, but there is no solution for matching multiple transaction pairs in the prior art.
Disclosure of Invention
In view of the above, it is necessary to provide a transaction matching method, a system, a computer-readable storage medium, and a computing device capable of matching multiple transaction pairs in order to solve the above technical problems.
A transaction matching method, the method comprising:
taking the asset type as a vertex, forming a directed edge corresponding to a transaction on each order acquired from a block chain in advance between the vertices, taking the logarithm of the price of the order as the weight of the corresponding directed edge, and constructing a directed graph;
carrying out negative ring detection on the directed graph;
matching the detected order on the negative ring.
In one embodiment, the performing negative loop detection on the directed graph includes:
and carrying out negative loop detection on the directed graph based on a Bellman Ford (Bellman-Ford) algorithm.
In one embodiment, a queue-based Bellman Ford algorithm is used to perform negative loop detection on the directed graph.
In one embodiment, the number of asset types is greater than 2.
In one embodiment, the asset type is determined according to each order acquired from the blockchain in advance;
and acquiring the quantity of all asset types determined according to each order.
Determining whether the number of all asset types is greater than 2.
In response to determining that the number of all asset types is equal to 2, determining whether the obtained order can be matched;
and in response to determining that the number of all the asset types is greater than 2, taking each determined asset type as a vertex, forming a directed edge corresponding to the transaction on each order among the vertices, taking the logarithm of the price of the order as the weight of the corresponding directed edge, and constructing a directed graph.
In one embodiment, the method further comprises:
before constructing a directed graph, acquiring a delegation list in a block chain;
and taking the logarithm of the price of each acquired order by taking e as a base number.
In one embodiment, the method operates at block link points.
A transaction matching system comprises a construction module, a detection module and a matching module.
The construction module is used for forming a directed edge corresponding to a transaction on each order acquired from a block chain in advance by taking the asset type as a vertex, and constructing a directed graph by taking the logarithm of the price of the order as the weight of the corresponding directed edge;
the detection module is used for carrying out negative loop detection on the directed graph;
and the matching module is used for matching the detected order on the negative ring.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
taking the asset type as a vertex, forming a directed edge corresponding to a transaction on each order acquired from a block chain in advance between the vertices, taking the logarithm of the price of the order as the weight of the corresponding directed edge, and constructing a directed graph;
carrying out negative ring detection on the directed graph;
matching the detected order on the negative ring.
A computing device comprising a memory and a processor, the memory storing a computer program that when executed by the processor performs the steps of:
taking the asset type as a vertex, forming a directed edge corresponding to a transaction on each order acquired from a block chain in advance between the vertices, taking the logarithm of the price of the order as the weight of the corresponding directed edge, and constructing a directed graph;
carrying out negative ring detection on the directed graph;
matching the detected order on the negative ring.
According to the transaction matching method, the transaction matching system, the computer-readable storage medium and the computing device, for multi-transaction matching, the asset type is used as the vertex, the directed edges corresponding to the transactions on each consignment bill acquired from the block chain in advance are formed between the vertices, the logarithm of the price of the consignment bill is used as the weight of the directed edges, a directed graph is constructed, and the problem of whether the assets can be traded is converted into the problem of whether the loop exists in the directed graph. After the weights of all the directed edges on the loop are added, if the result is a negative number, the loop is a negative loop, and the order on the loop is matchable, so that the order on the negative loop is matched, the problem of whether the order can be matched or not can be skillfully converted into the negative loop detection problem of a directed graph, the matching of multiple transaction pairs is efficiently realized, and the possibility of matching the transactions is favorably increased.
Drawings
Fig. 1 is a block chain network architecture diagram according to an embodiment;
FIG. 2 is a flow diagram of a transaction matching method in one embodiment;
FIG. 3 is a schematic diagram of a directed graph in one embodiment;
FIG. 4 is a flow chart of a transaction matching method in yet another embodiment;
FIG. 5 is a flow chart of a transaction matching method in yet another embodiment;
FIG. 6 is a block diagram of the architecture of a transaction matching system in one embodiment;
FIG. 7 is a diagram of an internal structure of a computing device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The terms "first," "second," and the like in the description and in the claims of the embodiments of the application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Assuming that there are N types of assets in the system, each of which can trade with each other, the traditional trade matching method is to determine the matchable trade pairs, such as asset a/asset B, asset C/asset D, etc., by traversing the obtained order.
In order to increase the possibility of transaction matching, the embodiment of the application provides a transaction matching method
The transaction matching method provided by the embodiment of the application can be used for performing under-chain matching or on-chain matching, and if the under-chain matching is adopted, the transaction matching method operates in the centralized server; if an on-chain match is employed, the transaction match method operates at the block link point.
The centralized server may be implemented as a stand-alone server or as a server cluster consisting of a plurality of servers. Blockchain nodes, i.e. nodes in a blockchain network.
A Block chain (Blockchain) is a storage structure for encrypted, chained transactions formed from blocks (blocks). The header of each block can comprise the hash values of all transactions in the block and also comprises the hash values of all transactions in the previous block, so that the falsification and forgery prevention of the transactions in the block are realized on the basis of the hash values; newly generated transactions, after being filled into the tiles and passing through the consensus of nodes in the blockchain network, are appended to the end of the blockchain to form a chain growth.
A blockchain network refers to a collection of nodes that collectively incorporate a new block into a blockchain. The collection of nodes forms a decentralized, interoperable database storage system. Any two nodes 1 communicate with each other via P2P (Peer To Peer) protocol, as shown in fig. 1. A block link point may be implemented by a separate server or a server cluster consisting of multiple servers.
Referring to fig. 2, a flow chart of a transaction matching method in an embodiment is shown. In this embodiment, the transaction matching method may be performed by a transaction matching system. The user or the merchant may submit a transaction request to the blockchain through an interactive interface such as a corresponding application program or a web page, where the transaction request may include a purchase order of the user or the merchant. The order may be a seller order or a buyer order. The order placing mode of the order form according to the order form can be divided into a limit order form, a market order form, a filling and loss stopping order form and the like.
And the transaction matching system acquires the order in the blockchain from the blockchain, and the like. The transaction matching system may store a list of orders, namely a seller list queue and a buyer list queue. And the transaction matching system matches the order in the order queue according to the information of the order and a preset algorithm or matches the just extracted order with the order in the order queue, so as to determine the matchable order.
As shown in fig. 2, the transaction matching method provided in this embodiment includes the following steps:
step S200, taking the asset type as a vertex, forming a directed edge corresponding to the transaction on each order acquired from the block chain in advance among the vertices, taking the logarithm of the price of the order as the weight of the corresponding directed edge, and constructing a directed graph.
Generally, the order contains information including at least trade (buy or sell), asset type, price, and quantity of the asset. Where the asset type may be digital currency, such as BTC, ETH, EOS, or the like.
When the directed graph is constructed, the preset asset types can be mapped to the vertexes, and the asset types related to all the acquired order can also be mapped to the vertexes. And representing the transactions of all the acquired orders by directed edges, and taking the logarithm of the price of the order as the weight of the directed edges.
The transaction matching method provided by the embodiment is compatible with a single transaction pair and a plurality of transaction pairs. Therefore, the number of asset types is not limited in this embodiment.
Illustratively, if the number of asset types is equal to 2, i.e., there are A/B, B/A transaction pairs, the deal of the order is A- > B, B- > A looped when the directed graph is constructed.
Illustratively, if the number of asset types is greater than 2, assuming that the asset types include asset a, asset B, and asset C, there are three transaction pairs a/B, B/C and C/a, as shown in connection with fig. 3, A, B, C is the vertex, and the direction of the directed edge corresponds to the transaction of the order. Transaction a- > B represents the exchange of a for B. The orders' transactions are A- > B, B- > C and C- > A, then the corresponding directed edges point to B, B for A and point to C and C, respectively.
In this embodiment, for transaction a- > B, the price a/B of the order is X1, and taking the logarithm of the base e to the price of each obtained order, the weight of the directed edge a- > B is the logarithm ln of X1 (X1); for transaction B- > C, the price B/C of the order is X2, and the weight of the directed edge B- > C is the logarithm ln of X2 (X2); for the transaction C- > A, the price C/A of the order is X3, and the weight of the directed edge C- > A is the logarithm ln of X3 (X3). It should be noted that the transactions a- > B, B- > C and C- > a are only exemplary illustrations, and the present invention does not limit the number of the obtained orders.
Step S202, negative ring detection is carried out on the directed graph.
In step S204, matching is performed on the detected order on the negative ring.
The negative loop, also called as negative weight loop, means that the sum of the weights of the loops is negative. As shown in FIG. 3, if ln (X1) + ln (X2) + ln (X3) <0, i.e., the sum of the weights of the directed edges of the loop is negative, it can be said that the directed edges A- > B, B- > C and C- > A form a negative ring. ln (X1) + ln (X2) + ln (X3) <0 means that X1 × 2 × 3<1, that is, the condition for matching the three request tickets is satisfied. Therefore, by detecting the negative loop in the directed graph, it is possible to determine whether or not matching of the order on the loop is possible.
In the embodiment, the asset type is used as a vertex, a directed edge corresponding to a transaction on each order acquired in advance is formed between the vertices, the logarithm of the price of the order is used as the weight of the directed edge, a directed graph is constructed, and the problem of whether the asset can be transacted is converted into the problem of whether a loop exists in the directed graph. When the weights of the directed edges on the loop are added and the result is a negative number, the loop is indicated as a negative ring and the order on the loop is matchable, so that the order on the negative ring is matched, and the problem of whether the order can be matched is converted into the negative ring detection problem of the directed graph. The transaction matching method provided by the embodiment can efficiently realize matching of multiple transaction pairs, and brings more transaction matching possibilities.
Specifically, step S202 includes:
and carrying out negative loop detection on the directed graph based on a Bellman Ford algorithm.
The prior art does not have a scheme of matching multiple transaction pairs, and if the traditional mode is used for processing multiple transaction pairs, namely enumerating all possible transactions, 2^ N-1 times of calculation is needed, an exponential increase algorithm is low in efficiency, matching performance is reduced rapidly, and transaction matching efficiency is very low. According to the transaction matching method provided by the embodiment, the negative ring detection is carried out on the directed graph through the Bellman Ford algorithm, so that the transaction matching efficiency can be improved.
The Bellman Ford algorithm is an algorithm for solving the single source shortest path problem. To find the shortest path, then this shortest path must contain less than N-1 edges, where N is the total number of vertices. The most polygonal case of the shortest path is to go through all vertices and finally reach the end point, and the path variable is N-1. That is, in a graph with N vertices, the depth of the shortest path between two vertices does not exceed N-1.
The Bellman Ford algorithm performs depth traversal from a source point to an adjacent vertex, and updates the estimated shortest path to a more accurate value through relaxation operation until an optimal solution is obtained. The process of the relaxation operation:
assuming that vertices A and B are reachable from source point S, the distance from source point S to vertex B via path 1 is LAThe distance from source point S to vertex B via path 2 is LBVertex A may go directly to vertex B, and the distance from vertex A to vertex B is LAB
If L existA+LAB<LBIt means that there is a new route from source point S to vertex B (the new route is routed to point A) whose distance is less than the distance L from source point S to vertex BB
The distance from the source point S to the vertex B is updated to LA+LABThen, the minimum distance from source point S to vertex B is shortened, and a closer path from source point S to vertex B (via vertex B) is found, which is the process of "relaxation operation".
If no negative loop exists, the shortest path can be obtained through a plurality of relaxation operations. If a negative loop exists, the arrival distance values of some vertices cannot converge, i.e., the distance values are continuously reduced during a plurality of relaxation operations.
Since the depth of the shortest path between some two vertices will not exceed N-1, after undergoing N-1 traversal relaxations, if the arrival distances of some number of vertices do not converge, it can be determined that a negative ring occurs. Therefore, the BellmanFord algorithm can be used to detect the negative ring in the directed graph. Negative loop detection is carried out on the directed graph through a Bellman Ford algorithm, and the transaction matching efficiency is improved.
It should be understood that, although the steps in the flowchart of fig. 2 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 2 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
Referring to fig. 4, a flow chart of a transaction matching method in another embodiment is shown. In this embodiment, the transaction matching method includes the following steps:
step S400, acquiring the order in the block chain.
In step S402, the number of pairs of prices per acquired order is logarithmized with 10 as the base number.
And step S404, determining the asset type according to each acquired order. Wherein the number of asset types is greater than 2, i.e. there are 3 or more than 3 assets, e.g. BTC, ETH, HT, EOS, etc.
Step S406, taking each determined asset type as a vertex, forming a directed edge corresponding to the transaction on each order among the vertices, taking the logarithm of the price of the order as the weight of the corresponding directed edge, and constructing a directed graph.
And step S412, performing negative loop detection on the directed graph by adopting a queue-based Bellman Ford algorithm.
In step S414, matching is performed on the detected order on the negative ring.
For multi-transaction pair matching, the embodiment provides a transaction matching method, and provides an efficient transaction matching scheme for the situation that 3 or more than 3 assets exist. Multiple transaction pair matches offer the possibility of more transaction matches than a single transaction pair match.
In the embodiment, the asset type is used as a vertex, a directed edge corresponding to a transaction on each order acquired in advance is formed between the vertices, the logarithm of the price of the order is used as the weight of the directed edge, a directed graph is constructed, and the problem of whether the asset can be transacted is converted into the problem of whether a loop exists in the directed graph. When the weights of the directed edges on the loop are added and the result is a negative number, the loop is indicated as a negative ring and the order on the loop is matchable, so that the order on the negative ring is matched, and the problem of whether the order can be matched is converted into the negative ring detection problem of the directed graph.
In addition, in the embodiment, by adopting a queue based (queue based) Bellman Ford algorithm, the negative ring detection problem can be solved under the time complexity of O (E + N) (where E is the number of mutual transactions between assets, and N is the number of types of assets) in the conventional case, and the transaction matching efficiency is further improved.
It should be understood that, although the steps in the flowchart of fig. 4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 4 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
Referring to fig. 5, a flow chart of a transaction matching method in another embodiment is shown. In this embodiment, the transaction matching method includes the following steps:
step S600, acquiring the order in the block chain.
Step S602, determining the asset type according to each acquired entrusting order;
step S603, the number of all asset types determined according to each order is acquired.
Step S604, determine whether the number of all asset types is greater than 2.
Step S606, in response to determining that the number of all asset types is equal to 2, determines whether the acquired order can be matched. It should be noted that, in the case that the number of asset types is equal to 2, a person skilled in the art can determine whether the obtained order can be matched according to the prior art without any doubt, for example, according to price conditions, and the like, and details are not described here.
Step S608, in response to determining that the number of all asset types is greater than 2, taking the logarithm of the price of each obtained order with e as the base number.
Step S610, each determined asset type is used as a vertex, a directed edge corresponding to the transaction on each order is formed between the vertices, the logarithm of the price of the order is used as the weight of the corresponding directed edge, and a directed graph is constructed.
And step S612, performing negative loop detection on the directed graph by adopting a queue-based Bellman Ford algorithm.
In step S614, matching is performed on the detected order on the negative ring.
In the embodiment, the asset type is used as a vertex, a directed edge corresponding to a transaction on each order acquired in advance is formed between the vertices, the logarithm of the price of the order is used as the weight of the directed edge, a directed graph is constructed, and the problem of whether the asset can be transacted is converted into the problem of whether a loop exists in the directed graph. After the weights of the directed edges on the loop are added, if the result is a negative number, the loop is indicated as a negative ring, and the order on the loop is matchable, so that the order on the negative ring is matched, the problem of whether the order can be matched or not is converted into the negative ring detection problem of the directed graph, and the negative ring detection is carried out on the directed graph through the queue-based Bellman Ford algorithm, so that the transaction matching efficiency is improved.
Although the negative ring detection is applied to the case where the number of asset types is equal to 2, the present embodiment flexibly adopts different matching methods according to the number of asset types, and can further trade matching efficiency.
It should be understood that, although the steps in the flowchart of fig. 5 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 5 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 6, the transaction matching method 1 may run at a block-link point, or may run at a centralized server (an off-link exchange). The transaction matching system 1 comprises a construction module 101, a detection module 103 and a matching module 105. The construction module 101 is configured to form a directed edge corresponding to a transaction on each order acquired in advance between vertices by using the asset type as a vertex, and construct a directed graph by using a logarithm of a price of the order as a weight of the directed edge. The detection module 103 is configured to perform negative loop detection on the directed graph. The matching module 105 is used for matching the detected order on the negative ring. Further, the number of asset types is greater than 2.
The transaction matching system 1 further comprises a first obtaining module and a third determining module. The first acquisition module is used for acquiring the order in the block chain before the directed graph is constructed. And the third determining module is used for determining the asset type according to each acquired order.
The building module 101 is specifically configured to form, between vertexes, a directed edge corresponding to a transaction on each order acquired from the blockchain in advance, using a logarithm of a price of the order as a weight of the directed edge, and building a directed graph, with each determined asset type as a vertex.
The building module 101 may map a preset asset type to a vertex, or may map asset types related to all the acquired order to a vertex. The construction module 101 represents the acquired transactions of all the orders by directed edges, and takes the logarithm of the price of the order as the weight of the directed edges.
Further, the detection module 103 is specifically configured to perform negative loop detection on the directed graph based on the Bellman Ford algorithm.
Preferably, the detection module 103 is specifically configured to perform negative loop detection on the directed graph by using a queue-based Bellman Ford algorithm.
Specifically, the building module 101 includes:
the asset type acquisition unit is used for determining the asset type according to each consignment order acquired from the block chain in advance;
and the quantity acquisition unit is used for acquiring the quantity of all the asset types determined according to each consignment order.
And the judging unit is used for judging whether the number of all the asset types is greater than 2.
The first response unit is used for responding to the judgment that the number of all the asset types is equal to 2, and determining whether the obtained entrustment bill can be matched or not;
and the second response unit is used for taking each determined asset type as a vertex in response to the fact that the number of all the asset types is larger than 2, forming a directed edge corresponding to the transaction on each order among the vertices, taking the logarithm of the price of the order as the weight of the corresponding directed edge, and constructing a directed graph.
Further, the transaction matching system 1 also comprises a calculation module.
And the calculation module is used for taking the logarithm of the price of each acquired order by taking e as a base number.
For the specific definition of the transaction matching system, reference may be made to the above definition of the transaction matching method, which is not described herein again. The various modules in the transaction matching system 1 described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computing device, and can also be stored in a memory in the computing device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computing device is provided, which may be a server, the internal structure of which may be as shown in FIG. 7. The computing device includes a processor, a memory, a network interface, and a database connected by a device bus. Wherein the processor of the computing device is configured to provide computing and control capabilities. The memory of the computing device includes a non-volatile computer-readable storage medium, an internal memory. The non-transitory computer-readable storage medium stores an operating device, a computer program, and a database. The internal memory provides an environment for the operation device and execution of the computer program in the non-volatile computer-readable storage medium. The database of the computing device is used to store data. The network interface of the computing device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a transaction matching method.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects may be applied, and that a particular computing device may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, there is provided a computing device comprising a memory and a processor, the memory having stored therein a computer program that when executed by the processor performs the steps of:
taking the asset type as a vertex, forming a directed edge corresponding to a transaction on each order acquired from a block chain in advance between the vertices, taking the logarithm of the price of the order as the weight of the corresponding directed edge, and constructing a directed graph;
carrying out negative ring detection on the directed graph;
matching the detected order on the negative ring.
In one embodiment, the negative loop detection of the directed graph comprises:
and carrying out negative loop detection on the directed graph based on the Bellman Ford algorithm.
In one embodiment, the negative loop detection is performed on the directed graph based on the Bellman Ford algorithm, and the method comprises the following steps:
and performing negative loop detection on the directed graph by adopting a queue-based Bellman Ford algorithm.
In one embodiment, the number of asset types is greater than 2.
In one embodiment, the processor, when executing the computer program, performs the steps of: before constructing a directed graph, acquiring a delegation list in a block chain;
determining the asset type according to each acquired entrusting order;
taking the asset type as a vertex, forming a directed edge corresponding to the transaction on each pre-acquired order between the vertices, taking the logarithm of the price of the order as the weight of the directed edge, and constructing a directed graph, wherein the steps comprise:
and taking each determined asset type as a vertex, forming directed edges corresponding to the transactions on each pre-acquired order among the vertices, taking the logarithm of the price of the order as the weight of the directed edges, and constructing a directed graph.
In one embodiment, the processor, when executing the computer program, performs the steps of: before constructing a directed graph, acquiring a delegation list in a block chain;
and taking the logarithm of the price of each acquired order by taking e as a base number.
In one embodiment, the transaction matching method operates on block link points.
In one embodiment, the transaction matching method runs on a centralized server.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
taking the asset type as a vertex, forming a directed edge corresponding to the transaction on each order acquired from the block chain in advance between the vertices, taking the logarithm of the price of the order as the weight of the directed edge, and constructing a directed graph;
carrying out negative loop detection on the directed graph;
matching the detected order on the negative ring.
In one embodiment, the negative loop detection of the directed graph comprises:
and carrying out negative loop detection on the directed graph based on the Bellman Ford algorithm.
In one embodiment, the negative loop detection is performed on the directed graph based on the Bellman Ford algorithm, and the method comprises the following steps:
and performing negative loop detection on the directed graph by adopting a queue-based Bellman Ford algorithm.
In one embodiment, the number of asset types is greater than 2.
In one embodiment, the computer program when executed by the processor further performs the steps of: the method for constructing the directed graph by taking the asset type as a vertex, forming directed edges corresponding to transactions on each order acquired from a block chain in advance between the vertices, and taking the logarithm of the price of the order as the weight of the corresponding directed edges comprises the following steps:
and determining the asset types and the quantity of all asset types according to each order acquired from the blockchain in advance.
It is determined whether the number of asset types is greater than 2.
In response to determining that the number of asset types is equal to 2, determining whether the obtained order can be matched;
and in response to determining that the number of the asset types is greater than 2, taking each determined asset type as a vertex, forming a directed edge corresponding to the transaction on each order between the vertices, taking the logarithm of the price of the order as the weight of the corresponding directed edge, and constructing a directed graph.
In one embodiment, the computer program when executed by the processor further performs the steps of: before constructing a directed graph, acquiring a delegation list in a block chain;
and taking the logarithm of the price of each acquired order by taking e as a base number.
In one embodiment, the transaction matching method operates on block link points.
In one embodiment, the transaction matching method runs on a centralized server.
It will be understood by those of ordinary skill in the art that all or a portion of the processes of the methods of the embodiments described above may be implemented by a computer program that may be stored on a non-volatile computer-readable storage medium, which when executed may include the processes of the embodiments of the methods described above, wherein any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A transaction matching method, comprising:
taking the asset type as a vertex, forming a directed edge corresponding to a transaction on each order acquired from a block chain in advance between the vertices, taking the logarithm of the price of the order as the weight of the corresponding directed edge, and constructing a directed graph;
carrying out negative ring detection on the directed graph;
matching the detected order on the negative ring.
2. The method of claim 1, wherein the performing negative loop detection on the directed graph comprises:
and carrying out negative loop detection on the directed graph based on a Bellman Ford algorithm.
3. The method according to claim 2, wherein the detecting the negative loop of the directed graph based on the Bellman Ford algorithm comprises:
and performing negative loop detection on the directed graph by adopting a queue-based Bellman Ford algorithm.
4. A method according to any of claims 1-3, characterized in that the number of asset types is larger than 2.
5. The method according to any one of claims 1 to 3, wherein the constructing of the directed graph by taking asset types as vertices, forming directed edges between the vertices corresponding to transactions on each order previously obtained from the blockchain, and taking logarithms of prices of the orders as weights of the corresponding directed edges comprises:
determining the asset type according to each consignment order acquired from the block chain in advance;
and acquiring the quantity of all asset types determined according to each order.
Determining whether the number of all asset types is greater than 2.
In response to determining that the number of all asset types is equal to 2, determining whether the obtained order can be matched;
and in response to determining that the number of all the asset types is greater than 2, taking each determined asset type as a vertex, forming a directed edge corresponding to the transaction on each order among the vertices, taking the logarithm of the price of the order as the weight of the corresponding directed edge, and constructing a directed graph.
6. The method according to any one of claims 1-3, further comprising:
before constructing a directed graph, acquiring a delegation list in a block chain;
and taking the logarithm of the price of each acquired order by taking e as a base number.
7. A method according to any of claims 1-3, wherein the transaction matching method operates on block-link points.
8. A transaction matching system, comprising:
the construction module is used for forming directed edges corresponding to transactions on each order acquired from a block chain in advance by taking the asset type as vertexes, taking the logarithm of the price of the order as the weight of the corresponding directed edges, and constructing a directed graph;
the detection module is used for carrying out negative loop detection on the directed graph;
and the matching module is used for matching the detected order on the negative ring.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the transaction matching method according to any of claims 1 to 7.
10. A computing device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program implements the steps of a transaction matching method according to any of claims 1 to 7.
CN202010180361.4A 2020-03-16 2020-03-16 Transaction matching method, system, computer readable storage medium and computing device Pending CN111402053A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010180361.4A CN111402053A (en) 2020-03-16 2020-03-16 Transaction matching method, system, computer readable storage medium and computing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010180361.4A CN111402053A (en) 2020-03-16 2020-03-16 Transaction matching method, system, computer readable storage medium and computing device

Publications (1)

Publication Number Publication Date
CN111402053A true CN111402053A (en) 2020-07-10

Family

ID=71436967

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010180361.4A Pending CN111402053A (en) 2020-03-16 2020-03-16 Transaction matching method, system, computer readable storage medium and computing device

Country Status (1)

Country Link
CN (1) CN111402053A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115239443A (en) * 2022-09-23 2022-10-25 北京百度网讯科技有限公司 Transaction matching method, device, equipment and medium based on block chain

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103873363A (en) * 2014-03-24 2014-06-18 华北电力大学(保定) Double route configuration method for electric power optical fiber communication net services
CN106991098A (en) * 2016-01-21 2017-07-28 北京四维图新科技股份有限公司 A kind of method and system for choosing path search index point of the same name
CN107527144A (en) * 2017-08-21 2017-12-29 复旦大学 A kind of detection method of financial field connected transaction
US20180231389A1 (en) * 2017-02-16 2018-08-16 IFP Energies Nouvelles Method of determining an area reachable by a vehicle using a dynamic model and a line graph
CN109409990A (en) * 2018-10-10 2019-03-01 北京知道创宇信息技术有限公司 Match method of trading and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103873363A (en) * 2014-03-24 2014-06-18 华北电力大学(保定) Double route configuration method for electric power optical fiber communication net services
CN106991098A (en) * 2016-01-21 2017-07-28 北京四维图新科技股份有限公司 A kind of method and system for choosing path search index point of the same name
US20180231389A1 (en) * 2017-02-16 2018-08-16 IFP Energies Nouvelles Method of determining an area reachable by a vehicle using a dynamic model and a line graph
CN107527144A (en) * 2017-08-21 2017-12-29 复旦大学 A kind of detection method of financial field connected transaction
CN109409990A (en) * 2018-10-10 2019-03-01 北京知道创宇信息技术有限公司 Match method of trading and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115239443A (en) * 2022-09-23 2022-10-25 北京百度网讯科技有限公司 Transaction matching method, device, equipment and medium based on block chain

Similar Documents

Publication Publication Date Title
JP7162697B2 (en) Crypto Integrated Platform
Mohanta et al. An overview of smart contract and use cases in blockchain technology
US20210126790A1 (en) Method and system for publicly verifiable proofs of retrievability in blockchains
CN112015749B (en) Method, device and system for updating business model based on privacy protection
KR101727525B1 (en) Block chain based distributed storage method and device thereof
US10937111B2 (en) Managing energy purchase agreements on a blockchain
CN107615317A (en) The system and method for block chain transaction record
US20210082033A1 (en) System and method for improving security of smart contract on blockchain
US20170140394A1 (en) Consensus-based reputation tracking in online marketplaces
US20100017321A1 (en) Adaptive Implied Spread Matching
WO2022206143A1 (en) Blockchain-based green certificate transaction system
CN109816323A (en) Transaction auditing method, calculating equipment, storage medium for block chain network
US20220414664A1 (en) Blockchain address risk assessment via graph analysis
WO2018065411A1 (en) Computer system
CN111937020A (en) Aggregation payment method and system for digital currency and edge server
US20200151718A1 (en) System and method for improving security of smart contract on blockchain
Harshavardhan et al. Blockchain technology in cloud computing to overcome security vulnerabilities
WO2020000798A1 (en) Block chain-based game data processing method and system and computer device
CN113689270B (en) Method for determining black product device, electronic device, storage medium, and program product
KR102137784B1 (en) System Providing Mergers and Acquisitions Service based on Block Chain and Method for operating the same
CN113205378B (en) Block chain-based electric energy transaction system
CN111402053A (en) Transaction matching method, system, computer readable storage medium and computing device
Parmar et al. Uplifting blockchain technology for data provenance in supply chain
KR20200078069A (en) Verification apparatus and method for interworking of blockchain network and financial system
WO2021197485A1 (en) Information processing method, system, device, storage medium, and program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20200710

WD01 Invention patent application deemed withdrawn after publication