Block chain transaction data acquisition method and device, electronic equipment and storage medium

By building a request tracking tree in the synchronization middleware and calculating the synchronous semaphore, the problem of lack of synchronous signals in the blockchain transaction data acquisition tool is solved, and the rapid response and efficient data processing of downstream processing units are realized.

CN119646282AActive Publication Date: 2025-03-18SUN YAT SEN UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411820178.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-03-18
Estimated Expiration
2044-12-11

AI Technical Summary

Technical Problem

The existing blockchain transaction data acquisition tools lack synchronization signals, which makes it difficult for downstream processing units to understand the data acquisition situation, thereby slowing down the task process.

Method used

The request tracking tree is built in the synchronization middleware, and the data acquisition situation is determined by calculating the synchronous semaphore, and the transaction data items are transmitted to the downstream processing unit according to the semaphore.

Benefits of technology

It realizes that the downstream processing unit can quickly understand the transaction data acquisition progress, improve response efficiency, and reduce time loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119646282A_ABST
    Figure CN119646282A_ABST
Patent Text Reader

Abstract

The invention discloses a block chain transaction data acquisition method, which comprises the following steps that: a server initiates a data acquisition initial request to a block chain, when the server receives a response returned by the block chain, the server generates a transaction data item and a new data acquisition request and synchronizes the transaction data item and the new data acquisition request to synchronous middleware, and the synchronous middleware constructs a request tracking tree; the synchronization semaphore is calculated in the request tracking tree according to the completion condition of each data acquisition sub-request, so that the downstream processing unit can know the acquisition progress of the transaction data through the synchronization semaphore, the transaction data can be processed or stored after all the data in the block are acquired, and the response efficiency of the downstream processing unit is improved; according to the further embodiment, the invention further provides a scheme for performing path compression on the request tracking tree, the query speed is increased, and the storage memory of the request tracking tree is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to data collection technology, and in particular to a blockchain transaction data collection method, device, electronic device and storage medium. Background Art

[0002] Blockchain is a distributed database technology that integrates peer-to-peer transmission, consensus mechanism and encryption algorithm, 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 has exceeded 10 billion, and people are paying 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 the RPC interface. Users interact with the on-chain data through the RPC interface of the relevant blockchain until the transaction data is collected to the destination. Currently, most blockchain transaction data collection tools do not have synchronization signals, and it is difficult for downstream processing units to understand whether the data of a block has been fully acquired, resulting in an inability to respond quickly, thereby slowing down the progress of related tasks. In addition, most of the current ETL tools use the method of calling the JSON-RPC interface in parallel at the processing level, which adds additional waiting time.

[0004] To this end, there is an urgent need for blockchain transaction data collection tools with synchronization signals to help downstream processing units execute quickly and reduce time loss. Summary of the invention

[0005] In view of this, the present invention aims to propose a blockchain transaction data collection method, device, electronic device and storage medium, by constructing a request tracking tree in the synchronization middleware, so that the downstream processing unit determines the data collection status according to the synchronization signal.

[0006] In a first aspect, the present invention provides a blockchain transaction data collection method, which is executed at a synchronization middleware, comprising:

[0007] Receive a data collection sub-request and a transaction data item sent by a request server, where the data collection sub-request is generated by an initial data collection request sent by the request server to a blockchain node, and the transaction data item is generated by the request server according to the block transaction data returned by the blockchain node;

[0008] Construct a request tracking tree, and calculate the synchronization semaphore according to the completion status of each data collection request in the request tracking tree;

[0009] The transaction data items are passed to the downstream processing unit according to the synchronization semaphore.

[0010] Furthermore, a request tracking tree is constructed, and the synchronization signal quantity is calculated according to the completion status of each data collection request in the request tracking tree, including:

[0011] A request tracking tree is constructed according to the dependency relationship of each data collection request. 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.

[0012] The number of unfinished data collection requests is counted and recorded as a synchronization semaphore, and the synchronization semaphore is written into the root node of the request tracking tree.

[0013] Further, delivering the transaction data item to the downstream processing unit according to the synchronization semaphore includes:

[0014] When the synchronization semaphore is 0, the transaction data item is passed to the downstream processing unit.

[0015] Furthermore, the above method also includes:

[0016] The request tracking tree is path compressed according to the node type of each node on the request tracking tree.

[0017] Furthermore, path compression of the request tracking tree includes:

[0018] Determine whether the node has a grandparent node. If so, determine the node type of the grandparent node. Otherwise, do not perform path compression at the node.

