Data processing method, device and equipment based on block chain and readable storage medium

By introducing data distribution components and load balancing components into the transaction pool cluster service node of the blockchain network, the problem of unbalanced transaction data in the blockchain network is solved, and the load balancing of transaction data and the improvement of blockchain network performance is achieved.

CN119690632APending Publication Date: 2025-03-25TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311240608.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-22
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The transaction data load in the blockchain network is unbalanced, resulting in limited performance improvement.

Method used

By introducing data distribution components and load balancing components into the transaction pool cluster service node, the transaction data sent by the terminal is obtained, and the load balancing selection process is performed in the load balancing component, the target blockchain node is determined, and the transaction data is sent to the target data shard component for storage and synchronization.

Benefits of technology

The load balancing of transaction data in the blockchain network is realized, avoiding the excessive pressure on storage and computing resources of a single blockchain node, and improving the performance of the entire blockchain network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690632A_ABST
    Figure CN119690632A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method, device and equipment based on a block chain and a readable storage medium, and the method comprises the steps: obtaining first transaction data sent by a first terminal, and sending the first transaction data to a data distribution assembly and a load balancing assembly; in the load balancing component, performing load balancing selection processing on the block chain node cluster to obtain a target block chain node, and determining a data theme service associated with the target block chain node as a target data theme service; sending the first transaction data to a target data fragmentation component through a data distribution component; the target data fragmentation component belongs to one or more data fragmentation components associated with the target data theme service; the target data fragmentation component is used for synchronizing the first transaction data to the target block chain node. According to the invention, load balancing of transaction data in the block chain network can be realized, and the performance of the whole block chain network is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a blockchain-based data processing method, device, equipment, and readable storage medium. Background Art

[0002] Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. It is mainly used to organize data in chronological order and encrypt it into a ledger to make it impossible to be tampered with or forged. At the same time, it can verify, store and update data. Because of the immutability and authenticity of blockchain, more and more blockchain applications are being used.

[0003] In existing blockchain networks, each blockchain node usually has a built-in transaction pool. The blockchain node will cache the received transaction data in the transaction pool, and then broadcast the transaction data, package it into blocks, and refresh the transaction pool after confirming that the transaction data is written into the blockchain ledger. It is understandable that the computing, storage, and network resources of a single blockchain node are limited, and the generation time and quantity of transaction data in the blockchain network are uncontrollable. In the same time period, some blockchain nodes may need to receive and process a large amount of concurrent transaction data, while some blockchain nodes may not receive transaction data. This leads to an unbalanced transaction data load in the blockchain network, thereby affecting the performance improvement of the entire blockchain network. Summary of the invention

[0004] The embodiments of the present application provide a blockchain-based data processing method, apparatus, device, and readable storage medium, which can achieve load balancing of transaction data in a blockchain network and improve the performance of the entire blockchain network.

[0005] The embodiment of the present application provides a data processing method based on blockchain on one hand, wherein the blockchain network includes a transaction pool cluster service node and a blockchain node cluster; the transaction pool cluster service node includes a data distribution component, a load balancing component, a data subject service associated with each blockchain node included in the blockchain node cluster, and one or more data sharding components associated with each data subject service; the method is executed by the transaction pool cluster service node; and includes:

[0006] Acquire first transaction data sent by the first terminal, and send the first transaction data to the data distribution component and the load balancing component;

[0007] In the load balancing component, a load balancing selection process is performed on the blockchain node cluster to obtain a target blockchain node, and a data subject service associated with the target blockchain node is determined as a target data subject service;

[0008] The first transaction data is sent to the target data shard component through the data distribution component; the target data shard component belongs to one or more data shard components associated with the target data subject service; the target data shard component is used to synchronize the first transaction data to the target blockchain node.

[0009] The embodiment of the present application provides a data processing device based on blockchain on one hand, wherein the blockchain network includes a transaction pool cluster service node and a blockchain node cluster; the transaction pool cluster service node includes a data distribution component, a load balancing component, a data subject service associated with each blockchain node included in the blockchain node cluster, and one or more data sharding components associated with each data subject service; the device is run by the transaction pool cluster service node; and includes:

[0010] An acquisition module, used for acquiring first transaction data sent by the first terminal, and sending the first transaction data to the data distribution component and the load balancing component;

[0011] The node selection module is used to perform load balancing selection processing on the blockchain node cluster in the load balancing component, obtain the target blockchain node, and determine the data subject service associated with the target blockchain node as the target data subject service;

[0012] The shard selection module is used to send the first transaction data to the target data shard component through the data distribution component; the target data shard component belongs to one or more data shard components associated with the target data subject service; the target data shard component is used to synchronize the first transaction data to the target blockchain node.

[0013] Among them, the node selection module includes:

[0014] A feature extraction unit, configured to perform feature extraction processing on the first transaction data in the load balancing component to obtain transaction features corresponding to the first transaction data;

[0015] A prediction unit is used to perform transaction execution prediction processing on each blockchain node according to the operation status characteristics and transaction characteristics corresponding to each blockchain node, and obtain the transaction execution prediction situation corresponding to each blockchain node; the transaction execution prediction situation includes the transaction execution prediction time and the transaction execution prediction occupied resources;

[0016] A weighting unit is used to perform weighted sum processing on the transaction execution prediction time and transaction execution prediction occupied resources corresponding to each blockchain node, and determine the transaction execution score corresponding to each blockchain node;

[0017] The first determination unit is used to determine the blockchain node with the smallest transaction execution score as the target blockchain node.

[0018] The prediction unit includes:

[0019] An acquisition subunit is used to acquire a transaction execution prediction model; the transaction execution prediction model is obtained by performing reinforcement learning training on an initial execution prediction model based on at least two historical transaction data samples and historical operation status feature samples;

[0020] The prediction subunit is used to input the operating status characteristics and transaction characteristics corresponding to each blockchain node into the transaction execution prediction model respectively, so as to obtain the transaction execution prediction situation corresponding to each blockchain node.

[0021] Wherein, the above-mentioned data processing device further includes:

[0022] A situation acquisition module, used to obtain the transaction execution status of the target blockchain node for the first transaction data;

[0023] The model adjustment module is used to determine the transaction execution loss value between the transaction execution situation and the transaction execution prediction situation corresponding to the target blockchain node, and adjust the model parameters of the transaction execution prediction model according to the transaction execution loss value to obtain the adjusted transaction execution prediction model.

[0024] Among them, the node selection module includes:

[0025] A second determination unit is used to determine a historical blockchain node identifier in a load balancing component; the historical blockchain node identifier is a blockchain node identifier corresponding to a blockchain node selected by a previous round of load balancing selection processing;

[0026] The second determination unit is further used to obtain the blockchain node identifier adjacent to the historical blockchain node identifier according to the blockchain node identifier sequence corresponding to the blockchain node cluster as the target blockchain node identifier;

[0027] The second determination unit is also used to determine the blockchain node corresponding to the target blockchain node identifier as the target blockchain node.

[0028] The shard selection module includes:

[0029] A first selection unit is used to obtain resource occupancy information corresponding to one or more data sharding components associated with a target data subject service through a data distribution component;

[0030] The first selection unit is further configured to determine the data shard component with the smallest resource occupancy information as the target data shard component, and send the first transaction data to the target data shard component.

[0031] The shard selection module includes:

[0032] A second selection unit is used to obtain a transaction hash corresponding to the first transaction data through a data distribution component, and perform remainder processing on the transaction hash according to the number of components of one or more data shard components associated with the target data subject service to obtain a component sequence number;

[0033] The second selection unit is further used to determine the data shard component indicated by the component serial number as the target data shard component, and send the first transaction data to the target data shard component.

[0034] Wherein, the above-mentioned data processing device further includes:

[0035] The data synchronization module is used to determine the transaction data in the one or more data shard components associated with the target data subject service, whose transaction status is in an unsynchronized state, as the target transaction data when it is determined that the target data subject service meets the subscription synchronization condition; the target transaction data includes the first transaction data;

[0036] The data synchronization module is also used to update the transaction status corresponding to the target transaction data to a synchronization status;

[0037] The data synchronization module is also used to send the target transaction data to the target blockchain node, so that the target blockchain node can verify the target transaction data and then package the target transaction data into the block to be chained; the block to be chained is used to be written into the blockchain ledger after passing the consensus of the blockchain node cluster.

[0038] The transaction pool cluster service node further includes a signature verification component; the above data processing device also includes:

[0039] A signature verification module, configured to receive signature data corresponding to the first transaction data through a signature verification component; the signature data is obtained by signing the first transaction data based on a transaction private key corresponding to a transaction object initiating the first transaction data;

[0040] The signature verification module is also used to decrypt the signature data in the signature verification component through the transaction public key corresponding to the transaction object to obtain the decryption result;

[0041] The signature verification module is further configured to execute the step of sending the first transaction data to the data distribution component and the load balancing component if the decryption result is a successful decryption result;

[0042] The signature verification module is also used to send a signature failure notification message to the transaction object if the signature decoding result is a signature decoding failure result.

[0043] The first transaction data includes transaction initiator information and smart contract information; the transaction pool cluster service node also includes an authority verification component; the above data processing device also includes:

[0044] The permission verification module is used to obtain the risk object information table in the permission verification component;

[0045] The authority verification module is also used to send risk warning information to the transaction object if the transaction initiator information is found in the risk object information table;

[0046] The authority verification module is also used to perform contract call authority verification processing on the transaction initiation object information according to the smart contract information if the transaction initiation object is not found in the risk object information table to obtain the authority verification result;

[0047] The authority verification module is further configured to execute the step of sending the first transaction data to the data distribution component and the load balancing component if the authority verification result is a result of passing the authority verification;

[0048] The permission verification module is also used to send a permission verification failure prompt message to the transaction object if the permission verification result is a permission verification failure result.

[0049] The transaction pool cluster service node further includes a weight verification component; the above data processing device also includes:

[0050] The weight verification module is used to obtain the transaction hash table in the weight verification component; the transaction hash table contains the transaction hash corresponding to the transaction data stored in each data shard component;

[0051] The weight verification module is further used to determine the first transaction hash corresponding to the first transaction data, perform weight verification on the first transaction hash and the transaction hash table, and obtain a weight verification result;

[0052] The weight verification module is further configured to execute the step of sending the first transaction data to the data distribution component and the load balancing component if the weight verification result indicates that the transaction hash table does not contain the first transaction hash;

[0053] The weight verification module is further configured to send a transaction duplication error prompt message to the transaction object if the weight verification result indicates that the transaction hash table contains the first transaction hash.

[0054] On the one hand, an embodiment of the present application provides a computer device, including: a processor, a memory, and a network interface;

[0055] The above-mentioned processor is connected to the above-mentioned memory and the above-mentioned network interface, wherein the above-mentioned network interface is used to provide a data communication network element, the above-mentioned memory is used to store a computer program, and the above-mentioned processor is used to call the above-mentioned computer program to execute the method in the embodiment of the present application.

[0056] On one hand, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. The computer program is suitable for being loaded by a processor and executing the method in the embodiment of the present application.

[0057] On the one hand, an embodiment of the present application provides a computer program product or a computer program, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method in the embodiment of the present application.

