A blockchain-based data processing method and device, and a storage medium

By employing parallel thread processing in the RAFT consensus algorithm, the problem of time-consuming data consistency processing in blockchain is solved, and efficient data consistency operation is achieved.

CN116644128BActive Publication Date: 2026-05-12TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2022-02-15
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

The existing RAFT consensus algorithm is time-consuming in the data consistency process in blockchain, which affects efficiency, especially when data is packaged and broadcast one by one.

Method used

The system employs a parallel thread processing approach. After the first thread on the master node completes the data packaging, the second thread is called to package the data in parallel. The execution status is determined based on the response information from the participating nodes, and then data consistency operations are performed.

Benefits of technology

It achieves high efficiency in the data consistency processing process, saving data packaging time and improving data processing efficiency by parallelizing the serial processing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116644128B_ABST
    Figure CN116644128B_ABST
Patent Text Reader

Abstract

The application discloses a kind of data processing method, device and storage medium based on blockchain, which can be applied to the field of map.By responding to the packing completion of first data in the main node in the first thread, the second thread is called to pack the second data;Then determine the execution state information corresponding to the first data in the first thread when the second data is packed;Further, the target operation is determined according to the execution state information, so that the packed second data is broadcasted to the participating node in the first thread based on the target operation to perform data consistency operation.Therefore, an efficient data processing process is realized, since parallel threads are used for data packing processing, the serial processing process in the algorithm consensus phase of blockchain is parallelized, the data packing time is saved, and the efficiency of data consistency processing is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a data processing method, apparatus and storage medium based on blockchain. Background Technology

[0002] With the rapid development of internet technology, people have increasingly higher requirements for data consistency. RAFT consensus algorithm is a commonly used consensus algorithm in distributed databases; it supports failures of up to half of the nodes, but it does not support malicious node behavior. Consortium blockchains, on the other hand, are a very common branch of blockchain technology in the industry, aiming to provide distributed ledger services in a relatively secure environment.

[0003] Generally, the master node can select transaction data from the transaction pool one by one, package it into a block, and then broadcast the block to other nodes to perform data consistency operations.

[0004] However, data consistency requires a large amount of data processing, and packaging and broadcasting data one by one takes a lot of time, which affects the efficiency of data consistency processing in the blockchain. Summary of the Invention

[0005] In view of this, this application provides a data processing method based on blockchain, which can effectively improve the efficiency of data consistency processing in blockchain.

[0006] The first aspect of this application provides a blockchain-based data processing method, which can be applied to a system or program in a terminal device that includes blockchain-based data processing functionality, specifically including:

[0007] In response to the completion of the packaging of the first data in the master node by the first thread, the second data is packaged by the second thread. The packaged first data is then broadcast to the participating nodes for data consistency operations.

[0008] When the second data packaging is completed, the execution status information corresponding to the first data in the first thread is determined, and the execution status information is determined based on the execution status of the response information fed back by the participating node in the master node;

[0009] Based on the execution status information, a target operation is determined, and based on the target operation, the packaged second data is broadcast to the participating nodes in the first thread to perform the data consistency operation.

[0010] Optionally, in some possible implementations of this application, the step of determining the target operation based on the execution status information, and broadcasting the packaged second data to the participating nodes in the first thread based on the target operation to perform the data consistency operation, includes:

[0011] Determine the execution status information corresponding to the execution status in the first thread;

[0012] If the execution status indicates that the response information corresponding to the first data has completed the execution operation in the first thread, then the communication data corresponding to the target operation is determined to be the packaged second data;

[0013] The packaged second data is broadcast to the participating nodes to perform the data consistency operation.

[0014] Optionally, in some possible implementations of this application, the method further includes:

[0015] If the execution status indicates that the response information corresponding to the first data has not completed the execution operation in the first thread, then the confirmation message and the packaged second data are packaged together to obtain merged data;

[0016] The communication data corresponding to the target operation is determined to be the merged data;

[0017] The merged data is broadcast to the participating nodes, so that the participating nodes can perform a confirmation operation corresponding to the first data based on the confirmation message, and perform the data consistency operation based on the packaged second data.

[0018] Optionally, in some possible implementations of this application, the method further includes:

[0019] Get the preset packaging interval;

[0020] Based on the preset packaging interval, after the second data is packaged by the second thread, the third data is packaged by the third thread.

[0021] The packaged third data is broadcast to the first processing stream of the participating node to perform a write-ahead log operation. After performing the write-ahead log operation, the participating node sends the response information corresponding to the third data back to the first processing stream of the master node. The first processing stream of the master node corresponds to the first thread.

[0022] After the first processing stream of the master node completes the task of collecting the response information corresponding to the third data, it sends an acknowledgment message to the second processing stream of the participating node, so that the participating node performs the data consistency operation in the second processing stream of the participating node.

[0023] Optionally, in some possible implementations of this application, broadcasting the packaged third data to the first processing stream of the participating node to perform a write-ahead log operation includes:

[0024] When the third data is packaged, the execution status information corresponding to the second data in the first thread is determined. The execution status information is determined based on the execution status of the response information fed back by the participating nodes in the master node.

[0025] The target operation is determined based on the execution status information, and the packaged third data is broadcast to the first processing stream of the participating node in the first thread based on the target operation to perform the write-ahead log operation.

[0026] Optionally, in some possible implementations of this application, obtaining the preset packaging interval includes:

[0027] Obtain the data volume information corresponding to the data consistency operation;

[0028] Configure the preset packaging interval based on the data volume information;

[0029] Obtain the configured preset packaging interval.

[0030] Optionally, in some possible implementations of this application, the method is applied to a blockchain device, which is a node in a blockchain.

[0031] A second aspect of this application provides a blockchain-based data processing device, comprising:

[0032] The packaging unit is used to respond to the completion of packaging of the first data in the master node by the first thread, and then to package the second data by the second thread. The packaged first data is then broadcast to the participating nodes for data consistency operations.

