A hybrid consensus method and system based on dynamic trust evaluation in a blockchain

By building a dynamic trust evaluation engine and trust score mechanism at the bottom layer of the blockchain, and combining LSTM anomaly prediction and view reconfiguration protocol, the problems of malicious attacks and anomaly recovery in hybrid consensus systems under dynamic networks are solved, achieving efficient decentralization and rapid fault recovery.

CN122437848APending Publication Date: 2026-07-21SOUTH CHINA UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SOUTH CHINA UNIV OF TECH
Filing Date
2026-03-31
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing hybrid consensus mechanisms are vulnerable to malicious node attacks in dynamic network environments, especially blood loss attacks, and their abnormal recovery strategies are slow, resulting in reduced system activity and compromised decentralization.

Method used

A dynamic trust evaluation engine is built at the bottom node layer. It combines a weighted election mechanism of trust points and staked equity, and achieves rapid master node rotation and fault recovery through LSTM anomaly prediction and a two-stage pipelined view reconfiguration protocol.

Benefits of technology

It effectively mitigates the risk of node monopoly, enhances the system's resistance to attacks and activity, reduces view switching latency, and ensures the network's high decentralization and robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122437848A_ABST
    Figure CN122437848A_ABST
Patent Text Reader

Abstract

The application discloses a kind of hybrid consensus method and system based on dynamic trust evaluation in block chain, for the core technical problems such as node election centralization and extremely slow abnormal recovery faced by existing hybrid consensus mechanism in dynamic environment, dynamic trust evaluation engine with time attenuation is constructed in underlying node layer to quantize node behavior in real time;In the core consensus layer, a composite weighted random election mechanism is designed by combining trust points and staking weight, combined with anti-monopoly elimination strategy to prevent a small number of nodes from controlling the network for a long time;In the monitoring and optimization layer, a view reconfiguration protocol based on LSTM anomaly prediction and two-stage pipeline is introduced to skip fixed timeout waiting and realize fast primary node rotation.The application effectively breaks through the performance bottleneck of traditional block chain, not only guarantees the high decentralization of the system in long-term operation, but also realizes millisecond-level fault recovery and high-throughput stable performance in complex network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of blockchain underlying infrastructure and distributed system technology, specifically relating to a hybrid consensus method and system based on dynamic trust assessment in blockchain. Background Technology

[0002] Hybrid consensus mechanisms are a distributed consensus paradigm designed to overcome the performance bottlenecks of the traditional blockchain "blockchain trilemma" while balancing decentralization and high scalability. However, due to the dynamic nature of real-world network environments and the unreliability of node behavior, they are highly susceptible to collusive attacks or covert malicious activities by malicious participants. Within the framework of hybrid consensus, the system typically uses mechanisms such as Proof-of-Stake (PoS) at the underlying layer to dynamically elect a consensus committee from a massive number of nodes. Then, at the upper layer, Byzantine Fault Tolerance (BFT) protocols are used for rapid block confirmation within the committee. This not only preserves the decentralized characteristics of the underlying network but also significantly improves the system's transaction throughput (TPS) and response speed. In a hybrid consensus system, participating nodes participate in the election by staking tokens, gaining the right to record transactions and sharing the benefits. However, hybrid consensus systems are easily affected by dynamic network anomalies, particularly "stake bleeding attacks," where malicious nodes continuously forge blocks on a hidden private fork chain at a specific chosen time to accumulate stake. Compared to direct denial-of-service attacks, this bleeding-of-stake attack is more difficult to detect because it initially does not affect the mainnet's normal functions, and its behavior is more similar to that of benign nodes. Furthermore, when a master node launches a covert, minor delay attack, the central network struggles to detect it quickly. Because decentralized networks, for security reasons, lack an absolutely authoritative central node for coordination, their system liveness is reduced, making them more vulnerable to attacks. Undoubtedly, these complex attacks in dynamic environments pose a significant challenge to the security of hybrid consensus systems.