[0058] In an embodiment of the present application, a blockchain network may include a transaction pool cluster service node and a blockchain node cluster. The transaction pool cluster service node may include a data distribution component, a load balancing component, a data subject service associated with each blockchain node included in the blockchain node cluster, and one or more data sharding components associated with each data subject service; the transaction pool cluster service node may obtain the first transaction data sent by the first terminal, and send the first transaction data to the data distribution component and the load balancing component; then, in the load balancing component, load balancing selection processing is performed on the blockchain node cluster to obtain a target blockchain node, and the data subject service associated with the target blockchain node is determined as the target data subject service; finally, the first transaction data is sent to the target data sharding component through the data distribution component; wherein the target data sharding component belongs to one or more data sharding components associated with the target data subject service, and the target data sharding component is used to synchronize the first transaction data to the target blockchain node. Through the method provided in the embodiment of the present application, the transaction data sent by the terminal is no longer sent directly to the blockchain node, but is received by the transaction pool cluster service node, thereby realizing the decoupling of the transaction data from the blockchain node, and then the transaction data is stored in the target data sharding component corresponding to the target blockchain node through the load balancing component and the data distribution component in the transaction pool cluster service node, and then the transaction data is synchronized to the target blockchain node through the target data sharding component, thereby realizing load balancing of the transaction data, avoiding excessive pressure on storage, computing and other resources of a single blockchain node and affecting the processing speed of the transaction data, thereby improving the performance of the entire blockchain network. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the embodiments of the present application 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 some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0060] Figure 1 This is a schematic diagram of a network architecture provided by an embodiment of the present application;

[0061] Figure 2 1 is a schematic diagram of a scenario of a data processing method based on blockchain provided in an embodiment of the present application;

[0062] Figure 3 It is a flowchart of a data processing method based on blockchain provided in an embodiment of the present application;

[0063] Figure 4 It is a flowchart of a data processing method based on blockchain provided in an embodiment of the present application;

[0064] Figure 5 It is a schematic diagram of a separated blockchain transaction pool cluster service system architecture provided by an embodiment of the present application;

[0065] Figure 6 This is a structural diagram of a Kafka module provided in an embodiment of the present application;

[0066] Figure 7 This is a flow chart of transaction data load balancing provided by an embodiment of the present application;

[0067] Figure 8 This is a schematic diagram of a process of uploading transaction data to a blockchain provided by an embodiment of the present application;

[0068] Fig. 9 It is a flow chart of a dynamic intelligent scheduling provided by an embodiment of the present application;

[0069] Fig.10 It is a structural schematic diagram of a blockchain-based data processing device provided in an embodiment of the present application;

[0070] Fig.11 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0072] To facilitate understanding, some nouns are briefly explained as follows:

[0073] 1. Blockchain: In a narrow sense, blockchain is a chain data structure with blocks as the basic unit. Digital summaries are used in blocks to verify previously acquired transaction histories, which is suitable for the needs of tamper-proofing and scalability in distributed accounting scenarios. In a broad sense, blockchain also refers to the distributed accounting technology implemented by the blockchain structure, including distributed consensus, privacy and security protection, peer-to-peer communication technology, network protocols, smart contracts, etc.

[0074] The goal of blockchain is to realize a distributed data record book, which only allows additions but not deletions. The basic structure of the underlying ledger is a linear linked list. The linked list is composed of "blocks" connected in series, and the hash value of the previous block is recorded in the subsequent block. Whether each block (and the transactions in the block) is legal can be quickly verified by calculating the hash value. If a node in the network proposes to add a new block, it must reach a consensus on the block through the consensus mechanism.

[0075] 2. Block: It is a data packet that carries transaction data on the blockchain network. It is a data structure marked with a timestamp and the hash value corresponding to the previous block. The block is verified and confirmed by the consensus mechanism of the network. The block includes a block header and a block body. The block header can record the meta information of the current block, including the current version number, the hash value corresponding to the previous block, the timestamp, the random number, the hash value of the Merkle Root, and other data. The block body can record the detailed data generated within a period of time, including all transaction records or other information generated during the block creation process that have been verified by the current block, which can be understood as a form of account book. In addition, the detailed data of the block body can include the unique Merkle Root generated through the hash process of the Merkle Tree and recorded in the block header.

[0076] The predecessor block, also known as the parent block, is sorted in time by recording the hash value corresponding to the block and the hash value corresponding to the parent block in the block header.

[0077] 3. Hash value: Also known as information characteristic value or characteristic value, the hash value is generated by converting input data of any length into a password and performing a fixed output through a hash algorithm. The original input data cannot be retrieved by decrypting the hash value. It is a one-way encryption function. In the blockchain, each block (except the initial block) contains the hash value of the previous block. The hash value is the potential core foundation and the most important aspect of blockchain technology. It retains the authenticity of the recorded and viewed data, as well as the integrity of the blockchain as a whole.

[0078] 4. Smart Contract: A smart contract is a computer protocol designed to disseminate, verify or execute contracts in an information-based manner. The concept of smart contracts has three major elements: commitment, agreement, and digital form, so it can expand the application scope of blockchain to all aspects of financial industry transactions, payments, settlements and clearing. Smart contracts refer to the immediate execution of corresponding contract terms when a pre-programmed condition is triggered. Its working principle is similar to the if-then statement of a computer program. Smart contracts allow trusted transactions without a third party, and these transactions are traceable and irreversible.

[0079] 5. Kafka (distributed stream processing platform): Kafka is a distributed stream processing platform, mainly used to build real-time data pipelines and streaming applications. It has the characteristics of high throughput, low latency, scalability, and fault tolerance. Kafka achieves decoupling between data producers and consumers through the publish / subscribe model and supports a large number of concurrent read and write operations. Kafka is widely used in scenarios such as big data, log processing, and message queues.

[0080] 6. Kafka Producer (producer component): Kafka Producer is the producer component in the Kafka system, responsible for sending data to the Kafka cluster. The producer can be any application that generates data, such as a log collector, sensor, service, etc. Kafka Producer encapsulates data into messages and publishes the messages to the specified KafkaTopic. The producer can customize the partitioning strategy and send messages to different partitions of the Topic to achieve load balancing and data sharding.

[0081] 7. Kafka Consumer (Consumer Component): Kafka Consumer is the consumer component in the Kafka system, responsible for reading data from the Kafka cluster. Consumers can be any application that needs to process data, such as data analysis, search, etc. Kafka Consumer subscribes to one or more Kafka Topics and pulls messages from the Topic's Partition. Consumers can set consumer groups to achieve load balancing and parallelization of message consumption.

[0082] 8. Kafka Broker (physical node): Kafka Broker is a server instance in the Kafka cluster, responsible for storing and managing message data. A Kafka cluster can contain multiple Brokers to achieve horizontal expansion and high availability. Kafka Broker stores message data in the Topic Partition and maintains an ordered message log for each Partition. Through the replica mechanism, Kafka Broker can achieve redundant storage and fault tolerance of data.

[0083] 9. Kafka Topic (data topic): Kafka Topic is a logical concept in the Kafka system, representing a specific type of message data. Producers publish messages to the Topic, and consumers pull messages from the Topic. Each Topic can have multiple Partitions to achieve data sharding and parallel processing. Kafka Topic supports multi-producer and multi-consumer modes, and can achieve one-to-many, many-to-one, and many-to-many data transmission.

[0084] 10. Kafka Partition (data shard): Kafka Partition is a physical concept in Kafka Topic, which represents a data shard of Topic. Each Partition contains an ordered message log and assigns an increasing offset to each message. Kafka Broker stores message data in the Partition, and consumers pull messages from the Partition. Through Partition, Kafka can achieve load balancing, data sharding, and parallelization of message consumption. At the same time, Partition also supports a replica mechanism to achieve redundant storage and fault tolerance of data.

[0085] 11. Transaction Pool: The transaction pool (also called Mempool) of the blockchain refers to a collection of transactions that have not been packaged into the block and are waiting to be written into the block. In the blockchain network, each node maintains a transaction pool to store new transactions generated by users. When a user initiates a transaction, the transaction will be broadcast to the entire network. If the transaction complies with the transaction rules and verification rules of the blockchain network, it will be added to the node's transaction pool. Transactions in the transaction pool need to wait for verification and confirmation before waiting to be packaged into the block. The transaction pool is one of the important components of the blockchain network. While ensuring that transactions are processed smoothly, it can also improve the efficiency and performance of the blockchain.

[0086] 12. Load balancing: Load balancing is a method of distributing workloads among multiple computing resources (such as servers, network connections, or other devices) in order to balance processing tasks on different resources. The main purpose of load balancing is to optimize resource utilization, maximize throughput, minimize response time, avoid resource overload, and ensure system availability and reliability. Load balancing can be applied to different systems and scenarios, such as network load balancing, server load balancing, and database load balancing. Load balancing can be implemented through hardware devices (load balancers) or software solutions (such as proxy servers or applications).

[0087] 13. Artificial Intelligence (AI): Artificial Intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial Intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0088] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0089] See also Figure 1 , Figure 1 Schematic diagram of a network architecture provided by an embodiment of the present application. Figure 1 As shown, the network architecture may include a blockchain node cluster 1000, a transaction pool cluster service node 100, and a terminal cluster 10. The blockchain node cluster 1000 may include at least two blockchain nodes. Figure 1 As shown, the blockchain node cluster 1000 may include blockchain node 1000a, blockchain node 1000b, ..., blockchain node 1000n, the transaction pool cluster service node 100 refers to a node integrated with a distributed stream processing platform (i.e., Kafka), and the terminal cluster 10 may specifically include terminal 10a, terminal 10b, ..., terminal 10n.

[0090] like Figure 1As shown, the terminal 10a, the terminal 10b, ..., the terminal 10n can be respectively connected to the transaction pool cluster service node 100 for data connection, so that the terminal can interact with the transaction pool cluster service node 100 through the data connection; the transaction pool cluster service node 100 can be respectively connected to the blockchain node 1000a, the blockchain node 1000b, ..., the blockchain node 1000n for data connection, so that the transaction pool cluster service node 100 can interact with the blockchain node through the data connection; the blockchain node 1000a, the blockchain node 1000b, ..., the blockchain node 1000n are connected to each other, so that data can be interacted between blockchain nodes. It can be understood that the above-mentioned data connection does not limit the connection method, and can be directly or indirectly connected through a wired communication method, can also be directly or indirectly connected through a wireless communication method, and can also be connected through other connection methods, and this application is not limited here.

[0091] It is understandable that data or blocks can be transferred between blockchain nodes through the above data connection. The blockchain network can realize data connection between blockchain nodes based on node identification. Each blockchain node in the blockchain network has a node identification corresponding to it, and each of the above blockchain nodes can store the node identifications of other blockchain nodes that are connected to itself, so that the acquired data or generated blocks can be broadcast to other blockchain nodes according to the node identifications of other blockchain nodes. For example, a node identification list as shown in Table 1 can be maintained in blockchain node 1000a, and the node identification list stores the node names and node identifications of other nodes:

[0092] Table 1

[0093] Node Name Node ID Blockchain Node 1000a AAA.AAA.AAA.AAA Blockchain node 1000b BBB.BBB.BBB.BBB … … Blockchain node 1000n CCC.CCC.CCC.CCC

[0094] The node identifier may be an Internet Protocol (IP) address for interconnecting networks or any other information that can be used to identify a blockchain node in a blockchain network. Table 1 only uses the IP address as an example for illustration. For example, blockchain node 1000a may send information (e.g., transaction data) to blockchain node 1000b via node identifier BBB.BBB.BBB.BBB, and blockchain node 1000b may determine that the information is sent by blockchain node 1000a via node identifier AAA.AAA.AAA.AAA.

