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

By detecting anomalous behavior in the blockchain network and generating punitive transactions, the problem of reducing the cost of malicious behavior by anomalous devices is solved, thereby improving network security.

CN116074027BActive Publication Date: 2025-11-25TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111287426.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-02
Publication Date
2025-11-25
Estimated Expiration
2041-11-02

AI Technical Summary

Technical Problem

In a blockchain network, malfunctioning network devices may reduce the cost of malicious behavior for malicious nodes, thereby reducing the security of the network.

Method used

By detecting abnormal behavior of business nodes, penalty parameters and penalty transactions are generated to increase the cost of malicious behavior for malicious nodes. The penalty task notification is forwarded by the routing node to execute the penalty removal process.

Benefits of technology

It improves the operational security of the blockchain network by punishing abnormal behavior, increasing the cost for malicious nodes, and enhancing network security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116074027B_ABST
    Figure CN116074027B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on blockchain data processing method, equipment and readable storage medium, the method includes: when business abnormal behavior set satisfies business punishment condition, obtain the punishment difficulty corresponding to business abnormal behavior set from business punishment gradient rule;Business abnormal behavior set, punishment parameter and punishment difficulty are used to generate punishment transaction;Punishment transaction is chained, and punishment task notification carrying punishment parameter and punishment difficulty is sent to routing node, so that routing node forwards punishment task notification to business node when obtaining the business request initiated by business node;Punishment task notification is used to indicate business node to execute the removal punishment processing associated with punishment parameter and punishment difficulty.Using the present application, the evil node can improve the evil cost and improve the operation security of blockchain network.The present application embodiment can be applied to cloud technology, artificial intelligence, intelligent transportation, assisted driving and various scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the rapid development of network technology and enterprises' emphasis on data security, blockchain has received great attention and application.

[0003] Currently, blockchain networks use a unified peer-to-peer (P2P) approach for data acquisition, consensus, and storage. However, in real-world scenarios, blockchain nodes in public networks may be accessed by malicious network devices, thus reducing the cost of malicious behavior for malicious nodes and consequently lowering the operational security of the blockchain network. Summary of the Invention

[0004] This application provides a blockchain-based data processing method, device, and readable storage medium, which can increase the cost of malicious nodes and thus improve the operational security of the blockchain network.

[0005] One embodiment of this application provides a blockchain-based data processing method, including:

[0006] When the first consensus node detects that the set of abnormal business behaviors of a business node meets the business penalty conditions, it obtains the penalty difficulty corresponding to the set of abnormal business behaviors from the business penalty gradient rules and generates penalty parameters for the business node.

[0007] Based on the set of abnormal business behaviors, penalty parameters, and penalty difficulty, penalty transactions are generated for business nodes.

[0008] Penalized transactions are processed on the blockchain. When a penalized transaction is successfully processed on the blockchain, a penalty task notification carrying penalty parameters and penalty difficulty is sent to the routing node. This allows the routing node to forward the penalty task notification to the business node when it receives a business request initiated by the business node. The penalty task notification is used to instruct the business node to perform the penalty removal process associated with the penalty parameters and penalty difficulty.

[0009] One embodiment of this application provides a blockchain-based data processing method, including:

[0010] When a routing node detects that the set of abnormal connection behaviors of a service node meets the connection penalty conditions, it retrieves the connection permissions corresponding to the set of abnormal connection behaviors from the connection penalty gradient rules.

[0011] Upon receiving a business request from a business node, based on connection permissions, the penalty task notification sent by the target consensus node when the penalty transaction is successfully uploaded to the chain is forwarded to the business node. This enables the business node to execute a penalty removal process associated with the penalty parameters and penalty difficulty according to the penalty task notification. The penalty task notification carries the penalty parameters and penalty difficulty. The penalty difficulty is obtained from the business penalty gradient rules when the target consensus node detects that the set of abnormal business behaviors of the business node meets the business penalty conditions, and the penalty difficulty is correlated with the set of abnormal business behaviors. The penalty parameters are generated by the target consensus node for the business node. The penalty transaction is generated based on the set of abnormal business behaviors, the penalty parameters, and the penalty difficulty.

[0012] One embodiment of this application provides a blockchain-based data processing device, including:

[0013] The first generation module is used to obtain the penalty difficulty corresponding to the set of abnormal business behaviors from the business penalty gradient rules and generate penalty parameters for the business node when the first consensus node detects that the set of abnormal business behaviors of the business node meets the business penalty conditions.

[0014] The first generation module is also used to generate penalty transactions for business nodes based on the set of abnormal business behaviors, penalty parameters, and penalty difficulty.

[0015] The transaction on-chain module is used to process penalty transactions on the blockchain. When a penalty transaction is successfully on-chain, a penalty task notification carrying penalty parameters and penalty difficulty is sent to the routing node. This allows the routing node to forward the penalty task notification to the business node when it receives a business request initiated by the business node. The penalty task notification is used to instruct the business node to perform penalty removal processing associated with the penalty parameters and penalty difficulty.

[0016] The blockchain-based data processing device also includes:

[0017] The first acquisition module is used to acquire transaction data to be uploaded to the blockchain that is forwarded by the routing node; the transaction data to be uploaded to the blockchain is initiated by the business node.

[0018] The second generation module is used to perform business verification on the transaction data to be uploaded to the blockchain and obtain the business verification result. The business verification result includes a first business verification result or a second business verification result. The first business verification result is used to indicate that there is an error in the transaction data to be uploaded to the blockchain. The second business verification result is used to indicate that there is no error in the transaction data to be uploaded to the blockchain.

[0019] The second generation module is also used to determine that if the business verification result is the first business verification result, the business node has a business abnormal behavior of the first business abnormal type, and add the business abnormal behavior of the first business abnormal type to the business abnormal behavior set for the business node.

[0020] The second generation module is also used to process the transaction data to be uploaded to the blockchain if the business verification result is the second business verification result.

[0021] The blockchain-based data processing device also includes:

[0022] The second acquisition module is used to acquire the transaction data to be uploaded to the blockchain forwarded by the routing node and generate the hash value to be detected for the transaction data to be uploaded to the blockchain; the transaction data to be uploaded to the blockchain is initiated by the business node;

[0023] The second acquisition module is also used to acquire a list of historical blocks that have been uploaded to the blockchain, and to acquire historical block information in the block list; the historical block information includes historical hash values, which refer to the hash values ​​of transaction data in historical blocks;

[0024] The second acquisition module is also used to match historical hash values ​​with the hash value to be detected to obtain a matching result; the matching result includes a first matching result or a second matching result; the first matching result is used to indicate that there is a historical hash value that is the same as the hash value to be detected; the second matching result is used to indicate that all historical hash values ​​are different from the hash value to be detected.

[0025] The second acquisition module is also used to determine, if the matching result is the first matching result, that the business node has a business abnormal behavior of the second business abnormal type, and to add the business abnormal behavior of the second business abnormal type to the business abnormal behavior set for the business node.

[0026] The second acquisition module is also used to process the transaction data to be uploaded to the blockchain if the matching result is the second matching result.

[0027] The blockchain-based data processing device also includes:

[0028] The third generation module is used to obtain the transaction data to be uploaded to the blockchain forwarded by the routing node; the transaction data to be uploaded to the blockchain is initiated by the business node; the transaction data to be uploaded to the blockchain carries contract information;

[0029] The third generation module is also used to call the transaction execution function in the smart contract to execute the transaction data to be uploaded to the chain through contract information;

[0030] The third generation module is also used to execute the transaction data to be uploaded to the blockchain according to the transaction execution function, and obtain the transaction execution result for the transaction data to be uploaded to the blockchain; the transaction execution result includes a first transaction execution result or a second transaction execution result; the first transaction execution result is used to indicate that the execution of the transaction data to be uploaded to the blockchain failed; the second transaction execution result is used to indicate that the execution of the transaction data to be uploaded to the blockchain was successful.

[0031] The third generation module is also used to determine if the transaction execution result is the first transaction execution result, and to add the business abnormal behavior belonging to the third business abnormal type to the business abnormal behavior set for the business node.

[0032] The third generation module is also used to process the transaction data to be uploaded to the blockchain if the transaction execution result is the second transaction execution result.

[0033] The blockchain-based data processing device also includes:

[0034] The first determination module is used to determine the target total number of target transaction data forwarded by the routing node and the first total number of business abnormal behaviors in the set of business abnormal behaviors when the business system time reaches the business heartbeat cycle; the target transaction data is initiated by the business node.

[0035] The first determining module is also used to determine the ratio of the number of services to be mapped between the first total number and the target total number. If the ratio of the number of services to be mapped is greater than the service number ratio threshold, then the set of abnormal business behaviors of the service node is determined to meet the business penalty conditions.

[0036] The first generation module includes:

[0037] The first acquisition unit is used to acquire the business penalty gradient rule; the business penalty gradient rule includes the business quantity ratio and the penalty difficulty that has a mapping relationship with the business quantity ratio; the business quantity ratio includes the business quantity ratio to be mapped;

[0038] The second acquisition unit is used to obtain the penalty difficulty that has a mapping relationship with the proportion of the number of businesses to be mapped from the business penalty gradient rules, and use it as the initial penalty difficulty.

[0039] The third acquisition unit is used to acquire the historical penalty difficulty of the business node, and determine the penalty difficulty based on the historical penalty difficulty and the initial penalty difficulty.

[0040] The third acquisition unit includes:

[0041] The first acquisition subunit is used to acquire the first generation timestamp of the historical penalty difficulty and the second generation timestamp of the initial penalty difficulty; the first generation timestamp is earlier than the second generation timestamp.

[0042] The second acquisition subunit is used to determine the time interval between the first generated timestamp and the second generated timestamp, and compare the time interval with the time interval threshold.

[0043] The first enhancement subunit is used to positively enhance the historical penalty difficulty based on the initial penalty difficulty if the time interval is less than or equal to the time interval threshold, so as to obtain the penalty difficulty.

[0044] The second enhancement subunit is used to reverse-enhance the historical penalty difficulty based on the initial penalty difficulty if the time interval is greater than the time interval threshold, so as to obtain the penalty difficulty.

[0045] The set of abnormal business behaviors includes A types of business anomalies; A types of business anomalies include B types of business anomalies. c c is a positive integer and c is less than or equal to A;

[0046] The blockchain-based data processing device also includes:

[0047] The second determination module is used to obtain the business exception type B from the set of abnormal business behaviors when the business system time reaches the business heartbeat cycle. c The second total number of abnormal business behaviors;

[0048] The second determining module is also used to perform a weighted summation of the second total number corresponding to each of the A business anomaly types based on the type weights corresponding to the A business anomaly types, so as to obtain the target business anomaly score.

[0049] The second determining module is also used to determine if the target business anomaly score is greater than the business anomaly score threshold, and then determine if the set of business anomaly behaviors of the business node meets the business penalty conditions.

[0050] The first generation module includes:

[0051] The fourth acquisition unit is used to acquire the business penalty gradient rule; the business penalty gradient rule includes the business anomaly score and the penalty difficulty that has a mapping relationship with the business anomaly score; the business anomaly score includes the target business anomaly score;

[0052] The fifth acquisition unit is used to obtain the penalty difficulty that has a mapping relationship with the target business anomaly score from the business penalty gradient rules.

[0053] The on-chain transaction module includes:

[0054] The broadcast block unit is used to generate the first block to be reached for consensus based on the penalized transactions, and broadcast the first block to be reached for consensus to the second consensus node in the consensus network;

[0055] The result acquisition unit is used to acquire the voting results for the penalty transactions returned by the second consensus node, and to acquire the voting success results in the voting results. The voting success results are used to characterize the set of abnormal business behaviors to be detected for the business nodes as counted by the second consensus node, and the data difference between the set of abnormal business behaviors and the set of abnormal business behaviors is less than the data difference threshold. It is also used to characterize the correlation between the set of abnormal business behaviors and the penalty difficulty, and satisfies the penalty gradient rule for the business to be detected in the second consensus node.

[0056] The statistical results unit is used to calculate the ratio of the total number of results corresponding to successful voting results to the total number of results corresponding to voting results. If the ratio of the number of results is less than the threshold for the ratio of successful results, the transaction is determined to have failed to be recorded on the blockchain.

[0057] The blockchain-based data processing device also includes:

[0058] The third acquisition module is used to acquire the penalty removal transaction forwarded by the routing node; the penalty removal transaction is initiated by the business node; the penalty removal transaction carries penalty removal parameters;

[0059] The third acquisition module is also used to acquire target parameters based on the removal penalty parameters and the penalty parameters, and to determine the summary information corresponding to the target parameters;

[0060] The third acquisition module is also used to generate a second consensus block based on the transaction that lifts the penalty if the digest information contains information that meets the penalty difficulty.

[0061] The third acquisition module is also used to broadcast the second block to be reached to consensus to the second consensus node in the consensus network, so that the second consensus node can reach a consensus on the second block to be reached and return the consensus result;

[0062] The third acquisition module is also used to lift the penalty on the business node and start processing business requests for the business node if the consensus result is a consensus pass result.

[0063] The third acquisition module is also used to send a penalty hold notification to the routing node if the consensus result is a consensus failure result, so that the routing node forwards the penalty hold notification to the business node when it receives the business request initiated by the business node.

[0064] One embodiment of this application provides a blockchain-based data processing device, including:

[0065] The first acquisition module is used to obtain the connection permissions corresponding to the set of abnormal connection behaviors from the connection penalty gradient rules when the routing node detects that the set of abnormal connection behaviors of the service node meets the connection penalty conditions.

[0066] The first forwarding module, upon receiving a business request initiated by a business node, forwards the penalty task notification sent by the target consensus node when the penalty transaction is successfully uploaded to the chain to the business node, based on connection permissions. This enables the business node to execute a penalty removal process associated with the penalty parameters and penalty difficulty according to the penalty task notification. The penalty task notification carries the penalty parameters and penalty difficulty. The penalty difficulty is obtained from the business penalty gradient rules when the target consensus node detects that the set of abnormal business behaviors of the business node meets the business penalty conditions, and the penalty difficulty is correlated with the set of abnormal business behaviors. The penalty parameters are generated by the target consensus node for the business node. The penalty transaction is generated based on the set of abnormal business behaviors, the penalty parameters, and the penalty difficulty.