[0033] The determining unit is used to determine the execution status information corresponding to the first data in the first thread when the second data packaging is completed. The execution status information is determined based on the execution status of the response information fed back by the participating nodes in the master node.

[0034] The processing unit is configured to determine the target operation based on the execution status information, and broadcast the packaged second data to the participating nodes in the first thread based on the target operation to perform the data consistency operation.

[0035] Optionally, in some possible implementations of this application, the processing unit is specifically used to determine the execution state corresponding to the execution state information in the first thread;

[0036] The processing unit is specifically configured to determine that the communication data corresponding to the target operation is the packaged second data if the execution status indicates that the response information corresponding to the first data has completed the execution operation in the first thread;

[0037] The processing unit is specifically used to broadcast the packaged second data to the participating nodes to perform the data consistency operation.

[0038] Optionally, in some possible implementations of this application, the processing unit is specifically used to package the confirmation message and the packaged second data together to obtain merged data if the execution status indicates that the response information corresponding to the first data has not completed the execution operation in the first thread.

[0039] The processing unit is specifically used to determine that the communication data corresponding to the target operation is the merged data;

[0040] The processing unit is specifically used to broadcast the merged data to the participating nodes, so that the participating nodes can perform a confirmation operation corresponding to the first data according to the confirmation message, and perform the data consistency operation according to the packaged second data.

[0041] Optionally, in some possible implementations of this application, the processing unit is specifically used to obtain a preset packaging interval;

[0042] The processing unit is specifically used to package the third data through the third thread after packaging the second data through the second thread based on the preset packaging interval;

[0043] The processing unit is specifically used to broadcast the packaged third data to the first processing stream of the participating node to perform a write-ahead log operation. After performing the write-ahead log operation, the participating node feeds back the response information corresponding to the third data to the first processing stream of the master node. The first processing stream of the master node corresponds to the first thread.

[0044] The processing unit is specifically configured to send confirmation information to the second processing stream of the participating node after the first processing stream of the master node has completed the task of collecting the response information corresponding to the third data, so that the participating node performs the data consistency operation in the second processing stream of the participating node.

[0045] Optionally, in some possible implementations of this application, the processing unit is specifically used to determine the execution status information corresponding to the second data in the first thread when the third data packaging is completed, and the execution status information is determined based on the execution status of the response information fed back by the participating node in the master node;

[0046] The processing unit is specifically used to determine the target operation based on the execution status information, and broadcast the packaged third data to the first processing stream of the participating node in the first thread based on the target operation, so as to perform the write-ahead log operation.

[0047] Optionally, in some possible implementations of this application, the processing unit is specifically used to obtain the data volume information corresponding to the data consistency operation;

[0048] The processing unit is specifically used to configure the preset packaging interval based on the data volume information;

[0049] The processing unit is specifically used to obtain the configured preset packaging interval.

[0050] A third aspect of this application provides a computer device, comprising: a memory, a processor, and a bus system; the memory is used to store program code; the processor is used to execute the blockchain-based data processing method described in the first aspect or any one of the first aspects according to the instructions in the program code.

[0051] The fourth aspect of this application provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the blockchain-based data processing method described in the first aspect or any one of the first aspects.

[0052] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the blockchain-based data processing method provided in the first aspect or various optional implementations thereof.

[0053] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:

[0054] In response to the completion of the packaging of the first data in the master node by the first thread, the second thread is invoked to package the second data. This packaged first data is then broadcast to participating nodes for data consistency operations. Next, the execution status information corresponding to the first data in the first thread is determined when the second data packaging is complete. This execution status information is determined based on the execution status of the responses from participating nodes in the master node. Furthermore, the target operation is determined based on the execution status information, and the packaged second data is broadcast to participating nodes by the first thread for data consistency operations based on the target operation. This achieves an efficient data consistency processing process. By using parallel threads for data packaging, the serial processing in the blockchain's algorithm consensus phase is parallelized, saving data packaging time and thus improving data processing efficiency. Attached Figure Description

[0055] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0056] Figure 1 A network architecture diagram for a blockchain-based data processing system.

[0057] Figure 2 A flowchart illustrating a blockchain-based data processing architecture is provided for embodiments of this application.

[0058] Figure 3 A flowchart illustrating a blockchain-based data processing method provided in this application embodiment;

[0059] Figure 4 A schematic diagram illustrating a blockchain-based data processing method provided in an embodiment of this application;

[0060] Figure 5 A schematic diagram illustrating another blockchain-based data processing method provided in this application embodiment;

[0061] Figure 6 A schematic diagram illustrating another blockchain-based data processing method provided in this application embodiment;

[0062] Figure 7 A schematic diagram illustrating another blockchain-based data processing method provided in this application embodiment;

[0063] Figure 8 A schematic diagram illustrating another blockchain-based data processing method provided in this application embodiment;

[0064] Figure 9 A schematic diagram of the structure of a blockchain-based data processing device provided in this application embodiment;

[0065] Figure 10 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application;

[0066] Figure 11 This application provides a schematic diagram of the structure of a server according to an embodiment of the present application.

[0067] Figure 12A A data sharing system provided in this application embodiment;

[0068] Figure 12B This application provides an embodiment of a blockchain block composition;

[0069] Figure 12C This application provides input information for a blockchain node in an embodiment. Detailed Implementation

[0070] This application provides a blockchain-based data processing method and related apparatus, which can be applied to systems or programs in terminal devices that include blockchain-based data processing functions. In response to the completion of packaging of first data in the master node by a first thread, a second thread is invoked to package second data. The packaged first data is then broadcast to participating nodes for data consistency operations. Next, the execution status information corresponding to the first data in the first thread is determined when the second data packaging is completed. This execution status information is determined based on the execution status of the response information fed back by participating nodes in the master node. Furthermore, a target operation is determined based on the execution status information, and the packaged second data is broadcast to participating nodes by the first thread based on the target operation for data consistency operations. This achieves an efficient data consistency processing process. By using parallel threads for data packaging, the serial processing in the blockchain's algorithm consensus phase is parallelized, saving data packaging time and thus improving data processing efficiency.