[0095] In the blockchain, before a block is put on the chain, the block must be agreed upon by the consensus nodes in the blockchain network. Only after the consensus is passed can the block be added to the blockchain. It is understandable that when the blockchain is used in some scenarios of government or commercial organizations, not all participating nodes in the blockchain (i.e., the blockchain nodes in the above blockchain node cluster 1000) have sufficient resources and necessity to become consensus nodes of the blockchain. For example, in Figure 1 In the blockchain node cluster 1000 shown, blockchain nodes 1000a, 1000b and 1000n can be used as consensus nodes in the blockchain node cluster. The consensus nodes in the blockchain node cluster 1000 participate in consensus, that is, consensus on blocks (including a batch of transactions), including generating blocks and voting on blocks; while non-consensus nodes do not participate in consensus, but will help spread block and voting messages, as well as synchronize status with each other.

[0096] It can be understood that the transaction pool cluster service node 100 is used to deploy the transaction pool in the blockchain network, that is, to verify and store the transaction data newly generated in the blockchain network that has not yet been packaged into the block. The transaction pool cluster service node 100 may include a data distribution component, a load balancing component, a data subject service associated with each blockchain node included in the blockchain node cluster 1000, and one or more data sharding components associated with each data subject service, wherein a data subject service is used to manage transaction data related to a blockchain node, and a data sharding component is used to store multiple transaction data. In the present application, when the transaction pool cluster service node 100 receives newly generated transaction data from any terminal in the terminal cluster 10, it can preferentially select the data sharding component corresponding to the relatively idle blockchain node in the blockchain node cluster 1000 to store the transaction data, and then synchronize the transaction data to the blockchain node through the data sharding component. The blockchain node initiates the uploading of the transaction data to the chain, and stores the transaction data through the transaction pool cluster service node 100 and distributes the transaction data to the appropriate blockchain node. This can achieve load balancing of the transaction data, avoid excessive computing and storage pressure on a single blockchain node and affect the processing speed of the transaction data, thereby improving the performance of the blockchain network.

[0097] Specifically, in the present application, after receiving the first transaction data sent by the first terminal (which can be any terminal in the terminal cluster 10), the transaction pool cluster service node 100 can send the first transaction data to the data distribution component and the load balancing component. Then, the transaction pool cluster service node 100 can perform load balancing selection processing on the blockchain node cluster in the load balancing component to obtain the target blockchain node, and determine the data subject service associated with the target blockchain node as the target data subject service. Then, the transaction pool cluster service node 100 can send the first transaction data to the target data sharding component for storage through the data distribution component; wherein the target data sharding component belongs to one or more data sharding components associated with the target data subject service, and the target data sharding component is used to synchronize the first transaction data to the target blockchain node.

[0098] Optionally, when the number of blockchain nodes included in the blockchain network is too large, the blockchain nodes can also be divided into multiple blockchain node clusters, and each blockchain node cluster is assigned a corresponding transaction pool cluster service node, that is, a transaction pool cluster service node is used to distribute the received transaction data to the blockchain nodes in the corresponding blockchain node cluster. For ease of understanding, this application only takes the blockchain network containing a transaction pool cluster service node as an example for explanation.

[0099] It is understandable that the data processing method provided in the embodiment of the present application can be executed by a computer device, and the computer device includes but is not limited to the above-mentioned transaction pool cluster service node (which can be a terminal or a server). The above-mentioned server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The above-mentioned terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, an intelligent speaker, a smart watch, etc., but is not limited to this.

[0100] It is understandable that the embodiments of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, etc. For example, the blockchain node system can reach a consensus on some driving behavior data, road trajectory data, etc. sent by the vehicle terminal, and store them on the chain after the consensus is reached.

[0101] It can be understood that in the specific implementation of the present application, the first transaction data and other related data involved, when the above embodiments of the present application are applied to specific products or technologies, need to obtain user permission or consent, and the collection, use and processing of the relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0102] To understand the implementation process of the above transaction data load balancing, please refer to Figure 2 , Figure 2 is a schematic diagram of a scenario of a data processing method based on blockchain provided in an embodiment of the present application. Figure 2 The terminal 20 shown may be the above Figure 1 Any terminal in the terminal cluster 10 shown, for example, terminal 20 is terminal 10a; Figure 2 The transaction pool cluster service node 21 shown can be the above Figure 1 The transaction pool service node 100 shown; wherein, Figure 2 The blockchain node 22 shown can be the above Figure 1 Any blockchain node in the blockchain node cluster 1000 shown, such as blockchain node 22, can be blockchain node 10b.

[0103] like Figure 2 As shown, object A has an association relationship with terminal 20 , and terminal 20 can respond to the transaction operation of object A, generate transaction data 201 , and then send the transaction data 201 to the transaction pool cluster service node 21 .

[0104] like Figure 2 As shown, the transaction pool cluster service node 21 includes a load balancing component 211, a data subject service associated with each blockchain node, a data distribution component 213, and one or more data sharding components associated with each data subject service. The load balancing component 211 is used to determine whether to send transaction data to a suitable (or idle) data subject service, and the data distribution component 213 is used to determine whether to send transaction data to a suitable (or idle) data sharding component associated with the data subject service selected by the load balancing component 211. It can be understood that the data subject service is a logical concept used to represent all transaction data associated with a blockchain node, while the data sharding component is a physical concept, which is an actual storage space for storing transaction data.

[0105] It can be understood that after receiving the transaction data 201, the transaction pool cluster service node 21 can first send the transaction data 201 to the load balancing component 211, and then in the load balancing component 211, from the data subject service 212a, data subject service 212b, ..., data subject service 212n, determine which data subject service to assign the transaction data 201 to. Specifically, each data subject service corresponds to a blockchain node in a blockchain node cluster. Therefore, in the load balancing component 211, the blockchain node cluster can be subjected to load balancing selection processing to obtain the target blockchain node, and then the data subject service associated with the target blockchain node is determined as the target data subject service. Among them, the purpose of the load balancing selection processing is to balance the computing, storage and other pressures between blockchain nodes, that is, to give priority to blockchain nodes with relatively idle computing and storage resources. The selection method at this time can adopt a polling method or an idle priority selection method. The specific implementation can be referred to in the subsequent Figure 3 The description in the corresponding embodiment will not be described in detail here. Assuming that the transaction pool cluster service node 21 determines that the blockchain node 22 is a suitable (or idle) blockchain node in the blockchain node cluster through the load balancing component 211, and the data subject service associated with the blockchain node is the data subject service 212b, the load balancing component 211 can determine that the data subject service 212b is the target data subject service, and then notify the data distribution component 213.

[0106] like Figure 2 As shown, when the transaction pool cluster service node 21 receives through the data distribution component 213 that the target data subject service is data subject service 212b, the data distribution component 213 can determine the data shard component associated with the data subject service 212b, assuming that it can be data shard component 214a, data shard component 214b, ..., data shard component 214n. Then, the transaction pool cluster service node 21 can select a suitable (idle) data shard component from these data shard components as the target data shard component 214a through the data distribution component 213 to store the transaction data 201. It can be understood that the purpose of a single data subject service 212b corresponding to multiple data shard components is to store the transaction data in a dispersed manner to avoid the direct loss of all transaction data when a single data shard component is destroyed, thereby achieving fault tolerance of the transaction data. The selection method at this time can adopt a polling method or an idle priority selection method. The specific implementation can be referred to in the subsequent Figure 3The description in the corresponding embodiment will not be described in detail here. Assuming that the transaction pool cluster service node 21 determines that the data sharding component 214a is the target data sharding component through the data distribution component 213, the transaction data 201 can be sent to the data sharding component 214a for storage through the data distribution component 213. It can be understood that when the subscription synchronization condition is met, the transaction pool cluster service node 21 can send the transaction data 201 to the blockchain node 22 corresponding to the data subject service 212b through the data sharding component 214a. After receiving the transaction data 201, the blockchain node 22 can verify the transaction, and then package it into the block to be chained, and then send the block to be chained to the blockchain node cluster in the blockchain network for consensus. When the block to be chained passes the consensus, it can be written into the blockchain ledger.

[0107] It can be understood that through the method provided in the embodiment of the present application, the transaction data will be stored in the data sharding components corresponding to different data subject services by the transaction pool cluster management node. When the subscription synchronization conditions are met, the transaction data in the data distribution component will be sent to the corresponding blockchain node, thereby avoiding a single blockchain node from receiving a large amount of transaction data at the same time, achieving load balancing of transaction data, and improving the processing speed of transaction data, thereby improving the performance of the blockchain network.

