Blockchain arbitrage behavior detection method, device, storage medium and electronic device

Blockchain data is processed through the pre-trained arbitrage behavior recognition model to identify and determine arbitrage behavior, which solves the problem of difficulty in identifying blockchain arbitrage behavior in the existing technology and achieves automatic identification and high-accuracy detection results.

CN115271743BActive Publication Date: 2024-10-15CHINA TELECOM CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210940111.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-05
Publication Date
2024-10-15
Estimated Expiration
2042-08-05

AI Technical Summary

Technical Problem

It is difficult for existing technology to effectively identify blockchain arbitrage behavior, resulting in the inability to take timely measures and causing asset losses to users participating in transactions.

Method used

Use a pre-trained arbitrage behavior recognition model to process the behavior data to be detected in the blockchain, determine whether the behavior to be detected is an arbitrage behavior through the recognition results, and extract the characteristic data to determine the specific category, such as decentralized exchange arbitrage behavior .

Benefits of technology

It realizes the automatic identification and effective detection of blockchain arbitrage behavior, reduces labor and time costs, improves the accuracy of detection results, and facilitates the adoption of corresponding measures against arbitrage behavior.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115271743B_ABST
    Figure CN115271743B_ABST
Patent Text Reader

Abstract

The present disclosure provides a blockchain arbitrage behavior detection method, device, storage medium and electronic device, which relate to the field of data security technology. The blockchain arbitrage behavior detection method includes: obtaining the behavior data to be detected in the blockchain; processing the behavior data to be detected using a pre-trained arbitrage behavior recognition model to output the recognition result corresponding to the behavior data to be detected; and determining whether the behavior data to be detected belongs to arbitrage behavior according to the recognition result. The present disclosure realizes the automatic recognition and effective detection of blockchain arbitrage behavior, reduces labor and time costs, and improves the accuracy of the detection results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data security technology, and in particular to a blockchain arbitrage behavior detection method, a blockchain arbitrage behavior detection device, a computer-readable storage medium, and an electronic device. Background Art

[0002] Blockchain usually uses a distributed ledger to store transaction records. Transactions are open to anyone on the blockchain, which poses a potential risk of arbitrage, causing asset losses to users participating in the transaction. In related technologies, it is difficult to effectively identify blockchain arbitrage behavior, and thus difficult to take corresponding measures. Summary of the invention

[0003] The present disclosure provides a blockchain arbitrage behavior detection method, a blockchain arbitrage behavior detection device, a computer-readable storage medium and an electronic device, so as to at least to some extent solve the problem that it is difficult to effectively identify blockchain arbitrage behavior in related technologies.

[0004] According to a first aspect of the present disclosure, a blockchain arbitrage behavior detection method is provided, comprising: obtaining behavior data to be detected in a blockchain; processing the behavior data to be detected using a pre-trained arbitrage behavior recognition model to output a recognition result corresponding to the behavior data to be detected; and determining whether the behavior data to be detected belongs to arbitrage behavior based on the recognition result.

[0005] Optionally, the identification result corresponding to the behavior data to be detected includes: a target arbitrage behavior category corresponding to the behavior data to be detected among multiple arbitrage behavior categories.

[0006] Optionally, determining whether the behavior data to be detected belongs to arbitrage behavior based on the identification result includes: extracting feature data from the behavior data to be detected according to the target arbitrage behavior category; and determining whether the behavior data to be detected belongs to the target arbitrage behavior based on the feature data.

[0007] Optionally, the target arbitrage behavior category includes decentralized exchange arbitrage behavior; extracting feature data from the behavior data to be detected based on the target arbitrage behavior category includes: determining that the type of feature data required to detect decentralized exchange arbitrage behavior is resource flow data; extracting resource flow data from the behavior data to be detected; determining whether the behavior data to be detected belongs to the target arbitrage behavior based on the feature data includes: determining an average resource increment based on a flow length and a resource increment in the resource flow data; if the average resource increment is greater than or equal to a preset increment threshold, determining that the behavior data to be detected belongs to decentralized exchange arbitrage behavior.

[0008] Optionally, extracting resource flow data from the behavior data to be detected includes: obtaining the resource flow path of the behavior data to be detected, and determining the starting resource in the resource flow path; dividing the resource flow path into sub-paths using the node corresponding to the starting resource in the resource flow path as a dividing point; and extracting the resource flow data of the sub-path.

[0009] Optionally, the multiple arbitrage behavior categories include: sandwich trading arbitrage behavior, decentralized exchange arbitrage behavior, NFT investment arbitrage behavior, and front-running trading.

[0010] Optionally, the method also includes: obtaining first sample behavior data and a known arbitrage behavior category label corresponding to the first sample behavior data; performing supervised learning using the first sample behavior data and the known arbitrage behavior category label to obtain a first sub-model; obtaining second sample behavior data, performing unsupervised learning based on the second sample behavior data to obtain a second sub-model; and obtaining the arbitrage behavior identification model based on the first sub-model and the second sub-model.