[0071] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “corresponding to,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0072] First, some terms that may appear in the embodiments of this application will be explained.

[0073] Write-ahead logging (WAL) is a set of techniques used in relational database systems to provide atomicity and durability. In systems using WAL, all modifications are written to a log file before being committed.

[0074] Leader node: The data source node in the blockchain that initiates data updates.

[0075] Peer: A node in the blockchain that responds to the master node by updating data.

[0076] It should be understood that the blockchain-based data processing method provided in this application can be applied to systems or programs in terminal devices that include blockchain-based data processing functions, such as consortium blockchain management. Specifically, the blockchain-based data processing system can run on systems such as... Figure 1 In the network architecture shown, such as Figure 1 The diagram shown illustrates the network architecture of a blockchain-based data processing system. As can be seen, this system can provide data processing across multiple information sources. Data is stored on a server through terminal-side operations, and the server, acting as a node in the blockchain, updates the data. Terminal devices can also act as nodes, but this will not be elaborated upon here. It is understood that… Figure 1 The document illustrates various terminal devices, which can be computer devices. In real-world scenarios, more or fewer types of terminal devices may participate in the blockchain-based data processing. The specific number and types depend on the actual scenario and are not limited here. Figure 1The image shows one server, but in real-world scenarios, multiple servers can be involved, especially in scenarios involving multi-node interaction. The specific number of servers depends on the actual scenario.

[0077] In this embodiment, the server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The terminal and server can be directly or indirectly connected via wired or wireless communication, and the terminal and server can be connected to form a blockchain network; this application does not impose any restrictions.

[0078] It is understandable that the aforementioned blockchain-based data processing system can run on personal mobile terminals, such as as an application for consortium blockchain management, or it can run on servers, or it can run on third-party devices to provide blockchain-based data processing to obtain the blockchain-based data processing results of information sources. Specifically, the blockchain-based data processing system can run as a program on the aforementioned devices, or it can run as a system component of the aforementioned devices, or it can run as a cloud service program. The specific operating mode depends on the actual scenario and is not limited here.

[0079] With the rapid development of internet technology, people have increasingly higher requirements for data consistency. RAFT consensus algorithm is a commonly used consensus algorithm in distributed databases; it supports failures of up to half of the nodes, but it does not support malicious node behavior. Consortium blockchains, on the other hand, are a very common branch of blockchain technology in the industry, aiming to provide distributed ledger services in a relatively secure environment.

[0080] Generally, the master node can select transaction data from the transaction pool one by one, package it into a block, and then broadcast the block to other nodes to perform data consistency operations.

[0081] However, data consistency requires a large amount of data processing, and packaging and broadcasting data one by one takes a lot of time, which affects the efficiency of data consistency processing in the blockchain.

[0082] To address the aforementioned issues, this application proposes a blockchain-based data processing method, which is applied to... Figure 2 In the blockchain-based data processing workflow framework shown, such as Figure 2The diagram illustrates a data processing architecture based on blockchain, as provided in this application embodiment. It shows three nodes in the blockchain, requiring data consistency calculations between them. Based on the current application of the RAFT consensus algorithm in the blockchain environment, a solution to improve consensus efficiency is proposed. This solution employs the concept of "parallel redundancy," parallelizing the previously sequential processing in the RAFT consensus phase, thereby improving the overall efficiency of the consensus algorithm. Each node in the diagram can act as a master node or a participating node; the specific node type is determined by the method of initiating data updates during data processing.

[0083] It is understood that the method provided in this application can be a program written as processing logic in a hardware system, or it can be a blockchain-based data processing device that integrates or externally implements the aforementioned processing logic. As one implementation, this blockchain-based data processing device, in response to the completion of packaging the first data in the first thread of the master node, calls a second thread to package the second data. The packaged first data is then broadcast to participating nodes for data consistency operations. Next, the execution status information corresponding to the first data in the first thread is determined when the second data packaging is completed. This execution status information is determined based on the execution status of the response information fed back by participating nodes in the master node. Furthermore, the target operation is determined based on the execution status information, and the packaged second data is broadcast to participating nodes in the first thread for data consistency operations based on the target operation. This achieves an efficient data consistency processing process. By using parallel threads for data packaging, the serial processing in the blockchain's algorithm consensus phase is parallelized, saving data packaging time and thus improving data processing efficiency.

[0084] Based on the above process architecture, the blockchain-based data processing method in this application will be described below. Please refer to [link / reference]. Figure 3 , Figure 3 The flowchart illustrates a blockchain-based data processing method provided in this application embodiment. This data processing method can be executed by a terminal or server and is applied to the optimization of the underlying blockchain consensus algorithm. This application embodiment includes at least the following steps:

[0085] 301. In response to the completion of the packaging of the first data in the master node by the first thread, the second thread is called to package the second data.

[0086] In this embodiment, the packaged first data is used to broadcast to participating nodes for data consistency operations, that is, to propagate and write data between nodes in the blockchain to achieve data consistency.

[0087] The following describes the specific communication process for data consistency, such as... Figure 4 As shown, Figure 4 This is a schematic diagram illustrating a blockchain-based data processing method provided in this application embodiment. The diagram shows that the leader first selects transactions from the transaction pool, packages them into blocks, and then broadcasts the blocks to other nodes (participating nodes). After receiving the packaged blocks, other nodes write the received messages into the Write-Ahead Log (WAL) and then return a response to the leader. After the leader node collects enough response messages (>1 / 2), it broadcasts a commit message to all nodes and performs a commit operation locally. The commit operation executes the transaction and writes the transaction result to storage. Then, other nodes execute the corresponding commit operation after receiving the commit message.

