A method, apparatus and computer program product for identifying risky transactions
By acquiring and analyzing transaction data from different types of trading venues in the blockchain, and using preset constraints and matching scoring rules to identify risky transactions, the problem of the inability to identify cross-type venues in existing technologies is solved, thus improving the security of the blockchain.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-15
- Publication Date
- 2026-03-31
AI Technical Summary
Existing risk transaction identification methods are unable to effectively identify risks across different types of trading venues, resulting in lower blockchain security.
By acquiring first transaction data from decentralized exchanges and second transaction data from centralized exchanges, and using preset constraints and matching scoring rules, candidate transactions are identified from the second transactions, and target transactions are determined based on the matching scores, thereby identifying risky transactions.
It improves the ability of blockchain to identify risky transactions across different types of trading venues and enhances the security of blockchain.
Smart Images

Figure CN121547283B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of blockchain technology, and in particular relates to a risk transaction identification method, device and computer program product. Background Technology
[0002] The blockchain technology field includes decentralized exchanges and centralized exchanges. Currently, existing risk transaction identification methods can generally only be applied to transactions occurring in the same type of exchange, and cannot be applied to transactions occurring in different types of exchanges.
[0003] For example, transactions 1 and 2 occur in a decentralized exchange, while transactions 3 and 4 occur in a centralized exchange. Existing risk transaction identification methods can identify risk transactions for transactions 1 and 2, and can also identify risk transactions for transactions 3 and 4, but cannot identify risk transactions for transactions 1 and 3, nor for transactions 1 and 4, nor for transactions 2 and 3, nor for transactions 2 and 4.
[0004] It can be seen that existing risk transaction identification methods are unable to identify risk transactions occurring in different types of trading venues, thus reducing the security of the blockchain. Summary of the Invention
[0005] In view of this, embodiments of this application provide a risk transaction identification method, apparatus, and computer program product to solve the technical problem of low security in existing blockchains.
[0006] In a first aspect, embodiments of this application provide a method for identifying risky transactions, including:
[0007] Obtain transaction data of a first transaction to be identified and transaction data of at least one second transaction; wherein the first transaction occurs in a decentralized exchange and each of the second transactions occurs in a centralized exchange.
[0008] Based on the transaction data of the first transaction, the transaction data of each of the second transactions, and at least one preset constraint, candidate transactions are determined from each of the second transactions;
[0009] For each candidate transaction, a matching score is determined based on the transaction data of the first transaction, the transaction data of the candidate transaction, and a preset matching scoring rule. The matching score is used to describe the degree to which the corresponding candidate transaction conforms to the matching scoring rule.
[0010] Based on the matching score corresponding to each of the candidate transactions, a target transaction is determined from each of the candidate transactions, and the target transaction and the first transaction are jointly determined as a pair of risk transactions.
[0011] Optionally, determining candidate transactions from the second transactions based on the transaction data of the first transaction, the transaction data of each of the second transactions, and at least one preset constraint includes:
[0012] For each second transaction, based on the transaction data of the first transaction, the transaction data of the second transaction, and each of the preset constraints, a target number of preset constraints satisfied by the second transaction is determined, and based on the target number, it is determined whether the second transaction is a candidate transaction.
[0013] Optionally, the preset constraints include any one or more of the following: start time constraints, holding time constraints, execution duration constraints, and transaction quantity difference constraints; determining the target number of preset constraints satisfied by the second transaction includes:
[0014] If the start time of the second transaction is later than the start time of the first transaction, then the second transaction is determined to satisfy the start time constraint condition.
[0015] If the time difference between the holding time of the second transaction and the holding time of the first transaction is less than a preset time difference threshold, then the second transaction is determined to meet the holding time constraint condition.
[0016] If the execution duration of the second transaction is less than a preset time threshold, then the second transaction is determined to satisfy the execution duration constraint condition.
[0017] If the difference between the number of transactions in the second transaction and the number of transactions in the first transaction is less than a preset difference threshold, then the second transaction is determined to satisfy the transaction quantity difference constraint condition.
[0018] The target quantity is determined based on whether the second transaction satisfies the start time constraint, the holding time constraint, the execution duration constraint, and the transaction quantity difference constraint.
[0019] Optionally, the matching scoring rule includes several matching scoring sub-rules, and the matching score includes several matching sub-scores, with one matching scoring sub-rule corresponding to one matching sub-score; determining the matching score of the candidate transaction based on the transaction data of the first transaction, the transaction data of the candidate transaction, and the preset scoring rule includes:
[0020] For each of the matching scoring sub-rules, the matching sub-score corresponding to the matching scoring sub-rule is determined based on the transaction data of the first transaction, the transaction data of the candidate transaction, and the matching scoring sub-rule.
[0021] The matching score of the candidate transaction is determined based on each of the matching sub-scores and the corresponding score weights of each matching sub-score.
[0022] Optionally, the matching scoring sub-rule includes a price difference scoring rule, and the matching sub-scoring includes a price difference matching score corresponding to the price difference scoring rule; the price difference scoring rule includes: if the price difference between the transaction price of the candidate transaction and the transaction price of the first transaction is larger, then the price difference matching score is higher;
[0023] And / or,
[0024] The matching scoring sub-rule includes a transaction volume difference scoring rule, and the matching sub-scoring includes a transaction volume difference matching score corresponding to the transaction volume difference scoring rule; the transaction volume difference scoring rule includes: if the transaction volume difference between the candidate transaction and the first transaction is smaller, the transaction volume difference matching score is higher.
[0025] Optionally, the matching scoring sub-rule includes an execution efficiency matching scoring rule, and the matching score includes an execution efficiency matching score corresponding to the execution efficiency matching scoring rule; the execution efficiency matching scoring rule includes: the higher the execution efficiency of the candidate transaction, the higher the execution efficiency matching score;
[0026] And / or,
[0027] The matching score sub-rule includes a transaction complexity matching score rule, and the matching score includes a transaction complexity matching score corresponding to the transaction complexity matching score rule; the transaction complexity matching score rule includes: the lower the transaction complexity of the candidate transaction, the higher the transaction complexity matching score.
[0028] Optionally, the matching scoring sub-rule includes a transaction time difference matching scoring rule, and the matching score includes a transaction time difference matching score corresponding to the transaction time difference matching scoring rule; the transaction time difference matching scoring rule includes: the smaller the difference in transaction time period between the transaction time period of the candidate transaction and the transaction time period of the first transaction, the higher the transaction time difference matching score;
[0029] And / or,
[0030] The matching score sub-rule includes a role consistency matching score rule, and the matching score includes a role consistency matching score corresponding to the role consistency matching score rule; the role consistency matching score rule includes: the higher the role consistency of the candidate transaction, the higher the role consistency matching score.
[0031] And / or,
[0032] The matching scoring sub-rule includes a price trend matching scoring rule, and the matching score includes a price trend matching score corresponding to the price trend matching scoring rule; the price trend matching scoring rule includes: if the first transaction is a buy transaction and the price trend of the candidate transaction is a downward trend, or if the first transaction is a sell transaction and the price trend of the candidate transaction is an upward trend, then the price trend matching score is greater than a preset scoring threshold, otherwise the price trend matching score is less than or equal to the preset scoring threshold.
[0033] Optionally, determining the target transaction from the candidate transactions based on the matching score corresponding to each candidate transaction includes:
[0034] From all the candidate transactions, the candidate transaction with the highest matching score, which is higher than a preset matching score threshold, is selected and determined as the target transaction.
[0035] Secondly, embodiments of this application provide a risk transaction identification device, comprising:
[0036] A data acquisition unit is used to acquire transaction data of a first transaction to be identified and transaction data of at least one second transaction; wherein the first transaction occurs in a decentralized exchange and each of the second transactions occurs in a centralized exchange.
[0037] The first determining unit is configured to determine candidate transactions from each of the second transactions based on the transaction data of the first transaction, the transaction data of each of the second transactions, and at least one preset constraint condition.
[0038] The second determining unit is used to determine the matching score of each candidate transaction based on the transaction data of the first transaction, the transaction data of the candidate transaction, and a preset scoring rule. The matching score is used to describe the degree to which the corresponding candidate transaction conforms to the matching scoring rule.
[0039] The third determining unit is used to determine the target transaction from each of the candidate transactions based on the matching score corresponding to each candidate transaction, and to jointly determine the target transaction and the first transaction as a pair of risk transactions.
[0040] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the risk transaction identification method as described in any of the first aspects above.
[0041] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the risk transaction identification method as described in any of the first aspects above.
[0042] Fifthly, embodiments of this application provide a computer program product that, when run on a control device, causes the control device to perform the steps of the risk transaction identification method as described in any of the first aspects above.
[0043] The risk transaction identification method, apparatus, and computer program product provided in this application have the following beneficial effects:
[0044] In the risk transaction identification method provided in this application embodiment, transaction data of a first transaction to be identified and transaction data of at least one second transaction are first obtained. The first transaction occurs in a decentralized exchange, while each second transaction occurs in a centralized exchange. Then, based on the transaction data of the first transaction, the transaction data of each second transaction, and at least one preset constraint, candidate transactions are determined from the second transactions. Next, for each candidate transaction, a matching score is determined based on the transaction data of the first transaction, the candidate transaction's transaction data, and a preset matching scoring rule. The matching score describes the degree to which the corresponding candidate transaction conforms to the matching scoring rule. Finally, based on the matching score corresponding to each candidate transaction, a target transaction is determined from the candidate transactions, and the target transaction and the first transaction are jointly identified as a pair of risk transactions. This method can identify risk transactions between a first transaction to be identified occurring in a decentralized exchange and each second transaction occurring in a centralized exchange. Compared with existing technologies that can only identify risk transactions occurring in exchanges of the same type, this method can improve the security of the blockchain. Attached Figure Description
[0045] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0046] Figure 1A flowchart illustrating the implementation of the risk transaction identification method provided in this application embodiment;
[0047] Figure 2 This is a schematic diagram of the structure of a risk transaction identification device provided in an embodiment of this application;
[0048] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0049] It should be noted that the terminology used in the embodiments of this application is only for explaining specific embodiments of this application and is not intended to limit this application. In the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more, "at least one" or "one or more" means one, two or more. The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
[0050] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0051] The subject executing the risk transaction identification method provided in this application embodiment can be an electronic device, which may include, but is not limited to, electronic devices such as laptops, desktop computers, tablets, and mobile phones.
[0052] The risk transaction identification method provided in this application can be applied to any scenario requiring risk transaction identification on a blockchain. For example, when a user needs to identify risk transactions for any number of first transactions occurring in a decentralized exchange and any number of second transactions occurring in a centralized exchange, the user can execute the steps of the risk transaction identification method provided in this application for each first transaction using an electronic device. This allows the identification of the target transaction corresponding to each first transaction in each second transaction, and then the target transaction and its corresponding counterpart are identified as a risk transaction pair. This overcomes the limitation of existing risk transaction identification methods that cannot identify risk transactions occurring in different types of exchange venues, thus improving blockchain security.
[0053] Please see Figure 1 , Figure 1 This is a flowchart illustrating the implementation of the risk transaction identification method provided in this application embodiment. The risk transaction identification method provided in this application embodiment may include S101~S104, as detailed below:
[0054] In S101, transaction data of a first transaction to be identified and transaction data of at least one second transaction are obtained; wherein the first transaction occurs in a decentralized exchange and each of the second transactions occurs in a centralized exchange.
[0055] In this embodiment of the application, if there are multiple first transactions, each first transaction can be identified as the first transaction to be identified in turn.
[0056] The transaction data for the first transaction may include, but is not limited to, any one or more of the following: the start time of the first transaction, the holding time of the first transaction, the execution duration of the first transaction, the transaction quantity of the first transaction, the transaction price of the first transaction, the transaction role of the first transaction, the transaction efficiency of the first transaction, the transaction complexity of the first transaction, the transaction end time of the first transaction, whether the first transaction is a buy or sell transaction, and the price trend of the first transaction.
[0057] The transaction data for the second transaction may include, but is not limited to, any two or more of the following: the start time of the second transaction, the holding time of the second transaction, the execution duration of the second transaction, the transaction quantity of the second transaction, the transaction price of the second transaction, the transaction role of the second transaction, the transaction efficiency of the second transaction, the transaction complexity of the second transaction, the transaction end time of the second transaction, whether the second transaction is a buy or sell transaction, and the price trend of the second transaction.
[0058] Decentralized Exchanges (DEXs) are defined as platforms that automatically execute transactions based on blockchain smart contracts without the intervention of a third-party centralized institution. Users do not need to entrust their assets to the platform; instead, they interact directly with the smart contracts through their own wallets, and transaction matching and asset transfer are all completed on-chain.
[0059] A centralized exchange (CEX) is defined as a trading platform operated by a third-party institution (the platform provider). The platform acts as a central hub responsible for asset custody, order matching, account management, and transaction clearing. Users trade through accounts provided by the platform.
[0060] In S102, candidate transactions are determined from each of the second transactions based on the transaction data of the first transaction, the transaction data of each second transaction, and at least one preset constraint.
[0061] In this embodiment of the application, after obtaining the transaction data of the first transaction to be identified and the transaction data of at least one second transaction, the electronic device can, for each second transaction, determine the target number of preset constraints that the second transaction satisfies based on the transaction data of the first transaction, the transaction data of the second transaction, and various preset constraints, and determine whether the second transaction is a candidate transaction based on the target number.
[0062] In one possible implementation, the preset constraints include any one or more of the following: start time constraint, holding time constraint, execution duration constraint, and transaction quantity difference constraint.
[0063] The method to determine whether the second transaction meets the start time constraint is as follows: if the start time of the second transaction is later than the start time of the first transaction, then the second transaction meets the start time constraint; if the start time of the second transaction is earlier than the start time of the first transaction, then the second transaction does not meet the start time constraint.
[0064] The method to determine whether the second transaction meets the holding time constraint is as follows: if the time difference between the holding time of the second transaction and the holding time of the first transaction is less than a preset time difference threshold, then the second transaction is determined to meet the holding time constraint; if the time difference between the holding time of the second transaction and the holding time of the first transaction is greater than or equal to the preset time difference threshold, then the second transaction is determined not to meet the holding time constraint.
[0065] The method for determining whether the second transaction meets the execution duration constraint is as follows: if the execution duration of the second transaction is less than a preset time threshold, then the second transaction is determined to meet the execution duration constraint; if the execution duration of the second transaction is greater than or equal to the preset time threshold, then the second transaction is determined not to meet the execution duration constraint.
[0066] The method for determining whether the second transaction meets the transaction quantity difference constraint is as follows: if the quantity difference between the second transaction and the first transaction is less than a preset quantity difference threshold, then the second transaction is determined to meet the transaction quantity difference constraint; if the quantity difference between the second transaction and the first transaction is greater than or equal to the preset quantity difference threshold, then the second transaction is determined not to meet the transaction quantity difference constraint.
[0067] After determining whether the second transaction satisfies each of the preset constraints, the electronic device can determine the target number of preset constraints satisfied by the second transaction based on whether the second transaction satisfies the start time constraint, holding time constraint, execution duration constraint, and transaction quantity difference constraint. For example, if the second transaction satisfies the start time constraint, holding time constraint, and execution duration constraint, but does not satisfy the transaction quantity difference constraint, the electronic device can determine that the target number of preset constraints satisfied by the second transaction is 3.
[0068] After determining the target number of preset constraints that the second transaction satisfies, the electronic device can compare the target number of preset constraints that the second transaction satisfies with a preset quantity threshold. If the target number of preset constraints that the second transaction satisfies is greater than or equal to the preset quantity threshold, the second transaction can be identified as a candidate transaction.
[0069] In practical applications, the preset quantity threshold can be set according to actual needs, and is not limited here. For example, the preset quantity threshold can be 3. If the target number of the preset constraints satisfied by the second transaction is 3, then the second transaction can be determined as a candidate transaction; if the target number of the preset constraints satisfied by the second transaction is 2, then the second transaction can not be determined as a candidate transaction.
[0070] By identifying an arbitrary number of candidate transactions within each second transaction, the workload of subsequent steps can be reduced, thereby improving the efficiency of risk transaction identification for transactions occurring in different types of trading venues. Without first identifying candidate transactions, it is necessary to determine the matching score for each second transaction, thus reducing the efficiency of risk transaction identification for transactions occurring in different types of trading venues.
[0071] In S103, for each candidate transaction, the matching score of the candidate transaction is determined based on the transaction data of the first transaction, the transaction data of the candidate transaction, and the preset matching scoring rules. The matching score is used to describe the degree to which the corresponding candidate transaction conforms to the matching scoring rules.
[0072] In this embodiment of the application, after determining an arbitrary number of candidate transactions in each second transaction, the electronic device can determine the matching score of each candidate transaction based on the transaction data of the first transaction, the transaction data of the candidate transaction, and a preset matching scoring rule. The matching score describes the degree to which the corresponding candidate transaction conforms to the matching scoring rule, thereby obtaining the matching score corresponding to each candidate transaction. The following explains how to determine the matching score corresponding to a certain second transaction.
[0073] In one possible implementation, the matching scoring rule includes several matching scoring sub-rules, and the matching score includes several matching sub-scores, with one matching scoring sub-rule corresponding to one matching sub-score. Based on this, the electronic device can determine the matching sub-score corresponding to each matching scoring sub-rule based on the transaction data of the first transaction, the transaction data of the candidate transaction, and the matching scoring sub-rule itself.
[0074] The following provides the available matching scoring sub-rules and the methods for determining the matching sub-score for each available matching scoring sub-rule.
[0075] Optionally, the matching score sub-rules include price difference scoring rules, and the matching sub-scoring includes price difference matching scores corresponding to the price difference scoring rules; the price difference scoring rules include: if the price difference between the transaction price of the candidate transaction and the transaction price of the first transaction is larger, then the price difference matching score is higher.
[0076] For example, the price difference matching score can be determined using the following formula:
[0077] Price difference matching score = first coefficient × |the transaction price of the candidate transaction - the transaction price of the first transaction|.
[0078] The first coefficient can be a positive number, and its specific value can be set according to actual needs.
[0079] Optionally, the matching scoring sub-rules include trading volume difference scoring rules, and the matching sub-scoring includes trading volume difference matching scores corresponding to the trading volume difference scoring rules; the trading volume difference scoring rules include: if the trading volume difference between the candidate trading volume and the first trading volume is smaller, the trading volume difference matching score is higher.
[0080] For example, the trading volume discrepancy matching score can be determined using the following formula:
[0081] Trading volume difference matching score = second coefficient / |Trading volume of candidate trade - Trading volume of first trade|.
[0082] The second coefficient can be a positive number, and its specific value can be set according to actual needs.
[0083] Optionally, the matching scoring sub-rule includes an execution efficiency matching scoring rule, and the matching score includes the execution efficiency matching score corresponding to the execution efficiency matching scoring rule; the execution efficiency matching scoring rule includes: the higher the execution efficiency of the candidate transaction, the higher the execution efficiency matching score.
[0084] For example, the execution efficiency matching score can be determined using the following formula:
[0085] Execution efficiency matching score = third coefficient × execution efficiency of candidate transactions
[0086] The third coefficient can be a positive number, and its specific value can be set according to actual needs. Optionally, the matching score sub-rule includes a transaction complexity matching score rule, and the matching score includes the transaction complexity matching score corresponding to the transaction complexity matching score rule; the transaction complexity matching score rule includes: the lower the transaction complexity of the candidate transaction, the higher the transaction complexity matching score.
[0087] For example, the transaction complexity matching score can be determined using the following formula:
[0088] Transaction complexity matching score = fourth coefficient / transaction complexity of candidate transactions
[0089] The fourth coefficient can be a positive number, and its specific value can be set according to actual needs.
[0090] Optionally, the matching scoring sub-rule includes a transaction time difference matching scoring rule, and the matching score includes a transaction time difference matching score corresponding to the transaction time difference matching scoring rule; the transaction time difference matching scoring rule includes: the smaller the difference in transaction time period between the transaction time period of the candidate transaction and the transaction time period of the first transaction, the higher the transaction time difference matching score.
[0091] For example, the absolute value (in seconds) of the first difference between the start time of the candidate transaction and the start time of the first transaction can be determined first, and the absolute value (in seconds) of the second difference between the end time of the candidate transaction and the end time of the first transaction can be determined. Then, the transaction time difference matching score can be determined using the following formula:
[0092] Transaction time difference matching score = Fifth coefficient / |Absolute value of the first difference + Absolute value of the second difference|
[0093] The fifth coefficient can be a positive number, and its specific value can be set according to actual needs.
[0094] Optionally, the matching score sub-rule includes the role consistency matching score rule, and the matching score includes the role consistency matching score corresponding to the role consistency matching score rule; the role consistency matching score rule includes: the higher the role consistency of the candidate transaction, the higher the role consistency matching score.
[0095] For example, the creator of each sub-transaction in the candidate transaction can be determined first, and then the role consistency matching score of the candidate transaction can be determined based on the creator of each sub-transaction. Specifically, the smaller the difference between the creators of each sub-transaction in the candidate transaction, the higher the role consistency matching score of the candidate transaction; conversely, the greater the difference between the creators of each sub-transaction in the candidate transaction, the lower the role consistency matching score of the candidate transaction. In practical applications, the specific implementation method for determining the role consistency score of the candidate transaction can be set according to actual needs.
[0096] Optionally, the matching score sub-rule includes a price trend matching score rule, and the matching score includes a price trend matching score corresponding to the price trend matching score rule; the price trend matching score rule includes: if the first transaction is a buy transaction and the price trend of the candidate transaction is a downward trend, or if the first transaction is a sell transaction and the price trend of the candidate transaction is an upward trend, then the price trend matching score is greater than a preset score threshold, otherwise the price trend matching score is less than or equal to the preset score threshold.
[0097] After determining the matching sub-score corresponding to each matching score sub-rule, the electronic device can determine the matching score of the candidate transaction based on each matching sub-score and its corresponding score weight, thereby determining the matching score corresponding to each candidate transaction.
[0098] In practical applications, the number of each matching scoring sub-rule, the scoring weight of each matching sub-rule, and the scoring weight of each matching sub-rule can all be set according to actual needs, and no limit is imposed here.
[0099] In S104, the target transaction is determined from the candidate transactions based on the matching score corresponding to each candidate transaction, and the target transaction and the first transaction are jointly determined as a pair of risk transactions.
[0100] In this embodiment of the application, after determining the matching score corresponding to each candidate transaction, the electronic device can select the candidate transaction with the highest matching score and the matching score being higher than a preset matching score threshold from the candidate transactions and determine it as the target transaction.
[0101] It should be noted that the number of target transactions can be one or zero. If the matching score of the candidate transaction with the highest matching score among all candidate transactions is not higher than the preset matching score threshold, then the first transaction to be identified does not have a corresponding target transaction, and the electronic device can determine that the first transaction to be identified is not a risky transaction.
[0102] As can be seen from the above, in the risk transaction identification method provided in this application embodiment, the transaction data of a first transaction to be identified and the transaction data of at least one second transaction are first obtained. The first transaction occurs in a decentralized exchange, while each second transaction occurs in a centralized exchange. Then, based on the transaction data of the first transaction, the transaction data of each second transaction, and at least one preset constraint, candidate transactions are determined from each second transaction. Next, for each candidate transaction, a matching score is determined based on the transaction data of the first transaction, the transaction data of the candidate transaction, and a preset matching scoring rule. The matching score describes the degree to which the corresponding candidate transaction conforms to the matching scoring rule. Finally, based on the matching score corresponding to each candidate transaction, a target transaction is determined from each candidate transaction, and the target transaction and the first transaction are jointly identified as a pair of risk transactions. This method can identify risk transactions between a first transaction to be identified occurring in a decentralized exchange and each second transaction occurring in a centralized exchange. Compared with existing technologies that can only identify risk transactions occurring in the same type of exchange, this method can improve the security of the blockchain.
[0103] Based on the risk transaction identification method provided in the above embodiments, this application further provides a risk transaction identification apparatus for implementing the above method embodiments. Please refer to [link to relevant documentation]. Figure 2 , Figure 2 This is a schematic diagram of a risk transaction identification device provided in an embodiment of this application. Figure 2 As shown, the risk transaction identification device 20 may include: a data acquisition unit 21, a first determination unit 22, a second determination unit 23, and a third determination unit 24. Wherein:
[0104] The data acquisition unit 21 is used to acquire transaction data of a first transaction to be identified and transaction data of at least one second transaction; wherein the first transaction occurs in a decentralized exchange and each of the second transactions occurs in a centralized exchange.
[0105] The first determining unit 22 is used to determine candidate transactions from each of the second transactions based on the transaction data of the first transaction, the transaction data of each of the second transactions, and at least one preset constraint condition.
[0106] The second determining unit 23 is used to determine the matching score of each candidate transaction based on the transaction data of the first transaction, the transaction data of the candidate transaction, and the preset matching scoring rules. The matching score is used to describe the degree to which the corresponding candidate transaction conforms to the matching scoring rules.
[0107] The third determining unit 24 is used to determine the target transaction from each candidate transaction based on the matching score corresponding to each candidate transaction, and to jointly determine the target transaction and the first transaction as a pair of risk transactions.
[0108] Optionally, the first determining unit 22 is specifically used for:
[0109] For each second transaction, based on the transaction data of the first transaction, the transaction data of the second transaction, and various preset constraints, a target number of preset constraints that the second transaction satisfies is determined, and based on the target number, it is determined whether the second transaction is a candidate transaction.
[0110] Optionally, the preset constraints include any one or more of the following: start time constraint, holding time constraint, execution duration constraint, and transaction quantity difference constraint; the first determining unit 22 is specifically used for:
[0111] If the start time of the second transaction is later than the start time of the first transaction, then the second transaction is determined to satisfy the start time constraint condition.
[0112] If the time difference between the holding time of the second transaction and the holding time of the first transaction is less than a preset time difference threshold, then the second transaction is determined to meet the holding time constraint condition.
[0113] If the execution duration of the second transaction is less than a preset time threshold, then the second transaction is determined to meet the execution duration constraint condition.
[0114] If the difference between the number of transactions in the second transaction and the number of transactions in the first transaction is less than a preset difference threshold, then the second transaction is determined to meet the transaction quantity difference constraint condition.
[0115] The target quantity is determined based on whether the second transaction meets the start time constraint, holding time constraint, execution duration constraint, and transaction quantity difference constraint.
[0116] Optionally, the matching scoring rule includes several matching scoring sub-rules, and the matching score includes several matching sub-scorings, with one matching scoring sub-rule corresponding to one matching sub-scoring; the second determining unit 23 is specifically used for:
[0117] For each matching score sub-rule, the matching sub-score corresponding to the matching score sub-rule is determined based on the transaction data of the first transaction, the transaction data of the candidate transaction, and the matching score sub-rule.
[0118] The matching score of the candidate transaction is determined based on each matching sub-score and its corresponding score weight.
[0119] Optionally, the matching scoring sub-rules include price difference scoring rules, and the matching sub-scoring includes price difference matching scores corresponding to the price difference scoring rules; the price difference scoring rules include: if the price difference between the transaction price of the candidate transaction and the transaction price of the first transaction is larger, then the price difference matching score is higher.
[0120] And / or,
[0121] The matching scoring sub-rules include the trading volume difference scoring rule, and the matching sub-scoring includes the trading volume difference matching score corresponding to the trading volume difference scoring rule; the trading volume difference scoring rule includes: if the difference between the trading volume of the candidate transaction and the trading volume of the first transaction is smaller, the trading volume difference matching score is higher.
[0122] Optionally, the matching scoring sub-rule includes an execution efficiency matching scoring rule, and the matching score includes the execution efficiency matching score corresponding to the execution efficiency matching scoring rule; the execution efficiency matching scoring rule includes: the higher the execution efficiency of the candidate transaction, the higher the execution efficiency matching score;
[0123] And / or,
[0124] The matching score sub-rule includes the transaction complexity matching score rule, and the matching score includes the transaction complexity matching score corresponding to the transaction complexity matching score rule; the transaction complexity matching score rule includes: the lower the transaction complexity of the candidate transaction, the higher the transaction complexity matching score.
[0125] Optionally, the matching scoring sub-rule includes a transaction time difference matching scoring rule, and the matching score includes a transaction time difference matching score corresponding to the transaction time difference matching scoring rule; the transaction time difference matching scoring rule includes: the smaller the difference in transaction time period between the transaction time period of the candidate transaction and the transaction time period of the first transaction, the higher the transaction time difference matching score.
[0126] And / or,
[0127] The matching score sub-rule includes the role consistency matching score rule, and the matching score includes the role consistency matching score corresponding to the role consistency matching score rule; the role consistency matching score rule includes: the higher the role consistency of the candidate transaction, the higher the role consistency matching score.
[0128] And / or,
[0129] The matching score sub-rule includes the price trend matching score rule, and the matching score includes the price trend matching score corresponding to the price trend matching score rule; the price trend matching score rule includes: if the first transaction is a buy transaction and the price trend of the candidate transaction is a downward trend, or if the first transaction is a sell transaction and the price trend of the candidate transaction is an upward trend, then the price trend matching score is greater than the preset score threshold, otherwise the price trend matching score is less than or equal to the preset score threshold.
[0130] Optionally, the third determining unit 24 is specifically used for:
[0131] From all candidate transactions, the candidate transaction with the highest matching score, which is also higher than the preset matching score threshold, is selected and determined as the target transaction.
[0132] It should be noted that the information interaction and execution process between the above-mentioned units are based on the same concept as the method embodiments of this application. Their specific functions and technical effects can be referred to the method embodiments section, and will not be repeated here.
[0133] Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 3 As shown, the electronic device 3 provided in this embodiment may include: a processor 30, a memory 31, and a computer program 32 stored in the memory 31 and executable on the processor 30, such as a program for a risk transaction identification method. When the processor 30 executes the computer program 32, it implements the steps described above in the embodiment of the risk transaction identification method, for example... Figure 1 S101~S104 are shown. Alternatively, when processor 30 executes computer program 32, it implements the functions of each module / unit in the above-described risk transaction identification device embodiment, for example... Figure 2 The functions of units 21-24 shown.
[0134] For example, computer program 32 can be divided into one or more modules / units, one or more of which are stored in memory 31 and executed by processor 30 to complete this application. One or more modules / units can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of computer program 32 in electronic device 3. For example, computer program 32 can be divided into data acquisition unit 21, first determining unit 22, second determining unit 23, and third determining unit 24. For the specific functions of each unit, please refer to... Figure 2 The relevant descriptions in the corresponding embodiments are not repeated here.
[0135] Those skilled in the art will understand that Figure 3 This is merely an example of electronic device 3 and does not constitute a limitation on electronic device 3. It may include more or fewer components than shown, or combine certain components, or use different components.
[0136] The processor 30 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0137] The memory 31 can be an internal storage unit of the electronic device 3, such as a hard disk or RAM. The memory 31 can also be an external storage device of the electronic device 3, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, or flash card. Furthermore, the memory 31 can include both internal and external storage units of the electronic device 3. The memory 31 is used to store computer programs and other programs and data required by the electronic device. The memory 31 can also be used to temporarily store data that has been output or will be output.
[0138] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units is merely an example. In practical applications, the above functions can be assigned to different functional units as needed, that is, the internal structure of the risk transaction identification device can be divided into different functional units to complete all or part of the functions described above. The functional units in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0139] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the steps in the various method embodiments described above.
[0140] This application provides a computer program product that, when run on a terminal device, enables the terminal device to implement the steps described in the various method embodiments above.
[0141] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, refer to the relevant descriptions of other embodiments.
[0142] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0143] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method of identifying risky transactions, characterized in that, The method comprises: obtaining transaction data of a first transaction to be identified and transaction data of at least one second transaction; wherein the first transaction occurs in a decentralized trading place, and each of the second transactions occurs in a centralized trading place; determining a candidate transaction from each of the second transactions according to the transaction data of the first transaction, the transaction data of each of the second transactions, and at least one preset constraint condition; for each of the candidate transactions, determining a matching score of the candidate transaction according to the transaction data of the first transaction, the transaction data of the candidate transaction, and a preset matching score rule, the matching score being used to describe a degree to which the corresponding candidate transaction meets the matching score rule; determining a target transaction from each of the candidate transactions according to the matching score corresponding to each of the candidate transactions, and determining the target transaction and the first transaction as a pair of risk transactions.
2. The method of claim 1, wherein, The determining of the candidate transaction from each of the second transactions according to the transaction data of the first transaction, the transaction data of each of the second transactions, and at least one preset constraint condition comprises: for each of the second transactions, determining a target number of the preset constraint conditions met by the second transaction according to the transaction data of the first transaction, the transaction data of the second transaction, and each of the preset constraint conditions, and determining whether the second transaction is the candidate transaction according to the target number.
3. The method of claim 2, wherein, The preset constraint condition comprises any one or more of a start time constraint condition, a holding time constraint condition, an execution duration constraint condition, and a transaction quantity difference constraint condition. The determining of the target number of the preset constraint conditions met by the second transaction comprises: if a transaction start time of the second transaction is later than a transaction start time of the first transaction, determining that the second transaction meets the start time constraint condition; if a time difference between a holding time of the second transaction and a holding time of the first transaction is less than a preset time difference threshold, determining that the second transaction meets the holding time constraint condition; if an execution duration of the second transaction is less than a preset time threshold, determining that the second transaction meets the execution duration constraint condition; if a quantity difference between a transaction quantity of the second transaction and a transaction quantity of the first transaction is less than a preset quantity difference threshold, determining that the second transaction meets the transaction quantity difference constraint condition; determining the target number according to whether the second transaction meets the start time constraint condition, the holding time constraint condition, the execution duration constraint condition, and the transaction quantity difference constraint condition.
4. The method of claim 1, wherein, The matching score rule comprises a plurality of matching score sub-rules, the matching score comprises a plurality of matching sub-scores, and one of the matching score sub-rules corresponds to one of the matching sub-scores; and the determining of the matching score of the candidate transaction according to the transaction data of the first transaction, the transaction data of the candidate transaction, and the preset matching score rule comprises: For each of the matching sub-rules, a matching sub-score corresponding to the matching sub-rule is determined according to the transaction data of the first transaction, the transaction data of the candidate transaction, and the matching sub-rule; A matching score of the candidate transaction is determined according to each of the matching sub-scores and a score weight corresponding to each of the matching sub-scores.
5. The method of claim 4, wherein, the matching sub-rules comprise a price difference sub-rule, and the matching sub-scores comprise a price difference matching sub-score corresponding to the price difference sub-rule; the price difference sub-rule comprises: the greater a price difference between a transaction price of the candidate transaction and a transaction price of the first transaction, the higher the price difference matching sub-score; and / or, the matching sub-rules comprise a transaction volume difference sub-rule, and the matching sub-scores comprise a transaction volume difference matching sub-score corresponding to the transaction volume difference sub-rule; the transaction volume difference sub-rule comprises: the smaller a transaction volume difference between a transaction volume of the candidate transaction and a transaction volume of the first transaction, the higher the transaction volume difference matching sub-score.
6. The method of claim 4, wherein, the matching sub-rules comprise an execution efficiency matching sub-rule, and the matching sub-scores comprise an execution efficiency matching sub-score corresponding to the execution efficiency matching sub-rule; the execution efficiency matching sub-rule comprises: the higher an execution efficiency of the candidate transaction, the higher the execution efficiency matching sub-score; and / or, the matching sub-rules comprise a transaction complexity matching sub-rule, and the matching sub-scores comprise a transaction complexity matching sub-score corresponding to the transaction complexity matching sub-rule; the transaction complexity matching sub-rule comprises: the lower a transaction complexity of the candidate transaction, the higher the transaction complexity matching sub-score.
7. The method of claim 4, wherein, the matching sub-rules comprise a transaction time difference matching sub-rule, and the matching sub-scores comprise a transaction time difference matching sub-score corresponding to the transaction time difference matching sub-rule; the transaction time difference matching sub-rule comprises: the smaller a transaction time period difference between a transaction time period of the candidate transaction and a transaction time period of the first transaction, the higher the transaction time difference matching sub-score; and / or, the matching sub-rules comprise a role consistency matching sub-rule, and the matching sub-scores comprise a role consistency matching sub-score corresponding to the role consistency matching sub-rule; the role consistency matching sub-rule comprises: the higher a role consistency of the candidate transaction, the higher the role consistency matching sub-score; and / or, The matching score sub-rules include a price trend matching score rule, and the matching score includes a price trend matching score corresponding to the price trend matching score rule; the price trend matching score rule includes: if the first transaction is a buy transaction and the price trend of the candidate transaction is a downward trend, or if the first transaction is a sell transaction and the price trend of the candidate transaction is an upward trend, the price trend matching score is greater than a preset score threshold, otherwise the price trend matching score is less than or equal to the preset score threshold.
8. The method according to any one of claims 1 to 7, characterized in that, The determining the target transaction from each of the candidate transactions according to the matching score corresponding to each of the candidate transactions includes: selecting, from each of the candidate transactions, a candidate transaction with the highest matching score and a matching score higher than a preset matching score threshold, as the target transaction.
9. A risk transaction identification apparatus characterized by comprising: The method includes: a data acquisition unit configured to acquire transaction data of a first transaction to be identified and transaction data of at least one second transaction; wherein the first transaction occurs in a decentralized trading place, and each of the second transactions occurs in a centralized trading place; a first determination unit configured to determine, from each of the second transactions, a candidate transaction according to the transaction data of the first transaction, the transaction data of each of the second transactions, and at least one preset constraint condition; a second determination unit configured to, for each of the candidate transactions, determine a matching score of the candidate transaction according to the transaction data of the first transaction, the transaction data of the candidate transaction, and a preset matching score rule, the matching score being used to describe a degree to which the corresponding candidate transaction meets the matching score rule; a third determination unit configured to determine, from each of the candidate transactions, a target transaction according to the matching score corresponding to each of the candidate transactions, and determine the target transaction and the first transaction as a pair of risk transactions.
10. A computer program product, characterised in that, The computer program product, when executed by a processor, implements each step in the risk transaction identification method according to any one of claims 1 to 8. The computer program product, when executed by a processor, implements each step in the risk transaction identification method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Abnormal transaction identification method and device based on block chain, equipment and medium
CN117932504A
Cross-chain atomic exchange method with high fault tolerance and mobility based on market maker algorithm
CN119417598A