[0011] According to a second aspect of the present disclosure, a blockchain arbitrage behavior detection device is provided, including: a data acquisition module, configured to acquire behavior data to be detected in the blockchain; an identification processing module, configured to process the behavior data to be detected using a pre-trained arbitrage behavior identification model to output an identification result corresponding to the behavior data to be detected; and an arbitrage behavior determination module, configured to determine whether the behavior data to be detected belongs to arbitrage behavior based on the identification result.

[0012] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the blockchain arbitrage behavior detection method and possible implementation methods thereof of the above-mentioned first aspect are implemented.

[0013] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the blockchain arbitrage behavior detection method and possible implementation methods of the above-mentioned first aspect by executing the executable instructions.

[0014] The technical solution disclosed in this disclosure has the following beneficial effects:

[0015] In this solution, an arbitrage behavior identification model is trained and used to identify the behavior data to be detected, and further based on the identification results, it is determined whether the behavior data to be detected belongs to arbitrage behavior. This realizes the automatic identification and effective detection of blockchain arbitrage behavior without the need for manual identification, reduces labor and time costs, improves the accuracy of detection results, and facilitates further taking corresponding measures against arbitrage behavior. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A schematic diagram showing a system architecture in this exemplary embodiment;

[0017] Figure 2 A flowchart of a blockchain arbitrage behavior detection method in this exemplary embodiment is shown;

[0018] Figure 3 A flowchart of a training arbitrage behavior identification model in this exemplary embodiment is shown;

[0019] Figure 4 A schematic diagram showing a training arbitrage behavior identification model in this exemplary embodiment;

[0020] Figure 5 A sub-flow chart of the blockchain arbitrage behavior detection method in this exemplary embodiment is shown;

[0021] Figure 6 A flow chart showing the detection of arbitrage behavior in a decentralized exchange in this exemplary embodiment;

[0022] Figure 7 A schematic diagram showing the structure of a blockchain arbitrage behavior detection device in this exemplary embodiment is shown;

[0023] Figure 8 A schematic structural diagram of an electronic device in this exemplary embodiment is shown. DETAILED DESCRIPTION

[0024] Exemplary embodiments of the present disclosure will be described more fully hereinafter with reference to the accompanying drawings.

[0025] The accompanying drawings are schematic diagrams of the present disclosure and are not necessarily drawn to scale. Some of the block diagrams shown in the accompanying drawings may be functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in hardware modules or integrated circuits, or in networks, processors or microcontrollers. The embodiments can be implemented in various forms and should not be construed as being limited to the examples set forth herein. The features, structures or characteristics described in the present disclosure may be combined in one or more embodiments in any suitable manner. In the description below, many specific details are provided to provide a full description of the embodiments of the present disclosure. However, those skilled in the art should appreciate that one or more specific details may be omitted when implementing the technical solution of the present disclosure, or one or more specific details may be replaced by other methods, components, devices, steps, etc.

[0026] Most of the related technologies require manual identification of blockchain arbitrage behaviors, which consumes high labor and time costs, and cannot guarantee the accuracy of the identification results.

[0027] In view of one or more of the above problems, an exemplary embodiment of the present disclosure provides a blockchain arbitrage behavior detection method. Figure 1 Describe the system architecture.

[0028] refer to Figure 1 As shown, the system architecture 100 may include a management device 110 and a blockchain node 120. Among them, the blockchain node 120 may be a user device in the blockchain; the management device 110 is used to collect the behavior data of each blockchain node 120 and perform blockchain arbitrage behavior detection. The management device 110 may be located in the blockchain and may directly obtain the behavior data of each blockchain node 120. For example, the management device 110 may be a security center server of the blockchain. In one embodiment, the management device 110 may be any blockchain node 120. The management device 110 may also be located outside the blockchain and connected to a specific node (such as a centralized node) in the blockchain through a wired or wireless communication link, and obtain the behavior data of each blockchain node 120 through the specific node.

[0029] As can be seen from the above, the blockchain arbitrage behavior detection method in this exemplary embodiment can be executed by the management device 110.

[0030] Combine the following Figure 2 The method for detecting blockchain arbitrage behavior is explained. Figure 2 The process of the method for detecting arbitrage behavior through blockchain is shown, which may include the following steps S210 to S230:

[0031] Step S210, obtaining the behavior data to be detected in the blockchain;

[0032] Step S220, using the pre-trained arbitrage behavior recognition model to process the behavior data to be detected, so as to output a recognition result corresponding to the behavior data to be detected;

[0033] Step S230: determining whether the behavior data to be detected belongs to arbitrage behavior according to the recognition result.

[0034] Based on the above method, an arbitrage behavior identification model is trained, and the model is used to identify the behavior data to be detected, and further based on the identification results, it is determined whether the behavior data to be detected belongs to arbitrage behavior. This realizes the automatic identification and effective detection of blockchain arbitrage behavior without the need for manual identification, reduces labor and time costs, improves the accuracy of detection results, and facilitates further taking corresponding measures against arbitrage behavior.

[0035] Below Figure 2 Provide detailed instructions for each step.

[0036] refer to Figure 2 , in step S210, the behavior data to be detected in the blockchain is obtained.