[0088] As seen from the above communication process, the time required for one round of block consensus is: total time = t0 + t1 + t2 + t3 + t4; and the communication volume = m0 + m1 + m2; with 3 communication attempts. The above data processing did not fully utilize the server's characteristics. For the leader, the t1 and t2 phases are idle, wasting server resources, and this is even more severe for ordinary nodes. Furthermore, the communication volume is large, especially for the third communication, m2, because it carries less effective information, leading to a lower message transmission rate due to the characteristics of TCP transmission.

[0089] This embodiment optimizes the RAFT consensus algorithm from two perspectives: improving server utilization and reducing communication overhead. The core idea of ​​this optimization is "parallel redundancy," which moves the leader node's message packaging time forward. Instead of packaging the message after receiving the designated phase one response message, it does so before that. This improves the leader node's server utilization and reduces resource idle waste during time t1+t2. Furthermore, it synchronizes the message processing flow of ordinary nodes, thereby improving the overall consensus performance.

[0090] In this embodiment, after the block (first data) in the master node is packaged by the first thread, the second thread is called to package the second data, thereby improving efficiency.

[0091] Specifically, the packaging operation may involve many steps, including selecting transactions, packaging transactions, and executing transactions. The specific steps depend on the actual scenario.

[0092] 302. Determine the execution status information corresponding to the first data in the first thread when the second data is packaged.

[0093] In this embodiment, the execution status information is determined based on the execution status of the response information fed back by the participating nodes in the master node. Figure 4 The process shown includes execution status information such as whether the new packaging operation (second data packaging) is performed after the leader node completes the previous round of commit status (confirmation operation) or the new packaging operation is performed after the leader node receives sufficient phase one response messages from the previous round. The processing procedures in different scenarios are explained below.

[0094] 303. Determine the target operation based on the execution status information, and broadcast the packaged second data to the participating nodes in the first thread based on the target operation to perform data consistency operation.

[0095] In this embodiment, the target operation is the corresponding operation performed for different stages of the first thread. The different stages are described below.

[0096] First, for the scenario where the packaging operation of the second data is performed after the leader node completes the previous round of commit state, the execution status information is first determined to be the execution status corresponding to the first thread; if the execution status indicates that the response information corresponding to the first data has completed the execution operation (commit state) in the first thread, then the communication data corresponding to the target operation is determined to be the packaged second data; then the packaged second data is broadcast to the participating nodes for data consistency operation.

[0097] Specifically, in combination Figure 5 The scenario shown is explained. Figure 5 This diagram illustrates another scenario of a blockchain-based data processing method provided in this application embodiment. The diagram shows that the second thread refers to one or more fixed threads dedicated to the packaging operation. In actual development, it exists as an independent packaged message provider, and its processing is largely unaffected by other threads. That is, after the first thread packages the first data, the second thread (a new thread) is called to package the second data. After packaging is complete, the first thread is in the commit state of the first data, i.e., the total time = t0, which is the packaging time. Compared to... Figure 4 The scenario shown eliminates the time interval t1+t2+t3+t4; in addition, the communication volume = m0+m1+m2; the number of communication times = 3 (the same as before), thus achieving the effect of improving efficiency.

[0098] In addition, for the case where the packing operation of the second data is performed after the leader node receives sufficient first-phase response messages in the previous round, that is, after determining the execution status corresponding to the execution status information in the first thread, if the execution status indicates that the response information corresponding to the first data has not completed the execution operation (received sufficient first-phase response messages in the previous round) in the first thread, the confirmation message is packed with the packed second data to obtain merged data, that is, the write-ahead log corresponding to the second data is merged with the commit process communication data of the first data at the participating nodes; then it is determined that the communication data corresponding to the target operation is the merged data; and the merged data is broadcast to the participating nodes, so that the participating nodes perform the confirmation operation corresponding to the first data according to the confirmation message and perform data consistency operations according to the packed second data.

[0099] Specifically, the communication process of this scenario is as Figure 6 shown Figure 6 This is a schematic diagram of another scenario of the data processing method based on blockchain provided by the embodiments of this application; it shows that when the packing of the second data is completed, that is, when the time t0 ends, the commit state is not reached, but only the collection of the first-phase response is completed. In this case, the processing of the message can be optimized, and the previous communication messages m2 (the commit data of the first data at the participating nodes) + m0 (the write-ahead log corresponding to the second data) are merged into a message m0'.

[0100] Through Figure 6 the shown communication process, it can be seen that the total time = t0 (i.e., the packing time, excluding the time t1 + t2 + t3 + t4); the communication volume = m0' + m1 (< m0 + m1 + m2, reducing the communication volume to a certain extent); the communication times = 2 (one less than Figure 5 )

[0101] It can be understood that in terms of the content of the protocol, it is basically the same as m0 + m2 itself, but due to the existence of data such as message headers during tcp communication itself, so in terms of the total message volume, m0' must be less than m0 + m2, and the communication times are also reduced from the original 3 times to 2 times.

[0102] Combining the optimizations of the above different scenarios, these two situations do not occur antagonistically, and they can coexist. In actual development, the above two situations can be integrated, and different operation processes can be performed for different stages when t0 is completed, as Figure 7 shown Figure 7This is a schematic diagram of another blockchain-based data processing method provided in the embodiments of this application; that is, the processing of the second data can be any of the processing methods in the above scenarios, and the processing of the third data can be any of the processing methods in the above scenarios. The specific number of data queues depends on the actual scenario and is not limited here.

[0103] This embodiment moves the leader's block packaging operation forward, so it no longer has to be performed after the previous round of consensus operations are completed. It can be performed after the previous round of packaging is completed, or even in parallel with the previous round of consensus to a certain extent, thereby greatly saving the time of packaging blocks and making the overall consensus performance higher. It also reduces the amount of communication, by focusing on the amount of communication transmission and the number of communication, and optimizing the amount of communication by reasonably adjusting the parallel processing flow.

[0104] In another possible scenario, multiple threads can be configured for parallel processing of the packaging threads. That is, in order to make fuller use of server resources, the packaging process can also be parallelized. This parallelization does not mean that the operations within a batch of packaging are parallel, but rather that multiple parallel packaging operations are performed simultaneously.