[0019] When the node type of the node's grandparent node is the requested type, let the node point directly to its grandparent node.

[0020] Furthermore, determining the node type of the grandparent node of the node includes:

[0021] Determine whether the node has a request fingerprint, the request fingerprint is generated according to the request content of the data collection sub-request, and determine the node type with the request fingerprint as the request type.

[0022] In a second aspect, the present invention provides a blockchain transaction data collection device, which is arranged at a synchronization middleware, and includes:

[0023] A receiving module, used to receive a data collection sub-request and a transaction data item sent by a request server, wherein the data collection sub-request is generated by a data collection initial request sent by the request server to a blockchain node, and the transaction data item is generated by the request server according to the block transaction data returned by the blockchain node;

[0024] The synchronization tracking module is used to construct a request tracking tree, in which the synchronization semaphore is calculated according to the completion status of each data collection request;

[0025] The sending module is used to transmit the transaction data items to the downstream processing unit according to the synchronization signal.

[0026] In a third aspect, the present invention provides a blockchain transaction data collection system, including a request server, a synchronization middleware, and a downstream processing unit;

[0027] The request server is used to send a data collection initial request and a data collection sub-request to the blockchain, and synchronize the data collection sub-request and the transaction data item to the synchronization middleware. The data collection sub-request is generated by 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 according to the block transaction data returned by the blockchain node;

[0028] The synchronization middleware is used to collect transaction data items;

[0029] The downstream processing unit is used to receive and process the transaction data items transmitted by the synchronization middleware;

[0030] Among them, when the synchronization middleware collects transaction data items, it specifically executes the blockchain transaction data collection method provided in the first aspect.

[0031] In a fourth aspect, the present invention provides an electronic device comprising a memory storing computer-executable instructions and a processor, wherein when the computer-executable instructions are executed by the processor, the device executes each step of the blockchain transaction data collection method provided in the first aspect.

[0032] In a fifth aspect, the present invention provides a readable storage medium storing a computer executable program, which, when executed, can implement the various steps of the blockchain transaction data collection method provided in the first aspect.

[0033] It can be seen from the above technical solutions that the present invention has the following beneficial effects:

[0034] The present invention provides a blockchain transaction data collection method, in which a server initiates an initial data collection request to the blockchain. 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. The synchronization middleware constructs a request tracking tree, and in the request tracking tree, a synchronization semaphore is calculated according to the completion status of each data collection sub-request, so that a downstream processing unit can understand the acquisition progress of transaction data through the synchronization semaphore. When all the data in the block has been acquired, the transaction data can be processed or stored, thereby improving the response efficiency of the downstream processing unit. In a further embodiment, the present invention also provides a solution for path compression of the request tracking tree, which speeds up the query speed and reduces the storage memory of the request tracking tree. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0036] Figure 1 It is a blockchain transaction data collection system architecture provided by an embodiment of the present invention;

[0037] Figure 2 This is a flowchart of a blockchain transaction data collection method provided by an embodiment of the present invention;

[0038] Figure 3 It is a schematic diagram of request tracking tree path compression provided by an embodiment of the present invention;

[0039] Figure 4 This is a structural diagram of a blockchain transaction data device provided by an embodiment of the present invention;

[0040] Figure 5 This is a diagram of the electronic device architecture provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0042] like Figure 1 As shown, it shows a blockchain transaction data collection system provided by an embodiment of the present invention. The crawler program sends an initial request for transaction data collection to the blockchain, and the initial request will pass through the engine and the downloader in sequence. The downloader sends a request to the blockchain node according to the URL and information in the request, and then waits for the blockchain response, and receives the 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 will send the response to the crawler program for processing. After the crawler program processes the response, it returns the captured transaction data item and sub-request to the synchronous middleware, and this process will be completed through the synchronous middleware.

[0043] The synchronization middleware stores the items generated by the crawler program in the cache and tracks the dependencies between requests. In addition, the synchronization middleware can also manage the status of the data collection process, such as tracking which requests have been processed and which requests are still waiting for responses. In order to allow the downstream processing unit to know whether the data is completely acquired, the embodiment of the present invention writes a synchronization semaphore into the synchronization middleware. The working object of the downstream processing unit is the project type object. Only when the synchronization semaphore is 0 can the synchronization middleware generate a synchronization data item, and the downstream processing unit can receive the transaction data item transmitted by the synchronization middleware to work, thereby enabling the downstream processing unit to know the data collection situation according to the synchronization semaphore.