[0003] Existing hybrid consensus mechanisms primarily employ two methods to address malicious node behavior and anomaly recovery: The first is to increase the economic cost of malicious behavior by strictly binding token staking, thereby filtering consensus nodes; the second is to passively trigger master node rotation and view switching by setting a fixed long-term timeout at the consensus execution layer. The problem with the first approach is that static identity assumptions struggle to cope with the dynamic changes of frequent node joining, leaving, or intermittent malicious behavior. It not only fails to identify covert malicious activities such as stake bleeding attacks but also easily leads to a Matthew effect, where the rich get richer, resulting in a monopoly of accounting rights by a few whale nodes. The problem with the second approach is that fixed timeouts significantly impact the performance of the system's main task (consensus block production). When network fluctuations or a high proportion of malicious nodes occur, the entire blockchain system may stagnate for extended periods, contradicting the goal of high throughput in hybrid consensus mechanisms.

[0004] The main drawbacks of existing methods for defending against and recovering from dynamic anomalies in hybrid consensus mechanisms are as follows: 1. Most underlying node elections rely on static consensus mechanisms, lacking support for dynamic trust adjustments. This results in high computational overhead and an inability to cope with dynamic malicious nodes. For example, some existing blockchain security methods attempt to use Proof-of-Work (PoW) and Zero-Knowledge Proof (ZKP) for authentication and security protection. However, not only does PoW cause extremely high computational load, but it also completely fails to support dynamic trust adjustments. The system cannot downgrade or isolate malicious nodes, resulting in extremely low adaptability to dynamic malicious behavior (Blockchain-based security and authentication for forensics application using consensus proof of work and zero knowledge protocol, A Danti).

[0005] 2. Most existing blockchain security frameworks lack adaptive consensus switching mechanisms and automated attack detection layers, making them unable to block covert attacks in real time. For example, some existing blockchain frameworks used for sensitive data tracing investigations, while improving the integrity of evidence to some extent, are limited to a single static consensus and completely lack adaptive consensus switching mechanisms and automated attack detection layers. This means that when the master node is compromised or covert malicious activity occurs, the system can only passively shut down and cannot dynamically switch consensus groups (Integrated blockchain-based framework for investigating child sexual exploitation materials (CSEM) in India, C Singh, SKGautam, H Khajuria, BP Nayak).

[0006] 3. Currently, many deep learning-based anomaly detection models are computationally extremely demanding and limited to specific domains, making them difficult to deeply integrate with consensus mechanisms (such as BFT view switching). For example, some defense solutions integrate high-parameter models such as LSTM and BERT for network attack classification, but their computation is too heavy and only specific to Internet of Things (IoT) data streams, completely lacking integration with the underlying consensus mechanism and traceability layer of blockchain. This design, where detection and consensus are separated, not only limits the accuracy of identifying high-dimensional features but also results in excessively high defense costs (Hybrid IoT security model within integration of LSTM, BERT, ROBERTA and transform learning for attack classification, A Gupta, DC Misra).

[0007] 4. Existing recovery strategies are rigid and lack scalability, lacking distributed recovery protocols when attacked. Existing defense mechanisms often become ineffective when faced with widespread malicious activity from nodes due to a lack of automated detection and flexible state recovery. For example, some distributed ledger-based attribution defense schemes, while improving data transparency, have extremely limited scalability and lack automated detection layers and distributed key or state recovery mechanisms. This rigid and singular defense strategy is easily breached after a few nodes are maliciously taken over, resulting in extremely poor consensus recovery efficiency (Using distributedLedger technology for digital forensic investigation purposes on tenderingprojects, PT Ramazhamba, HS Venter). Summary of the Invention

[0008] This invention addresses the core technical problems of existing hybrid consensus mechanisms in dynamic environments, such as centralized node election (relying solely on token staking can easily lead to a few nodes monopolizing the network and making it vulnerable to malicious nodes secretly seizing control) and extremely slow anomaly recovery (traditional view switching is limited by fixed timeout mechanisms, causing system stagnation). It provides a hybrid consensus method and system based on dynamic trust assessment in blockchain. First, a dynamic trust assessment engine with time decay is built at the underlying node layer to quantify node behavior in real time. Second, a composite weighted random election mechanism integrating trust points and staked equity is designed at the core consensus layer, combined with anti-monopoly elimination strategies to dismantle the monopoly of a single stakeholder. Third, a trust-accelerated view reconfiguration protocol based on LSTM anomaly prediction and a two-stage pipeline is introduced through the monitoring and optimization layer to skip fixed timeout waiting and achieve rapid master node rotation. Finally, it achieves autonomous and secure consensus and rapid fault recovery through "dynamic trust quantification - composite weighted election - predictive view switching".