[0067] The blockchain-based data processing device also includes:

[0068] The second acquisition module is used to acquire the transaction data to be uploaded to the chain initiated by the business node, which carries the signature to be verified, and to decrypt the signature to be verified using the node public key of the business node to obtain the first digital digest.

[0069] The second acquisition module is also used to acquire a second digital digest of the transaction data to be uploaded to the blockchain, and compare the first digital digest with the second digital digest.

[0070] The second forwarding module is used to determine that the business node has a connection anomaly of the first connection anomaly type if the first digital digest is different from the second digital digest, and to add the connection anomaly of the first connection anomaly type to the connection anomaly behavior set for the business node.

[0071] The second forwarding module is also used to forward the transaction data to be uploaded to the chain to the consensus node in the consensus network if the first digital digest is the same as the second digital digest, so that the consensus node can process the transaction data to be uploaded to the chain.

[0072] The blockchain-based data processing device also includes:

[0073] The third forwarding module is used to obtain transaction data to be uploaded to the blockchain initiated by business nodes;

[0074] The third forwarding module is also used to perform format verification on the transaction data to be uploaded to the blockchain and obtain the format verification result. The format verification result includes the first format verification result or the second format verification result. The first format verification result is used to indicate that there is a format error in the transaction data to be uploaded to the blockchain, and the second format verification result is used to indicate that there is no format error in the transaction data to be uploaded to the blockchain.

[0075] The third forwarding module is also used to determine that if the format verification result is the first format verification result, the business node has a connection exception behavior of the second connection exception type, and add the connection exception behavior of the second connection exception type to the connection exception behavior set for the business node.

[0076] The third forwarding module is also used to forward the transaction data to be uploaded to the chain to the consensus node in the consensus network if the format verification result is the second format verification result, so that the consensus node can process the transaction data to be uploaded to the chain.

[0077] The blockchain-based data processing device also includes:

[0078] The first determination module is used to determine the initial total number of initial transaction data initiated by the business node and the total number of connections with abnormal behavior in the set of abnormal connection behaviors when the connection system time reaches the connection heartbeat cycle.

[0079] The first determining module is used to determine the ratio of the number of connections to be mapped between the total number of connections and the initial total number. If the ratio of the number of connections to be mapped is greater than the connection ratio threshold, then the set of abnormal connection behaviors of the business node is determined to meet the connection penalty condition.

[0080] The first acquisition module includes:

[0081] The first acquisition unit is used to acquire the connection penalty gradient rule; the connection penalty gradient rule includes the connection quantity ratio and the connection permissions that have a mapping relationship with the connection quantity ratio; the connection quantity ratio includes the proportion of the number of connections to be mapped;

[0082] The second acquisition unit is used to obtain connection permissions that are mapped to the proportion of the number of connections to be mapped from the connection penalty gradient rule, and use them as initial connection permissions.

[0083] The third acquisition unit is used to acquire the historical connection permissions of the business node, and determine the connection permissions based on the historical connection permissions and the initial connection permissions.

[0084] The third acquisition unit includes:

[0085] The first acquisition subunit is used to acquire the generation timestamp of historical connection permissions and the generation timestamp of initial connection permissions; the generation timestamp of historical connection permissions is earlier than the generation timestamp of initial connection permissions.

[0086] The second acquisition subunit is used to determine the connection time interval between the generation timestamp of historical connection permissions and the generation timestamp of initial connection permissions, and compare the connection time interval with the connection time interval threshold.

[0087] The first enhancement subunit is used to positively enhance the historical connection permissions based on the initial connection permissions if the connection time interval is less than or equal to the connection time interval threshold, so as to obtain the connection permissions.

[0088] The second enhancement subunit is used to reverse-enhance historical connection permissions based on the initial connection permissions if the connection time interval is greater than the connection time interval threshold, so as to obtain the connection permissions.

[0089] The set of connection anomaly behaviors includes E connection anomaly types; the E connection anomaly types include connection anomaly type F. g g is a positive integer and g is less than or equal to E;

[0090] The blockchain-based data processing device also includes:

[0091] The third acquisition module is used to acquire connection exception type F from the set of connection exception behaviors when the connection system time reaches the connection heartbeat cycle. g The total number of connection-related abnormal behaviors;

[0092] The third acquisition module is also used to perform a weighted summation of the total number of behaviors corresponding to the E connection anomaly types based on the type weights corresponding to the E connection anomaly types, so as to obtain the target connection anomaly score.

[0093] The second determining module is used to determine that if the target connection anomaly score is greater than the connection anomaly score threshold, the set of connection anomaly behaviors of the business node satisfies the connection penalty condition.

[0094] The first acquisition module includes:

[0095] The fourth acquisition unit is used to acquire the connection penalty gradient rule; the connection penalty gradient rule includes connection anomaly scores and connection permissions that are mapped to the connection anomaly scores; the connection anomaly scores include the target connection anomaly score;

[0096] The fifth acquisition unit is used to obtain connection permissions that have a mapping relationship with the target connection anomaly score from the connection penalty gradient rule.

[0097] The first forwarding module includes:

[0098] The statistics request unit is used to count the number of historical requests initiated by a business node when a business request is received; the timestamp of the historical business request is earlier than the timestamp of the business request.

[0099] The request rejection unit is used to refuse to forward the business request to the target consensus node if the number of historical requests is equal to the number of connections allowed in the connection permissions, and to forward the penalty task notification sent by the target consensus node when the penalty transaction is successfully put on the chain to the business node.

[0100] The forwarding request unit is used to forward the business request to the target consensus node and forward the penalty task notification to the business node if the number of historical requests is less than the number of connections.

[0101] This application provides a computer device, including: a processor, a memory, and a network interface;

[0102] The processor is connected to the memory and the network interface, wherein the network interface is used to provide data communication functions, the memory is used to store computer programs, and the processor is used to call the computer programs so that the computer device executes the methods in the embodiments of this application.

[0103] One aspect of this application provides a computer-readable storage medium storing a computer program adapted for loading by a processor and executing the methods described in this application.

[0104] One aspect of this application provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method described in this application.

[0105] In this embodiment, the first consensus node detects the set of abnormal business behaviors of business nodes. When the set of abnormal business behaviors meets the business penalty conditions, it obtains the penalty difficulty corresponding to the set of abnormal business behaviors from the business penalty gradient rules and generates penalty parameters for the business node. Further, based on the set of abnormal business behaviors, the penalty parameters, and the penalty difficulty, it generates a penalty transaction for the business node. When the penalty transaction is successfully recorded on the chain, a penalty task notification carrying the penalty parameters and penalty difficulty is sent to the routing node. This allows the routing node to forward the penalty task notification to the business node when it receives a business request initiated by the business node. The penalty task notification instructs the business node to perform a penalty removal process associated with the penalty parameters and penalty difficulty. As can be seen, when the first consensus node determines that the set of abnormal business behaviors of a business node meets the business penalty conditions, it punishes the abnormal business behaviors of the business node through the penalty difficulty and penalty parameters. Therefore, it can increase the cost of malicious behavior for malicious nodes, thereby improving the operational security of the blockchain network. Attached Figure Description

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

[0107] Figure 1 This is a schematic diagram of a layered structure of a blockchain network provided in an embodiment of this application;

[0108] Figure 2 This is a schematic diagram of a data processing scenario based on blockchain provided in an embodiment of this application;

[0109] Figure 3 This is a flowchart illustrating a blockchain-based data processing method provided in an embodiment of this application;

[0110] Figure 4 This is a schematic diagram of a data processing scenario based on blockchain provided in an embodiment of this application;

[0111] Figure 5 This is a schematic diagram of a data processing scenario based on blockchain provided in an embodiment of this application;

[0112] Figure 6 This is a flowchart illustrating a blockchain-based data processing method provided in an embodiment of this application;

[0113] Figure 7 This is a flowchart illustrating a blockchain-based data processing method provided in an embodiment of this application;

[0114] Figure 8 This is a flowchart illustrating a blockchain-based data processing method provided in an embodiment of this application;

[0115] Figure 9 This is a schematic diagram of the structure of a blockchain-based data processing device provided in an embodiment of this application;

[0116] Figure 10 This is a schematic diagram of the structure of a blockchain-based data processing device provided in an embodiment of this application;

[0117] Figure 11 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application;

[0118] Figure 12 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0119] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0120] To facilitate understanding, the following brief explanations are provided for some of the terms:

[0121] 1. Blockchain: In a narrow sense, blockchain is a chain-like data structure with blocks as the basic unit. The blocks use digital digests to verify the previously obtained transaction history, which is suitable for the needs of anti-tampering and scalability in distributed ledger scenarios. In a broad sense, blockchain also refers to the distributed ledger technology implemented by the blockchain structure, including distributed consensus, privacy and security protection, peer-to-peer communication technology, network protocols, smart contracts, etc.

[0122] The goal of blockchain is to create a distributed data ledger that allows only additions and not deletions. The underlying structure of the ledger is a linear linked list. This list consists of interconnected "blocks," with each subsequent block recording the hash value of its predecessor. The validity of each block (and the transactions within it) can be quickly verified by calculating the hash value. If a node in the network proposes adding a new block, the block must be confirmed through a consensus mechanism.

[0123] 2. Block: A block is a data packet carrying transaction data (i.e., transactions) on a blockchain network. It is a data structure marked with a timestamp and the hash value of the previous block. A block is verified and confirmed by the network's consensus mechanism. A block consists of a block header and a block body. The block header records the metadata of the current block, including the current version number, the hash value of the previous block, the timestamp, a random number, and the hash value of the Merkle root. The block body records detailed data generated over a period of time, including all verified transactions and other information generated during the block creation process; it can be understood as a form of ledger representation. Furthermore, the detailed data in the block body may include a unique Merkle root recorded in the block header, generated through a Merkle tree hashing process.

[0124] The predecessor block, also known as the parent block, is the block in which the blockchain achieves temporal ordering by recording the hash value of the block and the hash value of the parent block in the block header.

[0125] 3. Hash Value: Also known as an information feature value or characteristic value, a hash value is generated by converting input data of arbitrary length into cryptographic data and producing a fixed output using a hash algorithm. The original input data cannot be retrieved by decrypting the hash value; it is a one-way cryptographic function. In a blockchain, each block (except the initial block) contains the hash value of its predecessor block. The hash value is a core foundation and the most important aspect of blockchain technology, preserving the authenticity of recorded and viewed data, as well as the integrity of the blockchain as a whole.

[0126] 4. Smart Contract: A smart contract is a computer protocol designed to disseminate, verify, or execute contracts in an informational manner. In a blockchain system, a smart contract (or simply contract) is code that all nodes on the blockchain can understand and execute, capable of performing arbitrary logic and producing results. In practical applications, smart contracts are managed and tested through transactions on the blockchain. Each transaction is equivalent to a Remote Procedure Call (RPC) request to the blockchain system. If a smart contract is like an executable program, the blockchain is like the operating system that provides the runtime environment. A blockchain can contain multiple contracts, distinguished by contract identity (ID), identifier, or name.

[0127] 5. Contract Execution: By initiating a transaction, users can invoke contracts already deployed on the blockchain. Each node in the blockchain system runs the same contract. For contracts that need to read data, they access their own ledger. Ultimately, each node verifies the consistency of the execution results (consensus). If the results are consistent, each node stores the necessary results in its own ledger and returns the results to the user.

[0128] 6. Read / Write Set: A record of operations performed by the contract on the node ledger data during execution. It is divided into the read set and the write set, referring to the data read from the ledger and the data to be written to the ledger during smart contract execution, respectively.

[0129] 7. Consensus Mechanism: The consensus mechanism is a mathematical algorithm in a blockchain system that enables different node devices to establish trust and acquire rights. In a blockchain system, through the voting mechanism among node devices (i.e., the consensus mechanism), the verification and confirmation of transactions can be completed in a very short time. For a transaction, if several node devices with unrelated interests can reach a consensus, it can be assumed that all node devices in the system can also reach a consensus on it.

[0130] 8. Public Key and Private Key: A public key and a private key are a key pair (one public key and one private key) obtained through an algorithm. The public key is the publicly known part of the key pair, while the private key is the private key. Public keys are typically used for encrypting data, verifying digital signatures, etc. This algorithm ensures that the resulting key pair is unique. When using this key pair, if data is encrypted with one key, it must be decrypted with the other key. For example, if data is encrypted with the public key, it must be decrypted with the private key, and vice versa; otherwise, decryption will fail.

[0131] Please see Figure 1 , Figure 1 This is a schematic diagram of a layered blockchain network structure provided in an embodiment of this application. The layered blockchain network structure in this embodiment can be... Figure 1 The blockchain network 1W shown represents a complete blockchain business system that can be developed by... Figure 1 The network shown consists of the business network, the consensus network, and the routing network where routing node 10D is located.

[0132] It should be understood that the number of routing nodes in the routing network can be one or more, and is not limited here. In this embodiment of the application, routing node 10D is used as an example. This routing node 10D can be used to isolate the business network and the consensus network, that is, to layer the peer-to-peer (P2P) network to form a layered structure of "business network - consensus network", thereby improving the confidentiality and security of data on the blockchain.

[0133] It should be understood that, in this application embodiment, a blockchain node located in a business network can be referred to as a business node. This business node does not need to participate in the accounting consensus; its main purpose is to execute transaction transactions to obtain transaction data associated with those transactions. Figure 1The blockchain node system (i.e., the first blockchain node system) corresponding to the business network (i.e., the witness network) shown can include one or more blockchain nodes. The number of nodes in the first blockchain node system is not limited here. For example, the first blockchain node system can specifically include business node 110a, business node 110b, business node 110c, ..., business node 110n. The business node here can be a full node containing the complete blockchain database, or a lightweight node storing a portion of the data in the blockchain database; this is not limited here. To reduce the waste of storage space for business nodes, the business node in this embodiment can be a lightweight node (Simplified Payment Verification, or SPV for short). This business node does not need to store complete transaction data, but instead obtains it from the routing node 10D. Figure 1 In the consensus network shown, block header data and partially authorized block data (e.g., transactions associated with the business node itself) are obtained.