[0037] In this exemplary embodiment, the behavior to be detected is a behavior performed in the blockchain network, which may be a network interaction behavior of each blockchain node 120, such as a transaction behavior, an accounting behavior, a request initiation behavior, etc. The behavior data to be detected may include broadcast data, log data, etc. in the behavior to be detected.

[0038] Since a large amount of behavior data is generated in the blockchain, in one embodiment, the behavior data in the blockchain can be pre-detected to detect the behavior data suspected of arbitrage behavior as the behavior data to be detected, thereby reducing the amount of data to be detected and the amount of calculation for subsequent processing. In the pre-detection, the judgment conditions for suspected arbitrage behavior can be set, such as data filtering conditions, regular expressions, etc., and the behavior data that meets the judgment conditions is used as the behavior data to be detected.

[0039] In one embodiment, the behavior data to be detected within a certain time range may be obtained. For example, blockchain arbitrage behavior detection may be performed periodically, such as a period of 1 hour, and in step S210, the behavior data to be detected within the last 1 hour may be obtained.

[0040] Continue to refer Figure 2 In step S220, the behavior data to be detected is processed using the pre-trained arbitrage behavior recognition model to output a recognition result corresponding to the behavior data to be detected.

[0041] The arbitrage behavior identification model is a pre-trained machine learning model that is used to input behavior data and output arbitrage behavior identification results corresponding to the behavior data. The present disclosure does not limit the specific type of the arbitrage behavior identification model, such as a neural network, a decision tree, a support vector machine, etc.

[0042] In one embodiment, the arbitrage behavior identification model can be used to perform a binary classification task of "yes" or "no". After processing the behavior data to be detected, the output identification result corresponding to the behavior data to be detected can be: the identification result of whether the behavior data to be detected is arbitrage behavior or not arbitrage behavior.

[0043] In one embodiment, the arbitrage behavior recognition model can be used to perform multi-classification tasks. After processing the behavior data to be detected, the output recognition result corresponding to the behavior data to be detected can be: the target arbitrage behavior category corresponding to the behavior data to be detected in multiple arbitrage behavior categories. Among them, the arbitrage behavior category is a category determined by pre-classifying the arbitrage behavior, such as: sandwich trading arbitrage behavior, decentralized exchange arbitrage behavior, NFT (Non-Fungible Token, non-homogeneous token) investment arbitrage behavior, front-running trading arbitrage behavior, etc. The arbitrage behavior recognition model can be used to determine which of the above arbitrage behavior categories the behavior data to be detected corresponds to, and output the classification result of the arbitrage behavior category, that is, the target arbitrage behavior category.

[0044] The following describes how to train an arbitrage behavior identification model.

[0045] In one embodiment, reference Figure 3 As shown, the blockchain arbitrage behavior identification method may further include the following steps S310 to S340:

[0046] Step S310, obtaining first sample behavior data and a known arbitrage behavior category label corresponding to the first sample behavior data;

[0047] The first sample behavior data is the behavior data of known arbitrage behavior, and the known arbitrage behavior category label is the annotation data (ground truth) corresponding to the first sample behavior data. Exemplarily, the known arbitrage behavior categories may include sandwich trading arbitrage behavior, decentralized exchange arbitrage behavior, NFT investment arbitrage behavior, front-running trading arbitrage behavior, etc. The behavior data that has been determined as arbitrage behavior (such as can be determined manually) under each category can be obtained as the first sample behavior data, and its corresponding category is used as the known arbitrage behavior category label, thereby forming a data pair of the first sample behavior data-known arbitrage behavior category label. By collecting a large amount of first sample behavior data and its known arbitrage behavior category label, a supervised data set is formed.

[0048] Step S320, using the first sample behavior data and known arbitrage behavior category labels to perform supervised learning to obtain a first sub-model;

[0049] The first sub-model may be a pre-built classification model, which is used to classify the arbitrage behavior category to which the behavior data belongs, or to identify whether the behavior data belongs to a certain type of arbitrage behavior. By using the first sample behavior data obtained in step S310 and the known arbitrage behavior category label for supervised learning, the first sub-model can be trained to obtain a trained first sub-model. Specifically, the first sample behavior data is input into the first sub-model, and the classification result is output after processing. By comparing the classification result with the known arbitrage behavior category label, the loss function value is calculated, and the parameters of the first sub-model are updated accordingly, thereby achieving supervised learning.

[0050] The present disclosure does not limit the number of first sub-models. For example, a first sub-model can be established, which can be used to perform multi-classification tasks and output the probability value of the behavior data belonging to each type of arbitrage behavior. Alternatively, multiple first sub-models can be established, which can be used to perform binary classification tasks, and each first sub-model is used to identify whether the behavior data belongs to a specific type of arbitrage behavior. For example, four first sub-models can be trained for the above four known arbitrage behavior categories, and each sub-model outputs the recognition result of one arbitrage behavior category.

[0051] Step S330, obtaining second sample behavior data, and performing unsupervised learning based on the second sample behavior data to obtain a second sub-model;