[0105] Specifically, during the parallel processing of the packaging threads, to ensure the sequential processing of data, a packaging interval can be set, and two processing streams can be configured for each node (master node and participating nodes), which can be considered as two thread pools. For the leader node, the operation of packaging blocks is completed by multiple threads, thus making fuller use of server resources. For participating nodes, corresponding threads are configured to handle the write-alert (WAL) and commit processes. First, a preset packaging interval is obtained; then, based on the preset packaging interval, the second thread packages the second data, and the third thread packages the third data; the packaged third data is then broadcast to the first processing stream of the participating nodes to perform a write-ahead log operation. After performing the write-ahead log operation, the participating nodes send the corresponding response information for the third data back to the first processing stream of the master node. The first processing stream of the master node corresponds to the first thread; after the first processing stream of the master node completes the task of collecting the response information for the third data, it sends an acknowledgment message to the second processing stream of the participating nodes, so that the participating nodes perform data consistency operations in the second processing stream of the participating nodes.

[0106] The following section will explain the parallel processing of the above multithreaded processes using specific scenarios, such as... Figure 8 As shown, Figure 8Schematic diagram of another blockchain-based data processing method provided by an embodiment of this application; the two horizontal lines of each node in the figure represent two processing streams, which can be considered as two thread pools. For the leader node, its core processing logic is different from the solution of Optimization 1. It completes the operation of packing blocks through multiple threads, thus making more full use of server resources. Its processing flow is of the RAFT algorithm type. Because its packing process is parallelized, its processing performance is excellent. And for the peer node, it can completely isolate the write WAL operation and the commit operation, and perform event-driven processing based on the received messages, thereby achieving isolation of the processing flow and reducing the development difficulty. Through Figure 8 The improvement shown in the figure yields: total time = max(△t0, tw, tc) (i.e., select the largest one among △t0, tw, tc, satisfying: tc > tw and tc << t0); communication volume = m0 + m1 + m2; number of communications = 3.

[0107] It can be understood that △t0 represents the time interval during parallel packing, and this parameter can be set manually. And tc represents the time of commit, that is, the time to execute the transaction and write it into the database. This processing time is limited by the execution time of the transaction and the operation time of the database. Therefore, the two need to be integrated.

[0108] Specifically, the data volume information corresponding to the data consistency operation can be obtained first; then the preset packing interval can be configured based on the data volume information; and the configured preset packing interval can be obtained. That is, when the transaction volume is large, the time of tc will definitely increase. If tc is to be kept within a relatively good time range, the transaction quantity needs to be relatively small. At this time, △t0 needs to be reasonably configured to achieve a better coordination between the two, and it can be configured in the actual application of the business system.

[0109] In another possible scenario, for Figure 8 the data processing process shown in the figure, the execution status information can also be judged to determine the target operation. That is, it is judged according to the processing status of the previous (possibly multiple) blocks when each packed block is completed. If it is in the collection completion stage, the m0' message sending method can be adopted. That is, first determine the execution status information corresponding to the second data in the first thread when the third data packing is completed; then determine the target operation according to the execution status information, so as to broadcast the packed third data in the first thread to the first processing stream of the participating nodes based on the target operation to perform the pre-written log operation.

[0110] It is understandable that the above scenario descriptions can be combined in a series of data processing processes, that is, they can be matched and selected according to the actual business situation, and this selection can be implemented in the program, thereby significantly reducing the difficulty of user optimization.

[0111] Additionally, it should be noted that the RAFT consensus algorithm itself does not support the existence of malicious nodes. It supports situations such as node downtime. Therefore, as long as the program implementation logic is correct, there will be no duplicate transactions or other inaccurate states. Furthermore, if the leader goes down, it will not affect the processing of the entire process, because this optimization scheme does not adjust the entire RAFT consensus process.

[0112] As described in the above embodiments, in response to the completion of packaging the first data in the first thread of the master node, the second thread is invoked to package the second data. The packaged first data is then broadcast to participating nodes for data consistency operations. Next, the execution status information corresponding to the first data in the first thread is determined when the second data packaging is completed. This execution status information is determined based on the execution status of the response information fed back by participating nodes in the master node. Furthermore, the target operation is determined based on the execution status information, and the packaged second data is broadcast to participating nodes in the first thread for data consistency operations based on the target operation. This achieves an efficient data consistency processing process. By using parallel threads for data packaging, the serial processing in the blockchain's algorithm consensus phase is parallelized, saving data packaging time and thus improving data processing efficiency.

[0113] To better implement the above-described solutions of the embodiments of this application, related apparatus for implementing the above solutions is also provided below. Please refer to... Figure 9 , Figure 9 This application provides a schematic diagram of the structure of a blockchain-based data processing device. The processing device 900 includes:

[0114] Packaging unit 901 is used to package the second data in the master node through the second thread in response to the completion of the packaging of the first data in the first thread. The packaged first data is used to broadcast to the participating nodes for data consistency operation.

[0115] The determining unit 902 is used to determine the execution status information corresponding to the first data in the first thread when the second data packaging is completed. The execution status information is determined based on the execution status of the response information fed back by the participating node in the master node.

[0116] Processing unit 903 is configured to determine a target operation based on the execution status information, and broadcast the packaged second data to the participating nodes in the first thread based on the target operation to perform the data consistency operation.

[0117] Optionally, in some possible implementations of this application, the processing unit 903 is specifically used to determine the execution state information corresponding to the execution state in the first thread;

[0118] The processing unit 903 is specifically configured to determine that the communication data corresponding to the target operation is the packaged second data if the execution status indicates that the response information corresponding to the first data has completed the execution operation in the first thread;

[0119] The processing unit 903 is specifically used to broadcast the packaged second data to the participating nodes to perform the data consistency operation.

[0120] Optionally, in some possible implementations of this application, the processing unit 903 is specifically used to package the confirmation message and the packaged second data together to obtain merged data if the execution status indicates that the response information corresponding to the first data has not completed the execution operation in the first thread.