[0134] It should be understood that, in this application embodiment, a node in the consensus network can be referred to as a consensus node (i.e., a ledger node), and this consensus node can run the blockchain consensus protocol. Figure 1 The consensus network shown can also include one or more blockchain nodes in its corresponding blockchain node system (i.e., the second blockchain node system). There is no limit to the number of nodes in the second blockchain node system. For example, the second blockchain system may specifically include consensus node 120a, consensus node 120b, consensus node 120c, ..., consensus node 120m.

[0135] In this embodiment, the consensus node with block-producing function in the consensus network can be referred to as the first consensus node, and the consensus nodes that perform block consensus on the generated new blocks in the consensus network can be collectively referred to as the second consensus node. The first consensus node can receive transaction data forwarded by business nodes in the business network through routing node 10D, and store the received transaction data in the node transaction pool of the first consensus node, so as to wait for the subsequent block with the largest generation timestamp on the blockchain to package the transaction data in the node transaction pool and generate a new block.

[0136] It should be understood that in this application embodiment, routing nodes, service nodes, and consensus nodes can be collectively referred to as blockchain nodes in blockchain network 1W. These blockchain nodes can be servers accessing blockchain network 1W or terminal devices accessing blockchain network 1W; the specific form of the blockchain node is not limited here. It is understood that... Figure 1The business network and consensus network shown are in different network environments. For example, business nodes are usually deployed in a business network on the public network, while consensus nodes running the blockchain consensus protocol are deployed in a private consensus network. The two can interact through routing boundaries (i.e., routing networks).

[0137] To ensure data interoperability at the network layer, data connections can exist between each network layer. For example, in the consensus network, there is a data connection between consensus node 120a and consensus node 120b, and between consensus node 120d and consensus node 120g; similarly, in the service network, there is a data connection between synchronization node 110f and synchronization node 110e, and so on. Furthermore, data connections can exist between the service network and the routing network, such as between routing node 10D and service node 110g; and between the consensus network and the routing network, such as between routing node 10D and consensus node 120f.

[0138] It is understandable that blockchain nodes can transmit data or blocks through the aforementioned data connections. These data connections between blockchain nodes can be based on node identifiers. Each blockchain node in the network has a corresponding node identifier, and each node can store the node identifiers of other connected blockchain nodes. This allows the acquired data or generated blocks to be broadcast to other blockchain nodes based on their node identifiers. For example, consensus node 120a can maintain a list of node identifiers, which stores the node names and identifiers of other blockchain nodes, as shown in Table 1.

[0139] Table 1

[0140]

[0141] The node identifier can be an Internet Protocol (IP) address or any other information that can be used to identify a node in a blockchain network. Table 1 only uses IP addresses as an example.

[0142] Assuming the node identifier of consensus node 120a is 117.116.156.425, then consensus node 120a can send a penalty task notification to routing node 10D through node identifier 117.114.151.183 (see below). Figure 3(As defined in the corresponding embodiment for the penalty task notification), and routing node 10D can determine that the penalty task notification was sent by consensus node 120a through node identifier 117.116.156.425; service node 110b can send transaction data A to routing node 10D through node identifier 117.114.151.183, then routing node 10D can determine that transaction data A was sent by service node 110b through node identifier 119.250.485.362, and the data transmission between other nodes is also like this, so it will not be described in detail.

[0143] It is understood that the above data connection is not limited to the connection method. It can be connected directly or indirectly through wired communication, or directly or indirectly through wireless communication, or through other connection methods. This application does not impose any restrictions on this.

[0144] in, Figure 1 The blockchain nodes in the blockchain network 1W include, but are not limited to, terminal devices or business servers. The business server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud databases, cloud services, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Terminal devices include, but are not limited to, mobile phones, computers, smart voice interaction devices, smart home appliances, and in-vehicle terminals. The terminal devices and business servers can be connected directly or indirectly via wired or wireless means; this embodiment of the application does not impose any limitations on this.

[0145] Further, please see Figure 2 , Figure 2 This is a schematic diagram illustrating a blockchain-based data processing scenario provided by an embodiment of this application. This embodiment can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, and assisted driving. Figure 2 Business node 20a in the middle can be Figure 1 In the business network, any service node, routing node 20b can be equivalent to... Figure 1 In the process, routing node 10D and consensus node 20c can be... Figure 1 Any consensus node in the consensus network. For example... Figure 2As shown, business object 201a performs business transaction operations through business node 20a. Business node 20a responds to the business transaction operations and generates transaction data 1. This application embodiment does not limit the business type; it can be any type of business, such as electronic invoice business, online transfer business, etc. The business type can be set according to the actual application scenario. It should be noted that all data mentioned in this application (such as transaction data 1 and the transaction data to be uploaded to the chain described below) are processed only after obtaining the permissions granted by the device object.