[0009] The present invention is achieved by at least one of the following technical solutions.

[0010] A hybrid consensus method based on dynamic trust assessment in blockchain includes the following steps: Step 1: Collect behavioral evidence of nodes at the P2P network layer and consensus layer in real time, continuously update the global trust table, and calculate the dynamic trust score of each node. Step 2: Calculate the composite election weight based on the token equity, dynamic trust score, and recent network activity of the nodes. Then, conduct multiple rounds of selection using a weighted random sampling algorithm, and combine anti-monopoly elimination and rotation mechanisms to dynamically elect a consensus committee based on the scale. Step 3: Collect the network heartbeat frequency and actual block delay data sequence of the master node in real time, and perform anomaly prediction and dynamic triggering; when it is determined that the master node is abnormal, skip the fixed long timeout timer, select a highly trusted node as the new master node based on the global trust table in Step 1, and complete the view reconfiguration through a two-stage pipeline of pre-switching and state synchronization recovery.

[0011] Furthermore, step 1 specifically includes: (1.1) Malicious behavior assessment and punishment: When evidence of malicious behavior is detected in a node, a punishment factor proportional to the severity of the malicious behavior is calculated and the trust score of this node is multiplicatively reduced; if the degree of malice exceeds the system's preset severity threshold, a kick-out message is generated and broadcast to the entire network, permanently depriving it of its consensus qualification. (1.2) Honest behavior evaluation and reward: When a node is detected to have honest behavior such as completing block proposals or voting on time, a reward factor is calculated, the trust value is accumulated, and a hard upper limit is set to prevent trust overflow. (1.3) Time smooth decay: Calculate the time interval between the current time and the last update time of this node. After each update, apply exponential smooth decay to the trust value to ensure that the trust score truly reflects the recent behavior of the node.

[0012] Furthermore, step 2 specifically includes: (2.1) Composite election weight calculation: For each node in the candidate node set, the composite election weight is calculated by comprehensively extracting the token equity staked on the blockchain, the dynamic trust points settled in the previous cycle, and the recent network activity of the node, and then summed to obtain the total weight of the entire network. (2.2) Weighted random sampling: In order to select a consensus committee of size k, the hash value of the previous block is used as a seed, and a verifiable random function is used to start k rounds of random selection. In each round of selection, a safe random number is generated in the range of 0 to the total weight of the entire network. The candidate node set is traversed and the weight is accumulated. When the accumulated value is greater than or equal to the safe random number for the first time, the node is determined to be elected and added to the committee set. (2.3) Anti-monopoly removal and rotation: Once a node is elected, it will be immediately removed from the candidate pool for this period and its corresponding weight will be precisely deducted from the total weight of the entire network, which will force a single node to not occupy multiple seats in the same committee.

[0013] Furthermore, the anomaly prediction and dynamic triggering in step 3 specifically include: collecting the network heartbeat frequency and actual block delay data sequence of the current master node in real time according to the time window, and outputting the predicted block delay at the current moment; The residual deviation between the actual delay and the predicted delay is calculated in real time. When the residual deviation is greater than the sum of the moving average of the historical residuals and the sensitivity tolerance coefficient multiplied by the standard deviation of the historical residuals, it is determined that the current master node is abnormal, and the failure judgment is immediately activated and an early warning broadcast is sent to the entire network simultaneously.

[0014] Furthermore, the view reconfiguration in step 3 specifically includes: (3.1) Leader selection mechanism based on trust score: When a view switch is triggered, the latest global trust table is directly queried to obtain the dynamic trust score of each online node in the consensus committee, and the node with the highest ranking and normal network status is selected as the candidate master node for the new round of view. (3.2) Pre-switch phase: The candidate new master node continuously listens to the early warning broadcast in the network. When the total number of independent messages in the set of valid early warning messages collected by the candidate new master node is greater than the threshold, it immediately extracts the context information of the current view locally and generates a proof of the legality of the new view. (3.3) State synchronization and recovery phase: The candidate new master node will broadcast the new view state packet containing the proof of legitimacy to the entire network. After receiving it, each slave node will perform signature verification in parallel. After the verification is successful, the local ledger will be synchronized to the latest state immediately, and the consensus block production process of the new view recovery will be seamlessly switched to.