[0044] Based on the above-proposed system, the following embodiments of the present invention provide a method for collecting blockchain transaction data.

[0045] See also Figure 2 An embodiment of the present invention 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 issued by the request server. The data collection sub-request is generated by the data collection initial request sent by the request server to the blockchain node. The transaction data item is generated by the request server based on the block transaction data returned by the blockchain node.

[0047] In this step, the request server will generate a data collection initial request according to business needs. The request carries content such as the target blockchain node, collection scope, priority, etc. The server will send the collection request directly to the blockchain node to initiate data pull, generate a new data collection sub-request after receiving the blockchain response, and generate a transaction data item based on the block transaction data returned by the blockchain, and synchronize the new data collection sub-request information and transaction data items to the synchronization middleware for building a tracking tree. After receiving the collection sub-request from the request server, the blockchain node returns the transaction data or block information to the request server.

[0048] Step S220: construct a request tracking tree, and calculate the synchronization signal quantity according to the completion status of each data collection sub-request in the request tracking tree.

[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 status, progress and parent-child dependency of each request, and updates the tracking tree status according to the data returned by the blockchain node. The embodiment of the present invention writes a synchronization semaphore in the tracking tree, and the synchronization semaphore is calculated according to the completion status 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 start and end heights of the block). If the sub-request is generated into multiple sub-tasks (such as obtaining blocks in batches), a sub-node is created for each sub-task. Each node on the request tracking tree represents a data collection request, and the node pointing represents the dependency of the data collection request. A synchronization semaphore is written at the root node. In a further implementation method, the number of unfinished data collection requests is counted and recorded as the synchronization semaphore.

[0051] Step S230: Deliver the transaction data item to the downstream processing unit according to the synchronization signal.

[0052] In this step, the synchronization semaphore is an indicator of the task status or data processing progress. When the synchronization middleware receives a new data collection task, the synchronization semaphore increases by one, and the initial value indicates an unfinished state. When the blockchain node returns the data, it parses and stores the data, and updates the synchronization semaphore (such as reducing the unfinished count). When all requests are executed and the data is returned, the synchronization semaphore count is 0, which triggers the synchronization middleware to pass the transaction data to the downstream processing unit.

[0053] The embodiment of the present invention writes the synchronization semaphore into the request tracking tree, and the value of the synchronization semaphore represents the number of unfinished requests. When the synchronization semaphore is 0, it means that all child requests related to a parent request or a grandparent request have been processed, which means that the synchronization data items related to these requests can be released and processed, so the data order in the block can be ensured to remain unchanged, which is beneficial to the execution of the downstream processing unit. Only when the synchronization semaphore is 0 will the synchronization middleware package the transaction data and transmit it to the downstream processing unit, so the downstream processing unit can understand the progress of obtaining the transaction data through the synchronization semaphore.

[0054] In a further embodiment, a union-find concept is introduced into the request tracking tree, and the request tracking tree is path compressed to speed up 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, a corresponding node type is generated according to a request address of a data collection request, and preferably a hash calculation is performed on the request address of the data collection request to generate a request fingerprint, and the request fingerprint is used to represent the node type of the node.

[0056] In a specific example, a hash calculation can be performed on the requested URL and other information to output a sequence of a certain byte length. When a node is used to represent a specific request, its node type is a byte type. The root node of the request tracking tree only writes block-related information and synchronization semaphores, so the root node is a non-byte type.

[0057] When compressing the path, first determine whether there is a grandparent node for the node corresponding to a request. If not, it can be considered that the node corresponds to the first request entering the tracking tree, and its parent node is the root node of the tracking tree. At this time, there is no need to perform path compression at this node; if a node has a grandparent node, determine whether the grandparent node of the node is a request type or a root node. If its grandparent node is a root node, there is no need to perform mechanical energy path compression at this node. If its grandparent node is a request type, point the node directly to its grandparent node, which can be understood as deleting the original parent node of the node, and its grandparent node is the parent node of the node.

[0058] Based on the above path compression idea, when the root node height is considered to be 0, the maximum height of the request tracking tree can be controlled to 2, which effectively reduces the storage memory of the request tracking tree and speeds up the query speed of the synchronization semaphore.