[0052] The second sample behavior data is the behavior data of unknown arbitrage behavior. For example, for an asset loss event in a blockchain that has occurred, if it is impossible to manually identify which known arbitrage behavior category it belongs to, the behavior data related to the event before and after can be obtained as the second sample behavior data. The second sample behavior data can be regarded as unsupervised data. Unsupervised learning can be performed based on the second sample behavior data, such as using unsupervised learning algorithms such as clustering, principal component analysis, and generative models to model the second sample behavior data, learn the commonalities of the second sample behavior data, and form a second sub-model.

[0053] Exemplarily, the second sample behavior data may be clustered to explore the commonalities between these behaviors and form unknown arbitrage behavior categories. Corresponding identifiers may be set for the unknown arbitrage behavior categories to distinguish them. After the unknown arbitrage behavior categories are determined, corresponding unknown arbitrage behavior category labels may be added to the second sample behavior data under each category, thereby forming a data pair of the second sample behavior data-unknown arbitrage behavior category label. The second sub-model is trained using the data pair.

[0054] The present disclosure does not limit the number of second sub-models. For example, a generative model may be established as the second sub-model. Alternatively, after clustering the second sample behavior data, a second sub-model may be established for each category.

[0055] Step S340: obtaining an arbitrage behavior identification model based on the first sub-model and the second sub-model.

[0056] In one embodiment, the arbitrage behavior identification model may be a group of models, such as a model library, including a first sub-model and a second sub-model.

[0057] In one embodiment, the first sub-model and the second sub-model may be combined into a global model, namely, an arbitrage behavior identification model. For example, the first sub-model and the second sub-model are used as two branches and connected in parallel to the input layer, the output layer or a specific intermediate layer to obtain the arbitrage behavior identification model.

[0058] pass Figure 3 In this way, an arbitrage behavior recognition model can be trained based on supervised sample behavior data and unsupervised sample behavior data, so that the model can learn the characteristics of the two types of sample behavior data, which can be used to identify known arbitrage behaviors and unknown arbitrage behaviors, thereby improving the comprehensiveness of arbitrage behavior recognition.

[0059] In one embodiment, the blockchain arbitrage behavior identification method may further include the following steps:

[0060] Obtaining first sample behavior data and a known arbitrage behavior category label corresponding to the first sample behavior data;

[0061] Acquire second sample behavior data, cluster the second sample behavior data to obtain one or more unknown arbitrage behavior categories, and generate corresponding unknown arbitrage behavior category labels for the second sample behavior data;

[0062] The arbitrage behavior recognition model is trained using the first sample behavior data, known arbitrage behavior category labels, the second sample behavior data, and unknown arbitrage behavior category labels.

[0063] Among them, the first sample behavior data and the known arbitrage behavior category label are supervised data. The second sample behavior data is unsupervised data, and the corresponding unknown arbitrage behavior category label is generated for it through clustering, which also forms supervised data. The first sample behavior data or the second sample behavior data is input into the arbitrage behavior recognition model to be trained, which outputs the corresponding arbitrage behavior classification result. By comparing the arbitrage behavior classification result with the known arbitrage behavior category label or the unknown arbitrage behavior category label, the loss function value can be calculated, and the parameters of the arbitrage behavior recognition model are updated accordingly, thereby realizing model training.

[0064] The above scheme trains the arbitrage behavior recognition model through two supervised data, and also enables the model to learn the characteristics of the two sample behavior data, which can be used to identify known arbitrage behaviors and unknown arbitrage behaviors, and improve the comprehensiveness of arbitrage behavior recognition.

[0065] Figure 4 A schematic diagram of training an arbitrage behavior recognition model is shown. Known arbitrage behaviors are collected, including sandwich trading arbitrage behaviors, decentralized exchange arbitrage behaviors, NFT investment arbitrage behaviors, and front-running trading arbitrage behaviors, and their behavior data are obtained to form first sample behavior data and their corresponding known arbitrage behavior category labels. Unknown arbitrage behaviors are collected, which may be events where asset losses have occurred but their arbitrage behavior categories are unknown, and their behavior data are obtained to form second sample behavior data. Supervised learning is performed using the first sample behavior data and known arbitrage behavior category labels, and unsupervised learning is performed using the second sample behavior data to obtain an arbitrage behavior recognition model.

[0066] Based on the trained arbitrage behavior recognition model, the behavior data to be detected is input into the model, and the corresponding recognition result can be output.

[0067] Continue to refer Figure 2 In step S230, it is determined whether the behavior data to be detected belongs to arbitrage behavior based on the recognition result.

[0068] In one implementation, the recognition result in step S220 may be used as the final detection result. For example, if the behavior data to be detected is identified as arbitrage behavior in the recognition result, it is finally determined that the behavior data to be detected is arbitrage behavior.

[0069] In one embodiment, further data analysis and processing can be performed based on the recognition results to ensure the accuracy of the final detection results. For example, the recognition results output by the arbitrage behavior recognition model include probability values, which can be used as the credibility of the recognition results. The recognition results can be further optimized based on the credibility to obtain the final detection results.