[0015] Furthermore, the threshold is the maximum tolerable number of malicious nodes plus one, set according to the theoretical Byzantine fault tolerance model.

[0016] The system architecture for implementing the hybrid consensus method based on dynamic trust assessment in a blockchain includes: The node layer is responsible for P2P network communication and behavioral feature data collection, and continuously updates the global trust table through a dynamic trust evaluation engine. The input embedding layer is used to process the fused feature representation and spatial object attributes of the output, and to achieve unified encoding of multi-source data; The core processing layer is used to integrate the calculation of composite election weights, consensus committee election, and hybrid consensus execution logic. The monitoring and optimization layer is used to perform LSTM anomaly prediction and perception, as well as the predictive fast view reconfiguration protocol; The blockchain storage layer blocks are used to persistently store the global trust table and block logs.

[0017] A system for implementing the hybrid consensus method based on dynamic trust assessment in a blockchain, comprising: The data perception and trust assessment module is used to collect behavioral evidence of nodes at the P2P network layer and consensus layer. Combining time decay mechanism and reward and punishment mechanism, it continuously updates the global trust table using dynamic trust score update algorithm and calculates the dynamic trust score of each node. The consensus election and execution module is used to dynamically elect a consensus committee based on a dynamic trust-based weighted election mechanism. An anomaly detection and view reconfiguration module is used to accelerate the view reconfiguration protocol based on LSTM anomaly prediction and a two-stage pipeline, skipping fixed timeout waits to achieve fast master node rotation. The blockchain ledger storage module is used to persistently store the global trust table and block logs. A computer device according to the present invention includes a memory and a processor, the memory being electrically connected to the processor, the memory storing a computer program, which, when executed by the processor, causes the processor to implement the method described herein.

[0018] The present invention provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor implements the method described herein.

[0019] Compared with the prior art, the present invention can achieve at least the following beneficial effects: This invention breaks through the limitations of traditional hybrid consensus mechanisms. First, it designs a composite weighted election mechanism that integrates trust and stake at the underlying protocol level, deeply binding the historical honesty of nodes and effectively dismantling the risk of monopoly by giants brought about by single token stake. Combined with anti-monopoly elimination strategies, it greatly enhances the system's ability to resist stake bleeding attacks, ensuring the high degree of decentralization of the network in long-term operation. Second, it integrates anomaly prediction and view reconfiguration mechanisms, completely solving the pain point of extremely slow system anomaly recovery. It breaks through the inherent rigid timeout waiting mechanism in traditional BFT protocols, and uses an LSTM model for real-time prediction and triggering. Combined with trust-accelerated candidate master node selection and two-stage pipeline state synchronization, it minimizes the absolute latency of view switching, achieving extremely high activity and robustness of the system in the face of malicious attacks and network fluctuations. Attached Figure Description

[0020] Figure 1 This is a diagram showing the overall layered architecture of the blockchain hybrid consensus system in the embodiment.

[0021] Figure 2 This is a flowchart of the dynamic trust score update algorithm in the embodiment.

[0022] Figure 3 This is a flowchart of the weighted election of the consensus node committee in the embodiment. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0024] like Figure 1As shown, this embodiment proposes a hybrid consensus method based on dynamic trust evaluation in blockchain to achieve high availability and decentralized consensus in dynamic network environments. First, a dynamic trust evaluation engine with time decay is built at the node layer to quantify node behavior in real time. Second, a composite weighted random election mechanism integrating trust points and staked equity is designed at the core consensus layer, combined with an anti-monopoly elimination strategy to dismantle the monopoly of giants caused by single equity stakes. Finally, a trust-accelerated view reconfiguration protocol based on LSTM anomaly prediction and a two-stage pipeline is introduced through the monitoring and optimization layer to skip fixed timeout waiting and achieve rapid master node rotation.

[0025] Specifically, the hybrid consensus method based on dynamic trust assessment in a blockchain includes the following steps: Step 1: Multidimensional Dynamic Trust Assessment and Quantification. At the node level, a dynamic trust assessment engine collects behavioral evidence of nodes in real time at the P2P network layer and consensus layer. Combining time decay mechanism and reward and punishment mechanism, a dynamic trust score update algorithm is used to continuously update the global trust table and calculate the dynamic trust score of each node.