[0146] Business node 20a responds to the on-chain operation for transaction data 1 by sending transaction data 1 to routing node 20b. After receiving transaction data 1 from business node 20a, routing node 20b obtains node status list 201b, such as... Figure 2 As shown, the node status list 201b may include the node identifier and node connection status corresponding to each service node in the service network. Figure 2 (abbreviated as status) and the number of connection anomalies ( Figure 2 (abbreviated as abnormal number); it can be understood that the node identifier in the node status list 201b can be equivalent to the node identifier in Table 1 described above, or it can be another type of information that can be used to identify a business node, which is not limited here; the total number of node connection states is at least two. In this embodiment, the normal connection state, the rate-limited connection state, and the connection rejection state are used as examples to illustrate the node connection states. The normal connection state can indicate that the data connection between the business node and the routing node 20b is in a normal data connection state, or it can indicate that the connection behavior of the business node in response to the business request is a normal connection behavior, or there is only a connection abnormal behavior within the allowed number; the rate-limited connection state can indicate that the data connection between the business node and the routing node 20b is in a rate-limited connection state. For example, within a connection heartbeat cycle, only a limited number of connections to the first target are allowed (which can be customized, such as 5 times). This can also indicate that the connection behavior of the business node in response to the business request has an abnormal connection behavior that exceeds the allowed number. The connection rejection state can indicate that the data connection between the business node and the routing node 20b is in a data rejection state. For example, within a connection heartbeat cycle, the routing node 20b refuses to receive the business request sent by the business node. This can also indicate that the connection behavior of the business node in response to the business request has an abnormal connection behavior that is far greater than the allowed number, or that the connection anomaly behavior belongs to a connection anomaly type with a high degree of abnormality. It is understood that the node connection state can be set according to the actual application scenario, and this application embodiment does not limit it.

[0147] Please see again. Figure 2If the node identifier of business node 20a is identifier 1, then routing node 20b can determine that the node connection status of business node 20a is a normal connection status, and that business node 20a has exhibited one connection anomaly. In this case, routing node 20b performs a connection check on transaction data 1. For a detailed description of the connection check process, please refer to the following text. Figure 8 The description of step S401 in the corresponding embodiment will not be repeated here. If the connection detection result is an abnormal connection result, that is, the service node 20a has abnormal connection behavior, such as the digital signature verification of transaction data 1 failing, or the data format of transaction data 1 being incorrect, then the routing node 20b adds the abnormal detection result to the set of abnormal connection behaviors for service node 20a, and rejects the data transmission request of service node 20a for transaction data 1, that is, it refuses to send transaction data 1 to the consensus network; if the connection detection result is a normal connection result, then transaction data 1 is sent to the consensus network so that the consensus nodes in the consensus network (such as Figure 2 The consensus node 20c in the example performs on-chain processing of transaction data.

[0148] If the node identifier of business node 20a is identifier 2, then routing node 20b can determine that the node connection status of business node 20a is a rate-limited connection status, and business node 20a has 4 historical connection abnormal behaviors; if the above-mentioned first target quantity is equal to 5, assuming that the total number corresponding to the number of historical requests is less than the number of connections (5 times), then routing node 20b performs connection detection on transaction data 1. The subsequent processing is the same as the processing process when business node 20a is in a normal connection status, so it will not be described in detail here. Please refer to the description above.

[0149] If the node identifier of business node 20a is identifier 3, then the routing node 20b can determine that the node connection status of business node 20a is a rate-limited connection status, and business node 20a has 5 historical connection abnormal behaviors. If the first target number mentioned above is equal to 5, and assuming that the total number of historical request counts is equal to the allowed number of connections (5 times), then the routing node 20b refuses to send transaction data 1 to the consensus network.

[0150] If the node identifier of business node 20a is identifier 4, then routing node 20b can determine that the node connection status of business node 20a is a connection refusal state, and business node 20a has 10 historical connection abnormal behaviors. Therefore, routing node 20b refuses to send transaction data 1 to the consensus network.

[0151] It is understood that the use of four nodes to identify four service nodes in the example service network in this application embodiment does not mean that there are only four service nodes in the service network, and this application embodiment does not limit the number of service nodes in the service network.

[0152] Assuming that the node identifier of business node 20a is node identifier 2, and the detection result for transaction data 1 is a normal result, then routing node 20b forwards transaction data 1 to the consensus network. After obtaining transaction data 1, consensus node 20c in the consensus network first determines whether to initiate punishment for business node 20a based on the abnormal business behavior set 20e of business node 20a. For the specific process of initiating the punishment task for business node 20a, please refer to the following text. Figure 3 The description of step S101 in the corresponding embodiment will not be elaborated here. If consensus node 20c has started the penalty task for business node 20a, then transaction data 1 will be rejected from being uploaded to the chain; if the penalty task for business node 20a has not been started, then business detection will be performed on transaction data 1. For a detailed description of the business detection process, please refer to the following text. Figure 3 The description of step S301 in the corresponding embodiment will not be repeated here. If the business detection result is a normal business result, consensus node 20c adds transaction data 1 to blockchain 20d; if the business detection result is an abnormal business result, that is, business node 20a has abnormal business behavior (such as... Figure 2 In the example shown, if the abnormal business behavior 5 is such that transaction data 1 is duplicate transaction data or an error occurs when executing transaction data 1, then consensus node 20c will add the abnormal business behavior result to the abnormal business behavior set 20e for business node 20a and reject the request to put transaction data 1 on the chain.

[0153] Subsequently, consensus node 20c detects abnormal business behaviors in the abnormal business behavior set 20e, such as... Figure 2 As shown, the set of abnormal business behaviors 20e includes abnormal business behavior 1, abnormal business behavior 2, ..., abnormal business behavior 5. When an abnormal business behavior in the set of abnormal business behaviors 20e meets the business penalty conditions, consensus node 20c can generate a penalty task notification for business node 20a. The specific process is described below. Figure 3 The description in step S101 will not be elaborated here; consensus node 20c sends the penalty task notification to routing node 20b, so that when routing node 20b receives a service request initiated by service node 20a, it will forward the penalty task notification to service node 20a. After receiving the penalty task notification, service node 20a can perform the penalty removal process.

[0154] In summary, this application designs a penalty scheme for a blockchain business platform from two levels (routing connection level and business level). The penalty scheme includes connection penalty and task penalty. This scheme can punish errors caused by execution, coding and malicious behavior when using the blockchain platform from two aspects: the connection of business nodes (including the basic format of business requests) and the business logic of business requests. Therefore, it can greatly increase the cost of malicious behavior for malicious actors, thereby ensuring the stable operation of the entire platform.

[0155] Further, please see Figure 3 , Figure 3 This is a flowchart illustrating a blockchain-based data processing method provided in an embodiment of this application. Figure 3 As shown, the data processing method may include at least steps S101-S103.

[0156] Step S101: When the first consensus node detects that the set of abnormal business behaviors of a business node meets the business penalty conditions, it obtains the penalty difficulty corresponding to the set of abnormal business behaviors from the business penalty gradient rules and generates penalty parameters for the business node.

[0157] Specifically, the first consensus node obtains the transaction data to be uploaded to the blockchain forwarded by the routing node; the transaction data to be uploaded to the blockchain is initiated by the business node; the transaction data to be uploaded to the blockchain is subjected to business verification to obtain a business verification result; the business verification result includes a first business verification result or a second business verification result; the first business verification result is used to indicate that there is error information in the transaction data to be uploaded to the blockchain; the second business verification result is used to indicate that there is no error information in the transaction data to be uploaded to the blockchain; if the business verification result is the first business verification result, it is determined that the business node has a business abnormality type belonging to the first business abnormality type, and the business abnormality type belonging to the first business abnormality type is added to the business abnormality behavior set for the business node; if the business verification result is the second business verification result, the transaction data to be uploaded to the blockchain is processed.

[0158] Specifically, the first consensus node obtains the transaction data to be uploaded to the blockchain forwarded by the routing node and generates a hash value to be detected for the transaction data to be uploaded to the blockchain; the transaction data to be uploaded to the blockchain is initiated by the business node; it obtains a list of historical blocks that have been uploaded to the blockchain and obtains historical block information from the block list; the historical block information includes historical hash values, which refer to the hash values ​​of transaction data in historical blocks; it matches the historical hash values ​​with the hash values ​​to be detected to obtain matching results; the matching results include a first matching result or a second matching result; the first matching result is used to indicate that there are historical hash values ​​in the historical hash values ​​that are the same as the hash value to be detected; the second matching result is used to indicate that all historical hash values ​​are different from the hash value to be detected; if the matching result is the first matching result, it is determined that the business node has a business abnormality behavior of the second business abnormality type, and the business abnormality behavior of the second business abnormality type is added to the business abnormality behavior set for the business node; if the matching result is the second matching result, the transaction data to be uploaded to the blockchain is processed.

[0159] Specifically, the first consensus node obtains the transaction data to be uploaded to the blockchain forwarded by the routing node; the transaction data to be uploaded to the blockchain is initiated by the business node; the transaction data to be uploaded to the blockchain carries contract information; the transaction execution function in the smart contract used to execute the transaction data to be uploaded to the blockchain is called through the contract information; the transaction data to be uploaded to the blockchain is executed according to the transaction execution function, and the transaction execution result for the transaction data to be uploaded to the blockchain is obtained; the transaction execution result includes a first transaction execution result or a second transaction execution result; the first transaction execution result is used to indicate that the execution of the transaction data to be uploaded to the blockchain failed; the second transaction execution result is used to indicate that the execution of the transaction data to be uploaded to the blockchain succeeded; if the transaction execution result is the first transaction execution result, it is determined that the business node has a business anomaly behavior belonging to the third business anomaly type, and the business anomaly behavior belonging to the third business anomaly type is added to the business anomaly behavior set for the business node; if the transaction execution result is the second transaction execution result, the transaction data to be uploaded to the blockchain is processed.

[0160] Specifically, the set of abnormal business behaviors includes A types of business anomalies; A types of business anomalies include B types of business anomalies. c c is a positive integer and c is less than or equal to A; when the business system time reaches the business heartbeat cycle, the first consensus node obtains the business abnormal behavior set belonging to business abnormal type B. cThe second total number of abnormal business behaviors is determined; based on the type weights corresponding to the A types of abnormal business behaviors, the second total number corresponding to the A types of abnormal business behaviors is weighted and summed to obtain the target abnormal business score; if the target abnormal business score is greater than the business abnormal score threshold, it is determined that the set of abnormal business behaviors of the business node meets the business penalty condition; when the first consensus node detects that the set of abnormal business behaviors of the business node meets the business penalty condition, the business penalty gradient rule is obtained; the business penalty gradient rule includes the abnormal business score and the penalty difficulty that has a mapping relationship with the abnormal business score; the abnormal business score includes the target abnormal business score; the penalty difficulty that has a mapping relationship with the target abnormal business score is obtained from the business penalty gradient rule.

[0161] The first consensus node can be Figure 1 Any consensus node in the consensus network. Please also refer to... Figure 4 , Figure 4 This is a schematic diagram illustrating a blockchain-based data processing scenario provided in an embodiment of this application. Figure 4 Business node 20a in the middle can be equivalent to Figure 2 Business node 20a and business object 201a in the context can be equivalent to... Figure 2 In the context, business object 201a and routing node 20b can be equivalent to... Figure 2 The routing node 20b in the example. Figure 4 As shown, business node 20a responds to business object 201a's on-chain operation for transaction data to be uploaded to the blockchain by sending the transaction data to be uploaded to the blockchain to routing node 20b. Routing node 20b, based on the set of abnormal connection behaviors of business node 20a and the connection penalty conditions, forwards the transaction data to be uploaded to the first consensus node 40z. For the conditions under which routing node 20b forwards the transaction data to be uploaded to the blockchain, please refer to the above text. Figure 2 The description in the text, and the following text Figure 8 The description of that will not be elaborated here.

[0162] After the first consensus node 40z obtains the transaction data to be uploaded to the chain, it performs business detection on the transaction data to be uploaded to the chain. The embodiments of this application do not limit the content of the business detection, which can be set according to the actual application scenario. For ease of understanding and description, business verification, duplicate verification and transaction execution are used as examples of business detection. The specific process is as follows.

[0163] The first consensus node 40z performs business verification on the transaction data to be uploaded to the blockchain. This verification can include checking for errors in the transaction data, such as incorrect tax identification numbers in e-invoices or incorrect account numbers in transfer transactions. The first consensus node 40z receives the business verification result. If the result matches the first business verification result, it can be determined that business node 20a exhibits a business anomaly of the first type. This can be interpreted as business node 20a uploading erroneous data to the blockchain, thus classifying it as the first type of business anomaly. Figure 4 Abnormal business behavior (abbreviated as Type 1 in Chinese) (e.g.) Figure 4 The example shown, Business Abnormal Behavior 1 and Business Abnormal Behavior 2, are added to the Business Abnormal Behavior Set 40a for Business Node 20a. Business Abnormal Behavior 1 can be understood as the behavior of putting erroneous transaction data on the chain.

[0164] If the business verification result is the second business verification result, then the first consensus node 40z generates the hash value to be detected for the transaction data to be uploaded to the chain, and obtains the block list for the historical blocks that have been uploaded to the chain. Further, it obtains the historical block information in the block list, matches the historical hash value with the hash value to be detected, and obtains the matching result. If the matching result is the first matching result, then the first consensus node 40z can determine that the business node 20a has a business anomaly behavior belonging to the second business anomaly type. This business anomaly behavior can be understood as the behavior of uploading duplicate transaction data to the chain. At this time, the first consensus node 40z will belong to the second business anomaly type (…). Figure 4 Abnormal business behavior (abbreviated as Type 2 in Chinese) (e.g.) Figure 4 The example shown includes business anomaly behavior 3 and business anomaly behavior 4), which are added to the business anomaly behavior set 40a for business section 20a. Business anomaly behavior 3 can be understood as the behavior of putting duplicate transaction data on the chain.

[0165] If the matching result is the second matching result, then the first consensus node 40z obtains the contract information carried by the transaction data to be uploaded to the blockchain, and calls the transaction execution function in the smart contract to execute the transaction data to be uploaded to the blockchain through the contract information; executes the transaction data to be uploaded to the blockchain according to the transaction execution function, and obtains the transaction execution result for the transaction data to be uploaded to the blockchain; if the transaction execution result is the first transaction execution result, then the first consensus node 40z can determine that the business node 20a has a business anomaly behavior belonging to the third business anomaly type. This business anomaly behavior can be understood as the failure to execute the transaction data to be uploaded to the blockchain. The reason for this failure may be that the transaction execution function fails to read data, or it may be that the transaction execution function fails to write data, or it may be that the transaction execution function cannot be obtained. This application embodiment does not limit the reason for failure and should be set according to the actual application scenario. At this time, the first consensus node 40z will belong to the third business anomaly type ( Figure 4 Business anomalies (abbreviated as Type 3 in Chinese) such as Figure 4 The example of abnormal business behavior 5) is added to the set of abnormal business behaviors for business nodes 40a; if the transaction execution result is the second transaction execution result, a consensus block 40b is generated based on the transaction data to be uploaded to the chain, and the consensus block 40b is broadcast in the consensus network to achieve consensus on the consensus block 40b. After the consensus is passed, it is added to the blockchain 40c.

[0166] This application does not limit the total number of business exception types. The number can be set according to the actual application scenario. For ease of description, this application uses three business exception types as examples: the first business exception type, the second business exception type, and the third business exception type.

[0167] Further, please see Figure 5 , Figure 5 This is a schematic diagram illustrating a blockchain-based data processing scenario provided in an embodiment of this application. For example... Figure 5 As shown, when the business system time reaches the business heartbeat cycle, the first consensus node 40c obtains the business abnormal behavior set 40a belonging to business abnormal type B. c The second total number of abnormal business behaviors, such as Figure 5 The example given belongs to the first type of business exception ( Figure 5 There are two abnormal business behaviors (abbreviated as Type 1), namely Abnormal Business Behavior 1 and Abnormal Business Behavior 2, which belong to the second type of business abnormality ( Figure 5 There are two abnormal business behaviors (abbreviated as Type 2), namely abnormal business behavior 3 and abnormal business behavior 4, which belong to the third type of business abnormality ( Figure 5There is one business anomaly behavior (abbreviated as Type 3), which is business anomaly behavior 5. Therefore, the second total number is 2, 2, and 1 respectively. Furthermore, the first consensus node 40z obtains the first type weight corresponding to the first business anomaly type ( Figure 5 Example: Type Weight 1), the second type weight corresponding to the second business exception type ( Figure 5 Example is type weight 2), the third type weight corresponding to the third business exception type ( Figure 5 (Example: Type Weight 3) Based on the type weights corresponding to the three business anomaly types, the first consensus node 40z performs a weighted sum of the second total quantities corresponding to the three business anomaly types to obtain the target business anomaly score. Figure 5 (Abbreviated as target score).

[0168] Please see again. Figure 5 If the target business anomaly score is greater than the business anomaly score threshold, then the first consensus node 40z can determine that the business anomaly behavior set 40a of business node 20a meets the business penalty condition. At this time, the business penalty gradient rule 40d is obtained. The business penalty gradient rule 40d can include the business anomaly score, such as... Figure 5 The example scores 1, 2, and 3. Furthermore, the business penalty gradient rule 40d can include penalty difficulty that maps to the business anomaly scores, such as... Figure 5 The example illustrates penalty difficulty M1 mapped to score 1, penalty difficulty M2 mapped to score 2, and penalty difficulty M3 mapped to score 3. Therefore, the first consensus node 40z can obtain the penalty difficulty mapped to the target business anomaly score from the business penalty gradient rule 40d. It is understood that the business anomaly score in the business penalty gradient rule 40d can be a single value or a range of values; this embodiment does not limit this and can be set according to the actual application scenario. It is understood that the larger the target business anomaly score, the larger the penalty parameter.

[0169] Furthermore, the first consensus node 40z obtains the penalty parameter for the business node 20a, which is a random number.

[0170] Step S102: Based on the set of abnormal business behaviors, penalty parameters, and penalty difficulty, generate penalty transactions for business nodes.

[0171] Specifically, as can be seen from step S101, the first consensus node records the abnormal business behavior of the business node during the business heartbeat cycle. Therefore, when the set of abnormal business behavior meets the business penalty conditions, a penalty transaction is generated based on the set of abnormal business behavior, penalty parameters, penalty difficulty, and node identifier of the business node, and is used as a packaged transaction.

[0172] It is understood that when the first consensus node determines the penalty parameters for the current business heartbeat cycle, it can either start a penalty task based on the penalty parameters determined for the current business heartbeat cycle in real time, or start a penalty task for the next business heartbeat cycle based on the penalty parameters determined for the current business heartbeat cycle. This application embodiment does not limit this, and can be set according to the actual application scenario.

[0173] Step S103: Process the penalty transaction on the blockchain. When the penalty transaction is successfully processed on the blockchain, a penalty task notification carrying the penalty parameters and penalty difficulty is sent to the routing node. This allows the routing node to forward the penalty task notification to the business node when it receives a business request initiated by the business node. The penalty task notification is used to instruct the business node to perform the penalty removal process associated with the penalty parameters and penalty difficulty.

[0174] Specifically, a first consensus block is generated based on the penalty transaction, and this first consensus block is broadcast to the second consensus node in the consensus network. The voting results for the penalty transaction returned by the second consensus node are obtained, and the successful voting results are obtained from the voting results. The successful voting results are used to characterize the set of abnormal business behaviors to be detected for the business node as counted by the second consensus node. The data difference between the successful voting results and the set of abnormal business behaviors is less than the data difference threshold, and it is used to characterize the correlation between the set of abnormal business behaviors and the penalty difficulty, satisfying the penalty gradient rule for the business to be detected in the second consensus node. The ratio of the total number of results corresponding to the successful voting results to the total number of results corresponding to the voting results is calculated. If the ratio of the number of results is less than the success ratio threshold, it is determined that the penalty transaction failed to be uploaded to the chain.

[0175] The first consensus node generates a first block to be consensus based on penalty transactions and broadcasts it to the second consensus node in the consensus network. After receiving the first block, the second consensus node reaches consensus on the transaction data (including penalty transactions) in the first block. The consensus process for penalty transactions is as follows: The second consensus node counts its own generated set of abnormal business behaviors (i.e., the set of abnormal business behaviors to be detected) to obtain the first total number of occurrences corresponding to the abnormal business behaviors. It then calculates the difference between the first and second total number of occurrences. If the difference is greater than the threshold, the vote for the penalty transaction fails (the vote carries the first total number of occurrences). In this case, the consensus of the first block to be consensus fails. If the difference is equal to or less than the threshold, the score of the abnormal business behavior to be detected corresponding to the set of abnormal business behaviors is calculated. The calculation process is the same as the process by which the first consensus node calculates the target business abnormality score corresponding to the set of abnormal business behaviors, so it will not be elaborated here.

[0176] After obtaining the anomaly score of the service to be detected, the second consensus node obtains the penalty gradient rule for the service to be detected. If there is no mapping relationship between the anomaly score of the service to be detected and the penalty difficulty in the penalty transaction in the penalty gradient rule, the voting result for the penalty transaction can be determined as a failed vote (the vote carries the anomaly score of the service to be detected). At this time, the consensus of the first consensus block fails. If there is a mapping relationship between the anomaly score of the service to be detected and the penalty difficulty in the penalty transaction in the penalty gradient rule, the voting result for the penalty transaction can be determined as a successful vote.

[0177] The first consensus node obtains the voting results for the penalty transactions returned by the second consensus node, and calculates the ratio of the total number of results corresponding to the successful votes to the total number of results corresponding to the voting results. If the ratio of the number of results is less than the success ratio threshold, the penalty transaction is determined to have failed to be uploaded to the blockchain. If the ratio of the number of results corresponding to each transaction data in the first block to be reached for consensus is equal to or greater than the success ratio threshold, the first consensus node writes the first block to be reached for consensus into the blockchain.

[0178] When a penalty transaction is successfully recorded on the blockchain, the business node's business request can be frozen, meaning the consensus network refuses to process the business request initiated by that business node. It is understood that business requests can include data recording requests and data synchronization requests, as well as other types of business requests; this embodiment does not limit this. Furthermore, the first consensus node sends a penalty task notification carrying penalty parameters and penalty difficulty to the routing node, so that when the routing node receives a business request initiated by the business node, it forwards the penalty task notification to the business node. The penalty task notification instructs the business node to perform penalty removal processing associated with the penalty parameters and penalty difficulty. Specific processing steps may include:

[0179] Step 1: After the business node receives the penalty task notification forwarded by the routing node, it generates a random number (i.e., the penalty removal parameter). The penalty parameter is also a random number. This application embodiment does not limit the method of generating the penalty parameter and the random number.

[0180] Step 2: The business node calculates H(x, y), where x represents the penalty parameter and y represents the parameter to remove the penalty. This application embodiment does not limit the generation method of (x, y), which can be the concatenation of x and y, the weighted sum of x and y, or other methods; H(x, y) represents the hash value corresponding to (x, y) obtained by the business node performing a hash calculation on (x, y). This application does not limit the hash algorithm, which can be any hash algorithm, as long as the business node and the consensus node in the consensus network agree on the same hash algorithm.

[0181] Step 3: If the target position of the hash value generated in Step 2 contains a target number of M bits or more (i.e., penalty difficulty), the business node removes the penalty; otherwise, Steps 1-3 are restarted. In this embodiment, the target position and target number are not limited; they only need to be agreed upon by the business node and the consensus network. For example, the target position is the preceding position of the hash value generated in Step 2, and the target number is 0.

[0182] Step 4: After calculating a valid hash value, the business node initiates a penalty removal transaction carrying penalty removal parameters to the routing node. When the routing node determines that the business node is in a normal connection state or a rate-limited connection state, but the historical request count is less than the allowed connection count, the routing node forwards the penalty removal transaction to the consensus network. Subsequent processing steps are detailed below. Figure 7 The corresponding embodiments are not described here.

[0183] As can be seen from the above, when the first consensus node determines that the set of abnormal business behaviors of a business node meets the business penalty conditions, it can punish the abnormal business behaviors of the business node by adjusting the penalty difficulty and penalty parameters. Therefore, it can increase the cost of malicious behavior for malicious nodes and thus improve the operational security of the blockchain network.

[0184] Please see Figure 6 , Figure 6 This is a flowchart illustrating a blockchain-based data processing method provided in an embodiment of this application. The method can be... Figure 1 This method is executed by any consensus node in the consensus network. For ease of understanding, this application embodiment uses the execution of the method by the first consensus node as an example for illustration. Figure 6 As shown, the method may include at least the following steps.

[0185] Step S201: When the business system time reaches the business heartbeat cycle, determine the target total number of target transaction data forwarded by the routing node, and determine the first total number of business abnormal behaviors in the business abnormal behavior set; the target transaction data is initiated by the business node.

[0186] Specifically, when determining the penalty parameters for the current business heartbeat cycle, the first consensus node can either start a penalty task based on the penalty parameters determined for the current business heartbeat cycle in real time, or start a penalty task for the next business heartbeat cycle based on the penalty parameters determined for the current business heartbeat cycle. This application embodiment does not limit this, and can be set according to the actual application scenario.

[0187] When the business system reaches the business heartbeat cycle, the first consensus node determines the target total number of target transaction data forwarded by the routing node, and determines the first total number of business abnormal behaviors in the set of business abnormal behaviors. It can be understood that the target transaction data is initiated by the business node, and the first total number is less than or equal to the target total number.

[0188] Step S202: Determine the ratio of the number of services to be mapped between the first total number and the target total number. If the ratio of the number of services to be mapped is greater than the service number ratio threshold, then determine that the set of abnormal business behaviors of the service node meets the business penalty conditions.

[0189] Specifically, it can be understood that if the proportion of the number of services to be mapped is less than or equal to 1, the closer it is to 1, the larger the total number of the target services, meaning that the number of abnormal business behaviors of the business nodes is large within the business system time. The proportion of the number of services to be mapped is compared with the business quantity proportion threshold. If the proportion of the number of services to be mapped is less than or equal to the business quantity proportion threshold, the first consensus node can determine that the set of abnormal business behaviors of the business node does not meet the business penalty conditions. If the proportion of the number of services to be mapped is greater than the business quantity proportion threshold, the set of abnormal business behaviors of the business node is determined to meet the business penalty conditions.

[0190] Step S203: When the first consensus node detects that the set of abnormal business behaviors of the business nodes meets the business penalty conditions, it obtains the business penalty gradient rule; the business penalty gradient rule includes the business quantity ratio and the penalty difficulty that has a mapping relationship with the business quantity ratio; the business quantity ratio includes the business quantity ratio to be mapped.

[0191] Step S204: Obtain the penalty difficulty that is mapped to the proportion of the number of services to be mapped from the business penalty gradient rules, and use it as the initial penalty difficulty.

[0192] Specifically, in conjunction with steps S203 and S204, the first consensus node obtains the penalty difficulty from the business penalty gradient rule based on the proportion of the number of businesses to be mapped. It can be understood that the larger the proportion of the number of businesses to be mapped, the larger the penalty parameter. The first consensus node uses the penalty difficulty obtained from the business penalty gradient rule as the initial penalty difficulty.

[0193] Step S205: Obtain the historical penalty difficulty of the business node, determine the penalty difficulty based on the historical penalty difficulty and the initial penalty difficulty, and generate penalty parameters for the business node.

[0194] Specifically, the process involves obtaining the first generation timestamp of the historical penalty difficulty and the second generation timestamp of the initial penalty difficulty; the first generation timestamp is earlier than the second generation timestamp; determining the time interval between the first and second generation timestamps and comparing the time interval with a time interval threshold; if the time interval is less than or equal to the time interval threshold, then the historical penalty difficulty is positively enhanced based on the initial penalty difficulty to obtain the penalty difficulty; if the time interval is greater than the time interval threshold, then the historical penalty difficulty is negatively enhanced based on the initial penalty difficulty to obtain the penalty difficulty.

[0195] It is understandable that even after a business node is relieved of its penalty, abnormal business behavior may continue, meaning that transaction data sent with abnormal business detection results may still exist. Based on this situation, this application's embodiments consider historical penalty difficulty. For example, if a business node's corresponding abnormal behavior set meets the penalty conditions within a continuous business heartbeat cycle, the first consensus node should adjust the penalty difficulty, i.e., increase the penalty difficulty for the business node. For instance, based on the initial penalty difficulty (determined by the set of abnormal business behavior within the current business system time), the historical penalty difficulty (determined by the set of abnormal business behavior within the historical business system time) is positively enhanced to obtain the penalty difficulty. Conversely, if a business node's corresponding abnormal behavior set does not meet the penalty conditions within a continuous business heartbeat cycle, the first consensus node should also adjust the penalty difficulty, i.e., decrease the penalty difficulty for the business node. For instance, based on the initial penalty difficulty (determined by the set of abnormal business behavior within the current business system time), the historical penalty difficulty (determined by the set of abnormal business behavior within the historical business system time) is negatively enhanced to obtain the penalty difficulty, or the initial penalty difficulty is determined as the penalty difficulty.

[0196] Step S206: Based on the set of abnormal business behaviors, penalty parameters, and penalty difficulty, generate penalty transactions for business nodes.

[0197] Step S207: Process the penalty transaction on the blockchain. When the penalty transaction is successfully processed on the blockchain, a penalty task notification carrying the penalty parameters and penalty difficulty is sent to the routing node. This allows the routing node to forward the penalty task notification to the business node when it receives a business request initiated by the business node. The penalty task notification is used to instruct the business node to perform the penalty removal process associated with the penalty parameters and penalty difficulty.

[0198] For the detailed implementation process of steps S206-S207, please refer to the above text. Figure 3 Steps S102-S103 in the corresponding embodiments will not be described in detail here.

[0199] As can be seen from the above, when the first consensus node determines that the set of abnormal business behaviors of a business node meets the business penalty conditions, it can punish the abnormal business behaviors of the business node by adjusting the penalty difficulty and penalty parameters. Therefore, it can increase the cost of malicious behavior for malicious nodes and thus improve the operational security of the blockchain network.

[0200] Please see Figure 7 , Figure 7 This is a flowchart illustrating a blockchain-based data processing method provided in an embodiment of this application. The method can be... Figure 1 This method is executed by any consensus node in the consensus network. For ease of understanding, this application embodiment uses the execution of the method by the first consensus node as an example for illustration. Figure 7 As shown, the method may include at least the following steps.

[0201] Step S301: Obtain the penalty removal transaction forwarded by the routing node; the penalty removal transaction is initiated by the business node; the penalty removal transaction carries penalty removal parameters.

[0202] Step S302: Obtain the target parameters generated based on the removal penalty parameters and the penalty parameters, and determine the summary information corresponding to the target parameters.

[0203] Step S303: If the digest information contains information that meets the penalty difficulty, then a second consensus block is generated based on the transaction that removes the penalty.

[0204] Based on the descriptions of steps S301-S303, please refer to the above text. Figure 3 In the corresponding embodiment, step S301 describes that after the first consensus node obtains the penalty relief transaction carrying the penalty relief parameter forwarded by the routing node, it obtains the target parameter, i.e. (x, y) as described above, based on the generation method agreed upon with the business node. Then, it obtains the digest information corresponding to the target parameter, i.e., it performs hash calculation on the target parameter to obtain the hash value. If there is information in the digest information that meets the penalty difficulty, the first consensus node generates a second block to be consensus based on the penalty relief transaction.

[0205] Step S304: Broadcast the second block to be reached for consensus to the second consensus node in the consensus network, so that the second consensus node can reach a consensus on the second block to be reached for consensus and return the consensus result.

[0206] Step S305: If the consensus result is a consensus pass, then the penalty on the business node is lifted and business request processing for the business node is started.

[0207] Step S306: If the consensus result is a consensus failure, a penalty hold notification is sent to the routing node so that when the routing node receives a business request initiated by the business node, it forwards the penalty hold notification to the business node.

[0208] As can be seen from the above, when the first consensus node determines that the set of abnormal business behaviors of a business node meets the business penalty conditions, it can punish the abnormal business behaviors of the business node by adjusting the penalty difficulty and penalty parameters. Therefore, it can increase the cost of malicious behavior for malicious nodes and thus improve the operational security of the blockchain network.

[0209] Please see Figure 8 , Figure 8 This is a flowchart illustrating a blockchain-based data processing method provided in an embodiment of this application. The method can be... Figure 1 The routing node in the process executes, such as Figure 8 As shown, the method includes at least the following steps.

[0210] Step S401: When the routing node detects that the set of abnormal connection behaviors of the service node meets the connection penalty conditions, it obtains the connection permissions corresponding to the set of abnormal connection behaviors from the connection penalty gradient rules.

[0211] Specifically, the routing node obtains the transaction data to be uploaded to the blockchain from the business node, carrying the signature to be verified. It decrypts the signature using the business node's public key to obtain a first digital digest. It then obtains a second digital digest of the transaction data to be uploaded to the blockchain and compares it with the first digital digest. If the first and second digital digests are different, it determines that the business node has a connection anomaly of type 1, and adds this connection anomaly to the set of connection anomalies for the business node. If the first and second digital digests are the same, the transaction data to be uploaded to the blockchain is forwarded to the consensus node in the consensus network so that the consensus node can process the transaction data to be uploaded to the blockchain.

[0212] Specifically, the routing node obtains the transaction data to be uploaded to the blockchain initiated by the business node; performs format verification on the transaction data to be uploaded to the blockchain to obtain the format verification result; the format verification result includes a first format verification result or a second format verification result; the first format verification result is used to indicate that the transaction data to be uploaded to the blockchain has a format error, and the second format verification result is used to indicate that the transaction data to be uploaded to the blockchain does not have a format error; if the format verification result is the first format verification result, it is determined that the business node has a connection anomaly behavior of the second connection anomaly type, and the connection anomaly behavior of the second connection anomaly type is added to the connection anomaly behavior set for the business node; if the format verification result is the second format verification result, the transaction data to be uploaded to the blockchain is forwarded to the consensus node in the consensus network so that the consensus node can process the transaction data to be uploaded to the blockchain.

[0213] Specifically, when the connection system time reaches the connection heartbeat cycle, the routing node determines the initial total number of initial transaction data initiated by the business node, and the total number of connections with abnormal connection behaviors in the connection abnormal behavior set; it determines the ratio of the number of connections to be mapped between the total number of connections and the initial total number. If the ratio of the number of connections to be mapped is greater than the connection ratio threshold, it determines that the connection abnormal behavior set of the business node meets the connection penalty condition; it obtains the connection penalty gradient rule; the connection penalty gradient rule includes the connection ratio and the connection permissions that are mapped to the connection ratio; the connection ratio includes the ratio of the number of connections to be mapped; it obtains the connection permissions that are mapped to the ratio of the number of connections to be mapped from the connection penalty gradient rule, and uses them as the initial connection permissions; it obtains the historical connection permissions of the business node, and determines the connection permissions based on the historical connection permissions and the initial connection permissions.

[0214] The specific process by which a routing node determines connection permissions based on historical connection permissions and initial connection permissions may include: obtaining the generation timestamps of historical connection permissions and initial connection permissions; the generation timestamps of historical connection permissions being earlier than the generation timestamps of initial connection permissions; determining the connection time interval between the generation timestamps of historical and initial connection permissions, and comparing the connection time interval with a connection time interval threshold; if the connection time interval is less than or equal to the connection time interval threshold, then the historical connection permissions are positively enhanced based on the initial connection permissions to obtain the connection permissions; if the connection time interval is greater than the connection time interval threshold, then the historical connection permissions are negatively enhanced based on the initial connection permissions to obtain the connection permissions.

[0215] Specifically, the set of connection anomaly behaviors includes E connection anomaly types; these E connection anomaly types include connection anomaly type F. g g is a positive integer and g is less than or equal to E; when the connection system time reaches the connection heartbeat cycle, the routing node obtains the connection anomaly type F from the set of connection anomaly behaviors. g The total number of connection anomaly behaviors is determined; based on the type weights corresponding to the E connection anomaly types, the total number of behaviors corresponding to the E connection anomaly types is weighted and summed to obtain the target connection anomaly score; if the target connection anomaly score is greater than the connection anomaly score threshold, then the set of connection anomaly behaviors of the business node is determined to satisfy the connection penalty condition; the connection penalty gradient rule is obtained; the connection penalty gradient rule includes the connection anomaly score and the connection permissions that have a mapping relationship with the connection anomaly score; the connection anomaly score includes the target connection anomaly score; the connection permissions that have a mapping relationship with the target connection anomaly score are obtained from the connection penalty gradient rule.

[0216] After the routing node obtains the transaction data to be uploaded to the blockchain, it performs connection checks on the transaction data. This embodiment does not limit the content of the connection checks; they can be set according to the actual application scenario. For ease of understanding and description, signature verification and format validation are used as examples of connection checks, and the specific process is as described above. This embodiment does not limit the total number of connection exception types; they can be set according to the actual application scenario. For ease of description, this embodiment uses two connection exception types as examples: the first connection exception type and the second connection exception type. A connection exception behavior belonging to the first connection exception type can be understood as a business node tampering with the actual transaction data initiated by other business nodes. A connection exception behavior belonging to the second connection exception type can be understood as a business node having a data format error.

[0217] Understandably, when a business node is detected to have connection anomalies of the first type, the routing node does not need to perform format validation and can refuse to forward the transaction data to be uploaded to the blockchain; furthermore, if a business node is detected to have connection anomalies of the second type, then the routing node will refuse to forward the transaction data to be uploaded to the blockchain.

[0218] Step S402: Upon receiving a business request initiated by a business node, based on connection permissions, the penalty task notification sent by the target consensus node when the penalty transaction is successfully uploaded to the chain is forwarded to the business node. This enables the business node to execute a penalty removal process associated with the penalty parameters and penalty difficulty according to the penalty task notification. The penalty task notification carries the penalty parameters and penalty difficulty. The penalty difficulty is obtained from the business penalty gradient rules when the target consensus node detects that the set of abnormal business behaviors of the business node meets the business penalty conditions, and the penalty difficulty is related to the set of abnormal business behaviors. The penalty parameters are generated by the target consensus node for the business node. The penalty transaction is generated based on the set of abnormal business behaviors, the penalty parameters, and the penalty difficulty.

[0219] Specifically, when a business request initiated by a business node is received, the historical request count of the business node is counted. The timestamp of the historical business request is earlier than the timestamp of the business request. If the historical request count is equal to the number of connections allowed in the connection permissions, the business request is refused to be forwarded to the target consensus node, and the penalty task notification sent by the target consensus node when the penalty transaction is successfully uploaded to the chain is forwarded to the business node. If the historical request count is less than the number of connections allowed, the business request is forwarded to the target consensus node, and the penalty task notification is forwarded to the business node.

[0220] Understandably, if a service node is in a connection-rejecting state or the number of historical requests equals the number of allowed connections, the routing node can refuse to forward the service request to the consensus network. In addition, if a service node is in a connection-rejecting state or the number of historical requests equals the number of allowed connections when sending a penalty-removal transaction, the routing node can still refuse to forward the penalty-removal transaction to the consensus network.

[0221] Optionally, if a routing node receives a penalty task notification for a business node sent by the target consensus node, it may refuse to forward the business request to the consensus network.

[0222] As mentioned above, when a routing node determines that the set of abnormal connection behaviors of a business node meets the connection penalty conditions, it can implement connection penalties for the abnormal connection behaviors of the business node through connection permissions. Therefore, it can increase the cost of malicious nodes and thus improve the operational security of the blockchain network.

[0223] Further, please see Figure 9 , Figure 9 This is a schematic diagram of the structure of a blockchain-based data processing device provided in an embodiment of this application. The aforementioned blockchain-based data processing device can be a computer program (including program code) running on a computer device; for example, the data processing device is application software. This device can be used to execute corresponding steps in the methods provided in the embodiments of this application. Figure 9 As shown, the blockchain-based data processing device 1 may include: a first generation module 11 and a transaction on-chain module 12.

[0224] The first generation module 11 is used to obtain the penalty difficulty corresponding to the set of abnormal business behaviors from the business penalty gradient rules and generate penalty parameters for the business node when the first consensus node detects that the set of abnormal business behaviors of the business node meets the business penalty conditions.

[0225] The first generation module 11 is also used to generate penalty transactions for business nodes based on the set of abnormal business behaviors, penalty parameters, and penalty difficulty.

[0226] The transaction on-chain module 12 is used to process penalty transactions on the blockchain. When a penalty transaction is successfully on-chain, a penalty task notification carrying penalty parameters and penalty difficulty is sent to the routing node. This allows the routing node to forward the penalty task notification to the business node when it receives a business request initiated by the business node. The penalty task notification is used to instruct the business node to perform penalty removal processing associated with the penalty parameters and penalty difficulty.

[0227] The specific functional implementation methods of the first generation module 11 and the transaction on-chain module 12 can be found in the above description. Figure 3Steps S101-S103 in the corresponding embodiment will not be described again here.

[0228] Please see again Figure 9 The blockchain-based data processing device 1 may further include: a first acquisition module 13 and a second generation module 14.

[0229] The first acquisition module 13 is used to acquire transaction data to be uploaded to the blockchain that is forwarded by the routing node; the transaction data to be uploaded to the blockchain is initiated by the business node.

[0230] The second generation module 14 is used to perform business verification on the transaction data to be uploaded to the blockchain and obtain a business verification result. The business verification result includes a first business verification result or a second business verification result. The first business verification result is used to indicate that there is an error in the transaction data to be uploaded to the blockchain. The second business verification result is used to indicate that there is no error in the transaction data to be uploaded to the blockchain.

[0231] The second generation module 14 is also used to determine that if the business verification result is the first business verification result, the business node has a business abnormal behavior of the first business abnormal type, and add the business abnormal behavior of the first business abnormal type to the business abnormal behavior set for the business node.

[0232] The second generation module 14 is also used to process the transaction data to be uploaded to the blockchain if the business verification result is the second business verification result.

[0233] The specific functional implementation methods of the first acquisition module 13 and the second generation module 14 can be found in the above description. Figure 3 Step S101 in the corresponding embodiment will not be described again here.

[0234] Please see again Figure 9 The blockchain-based data processing device 1 may further include: a second acquisition module 15.

[0235] The second acquisition module 15 is used to acquire the transaction data to be uploaded to the chain forwarded by the routing node and generate the hash value to be detected for the transaction data to be uploaded to the chain; the transaction data to be uploaded to the chain is initiated by the business node;

[0236] The second acquisition module 15 is also used to acquire a list of historical blocks that have been uploaded to the blockchain, and to acquire historical block information in the block list; the historical block information includes historical hash values, which refer to the hash values ​​of transaction data in historical blocks;

[0237] The second acquisition module 15 is further configured to match historical hash values ​​with the hash value to be detected to obtain a matching result; the matching result includes a first matching result or a second matching result; the first matching result is used to indicate that there is a historical hash value in the historical hash values ​​that is the same as the hash value to be detected; the second matching result is used to indicate that all historical hash values ​​are different from the hash value to be detected.

[0238] The second acquisition module 15 is also used to determine, if the matching result is the first matching result, that the business node has a business abnormal behavior of the second business abnormal type, and to add the business abnormal behavior of the second business abnormal type to the business abnormal behavior set for the business node.

[0239] The second acquisition module 15 is also used to process the transaction data to be uploaded to the blockchain if the matching result is the second matching result.

[0240] The specific implementation of the second acquisition module 15 can be found in the above description. Figure 3 Step S101 in the corresponding embodiment will not be described again here.

[0241] Please see again Figure 9 The blockchain-based data processing device 1 may also include: a third generation module 16.

[0242] The third generation module 16 is used to obtain the transaction data to be uploaded to the chain forwarded by the routing node; the transaction data to be uploaded to the chain is initiated by the business node; the transaction data to be uploaded to the chain carries contract information;

[0243] The third generation module 16 is also used to call the transaction execution function in the smart contract to execute the transaction data to be uploaded to the chain through contract information;

[0244] The third generation module 16 is also used to execute the transaction data to be uploaded to the blockchain according to the transaction execution function, and obtain the transaction execution result for the transaction data to be uploaded to the blockchain; the transaction execution result includes a first transaction execution result or a second transaction execution result; the first transaction execution result is used to indicate that the execution of the transaction data to be uploaded to the blockchain failed; the second transaction execution result is used to indicate that the execution of the transaction data to be uploaded to the blockchain was successful;

[0245] The third generation module 16 is also used to determine if the transaction execution result is the first transaction execution result, and to add the business abnormal behavior belonging to the third business abnormal type to the business abnormal behavior set for the business node.

[0246] The third generation module 16 is also used to process the transaction data to be uploaded to the blockchain if the transaction execution result is the second transaction execution result.

[0247] The specific implementation of the third generation module 16 can be found in the above description. Figure 3 Step S101 in the corresponding embodiment will not be described again here.

[0248] Please see again Figure 9 The blockchain-based data processing device 1 may further include: a first determining module 17.

[0249] The first determination module 17 is used to determine the target total number of target transaction data forwarded by the routing node and the first total number of business abnormal behaviors in the set of business abnormal behaviors when the business system time reaches the business heartbeat cycle; the target transaction data is initiated by the business node.

[0250] The first determining module 17 is also used to determine the ratio of the number of services to be mapped between the first total number and the target total number. If the ratio of the number of services to be mapped is greater than the service number ratio threshold, then the set of abnormal business behaviors of the service node is determined to meet the business penalty conditions.

[0251] The first generation module 11 may include: a first acquisition unit 111, a second acquisition unit 112, and a third acquisition unit 113.

[0252] The first acquisition unit 111 is used to acquire the business penalty gradient rule; the business penalty gradient rule includes the business quantity ratio and the penalty difficulty that has a mapping relationship with the business quantity ratio; the business quantity ratio includes the business quantity ratio to be mapped.

[0253] The second acquisition unit 112 is used to acquire the penalty difficulty that has a mapping relationship with the proportion of the number of services to be mapped from the business penalty gradient rule, and use it as the initial penalty difficulty.

[0254] The third acquisition unit 113 is used to acquire the historical penalty difficulty of the business node, and determine the penalty difficulty based on the historical penalty difficulty and the initial penalty difficulty.

[0255] The specific functional implementation methods of the first determining module 17, the first acquiring unit 111, the second acquiring unit 112, and the third acquiring unit 113 can be found above. Figure 6 Steps S201-S205 in the corresponding embodiment will not be described again here.

[0256] Please see again Figure 9 The third acquisition unit 113 may include: a first acquisition subunit 1131, a second acquisition subunit 1132, a first enhancement subunit 1133, and a second enhancement subunit 1134.

[0257] The first acquisition subunit 1131 is used to acquire the first generation timestamp of the historical penalty difficulty and the second generation timestamp of the initial penalty difficulty; the first generation timestamp is earlier than the second generation timestamp.

[0258] The second acquisition subunit 1132 is used to determine the time interval between the first generated timestamp and the second generated timestamp, and compare the time interval with the time interval threshold.

[0259] The first enhancement subunit 1133 is used to positively enhance the historical penalty difficulty based on the initial penalty difficulty if the time interval is less than or equal to the time interval threshold, so as to obtain the penalty difficulty.

[0260] The second enhancement subunit 1134 is used to reverse-enhance the historical penalty difficulty based on the initial penalty difficulty if the time interval is greater than the time interval threshold, so as to obtain the penalty difficulty.

[0261] The specific functional implementations of the first acquisition subunit 1131, the second acquisition subunit 1132, the first enhancement subunit 1133, and the second enhancement subunit 1134 can be found above. Figure 6 Step S205 in the corresponding embodiment will not be described again here.

[0262] Please see again Figure 9 The set of abnormal business behaviors includes A types of business anomalies; A types of business anomalies include B types of business anomalies. c c is a positive integer and c is less than or equal to A;

[0263] The blockchain-based data processing device 1 may further include: a second determining module 18.

[0264] The second determining module 18 is used to obtain the business exception type B from the set of abnormal business behaviors when the business system time reaches the business heartbeat cycle. c The second total number of abnormal business behaviors;

[0265] The second determining module 18 is also used to perform a weighted summation of the second total number corresponding to each of the A business anomaly types based on the type weights corresponding to the A business anomaly types, so as to obtain the target business anomaly score.

[0266] The second determining module 18 is also used to determine that the set of abnormal business behaviors of the business node satisfies the business penalty condition if the target business abnormal score is greater than the business abnormal score threshold.

[0267] The first generation module 11 may include a fourth acquisition unit 114 and a fifth acquisition unit 115.

[0268] The fourth acquisition unit 114 is used to acquire the business penalty gradient rule; the business penalty gradient rule includes the business anomaly score and the penalty difficulty that has a mapping relationship with the business anomaly score; the business anomaly score includes the target business anomaly score;

[0269] The fifth acquisition unit 115 is used to obtain the penalty difficulty that has a mapping relationship with the target business anomaly score from the business penalty gradient rules.

[0270] The specific functional implementation methods of the first determining module 17, the fourth acquiring unit 114, and the fifth acquiring unit 115 can be found in the above description. Figure 3 Step S101 in the corresponding embodiment will not be described again here.

[0271] Please see again Figure 9 The transaction on-chain module 12 may include: a broadcast block unit 121, a result acquisition unit 122, and a statistical result unit 123.

[0272] Broadcast block unit 121 is used to generate a first consensus block based on penalized transactions and broadcast the first consensus block to the second consensus node in the consensus network;

[0273] The result acquisition unit 122 is used to acquire the voting results for the penalty transactions returned by the second consensus node, and to acquire the voting success results in the voting results. The voting success results are used to characterize the set of abnormal business behaviors to be detected for the business nodes counted by the second consensus node, and the data difference between the set of abnormal business behaviors and the set of abnormal business behaviors is less than the data difference threshold. It is also used to characterize the correlation between the set of abnormal business behaviors and the penalty difficulty, and satisfies the penalty gradient rule for the business to be detected in the second consensus node.

[0274] The statistical results unit 123 is used to calculate the ratio of the total number of results corresponding to successful voting results to the total number of results corresponding to voting results. If the ratio of the number of results is less than the threshold of the success ratio, the transaction is determined to have failed to be penalized and recorded on the blockchain.

[0275] The specific functional implementation methods of the broadcast block unit 121, the result acquisition unit 122, and the statistical result unit 123 can be found in the above description. Figure 3 Step S103 in the corresponding embodiment will not be described again here.

[0276] Please see again Figure 9 The blockchain-based data processing device 1 may also include: a third acquisition module 19.

[0277] The third acquisition module 19 is used to acquire the penalty removal transaction forwarded by the routing node; the penalty removal transaction is initiated by the business node; the penalty removal transaction carries penalty removal parameters;

[0278] The third acquisition module 19 is also used to acquire the target parameters generated based on the removal penalty parameters and the penalty parameters, and to determine the summary information corresponding to the target parameters;

[0279] The third acquisition module 19 is also used to generate a second consensus block based on the transaction that lifts the penalty if the digest information contains information that meets the penalty difficulty.

[0280] The third acquisition module 19 is also used to broadcast the second consensus block to the second consensus node in the consensus network, so that the second consensus node can reach a consensus on the second consensus block and return the consensus result;

[0281] The third acquisition module 19 is also used to release the penalty on the business node and start the business request processing for the business node if the consensus result is a consensus pass result.

[0282] The third acquisition module 19 is also used to send a penalty hold notification to the routing node if the consensus result is a consensus failure result, so that the routing node forwards the penalty hold notification to the business node when it receives the business request initiated by the business node.

[0283] The specific implementation of the third acquisition module 19 can be found in the above description. Figure 7 Steps S301-S306 in the corresponding embodiment will not be described again here.

[0284] As can be seen from the above, when the first consensus node determines that the set of abnormal business behaviors of a business node meets the business penalty conditions, it can punish the abnormal business behaviors of the business node by adjusting the penalty difficulty and penalty parameters. Therefore, it can increase the cost of malicious behavior for malicious nodes and thus improve the operational security of the blockchain network.

[0285] Further, please see Figure 10 , Figure 10 This is a schematic diagram of the structure of a blockchain-based data processing device provided in an embodiment of this application. The aforementioned blockchain-based data processing device can be a computer program (including program code) running on a computer device; for example, the data processing device is application software. This device can be used to execute corresponding steps in the methods provided in the embodiments of this application. Figure 10 As shown, the blockchain-based data processing device 2 may include: a first acquisition module 21 and a first forwarding module 22.

[0286] The first acquisition module 21 is used to obtain the connection permission corresponding to the set of abnormal connection behaviors from the connection penalty gradient rule when the routing node detects that the set of abnormal connection behaviors of the service node meets the connection penalty condition.

[0287] The first forwarding module 22 is used, upon receiving a business request initiated by a business node, to forward the penalty task notification sent by the target consensus node when the penalty transaction is successfully uploaded to the chain to the business node, based on connection permissions. This enables the business node to execute a penalty removal process associated with the penalty parameters and penalty difficulty according to the penalty task notification. The penalty task notification carries the penalty parameters and penalty difficulty. The penalty difficulty is obtained from the business penalty gradient rules when the target consensus node detects that the set of abnormal business behaviors of the business node meets the business penalty conditions, and the penalty difficulty is related to the set of abnormal business behaviors. The penalty parameters are generated by the target consensus node for the business node. The penalty transaction is generated based on the set of abnormal business behaviors, the penalty parameters, and the penalty difficulty.

[0288] The specific functional implementation methods of the first acquisition module 21 and the first forwarding module 22 can be found in the above description. Figure 8 Steps S401-S402 in the corresponding embodiment will not be described again here.

[0289] Please see again Figure 10 The blockchain-based data processing device 2 may further include: a second acquisition module 23 and a second forwarding module 24.

[0290] The second acquisition module 23 is used to acquire the transaction data to be uploaded to the chain initiated by the business node and carrying the signature to be verified, and to decrypt the signature to be verified using the node public key of the business node to obtain the first digital digest.

[0291] The second acquisition module 23 is also used to acquire a second digital digest of the transaction data to be uploaded to the blockchain, and compare the first digital digest with the second digital digest.

[0292] The second forwarding module 24 is used to determine that the service node has a connection anomaly of the first connection anomaly type if the first digital digest is different from the second digital digest, and to add the connection anomaly of the first connection anomaly type to the connection anomaly behavior set for the service node.

[0293] The second forwarding module 24 is further configured to forward the transaction data to be uploaded to the blockchain to the consensus node in the consensus network if the first digital digest is the same as the second digital digest, so that the consensus node can process the transaction data to be uploaded to the blockchain.

[0294] The specific functional implementation methods of the second acquisition module 23 and the second forwarding module 24 can be found in the above description. Figure 8 Step S401 in the corresponding embodiment will not be described again here.

[0295] Please see again Figure 10The blockchain-based data processing device 2 may also include: a third forwarding module 25.

[0296] The third forwarding module 25 is used to obtain transaction data to be uploaded to the blockchain initiated by the business node;

[0297] The third forwarding module 25 is also used to perform format verification on the transaction data to be uploaded to the blockchain and obtain the format verification result; the format verification result includes the first format verification result or the second format verification result; the first format verification result is used to indicate that there is a format error in the transaction data to be uploaded to the blockchain, and the second format verification result is used to indicate that there is no format error in the transaction data to be uploaded to the blockchain;

[0298] The third forwarding module 25 is also used to determine that if the format verification result is the first format verification result, the business node has a connection abnormality behavior of the second connection abnormality type, and add the connection abnormality behavior of the second connection abnormality type to the connection abnormality behavior set for the business node.

[0299] The third forwarding module 25 is also used to forward the transaction data to be uploaded to the chain to the consensus node in the consensus network if the format verification result is the second format verification result, so that the consensus node can process the transaction data to be uploaded to the chain.

[0300] The specific implementation of the third forwarding module 25 can be found in the above description. Figure 8 Step S401 in the corresponding embodiment will not be described again here.

[0301] Please see again Figure 10 The blockchain-based data processing device 1 may further include: a first determining module 26.

[0302] The first determining module 26 is used to determine the initial total number of initial transaction data initiated by the business node and the total number of connections with abnormal behavior in the connection abnormal behavior set when the connection system time reaches the connection heartbeat cycle.

[0303] The first determining module 26 is used to determine the ratio of the number of connections to be mapped between the total number of connections and the initial total number. If the ratio of the number of connections to be mapped is greater than the connection ratio threshold, then the set of abnormal connection behaviors of the business node is determined to meet the connection penalty condition.

[0304] The first acquisition module 21 includes: a first acquisition unit 211, a second acquisition unit 212, and a third acquisition unit 213.

[0305] The first acquisition unit 211 is used to acquire the connection penalty gradient rule; the connection penalty gradient rule includes the connection quantity ratio and the connection permissions that have a mapping relationship with the connection quantity ratio; the connection quantity ratio includes the proportion of the number of connections to be mapped.

[0306] The second acquisition unit 212 is used to acquire connection permissions that have a mapping relationship with the proportion of the number of connections to be mapped from the connection penalty gradient rule, and use them as initial connection permissions.

[0307] The third acquisition unit 213 is used to acquire the historical connection permissions of the business node and determine the connection permissions based on the historical connection permissions and the initial connection permissions.

[0308] The specific functional implementation methods of the first determining module 26, the first acquiring unit 211, the second acquiring unit 212, and the third acquiring unit 213 can be found above. Figure 8 Step S401 in the corresponding embodiment will not be described again here.

[0309] Please see again Figure 10 The third acquisition unit 213 may include: a first acquisition subunit 2131, a second acquisition subunit 2132, a first enhancement subunit 2133, and a second enhancement subunit 2134.

[0310] The first acquisition subunit 2131 is used to acquire the generation timestamp of the historical connection permission and the generation timestamp of the initial connection permission; the generation timestamp of the historical connection permission is earlier than the generation timestamp of the initial connection permission.

[0311] The second acquisition subunit 2132 is used to determine the connection time interval between the generation timestamp of the historical connection permission and the generation timestamp of the initial connection permission, and compare the connection time interval with the connection time interval threshold.

[0312] The first enhancement subunit 2133 is used to positively enhance the historical connection permissions based on the initial connection permissions if the connection time interval is less than or equal to the connection time interval threshold, so as to obtain the connection permissions.

[0313] The second enhancement subunit 2134 is used to perform reverse enhancement on the historical connection permissions based on the initial connection permissions if the connection time interval is greater than the connection time interval threshold, so as to obtain the connection permissions.

[0314] The specific functional implementations of the first acquisition subunit 2131, the second acquisition subunit 2132, the first enhancement subunit 2133, and the second enhancement subunit 2134 can be found above. Figure 8 Step S401 in the corresponding embodiment will not be described again here.

[0315] Please see again Figure 10 The set of connection exception behaviors includes E connection exception types; E connection exception types include connection exception type F. g g is a positive integer and g is less than or equal to E;

[0316] The blockchain-based data processing device 1 may further include: a third acquisition module 27 and a second determination module 28.

[0317] The third acquisition module 27 is used to acquire connection anomaly type F from the set of connection anomaly behaviors when the connection system time reaches the connection heartbeat cycle. g The total number of connection-related abnormal behaviors;

[0318] The third acquisition module 27 is also used to perform a weighted summation of the total number of behaviors corresponding to the E connection anomaly types based on the type weights corresponding to the E connection anomaly types, so as to obtain the target connection anomaly score.

[0319] The second determining module 28 is used to determine that the set of connection abnormal behaviors of the business node satisfies the connection penalty condition if the target connection abnormal score is greater than the connection abnormal score threshold.

[0320] The first acquisition module 21 includes: a fourth acquisition unit 214 and a fifth acquisition unit 215.

[0321] The fourth acquisition unit 214 is used to acquire the connection penalty gradient rule; the connection penalty gradient rule includes the connection anomaly score and the connection permission that has a mapping relationship with the connection anomaly score; the connection anomaly score includes the target connection anomaly score;

[0322] The fifth acquisition unit 215 is used to acquire connection permissions that have a mapping relationship with the target connection anomaly score from the connection penalty gradient rule.

[0323] The specific functional implementation methods of the third acquisition module 27, the second determination module 28, the fourth acquisition unit 214, and the fifth acquisition unit 215 can be found above. Figure 8 Step S401 in the corresponding embodiment will not be described again here.

[0324] Please see again Figure 10 The first forwarding module 22 may include: a statistics request unit 221, a rejection request unit 222, and a forwarding request unit 223.

[0325] The statistics request unit 221 is used to count the number of historical requests initiated by the business node when a business request initiated by the business node is obtained; the initiation timestamp of the historical business request is earlier than the initiation timestamp of the business request.

[0326] The request rejection unit 222 is used to refuse to forward the business request to the target consensus node if the number of historical requests is equal to the number of connectable permissions, and to forward the penalty task notification sent by the target consensus node when the penalty transaction is successfully put on the chain to the business node.

[0327] The forwarding request unit 223 is used to forward the business request to the target consensus node and forward the penalty task notification to the business node if the number of historical requests is less than the number of connections.

[0328] The specific functional implementation methods of the statistics request unit 221, the rejection request unit 222, and the forwarding request unit 223 can be found in the above description. Figure 8 Step S402 in the corresponding embodiment will not be described again here.

[0329] As mentioned above, when a routing node determines that the set of abnormal connection behaviors of a business node meets the connection penalty conditions, it can implement connection penalties for the abnormal connection behaviors of the business node through connection permissions. Therefore, it can increase the cost of malicious nodes and thus improve the operational security of the blockchain network.

[0330] Further, please see Figure 11 , Figure 11 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 11 As shown, the computer device 1000 may include: at least one processor 1001, such as a CPU; at least one network interface 1004; a user interface 1003; a memory 1005; and at least one communication bus 1002. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and a keyboard. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as at least one disk drive. Optionally, the memory 1005 may also be at least one storage device located remotely from the aforementioned processor 1001. Figure 11 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a device control application program.

[0331] exist Figure 11 In the computer device 1000 shown, the network interface 1004 provides network communication functionality; 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:

[0332] When the first consensus node detects that the set of abnormal business behaviors of a business node meets the business penalty conditions, it obtains the penalty difficulty corresponding to the set of abnormal business behaviors from the business penalty gradient rules and generates penalty parameters for the business node.

[0333] Based on the set of abnormal business behaviors, penalty parameters, and penalty difficulty, penalty transactions are generated for business nodes.

[0334] Penalized transactions are processed on the blockchain. When a penalized transaction is successfully processed on the blockchain, a penalty task notification carrying penalty parameters and penalty difficulty is sent to the routing node. This allows the routing node to forward the penalty task notification to the business node when it receives a business request initiated by the business node. The penalty task notification is used to instruct the business node to perform the penalty removal process associated with the penalty parameters and penalty difficulty.

[0335] It should be understood that the computer device 1000 described in the embodiments of this application can execute the foregoing text. Figure 3 , Figure 6 , Figure 7 as well as Figure 8 The description of the blockchain-based data processing method in the corresponding embodiments can also be performed as described above. Figure 9 The description of the blockchain-based data processing device 1 in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated.

[0336] Further, please see Figure 12 , Figure 12 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 12 As shown, the aforementioned computer device 2000 may include: a processor 2001, a network interface 2004, and a memory 2005. Furthermore, the computer device 2000 may also include: a user interface 2003, and at least one communication bus 2002. The communication bus 2002 is used to implement communication between these components. The user interface 2003 may include a display screen and a keyboard; optionally, the user interface 2003 may also include a standard wired interface or a wireless interface. The network interface 2004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 2005 may be high-speed RAM or non-volatile memory, such as at least one disk storage device. Optionally, the memory 2005 may also be at least one storage device located remotely from the aforementioned processor 2001. Figure 12 As shown, the memory 2005, which is a computer-readable storage medium, may include an operating system, a network communication module, a user interface module, and a device control application program.

[0337] exist Figure 12 In the computer device 2000 shown, the network interface 2004 provides network communication functionality; the user interface 2003 is mainly used to provide an input interface for the user; and the processor 2001 can be used to call the device control application program stored in the memory 2005 to achieve:

[0338] When a routing node detects that the set of abnormal connection behaviors of a service node meets the connection penalty conditions, it retrieves the connection permissions corresponding to the set of abnormal connection behaviors from the connection penalty gradient rules.

[0339] Upon receiving a business request from a business node, based on connection permissions, the penalty task notification sent by the target consensus node when the penalty transaction is successfully uploaded to the chain is forwarded to the business node. This enables the business node to execute a penalty removal process associated with the penalty parameters and penalty difficulty according to the penalty task notification. The penalty task notification carries the penalty parameters and penalty difficulty. The penalty difficulty is obtained from the business penalty gradient rules when the target consensus node detects that the set of abnormal business behaviors of the business node meets the business penalty conditions, and the penalty difficulty is correlated with the set of abnormal business behaviors. The penalty parameters are generated by the target consensus node for the business node. The penalty transaction is generated based on the set of abnormal business behaviors, the penalty parameters, and the penalty difficulty.

[0340] It should be understood that the computer device 2000 described in the embodiments of this application can execute the foregoing text. Figure 3 , Figure 6 , Figure 7 as well as Figure 8 The description of the blockchain-based data processing method in the corresponding embodiments can also be performed as described above. Figure 10 The description of the blockchain-based data processing device 2 in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated.

[0341] This application also provides a computer-readable storage medium storing a computer program, the computer program including program instructions, which are implemented when executed by a processor. Figure 3 , Figure 6 , Figure 7 as well as Figure 8 For details on the data processing methods provided in each step, please refer to the above. Figure 3 , Figure 6 , Figure 7 as well as Figure 8 The implementation methods provided for each step will not be elaborated here. Furthermore, the beneficial effects of using the same method will also not be described in detail.

[0342] The aforementioned computer-readable storage medium can be an internal storage unit of the data processing apparatus or computer device provided in any of the foregoing embodiments, such as a hard disk or memory of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the computer device. Furthermore, the computer-readable storage medium can include both internal storage units and external storage devices of the computer 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 can also be used to temporarily store data that has been output or will be output.

[0343] This application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the aforementioned... Figure 3 , Figure 6 , Figure 7 as well as Figure 8 The description of the data processing method in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated.

[0344] The terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.

[0345] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.

[0346] The methods and related apparatuses provided in this application are described with reference to the method flowcharts and / or structural diagrams provided in this application. Specifically, each block of the method flowchart and / or structural diagram, as well as combinations of blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to create a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, generate instructions for implementing the process. Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 A process or multiple processes and / or structures illustrate the steps of the functions specified in one or more boxes.

[0347] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.

Claims

1. A data processing method based on blockchain, characterized in that, include: When the first consensus node detects that the set of abnormal business behaviors of a business node meets the business penalty conditions, it obtains the penalty difficulty corresponding to the set of abnormal business behaviors from the business penalty gradient rules and generates penalty parameters for the business node. Based on the set of abnormal business behaviors, the penalty parameters, and the penalty difficulty, a penalty transaction is generated for the business node; The penalty transaction is processed on the blockchain. When the penalty transaction is successfully processed on the blockchain, a penalty task notification carrying the penalty parameters and the penalty difficulty is sent to the routing node, so that when the routing node receives a business request initiated by the business node, it forwards the penalty task notification to the business node. The penalty task notification is used to instruct the business node to perform a penalty removal process associated with the penalty parameters and the penalty difficulty.

2. The method according to claim 1, characterized in that, The method further includes: Obtain the transaction data to be uploaded to the blockchain that is forwarded by the routing node; the transaction data to be uploaded to the blockchain is initiated by the business node; The transaction data to be uploaded to the blockchain is subjected to business verification to obtain a business verification result; the business verification result includes a first business verification result or a second business verification result; the first business verification result is used to indicate that the transaction data to be uploaded to the blockchain contains error information; the second business verification result is used to indicate that the transaction data to be uploaded to the blockchain does not contain error information. If the business verification result is the first business verification result, then it is determined that the business node has a business abnormality behavior of the first business abnormality type, and the business abnormality behavior of the first business abnormality type is added to the business abnormality behavior set for the business node. If the business verification result is the second business verification result, then the transaction data to be uploaded to the blockchain will be processed for blockchain upload.

3. The method according to claim 1, characterized in that, The method further includes: Obtain the transaction data to be uploaded to the blockchain forwarded by the routing node, and generate the hash value to be detected for the transaction data to be uploaded to the blockchain; the transaction data to be uploaded to the blockchain is initiated by the business node; Obtain a list of historical blocks that have been uploaded to the blockchain, and obtain historical block information from the list of blocks; the historical block information includes historical hash values, which refer to the hash values ​​of transaction data in the historical blocks; The historical hash values ​​are matched with the hash value to be detected to obtain a matching result; the matching result includes a first matching result or a second matching result; the first matching result is used to indicate that there is a historical hash value in the historical hash values ​​that is the same as the hash value to be detected; the second matching result is used to indicate that all the historical hash values ​​are different from the hash value to be detected. If the matching result is the first matching result, then it is determined that the business node has a business abnormality behavior that belongs to the second business abnormality type, and the business abnormality behavior that belongs to the second business abnormality type is added to the business abnormality behavior set for the business node. If the matching result is the second matching result, then the transaction data to be uploaded to the blockchain will be processed for blockchain upload.

4. The method according to claim 1, characterized in that, The method further includes: Obtain the transaction data to be uploaded to the blockchain forwarded by the routing node; the transaction data to be uploaded to the blockchain is initiated by the business node; the transaction data to be uploaded to the blockchain carries contract information; The transaction execution function in the smart contract, which is used to execute the transaction data to be uploaded to the blockchain, is invoked using the contract information. The transaction data to be uploaded to the blockchain is executed according to the transaction execution function to obtain a transaction execution result for the transaction data to be uploaded to the blockchain; the transaction execution result includes a first transaction execution result or a second transaction execution result; the first transaction execution result is used to indicate that the execution of the transaction data to be uploaded to the blockchain failed; the second transaction execution result is used to indicate that the execution of the transaction data to be uploaded to the blockchain succeeded. If the transaction execution result is the first transaction execution result, then it is determined that the business node has a business abnormal behavior belonging to the third business abnormal type, and the business abnormal behavior belonging to the third business abnormal type is added to the business abnormal behavior set for the business node. If the transaction execution result is the second transaction execution result, then the transaction data to be uploaded to the blockchain will be processed for blockchain upload.

5. The method according to claim 1, characterized in that, The method further includes: When the business system reaches the business heartbeat cycle, the target total number of target transaction data forwarded by the routing node is determined, and the first total number of business abnormal behaviors in the set of business abnormal behaviors is determined; the target transaction data is initiated by the business node; Determine the ratio of the number of services to be mapped between the first total number and the target total number. If the ratio of the number of services to be mapped is greater than the service number ratio threshold, then determine that the set of abnormal service behaviors of the service node meets the service penalty condition. The step of obtaining the penalty difficulty corresponding to the set of abnormal business behaviors from the business penalty gradient rules includes: Obtain the business penalty gradient rule; the business penalty gradient rule includes the business quantity ratio and the penalty difficulty that has a mapping relationship with the business quantity ratio; the business quantity ratio includes the business quantity ratio to be mapped; The penalty difficulty that is mapped to the proportion of the number of services to be mapped is obtained from the business penalty gradient rules and used as the initial penalty difficulty; Obtain the historical penalty difficulty of the business node, and determine the penalty difficulty based on the historical penalty difficulty and the initial penalty difficulty.

6. The method according to claim 5, characterized in that, Determining the penalty difficulty based on the historical penalty difficulty and the initial penalty difficulty includes: Obtain the first generation timestamp of the historical penalty difficulty, and obtain the second generation timestamp of the initial penalty difficulty; the first generation timestamp is earlier than the second generation timestamp. Determine the time interval between the first generated timestamp and the second generated timestamp, and compare the time interval with a time interval threshold; If the time interval is less than or equal to the time interval threshold, then based on the initial penalty difficulty, the historical penalty difficulty is positively enhanced to obtain the penalty difficulty; If the time interval is greater than the time interval threshold, then the historical penalty difficulty is reverse-enhanced based on the initial penalty difficulty to obtain the penalty difficulty.

7. The method according to claim 1, characterized in that, The set of abnormal business behaviors includes A types of business anomalies; the A types of business anomalies include B types of business anomalies. c c is a positive integer and c is less than or equal to A; The method further includes: When the business system time reaches the business heartbeat cycle, retrieve the business exception type B from the set of abnormal business behaviors. c The second total number of abnormal business behaviors; Based on the type weights corresponding to the A types of business anomalies, the second total number corresponding to the A types of business anomalies is weighted and summed to obtain the target business anomaly score. If the target business anomaly score is greater than the business anomaly score threshold, then the set of business anomaly behaviors of the business node is determined to meet the business penalty condition. The step of obtaining the penalty difficulty corresponding to the set of abnormal business behaviors from the business penalty gradient rules includes: Obtain the business penalty gradient rule; the business penalty gradient rule includes a business anomaly score and a penalty difficulty that has a mapping relationship with the business anomaly score; the business anomaly score includes the target business anomaly score; Obtain the penalty difficulty that has a mapping relationship with the target business anomaly score from the business penalty gradient rules.

8. The method according to claim 1, characterized in that, The on-chain processing of the penalized transaction includes: Based on the penalty transaction, a first consensus block is generated, and the first consensus block is broadcast to the second consensus node in the consensus network; Obtain the voting results for the penalized transaction returned by the second consensus node, and obtain the voting success results in the voting results; the voting success results are used to characterize the set of abnormal business behaviors to be detected for the business node counted by the second consensus node, the data difference between the set of abnormal business behaviors and the set of abnormal business behaviors is less than the data difference threshold, and are used to characterize the correlation between the set of abnormal business behaviors and the penalty difficulty, satisfying the penalty gradient rule for the business to be detected in the second consensus node; The ratio of the total number of successful voting results to the total number of results corresponding to the voting results is calculated. If the ratio of the number of results is less than the success ratio threshold, the penalty transaction is determined to have failed to be uploaded to the blockchain.

9. The method according to claim 1, characterized in that, The method further includes: Obtain the penalty removal transaction forwarded by the routing node; the penalty removal transaction is initiated by the service node; the penalty removal transaction carries penalty removal parameters; Obtain the target parameters generated based on the penalty removal parameters and the penalty parameters, and determine the summary information corresponding to the target parameters; If the summary information contains information that meets the penalty difficulty, then a second consensus block is generated based on the transaction that lifted the penalty. The second block to be reached for consensus is broadcast to the second consensus node in the consensus network, so that the second consensus node can reach a consensus on the second block to be reached for consensus and return the consensus result; If the consensus result is a consensus pass, the penalty on the business node is lifted, and business request processing for the business node is started. If the consensus result is a consensus failure, a penalty hold notification is sent to the routing node so that when the routing node receives a service request initiated by the service node, it forwards the penalty hold notification to the service node.

10. A data processing method based on blockchain, characterized in that, include: When a routing node detects that the set of abnormal connection behaviors of a service node meets the connection penalty conditions, it obtains the connection permissions corresponding to the set of abnormal connection behaviors from the connection penalty gradient rules. When a business request initiated by the business node is received, based on the connection permission, the penalty task notification sent by the target consensus node when the penalty transaction is successfully uploaded to the chain is forwarded to the business node, so that the business node can perform the penalty removal process associated with the penalty parameters and the penalty difficulty according to the penalty task notification. The penalty task notification carries the penalty parameters and the penalty difficulty; The penalty difficulty is obtained from the business penalty gradient rule when the target consensus node detects that the set of abnormal business behaviors of the business node meets the business penalty conditions, and the penalty difficulty is related to the set of abnormal business behaviors; the penalty parameter is generated by the target consensus node for the business node; the penalty transaction is generated based on the set of abnormal business behaviors, the penalty parameter, and the penalty difficulty.

11. The method according to claim 10, characterized in that, The method further includes: Obtain the transaction data to be uploaded to the blockchain initiated by the business node, which carries a signature to be verified, and decrypt the signature to be verified using the node public key of the business node to obtain the first digital digest. Obtain the second digital digest of the transaction data to be uploaded to the blockchain, and compare the first digital digest with the second digital digest; If the first digital digest is different from the second digital digest, it is determined that the service node has a connection anomaly behavior of the first connection anomaly type, and the connection anomaly behavior of the first connection anomaly type is added to the connection anomaly behavior set for the service node. If the first digital digest is the same as the second digital digest, the transaction data to be uploaded to the blockchain is forwarded to the consensus node in the consensus network so that the consensus node can process the transaction data to be uploaded to the blockchain.

12. The method according to claim 10, characterized in that, The method further includes: Obtain the transaction data to be uploaded to the blockchain initiated by the business node; The format of the transaction data to be uploaded to the blockchain is validated to obtain a format validation result; the format validation result includes a first format validation result or a second format validation result; the first format validation result is used to indicate that the transaction data to be uploaded to the blockchain has a format error, and the second format validation result is used to indicate that the transaction data to be uploaded to the blockchain does not have a format error. If the format verification result is the first format verification result, then it is determined that the business node has a connection exception behavior of the second connection exception type, and the connection exception behavior of the second connection exception type is added to the connection exception behavior set for the business node. If the format verification result is the second format verification result, the transaction data to be uploaded to the chain is forwarded to the consensus node in the consensus network so that the consensus node can process the transaction data to be uploaded to the chain.

13. The method according to claim 10, characterized in that, The method further includes: When the connection system time reaches the connection heartbeat cycle, determine the initial total number of initial transaction data initiated by the business node, and determine the total number of connections with connection abnormal behavior in the connection abnormal behavior set; Determine the ratio of the number of connections to be mapped between the total number of connections and the initial total number. If the ratio of the number of connections to be mapped is greater than the connection ratio threshold, then determine that the set of abnormal connection behaviors of the service node satisfies the connection penalty condition. Then, the connection permissions corresponding to the set of connection anomalies are obtained from the connection penalty gradient rules, including: Obtain the connection penalty gradient rule; the connection penalty gradient rule includes a connection quantity ratio and connection permissions that have a mapping relationship with the connection quantity ratio; the connection quantity ratio includes the proportion of the number of connections to be mapped; The connection permissions that are mapped to the proportion of the number of connections to be mapped are obtained from the connection penalty gradient rule and used as the initial connection permissions. Obtain the historical connection permissions of the business node, and determine the connection permissions based on the historical connection permissions and the initial connection permissions.

14. The method according to claim 10, characterized in that, When a business request initiated by the business node is received, based on the connection permission, the penalty task notification sent by the target consensus node when the penalty transaction is successfully uploaded to the chain is forwarded to the business node, including: When a business request initiated by the business node is obtained, the number of historical requests initiated by the business node is counted; the timestamp of the historical business request is earlier than the timestamp of the business request. If the number of historical requests is equal to the number of connectable requests in the connection permissions, then the business request will not be forwarded to the target consensus node, and the penalty task notification sent by the target consensus node when the penalty transaction is successfully uploaded to the chain will be forwarded to the business node. If the number of historical requests is less than the number of connections that can be made, the business request is forwarded to the target consensus node, and the penalty task notification is forwarded to the business node.

15. 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 data communication functions, the memory is used to store computer programs, and the processor is used to invoke the computer programs to cause the computer device to perform the method according to any one of claims 1 to 14.

16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded and executed by a processor to cause a computer device having the processor to perform the method of any one of claims 1-14.

17. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium, the computer instructions being adapted to be read and executed by a processor to cause a computer device having the processor to perform the method of any one of claims 1-14.

Citation Information

Patent Citations

  • Node processing method, related equipment and computer readable storage medium

    CN110650135A

  • Blockchain consensus excitation system and method based on large-scale scientific core computing

    CN110674533A