[0070] In one embodiment, reference Figure 5 As shown, the above determination of whether the behavior data to be detected belongs to arbitrage behavior according to the identification result may include the following steps S510 and S520:

[0071] Step S510, extracting feature data from the behavior data to be detected according to the target arbitrage behavior category;

[0072] Step S520: determining whether the behavior data to be detected belongs to the target arbitrage behavior based on the feature data.

[0073] The behavior data to be detected usually contains data from many aspects. For different arbitrage behavior categories, the data required for arbitrage behavior detection may be different. Feature data refers to the data required for arbitrage behavior detection for the target arbitrage behavior category. For example, if the target arbitrage behavior category is decentralized exchange arbitrage behavior, the type of feature data required may be resource flow data; if the target arbitrage behavior category is sandwich trading arbitrage behavior, the type of feature data required may be resource transaction data, and so on.

[0074] After extracting the required feature data according to the target arbitrage behavior category corresponding to the behavior data to be detected, further analysis of the feature data can be performed to determine whether the behavior data to be detected belongs to the target arbitrage behavior, thereby obtaining the final detection result. For example, the index value in the behavior data to be detected can be calculated based on the feature data, and the judgment can be made based on the index value. Alternatively, the feature data can be used to determine whether the behavior data to be detected meets the characteristics of arbitrage behavior, thereby determining whether it belongs to arbitrage behavior.

[0075] based on Figure 5 The process can extract different types of feature data for different arbitrage behavior categories, and determine whether the behavior data to be detected belongs to the arbitrage behavior under its corresponding category based on the feature data, which improves the flexibility and pertinence of the blockchain arbitrage behavior detection method. Focusing the process of processing and analyzing the behavior data to be detected on the feature data can reduce the processing of irrelevant data and improve efficiency.

[0076] In one embodiment, taking the target arbitrage behavior category as decentralized exchange arbitrage behavior as an example, Figure 5 The process is further explained. Figure 6 As shown, Figure 5 The process can be implemented as Figure 6 Steps S610 to S640 in:

[0077] Step S610, determining that the type of characteristic data required for detecting arbitrage behavior in decentralized exchanges is resource flow data;

[0078] Step S620, extracting resource flow data from the behavior data to be detected;

[0079] Step S630, determining an average resource increment based on the flow length and the resource increment in the resource flow data;

[0080] Step S640: If the average resource increment is greater than or equal to the preset increment threshold, it is determined that the behavior data to be detected belongs to decentralized exchange arbitrage behavior.

[0081] Among them, resources can be exchangeable or tradable resources in the blockchain, such as digital assets of the blockchain. In order to detect arbitrage behavior in decentralized exchanges, the feature data that needs to be extracted is resource flow data. Resource flow data is used to describe the resource changes of blockchain users during a series of resource exchanges or transactions. For example, a series of resource exchange behaviors of a blockchain user in a decentralized exchange are as follows: 1000 resource a is exchanged for 980 resource b, 980 resource b is exchanged for 990 resource c, 990 resource c is exchanged for 1010 resource a, 1010 resource a is exchanged for 800 resource d, 800 resource d is exchanged for 1020 resource a, 1020 resource a is exchanged for 1010 resource c, 1100 resource c is exchanged for 1200 resource e, 1200 resource e is exchanged for 1100 resource f, and 1100 resource f is exchanged for 1030 resource a. The resource transfer process is represented in the form of data, that is, resource transfer data is obtained. For example, each resource exchange can be represented as a binary data group, such as (1000a, 980b), (980b, 990c), or the resource data can be arranged in chronological order to form serialized data, and so on.

[0082] The circulation length is used to quantitatively indicate the length of the resource circulation process. It can be the number of resource exchanges, such as the circulation length of the above resource circulation process is 9, or it can be the number of intermediate links of the resource exchange, such as the circulation length of the above resource circulation process is 8. The present disclosure does not limit the method for calculating the circulation length. The resource increment is used to quantitatively indicate the increase or decrease of resources. For example, 1000 resources a are exchanged for 980 resources b, and the increment of resource a is -1000. In the above resource circulation process, 1000 resources a are finally exchanged for 1030 resources a, and the increment of resource a is 30. The average resource increment can be the ratio of the resource increment (or the sum of the resource increment and the coefficient) to the circulation length. The circulation length is represented by n, and the increment of resource a is represented by Δa. The average resource increment is Δa / n. It can be seen that the average resource increment refers to the average resource increment per circulation or each intermediate link. It combines the absolute resource increment and the complexity of resource circulation (the longer the circulation length, the more complex the circulation process and the higher the corresponding cost) to characterize the resource benefits of the resource circulation process.

[0083] The preset increment threshold is used to measure whether the average resource increment is too high, and can be determined based on experience or specific circumstances. If the average resource increment calculated in step S630 is greater than or equal to the preset increment threshold, it means that the resource income of the above resource flow process is large and there is arbitrage behavior, thereby determining that the behavior data to be detected belongs to the arbitrage behavior of the decentralized exchange.