[0026] like Figure 2 As shown, this step aims to introduce a dynamic trust evaluation engine with a time decay mechanism and a strict reward and punishment mechanism at the node layer, abandoning the static identity assumption in traditional consensus. This engine collects behavioral evidence of nodes at the P2P network layer and consensus layer in real time and continuously updates the global trust table. The specific update process is as follows: (1.1) Intentional behavior assessment and exponential punishment.

[0027] When the system detects a node Evidence of malicious behavior When encountering situations such as sending conflicting blocks or prolonged periods of no response, the system calculates penalties based on a pre-defined penalty function. The severity of the punishment is directly proportional to the severity of the wrongdoing. Subsequently, the trust score for that node is multiplicatively reduced.

[0028] in, For: Evidence of node behavior The corresponding Abnormal Behavior Risk Coefficient is obtained using a standard key-value mapping technique based on hash tables, a technique found in computer science. The system pre-builds a static hash map dictionary locally, using various predefined error codes from the underlying blockchain protocol as keys, and mapping them to... The constant risk coefficient for each interval is used as a value. For example, for minor violations like "downtime," the constant value for dictionary lookup is 0.3; for serious Byzantine errors like "double signing / equivocation," the constant value is 0.9. The system parses and obtains behavioral evidence... After obtaining the specific error code, through A dictionary key-value pair lookup algorithm with time complexity can directly extract this constant value as the risk coefficient for abnormal behavior.

[0029] To quickly isolate high-risk nodes, if the level of malice exceeds a preset severity threshold... It will immediately generate and broadcast a call-out message to the entire network, permanently stripping it of its consensus eligibility.

[0030] (2) Honest behavior assessment and linear rewards.

[0031] If a node is detected to have performed honest actions such as timely block proposals or legitimate votes, a reward factor is calculated, and the trust value is accumulated. The calculation formula is as follows:

[0032]

[0033] in, As a reward factor; For reward calculation function; Contribute quantifiable values ​​to the system for honest behavior; To achieve the minimum value function, in one embodiment, a hard upper limit of 1.0 is set. This represents the accumulated trust value.

[0034] Unlike the "cliff-like punishment" for wrongdoing, the process of nodes building trust is "linear and slow" (i.e., additive accumulation). At the same time, by limiting the maximum score to 1.0 through a minimum value function, it fundamentally prevents old nodes from infinitely expanding their trust points through long-term accumulation, thereby preventing trust overflow and system centralization.

[0035] (3) Introduce a time-smoothing decay mechanism.

[0036] To prevent early-joining nodes from accumulating high scores and then remaining dormant for extended periods or suddenly committing malicious acts, an exponential smooth decay is applied to the trust value after each update. The calculation formula is as follows:

[0037] in, This is the latest dynamic trust score obtained after settlement; The final trust integral, after applying an exponentially smooth decay to the trust value, will serve as the base trust value for nodes to participate in subsequent consensus and the next cycle. The time interval between the current physical time and the last trust update time of this node; The attenuation constant is preset for the system to control the attenuation rate; For the natural constant It is an exponential function with base 0. Trust is time-sensitive. If a node does not participate in network contributions for a long period (i.e., ...), ... (Increases), and its trust score will automatically and smoothly decrease over time. This mechanism ensures that the trust score always and uniquely reflects the node's "recent" true behavioral performance.

[0038] Step 2: The weighted election mechanism of the consensus node committee based on dynamic trust undermines the risks of giant monopoly and centralization brought about by Proof-of-Stake (PoS), including the following steps: like Figure 3 As shown, in the core processing layer, this invention designs a consensus node committee weighted election mechanism based on dynamic trust to dismantle the risks of giant monopoly and centralization brought about by single proof of stake (PoS).

[0039] (1) Calculate the composite election weights.

[0040] For each node in the candidate node set, the system extracts its multi-dimensional features to calculate the composite election weight, the formula of which is:

[0041] in, For nodes The final composite election weights; For nodes The value of tokens staked in a blockchain smart contract. For nodes The dynamic trust score obtained from step 1; The nodes after logarithmic smoothing Recent network activity statistics (such as the number of legitimate messages sent recently); It is the natural logarithm function.