[0121] The processing unit 903 is specifically used to determine that the communication data corresponding to the target operation is the merged data;

[0122] The processing unit 903 is specifically used to broadcast the merged data to the participating nodes, so that the participating nodes can perform a confirmation operation corresponding to the first data according to the confirmation message, and perform the data consistency operation according to the packaged second data.

[0123] Optionally, in some possible implementations of this application, the processing unit 903 is specifically used to obtain a preset packaging interval;

[0124] The processing unit 903 is specifically used to package the third data through the third thread after packaging the second data through the second thread based on the preset packaging interval;

[0125] The processing unit 903 is specifically used to broadcast the packaged third data to the first processing stream of the participating node to perform a write-ahead log operation. After performing the write-ahead log operation, the participating node feeds back the response information corresponding to the third data to the first processing stream of the master node. The first processing stream of the master node corresponds to the first thread.

[0126] The processing unit 903 is specifically used to send confirmation information to the second processing stream of the participating node after the first processing stream of the master node has completed the task of collecting the response information corresponding to the third data, so that the participating node can perform the data consistency operation in the second processing stream of the participating node.

[0127] Optionally, in some possible implementations of this application, the processing unit 903 is specifically used to determine the execution status information corresponding to the second data in the first thread when the third data packaging is completed, and the execution status information is determined based on the execution status of the response information fed back by the participating node in the master node;

[0128] The processing unit 903 is specifically used to determine the target operation based on the execution status information, and broadcast the packaged third data to the first processing stream of the participating node in the first thread based on the target operation, so as to perform the write-ahead log operation.

[0129] Optionally, in some possible implementations of this application, the processing unit 903 is specifically used to obtain the data volume information corresponding to the data consistency operation;

[0130] The processing unit 903 is specifically used to configure the preset packaging interval based on the data volume information;

[0131] The processing unit 903 is specifically used to obtain the configured preset packaging interval.

[0132] In response to the completion of the packaging of the first data in the master node by the first thread, the second thread is invoked to package the second data. This packaged first data is then broadcast to participating nodes for data consistency operations. Next, the execution status information corresponding to the first data in the first thread is determined when the second data packaging is complete. This execution status information is determined based on the execution status of the responses from participating nodes in the master node. Furthermore, the target operation is determined based on the execution status information, and the packaged second data is broadcast to participating nodes by the first thread for data consistency operations based on the target operation. This achieves an efficient data consistency processing process. By using parallel threads for data packaging, the serial processing in the blockchain's algorithm consensus phase is parallelized, saving data packaging time and thus improving data processing efficiency.

[0133] This application also provides a terminal device, such as... Figure 10The diagram shown is a structural schematic of another terminal device provided in an embodiment of this application. For ease of explanation, only the parts related to the embodiment of this application are shown. For specific technical details not disclosed, please refer to the method section of the embodiment of this application. The terminal can be any terminal device including mobile phones, tablets, personal digital assistants (PDAs), point-of-sale (POS) terminals, in-vehicle computers, etc. Taking a mobile phone as an example:

[0134] Figure 10 This is a block diagram illustrating a portion of the structure of a mobile phone related to the terminal provided in the embodiments of this application. (Reference) Figure 10 The mobile phone includes components such as a radio frequency (RF) circuit 1010, a memory 1020, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a wireless fidelity (WiFi) module 1070, a processor 1080, and a power supply 1090. Those skilled in the art will understand that... Figure 10 The mobile phone structure shown does not constitute a limitation on the mobile phone and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0135] The following is combined Figure 10 A detailed introduction to each component of a mobile phone:

[0136] The RF circuit 1010 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and processes it with the processor 1080; additionally, it transmits uplink data to the base station. Typically, the RF circuit 1010 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier (LNA), and a duplexer. Furthermore, the RF circuit 1010 can also communicate wirelessly with networks and other devices. The aforementioned wireless communication can use any communication standard or protocol, including but not limited to Global System for Mobile Communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, and Short Message Service (SMS).

[0137] The memory 1020 can be used to store software programs and modules. The processor 1080 executes various mobile phone functions and data processing by running the software programs and modules stored in the memory 1020. The memory 1020 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 1020 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0138] The input unit 1030 can be used to receive input numerical or character information, and generate key signal inputs related to user settings and function control of the mobile phone. Specifically, the input unit 1030 may include a touch panel 1031 and other input devices 1032. The touch panel 1031, also known as a touch screen, can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel 1031, as well as air touch operations within a certain range on the touch panel 1031), and drive the corresponding connection devices according to a pre-set program. Optionally, the touch panel 1031 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, sends it to the processor 1080, and can receive and execute commands sent by the processor 1080. Furthermore, the touch panel 1031 can be implemented using various types of sensors, including resistive, capacitive, infrared, and surface acoustic wave sensors. In addition to the touch panel 1031, the input unit 1030 may also include other input devices 1032. Specifically, these other input devices 1032 may include, but are not limited to, one or more of the following: a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, and a joystick.

[0139] The display unit 1040 can be used to display information input by the user or information provided to the user, as well as various menus of the mobile phone. The display unit 1040 may include a display panel 1041, which may optionally be configured as a liquid crystal display (LCD), organic light-emitting diode (OLED), or similar form. Further, a touch panel 1031 may cover the display panel 1041. When the touch panel 1031 detects a touch operation on or near it, it transmits the information to the processor 1080 to determine the type of touch event. Subsequently, the processor 1080 provides corresponding visual output on the display panel 1041 according to the type of touch event. Although in Figure 10 In this embodiment, the touch panel 1031 and the display panel 1041 are two separate components to realize the input and output functions of the mobile phone. However, in some embodiments, the touch panel 1031 and the display panel 1041 can be integrated to realize the input and output functions of the mobile phone.

[0140] The mobile phone may also include at least one sensor 1050, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 1041 according to the ambient light level, and the proximity sensor can turn off the display panel 1041 and / or backlight when the phone is moved to the ear. As a type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used for applications that recognize the phone's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometer, taps), etc. Other sensors that may be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.