[0084] based on Figure 6After identifying the category of decentralized exchange arbitrage behavior corresponding to the behavior data to be detected, the resource flow data is extracted from the behavior data to be detected, and the average resource increment is calculated based on the flow length and resource increment in the resource flow data, and compared with the preset increment threshold to determine whether the behavior data to be detected belongs to decentralized exchange arbitrage behavior. A solution for feature data extraction and data analysis for decentralized exchange arbitrage behavior is provided, which can effectively detect decentralized exchange arbitrage behavior, and the implementation process of the solution is simple and the calculation amount is low.

[0085] In one implementation, the above-mentioned extraction of resource flow data from the behavior data to be detected may include the following steps:

[0086] Obtain the resource flow path of the behavior data to be detected, and determine the starting resource in the resource flow path;

[0087] Taking the node corresponding to the starting resource in the resource flow path as the dividing point, the resource flow path is divided into sub-paths;

[0088] Extract resource flow data of subpath.

[0089] For example, in the above resource flow process, the resource flow path is:

[0090] a×1000→b×980→c×990→a×1010→d×800→a×1020→c×1010→e×1200→f×1100→a×1030;

[0091] The starting resource in the resource flow path is a; taking the node corresponding to a as the dividing point, the resource flow path can be divided into three sub-paths, as shown below:

[0092] Subpath 1, a×1000→b×980→c×990→a×1010;

[0093] Subpath 2, a×1010→d×800→a×1020;

[0094] Subpath 3, a×1020→c×1010→e×1200→f×1100→a×1030;

[0095] After obtaining the subsequence, the resource flow data of each subpath can be extracted respectively, and the average resource increment can be calculated, such as the average resource increment Δa / n of subpath 1 is 10 / 3=3.3, the average resource increment of subpath 2 is 5, and the average resource increment of subpath 3 is 2.5. Then, the average resource increment of each subpath can be compared with the preset increment threshold to determine whether there is a situation where the resource income is too large in each subpath. In one embodiment, if there is a situation where the resource income is too large in at least one subpath, it is determined that the behavior data to be detected belongs to the arbitrage behavior of the decentralized exchange. In one embodiment, the behavior data to be detected can be divided into multiple groups of behavior data according to the division of the subpath, and each group of behavior data corresponds to a subpath, that is, it can be considered that the behavior data to be detected contains multiple behaviors. If there is a situation where the resource income is too large in a subpath, it is determined that the group of behavior data corresponding to the subpath belongs to the arbitrage behavior of the decentralized exchange.

[0096] By using the above-mentioned method of splitting sub-paths, each sub-path can be judged, thereby achieving more accurate and refined arbitrage behavior detection.

[0097] In one implementation, in order to facilitate the segmentation of sub-paths, the nodes in the resource flow path may be converted first, and the nodes corresponding to the starting resources and the nodes corresponding to the non-starting resources may be represented by two characters respectively. For example, the node corresponding to resource a may be represented as ▲, and the nodes corresponding to other resources may be represented as ■. Then, the above resource flow path may be simplified as follows:

[0098] ▲→■→■→▲→■→▲→■→■→■→■→▲;

[0099] Then we can split the path using ▲ as the split point to obtain sub-paths, as follows:

[0100] Subpath 1, ▲→■→■→▲;

[0101] Subpath 2, ▲→■→▲;

[0102] Subpath 3, ▲→■→■→■→▲;

[0103] In one embodiment, it is possible to search in the arbitrage behavior identification model whether there is a behavior pattern identical to the above subsequence. If so, the subsequence may belong to arbitrage behavior, and further extract characteristic data (i.e., resource flow data) and analyze it. If not, the subsequence does not belong to arbitrage behavior and no subsequent processing is required.

[0104] In actual situations, since the arbitrage behaviors of decentralized exchanges may be different, the specific behavior chains may also be different. The pre-trained arbitrage behavior identification model can effectively identify potential decentralized exchange arbitrage behaviors, and then further analyze the resource flow data, which can significantly improve the reliability of arbitrage behavior detection results.

[0105] In one embodiment, the target arbitrage behavior category is sandwich trading arbitrage behavior as an example for further explanation. Sandwich trading arbitrage behavior refers to the arbitrageur placing two transactions before and after the actual trader's order, trading at a lower price before the actual trader's transaction, and then selling the order at a higher price to make a profit after the actual trader completes the transaction. For potential sandwich trading arbitrage behavior, transaction time data and resource increment can be extracted from the behavior data to be detected, and the transaction time difference can be calculated through the transaction time data of the two transactions, and the ratio of the resource increment to the transaction time difference can be calculated. If the ratio is too high (such as greater than or equal to the preset sandwich trading threshold), it is determined to be a sandwich trading arbitrage behavior.

[0106] The exemplary embodiment of the present disclosure also provides a blockchain arbitrage behavior detection device. Figure 7 As shown, the blockchain arbitrage behavior detection device 700 includes:

[0107] The data acquisition module 710 is configured to acquire the behavior data to be detected in the blockchain;

[0108] The identification processing module 720 is configured to process the behavior data to be detected using a pre-trained arbitrage behavior identification model to output an identification result corresponding to the behavior data to be detected;

