Blockchain transaction data collection method and device, electronic equipment and storage medium
By constructing a request tracking tree and calculating synchronization semaphores in the synchronization middleware, the problem of lack of synchronization signals in blockchain transaction data acquisition tools is solved, enabling efficient data acquisition and processing by downstream processing units.
Patent Information
- Application Number
- CN202411820178.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-12-11
AI Technical Summary
Existing blockchain transaction data collection tools lack synchronization signals, making it difficult for downstream processing units to understand the data acquisition status, thus affecting task progress and efficiency.
A request tracing tree is built in the synchronization middleware. The data acquisition status is determined by calculating the synchronization semaphore, and path compression is performed in the request tracing tree to ensure that downstream processing units can obtain data in a timely manner.
This improves the response efficiency of downstream processing units, reduces waiting time, and ensures the timeliness and integrity of data processing.
Smart Images

Figure CN119646282B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of data collection, and particularly relates to a blockchain transaction data collection method and device, an electronic device and a storage medium. BACKGROUND
[0002] Blockchain is a distributed database technology that combines point-to-point transmission, consensus mechanism and encryption algorithm technology, and has been widely used in many fields. With the continuous vigorous development of the blockchain ecosystem, the number of on-chain transaction data records of the blockchain has exceeded one hundred billion, and people pay more and more attention to blockchain transaction data collection tools.
[0003] Most of the existing blockchain transaction data collection tools are ETL tools based on RPC interfaces. Users interact with on-chain data through the RPC interface of the relevant blockchain, and collect transaction data to the destination. Most of the current blockchain transaction data collection tools do not have a synchronization signal, and the downstream processing unit cannot know whether the data of a certain block has been completely acquired, which leads to the inability to respond quickly, thereby slowing down the progress of related tasks. In addition, most of the current ETL tools use the method of processing level parallel call of JSON-RPC interface, which increases the additional waiting time.
[0004] Therefore, there is an urgent need for a blockchain transaction data collection tool with a synchronization signal to help the downstream processing unit execute quickly and reduce time loss. SUMMARY
[0005] In view of this, the present application aims to provide a blockchain transaction data collection method, device, electronic device and storage medium, which constructs a request tracking tree in the synchronization middleware, so that the downstream processing unit determines the data collection situation according to the synchronization signal.
[0006] In the first aspect, the present application provides a blockchain transaction data collection method, which is executed at a synchronization middleware, comprising:
[0007] Receiving a data collection sub-request and a transaction data item sent by a request server, the data collection sub-request being generated from a data collection initial request sent by the request server to a blockchain node, and the transaction data item being generated by the request server according to the block transaction data returned by the blockchain node;
[0008] Constructing a request tracking tree, and calculating a synchronization signal in the request tracking tree according to the completion of each data collection request;
[0009] Transferring the transaction data item to a downstream processing unit according to the synchronization signal.
[0010] Further, constructing a request tracking tree and calculating a synchronization signal in the request tracking tree according to the completion of each data collection request comprises:
[0011] constructing a request tracking tree according to the dependency relationship of each data collection request, each node on the request tracking tree representing a data collection request, and the direction of the node representing the dependency relationship of the data collection request;
[0012] counting the number of uncompleted data collection requests as a synchronization semaphore, and writing the synchronization semaphore into a root node of the request tracking tree.
[0013] Further, the transmitting the transaction data item to the downstream processing unit according to the synchronization semaphore comprises:
[0014] transmitting the transaction data item to the downstream processing unit when the synchronization semaphore is 0.
[0015] Further, the method further comprises:
[0016] performing path compression on the request tracking tree according to the node type of each node on the request tracking tree.
[0017] Further, the performing path compression on the request tracking tree comprises:
[0018] determining whether the node has a grandparent node, determining the node type of the grandparent node of the node when the node has the grandparent node, and not performing path compression at the node when the node does not have the grandparent node;
[0019] when the node type of the grandparent node of the node is the request type, directly pointing the node to the grandparent node of the node.
[0020] Further, the determining the node type of the grandparent node of the node comprises:
[0021] determining whether the node has a request fingerprint, the request fingerprint being generated according to the request content of the data collection sub-request, and determining the node type of the node having the request fingerprint as the request type.
[0022] In a second aspect, the present application provides a blockchain transaction data collection device, arranged at a synchronization middleware, comprising:
[0023] a receiving module, configured to receive a data collection sub-request and a transaction data item sent by a request server, the data collection sub-request being generated according to a data collection initial request sent by the request server to a blockchain node, and the transaction data item being generated by the request server according to block transaction data returned by the blockchain node;
[0024] a synchronization tracking module, configured to construct a request tracking tree, and calculate a synchronization semaphore according to the completion of each data collection request in the request tracking tree;
[0025] a sending module, configured to transmit the transaction data item to a downstream processing unit according to the synchronization semaphore.
[0026] In a third aspect, the present application provides a blockchain transaction data collection system, comprising a request server, a synchronization middleware, and a downstream processing unit.
[0027] The request server is configured to send a data collection initial request and a data collection sub-request to the blockchain, and synchronize the data collection sub-request and a transaction data item to the synchronization middleware, the data collection sub-request being generated based on the data collection initial request sent by the request server to the blockchain node, and the transaction data item being generated by the request server based on the block transaction data returned by the blockchain node.
[0028] The synchronization middleware is configured to collect the transaction data item.
[0029] The downstream processing unit is configured to receive the transaction data item transmitted by the synchronization middleware for processing.
[0030] In the process of collecting the transaction data item, the synchronization middleware specifically executes the blockchain transaction data collection method provided in the first aspect.
[0031] In a fourth aspect, the present application provides an electronic device comprising a memory storing computer executable instructions and a processor, wherein the computer executable instructions, when executed by the processor, cause the device to execute the steps of the blockchain transaction data collection method provided in the first aspect.
[0032] In a fifth aspect, the present application provides a readable storage medium storing computer executable instructions, wherein the computer executable instructions, when executed, can implement the steps of the blockchain transaction data collection method provided in the first aspect.
[0033] As can be seen from the above technical solutions, the present application has the following beneficial effects:
[0034] The present application provides a blockchain transaction data collection method, wherein a data collection initial request is initiated by a server to a blockchain, and when the server receives a response returned by the blockchain, a transaction data item and a new data collection request are generated and synchronized to a synchronization middleware, a request tracking tree is constructed by the synchronization middleware, a synchronization semaphore is calculated in the request tracking tree according to the completion of each data collection sub-request, so that the downstream processing unit can know the acquisition progress of the transaction data through the synchronization semaphore, and when the data in the block has been acquired completely, the transaction data can be processed or stored, thereby improving the response efficiency of the downstream processing unit; and in a further embodiment, the present application further provides a scheme for path compression of the request tracking tree, which accelerates the query speed and reduces the storage memory of the request tracking tree. BRIEF DESCRIPTION OF DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description only constitute the embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of the provided drawings.
[0036] Figure 1 is a blockchain transaction data collection system architecture provided by an embodiment of the present application;
[0037] Figure 2 is a flowchart of a blockchain transaction data collection method provided by an embodiment of the present application;
[0038] Figure 3 is a schematic diagram of request tracking tree path compression provided by an embodiment of the present application;
[0039] Figure 4 is a blockchain transaction data device structure diagram provided by an embodiment of the present application;
[0040] Figure 5 is an electronic device architecture diagram provided by an embodiment of the present application. DETAILED DESCRIPTION
[0041] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments only constitute some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0042] As shown in Figure 1 , it shows a blockchain transaction data collection system provided by an embodiment of the present application. A crawler program sends a transaction data collection initial request to a blockchain. The initial request will pass through an engine and a downloader in turn. The downloader sends a request to a blockchain node according to the URL and information in the request, then waits for a response from the blockchain, and receives returned block transaction data to generate a transaction data item. Once the downloader receives the response, it will pass the response to the engine, and the engine sends the response to the crawler program for processing. After the crawler program processes the response, it returns the scraped transaction data item and a sub-request to the synchronization middleware. This process will be completed through the synchronization middleware.
[0043] The synchronization middleware stores the items generated by the crawler into a cache and tracks the dependencies between requests, and can also manage the state of the data collection process, such as tracking which requests have been processed and which requests are still waiting for responses. In order for the downstream processing unit to know whether the data has been completely acquired, the synchronization signal quantity is written into the synchronization middleware in the embodiment of the application, and the working object of the downstream processing unit is an item type object, and the synchronization middleware can only generate a synchronization data item when the synchronization signal quantity is 0, and the downstream processing unit can only receive the transaction data item transmitted by the synchronization middleware to work, so that the downstream processing unit can know the data collection situation according to the synchronization signal quantity.
[0044] Based on the above-mentioned system, the following embodiment of the application provides a blockchain transaction data collection method.
[0045] Referring to Figure 2 An embodiment of the application provides a blockchain transaction data collection method, which is executed at a synchronization middleware and includes the following steps:
[0046] Step S210. Receive a data collection sub-request and a transaction data item sent by a request server, the data collection sub-request is generated based on a data collection initial request sent by the request server to a blockchain node, and the transaction data item is generated based on the block transaction data returned by the blockchain node.
[0047] In this step, the request server generates a data collection initial request according to business requirements, and the request carries content such as a target blockchain node, a collection range, a priority, etc., and the server sends the collection request to the blockchain node to initiate data pulling, generates a new data collection sub-request after receiving the response of the blockchain, and generates a transaction data item based on the block transaction data returned by the blockchain, and synchronizes the new data collection sub-request information and the transaction data item to the synchronization middleware for constructing a tracking tree. After receiving the collection sub-request of the request server, the blockchain node returns transaction data or block information to the request server.
[0048] Step S220. Construct a request tracking tree, and calculate a synchronization signal quantity in the request tracking tree according to the completion of each data collection sub-request.
[0049] In this step, the synchronization middleware generates a corresponding request tracking tree according to each data collection sub-request sent by the request server, organizes the hierarchical relationship of the request using a tree structure, marks the state, progress and parent-child dependency relationship of each request, and updates the state of the tracking tree according to the data returned by the blockchain node. The synchronization signal quantity is written into the tracking tree in the embodiment of the application, and the synchronization signal quantity is calculated according to the completion of each data collection request.
[0050] Specifically, after receiving the data collection sub-request, the synchronization middleware constructs a root node according to the request range (such as the starting and ending height of the block), and if the sub-request generates multiple sub-tasks (such as batch acquisition of blocks), a sub-node is created for each sub-task. Each node on the request tracking tree represents a data collection request, and the direction of the node represents the dependency relationship of the data collection request. The synchronization semaphore is written at the root node, and in a further implementation, the number of uncompleted data collection requests is counted as the synchronization semaphore.
[0051] Step S230. Deliver the transaction data item to the downstream processing unit according to the synchronization semaphore.
[0052] In this step, the synchronization semaphore is an indicator representing the task state or data processing progress. When the synchronization middleware receives a new data collection task, the synchronization semaphore is incremented by one, and the initial value represents an uncompleted state. When the blockchain node returns data, the data is parsed and stored, and the synchronization semaphore is updated (such as reducing the uncompleted count). When all requests are executed and data is returned, the synchronization semaphore count is 0, at which time the synchronization middleware triggers the delivery of transaction data to the downstream processing unit.
[0053] In the embodiment of the application, the synchronization semaphore is written into the request tracking tree, and the value of the synchronization semaphore represents the number of uncompleted requests. When the synchronization semaphore is 0, it means that all child requests related to a parent request or grandparent request have been processed, which means that the synchronization data items related to these requests can be released and processed. Therefore, the order of the data in the block can be ensured, which is beneficial to the execution of the downstream processing unit. Only when the synchronization semaphore is 0, the synchronization middleware will package the transaction data and deliver it to the downstream processing unit. The downstream processing unit can understand the progress of the acquisition of transaction data through the synchronization semaphore.
[0054] In a further embodiment, the union-find set idea is introduced into the request tracking tree to perform path compression on the request tracking tree and accelerate the query speed of the synchronization semaphore. Specifically, the request tracking tree is path compressed according to the node type of each node on the request tracking tree.
[0055] In a further embodiment, the node type corresponding to the data collection request is generated according to the request address of the data collection request. Preferably, the request address of the data collection request is hashed to generate a request fingerprint, and the request fingerprint is used to represent the node type of the node.
[0056] In a specific example, the URL and other information of the request can be hashed to output a sequence of a certain byte length. When the node is used to represent a specific request, the node type is a byte type. The root node of the request tracking tree only writes the block-related information and the synchronization semaphore, and the root node is a non-byte type.
[0057] When the path is compressed, it is determined whether the node corresponding to a certain request has a grandparent node. If not, it is considered that the node corresponds to the first request entering the tracking tree, and the parent node of the node is the root node of the tracking tree, so that path compression is not needed at the node. If a node has a grandparent node, it is determined whether the grandparent node of the node is a request type or a root node. If the grandparent node of the node is a root node, path compression is not needed at the node. If the grandparent node of the node is a request type, the node is directly pointed to the grandparent node, and it can be understood that the original parent node of the node is deleted, and the grandparent node is the parent node of the node.
[0058] Based on the above path compression idea, when the root node is considered to have a height of 0, the maximum height of the request tracking tree can be controlled to be 2, the storage memory of the request tracking tree is effectively reduced, and the query speed of the synchronization semaphore is accelerated.
[0059] Exemplarily, Figure 3 The process of path compression of the request tracking tree according to the embodiment of the application is illustrated. As shown in Figure 3 Before path compression, the parent node of request 1 is the root node, the synchronization semaphore of the root node is written as 2, the parent nodes of requests 2 and 3 are request 1, and the parent nodes of requests 4 and 5 are request 3. After path compression of the request tracking tree, it is first determined whether each node has a grandparent node. Request 1 does not have a grandparent node, so that compression is not needed. The grandparent nodes of requests 2 and 3 are both the root node, so that compression is not needed. The grandparent nodes of requests 4 and 5 are the nodes corresponding to request 1, which belong to the byte type, so that the parent nodes of requests 4 and 5 are modified to the positions corresponding to the grandparent nodes, i.e., request 3 is deleted, and requests 4 and 5 are directly pointed to request 1. After calculation, when a new request is recorded in the request tracking tree, the request tracking tree updates the node dependency relationship according to the above path compression idea, and the time complexity is .
[0060] Since the embodiment of the application introduces the synchronization semaphore in the request tracking tree, when multiple blocks are processed in parallel for data request, the request-level parallel calling strategy is adopted, so that the waiting time of other request calling is reduced, and the execution process of the ETL tool is accelerated.
[0061] The above embodiments provide a blockchain transaction data collection method, a server initiates a data collection initial request to a blockchain, when the server receives a response returned by the blockchain, generates a transaction data item and a new data collection request and synchronizes to a synchronization middleware, the synchronization middleware builds a request tracking tree, calculates a synchronization semaphore in the request tracking tree according to the completion of each data collection sub-request, so that the downstream processing unit can know the acquisition progress of the transaction data through the synchronization semaphore, when the data in the block has been acquired, the transaction data can be processed or stored, and the response efficiency of the downstream processing unit is improved; further embodiments of the application also provide a scheme for path compression of the request tracking tree, which accelerates the query speed and reduces the storage memory of the request tracking tree.
[0062] The above-mentioned method can be implemented in various forms of equipment, and therefore the application also discloses a blockchain transaction data collection device corresponding to the above-mentioned method, and specific embodiments are given below for detailed description.
[0063] As shown in Figure 4 An embodiment of the application provides a blockchain transaction data collection device, which is arranged at a synchronization middleware and comprises:
[0064] The receiving module 402 is configured to receive the data collection request and the transaction data item sent by the request server, the data collection sub-request is generated based on the data collection initial request sent by the request server to the blockchain node, and the transaction data item is generated by the request server based on the block transaction data returned by the blockchain node;
[0065] The synchronization tracking module 404 is configured to build a request tracking tree and calculate a synchronization semaphore in the request tracking tree according to the completion of each data collection request;
[0066] The sending module 406 is configured to transmit the transaction data item to the downstream processing unit according to the synchronization semaphore.
[0067] The device provided by the embodiment of the application has the same implementation principle and technical effects as the above-mentioned method embodiments, and for brief description, the part not mentioned in the device embodiment can be referred to the corresponding content in the above-mentioned method embodiments.
[0068] The methods and related apparatuses mentioned in the above embodiments are described with reference to the method flowcharts and / or structural schematic diagrams provided by the embodiments of the present application. Each flow and / or block in the method flowchart and / or structural schematic diagram, and the combination of the flows and / or blocks in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices produce a device that implements the functions specified in the flowchart Figure 1 flow or multiple flows and / or structural schematic Figure 1 block or multiple blocks. These computer program instructions can also be stored in a computer readable memory that can cause the computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including instruction devices that implement the functions specified in the flowchart Figure 1 flow or multiple flows and / or structural schematic Figure 1 block or multiple blocks. These computer program instructions can also be loaded into a computer or other programmable data processing device, so that a series of operation steps are performed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide a process for implementing the functions specified in the flowchart Figure 1 flow or multiple flows and / or structural schematic
[0069] The following embodiments take the computer device to which the method is applied as an example for illustration. It can be understood that the computer device can be any device with operation and processing functions, which can be but is not limited to a server or a personal notebook computer, etc. In one of the embodiments, the computer device can be an application server, which can be a server for running an application to be tested.
[0070] Referring to Figure 5 , which shows a hardware structural block diagram of an electronic device, which is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown in the figures, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the present application described and / or claimed in this document.
[0071] As Figure 5As shown, the electronic device comprises at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4;
[0072] In the embodiments of the present application, the number of the processor 1, the communication interface 2, the memory 3 and the communication bus 4 is at least one, and the processor 1, the communication interface 2 and the memory 3 complete the communication with each other through the communication bus 4;
[0073] The processor 1 can be a central processing unit CPU, or an application specific integrated circuit ASIC, or one or more integrated circuits configured to implement the embodiments of the present application, etc.
[0074] The memory 3 can include a high-speed RAM memory, and can also include a non-volatile memory, etc., such as at least one disk memory.
[0075] The memory stores a program, and the processor can invoke the program stored in the memory, and the program is used to implement the various processing procedures of the blockchain transaction data collection scheme.
[0076] The embodiments of the present application also provide a readable storage medium having a computer program stored thereon, and the computer program is executed by the processor to implement the various processing procedures of the blockchain transaction data collection scheme provided by the above embodiments and / or any possible implementation manner combined with the embodiments.
[0077] The above embodiments have described the present application in detail with respect to possible situations, and those skilled in the art will recognize that the present application can be practiced by other embodiments. The specific naming of the components, the capitalization of terms, the attributes, the data structures or any other programming or structural aspects of the embodiments are not mandatory or important, and the mechanisms of the present application can have different names, forms or procedures, which implement the same or similar functions. The system can be implemented by a combination of hardware and software (as described), entirely by hardware elements, or entirely by software elements. The specific division of functions between various system components described herein is only exemplary and not mandatory; on the contrary, a single system component can perform the functions of multiple components, or multiple components can perform the functions of a single component.
[0078] Those skilled in the art will appreciate that the various steps of the methods disclosed above can be implemented by general computing devices, which can be centralized on a single computing device or distributed across a network of multiple computing devices, and optionally can be implemented by program code executable by a computing device, which can be stored in a storage device and executed by a computing device, or can be implemented by individual integrated circuit modules, or by multiple modules or steps implemented by a single integrated circuit module. Thus, the embodiments of the present application are not limited to any particular combination of hardware and software.
[0079] The computing device executable programs (also referred to as programs, software, software applications, or code) include machine instructions for a programmable processor, and can be implemented using high level procedural and / or object oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus and / or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal that can be used to provide machine instructions and / or data to a programmable processor.
[0080] Certain aspects of the present application include process steps and instructions described herein in the form of algorithms. It should be noted that the process steps and instructions of the present application can be implemented in software, firmware, and / or hardware, and when implemented in software, they can be downloaded from a variety of operating systems used on different platforms and operated therefrom.
[0081] Those skilled in the art can understand that the structures shown in the various figures are only block diagrams of the partial structures related to the schemes of the present application, and do not constitute a limitation on the terminal device to which the schemes of the present application are applied. The specific terminal device can include more or less components than those shown in the figures, or combine certain components, or have a different arrangement of components.
[0082] In the description of the specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "a possible design" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are contained in at least one embodiment or example of the application. In the description of the specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in any one or more embodiments or examples. In addition, those skilled in the art can combine and combine the different embodiments or examples described in the specification and the features of the different embodiments or examples without contradiction, and combine and combine them.
[0083] The above embodiments are only used to illustrate the technical solutions of the present application, but not limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can still be modified, or some technical features therein can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for collecting blockchain transaction data, characterized in that, The method is executed at the synchronization middleware and includes: The system receives a data collection sub-request and transaction data items from the request server. The data collection sub-request is generated from the initial data collection request sent by the request server to the blockchain node, and the transaction data items are generated by the request server based on the block transaction data returned by the blockchain node. Construct a request trace tree, and calculate a synchronization semaphore in the request trace tree based on the completion status of each data acquisition sub-request, specifically including: A request tracing tree is constructed based on the dependencies of each data collection sub-request. Each node in the request tracing tree represents a data collection sub-request, and the pointers of the nodes represent the dependencies of the data collection sub-requests. The number of incomplete data acquisition sub-requests is recorded as the synchronization semaphore, and the synchronization semaphore is written to the root node of the request tracking tree; When the synchronization semaphore is 0, the transaction data item is transmitted to the downstream processing unit.
2. The method according to claim 1, characterized in that, The method further includes: The request tracing tree is compressed based on the node type of each node in the request tracing tree.
3. The method according to claim 2, characterized in that, Path compression of the request tracking tree includes: Determine if a node has a grandparent node. If it does, determine the node type of the grandparent node; otherwise, do not perform path compression at that node. When the node's grandparent node is of type request, make the node point directly to its grandparent node.
4. The method according to claim 3, characterized in that, The node types for determining the grandparent node of the node include: Determine whether a node has a request fingerprint. The request fingerprint is generated based on the request content of the data collection sub-request. The node type with a request fingerprint is determined as the request type.
5. A blockchain transaction data acquisition device, characterized in that, The device is located at the synchronization middleware and includes: The receiving module is used to receive data collection sub-requests and transaction data items sent by the request server. The data collection sub-requests are generated from the initial data collection request sent by the request server to the blockchain node, and the transaction data items are generated by the request server based on the block transaction data returned by the blockchain node. The synchronization tracking module is used to construct a request tracking tree. Within this tree, synchronization semaphores are calculated based on the completion status of each data acquisition sub-request. Specifically, this includes: A request tracing tree is constructed based on the dependencies of each data collection sub-request. Each node in the request tracing tree represents a data collection sub-request, and the pointers of the nodes represent the dependencies of the data collection sub-requests. The number of incomplete data acquisition sub-requests is recorded as the synchronization semaphore, and the synchronization semaphore is written to the root node of the request tracking tree; The sending module is used to transmit the transaction data items to the downstream processing unit when the synchronization semaphore is 0.
6. A blockchain transaction data acquisition system, characterized in that, This includes the request server, synchronization middleware, and downstream processing units; The request server is used to send an initial data collection request and a sub-data collection request to the blockchain, and to synchronize the sub-data collection request and transaction data items to the synchronization middleware. The sub-data collection request is generated from the initial data collection request sent by the request server to the blockchain node, and the transaction data items are generated by the request server based on the block transaction data returned by the blockchain node. The synchronization middleware is used to collect the transaction data items; The downstream processing unit is used to receive and process the transaction data items transmitted by the synchronization middleware. When the synchronization middleware collects the transaction data items, it specifically executes the blockchain transaction data collection method as described in any one of claims 1 to 4.
7. An electronic device, characterized in that, It includes a memory storing computer-executable instructions and a processor, which, when executed by the processor, causes the device to perform the blockchain transaction data acquisition method as described in any one of claims 1 to 4.
8. A readable storage medium, characterized in that, It stores a computer-executable program, which, when executed, enables the blockchain transaction data acquisition method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Data synchronization method based on blockchain application system, middleware and system based on blockchain application system
CN107657059A
Transaction data synchronization method and device based on block chain, equipment and medium
CN109857807A