[0059] For example, Figure 3 The process of request tracking tree path compression according to the embodiment of the present invention is illustrated. Figure 3 As shown in the figure, before path compression, the parent node of request 1 is the root node, where the synchronization semaphore 2 is written at the root node. The parent node of requests 2 and 3 is request 1, and the parent node of requests 4 and 5 is request 3. To perform path compression on the request tracking tree, first determine whether each node has a grandparent node. Request 1 does not have a grandparent node, so there is no need to compress it. The grandparent nodes of requests 2 and 3 are both root nodes, and they also do not need to be compressed. The grandparent nodes of requests 4 and 5 are the nodes corresponding to request 1, which are of byte type. Then, the parent nodes of requests 4 and 5 can be modified to the positions corresponding to their grandparent nodes, that is, request 3 is deleted, and requests 4 and 5 are directly pointed to request 1. After calculation, whenever a new request is recorded in the request tracking tree, the request tracking tree will update the node dependency according to the above path compression idea, and the time complexity is .

[0060] Since the embodiment of the present invention introduces a synchronization semaphore in the request tracking tree, when processing parallel data requests for multiple blocks, a request-level parallel calling strategy is adopted, which can reduce the waiting time of other request calls and speed up the execution process of the ETL tool.

[0061] The above embodiments provide a blockchain transaction data collection method, in which the server initiates an initial data collection request to the blockchain. When the server receives a response returned by the blockchain, it generates a transaction data item and a new data collection request and synchronizes them to the synchronization middleware. The synchronization middleware constructs a request tracking tree, and calculates the synchronization semaphore in the request tracking tree according to the completion status of each data collection sub-request so that the downstream processing unit can understand the progress of transaction data acquisition through the synchronization semaphore. When all the data in the block has been acquired, the transaction data can be processed or stored, thereby improving the response efficiency of the downstream processing unit. A further embodiment of the present invention also provides a solution for path compression of the request tracking tree, which speeds up the query speed and reduces the storage memory of the request tracking tree.

[0062] The above-mentioned disclosed method can be implemented by using various forms of equipment, so the present invention also discloses a blockchain transaction data collection device corresponding to the above-mentioned method, and a specific embodiment is given below for detailed description.

[0063] like Figure 4 As shown, an embodiment of the present invention provides a blockchain transaction data collection device, which is arranged at a synchronization middleware, and includes:

[0064] A receiving module 402 is used to receive a data collection request and a transaction data item sent by a request server, wherein the data collection sub-request is generated by 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 according to the block transaction data returned by the blockchain node;

[0065] A synchronization tracking module 404 is used to construct a request tracking tree, and calculate the synchronization signal quantity according to the completion status of each data collection request in the request tracking tree;

[0066] The sending module 406 is used to transmit the transaction data item to the downstream processing unit according to the synchronization signal.

[0067] The implementation principle and technical effects of the device provided in the embodiments of the present application are the same as those of the aforementioned method embodiments. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiments.

[0068] The methods and related devices mentioned in the above embodiments are described with reference to the method flow charts and / or structural diagrams provided in the embodiments of the present application. Specifically, each process and / or block in the method flow charts and / or structural diagrams, as well as the combination of processes and / or blocks in the flow charts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the process. Figure 1 A process or multiple processes and / or structures Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or structures Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed 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 for implementing the process in the process. Figure 1 A flow or multiple flows and / or structures illustrate the steps of the functions specified in one block or multiple blocks.

[0069] The following embodiments are described by taking the method applied to a computer device as an example. It can be understood that the computer device can be any device with computing and processing functions, and can be but not limited to a server or a personal laptop computer, etc. In one embodiment, the computer device can be an application server, and the application server can be a server for running an application to be tested.

[0070] See also Figure 5 , which shows a hardware block diagram of an electronic device, the electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.

[0071] like Figure 5As shown, the electronic device includes: 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 embodiment 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 communicate with each other through the communication bus 4;

[0073] The processor 1 may be a central processing unit CPU, or an application-specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention, etc.;

[0074] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), etc., such as at least one disk memory;

[0075] Among them, the memory stores a program, and the processor can call the program stored in the memory, and the program is used to: implement each processing flow of the aforementioned blockchain transaction data collection solution.

[0076] An embodiment of the present invention also provides a readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the various processing flows of the blockchain transaction data collection solution provided in the above embodiment and / or any possible implementation method in combination with the embodiment are implemented.

[0077] The above-mentioned embodiments have described the present invention in particular detail with respect to possible scenarios, and those skilled in the art will recognize that the present invention can be practiced through other embodiments. The specific naming of components, the capitalization of terms, attributes, data structures, or any other programming or structural aspects are not mandatory or important, and the mechanisms or features of the present invention may have different names, forms, or procedures. The system may 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 the various system components described herein is exemplary only and not mandatory; on the contrary, the functions performed by a single system component may be performed by multiple components, or the functions performed by multiple components may be performed by a single component.