[0141] The audio circuit 1060, speaker 1061, and microphone 1062 provide an audio interface between the user and the mobile phone. The audio circuit 1060 converts the received audio data into electrical signals and transmits them to the speaker 1061, where the speaker 1061 converts them into sound signals for output. On the other hand, the microphone 1062 converts the collected sound signals into electrical signals, which are then received by the audio circuit 1060, converted into audio data, and then processed by the processor 1080 before being transmitted via the RF circuit 1010 to, for example, another mobile phone, or the audio data can be output to the memory 1020 for further processing.

[0142] WiFi is a short-range wireless transmission technology. Through the WiFi module 1070, mobile phones can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although Figure 10 The WiFi module 1070 is shown, but it is understood that it is not an essential component of a mobile phone and can be omitted as needed without changing the essence of the invention.

[0143] The processor 1080 is the control center of the mobile phone, connecting various parts of the phone through various interfaces and lines. It performs various functions and processes data by running or executing software programs and / or modules stored in the memory 1020 and calling data stored in the memory 1020, thereby managing the phone as a whole. Optionally, the processor 1080 may include one or more processing units; optionally, the processor 1080 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the aforementioned modem processor may also not be integrated into the processor 1080.

[0144] The mobile phone also includes a power supply 1090 (such as a battery) that supplies power to various components. Optionally, the power supply can be logically connected to the processor 1080 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.

[0145] Although not shown, mobile phones may also include a camera, Bluetooth module, etc., which will not be described in detail here.

[0146] In this embodiment of the application, the processor 1080 included in the terminal also has the function of performing the various steps of the page processing method described above.

[0147] This application also provides a server; please refer to [link / reference]. Figure 11 , Figure 11 This is a schematic diagram of a server structure provided in an embodiment of this application. The server 1100 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 1122 (e.g., one or more processors) and memory 1132, and one or more storage media 1130 (e.g., one or more mass storage devices) for storing application programs 1142 or data 1144. The memory 1132 and storage media 1130 can be temporary or persistent storage. The program stored in the storage media 1130 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the server. Furthermore, the CPU 1122 may be configured to communicate with the storage media 1130 and execute the series of instruction operations in the storage media 1130 on the server 1100.

[0148] Server 1100 may also include one or more power supplies 1126, one or more wired or wireless network interfaces 1150, one or more input / output interfaces 1158, and / or one or more operating systems 1141, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0149] The steps performed by the management device in the above embodiments can be based on this Figure 11 The server structure shown.

[0150] This application also provides a computer-readable storage medium storing blockchain-based data processing instructions, which, when run on a computer, cause the computer to perform the aforementioned actions. Figures 3 to 8 The steps performed by the blockchain-based data processing device in the method described in the illustrated embodiment.

[0151] This application also provides a computer program product including blockchain-based data processing instructions, which, when run on a computer, causes the computer to perform the aforementioned actions. Figures 3 to 8 The steps performed by the blockchain-based data processing device in the method described in the illustrated embodiment.

[0152] This application also provides a blockchain-based data processing system, which may include... Figure 9 The blockchain-based data processing device described in the embodiments, or Figure 10 The terminal device in the described embodiments, or Figure 11 The server described.

[0153] In one possible scenario, the network resource management method of this application is applied to a blockchain device, i.e., the authoritative DNS, LDNS, or terminal is a blockchain device, and this blockchain device is a node in the blockchain. This is described below with reference to the accompanying drawings; see also... Figure 12A The data sharing system 1200 shown refers to a system for data sharing between nodes. This system may include multiple nodes 1201, which can refer to various clients within the system. Each node 1201, during normal operation, receives input information and maintains the shared data within the system based on this information. To ensure interoperability within the system, information connections exist between nodes, allowing for information transmission. For example, when any node in the system receives input information, other nodes obtain this input information according to a consensus algorithm and store it as part of the shared data, ensuring consistency across all nodes.

[0154] Each node in the data sharing system has a corresponding node identifier, and each node can also store the node identifiers of other nodes in the data sharing system. This allows for the subsequent broadcasting of generated blocks to other nodes in the data sharing system based on their node identifiers. Each node can maintain a node identifier list as shown in the table below, storing the node name and node identifier in this list. The node identifier can be an IP (Internet Protocol) address or any other information that can be used to identify the node. Table 1 only uses IP addresses as an example.

[0155] Table 1. Correspondence between node names and node identifiers

[0156] Node Name Node identifier Node 1 117.114.151.174 Node 2 117.116.189.145 … … Node N 119.123.789.258

[0157] Each node in the data-sharing system stores the same blockchain. A blockchain consists of multiple blocks; see [link to blockchain documentation]. Figure 12B A blockchain consists of multiple blocks. The genesis block includes a block header and a block body. The block header stores input information feature values, version number, timestamp, and difficulty value, while the block body stores the input information. The next block after the genesis block takes the genesis block as its parent block. The next block also includes a block header and a block body. The block header stores the input information feature values ​​of the current block, the block header feature values ​​of the parent block, version number, timestamp, and difficulty value, and so on. This ensures that the block data stored in each block is related to the block data stored in the parent block, guaranteeing the security of the input information in the blocks.

[0158] When generating the individual blocks in the blockchain, see Figure 12C When a node in the blockchain receives input information, it verifies the input information. After verification, it stores the input information in a memory pool and updates its hash tree used to record the input information. Then, it updates the timestamp to the time the input information was received and tries different random numbers multiple times to calculate the feature value, ensuring that the calculated feature value satisfies the following formula:

[0159]

[0160] Wherein, SHA256 is the feature value algorithm used to calculate the feature value; version (version number) is the version information of the relevant block protocol in the blockchain; prev_hash is the block header feature value of the parent block of the current block; merkle_root is the feature value of the input information; ntime is the update time of the update timestamp; nbits is the current difficulty, which is a fixed value for a period of time and is determined again after exceeding the fixed time period; x is a random number; TARGET is the feature value threshold, which can be determined based on nbits.