[0108] For further information, see Figure 3 , Figure 3 The flowchart of a data processing method based on blockchain provided by an embodiment of the present application is shown in FIG. The blockchain network includes a transaction pool cluster service node and a blockchain node cluster; the transaction pool cluster service node includes a data distribution component, a load balancing component, a data subject service associated with each blockchain node included in the blockchain node cluster, and one or more data sharding components associated with each data subject service; the method can be performed by the transaction pool cluster service node (for example, the above Figure 1 The transaction pool cluster service node 100 in the corresponding embodiment is executed. Hereinafter, the method will be described by taking the execution of the transaction pool cluster service node as an example, wherein the data processing method based on blockchain may at least include the following steps S101-S103:

[0109] Step S101: acquiring first transaction data sent by a first terminal, and sending the first transaction data to a data distribution component and a load balancing component.

[0110] Specifically, a transaction pool cluster service node refers to a node with a separated blockchain transaction pool cluster service system architecture based on Kafka. In actual applications, a transaction pool cluster service node may include one or more servers, and its components, such as data distribution components, load balancing components, and data sharding components, may be dispersedly deployed in each server it contains. The specific number of servers and component deployment may be set according to actual conditions, and this application does not impose any restrictions thereon.

[0111] Specifically, the data sharding component refers to the Partition in Kafka, which is used to store transaction data. When the transaction pool cluster service node contains multiple servers, the data sharding components are often deployed in each server in a dispersed manner, thereby avoiding the failure of a single server and damaging all stored transaction data. The essence of the data subject service is the Topic in Kafka. The transaction pool cluster service node can classify the stored data by Topic. In this application, a data subject service refers to the transaction data related to a blockchain node. It can be understood that the transaction data contained in a data subject service can be stored separately, that is, a data subject service can usually be associated with one or more data sharding components, and these data sharding components can be stored separately physically, that is, these data sharding components can be stored on multiple servers (or physical nodes).

[0112] It can be understood that by assigning a corresponding data subject service to each blockchain node and each data subject service is associated with its own data shard component, load balancing of transaction data can be achieved. Specifically, the transaction pool cluster service node can use the load balancing component to decide which blockchain node's corresponding data subject service to assign the transaction data to, and then use the data distribution component to decide which data shard component corresponding to the data subject service to assign the transaction data to for storage. Therefore, the transaction pool cluster service node will send the transaction data to the load balancing component and the data distribution component to perform load balancing of the transaction data.

[0113] Step S102, in the load balancing component, load balancing selection processing is performed on the blockchain node cluster to obtain a target blockchain node, and the data subject service associated with the target blockchain node is determined as the target data subject service.

[0114] Specifically, the purpose of the load balancing selection process is to select a suitable blockchain node from the blockchain node cluster to be responsible for the first transaction data on the chain, for example, to give priority to a more idle blockchain node, so as to avoid excessive pressure on resources such as storage and computing of a single blockchain node and affect the processing speed of the first transaction data. The implementation of the load balancing selection process can adopt a polling strategy or other custom strategies, which is not limited in this application.

[0115] Specifically, if the polling strategy is adopted, a feasible implementation process of performing load balancing selection processing on the blockchain node cluster in the load balancing component to obtain the target blockchain node can be as follows: in the load balancing component, determine the historical blockchain node identifier; the historical blockchain node identifier is the blockchain node identifier corresponding to the blockchain node selected by the previous round of load balancing selection processing; according to the blockchain node identifier sequence corresponding to the blockchain node cluster, obtain the blockchain node identifier adjacent to the historical blockchain node identifier as the target blockchain node identifier; determine the blockchain node corresponding to the target blockchain node identifier as the target blockchain node. For example, the blockchain node identifiers corresponding to the blockchain node cluster are 1, 2, ..., 100, and the historical blockchain node identifier is 2. If the order of the blockchain node identifiers is followed, the target blockchain node identifier can be determined to be 3, so the blockchain node with the blockchain node identifier 3 can be determined as the target blockchain node.

[0116] Specifically, the load balancing selection process can also be selected according to the node status of each blockchain node, that is, the blockchain node with a more idle node status is given priority. However, in order to improve the processing speed of transactions, the blockchain node can also be predicted based on the operating status characteristics of the blockchain node to process the transaction data, and the blockchain node with better processing status can be selected. At this time, in the load balancing component, the blockchain node cluster is subjected to load balancing selection processing to obtain a feasible implementation process of the target blockchain node, which can be: in the load balancing component, the first transaction data is subjected to feature extraction processing to obtain the transaction features corresponding to the first transaction data; according to the operating status characteristics and transaction features corresponding to each blockchain node, the transaction execution prediction processing is performed on each blockchain node to obtain the transaction execution prediction situation corresponding to each blockchain node; the transaction execution prediction situation includes the transaction execution prediction time and the transaction execution prediction occupied resources; the transaction execution prediction time corresponding to each blockchain node is subjected to weighted sum processing to determine the transaction execution score corresponding to each blockchain node; the blockchain node with the smallest transaction execution score is determined as the target blockchain node.

[0117] Among them, feature extraction refers to extracting useful and computer-understandable information from raw data. Therefore, feature extraction processing refers to converting unstructured first transaction data into structured information that can be recognized and processed by computers, that is, scientifically abstracting the first transaction data and establishing its mathematical model to describe and replace the first transaction data, so that the computer device can realize the execution prediction of the first transaction data by calculating and operating this mathematical model. Among them, the mathematical model can be a vector space model. In this case, the transaction features corresponding to the first transaction data can be vectors in the vector space model, and the computer device can describe and use the first transaction data through the feature representation subset composed of the transaction features. It can be understood that feature extraction processing can adopt text classification methods, statistical methods, machine learning methods, and deep learning methods, etc., and this application is not limited here.

[0118] Among them, the running state feature refers to the feature corresponding to the running state information used to describe the blockchain node, wherein the running state information may include the computing power resource occupancy information of the blockchain node, wherein the computing power resources may include CPU (Central Processing Unit, central processing unit) resources, memory resources, network resources, etc. For example, the running state information may include CPU usage, memory usage, network bandwidth, etc. Optionally, the running state information of the blockchain node may be collected by deploying a resource detection component in the blockchain node. After the blockchain node runs happily, the resource detection component may be started, and then when it is determined that the detection cycle has been reached, the current running state information of the blockchain node is obtained through the resource detection component, and then the running state information is sent to the transaction pool cluster service node through the resource detection component. The transaction pool cluster service node may perform feature extraction processing on the received running state information to obtain the running state feature. The feature extraction processing of the running state information may refer to the feature extraction processing of the transaction data, which will not be repeated here.

[0119] Among them, according to the operating status characteristics and transaction characteristics corresponding to each blockchain node, each blockchain node is respectively processed for transaction execution prediction, and a feasible implementation process for obtaining the transaction execution prediction situation corresponding to each blockchain node can be: obtaining a transaction execution prediction model; the transaction execution prediction model is obtained by reinforcement learning training of the initial execution prediction model based on at least two historical transaction data samples and historical operating status characteristic samples; the operating status characteristics and transaction characteristics corresponding to each blockchain node are respectively input into the transaction execution prediction model to obtain the transaction execution prediction situation corresponding to each blockchain node. Among them, reinforcement learning, also known as reinforcement learning, evaluation learning or enhanced learning, is one of the paradigms and methodologies of machine learning. The transaction execution prediction model trained by reinforcement learning is used to simulate the process of blockchain nodes executing transaction data, thereby inferring the corresponding execution situation when blockchain nodes execute transaction data.

[0120] Among them, the transaction execution prediction situation may include the transaction execution prediction time and the transaction execution prediction occupied resources. The transaction execution score corresponding to the blockchain node may be determined by weighted summing the transaction execution prediction time and the transaction execution prediction occupied resources corresponding to the blockchain node, wherein the weighted summing means multiplying the transaction execution prediction time by the first weight corresponding to it to obtain the first weight score, multiplying the transaction execution prediction occupied resources by the second weight to obtain the second weight score, and then adding the first weight score to the second weight score to obtain the transaction execution score. For example, the transaction execution prediction time corresponding to blockchain node A is 2s, and the occupancy rate corresponding to the transaction execution prediction occupied resources is 20%. Assuming that the weight corresponding to the time is 5 and the weight corresponding to the resource ratio is 50, the transaction execution score of blockchain node A is 2×5+50×20%=20, and the transaction execution prediction time corresponding to blockchain node B is 1.8s, and the occupancy rate corresponding to the transaction execution prediction occupied resources is 30%, then the transaction execution score of blockchain node B is 1.8×5+50×30%=27. Because the transaction execution score of blockchain node A is less than that of blockchain node B, blockchain node A will be selected as the target blockchain node. Optionally, the transaction execution prediction situation may only include the transaction execution prediction time, or only include the transaction execution prediction occupied resources, or include other situations. The initial execution prediction model can be constructed according to the transaction execution prediction situation that needs to be predicted, and this application does not limit this.

[0121] Optionally, in addition to using historical transaction data samples and historical operation status feature samples to train the model to obtain the transaction execution prediction model, the transaction execution prediction model can be continuously updated by online learning, that is, after predicting the transaction execution prediction situation corresponding to the first transaction data through the transaction execution prediction model, the target blockchain node can wait until the first transaction data is actually executed, and then obtain the transaction execution situation of the target blockchain node for the first transaction data; then determine the transaction execution loss value between the transaction execution situation and the transaction execution prediction situation corresponding to the target blockchain node, and adjust the model parameters of the transaction execution prediction model according to the transaction execution loss value to obtain the adjusted transaction execution prediction model. Among them, the transaction execution loss value can be determined by the loss function, which is a function that maps the value of a random event or its related random variable to a non-negative real number to represent the "risk" or "loss" of the random event, such as a cross entropy loss function, an exponential loss function, etc. The loss function can be selected based on the type of the transaction execution prediction model. It can be understood that the adjusted transaction execution prediction model can be used to predict new transaction data, and such a cycle iteration can make the prediction rate of the transaction execution prediction model higher and higher.

[0122] Step S103, sending the first transaction data to the target data shard component through the data distribution component; the target data shard component belongs to one or more data shard components associated with the target data subject service; the target data shard component is used to synchronize the first transaction data to the target blockchain node.

[0123] Specifically, the data distribution component can be the Producer in Kafka, which is responsible for distributing data to the Partition of the specified Topic. After the balancing component determines the target data topic service, it can notify the data distribution component. The data distribution component can determine one or more data shard components associated with the target data topic service, and then select the target data shard component from the one or more data shard components to store the first transaction data. The selection method can adopt a polling strategy or other custom strategies, which is not limited in this application.

[0124] Specifically, a feasible implementation process of sending the first transaction data to the target data shard component through the data distribution component may be: obtaining resource occupancy information corresponding to one or more data shard components associated with the target data subject service through the data distribution component; determining the data shard component with the smallest resource occupancy information as the target data shard component, and sending the first transaction data to the target data shard component. The resource occupancy information refers to the occupancy information of storage resources. In other words, the first transaction data is sent to the target data shard component with the smallest storage resource occupancy.

[0125] Specifically, a feasible implementation process of sending the first transaction data to the target data shard component through the data distribution component may be: obtaining the transaction hash corresponding to the first transaction data through the data distribution component, performing remainder processing on the transaction hash according to the number of components of one or more data shard components associated with the target data subject service, and obtaining a component serial number; determining the data shard component indicated by the component serial number as the target data shard component, and sending the first transaction data to the target data shard component. For ease of understanding, assuming that the target data subject service is associated with 3 data shard components, the first transaction hash is divided by 3, and the remainder obtained is the component serial number. Assuming that the component serial number is 2, the second data shard component is used as the target data shard component. By taking the remainder, the storage of transaction data can be made random and difficult to guess.

[0126] Optionally, when it is determined that the target data subject service meets the subscription synchronization condition, the transaction data in the one or more data shard components associated with the target data subject service whose transaction status is in an unsynchronized state is determined as the target transaction data; the target transaction data includes the first transaction data; the transaction status corresponding to the target transaction data is updated to a synchronized state; the target transaction data is sent to the target blockchain node so that the target blockchain node can verify the transaction of the target transaction data and then package the target transaction data into the block to be chained; the block to be chained is used to be written into the blockchain account book after passing the consensus of the blockchain node cluster. Among them, the subscription synchronization condition can be that the transaction data reception time reaches the synchronization cycle. If the synchronization cycle is one hour, the transaction pool cluster service node needs to synchronize the transaction data received within one hour to the target blockchain node once every hour. Among them, the subscription synchronization condition can also be that the cumulative number of newly stored transaction data reaches the number of synchronized transaction data. For example, if the number of synchronized transaction data is 10, when the transaction pool cluster service node newly stores 10 transaction data belonging to the target data subject service, these 10 transaction data can be used as target transaction data and then sent to the target blockchain node.

[0127] Through the method provided in the embodiment of the present application, the transaction data sent by the terminal is no longer sent directly to the blockchain node, but is received by the transaction pool cluster service node, thereby realizing the decoupling of the transaction data from the blockchain node, and then the transaction data is stored in the target data sharding component corresponding to the target blockchain node through the load balancing component and the data distribution component in the transaction pool cluster service node, and then the transaction data is synchronized to the target blockchain node through the target data sharding component, thereby realizing load balancing of the transaction data, avoiding excessive pressure on storage, computing and other resources of a single blockchain node and affecting the processing speed of the transaction data, thereby improving the performance of the entire blockchain network.

[0128] For further information, see Figure 4 , Figure 4 The flowchart of a data processing method based on blockchain provided by an embodiment of the present application is shown in FIG. The blockchain network includes a transaction pool cluster service node and a blockchain node cluster; the transaction pool cluster service node includes a data distribution component, a load balancing component, a data subject service associated with each blockchain node included in the blockchain node cluster, and one or more data sharding components associated with each data subject service; the method can be performed by the transaction pool cluster service node (for example, the above Figure 1 The transaction pool cluster service node 100 in the corresponding embodiment is executed. Hereinafter, the method will be described by taking the transaction pool cluster service node as an example, wherein the data processing method based on blockchain may at least include the following steps S201-S204:

[0129] Step S201, obtaining first transaction data sent by a first terminal, performing verification processing on the first transaction data, and obtaining a verification result.

[0130] Specifically, in order to ensure the security of the blockchain network, the transaction pool cluster service node can also be responsible for security verification of transaction data.

[0131] Specifically, the verification process may include a signature verification process, and the verification result at this time may include a decryption result. The signature verification process may be completed by a signature verification component, that is, the first transaction data is verified and processed, and a feasible implementation process to obtain the verification result may be: the signature data corresponding to the first transaction data is received by the signature verification component; the signature data is obtained by signing the first transaction data based on the transaction private key corresponding to the transaction object that initiated the first transaction data; in the signature verification component, the signature data is decrypted by the transaction public key corresponding to the transaction object to obtain the decryption result; if the decryption result is a successful decryption result, the verification result can be considered as a verification pass result, and step S202 can be executed; if the decryption result is a failed decryption result, a decryption failure notification message is sent to the transaction object. Among them, the public key and the private key are commonly known as asymmetric encryption methods. The public key is for everyone, that is, the transaction pool cluster service node can obtain the transaction public key of the transaction object; the transaction private key is private to the transaction object, and other nodes or other transaction objects cannot obtain the transaction private key of the transaction object. The transaction object uses its own private key to process the first transaction data. Since the private key is only owned by the transaction object, this generates a file that other transaction objects or nodes cannot generate, thus forming signature data. The transaction pool cluster service node knows that the first transaction data should be generated by the transaction object, so it can obtain the transaction public key, and then use the transaction public key to decrypt the signature data, that is, verify the signature, and obtain the signature verification result. The successful signature verification result indicates that the signature data was sent by the transaction object and has not been tampered with during the transmission process, so it can be determined that the first transaction data has been verified.

[0132] Specifically, the verification process may include the permission verification process, and the verification result at this time may include the permission verification result, and the permission verification process may be completed by the permission verification component. It can be understood that the first transaction data may include the initiating object information and the smart contract information, then the first transaction data is verified and processed, and a feasible implementation process for obtaining the verification result may be: in the permission verification component, the risk object information table is obtained; if the transaction initiating object information is found in the risk object information table, the risk warning information is sent to the transaction object; if the transaction initiating object is not found in the risk object information table, the contract call permission verification process is performed on the transaction initiating object information according to the smart contract information to obtain the permission verification result; if the permission verification result is the permission verification pass result, the verification result can be considered as the verification pass result, and step S202 can be executed; if the permission verification result is the permission verification failure result, the permission verification failure prompt information is sent to the transaction object. That is to say, before storing the first transaction data, the identity security of the transaction initiating object and the permission to call the smart contract can be verified first to prevent people with risks or without smart contract call permissions from arbitrarily calling smart contracts in the blockchain network. Among them, the risk object information table may include risk object information with risk, and the risk object information table may be updated at any time. Among them, the smart contract information may include a smart contract identifier, and then the transaction initiation object information is subjected to contract call permission verification processing according to the smart contract information, and a feasible implementation process for obtaining the permission verification result may be: obtaining a permission object list associated with the smart contract identifier, and if the transaction initiation object information is found in the permission object list, then determining that the permission verification result is a permission verification pass result; if the transaction initiation object information is not found in the permission object list, then determining that the permission verification result is a permission verification failure result. Among them, the permission object list contains object information with the permission to call the smart contract corresponding to the smart contract identifier.

[0133] Specifically, the verification process may include a weight verification process, and the verification result at this time may include a weight verification result, and the weight verification process may be completed by a weight verification component. It can be understood that a feasible implementation process of performing a verification process on the first transaction data to obtain a verification result may be: in the weight verification component, a transaction hash table is obtained; the transaction hash table contains the transaction hash corresponding to the transaction data stored in each data shard component; the first transaction hash corresponding to the first transaction data is determined, and the first transaction hash and the transaction hash table are weight verified to obtain a weight verification result; if the weight verification result indicates that the transaction hash table does not contain the first transaction hash, the verification result may be considered to be a verification pass result, and step S202 may be executed; if the weight verification result indicates that the transaction hash table contains the first transaction hash, a transaction duplication error prompt message is sent to the transaction object. It can be understood that the weight verification process is to avoid repeated storage of the same transaction data, so the transaction hash table composed of the transaction hash of the stored transaction data can be compared with the first transaction hash of the first transaction data to determine whether the same transaction data as the first transaction data has been stored. Among them, the transaction hash refers to the result obtained by performing a hash operation on the transaction data, and it should be understood that the transaction hashes corresponding to different transaction data are different.

[0134] Step S202: If the verification result is a passed verification result, the first transaction data is sent to a data distribution component and a load balancing component.

[0135] Step S203, in the load balancing component, load balancing selection processing is performed on the blockchain node cluster to obtain a target blockchain node, and the data subject service associated with the target blockchain node is determined as the target data subject service.

[0136] Step S204, sending the first transaction data to the target data shard component through the data distribution component; the target data shard component belongs to one or more data shard components associated with the target data subject service; the target data shard component is used to synchronize the first transaction data to the target blockchain node.

[0137] Specifically, the implementation process of step S202 to step S204 can refer to the above Figure 3 The specific description of steps S101 to S103 in the corresponding embodiment will not be repeated here.

[0138] Through the method proposed in the embodiment of the present application, the transaction pool cluster service node can verify the transaction data, such as signature verification, permission verification, and transaction duplication verification, so as to avoid duplication, insecurity and other problems in the transaction data in the blockchain network, thereby ensuring the security and uniqueness of the transaction data in the blockchain network.

[0139] Furthermore, in order to implement the above data processing method, the transaction pool cluster service node can adopt a separate blockchain transaction pool cluster service system architecture based on Kafka. The specific system architecture can be set according to the actual situation. For ease of understanding, please refer to Figure 5 , Figure 5 It is a schematic diagram of a separate blockchain transaction pool cluster service system architecture provided by an embodiment of the present application. Among them, the transaction pool cluster service is the core component of the separate blockchain transaction pool based on Kafka, which is responsible for receiving, processing, and distributing transaction data. It decouples the transaction pool from the blockchain node, improving the performance, scalability, and maintainability of the entire system. It can be understood that the transaction pool cluster service can be deployed in the transaction pool cluster service node.

[0140] like Figure 5 As shown, the transaction pool cluster service may include a network module. The network module is responsible for processing network communications with external terminals and blockchain nodes, and includes two submodules: transaction receiving and transaction sending. The transaction receiving submodule is responsible for receiving transaction requests (that is, the above-mentioned transaction data) from external terminals, such as smart contract calls such as transfers and evidence storage, and the received transaction data will be sent to the authentication module for verification. The transaction sending submodule is responsible for sending the processed transaction data to the blockchain node. In addition, it can also interact with the Kafka module to publish the transaction data to the specified Topic and Partition to achieve load balancing and data sharding.

[0141] like Figure 5 As shown, the transaction pool cluster service may also include an authentication module. The authentication module is responsible for verifying the security of transaction data, and may include submodules such as signature verification, permission verification, and transaction weight verification. Figure 4 The signature verification component described in the corresponding embodiment) is responsible for checking the digital signature of the transaction data to ensure the integrity and non-repudiation of the transaction. Figure 4 The authority verification component described in the corresponding embodiment) is responsible for checking the authority of the transaction initiator to ensure that he is qualified to execute the transaction. Figure 4 The weight verification component in the corresponding embodiment is responsible for confirming whether there are duplicate transactions and ensuring the uniqueness of the transaction.