[0078] Those skilled in the art should understand that the various steps of the above disclosed method can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented with program codes executable by the computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the embodiments of the present invention are not limited to any specific combination of hardware and software.

[0079] These computing device executable programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors, and these computing programs 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, device, and / or device (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing 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 for providing machine instructions and / or data to a programmable processor.

[0080] Certain aspects of the present invention 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 invention can be implemented in software, firmware and / or hardware, and when implemented by software, it can be downloaded, stored on different platforms used by various operating systems and operated from the platforms.

[0081] Those skilled in the art will understand that the structures shown in the accompanying drawings are merely block diagrams of partial structures related to the scheme of the present application, and do not constitute a limitation on the terminal device to which the scheme of the present application is applied. The specific terminal device may include more or fewer components than those shown in the figures, or combine certain components, or have a different arrangement of components.

[0082] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "possible design" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0083] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A blockchain transaction data collection method, characterized in that: The method is executed at a synchronization middleware, and includes: Receive a data collection sub-request and a transaction data item sent by a request server, wherein the data collection sub-request is generated from a data collection initial request sent by the request server to a blockchain node, and the transaction data item is generated by the request server according to block transaction data returned by the blockchain node; Constructing a request tracking tree, and calculating a synchronization semaphore in the request tracking tree according to the completion status of each of the data collection sub-requests; The transaction data item is delivered to a downstream processing unit according to the synchronization semaphore.

2. The method according to claim 1, characterized in that The step of constructing a request tracking tree and calculating a synchronization signal quantity according to the completion status of each data collection sub-request in the request tracking tree comprises: A request tracking tree is constructed according to the dependency relationship of each data collection sub-request, each node on the request tracking tree represents a data collection sub-request, and the direction of the node represents the dependency relationship of the data collection sub-request; The number of unfinished data collection sub-requests is counted and recorded as the synchronization semaphore, and the synchronization semaphore is written into the root node of the request tracking tree.

3. The method according to claim 1, characterized in that The transmitting the transaction data item to the downstream processing unit according to the synchronization signal comprises: When the synchronization semaphore is 0, the transaction data item is passed to the downstream processing unit.

4. The method according to claim 1, characterized in that: The method further comprises: The request tracking tree is path compressed according to the node type of each node on the request tracking tree.

5. The method according to claim 4, characterized in that Performing path compression on the request tracking tree includes: Determine whether the node has a grandparent node, and if so, determine the node type of the grandparent node of the node, otherwise, do not perform path compression at the node; When the node type of the grandparent node of the node is the requested type, the node is made to point directly to its grandparent node.

6. The method according to claim 5, characterized in that The step of determining the node type of the grandparent node of the node includes: It is determined whether the node has a request fingerprint, the request fingerprint is generated according to the request content of the data collection sub-request, and the node type having the request fingerprint is determined to be the request type.

7. A blockchain transaction data collection device, characterized in that: The device is arranged at a synchronization middleware, and includes: A receiving module, used to receive a data collection sub-request and a transaction data item sent by a request server, wherein the data collection sub-request is generated from a data collection initial request sent by the request server to a blockchain node, and the transaction data item is generated by the request server according to the block transaction data returned by the blockchain node; The synchronization tracking module is used to construct a request tracking tree and calculate the synchronization semaphore according to the completion status of each data collection sub-request in the request tracking tree; The sending module is used to transmit the transaction data items to the downstream processing unit according to the synchronization signal.

8. A blockchain transaction data collection system, characterized in that: It includes a request server, a synchronization middleware, and a downstream processing unit; The request server is used to send a data collection initial request and a data collection sub-request to the blockchain, and synchronize the data collection sub-request and the transaction data item to the synchronization middleware, the data collection sub-request is generated from 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 according to 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; Among them, 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 6.

9. An electronic device, characterized in that: The device comprises a memory storing computer executable instructions and a processor, and when the computer executable instructions are executed by the processor, the device executes the blockchain transaction data collection method as described in any one of claims 1 to 6.

10. A readable storage medium, characterized in that: A computer executable program is stored, and when the program is executed, the blockchain transaction data collection method as described in any one of claims 1 to 6 can be implemented.

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

  • Method and apparatus for processing privacy data of block chain, device, storage medium and coputer program product

    EP3916604A1

  • Methods and apparatuses for synchronizing data based on blockchain integrated station

    US20210344753A1