[0161] Thus, when a random number satisfying the above formula is calculated, the information can be stored accordingly, generating a block header and a block body to obtain the current block. Subsequently, the node where the blockchain resides sends the newly generated block to other nodes in its data sharing system based on the node identifiers of other nodes in the data sharing system. The other nodes then verify the newly generated block and add it to their stored blockchain after verification.

[0162] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0163] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.

[0164] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0165] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0166] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a blockchain-based data processing device, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0167] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A data processing method based on blockchain, characterized in that, include: In response to the completion of the packaging of the first data in the master node by the first thread, the second thread is called to package the second data. The packaged first data is then broadcast to the participating nodes for data consistency operations. When the second data packaging is completed, the execution status information corresponding to the first data in the first thread is determined, and the execution status information is determined based on the execution status of the response information fed back by the participating node in the master node; Determine the execution status information corresponding to the execution status in the first thread; If the execution status indicates that the response information corresponding to the first data has completed the execution operation in the first thread, then the communication data corresponding to the target operation is determined to be the packaged second data; The packaged second data is broadcast to the participating nodes to perform the data consistency operation; If the execution status indicates that the response information corresponding to the first data has not completed the execution operation in the first thread, then the confirmation message and the packaged second data are packaged together to obtain merged data; The communication data corresponding to the target operation is determined to be the merged data; The merged data is broadcast to the participating nodes, so that the participating nodes can perform a confirmation operation corresponding to the first data based on the confirmation message, and perform the data consistency operation based on the packaged second data.

2. The method according to claim 1, characterized in that, The method further includes: Get the preset packaging interval; Based on the preset packaging interval, after the second data is packaged by the second thread, the third data is packaged by the third thread. The packaged third data is broadcast to the first processing stream of the participating node to perform a write-ahead log operation. After performing the write-ahead log operation, the participating node sends the response information corresponding to the third data back to the first processing stream of the master node. The first processing stream of the master node corresponds to the first thread. After the first processing stream of the master node completes the task of collecting the response information corresponding to the third data, it sends an acknowledgment message to the second processing stream of the participating node, so that the participating node performs the data consistency operation in the second processing stream of the participating node.

3. The method according to claim 2, characterized in that, The step of broadcasting the packaged third data to the first processing stream of the participating nodes to perform the write-ahead log operation includes: When the third data is packaged, the execution status information corresponding to the second data in the first thread is determined. The execution status information is determined based on the execution status of the response information fed back by the participating nodes in the master node. The target operation is determined based on the execution status information, and the packaged third data is broadcast to the first processing stream of the participating node in the first thread based on the target operation to perform the write-ahead log operation.

4. The method according to claim 2, characterized in that, The process of obtaining the preset packaging interval includes: Obtain the data volume information corresponding to the data consistency operation; Configure the preset packaging interval based on the data volume information; Obtain the configured preset packaging interval.

5. The method according to claim 1, characterized in that, The method is applied to a blockchain device, which is a node in a blockchain.

6. A data processing device based on blockchain, characterized in that, include: The packaging unit is used to respond to the completion of the packaging of the first data in the master node by the first thread, and to call the second thread to package the second data. The packaged first data is then broadcast to the participating nodes for data consistency operations. The determining unit is used to determine the execution status information corresponding to the first data in the first thread when the second data packaging is completed. The execution status information is determined based on the execution status of the response information fed back by the participating nodes in the master node. A processing unit is configured to determine the execution status information corresponding to the execution status in the first thread; The processing unit is configured to determine that the communication data corresponding to the target operation is the packaged second data if the execution status indicates that the response information corresponding to the first data has completed the execution operation in the first thread; The processing unit is used to broadcast the packaged second data to the participating nodes to perform the data consistency operation; The processing unit is configured to, if the execution status indicates that the response information corresponding to the first data has not completed the execution operation in the first thread, package the confirmation message and the packaged second data together to obtain merged data; The processing unit is used to determine that the communication data corresponding to the target operation is the merged data; The processing unit is configured to broadcast the merged data to the participating nodes, so that the participating nodes can perform a confirmation operation corresponding to the first data based on the confirmation message, and perform the data consistency operation based on the packaged second data.

7. The apparatus according to claim 6, characterized in that, The processing unit is also used to obtain a preset packaging interval; The processing unit is further configured to package the third data through the third thread after packaging the second data through the second thread based on the preset packaging interval; The processing unit is further configured to broadcast the packaged third data to the first processing stream of the participating node to perform a write-ahead log operation. After performing the write-ahead log operation, the participating node feeds back the response information corresponding to the third data to the first processing stream of the master node. The first processing stream of the master node corresponds to the first thread. The processing unit is further configured to send confirmation information to the second processing stream of the participating node after the first processing stream of the master node has completed the task of collecting the response information corresponding to the third data, so that the participating node performs the data consistency operation in the second processing stream of the participating node.

8. The apparatus according to claim 7, characterized in that, The processing unit is specifically used to determine the execution status information corresponding to the second data in the first thread when the third data packaging is completed. The execution status information is determined based on the execution status of the response information fed back by the participating nodes in the master node. The processing unit is specifically used to determine the target operation based on the execution status information, and broadcast the packaged third data to the first processing stream of the participating node in the first thread based on the target operation, so as to perform the write-ahead log operation.

9. The apparatus according to claim 7, characterized in that, The processing unit is specifically used to obtain the data volume information corresponding to the data consistency operation; The processing unit is specifically used to configure the preset packaging interval based on the data volume information; The processing unit is specifically used to obtain the configured preset packaging interval.

10. A computer device, characterized in that, The computer device includes a processor and memory: The memory is used to store program code; the processor is used to execute the blockchain-based data processing method according to any one of claims 1 to 5 according to the instructions in the program code.

11. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the blockchain-based data processing method according to any one of claims 1 to 5.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the blockchain-based data processing method according to any one of claims 1 to 5.