[0142] like Figure 5As shown, the transaction pool cluster service may also include a high availability and load balancing module. The high availability and load balancing module is used to ensure the stability and performance of the transaction pool cluster service. It may include two sub-modules: load balancing and failover and recovery. Figure 3 The load balancing component described in the corresponding embodiment is responsible for dynamically allocating transactions to the most suitable nodes for execution according to the real-time status and transaction characteristics of the blockchain nodes, which helps to fully utilize the computing power of the blockchain nodes and achieve performance optimization and load balancing. Among them, the two sub-modules of failover and recovery are responsible for automatically switching to the backup service when the transaction pool cluster service fails to ensure the high availability of the system.

[0143] like Figure 5 As shown, the transaction pool cluster service may also include a detection module. The detection module is responsible for collecting and displaying the operating status and performance indicators of the transaction pool cluster service, and may include two submodules: indicator collection and detection display. The indicator collection submodule is responsible for periodically collecting various indicators of the transaction pool cluster service, such as transaction processing speed, latency, resource utilization, etc. These indicators can be used to evaluate the performance and stability of the system, as well as to perform fault diagnosis and troubleshooting. The detection display submodule is responsible for displaying the collected indicator data in the form of charts and reports to the operation and maintenance personnel, so as to facilitate real-time understanding of the operating status and performance of the system.

[0144] like Figure 5 As shown, the transaction pool cluster service can also include a Kafka module. The Kafka module is used to implement the publishing and subscription of transaction data. It sends the transaction data received from the network module to the Kafka Producer (i.e., the above Figure 3 The data distribution component described in the corresponding embodiment) is then stored in the specified Topic (i.e., the above-mentioned Figure 3 The data subject service described in the corresponding embodiment) and Partition (that is, the above Figure 3 In the data sharding component described in the corresponding embodiment).

[0145] To understand the above Kafka modules, please refer to Figure 6 , Figure 6 It is a structural diagram of a Kafka module provided in an embodiment of the present application.

[0146] like Figure 6As shown in the figure, the Kafka module can include a Producer component, which is responsible for sending the transaction data processed by the transaction pool cluster service to the Kafka cluster. It encapsulates the transaction data into messages and publishes the messages to the specified Kafka Topic. The Producer component can send messages to different Partitions based on the load balancing strategy.

[0147] like Figure 6 As shown, the Kafka module may include a Kafka cluster, and the Kafka cluster may include multiple Brokers (physical nodes), such as Broker1, Broker2, and Broker3. Different Brokers may include different Topics and Partitions. For the sake of simplicity, only Broker1 is used as an example for detailed introduction.

[0148] like Figure 6 As shown, Broker1 is a server instance in the Kafka cluster, responsible for storing and managing message data. Broker1 contains two Topics, namely Topic1 and Topic3, corresponding to blockchain node 1 and blockchain node 3 respectively.

[0149] Among them, Topic1 (corresponding to blockchain node 1) is a logical concept, which represents the transaction data related to blockchain node 1. It includes two partitions, namely Partition11 and Partition12. Among them, Partition11 is a data shard of Topic1 (that is, the above Figure 3 The data sharding component) is used to store transaction data related to blockchain node 1. Among them, the Partition12 copy (which is essentially also a data sharding component) is a backup of Partition12, which is used to achieve redundant storage and fault tolerance of data.

[0150] Among them, Topic3 ​​(corresponding to blockchain node 3) is a logical concept, which represents the transaction data related to blockchain node 3. It includes two partitions, namely Partition31 and Partition32. Partition31 is a data shard of Topic3 ​​(i.e. Figure 3 The data sharding component) is used to store transaction data related to blockchain node 3. Among them, the Partition32 copy (which is essentially also a data sharding component) is a backup of Partition32, which is used to achieve redundant storage and fault tolerance of data.

[0151] Depend on Figure 6It can be seen that a Topic can actually contain one or more Partitions, as well as the Partition replicas corresponding to each Partition. These Partitions can be deployed on the same or different Brokers. However, for fault tolerance, the Partition replicas corresponding to the Partition are usually not deployed on the same Broker.