[0109] The arbitrage behavior determination module 730 is configured to determine whether the behavior data to be detected belongs to arbitrage behavior according to the recognition result.

[0110] In one implementation, the identification result corresponding to the behavior data to be detected includes: a target arbitrage behavior category corresponding to the behavior data to be detected among multiple arbitrage behavior categories.

[0111] In one implementation, the above-mentioned determining whether the behavior data to be detected belongs to arbitrage behavior according to the recognition result includes:

[0112] Extract feature data from the behavior data to be detected according to the target arbitrage behavior category;

[0113] Determine whether the behavior data to be detected belongs to the target arbitrage behavior based on the feature data.

[0114] In one embodiment, the target arbitrage behavior category includes decentralized exchange arbitrage behavior. The feature data is extracted from the behavior data to be detected according to the target arbitrage behavior category, including:

[0115] It is determined that the type of characteristic data required to detect arbitrage behavior in decentralized exchanges is resource flow data;

[0116] Extract resource flow data from the behavior data to be detected.

[0117] The above-mentioned determination of whether the behavior data to be detected belongs to the target arbitrage behavior based on the characteristic data includes:

[0118] Determine an average resource increment based on the flow length and resource increment in the resource flow data;

[0119] If the average resource increment is greater than or equal to the preset increment threshold, it is determined that the behavior data to be detected belongs to decentralized exchange arbitrage behavior.

[0120] In one implementation, the above-mentioned extracting resource flow data from the behavior data to be detected includes:

[0121] Obtain the resource flow path of the behavior data to be detected, and determine the starting resource in the resource flow path;

[0122] Taking the node corresponding to the starting resource in the resource flow path as the dividing point, the resource flow path is divided into sub-paths;

[0123] Extract resource flow data of subpath.

[0124] In one embodiment, the above-mentioned multiple arbitrage behavior categories include: sandwich trading arbitrage behavior, decentralized exchange arbitrage behavior, NFT investment arbitrage behavior, and front-running trading.

[0125] In one embodiment, the blockchain arbitrage behavior detection device 700 may further include a model training module configured to:

[0126] Obtaining first sample behavior data and a known arbitrage behavior category label corresponding to the first sample behavior data;

[0127] Using the first sample behavior data and known arbitrage behavior category labels to perform supervised learning, a first sub-model is obtained;

[0128] Acquire second sample behavior data, and perform unsupervised learning based on the second sample behavior data to obtain a second sub-model;

[0129] Based on the first sub-model and the second sub-model, an arbitrage behavior identification model is obtained.

[0130] The specific details of each part of the above-mentioned device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.

[0131] The exemplary embodiments of the present disclosure also provide a computer-readable storage medium, which can be implemented in the form of a program product, which includes a program code, and when the program product is run on an electronic device, the program code is used to cause the electronic device to perform the steps described in the above "Exemplary Method" section of this specification according to various exemplary embodiments of the present disclosure. In an optional embodiment, the program product can be implemented as a portable compact disk read-only memory (CD-ROM) and includes program code, and can be run on an electronic device, such as a personal computer. However, the program product of the present disclosure is not limited to this, and in this document, the readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, device or device.

[0132] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0133] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0134] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0135] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0136] The exemplary embodiment of the present disclosure also provides an electronic device, which may be, for example, the control node described above. The electronic device may include a processor and a memory. The memory stores executable instructions of the processor, such as program code. The processor executes the blockchain arbitrage behavior detection method in the exemplary embodiment by executing the executable instructions, such as program code. Figure 2 method steps.

[0137] Reference below Figure 8 , the electronic device is exemplarily described in the form of a general-purpose computing device. It should be understood that Figure 8 The electronic device 800 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0138] like Figure 8 As shown, the electronic device 800 may include: a processor 810 , a memory 820 , a bus 830 , an I / O (input / output) interface 840 , and a network adapter 850 .

[0139] The memory 820 may include a volatile memory, such as a RAM 821, a cache unit 822, and may also include a non-volatile memory, such as a ROM 823. The memory 820 may also include one or more program modules 824, such program modules 824 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may include the implementation of a network environment.

[0140] The bus 830 is used to realize the connection between different components of the electronic device 800, and may include a data bus, an address bus, and a control bus.

[0141] The electronic device 800 can communicate with one or more external devices 900 (eg, a keyboard, a mouse, an external controller, etc.) through the I / O interface 840 .

[0142] The electronic device 800 can communicate with one or more networks through the network adapter 850. For example, the network adapter 850 can provide mobile communication solutions such as 3G / 4G / 5G, or wireless communication solutions such as wireless LAN, Bluetooth, near field communication, etc. The network adapter 850 can communicate with other modules of the electronic device 800 through the bus 830.

[0143] although Figure 8 Not shown, other hardware and / or software modules may also be provided in the electronic device 800, including but not limited to: a display, a microcode, a device driver, a redundant processor, an external disk drive array, a RAID system, a tape drive, and a data backup storage system.

