A blockchain transaction data retrieval system, method, device and storage medium
By combining blockchain monitoring nodes, data processing modules, and graph databases, the problems of poor data query performance and real-time performance in blockchain trading platforms are solved, enabling fast real-time retrieval and traceability, which is suitable for financial research and anti-money laundering businesses.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-11
- Publication Date
- 2026-03-27
AI Technical Summary
Existing blockchain trading platforms suffer from poor query performance due to their massive data volume and divergent data structure, making it difficult to achieve real-time relationship retrieval and business-level analysis, and failing to meet real-time requirements.
It employs blockchain monitoring nodes, data processing modules, data storage modules, and data query modules, combined with in-memory databases and graph databases, to achieve rapid real-time retrieval and traceability of blockchain transaction data.
It enables the rapid import and retrieval of massive amounts of blockchain data in extremely low response times, supports real-time transaction traceability and business needs, improves data query performance, and is applicable to fields such as financial research, anti-fraud and anti-money laundering.
Smart Images

Figure CN114357000B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of block chain, and particularly relates to a block chain transaction data retrieval system, method, device and storage medium. BACKGROUND
[0002] In the existing regional chain transaction platform, due to the large amount of block chain encrypted currency data, especially the divergent data structure characteristics of the block chain, the data query performance is very poor, and it is difficult to achieve the relationship retrieval of the transaction on the block chain, even the address level; and due to the limitation of performance bottleneck, the existing regional chain transaction platform cannot achieve the business level analysis requirement, such as analyzing the transaction preference of the address, the specific situation of the fund inflow and outflow and the like; in addition, due to the high block transaction quantity of the existing regional chain transaction platform such as Ethereum, the traditional block file or traditional analysis method cannot meet the real-time requirement. Therefore, the current market urgently needs to develop a tool for deep dissection of the data under the surface of the encrypted currency. SUMMARY
[0003] In order to overcome the defects of the prior art, one of the purposes of the present application is to provide a block chain transaction data retrieval system, which can quickly perform real-time relationship retrieval on the transaction on the block chain and improve the retrieval efficiency.
[0004] The second purpose of the present application is to provide a block chain transaction data analysis and monitoring method, which can realize real-time transaction traceability.
[0005] The third purpose of the present application is to provide an electronic device.
[0006] The fourth purpose of the present application is to provide a storage medium.
[0007] One of the purposes of the present application is achieved by the following technical scheme:
[0008] A block chain transaction data retrieval system comprises:
[0009] A block chain monitoring node is used for synchronizing the blocks and transaction data on the block chain, and sending the data obtained by monitoring to a data processing module in units of blocks;
[0010] A data processing module is used for receiving the block data of different blocks, and processing the different block data respectively and then buffering them to an in-memory database;
[0011] A data storage module is used for classifying and screening the data stored in the in-memory database in the data processing module according to the structure of a graph database at regular time intervals, and writing the processed structure to a graph database;
[0012] The data query module is configured to use a query language of the graph database to perform real-time retrieval on the data written in the graph database according to the received query instruction.
[0013] Further, the memory database is a kv database; the data processing module processes different block data, including:
[0014] The block data received from different regions is subjected to block height identification, and the transaction data is subjected to hash calculation to obtain a transaction hash value, so that the block height and the transaction hash value are cached in the kv database as keys.
[0015] Further, before the data storage module writes the processed structure into the graph database, it further includes:
[0016] It is judged whether the graph database is empty, if the current graph database is empty, the processed structure is directly written into the graph database using the initialization mode of the graph database.
[0017] Further, it further includes:
[0018] The business module is connected with the data query module, and is configured to initiate a corresponding query instruction to the data query module according to the business requirement, so that the data query module retrieves the corresponding address and transaction data according to the query instruction.
[0019] The second purpose of the application is achieved by the following technical scheme:
[0020] A blockchain transaction data analysis and monitoring method applied in the blockchain transaction data retrieval system as described above, comprising:
[0021] A target address is obtained, and the target address is used as a starting point to search for transactions related to the target address and blocks associated with the transactions;
[0022] According to the input or output address of the searched transaction, another party of the transaction is set, and the address of the another party is used as a starting point to search for transactions associated with the address and blocks;
[0023] The data usage address involved in the search process is aggregated using the relationship between the data usage address and the transaction to obtain the transaction direction, so as to realize the traceability tracking of the transaction.
[0024] Further, when performing transaction traceability tracking, it further includes:
[0025] The transaction data associated with the data usage address is subjected to transaction amount summation processing, and all transaction hash values associated with the data usage address are counted and displayed.
[0026] Further, after obtaining the transaction direction, further comprising:
[0027] A visual chart is generated and displayed, the visual chart comprising a transaction trace graph, the transaction trace graph at least marking a data usage address, transaction data and a transaction direction.
[0028] Further, the visual chart further comprises a transaction statistical chart, the transaction statistical chart displaying cumulative transaction amount, average transaction amount and cumulative transaction times in different time periods.
[0029] The third purpose of the present application is achieved by the following technical solution:
[0030] An electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the processor implementing the blockchain transaction data analysis and monitoring method when executing the computer program.
[0031] The fourth purpose of the present application is achieved by the following technical solution:
[0032] A storage medium having a computer program stored thereon, the computer program being executed to implement the blockchain transaction data analysis and monitoring method.
[0033] Compared with the prior art, the present application has the following advantages:
[0034] The present application can monitor the block data of different blockchains, realize the rapid import of massive blockchain data, and combine the data retrieval of the graph database to retrieve the data on the chain in real time at an extremely low response time (millisecond level) speed; based on this, the transaction information of the tracked address is realized in real time according to the needs of the business, and the anti-anonymity target is realized by classifying and positioning the address and combining some transaction behavior habits, which can finally assist some financial research, fraud prevention, anti-money laundering, extortion and other business fields. BRIEF DESCRIPTION OF DRAWINGS
[0035] Figure 1 A module schematic diagram of the blockchain transaction data retrieval system of the present application;
[0036] Figure 2 A flowchart of the blockchain transaction data analysis and monitoring method of the present application;
[0037] Figure 3 A display graph of the transaction trace tracking of the present application;
[0038] Figure 4 A display graph of the transaction flow direction of the address of the present application;
[0039] Figure 5 A display graph of the visual chart of the present application. Detailed Implementation
[0040] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments. It should be noted that, without conflict, the various embodiments or technical features described below can be arbitrarily combined to form new embodiments.
[0041] Example 1
[0042] This embodiment provides a blockchain transaction data retrieval system. This system can quickly and in real-time retrieve transaction data on the blockchain, even performing address-level relationship searches, significantly improving data query performance. For example... Figure 1 As shown, the retrieval system in this embodiment specifically includes a blockchain monitoring node, a data processing module, a data storage module, a data query module, and a business module.
[0043] The blockchain monitoring node is compatible with the blockchain protocols required by the system. It synchronizes blocks and transaction data on different blockchains through the blockchain protocols and sends the monitored data to the data processing module in units of blocks.
[0044] The blockchain monitoring node is connected to the data processing module. After receiving block data from different regions, the data processing module processes the different block data separately and caches them in the memory database. In this embodiment, the memory database used is a key-value (kV) database, where kV refers to a key-value pair. The key-value (KV) database is a type of distributed storage database characterized by fast query speed, large data storage capacity, and support for high concurrency. This embodiment stores different received block data into the KV database. This requires identifying the block height and calculating the transaction hash value for the received block data from different regions. The block height simply refers to the number of blocks connected to the main chain. When a blockchain listening node receives a block, it dynamically identifies the block's position within the blockchain to obtain its block height. This block height can also be stored as metadata in an indexed database table for quick retrieval.
[0045] This embodiment uses transaction hashes to present transaction records such as issuing address, receiving address, issuing time, receiving time, and number of confirmations. Specific transaction details can be viewed through the transaction hash, and each hash corresponds to a unique transaction, ensuring transaction privacy and security.
[0046] The data processing module in this embodiment caches the block height and transaction hash value as the key into the kv database after the above processing, and the purpose is to abstract and integrate different block data into a set of processes and data sets to facilitate subsequent data storage.
[0047] The data storage module in this embodiment is used to classify and filter the data stored in the memory database in the data processing module according to the structure of the graph database, and write the processed structure into the graph database. Since the graph model provides an inherent index data structure, it does not need to load or touch irrelevant data for a given condition query, which makes it good at processing large amounts of complex, interconnected, and low-structured data; the basic storage unit of the graph database is: node, relationship, attribute, which can present and query the association relationship between nodes, thereby meeting the relationship retrieval demand in the process of tracing the source of the blockchain transaction data.
[0048] The data in this embodiment is classified and filtered according to the graph database structure, and the purpose is to establish the association relationship between the divergent data, so as to change into the structure matched with the graph database to facilitate storage in the graph database.
[0049] Since the graph database needs to first count the original data information when adding new data, check and establish the connection between the new data and the original data, therefore, the speed of adding new data in the non-empty database of the graph database will be relatively slow. In order to speed up the import speed of massive blockchain data, before writing the processed structure into the graph database, it is also necessary to judge whether the graph database is empty, if the current graph database is empty, then directly use the initialization mode of the graph database to write the processed structure into the graph database, that is, directly create a database storage file from the source data, without going through any database services such as indexing, transaction, etc., thereby greatly speeding up the data import speed, and realizing massive data import at a very low response time (millisecond level), at the same time, also shortening the time of searching the data on the chain, improving the efficiency.
[0050] The data query module in this embodiment integrates a set of query syntax of the graph database, and combines the structure of the blockchain, and the purpose is to facilitate quick retrieval of the blockchain structure stored in the graph database, through this layer of abstraction, the query module shields the specific query syntax and deployment structure of the graph database for the upper layer business, provides more flexible expansion space for subsequent larger scale data, and isolates changes without affecting the upper layer business. Further, through the frequency and parameter disassembly of the upper layer business calling, and according to the negotiated strategy, a certain degree of query result caching can be performed, which can obtain better response speed under larger scale data query conditions.
[0051] The data query module performs corresponding query and retrieval operations based on the business requirements of the business module. The data query module performs real-time retrieval on the data written into the graph database after receiving the query instruction issued by the business module. The business module is used for the actual application scenario of the blockchain transaction data retrieval system. The blockchain transaction data retrieval system of the embodiment can be applied to business scenarios such as fraud prevention and transaction traceability according to the characteristics of the chain structure and anonymity of the blockchain, and provides a method for obtaining the address and transaction flow relationship in the business scenario.
[0052] Embodiment Two
[0053] The embodiment provides a blockchain transaction data analysis and monitoring method, that is, the blockchain transaction data retrieval system of embodiment one is applied to the business scenario of transaction traceability, as shown in the following figure: Figure 2 The method specifically includes the following steps:
[0054] Step S1: Obtain a target address, and search transactions with the target address as the origin and the target address as the output or input relationship and blocks associated with the transactions.
[0055] The target address in the embodiment is an address that a user wants to query. The blockchain transaction data retrieval system of embodiment one is used to search transactions associated with the target address. The transaction with the target address as the output relationship refers to a transaction in which the receiving address is the target address, and the transaction with the target address as the input relationship refers to a transaction in which the sending address is the target address. Since the blockchain transaction data retrieval system of embodiment one is combined with a graph database to perform data retrieval, it can achieve address-level relationship retrieval to determine the transactions associated with the address, and can also search for blocks associated with the transactions to obtain the transaction data corresponding to the transactions.
[0056] Step S2: Set the input or output address of the searched transaction as the other party of the transaction, and search transactions and blocks associated with the address as the origin.
[0057] If the transaction with the target address as the output relationship is searched in step S1, the receiving address of the transaction is obtained. Therefore, in step S2, the input address (i.e., the sending address) of the transaction is used as the origin to search for transactions and blocks associated with the address. Similarly, if the transaction with the target address as the input relationship is searched in step S1, the sending address of the transaction is obtained. Therefore, in step S2, the output address (i.e., the receiving address) of the transaction is used as the origin to search for transactions and blocks associated with the address.
[0058] Step S3: The data involved in the search process is aggregated using the address, the relationship between the data usage address and the transaction, and the transaction direction obtained to realize the traceability tracking of the transaction.
[0059] Since the input address and the output address of the transaction obtained through the search in steps S1 and S2 can present the transaction direction, the addresses are collectively referred to as the data usage address and are used as the first aggregation condition, and the relationship between the transaction and the address is used as the second aggregation condition, and all transaction hash values involved are counted to obtain the corresponding transaction data, and the transaction amount of the transaction data is summed, and the data obtained after the aggregation can know the transaction data such as the transaction starting point, the transaction ending point, and the transaction amount, thereby realizing the purpose of traceability tracking of the transaction.
[0060] After the address and the transaction of interest of the user are searched in the embodiment, the search results can generate a visual chart to intuitively display the transaction data of the address on the chain (such as Figures 3-5 indicated), and the hidden information behind the transaction data, thereby solving the actual problems in reality, such as mining clues of money laundering, fraud, and other illegal activities for criminal investigation.
[0061] The visual chart includes a transaction traceability chart, as shown in Figure 3 , Figure 4 The transaction traceability chart at least marks the data usage address, the transaction data, and the transaction direction, so that the user can view the transaction direction, the transaction amount, the transaction address, the transaction receiving address, and all transaction hash values associated with the target address on the chain through the transaction traceability chart, thereby understanding the specific situation of the transaction fund inflow and outflow, and realizing the purpose of transaction traceability tracking. In addition, the visual chart also includes a transaction statistical chart, as shown in Figure 5 The transaction statistical chart displays the cumulative transaction amount, the average transaction amount, and the cumulative transaction times in different time periods, and is used for analyzing the transaction preference of the address according to the analysis demand of the business level, and meets various business demands.
[0062] According to the method of the embodiment, a large amount of blockchain data is quickly imported, and the data retrieval of the graph database is combined, so that the data on the chain can be searched in real time at a very low response time (millisecond level). Based on this, the transaction information of the address is tracked in real time according to the demand of the business, and the anti-anonymity target is realized by classifying and positioning the address and combining some transaction behavior habits. Finally, it can assist some financial research, fraud prevention, anti-money laundering, extortion, and other business fields.
[0063] Embodiment Three
[0064] The embodiment provides an electronic device, which comprises a processor, a memory and a computer program stored on the memory and capable of running on the processor, and the processor implements the blockchain transaction data analysis monitoring method in the second embodiment when the computer program is executed. In addition, the embodiment also provides a storage medium, which stores a computer program, and the computer program implements the blockchain transaction data analysis monitoring method when being executed.
[0065] The device and the storage medium in the embodiment and the method in the foregoing embodiments are two aspects based on the same inventive concept, and the implementation process of the method has been described in detail in the foregoing, so that those skilled in the art can clearly understand the structure and the implementation process of the device and the storage medium in the embodiment according to the foregoing description. In order to make the description brief, the device and the storage medium in the embodiment will not be described here.
[0066] The above-described embodiments are only preferred embodiments of the present application, and cannot be used to limit the protection scope of the present application. Any non-essential changes and replacements made by those skilled in the art on the basis of the present application shall fall within the protection scope of the present application.
Claims
1. A blockchain transaction data retrieval system, characterized in that, include: Blockchain listening nodes are used to synchronize blocks and transaction data on the blockchain and send the monitored data to the data processing module in units of blocks. The data processing module is used to receive block data from different regions, process the different block data separately, and cache them in an in-memory database; wherein, the in-memory database is a key-value database; the data processing module processes the different block data, including: identifying the block height of the block data received from different regions, and performing hash calculation on the transaction data to obtain the transaction hash value, thereby caching the block height and the transaction hash value as the key in the key-value database; The data storage module is used to periodically classify and filter the data stored in the memory database according to the structure of the graph database, and write the processed structure to the graph database. The data query module is used to retrieve data written into the graph database in real time based on the received query instructions and the query language of the graph database.
2. The blockchain transaction data retrieval system according to claim 1, characterized in that, Before writing the processed structure to the graph database, the data storage module also includes: determining whether the graph database is empty; if the current graph database is empty, then directly using the graph database initialization mode to write the processed structure to the graph database.
3. The blockchain transaction data retrieval system according to any one of claims 1 to 2, characterized in that, Also includes: The business module, connected to the data query module, is used to initiate corresponding query instructions to the data query module according to business needs, so that the data query module can retrieve the corresponding address and transaction data according to the query instructions.
4. A method for analyzing and monitoring blockchain transaction data, characterized in that, The application in the blockchain transaction data retrieval system as described in any one of claims 1 to 3 includes: obtaining a target address, searching for transactions with the target address as the origin and the blocks associated with the target address in the output or input relationship; The input or output address of the searched transaction is set as the other party to the transaction, and its address is used as the origin to search for transactions and blocks associated with that address; By aggregating the data usage addresses and the relationships between data usage addresses and transactions involved in the search process, the obtained transaction directions can be used to trace the origin of transactions.
5. The blockchain transaction data analysis and monitoring method according to claim 4, characterized in that, When conducting transaction tracing, it also includes: summing the transaction amounts of the transaction data associated with the data address, and statistically analyzing and displaying the hash values of all transactions associated with the data address.
6. The blockchain transaction data analysis and monitoring method according to claim 4, characterized in that, After obtaining the transaction direction, the method further includes: generating and displaying a visualization chart, which includes a transaction traceability chart, and the transaction traceability chart at least marks the data usage address, transaction data, and transaction direction.
7. The blockchain transaction data analysis and monitoring method according to claim 6, characterized in that, The visualization charts also include transaction statistics charts, which display the cumulative transaction amount, average transaction amount, and cumulative number of transactions over different time periods.
8. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the blockchain transaction data analysis and monitoring method according to any one of claims 4 to 7.
9. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed, implements the blockchain transaction data analysis and monitoring method according to any one of claims 4 to 7.
Citation Information
Patent Citations
A method and apparatus for transmitting block chain data to a block chain browser
CN109447641A
Data retrieval system and method based on block chain
CN112506925A
Cryptocurrency flow direction tracking method and device based on graph database
CN112650890A