[0042] The probability of a node being elected no longer depends solely on its wealth. ), but wealth and honesty ( ) and diligence ( The product constraint of the three factors ( ). In particular, the natural logarithm function is introduced. This is to smooth out network activity and prevent certain nodes from disproportionately amplifying their election weight by maliciously collecting massive amounts of meaningless activity data.

[0043] (2) Weighted random sampling and anti-monopoly elimination.

[0044] After calculating the total weight of the entire network (i.e., all valid candidate nodes) Accumulated value After that, the system combines a verifiable random function (VRF) to enable... Round of random selection to select Members of the consensus committee.

[0045] In each round of selection, the system is in the interval Generate a safe random number Q; iterate through the candidate node set and accumulate weights, and when the accumulated value reaches a certain value... The node is selected when it is first greater than or equal to Q.

[0046] Anti-monopoly rotation strategy: Once a node is elected, the system immediately removes it from the candidate pool for the current cycle and... Precisely deduct its corresponding weight The significance of this strategy lies in ensuring that no single whale node (even with extremely high weight) can occupy multiple seats in the same consensus committee, thus severing the decentralization degradation brought about by Zipf's law from the bottom layer of the protocol.

[0047] Step 3: Seamlessly switch to the new view after verifying the signature from the node via the predictive fast view reconfiguration (switch) protocol, including the following steps: In the consensus execution phase, in response to the fatal flaw of the traditional BFT protocol being extremely slow to switch when encountering master node anomalies, this invention designs a trust-accelerated fast view switching protocol in the monitoring and optimization layer.

[0048] (1) Anomaly prediction and dynamic triggering based on LSTM sequences.

[0049] Anomaly detection module by time window Real-time acquisition of the actual block delay data sequence of the current master node Predict block latency based on historical sequence output and calculate triggering conditions:

[0050]

[0051] ; in, and Each represents the current time. The predicted block delay versus the actual block delay; For the prediction model function of the long short-term memory network deployed in the monitoring layer; This represents the absolute residual deviation between the actual and predicted values. and These are the moving average and standard deviation of the historical residual sequence for that node, respectively; The sensitivity tolerance coefficient is set. When the absolute residual deviation... If the sum of the moving average of the historical residuals and the preset sensitivity tolerance coefficient multiplied by the standard deviation of the historical residuals is greater than the sum of the two values, the current master node is determined to be abnormal. The failure determination is immediately activated and an early warning broadcast is sent to the entire network simultaneously.

[0052] The system abandons the rigid "fixed timeout" of traditional protocols. As soon as the current latency characteristics of the master node deviate from its own historical normal fluctuation range (i.e., the residual exceeds the mean plus several times the standard deviation), the system immediately determines that the current master node has an anomaly such as hidden malicious behavior or network paralysis tendency. It skips the fixed long timeout timer, immediately activates the failure judgment in advance, and broadcasts an early warning message to the entire network, compressing the fault detection time to the millisecond level.

[0053] (2) Leader selection mechanism based on trust score.

[0054] When the above steps determine that the current master node is abnormal and triggers a view switch, the system abandons the traditional polling and succession mechanism, and a new round of candidate master nodes for the view is selected. The selection formula is:

[0055] in, To establish a new round of candidate master node designations; This is the set of valid nodes in the current consensus committee. For nodes Dynamic trust score; For nodes The current network online status parameter (1 for online connectivity, 0 for offline or no response); Sub-means to find the objective function The node where the maximum value is taken .

[0056] (3) Two-stage rapid switching pipeline execution.

[0057] View reconfiguration employs a two-stage pipeline of "pre-switchover" and "state synchronization". During the pre-switchover phase, the candidate new master node collects a set of valid early warning messages. The triggering condition is:

[0058] in, The total number of independent messages contained in the set of legitimate early warning messages (i.e., the cardinality of the set); This is the maximum number of malicious nodes that can be tolerated, based on the theoretical Byzantine fault-tolerant model.

[0059] Thanks to the underlying trust isolation mechanism, in one embodiment, the traditional PBFT protocol must collect [data] during view switching. A stringent threshold for confirmation has been safely downgraded to simply requiring the collection of [data / information]. A warning signal is issued. Once the criteria are met, the new master node immediately extracts the context and broadcasts the validity status packet of the new view. After the slave node verifies the signature, it seamlessly switches to the new view, greatly reducing network communication storms and the absolute latency of the switchover.

[0060] The system architecture for implementing the hybrid consensus method based on dynamic trust assessment in a blockchain includes: The node layer is responsible for P2P network communication and behavioral feature data collection, and continuously updates the global trust table through a dynamic trust assessment engine.

[0061] The input embedding layer is used to process the fused feature representation and spatial object attributes of the output, realizing unified encoding of multi-source data.

[0062] The core processing layer is used to integrate composite election weight calculation, consensus committee election, and hybrid consensus execution logic.

[0063] The monitoring and optimization layer is used to perform LSTM anomaly prediction and perception, as well as a predictive fast view reconfiguration protocol.

[0064] The blockchain storage layer blocks are used to persistently store the global trust table and block logs.

[0065] This embodiment provides a hybrid consensus system in a blockchain based on dynamic trust evaluation, provided by the above method, including: The data awareness and trust assessment module, deployed at the node layer, is used to collect behavioral evidence of nodes at the P2P network layer and consensus layer. Combining time decay mechanism and reward and punishment mechanism, it continuously updates the global trust table using a dynamic trust score update algorithm to calculate the dynamic trust score of each node.

[0066] The consensus election and execution module, deployed in the core processing layer, is used to dynamically elect a consensus committee based on a dynamic trust-based weighted election mechanism for consensus node committees.

[0067] The anomaly detection and view reconfiguration module, deployed in the monitoring and optimization layer, is used to accelerate the view reconfiguration protocol based on LSTM anomaly prediction and a two-stage pipeline, skipping fixed timeout waits to achieve fast master node rotation.

[0068] A blockchain ledger storage module deployed at the underlying level is used to persistently store the global trust table and block logs.

[0069] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined in this invention may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A hybrid consensus method based on dynamic trust assessment in blockchain, characterized in that, Includes the following steps: Step 1: Collect behavioral evidence of nodes at the P2P network layer and consensus layer in real time, continuously update the global trust table, and calculate the dynamic trust score of each node. Step 2: Calculate the composite election weight based on the token equity, dynamic trust score, and recent network activity of the nodes. Then, conduct multiple rounds of selection using a weighted random sampling algorithm, and combine anti-monopoly elimination and rotation mechanisms to dynamically elect a consensus committee based on the scale. Step 3: Collect the network heartbeat frequency and actual block delay data sequence of the master node in real time to perform anomaly prediction and dynamic triggering; When the master node is determined to be abnormal, the fixed long timeout timer is skipped, and a highly trusted node is selected as the new master node based on the global trust table in step 1. The view reconfiguration is completed through a two-stage pipeline of pre-switching and state synchronization recovery.

2. The hybrid consensus method based on dynamic trust assessment in blockchain according to claim 1, characterized in that, Step 1 specifically includes: (1.1) Malicious behavior assessment and punishment: When evidence of malicious behavior is detected in a node, a punishment factor proportional to the severity of the malicious behavior is calculated and the trust score of this node is multiplicatively reduced; if the degree of malice exceeds the system's preset severity threshold, a kick-out message is generated and broadcast to the entire network, permanently depriving it of its consensus qualification. (1.2) Honest behavior evaluation and reward: When a node is detected to have honest behavior such as completing block proposals or voting on time, a reward factor is calculated, the trust value is accumulated, and a hard upper limit is set to prevent trust overflow. (1.3) Time smooth decay: Calculate the time interval between the current time and the last update time of this node. After each update, apply exponential smooth decay to the trust value to ensure that the trust score truly reflects the recent behavior of the node.

3. The hybrid consensus method based on dynamic trust assessment in a blockchain according to claim 1, characterized in that, Step 2 specifically includes: (2.1) Composite election weight calculation: For each node in the candidate node set, the composite election weight is calculated by comprehensively extracting the token equity staked on the blockchain, the dynamic trust points settled in the previous cycle, and the recent network activity of the node, and then summed to obtain the total weight of the entire network. (2.2) Weighted random sampling: In order to select a consensus committee of size k, the hash value of the previous block is used as a seed, and a verifiable random function is used to start k rounds of random selection. In each round of selection, a safe random number is generated in the range of 0 to the total weight of the entire network. The candidate node set is traversed and the weight is accumulated. When the accumulated value is greater than or equal to the safe random number for the first time, the node is determined to be elected and added to the committee set. (2.3) Anti-monopoly removal and rotation: Once a node is elected, it will be immediately removed from the candidate pool for this period and its corresponding weight will be precisely deducted from the total weight of the entire network, which will force a single node to not occupy multiple seats in the same committee.

4. The hybrid consensus method based on dynamic trust assessment in a blockchain according to claim 1, characterized in that, The anomaly prediction and dynamic triggering in step 3 specifically include: collecting the network heartbeat frequency and actual block delay data sequence of the current master node in real time according to the time window, and outputting the predicted block delay at the current moment; The residual deviation between the actual delay and the predicted delay is calculated in real time. When the residual deviation is greater than the sum of the moving average of the historical residuals and the sensitivity tolerance coefficient multiplied by the standard deviation of the historical residuals, it is determined that the current master node is abnormal, and the failure judgment is immediately activated and an early warning broadcast is sent to the entire network simultaneously.

5. A hybrid consensus method based on dynamic trust assessment in a blockchain according to claim 1, characterized in that, The view reconfiguration in step 3 specifically includes: (3.1) Leader selection mechanism based on trust score: When a view switch is triggered, the latest global trust table is directly queried to obtain the dynamic trust score of each online node in the consensus committee, and the node with the highest ranking and normal network status is selected as the candidate master node for the new round of view. (3.2) Pre-switch phase: The candidate new master node continuously listens to the early warning broadcast in the network. When the total number of independent messages in the set of valid early warning messages collected by the candidate new master node is greater than the threshold, it immediately extracts the context information of the current view locally and generates a proof of the legality of the new view. (3.3) State synchronization and recovery phase: The candidate new master node will broadcast the new view state packet containing the proof of legitimacy to the entire network. After receiving it, each slave node will perform signature verification in parallel. After the verification is successful, the local ledger will be synchronized to the latest state immediately, and the consensus block production process of the new view recovery will be seamlessly switched to.

6. A hybrid consensus method based on dynamic trust assessment in a blockchain according to claim 5, characterized in that, The threshold is the maximum number of malicious nodes that can be tolerated, plus one, as set according to the theoretical Byzantine fault tolerance model.

7. A system architecture for implementing the hybrid consensus method based on dynamic trust assessment in a blockchain as described in any one of claims 1 to 6, characterized in that, include: The node layer is responsible for P2P network communication and behavioral feature data collection, and continuously updates the global trust table through a dynamic trust evaluation engine. The input embedding layer is used to process the fused feature representation and spatial object attributes of the output, and to achieve unified encoding of multi-source data; The core processing layer is used to integrate the calculation of composite election weights, consensus committee election, and hybrid consensus execution logic. The monitoring and optimization layer is used to perform LSTM anomaly prediction and perception, as well as the predictive fast view reconfiguration protocol; The blockchain storage layer blocks are used to persistently store the global trust table and block logs.

8. A system for implementing a hybrid consensus method based on dynamic trust assessment in a blockchain as described in any one of claims 1 to 6, characterized in that, include: The data perception and trust assessment module is used to collect behavioral evidence of nodes at the P2P network layer and consensus layer. Combining time decay mechanism and reward and punishment mechanism, it continuously updates the global trust table using dynamic trust score update algorithm and calculates the dynamic trust score of each node. The consensus election and execution module is used to dynamically elect a consensus committee based on a dynamic trust-based weighted election mechanism. An anomaly detection and view reconfiguration module is used to accelerate the view reconfiguration protocol based on LSTM anomaly prediction and a two-stage pipeline, skipping fixed timeout waits to achieve fast master node rotation. The blockchain ledger storage module is used to persistently store the global trust table and block logs.

9. A computer device comprising a memory and a processor, the memory being electrically connected to the processor, the memory storing a computer program, characterized in that: When the computer program is executed by the processor, it causes the processor to implement the method as described in any one of claims 1 to 6.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor implements the method as described in any one of claims 1 to 6.