[0144] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0145] It will be appreciated by those skilled in the art that various aspects of the present disclosure may be implemented as a system, method or program product. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which may be collectively referred to herein as a "circuit", "module" or "system". Those skilled in the art will readily think of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variations, uses or adaptive changes of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and implementation are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

[0146] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A blockchain arbitrage behavior detection method, characterized in that: include: Obtain the behavior data to be detected in the blockchain; Processing the behavior data to be detected using a pre-trained arbitrage behavior recognition model to output a recognition result corresponding to the behavior data to be detected; Determining whether the behavior data to be detected belongs to arbitrage behavior according to the identification result; The identification result corresponding to the behavior data to be detected includes: a target arbitrage behavior category corresponding to the behavior data to be detected in multiple arbitrage behavior categories; The determining whether the behavior data to be detected belongs to arbitrage behavior according to the recognition result includes: extracting feature data from the behavior data to be detected according to the target arbitrage behavior category; and determining whether the behavior data to be detected belongs to the target arbitrage behavior based on the feature data; The target arbitrage behavior category includes decentralized exchange arbitrage behavior; the extracting characteristic data from the behavior data to be detected according to the target arbitrage behavior category includes: determining that the type of characteristic data required for detecting decentralized exchange arbitrage behavior is resource flow data; extracting resource flow data from the behavior data to be detected; The determining, based on the feature data, whether the behavior data to be detected belongs to the target arbitrage behavior includes: determining an average resource increment based on the flow length and resource increment in the resource flow data; if the average resource increment is greater than or equal to a preset increment threshold, determining that the behavior data to be detected belongs to a decentralized exchange arbitrage behavior.

2. The method according to claim 1, characterized in that The obtaining of the behavior data to be detected in the blockchain includes: performing a pre-detection on the behavior data in the blockchain to detect behavior data suspected of arbitrage behavior as the behavior data to be detected.

3. The method according to claim 1, characterized in that The circulation length includes the number of resource exchanges or the number of intermediate links in the resource exchange; the average resource increment includes the average resource increment per circulation or the resource increment per intermediate link.

4. The method according to claim 1, characterized in that The target arbitrage behavior category includes sandwich trading arbitrage behavior; extracting feature data from the behavior data to be detected according to the target arbitrage behavior category includes: extracting transaction time and resource increment from the behavior data to be detected; The determining, based on the characteristic data, whether the behavior data to be detected belongs to the target arbitrage behavior includes: calculating a transaction time difference through the transaction times of two transactions, and calculating a ratio of the resource increment to the transaction time difference; if the ratio is greater than or equal to a preset sandwich transaction threshold, determining that the behavior data to be detected belongs to a sandwich transaction arbitrage behavior.

5. The method according to claim 1, characterized in that The extracting resource flow data from the behavior data to be detected includes: Acquire the resource flow path of the behavior data to be detected, and determine the starting resource in the resource flow path; Taking the node corresponding to the starting resource in the resource flow path as a dividing point, dividing the resource flow path into sub-paths; Extract resource flow data of the subpath.

6. The method according to claim 1, characterized in that The multiple arbitrage behavior categories include: sandwich trading arbitrage, decentralized exchange arbitrage, NFT investment arbitrage, and front-running transactions.

7. The method according to claim 1, characterized in that The method further comprises: Acquire first sample behavior data and a known arbitrage behavior category label corresponding to the first sample behavior data; Performing supervised learning using the first sample behavior data and the known arbitrage behavior category label to obtain a first sub-model; Acquire second sample behavior data, and perform unsupervised learning based on the second sample behavior data to obtain a second sub-model; Based on the first sub-model and the second sub-model, the arbitrage behavior identification model is obtained.

8. A blockchain arbitrage behavior detection device, characterized in that: include: A data acquisition module, configured to acquire the behavior data to be detected in the blockchain; an identification processing module, configured to process the behavior data to be detected using a pre-trained arbitrage behavior identification model to output an identification result corresponding to the behavior data to be detected; an arbitrage behavior determination module, configured to determine whether the behavior data to be detected belongs to arbitrage behavior according to the recognition result; The identification result corresponding to the behavior data to be detected includes: a target arbitrage behavior category corresponding to the behavior data to be detected in multiple arbitrage behavior categories; The determining whether the behavior data to be detected belongs to arbitrage behavior according to the recognition result includes: extracting feature data from the behavior data to be detected according to the target arbitrage behavior category; and determining whether the behavior data to be detected belongs to the target arbitrage behavior based on the feature data; The target arbitrage behavior category includes decentralized exchange arbitrage behavior; the extracting characteristic data from the behavior data to be detected according to the target arbitrage behavior category includes: determining that the type of characteristic data required for detecting decentralized exchange arbitrage behavior is resource flow data; extracting resource flow data from the behavior data to be detected; The determining, based on the feature data, whether the behavior data to be detected belongs to the target arbitrage behavior includes: determining an average resource increment based on the flow length and resource increment in the resource flow data; if the average resource increment is greater than or equal to a preset increment threshold, determining that the behavior data to be detected belongs to a decentralized exchange arbitrage behavior.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.