[0152] Furthermore, through the data processing methods and the transaction pool cluster service proposed in the above embodiments, it is possible to send transaction data to the transaction pool cluster service, and then load balance it through the transaction pool cluster service, so as to allocate it to the corresponding Topic and Partition. Figure 7 , Figure 7 1 is a flow chart of a transaction data load balancing process provided by an embodiment of the present application. Figure 7 As shown, the entire transaction data load balancing process may include the following steps S301-S310:

[0153] Step S301: The terminal generates transaction data in response to the transaction operation of the transaction object.

[0154] Specifically, the terminal can be integrated with a client corresponding to the transaction pool cluster service. When the terminal runs the client, the transaction object can perform transaction operations through the client. The terminal can respond to the transaction operation and determine the contract, method and parameters that the transaction object wants to call. For example, if the transaction object wants to transfer money, the corresponding transfer contract, transfer amount, accounts of both parties to the transfer, etc. are determined, and then transaction data is generated according to the contract, method and parameters that the transaction object wants to call.

[0155] Step S302: The terminal performs signature processing on the transaction data to obtain signature data.

[0156] Specifically, the private key of the transaction object may be stored on the terminal, and the terminal may sign the transaction data using the private key to obtain signature data, which may be used to verify the integrity of the transaction data and the object to which it belongs.

[0157] Step S303: The terminal sends the transaction data and signature data to the transaction pool cluster service.

[0158] Specifically, the network module included in the transaction pool cluster service has a corresponding IP and port, so the terminal can send transaction data and signature data to the network module of the transaction pool cluster service.

[0159] Step S304: The network module of the transaction pool cluster service receives the transaction data and signature data.

[0160] Specifically, the communication of the transaction pool cluster service is implemented by the network module it contains. Therefore, the transaction pool cluster service can receive transaction data and signature data through the transaction receiving interface of the network module (ie, the above-mentioned transaction receiving submodule).

[0161] Step S305, the authentication module of the transaction pool cluster service performs transaction verification. If the transaction verification succeeds, step S306 is executed; if the transaction verification fails, step S310 is executed.

[0162] Specifically, from the above Figure 5 It can be seen that the authentication module can include a signature verification submodule, a permission verification submodule and a transaction weight verification submodule. Then, a feasible implementation process of the authentication module for transaction verification can be: first, the signature data is verified by the signature verification submodule. If the signature verification fails, it is determined that the transaction verification has failed; if the signature verification succeeds, the permission verification submodule is continued to perform permission verification on the transaction data. If the permission verification fails, it is determined that the transaction verification has failed. If the permission verification succeeds, the transaction weight verification submodule is continued to perform transaction weight verification on the transaction data. If the transaction weight verification fails, it is determined that the transaction verification has failed. If the transaction weight verification succeeds, it is determined that the transaction verification has succeeded. Among them, the implementation process of signature verification, permission verification and transaction weight verification can be referred to the above. Figure 4 The specific description of step S201 in the corresponding embodiment will not be repeated here. It can be understood that the verification order of the above-mentioned signature verification, authority verification and transaction weight verification can also be changed, and the transaction verification is considered to have failed as long as one of the verifications fails.

[0163] Optionally, the authentication module may also include a storage check component. After determining that the transaction verification is successful, it checks whether the existing storage of the transaction pool cluster service is sufficient. If it is sufficient, step S306 is executed. If it is not sufficient, an error of insufficient storage space can be directly returned to the terminal.

[0164] Step S306: The load balancing submodule of the transaction pool cluster service determines the target blockchain node.

[0165] Specifically, the load balancing submodule is the above-mentioned load balancing component, so the implementation process of step S306 can refer to the above-mentioned Figure 3 The specific description of step S102 in the corresponding embodiment will not be repeated here.

[0166] Step S307: The transaction pool cluster service sends the transaction data to the Kafka Producer and determines the target Topic corresponding to the target blockchain node.

[0167] Specifically, Kafka Producer is the above-mentioned data distribution component, and Topic is the above-mentioned data subject service. Therefore, the implementation process of step S307 can refer to the above-mentioned Figure 3 The specific description of step S103 in the corresponding embodiment will not be repeated here.

[0168] Step S308, the Producer determines the target Partition corresponding to the target Topic, and sends the transaction data to the corresponding Kafka Broker for storage.

[0169] In step S309, the target blockchain node acts as a Kafka Consumer and subscribes to the target Topic, thereby synchronizing the transaction data in the target Topic.

[0170] Specifically, usually one Topic corresponds to one blockchain node. However, according to actual conditions, multiple blockchain nodes can also subscribe to the same Topic, and this application does not limit this.

[0171] Step S310, sending an error prompt indicating transaction verification failure to the terminal.

[0172] Specifically, the error prompt for transaction verification failure may include an error prompt for signature verification failure, an error prompt for permission verification failure, and an error prompt for transaction duplication. It is only necessary to return the corresponding error prompt according to the specific error type.

[0173] Further, through Figure 7 After the process described in the corresponding embodiment allocates the transaction data to the corresponding Topic and Partition, the blockchain node can obtain the transaction data by subscribing to the Topic and initiate the uploading of the transaction data to the chain. For ease of understanding, please refer to Figure 8 , Figure 8 This is a schematic diagram of a process of uploading transaction data to a blockchain provided by an embodiment of the present application. Figure 8 As shown, the entire process of uploading transaction data to the blockchain may include the following steps S401 to S416:

[0174] Step S401: The blockchain node reads the configuration file and determines the Kafka topic that needs to be subscribed.

[0175] Specifically, when the blockchain node starts, it reads the configuration file and determines the Kafka topic that needs to be subscribed.

[0176] Step S402: The blockchain node initializes the Kafka Consumer client.

[0177] Specifically, the Kafka Consumer client can be integrated and installed in the blockchain node. After the blockchain node is started, the Kafka Consumer client will be started and initialized. It can be understood that through the Kafka Consumer client, the blockchain node can subscribe to one or more Topics included in the transaction pool cluster service. This application only takes a blockchain node subscribing to a Topic as an example, but in fact, it can also subscribe to multiple Topics.

[0178] Step S403: The Kafka Consumer client connects to the Kafka Broker, obtains metadata information of the subscribed Topic, and starts subscription consumption.

[0179] Specifically, the metadata information includes the partition information (i.e., Partition) and replica information corresponding to the subscription topic. The Kafka Consumer client can determine to obtain transaction data in some or all partitions in the subscription topic each time the subscription is synchronized based on the consumer grouping and load balancing strategy.

[0180] Step S404: Kafka Broker sends the transaction data in the subscribed Topic to the Kafka Consumer client.

[0181] Specifically, Kafka Broker can respond to the subscription partition request of the Kafka Consumer client and send the transaction data in the corresponding Partition in the subscribed Topic to the Kafka Consumer client.

[0182] Step S405: The Kafka Consumer client puts the transaction data into a local buffer.

[0183] Step S406: The blockchain node obtains transaction data from the local buffer.

[0184] Step S407: The blockchain node deserializes the transaction data and converts it into an internal transaction object.

[0185] Specifically, the terminal generates transaction data after serializing the contract, method, parameter and other information that the transaction object wants to call. The blockchain node needs to deserialize the transaction data first, determine the contract, method, parameter and other information that the transaction object wants to call, and identify it as an internal transaction object.

[0186] In step S408, the blockchain node performs transaction verification on the internal transaction object. If the transaction verification succeeds, step S409 is executed; if the transaction verification fails, step S416 is executed.

[0187] Specifically, the transaction verification of the internal transaction object by the blockchain node mainly includes basic verification, signature verification, business logic verification, and permission verification. In a feasible implementation process, the blockchain node can first perform basic verification on the transaction object, that is, determine whether the transaction format, signature, etc. are correct. If the basic verification fails, the transaction verification is determined to have failed, and no subsequent verification is required; if the basic verification succeeds, the internal transaction object that has passed the basic verification is placed in the transaction verification queue, waiting for further processing. Then, the blockchain node can take out the internal transaction object from the transaction verification queue and perform business logic verification on it, such as balance check, parameter verification, etc. If the business logic verification fails, the transaction verification is determined to have failed, and no subsequent verification is required; if the business logic verification succeeds, the internal transaction object is subjected to permission verification, such as determining whether the transaction object (the object that initiates the transaction data) is in the blacklist and whether it has the permission to call the transaction execution method. If the permission verification fails, the transaction verification is determined to have failed; if the permission verification succeeds, the transaction verification is determined to have succeeded.

[0188] Step S409: The blockchain node puts the internal transaction object into the transaction execution queue, waiting for execution.

[0189] In step S410, the blockchain node takes out the internal transaction object from the transaction execution queue and executes the corresponding business logic to obtain the transaction execution result.

[0190] Specifically, business logic refers to transfers, calling smart contracts, etc. It can be understood that the transaction execution results include successful transaction execution results and failed transaction execution results. Regardless of whether the transaction execution is successful or not, the blockchain node can send the transaction execution results to the block scheduling module.

[0191] Step S411: After receiving all transaction execution results, the block scheduling module of the blockchain node generates a block.

[0192] In step S412, the blockchain node sends the block to other blockchain nodes in the blockchain network.

[0193] In step S413, all blockchain nodes reach consensus on the block. If the consensus is successful, step S414 is executed; if the consensus fails, step S415 is executed.

[0194] Specifically, the implementation process of step S409 to step S413 can refer to the above Figure 4 The specific description of steps S202 to S204 in the corresponding embodiment will not be repeated here.

[0195] Step S414: All blockchain nodes store the block and update the data in the status database.

[0196] Step S415, the blockchain node returns an error indicating that the consensus verification failed.

[0197] Step S416, the blockchain node returns an error indicating that the transaction verification failed.

[0198] Specifically, transaction verification failure errors may include basic verification failure errors, signature verification failure errors, business logic verification failure errors, and permission verification failure errors. You only need to return the corresponding error based on the specific error type.

[0199] Furthermore, based on the above Figure 7 and Figure 8 The process described in the corresponding embodiment can combine transaction information and blockchain node status to predict node execution time and perform dynamic intelligent scheduling, that is, to predict transaction execution based on the transaction characteristics of transaction data and the operating status characteristics of blockchain nodes to determine the target blockchain node for executing transaction data. For ease of understanding, please refer to Fig. 9 , Fig. 9 This is a schematic diagram of a dynamic intelligent scheduling process provided by an embodiment of the present application. Fig. 9 As shown, the entire dynamic intelligent scheduling process may include the following steps S501 to S516:

[0200] Step S501: Each blockchain node starts a resource detection component to collect the real-time operating status of the blockchain node.

[0201] Specifically, a lightweight resource detection agent, i.e., a resource detection component, can be deployed in each blockchain node in the blockchain network to collect the real-time status of the node, such as CPU usage, memory usage, network bandwidth, execution time of each transaction, and resource consumption.

[0202] Step S502: The resource detection component periodically reports the operation status information of the blockchain node to the transaction pool cluster service.

[0203] Step S503: The transaction pool cluster service stores the received operation status information.

[0204] Specifically, the transaction pool cluster service may store the received operating status information in a data structure, such as a hash table or a database.

[0205] Step S504: After receiving the transaction data through the network module, the transaction pool cluster service performs transaction verification through the authentication module. After successful verification, step S505 is executed.

[0206] Specifically, the implementation process of step S504 can refer to the above Figure 7The specific description of step S305 in the corresponding embodiment will not be repeated here.

[0207] Step S505: The load balancing submodule of the transaction pool cluster service performs feature extraction processing on the transaction data to obtain transaction features.

[0208] Specifically, the load balancing submodule extracts features from transaction data, which may include transaction type, contract name, calling method, parameters, and other features.

[0209] Step S506: The load balancing submodule obtains the stored operation status information of the blockchain node, performs feature extraction processing on the operation status information, and obtains the operation status feature.

[0210] Step S507: The load balancing submodule uses the trained transaction execution prediction model to perform transaction execution prediction processing to obtain the transaction execution prediction status of the blockchain node.

[0211] Step S508: The load balancing submodule selects a target blockchain node based on the transaction execution prediction of each blockchain node.

[0212] Specifically, the implementation process of step S505 to step S508 can be referred to above. Figure 3 The specific description of step S102 in the corresponding embodiment will not be repeated here.

[0213] Step S509: The transaction pool cluster service sends the transaction data to the Kafka Producer and determines the target Topic corresponding to the target blockchain node.

[0214] In step S510, the Producer determines the target Partition corresponding to the target Topic and sends the transaction data to the corresponding Kafka Broker for storage.

[0215] In step S511, the target blockchain node acts as a Kafka Consumer and subscribes to the target Topic, thereby synchronizing the transaction data in the target Topic.

[0216] Specifically, the implementation process of step S509 to step S511 can refer to the above Figure 7 The specific description of steps S307 to S309 in the corresponding embodiment will not be repeated here.

[0217] Step S512: After receiving the transaction data, the target blockchain node further verifies and processes it.

[0218] Step S513: The transaction and transaction execution results after execution by the target blockchain node are packaged into a block, and the block is sent to other blockchain nodes.

[0219] Step S514: When all blockchain nodes reach a consensus, the block is written into the blockchain to confirm that the transaction data has been executed.

[0220] Specifically, the implementation process of step S512 to step S514 can refer to the above Figure 8 The specific description of steps S404 to S414 in the corresponding embodiment will not be repeated here.

[0221] Step S515: The target blockchain node records the execution time and resource consumption of the transaction data to the resource detection component.

[0222] Step S516: the transaction pool cluster service modifies the transaction execution prediction model according to the execution time and resource consumption records of the transaction data sent by the resource detection component.

[0223] Specifically, the implementation process of step S516 can refer to the above Figure 3 The optional description of step S102 in the corresponding embodiment will not be repeated here.

[0224] By managing the transaction data in the blockchain network through the Kafka-based separated blockchain transaction pool cluster service system architecture proposed in the embodiment of the present application, the decoupling between the transaction pool and the node can be achieved, and the storage and verification pressure of the node is too high to affect the performance of the blockchain. In addition, the transaction pool is realized through the Kafka architecture, and the load balancing and dynamic allocation of blockchain nodes and transaction data are realized by reasonably allocating Topic and Partition, avoiding the single point pressure of blockchain nodes. In addition, the present application also proposes an intelligent scheduling scheme based on machine learning, which continuously obtains the state of the node through the resource detection component of the blockchain node, and combines the transaction information as the parameter of the model for training, and continuously adjusts and optimizes the model by comparing the predicted results with the actual results. In summary, the separated blockchain transaction pool cluster service based on Kafka has the advantages of high throughput, low latency, load balancing, resource optimization, easy expansion and maintenance, etc., which can effectively improve the disadvantages of the traditional transaction pool in the node and provide higher performance and better scalability for the blockchain network.

[0225] See also Fig.10 , Fig.101 is a schematic diagram of the structure of a blockchain-based data processing device provided in an embodiment of the present application. The data processing device may be a computer program (including program code) running on a computer device, for example, the data processing device is an application software; the data processing device 1 may be used to execute the corresponding steps in the data processing method provided in an embodiment of the present application. Fig.10 As shown, the data processing device 1 may include: an acquisition module 11, a node selection module 12 and a shard selection module 13.

[0226] An acquisition module 11 is used to acquire first transaction data sent by the first terminal, and send the first transaction data to the data distribution component and the load balancing component;

[0227] The node selection module 12 is used to perform load balancing selection processing on the blockchain node cluster in the load balancing component, obtain the target blockchain node, and determine the data subject service associated with the target blockchain node as the target data subject service;

[0228] The shard selection module 13 is used to send the first transaction data to the target data shard component through the data distribution component; the target data shard component belongs to one or more data shard components associated with the target data subject service; the target data shard component is used to synchronize the first transaction data to the target blockchain node.

[0229] The specific implementation of the acquisition module 11, the node selection module 12 and the shard selection module 13 can be found in the above Figure 3 The specific description of step S101 to step S103 in the corresponding embodiment will not be repeated here.

[0230] The node selection module 12 includes: a feature extraction unit 121 , a prediction unit 122 , a weighting unit 123 and a first determination unit 124 .

[0231] The feature extraction unit 121 is used to perform feature extraction processing on the first transaction data in the load balancing component to obtain transaction features corresponding to the first transaction data;

[0232] The prediction unit 122 is used to perform transaction execution prediction processing on each blockchain node according to the operation status characteristics and transaction characteristics corresponding to each blockchain node, and obtain the transaction execution prediction situation corresponding to each blockchain node; the transaction execution prediction situation includes the transaction execution prediction time and the transaction execution prediction occupied resources;

[0233] A weighting unit 123 is used to perform weighted sum processing on the transaction execution prediction time and transaction execution prediction occupied resources corresponding to each blockchain node, and determine the transaction execution score corresponding to each blockchain node;

[0234] The first determination unit 124 is used to determine the blockchain node with the smallest transaction execution score as the target blockchain node.

[0235] The specific implementation of the feature extraction unit 121, the prediction unit 122, the weighting unit 123 and the first determination unit 124 can refer to the above Figure 3 The specific description of step S102 in the corresponding embodiment will not be repeated here.

[0236] The prediction unit 122 includes: an acquisition subunit 1221 and a prediction subunit 1222 .

[0237] An acquisition subunit 1221 is used to acquire a transaction execution prediction model; the transaction execution prediction model is obtained by performing reinforcement learning training on an initial execution prediction model based on at least two historical transaction data samples and historical operation status feature samples;

[0238] The prediction subunit 1222 is used to input the operating status characteristics and transaction characteristics corresponding to each blockchain node into the transaction execution prediction model respectively, so as to obtain the transaction execution prediction situation corresponding to each blockchain node.

[0239] The specific implementation of the acquisition subunit 1221 and the prediction subunit 1222 can be found in the above Figure 3 The specific description of step S102 in the corresponding embodiment will not be repeated here.

[0240] The data processing device 1 further includes a situation acquisition module 14 and a model adjustment module 15 .

[0241] A situation acquisition module 14 is used to obtain the transaction execution situation of the target blockchain node for the first transaction data;

[0242] The model adjustment module 15 is used to determine the transaction execution loss value between the transaction execution situation and the transaction execution prediction situation corresponding to the target blockchain node, and adjust the model parameters of the transaction execution prediction model according to the transaction execution loss value to obtain the adjusted transaction execution prediction model.

[0243] The specific implementation of the situation acquisition module 14 and the model adjustment module 15 can be found in the above Figure 3 The optional description of step S102 in the corresponding embodiment will not be repeated here.

[0244] The node selection module 12 includes: a second determination unit 125 .

[0245] The second determining unit 125 is used to determine the historical blockchain node identifier in the load balancing component; the historical blockchain node identifier is the blockchain node identifier corresponding to the blockchain node selected by the previous round of load balancing selection processing;

[0246] The second determination unit 125 is further used to obtain the blockchain node identifier adjacent to the historical blockchain node identifier according to the blockchain node identifier sequence corresponding to the blockchain node cluster as the target blockchain node identifier;

[0247] The second determination unit 125 is further used to determine the blockchain node corresponding to the target blockchain node identifier as the target blockchain node.

[0248] The specific implementation of the second determining unit 125 can refer to the above Figure 3 The specific description of step S102 in the corresponding embodiment will not be repeated here.

[0249] The shard selection module 13 includes: a first selection unit 131 .

[0250] The first selection unit 131 is used to obtain resource occupancy information corresponding to one or more data sharding components associated with the target data subject service through the data distribution component;

[0251] The first selection unit 131 is further configured to determine the data shard component with the smallest resource occupancy information as the target data shard component, and send the first transaction data to the target data shard component.

[0252] The specific implementation of the first selection unit 131 can refer to the above Figure 3 The specific description of step S103 in the corresponding embodiment will not be repeated here.

[0253] The shard selection module 13 includes: a second selection unit 132 .

[0254] The second selection unit 132 is used to obtain the transaction hash corresponding to the first transaction data through the data distribution component, and perform modulo processing on the transaction hash according to the number of components of one or more data shard components associated with the target data subject service to obtain a component sequence number;

[0255] The second selection unit 132 is further configured to determine the data shard component indicated by the component serial number as the target data shard component, and send the first transaction data to the target data shard component.

[0256] The specific implementation of the second selection unit 132 can refer to the above Figure 3 The specific description of step S103 in the corresponding embodiment will not be repeated here.

[0257] Wherein, the above-mentioned data processing device 1 further includes: a data synchronization module 16.

[0258] The data synchronization module 16 is used to determine the transaction data in the one or more data shard components associated with the target data subject service, whose transaction status is in an unsynchronized state, as the target transaction data when it is determined that the target data subject service meets the subscription synchronization condition; the target transaction data includes the first transaction data;

[0259] The data synchronization module 16 is further used to update the transaction status corresponding to the target transaction data to a synchronization status;

[0260] The data synchronization module 16 is also used to send the target transaction data to the target blockchain node, so that the target blockchain node can verify the target transaction data and then package the target transaction data into the block to be chained; the block to be chained is used to be written into the blockchain ledger after passing the consensus of the blockchain node cluster.

[0261] The specific implementation of the data synchronization module 16 can be found in the above Figure 3 The optional description of step S103 in the corresponding embodiment will not be repeated here.

[0262] Among them, the transaction pool cluster service node also includes a signature verification component;

[0263] The above data processing device 1 further includes: a signature verification module 17 .

[0264] The signature verification module 17 is used to receive the signature data corresponding to the first transaction data through the signature verification component; the signature data is obtained by signing the first transaction data based on the transaction private key corresponding to the transaction object that initiated the first transaction data;

[0265] The signature verification module 17 is also used to decrypt the signature data in the signature verification component by using the transaction public key corresponding to the transaction object to obtain a decryption result;

[0266] The signature verification module 17 is further configured to execute the step of sending the first transaction data to the data distribution component and the load balancing component if the decryption result is a successful decryption result;

[0267] The signature verification module 17 is further configured to send a signature failure notification message to the transaction object if the signature decoding result is a signature decoding failure result.

[0268] The specific implementation of the signature verification module 17 can be found in the above Figure 4 The specific description of step S201 in the corresponding embodiment will not be repeated here.

[0269] The first transaction data includes transaction initiator information and smart contract information; the transaction pool cluster service node also includes an authority verification component;

[0270] The above-mentioned data processing device 1 further includes: an authority verification module 18 .

[0271] The authority verification module 18 is used to obtain the risk object information table in the authority verification component;

[0272] The authority verification module 18 is also used to send risk warning information to the transaction object if the transaction initiating object information is found in the risk object information table;

[0273] The authority verification module 18 is also used to perform contract call authority verification processing on the transaction initiation object information according to the smart contract information if the transaction initiation object is not found in the risk object information table to obtain an authority verification result;

[0274] The authority verification module 18 is further configured to execute the step of sending the first transaction data to the data distribution component and the load balancing component if the authority verification result is a result of passing the authority verification;

[0275] The authority verification module 18 is further configured to send an authority verification failure prompt message to the transaction object if the authority verification result is an authority verification failure result.

[0276] The specific implementation of the authority verification module 18 can be found in the above Figure 4 The specific description of step S201 in the corresponding embodiment will not be repeated here.

[0277] Among them, the transaction pool cluster service node also includes a weight verification component;

[0278] The data processing device 1 further includes a weight verification module 19 .

[0279] The weight verification module 19 is used to obtain a transaction hash table in the weight verification component; the transaction hash table contains the transaction hash corresponding to the transaction data stored in each data shard component;

[0280] The weight verification module 19 is further used to determine the first transaction hash corresponding to the first transaction data, perform weight verification on the first transaction hash and the transaction hash table, and obtain a weight verification result;

[0281] The weight verification module 19 is further configured to execute the step of sending the first transaction data to the data distribution component and the load balancing component if the weight verification result indicates that the transaction hash table does not contain the first transaction hash;

[0282] The weight verification module 19 is further configured to send a transaction duplication error prompt message to the transaction object if the weight verification result indicates that the transaction hash table contains the first transaction hash.

[0283] The specific implementation of the weight verification module 19 can be found in the above Figure 4 The specific description of step S201 in the corresponding embodiment will not be repeated here.

[0284] See also Fig.11 , Fig.11 Schematic diagram of the structure of a computer device provided in an embodiment of the present application. Fig.11 As shown above Fig.10 The data processing device 1 in the corresponding embodiment can be applied to a computer device 1000, and the computer device 1000 may include: a processor 1001, a network interface 1004 and a memory 1005. In addition, the above-mentioned computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. Among them, the user interface 1003 may include a display screen (Display), a keyboard (Keyboard), and the user interface 1003 may optionally include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or it may be a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1005 may optionally also be at least one storage device located away from the aforementioned processor 1001. As Fig.11 As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.

[0285] In such Fig.11 In the computer device 1000 shown, the network interface 1004 can provide a network communication network element; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:

[0286] Acquire first transaction data sent by the first terminal, and send the first transaction data to the data distribution component and the load balancing component;

[0287] In the load balancing component, a load balancing selection process is performed on the blockchain node cluster to obtain a target blockchain node, and a data subject service associated with the target blockchain node is determined as a target data subject service;

[0288] The first transaction data is sent to the target data shard component through the data distribution component; the target data shard component belongs to one or more data shard components associated with the target data subject service; the target data shard component is used to synchronize the first transaction data to the target blockchain node.

[0289] It should be understood that the computer device 1000 described in the embodiment of the present application can execute the above Figure 3 , Figure 4 The description of the data processing method in any corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated here.

[0290] In addition, it should be pointed out here that: the embodiment of the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program executed by the data processing device 1 mentioned above, and the computer program includes program instructions. When the processor executes the program instructions, the computer program can execute the above-mentioned data processing device 1. Figure 3 , Figure 4 The description of the above data processing method in any corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application.

[0291] The computer-readable storage medium may be the data processing device provided in any of the aforementioned embodiments or the internal storage unit of the computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (smart media card, SMC), a secure digital (secure digital, SD) card, a flash card (flash card), etc. equipped on the computer device. Further, the computer-readable storage medium may also include both the internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.

[0292] In addition, it should be noted that: the embodiment of the present application also provides a computer program product or a computer program, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above Figure 3 , Figure 4Any method provided by the corresponding embodiment.

[0293] The terms "first", "second", etc. in the description, claims, and drawings of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, device, product, or equipment that includes a series of steps or units is not limited to the listed steps or modules, but optionally includes steps or modules that are not listed, or optionally includes other step units inherent to these processes, methods, devices, products, or equipment.

[0294] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of network elements in the above description. Whether these network elements are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described network elements for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0295] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A data processing method based on blockchain, characterized in that: The blockchain network includes a transaction pool cluster service node and a blockchain node cluster; the transaction pool cluster service node includes a data distribution component, a load balancing component, a data subject service associated with each blockchain node included in the blockchain node cluster, and one or more data sharding components associated with each data subject service; The method is executed by a transaction pool cluster service node; the method comprises: Acquire first transaction data sent by the first terminal, and send the first transaction data to the data distribution component and the load balancing component; In the load balancing component, load balancing selection processing is performed on the blockchain node cluster to obtain a target blockchain node, and a data subject service associated with the target blockchain node is determined as a target data subject service; The first transaction data is sent to a target data shard component through the data distribution component; the target data shard component belongs to one or more data shard components associated with the target data subject service; the target data shard component is used to synchronize the first transaction data to the target blockchain node.

2. The method according to claim 1, characterized in that In the load balancing component, the blockchain node cluster is subjected to load balancing selection processing to obtain a target blockchain node, including: In the load balancing component, feature extraction processing is performed on the first transaction data to obtain transaction features corresponding to the first transaction data; According to the operation status characteristics corresponding to each blockchain node and the transaction characteristics, transaction execution prediction processing is performed on each blockchain node respectively to obtain the transaction execution prediction situation corresponding to each blockchain node; the transaction execution prediction situation includes the transaction execution prediction time and the transaction execution prediction occupied resources; Perform weighted sum processing on the transaction execution prediction time and transaction execution prediction occupied resources corresponding to each blockchain node, and determine the transaction execution score corresponding to each blockchain node; The blockchain node with the smallest transaction execution score is determined as the target blockchain node.

3. The method according to claim 2, characterized in that The step of performing transaction execution prediction processing on each blockchain node according to the operation status characteristics corresponding to each blockchain node and the transaction characteristics to obtain the transaction execution prediction situation corresponding to each blockchain node includes: Obtaining a transaction execution prediction model; the transaction execution prediction model is obtained by performing reinforcement learning training on an initial execution prediction model based on at least two historical transaction data samples and historical operation status feature samples; The operating status characteristics corresponding to each blockchain node and the transaction characteristics are respectively input into the transaction execution prediction model to obtain the transaction execution prediction situation corresponding to each blockchain node.

4. The method according to claim 3, characterized in that Also includes: Obtaining transaction execution status of the target blockchain node for the first transaction data; Determine a transaction execution loss value between the transaction execution situation and the transaction execution prediction situation corresponding to the target blockchain node, adjust the model parameters of the transaction execution prediction model according to the transaction execution loss value, and obtain an adjusted transaction execution prediction model.

5. The method according to claim 1, characterized in that: In the load balancing component, the blockchain node cluster is subjected to load balancing selection processing to obtain a target blockchain node, including: In the load balancing component, a historical blockchain node identifier is determined; the historical blockchain node identifier is a blockchain node identifier corresponding to the blockchain node selected by the previous round of load balancing selection processing; According to the blockchain node identification sequence corresponding to the blockchain node cluster, obtain the blockchain node identification adjacent to the historical blockchain node identification as the target blockchain node identification; The blockchain node corresponding to the target blockchain node identifier is determined as the target blockchain node.

6. The method according to claim 1, characterized in that The step of sending the first transaction data to a target data sharding component through the data distribution component includes: Obtaining resource occupancy information corresponding to one or more data sharding components associated with the target data subject service through the data distribution component; The data shard component with the smallest resource occupancy information is determined as the target data shard component, and the first transaction data is sent to the target data shard component.

7. The method according to claim 1, characterized in that The step of sending the first transaction data to a target data sharding component through the data distribution component includes: Obtaining, through the data distribution component, a transaction hash corresponding to the first transaction data, and performing modulo processing on the transaction hash according to the number of components of one or more data shard components associated with the target data subject service to obtain a component serial number; The data shard component indicated by the component serial number is determined as the target data shard component, and the first transaction data is sent to the target data shard component.

8. The method according to claim 1, characterized in that: Also includes: When it is determined that the target data subject service meets the subscription synchronization condition, the transaction data in the one or more data shard components associated with the target data subject service whose transaction status is in an unsynchronized state is determined as the target transaction data; the target transaction data includes the first transaction data; Updating the transaction status corresponding to the target transaction data to a synchronization status; Sending the target transaction data to the target blockchain node, so that the target blockchain node verifies the target transaction data and then packages the target transaction data into a block to be uploaded to the blockchain; The block to be chained is used to be written into the blockchain ledger after passing the consensus of the blockchain node cluster.

9. The method according to claim 1, characterized in that: The transaction pool cluster service node further includes a signature verification component; the method further includes: receiving, by the signature verification component, signature data corresponding to the first transaction data; the signature data being obtained by signing the first transaction data based on a transaction private key corresponding to a transaction object initiating the first transaction data; In the signature verification component, the signature data is decrypted using the transaction public key corresponding to the transaction object to obtain a decryption result; If the result of the decryption is a successful decryption result, the step of sending the first transaction data to the data distribution component and the load balancing component is executed; If the result of the decryption is a decryption failure, a decryption failure notification message is sent to the transaction object.

10. The method according to claim 1, characterized in that The first transaction data includes transaction initiator information and smart contract information; the transaction pool cluster service node also includes an authority verification component; the method further includes: In the authority verification component, a risk object information table is obtained; If the transaction initiating object information is found in the risk object information table, risk warning information is sent to the transaction object; If the transaction initiating object is not found in the risk object information table, the contract call permission verification process is performed on the transaction initiating object information according to the smart contract information to obtain a permission verification result; If the authority verification result is an authority verification pass result, executing the step of sending the first transaction data to the data distribution component and the load balancing component; If the authority verification result is an authority verification failure result, a permission verification failure prompt message is sent to the transaction object.

11. The method according to claim 1, characterized in that The transaction pool cluster service node further includes a weight verification component; the method further includes: In the weight verification component, a transaction hash table is obtained; the transaction hash table contains transaction hashes corresponding to the transaction data stored in each data shard component; Determine a first transaction hash corresponding to the first transaction data, and perform a weight verification process on the first transaction hash and the transaction hash table to obtain a weight verification result; If the weight verification result indicates that the transaction hash table does not contain the first transaction hash, executing the step of sending the first transaction data to the data distribution component and the load balancing component; If the weight verification result indicates that the transaction hash table contains the first transaction hash, a transaction duplication error prompt message is sent to the transaction object.

12. A data processing device based on blockchain, characterized in that: The blockchain network includes a transaction pool cluster service node and a blockchain node cluster; the transaction pool cluster service node includes a data distribution component, a load balancing component, a data subject service associated with each blockchain node included in the blockchain node cluster, and one or more data sharding components associated with each data subject service; The device is run by a transaction pool cluster service node; the device includes: An acquisition module, configured to acquire first transaction data sent by a first terminal, and send the first transaction data to a data distribution component and a load balancing component; A node selection module is used to perform load balancing selection processing on the blockchain node cluster in the load balancing component to obtain a target blockchain node, and determine the data subject service associated with the target blockchain node as the target data subject service; A shard selection module is used to send the first transaction data to a target data shard component through the data distribution component; the target data shard component belongs to one or more data shard components associated with the target data subject service; the target data shard component is used to synchronize the first transaction data to the target blockchain node.

13. A computer device, characterized in that: include: Processor, memory, and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide a data communication function, the memory is used to store program code, and the processor is used to call the program code to execute the method described in any one of claims 1-11.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the method according to any one of claims 1 to 11.

15. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 11 can be performed.