A method for optimizing selection of a carbon inclusive blockchain consensus algorithm proposal node
By combining statistical methods and a carbon inclusive performance prediction model with the maximum weighted independent set algorithm, the number of memory fragments is dynamically adjusted, solving the problem of low efficiency in the selection of proposal nodes in blockchain consensus algorithms, and achieving efficient and accurate node screening and network performance optimization.
Patent Information
- Application Number
- CN202511284961.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-10
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-09-10
AI Technical Summary
Existing blockchain consensus algorithms suffer from inefficient node selection and an inability to effectively exclude nodes with abnormal performance, leading to unstable network performance.
The mathematical mean and standard deviation of the consensus efficiency scores of candidate nodes are calculated using statistical methods. Combined with the carbon inclusive performance prediction model and the maximum weighted independent set algorithm, the number of memory fragments is dynamically adjusted, and proposal nodes are screened through a multi-round voting verification process.
This significantly improves the accuracy and efficiency of proposal node selection, ensuring that the selected nodes have excellent network performance and processing capabilities, thereby enhancing the stability and consensus efficiency of the blockchain network.
Smart Images

Figure CN120785520B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of carbon inclusive blockchain technology, and specifically relates to an optimization method for selecting proposal nodes for a carbon inclusive blockchain consensus algorithm. Background Technology
[0002] As a core technology of distributed systems, blockchain consensus algorithms primarily rely on random selection or static sorting mechanisms based on proof-of-stake for proposal node selection. These methods are widely used in applications with high network performance requirements, such as carbon credit programs. Existing node selection mechanisms typically employ fixed screening criteria, lacking in-depth analysis and dynamic evaluation capabilities of historical node performance, making it difficult to accurately identify and exclude outlier nodes. In current blockchain consensus systems, due to the lack of effective statistical analysis methods and intelligent prediction mechanisms, outlier nodes with consensus efficiency scores significantly deviating from the normal range can still participate in the proposal process, leading to a decline in overall consensus efficiency and network instability. In other words, existing technologies suffer from inefficient proposal node selection and an inability to effectively exclude outlier nodes. Summary of the Invention
[0003] In view of this, the present invention provides an optimized method for selecting proposal nodes in the consensus algorithm of the carbon inclusive blockchain, which can solve the technical problems of low efficiency in selecting proposal nodes in the existing blockchain consensus algorithm and the inability to effectively exclude nodes with abnormal performance.
[0004] This invention is implemented as follows: An optimized method for selecting proposal nodes in a carbon-inclusive blockchain consensus algorithm includes: a node initiates a new epoch, records the current block height as the block height value, counts the total number of candidate nodes as the candidate node number, assigns a candidate node number to each candidate node, and queries the consensus efficiency score of each candidate node in the previous epoch on the chain; statistical methods are applied to calculate the mathematical mean and standard deviation of the consensus efficiency scores of all candidate nodes, and a deviation adjustment coefficient is used to determine whether the node score meets the outlier criteria, marking nodes that meet the outlier criteria as outliers; a carbon-inclusive performance prediction model and a dynamic memory adjustment function are applied to evaluate and predict the network performance of candidate nodes, removing outliers from the candidate status of this epoch, and a maximum weighted independent set algorithm is applied to generate a proposal node list for this epoch; the proposal node packages and proposes a block at a specified block height and broadcasts the block data; the verification node performs transaction validity verification and state execution verification and broadcasts the vote; multiple rounds of voting verification are executed, and consensus participation points are added to participating nodes; after the block is submitted, the node score list is sent and written into the header of the next block.
[0005] The "new era" refers to a time management unit in the blockchain system with a fixed number of blocks as the period, used to periodically adjust the qualifications of candidate nodes and update the identities of consensus participants.
[0006] The consensus efficiency score refers to a numerical indicator that quantifies the performance of nodes in the consensus process. It is calculated by statistically analyzing the effective participation and response speed of nodes in each round of voting. The formula for calculating the consensus efficiency score is the number of times each node successfully participated in voting in the previous era, divided by the total number of voting rounds, and then multiplied by 100.
[0007] The outlier determination condition refers to the mathematical condition for determining whether a node is an outlier node. When the difference between the mathematical mean and the node consensus efficiency score is greater than the product of the deviation adjustment coefficient and the standard deviation, the outlier determination condition is met.
[0008] The deviation adjustment coefficient refers to a numerical parameter that controls the strictness of outlier node identification and is used to adjust the sensitivity of outlier determination. The deviation adjustment coefficient ranges from 0.5 to 2.0.
[0009] The specific structure of the carbon inclusive performance prediction model is a time-series prediction network based on the Transformer-XL architecture, which includes an encoder layer for processing historical performance data of nodes, a decoder layer for generating future performance prediction results, and a memory mechanism for processing long-sequence node performance change patterns.
[0010] The number of memory segments in the memory mechanism of the carbon inclusive performance prediction model is adjusted by a dynamic memory adjustment function based on the epoch cycle length and the number of candidate nodes. When the epoch cycle length is large or the number of candidate nodes is large, the number of memory segments is increased; when the epoch cycle length is small or the number of candidate nodes is small, the number of memory segments is decreased.
[0011] The dynamic memory adjustment function calculates the memory adjustment value based on the epoch cycle length, the number of candidate nodes, and the network complexity index. The calculation formula for the memory adjustment value is the sum of the epoch cycle length divided by 100, the number of candidate nodes divided by 50, and the network complexity index divided by 10, divided by 3.
[0012] Specifically, when the memory adjustment value is in the range of 0 to 0.3, 8 basic memory segments are used to adjust the memory mechanism parameters of the carbon inclusive performance prediction model; when the memory adjustment value is in the range of 0.3 to 0.7, 16 medium memory segments are used; and when the memory adjustment value is in the range of 0.7 to 1.0, 32 extended memory segments are used.
[0013] The application steps of the maximum weighted independent set algorithm specifically include constructing a weighted undirected graph from the remaining candidate nodes after removing outliers, with each candidate node as a vertex of the graph, the consensus efficiency score of the candidate node as the vertex weight, establishing edge connections of the graph based on the network connectivity and resource competition relationship between candidate nodes, and applying a greedy algorithm or dynamic programming algorithm to solve for the maximum weighted independent set of the weighted undirected graph.
[0014] The process includes establishing a training dataset before applying the carbon inclusive performance prediction model. This involves collecting historical operational data from multiple carbon inclusive blockchain networks, including node network latency time series, CPU utilization time series, memory utilization time series, block packaging success rate data, and voting response time data. Specifically, the training dataset is created by dividing the historical operational data into training sample sets according to time windows. Each training sample contains node performance data for a consecutive time period as an input feature vector and performance data for the next time period as a prediction target vector. Abnormal data is cleaned and standardized. The carbon inclusive performance prediction model training process involves dividing the comprehensive training dataset into a model training set and a model validation set at an 8:2 ratio, initializing the Transformer-XL model parameters and setting the initial memory fragment count to 16, and using the Adam optimization algorithm to train the model parameters. The specific steps for training the model parameters are as follows: set the learning rate parameter to 0.001, the batch size parameter to 32, and the number of training rounds to 100. During the training process, the number of memory segments is adjusted by a dynamic memory adjustment function based on the model validation set loss function value. When the model validation set loss function value does not improve for 5 consecutive training rounds, an early stopping mechanism is triggered.
[0015] The consensus participation score refers to the quantitative score that records the degree of contribution of a node in the consensus process. Each valid vote adds 1 point to the consensus participation score of a node.
[0016] The "sufficient number" refers to the minimum number of nodes required to ensure the credibility of the scoring list. The sufficient number is equal to the number of candidate nodes minus the Byzantine fault tolerance parameter plus 1.
[0017] This invention effectively identifies and eliminates outlier nodes with abnormal consensus efficiency scores by introducing a statistical outlier detection method combined with a carbon inclusive performance prediction model based on the Transformer-XL architecture and a maximum weighted independent set algorithm for node selection. This significantly improves the accuracy and efficiency of proposal node selection. The dynamic memory adjustment function used in this invention can adaptively adjust the prediction model parameters according to changes in the network environment, overcoming the limitations of traditional static selection mechanisms that cannot adapt to dynamic network changes, ensuring that the selected proposal nodes have optimal network performance and processing capabilities. Through the organic combination of multi-round statistical analysis, intelligent prediction evaluation, and graph theory optimization algorithms, this invention fundamentally solves the technical problems of low proposal node selection efficiency and the inability to effectively eliminate nodes with abnormal performance in existing consensus algorithms. Attached Figure Description
[0018] Figure 1 This is a flowchart of the method of the present invention.
[0019] Figure 2 This is a schematic diagram illustrating the division of epochal iteration stages. Detailed Implementation
[0020] 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.
[0021] like Figure 1 The diagram shown is a flowchart of an optimization method for selecting proposal nodes in a carbon-inclusive blockchain consensus algorithm provided by this invention. This method includes the following steps:
[0022] S01. The node starts a new era, records the current block height as the block height value, counts the total number of candidate nodes as the candidate node number, assigns a candidate node number to each candidate node, and queries the consensus efficiency score of each candidate node in the previous era on the chain.
[0023] S02. Calculate the mathematical mean and standard deviation of the consensus efficiency scores of all candidate nodes using statistical methods. Determine whether the node scores meet the outlier criteria based on the deviation adjustment coefficient. Mark the nodes that meet the outlier criteria as outlier nodes.
[0024] S03. The carbon inclusive performance prediction model and dynamic memory adjustment function are used to evaluate and predict the network performance of candidate nodes, remove outlier nodes from the candidate status in this era, and use the maximum weight independent set algorithm to generate the proposal node list for this era.
[0025] S04. The proposal node proposes a block package at the specified block height and broadcasts the newly packaged block data to other validator nodes.
[0026] S05. The verification node performs transaction validity verification and state execution verification on the blocks packaged by the proposing node. The verification node votes on the blocks based on the verification results and broadcasts the voting information to other nodes.
[0027] S06. The consensus algorithm executes a multi-round voting verification process. After receiving a valid vote, the node adds consensus participation points to the node that sent the vote.
[0028] S07. After a block is committed, each node sends its node score list to the proposal node at the next height. Once the proposal node receives a sufficient number of score lists, it writes the score list data into the block header of the next block.
[0029] Among them, the New Era is a time management unit in the blockchain system with a fixed number of blocks as the cycle, used to periodically adjust the qualifications of candidate nodes and update the identities of consensus participants.
[0030] The block height value is the sequence number of the latest block in the blockchain, used to determine the current state and progress of the blockchain.
[0031] The number of candidate nodes refers to the total number of blockchain nodes participating in the consensus algorithm, and the number of candidate nodes determines the scale and decentralization of the consensus network.
[0032] The candidate node number is a unique identifier assigned to each candidate node, used to distinguish and track different network nodes during algorithm execution.
[0033] Among them, the consensus efficiency score is a numerical indicator that quantifies the performance of nodes in the consensus process. It is calculated by statistically analyzing the effective participation and response speed of nodes in each round of voting. The formula for calculating the consensus efficiency score is the number of times each node successfully participated in voting in the previous era divided by the total number of voting rounds and then multiplied by 100.
[0034] The mathematical mean is the arithmetic mean of the consensus efficiency scores of all candidate nodes, and the formula for calculating the mathematical mean is the sum of the consensus efficiency scores of all candidate nodes divided by the number of candidate nodes.
[0035] The standard deviation is a statistic that measures the dispersion of consensus efficiency scores among candidate nodes. The standard deviation is calculated by taking the square root of the sum of the squares of the differences between each node's score and the mathematical mean, divided by the number of candidate nodes.
[0036] The deviation adjustment coefficient is a numerical parameter that controls the strictness of outlier node identification and is used to adjust the sensitivity of outlier determination. The deviation adjustment coefficient ranges from 0.5 to 2.0.
[0037] The outlier determination condition is a mathematical condition for determining whether a node is a performance abnormal node. When the difference between the mathematical mean and the node consensus efficiency score is greater than the product of the deviation adjustment coefficient and the standard deviation, it is determined that the outlier determination condition is met.
[0038] Outlier nodes are candidate nodes whose consensus efficiency scores deviate significantly from the normal range. Nodes with network performance or processing capabilities below average are identified through statistical methods.
[0039] Among them, the carbon inclusive performance prediction model is a node performance evaluation algorithm built on machine learning technology, which is used to predict the network latency and processing capacity performance of candidate nodes in the carbon inclusive scenario.
[0040] The dynamic memory adjustment function is a calculation function used to adjust the memory parameters of the carbon inclusive performance prediction model, and dynamically optimizes the memory length setting of the model according to changes in the network environment.
[0041] Among them, the maximum weighted independent set algorithm is a classic optimization algorithm in graph theory, which is used to find the set of vertices with the maximum total weight and no adjacency in a weighted graph. In this method, it is used to select the optimal combination of proposal nodes.
[0042] The proposal node list is a list of nodes responsible for packaging blocks within this epoch, and the proposal node list includes high-performance candidate node identifiers selected by an algorithm.
[0043] The specified block height is the block number in which the proposal node performs the block packaging operation, and the specified block height is within the range of the current block height value plus 1 to the current block height value plus the epoch period length.
[0044] The block data is a data structure containing transaction information, state updates, and consensus proofs, which is organized and packaged by the proposal nodes.
[0045] Among them, the verification node is a blockchain network node responsible for verifying the validity of the block and participating in voting. It is different from the proposal node but participates in the entire consensus process.
[0046] Among them, transaction validity verification is the process of verifying whether the transactions contained in the block comply with the blockchain rules and state transition requirements.
[0047] Among them, state execution verification is the process of simulating the execution of transactions in a block and verifying the correctness of state changes.
[0048] Among them, the voting information is a digital signature message from the verification node expressing its support or opposition to the validity of the block.
[0049] The multi-round voting verification process is an iterative voting process to ensure that the block obtains sufficient consensus support. The number of rounds in the multi-round voting verification process is determined by the security requirements of the consensus algorithm.
[0050] Among them, the consensus participation score is a quantitative score that records the degree of contribution of a node in the consensus process. Each valid vote adds 1 point to the consensus participation score of a node.
[0051] The node score list is a data list that records the consensus participation points obtained by all nodes in the current block consensus process.
[0052] The next height is the block number position of the current block height value plus 1.
[0053] The "sufficient number" refers to the minimum number of nodes required to ensure the credibility of the scoring list, which is equal to the number of candidate nodes minus the Byzantine fault tolerance parameter plus 1.
[0054] The Byzantine fault tolerance parameter is the maximum number of malicious or faulty nodes that the consensus algorithm can tolerate.
[0055] The scoring list data contains structured information including consensus participation scores for each node, which is used to update the historical consensus efficiency scores of the nodes.
[0056] The block header is a front part of the block data structure that contains metadata information and is used to store block digests and consensus-related information.
[0057] The specific structure of the carbon inclusive performance prediction model is a time-series prediction network based on the Transformer-XL architecture. It includes an encoder layer for processing historical performance data of nodes, a decoder layer for generating future performance prediction results, and a memory mechanism for processing long-sequence node performance change patterns. The number of memory segments in the memory mechanism is adjusted by a dynamic memory adjustment function according to the epoch period length and the number of candidate nodes. When the epoch period length is large or the number of candidate nodes is large, the number of memory segments is increased to capture more historical information. When the epoch period length is small or the number of candidate nodes is small, the number of memory segments is reduced to improve computational efficiency.
[0058] The steps for establishing the training dataset for the carbon inclusive performance prediction model specifically include collecting historical operating data from multiple carbon inclusive blockchain networks. The historical operating data includes node network latency time series, CPU utilization time series, memory utilization time series, block packaging success rate data, and voting response time data. The historical operating data is divided into training sample sets according to time windows. Each training sample contains node performance data within a continuous time period as an input feature vector and performance data for the next time period as a prediction target vector. Abnormal data is cleaned and standardized to establish a comprehensive training dataset that includes the node performance change patterns under different network conditions and loads.
[0059] The specific steps of training the carbon inclusive performance prediction model include dividing the comprehensive training dataset into a model training set and a model validation set in an 8:2 ratio, initializing the Transformer-XL model parameters and setting the initial number of memory segments to 16, using the Adam optimization algorithm to train the model parameters, setting the learning rate parameter to 0.001, the batch size parameter to 32, and the number of training epochs to 100, adjusting the number of memory segments according to the loss function value of the model validation set through a dynamic memory adjustment function to optimize the model performance, triggering an early stopping mechanism when the loss function value of the model validation set does not improve for 5 consecutive training epochs, and saving the model parameters with the best performance on the model validation set as the final training result.
[0060] The dynamic memory adjustment function is used to adjust the number of memory segments in the carbon inclusive performance prediction model. The dynamic memory adjustment function calculates the memory adjustment value based on the epoch period length, the number of candidate nodes, and the network complexity index. The formula for calculating the memory adjustment value is: epoch period length divided by 100, candidate node number divided by 50, and network complexity index divided by 10, then divided by 3. When the memory adjustment value is in the range of 0 to 0.3, a basic number of 8 memory segments is used to adjust the memory mechanism parameters of the carbon inclusive performance prediction model. When the memory adjustment value is in the range of 0.3 to 0.7, a medium number of 16 memory segments is used to adjust the memory mechanism parameters of the carbon inclusive performance prediction model. When the memory adjustment value is in the range of 0.7 to 1.0, an extended number of 32 memory segments is used to adjust the memory mechanism parameters of the carbon inclusive performance prediction model.
[0061] The application steps of the maximum weighted independent set algorithm specifically include constructing a weighted undirected graph from the remaining candidate nodes after removing outliers, with each candidate node as a vertex of the graph and the consensus efficiency score of the candidate node as the vertex weight; establishing edge connections in the graph based on the network connectivity and resource competition relationship between candidate nodes, with the edge weight representing the intensity of resource competition between nodes; applying a greedy algorithm or a dynamic programming algorithm to solve for the maximum weighted independent set of the weighted undirected graph; and using the candidate nodes corresponding to the vertices in the maximum weighted independent set as the proposal node list for this era.
[0062] The epoch cycle length, defined as the number of blocks in each new epoch, controls the time interval for adjusting candidate node eligibility; its value ranges from 100 to 1000 blocks. The network complexity index, a numerical parameter measuring the complexity of the blockchain network topology and communication, is calculated based on node connectivity and geographical distribution; its value ranges from 1 to 100. The number of memory segments is the number of data segments used to store historical information in the carbon inclusive performance prediction model, affecting the model's ability to learn long-term dependencies. The memory adjustment value is the output of the dynamic memory adjustment function, used to determine the appropriate level of memory segments for the carbon inclusive performance prediction model. The weighted undirected graph is a data structure in graph theory, consisting of a set of vertices and edges, each assigned a numerical weight. The vertex weight is the numerical value assigned to each vertex in the weighted undirected graph, corresponding to the comprehensive performance score of the candidate node in this method. The resource competition intensity is a numerical indicator measuring the degree of competition between two candidate nodes in terms of hardware resources or network bandwidth. The greedy algorithm is a heuristic algorithm for solving the maximum weight independent set problem, gradually constructing a global solution through local optimal choices. The dynamic programming algorithm is an exact algorithm for solving the maximum weight independent set problem, finding the optimal solution by decomposing subproblems and state transition equations.
[0063] The specific implementation methods of the above steps are described in detail below.
[0064] The specific implementation of step S01 involves the system first detecting a new epoch start signal and then initiating a node selection and optimization process. It obtains the sequence number of the latest block as the block height value through the blockchain status query interface; this value is used to determine the starting position and time anchor of the algorithm execution. The system then traverses all active nodes in the blockchain network, counting the total number of nodes that meet the candidate qualifications. The criteria for candidate qualifications include a node's online time exceeding 80% of the epoch cycle length, node hardware configuration meeting minimum performance requirements, and a node network connectivity test pass rate of over 95%. For each node that meets the candidate qualifications, the system assigns a unique candidate node number according to the order in which the node first joined the network. The sequence number uses an incremental integer encoding method to ensure the uniqueness and traceability of the node identifier. After completing the node statistics and numbering, the system queries the consensus efficiency score of each candidate node in the previous epoch through a smart contract interface. This score reflects the node's participation and response efficiency in the consensus process. The query process uses a batch reading mechanism to improve data acquisition efficiency.
[0065] The specific implementation of step S02 involves the system applying descriptive statistical methods to analyze the collected consensus efficiency scores of candidate nodes. First, the arithmetic mean of all candidate node scores is calculated as the mathematical mean, representing the average performance level of nodes in the network. Then, the standard deviation of the scores is calculated to measure the dispersion and distribution characteristics of node performance. The standard deviation is calculated using the sample standard deviation formula to obtain an unbiased estimate. The system sets a sensitivity threshold for outlier detection based on a preset deviation adjustment coefficient. A recommended value for the deviation adjustment coefficient is 1.5, which strikes a good balance between identifying anomalous nodes and maintaining the size of the candidate pool. For each candidate node, the system checks whether its consensus efficiency score meets the outlier detection criteria. That is, when the difference between the mathematical mean and the node score exceeds the product of the deviation adjustment coefficient and the standard deviation, the node is marked as an outlier. This outlier detection method based on statistical principles can effectively identify nodes whose performance significantly deviates from the normal range, preventing inefficient nodes from affecting the overall consensus efficiency.
[0066] The specific implementation of step S03 involves the system initiating the carbon-inclusive performance prediction module to evaluate the network performance of the remaining candidate nodes. The prediction model is based on a temporal neural network architecture and can predict future network latency and processing capacity based on the historical performance data of the nodes. The system inputs the historical performance feature vectors of the candidate nodes, including key indicators such as network latency sequences, CPU utilization sequences, and memory utilization sequences. The prediction model outputs the expected performance score of the node in the next epoch. The dynamic memory adjustment function automatically adjusts the memory mechanism parameters of the prediction model according to the complexity of the current network environment and the size of the candidate nodes, ensuring that the model can adapt to network environments of different sizes and complexities. The system then removes all nodes marked as outliers from the candidate pool to ensure the basic performance quality of the proposal nodes. After completing performance prediction and outlier removal, the system applies the maximum weighted independent set algorithm to select the optimal combination of proposal nodes. This algorithm constructs the remaining candidate nodes into a weighted graph structure, using the comprehensive performance score of the nodes as the vertex weight and the resource competition relationship between nodes as the edge weight. By solving the maximum weighted independent set problem, the system obtains the set of nodes that are mutually non-conflicting and have the largest total weight as the proposal node list.
[0067] The specific implementation of step S04 involves the system determining the block packaging timing for each proposal node based on the proposal node list and block production scheduling strategy. The scheduling strategy employs a round-robin mechanism to ensure that each proposal node receives a fair opportunity to produce blocks. When the specified block height is reached, the corresponding proposal node initiates the block packaging process. First, it selects transactions to be processed from the transaction pool. The transaction selection strategy comprehensively considers factors such as transaction fees, transaction priority, and block space limitations. The proposal node verifies the validity of the selected transactions, including digital signature verification, balance adequacy checks, and transaction format compliance checks, ensuring that all included transactions conform to the blockchain protocol specifications. Verified transactions are organized into a Merkle tree structure, generating a transaction root hash value as an important component of the block header. The proposal node constructs a complete block data structure, including necessary fields such as block header information, transaction list, and state root hash, and digitally signs the entire block to prove its origin and integrity. After completing the block packaging, the proposal node immediately broadcasts the new block data to all verification nodes via a peer-to-peer network protocol. The broadcast employs a layered propagation mechanism to improve propagation efficiency and network coverage.
[0068] The specific implementation of step S05 is as follows: Upon receiving a new block, the verification node immediately initiates the block verification process. First, it performs a compliance check on the basic format and structure of the block, including fundamental verification items such as the integrity of the block header fields, block size limits, and the reasonableness of the timestamp. The system then performs detailed validity checks on each transaction contained in the block. The verification process includes key steps such as cryptographic verification of transaction signatures, verification of the sender's account balance adequacy, and verification of the correctness of smart contract execution. After the transaction validity checks are completed, the verification node simulates the execution of all transactions in the block to verify the correctness of state transitions. The execution process uses a virtual machine environment to ensure the determinism and reproducibility of state changes. The system calculates the hash value of the new state root after execution and compares it with the state root declared in the block header to ensure the consistency and accuracy of state transitions. Based on the verification results, the verification node generates corresponding voting information. The voting information uses digital signature technology to ensure the authenticity and unforgeability of the vote. The verification node broadcasts the voting information to other network nodes via a network protocol. The voting message contains key information such as the block hash, voting results, node identifier, and digital signature. The broadcast mechanism uses an optimized propagation algorithm to reduce network latency and bandwidth consumption.
[0069] The specific implementation of step S06 involves the consensus algorithm executing a multi-round voting verification mechanism based on Byzantine fault tolerance theory to ensure that a block receives sufficient network consensus support before it can be formally confirmed. The system typically sets the number of voting rounds to three, with each round having a defined time window limit, recommended to be 30 seconds. Votes not received within this timeframe are considered invalid. In each voting round, nodes collect voting information from other verification nodes and verify the validity of the votes, including cryptographic verification of the vote signature, identity verification of the voting node, and format verification of the vote content. The system counts the number of nodes supporting and opposing the block in each round. When the number of supporting votes exceeds two-thirds of the total number of verification nodes, consensus is reached in that round; otherwise, the process proceeds to the next round. For each node that sends a valid vote, the system automatically adds one consensus participation point. This point accumulation mechanism incentivizes nodes to actively participate in the consensus process and maintain network activity. The multi-round voting mechanism aims to prevent abnormal situations such as network partitions, node failures, and malicious attacks, improving the security and reliability of block confirmation through a progressive consensus confirmation process.
[0070] The specific implementation of step S07 involves the following steps: After a block receives sufficient consensus support and is formally submitted to the blockchain, each validator node compiles the performance records of all nodes during this consensus process, generating a node score list containing node identifiers and corresponding consensus participation scores. The score list uses a structured data format to ensure data integrity and parsability, recording each node's specific performance and score acquisition during the current block consensus process. Each validator node sends its node score list to the designated proposal node at the next height via a secure communication protocol. The transmission process employs digital signatures and encryption mechanisms to ensure data authenticity and confidentiality. The proposal node at the next height continuously collects score lists from each validator node. Collection stops when the number of collected score lists reaches a sufficient threshold, which is equal to the total number of candidate nodes minus the Byzantine fault tolerance parameter plus 1. The Byzantine fault tolerance parameter is typically set to one-third of the total number of candidate nodes. The proposal node aggregates and verifies the consistency of the collected score lists, using a majority voting mechanism to determine the final node score result, resolving potential score discrepancies. The compiled scoring list data is written into the block header of the next block, becoming a permanent record of the blockchain state and providing historical basis for node selection in subsequent eras. This blockchain-based scoring mechanism ensures the transparency, immutability, and traceability of node performance data.
[0071] The carbon-inclusive performance prediction model employs a deep neural network design based on the Transformer-XL architecture. This architecture effectively models long-sequence data through self-attention and relative position encoding techniques. The encoder layer processes historical performance data of nodes, including multi-dimensional feature vectors such as network latency time series, CPU utilization time series, and memory utilization time series. The encoder captures the correlations and dependencies between different performance indicators through a multi-head attention mechanism. The decoder layer generates predicted values for the future performance of nodes based on the encoder's output. The prediction results include key performance parameters such as expected network latency, processing capacity assessment, and stability indicators. The model's memory mechanism uses a segmented recurrent memory design, capable of storing and utilizing historical information beyond the current input window. The number of memory segments is dynamically adjusted according to the network size and complexity: a basic configuration of 8 memory segments, a medium configuration of 16 memory segments, and an extended configuration of 32 memory segments. The dynamic memory adjustment function calculates the memory adjustment value based on the epoch period length, the number of candidate nodes, and the network complexity indicator. When the adjustment value is small, the basic memory configuration is used to improve computational efficiency; when the adjustment value is large, the extended memory configuration is used to enhance the model's long-term dependency learning ability.
[0072] The process of building the training dataset first requires collecting historical operational data from multiple running carbon-inclusive blockchain networks. The data collection period should ideally cover at least six months of network operation to ensure data representativeness and completeness. The collected historical operational data includes time-series data on node network latency, sampled every minute, recording communication latency between the node and other nodes in the network. CPU utilization time-series data records the load on the node's processor, sampled every 30 seconds, reflecting the node's computational resource consumption patterns. Memory utilization time-series data monitors the node's memory usage, also sampled every 30 seconds, to evaluate the node's resource management efficiency. Block packaging success rate data statistically analyzes the successful block production of nodes when acting as proposal nodes, calculating the success rate index using epochs as the statistical period. Voting response time data records the voting response speed of nodes during the verification process, reflecting the node's consensus participation efficiency. The data preprocessing stage first performs quality checks on the collected raw data, identifying and marking abnormal data points, including abnormal readings caused by sensor malfunctions, data loss due to network interruptions, and performance fluctuations caused by system restarts. Outlier handling employs statistical methods. Isolated outliers are repaired using interpolation, while consecutive outlier intervals are filled using the average of preceding and following data. Data standardization utilizes Z-score standardization to convert performance metrics of different dimensions into standardized values, eliminating the impact of dimensional differences on model training. Time window segmentation divides the standardized data into training samples with fixed time lengths. Each sample contains 72 consecutive hours of historical performance data as the input feature vector, and the following 24 hours of performance data as the prediction target vector. This segmentation allows the model to learn the patterns and trends of short-term performance changes.
[0073] The model training process employs stratified sampling, dividing the comprehensive training dataset into a training set and a validation set at an 8:2 ratio to ensure consistency in data distribution between the two sets. The Transformer-XL model parameters are initialized using the Xavier initialization method to ensure stable signal propagation between network layers, with an initial memory fragment size of 16 as the starting configuration. The training process uses the Adam optimization algorithm for iterative parameter updates. The Adam algorithm combines the advantages of momentum and adaptive learning rates, achieving stable convergence on complex loss functions. The learning rate is set to 0.001, providing sufficient parameter update amplitude while ensuring training stability. The batch size is set to 32, striking a balance between computational efficiency and gradient estimation accuracy, avoiding excessive variance in gradient estimation or waste of computational resources. The number of training epochs is set to 100, providing ample learning time for the model to converge to the optimal parameter configuration. During training, the system continuously monitors the model's loss function on the validation set. When the loss value's downward trend flattens, the dynamic memory adjustment function adjusts the number of memory segments based on the current learning state. Increasing the number of memory segments enhances the model's expressive power, while decreasing the number of memory segments prevents overfitting. The early stopping mechanism is triggered when the validation set loss function value does not improve for five consecutive training epochs. At this point, the model is considered to have reached its optimal state, and continuing training may lead to overfitting. The system saves the model parameters that perform best on the validation set as the final training result, ensuring that the deployed model has the best generalization ability and prediction accuracy.
[0074] The key technical ideas of this invention are mainly reflected in the following aspects. First, there is an outlier node identification technology based on statistical principles. This technology establishes a mathematical model for outlier determination by calculating the mathematical mean and standard deviation of the consensus efficiency scores of candidate nodes, automatically identifying nodes whose performance significantly deviates from the normal range. Compared to traditional fixed threshold filtering methods, statistical methods can dynamically adjust the judgment criteria according to the overall performance distribution of the network, avoiding misjudgments caused by changes in the network environment and improving the accuracy and adaptability of node selection. Second, there is the application of a carbon inclusive performance prediction model. This model is based on the Transformer-XL architecture and has the ability to process long-sequence data and capture long-term dependencies. Compared with traditional node evaluation based on rules or simple statistical methods, deep learning models can automatically learn complex performance change patterns from historical data, providing more accurate node performance predictions and reducing the consensus efficiency decline caused by inaccurate performance estimation. Third, there is the innovative application of the maximum weighted independent set algorithm in proposal node selection. This algorithm transforms the node selection problem into a graph theory optimization problem, comprehensively considering the performance weights of nodes and resource competition relationships, and can select the optimal node combination that has both high performance and no conflicts. Compared to traditional greedy or random selection methods, the maximum weighted independent set algorithm can optimize node configuration from a global perspective, maximizing overall consensus efficiency while avoiding performance interference caused by resource contention. Fourthly, the introduction of a dynamic memory adjustment mechanism adaptively adjusts the memory parameters of the prediction model based on network size and complexity, achieving a dynamic balance between computational efficiency and prediction accuracy.
[0075] The synergistic effect of these key technological approaches has yielded significant technical benefits and advantages. Statistical outlier detection provides high-quality data input for the performance prediction model, avoiding interference from noisy data by removing outlier nodes and improving the training effect and generalization ability of the prediction model. The accurate prediction results of the performance prediction model provide reliable node weight evaluation for the maximum weight independent set algorithm, enabling the algorithm to make optimal selections based on accurate performance information, thus improving the scientific nature and effectiveness of node selection. The dynamic memory adjustment mechanism ensures the adaptability and stability of the performance prediction model in different network environments, providing continuous and reliable technical support for the entire system. This multi-technology integration design has stronger robustness and higher overall performance compared to traditional single-technology solutions, and can maintain stable and efficient consensus operations in complex and ever-changing blockchain network environments.
[0076] It should be noted that this invention also solves the following technical problems: First, it addresses the technical problem of insufficient accuracy in node performance prediction in blockchain consensus algorithms. Traditional node performance evaluation methods mainly rely on static index analysis, which cannot accurately predict the future performance of nodes in dynamic network environments, leading to potential performance degradation of selected proposal nodes during the actual consensus process. This invention constructs a carbon-inclusive performance prediction model based on the Transformer-XL architecture. It utilizes the encoder layer to process multi-dimensional features of historical node performance data, including network latency time series, CPU utilization time series, and memory utilization time series, and combines this with the decoder layer to generate future performance prediction results. Furthermore, it uses a memory mechanism to process long-sequence node performance change patterns, significantly improving the accuracy and reliability of node performance prediction. Second, it solves the technical problem of the lack of adaptability in memory mechanism parameter configuration in blockchain consensus systems. Existing deep learning-based blockchain performance prediction models typically use fixed memory parameter settings, which cannot be dynamically adjusted according to changes in network size and complexity, resulting in unstable model performance under different network environments. This invention designs a dynamic memory adjustment function that calculates memory adjustment values based on epoch cycle length, number of candidate nodes, and network complexity index. It automatically selects the number of basic, medium, or extended memory segments according to different value ranges, realizing intelligent configuration of memory mechanism parameters and ensuring that the prediction model can maintain optimal learning ability and prediction accuracy under various network conditions.
[0077] Specifically, the principle of this invention is as follows: The fundamental reason why this invention can solve the core technical problem of low efficiency in proposal node selection and the inability to effectively exclude outlier nodes lies in its multi-layered node evaluation and screening mechanism. First, by calculating the mathematical mean and standard deviation of the consensus efficiency scores of candidate nodes, a scientific statistical basis is established, making the identification of outlier nodes have a quantitative standard. The introduction of the deviation adjustment coefficient further enhances the flexibility and accuracy of outlier determination. Second, the carbon inclusive performance prediction model based on the Transformer-XL architecture processes historical node performance data through the encoder layer, generates future performance prediction results through the decoder layer, and uses a memory mechanism to process long-sequence node performance change patterns, which can accurately predict the network latency and processing capacity performance of nodes in the carbon inclusive scenario. The dynamic memory adjustment function dynamically adjusts the number of memory segments according to the epoch period length, the number of candidate nodes, and the network complexity index, ensuring that the prediction model always maintains optimal performance. Finally, the maximum weighted independent set algorithm constructs candidate nodes into a weighted undirected graph. By solving for the set of vertices with the maximum total weight and no adjacency, it ensures that the selected proposal nodes not only have high performance but also avoid resource contention conflicts. The logical rigor of this multi-level screening mechanism lies in its progressive process, from statistical anomaly elimination and intelligent performance evaluation to graph theory optimization selection. Each step provides a more reliable data foundation for the next step, ultimately achieving efficient and accurate selection of proposal nodes.
[0078] The following provides a specific embodiment 1 of the present invention, and the specific implementation of each step in this embodiment 1 is described in detail below.
[0079] In this embodiment, the specific implementation of step S01 is the same as described above, and will not be repeated in detail here.
[0080] The specific implementation of step S02 involves the system applying statistical methods to perform data analysis on the consensus efficiency scores of candidate nodes. The specific representation of the mathematical mean calculation is as follows:
[0081] ;
[0082] In the formula, The mathematical mean of the consensus efficiency scores of all candidate nodes; For the first Consensus efficiency score of each candidate node; The number of candidate nodes; The candidate node index, with a value ranging from 1 to... .
[0083] The specific representation of the standard deviation value is as follows:
[0084] ;
[0085] In the formula, The standard deviation of the consensus efficiency score of candidate nodes; This represents the square of the difference between the score of each node and the mathematical mean; the meanings of other variables are the same as described above.
[0086] The specific criteria for determining outliers are expressed as follows:
[0087] ;
[0088] In the formula, The deviation adjustment coefficient ranges from 0.5 to 2.0, with a recommended value of 1.5; when this inequality condition is met, the first... One candidate node was identified as an outlier; the meanings of other variables are the same as described above. The parameter acquisition method is as follows: The query is performed through the blockchain smart contract interface. The query process includes the following steps: Step 1: Connect to the blockchain network node and establish an RPC communication connection; Step 2: Call the historical score query function of the smart contract, passing in the node identifier and epoch number parameters; Step 3: Parse the returned score data and perform data type conversion. The statistics are obtained by traversing the candidate node list. The statistical process includes the following steps: Step 1: Obtain the candidate node registration list for the current era; Step 2: Filter active nodes that meet the eligibility criteria; Step 3: Count the total number of filtered nodes. The recommended range is 1.0 to 2.0.
[0089] The specific implementation of step S03 is that the system applies a dynamic memory adjustment function to calculate the memory adjustment value, as shown below:
[0090] ;
[0091] In the formula, To remember the adjustment value, the range is from 0 to 1.0; The length of the epoch cycle, ranging from 100 to 1000 blocks; This is a network complexity metric, with a value ranging from 1 to 100; the meanings of other variables are the same as described above.
[0092] The specific representation of determining the number of memory segments based on memory regulation values is as follows:
[0093] ;
[0094] In the formula, The number of memory segments used in the carbon inclusive performance prediction model; the meanings of other variables are the same as described above. The parameter acquisition method is as follows: The configuration process, which involves obtaining system configuration parameters, includes the following steps: Step 1: Reading the governance parameter configuration file of the blockchain network; Step 2: Parsing the epoch cycle length configuration item; Step 3: Verifying the legality of the parameter values and loading them into the system memory. The network topology analysis method is used to obtain the data. The analysis process includes step 1: collecting the connection information and geographical distribution data of all nodes in the network; step 2: calculating the average degree centrality and clustering coefficient of the network graph; and step 3: calculating the network complexity index based on the degree centrality and clustering coefficient using a weighted average method.
[0095] The specific implementation methods for steps S04-S05 are the same as those described above, and will not be repeated in detail here.
[0096] The specific implementation of step S06 involves the system executing a multi-round voting verification process and calculating the consensus participation score. The specific representation of the consensus efficiency score calculation is as follows:
[0097] ;
[0098] In the formula, For the first The consensus efficiency score of each node has the same meaning as the variable in step S02; For the first The number of times a node successfully participated in voting in the previous era; This represents the total number of voting rounds in the previous era; the meanings of other variables are the same as described above.
[0099] The specific representation of consensus participation points accumulation is as follows:
[0100] ;
[0101] In the formula, For the first Each node contributes points to the consensus participation score in the current block. For the first The initial score of each node before the start of the current block; This represents the number of voting rounds in the current block consensus process. For the first The points increment for each round of voting, when valid votes are cast. Invalid vote ; This represents the voting round number. The parameter is obtained as follows: The voting records of the statistical nodes are obtained through the following steps: Step 1: Query all voting transactions of a specified epoch from the historical data of the blockchain; Step 2: Filter out the valid voting transactions initiated by the target node; Step 3: Count the total number of valid voting transactions. The data is obtained through epoch voting statistics. The statistical process includes the following steps: Step 1: Determine the start and end block heights of the target epoch; Step 2: Traverse the voting round records of all blocks within the epoch; Step 3: Accumulate the number of voting rounds for all blocks.
[0102] The specific implementation of step S07 is that the system collects the node score list and writes it into the block header. The specific representation of calculating a sufficient number of nodes is as follows:
[0103] ;
[0104] In the formula, A sufficient number are required to ensure the credibility of the score list; This is the Byzantine fault tolerance parameter, which is typically set to a value of [value missing]. ; This is the floor function; the meanings of other variables are the same as described above. The parameters are obtained as follows: The calculation is performed using Byzantine fault tolerance theory. The calculation process includes step 1: determining the total number of candidate nodes. Step 2: Calculation Step 3: Divide the quotient by 3; Step 4: Round down the quotient to obtain the Byzantine fault tolerance parameter.
[0105] It should be noted that in the specific structure of the carbon inclusive performance prediction model, the dynamic memory adjustment function is designed based on network adaptability theory. By comprehensively considering three key factors—epoch period length, number of candidate nodes, and network complexity—it achieves intelligent adjustment of the model's memory mechanism. This function employs a linear weighted average method. The three influencing factors are standardized and combined with equal weights to ensure the stability and predictability of the adjustment mechanism. When the network is large or complex, the function automatically increases the number of memory segments to enhance the model's long-term dependency learning ability. When the network environment is relatively simple, the function reduces the number of memory segments to improve computational efficiency. This dynamic adjustment mechanism can significantly improve the adaptability and prediction accuracy of the prediction model in different network environments compared to fixed parameter configuration.
[0106] The formulas for calculating the mathematical mean and standard deviation follow classical statistical theory, providing a scientific basis for outlier detection by quantifying the central tendency and dispersion of candidate node performance distribution. The mathematical mean reflects the overall performance level of network nodes, while the standard deviation measures the consistency of performance distribution; together, they constitute a complete statistical description system. Compared to traditional fixed threshold filtering methods, the statistically based dynamic threshold can adaptively adjust the judgment criteria according to the actual performance distribution of the network, avoiding over-filtering or under-filtering caused by changes in the network environment, and significantly improving the accuracy and robustness of node selection.
[0107] Outlier detection is performed using the standard deviation multiple method, which compares the deviation of a node's score from the mean with the ratio of the standard deviation. This method enables automatic identification of abnormal nodes. Its core principle is based on the normal distribution theory, using standard deviation as a standard measure of deviation, and employing an adjustable multiplier coefficient. This approach allows for flexible control over the stringency of decision-making. Compared to absolute threshold methods, this relative threshold method can adapt to differences in performance distribution under different network environments, providing better environmental adaptability while maintaining decision validity and effectively preventing the negative impact of inefficient nodes on the consensus process.
[0108] Consensus efficiency score calculation formula An objective performance evaluation system is established by quantifying node participation rates in the voting process. The formula, expressed as a percentage, ensures comparability of scores across different eras, providing a standardized data foundation for historical performance analysis and trend prediction. The calculation process comprehensively considers the number of successful votes and total voting opportunities, accurately reflecting node consensus participation and technical reliability. Compared to simple online duration statistics, this method more precisely assesses the actual contribution value of nodes, providing a more reliable historical basis for subsequent node selection.
[0109] Consensus Participation Points Accumulation Formula An incremental calculation method is employed, recording the performance of nodes in a single block consensus process through round-by-round accumulation. This formula design considers the validity verification of votes; only verified votes earn points, incentivizing nodes to provide high-quality consensus services. The incremental design ensures that the points calculation process is synchronized with the consensus process, avoiding potential data inconsistencies that may arise from post-event statistics. Compared to traditional fixed reward mechanisms, this dynamic points system can more accurately quantify node contributions, providing technical support for building a fair and transparent incentive mechanism.
[0110] Sufficient quantity calculation formula Based on Byzantine fault tolerance theory, this ensures that reliable scoring results can still be obtained even in the presence of malicious nodes. The formula is achieved by subtracting the maximum possible number of malicious nodes. By incrementing by 1, the number of collected scores is ensured to be sufficient to withstand Byzantine attacks. This formula design reflects the security requirements of distributed systems, striking a balance between efficiency and security. Compared to simple majority voting mechanisms, this Byzantine fault-tolerant design guarantees the correctness and reliability of the system under more stringent security assumptions, providing stronger security guarantees for blockchain consensus algorithms.
[0111] To better understand and implement this invention, a specific application scenario is provided below as Example 2: The technical team discovered that traditional proof-of-stake consensus algorithms suffer from inefficiency and inappropriate node selection when handling large-scale node networks, especially when the network size reaches more than 500 candidate nodes, the consensus confirmation time increases significantly, affecting the platform's real-time performance. To solve this technical problem, the technical team decided to adopt the carbon-inclusive blockchain consensus algorithm proposal node selection optimization method of this invention.
[0112] The technical team first collected basic information and historical performance data of all candidate nodes in the current network. At the start of epoch 127, the system recorded the current block height as 63500, with 480 nodes meeting the candidate eligibility criteria. The technical team assigned a unique serial number to each candidate node according to the order in which they joined the network, numbered sequentially from 1 to 480. The system queried the consensus efficiency score of each candidate node in epoch 126 through the smart contract interface. These scores reflected the participation and response efficiency of each node in the voting process of the previous epoch. The basic information of the candidate nodes is shown in Table 1.
[0113] Table 1 Basic Information of Candidate Nodes
[0114]
[0115] The technical team then initiated a statistical analysis module to process the consensus efficiency scores of the 480 candidate nodes collected. Through calculation, they discovered that the mathematical mean of the consensus efficiency scores of all candidate nodes was... Standard deviation value The system setting deviates from the adjustment coefficient. Based on this, the outlier detection threshold was calculated to be 18.6. After outlier detection, the technical team found that the consensus efficiency scores of 23 nodes significantly deviated from the normal range. These nodes mainly exhibited problems such as excessively high network latency, slow voting response, or unstable device performance. The statistical analysis results of the node consensus efficiency scores are shown in Table 2.
[0116] Table 2 Node Consensus Efficiency Score Statistics
[0117]
[0118] The technical team will next apply the Carbon Inclusive performance prediction model to evaluate the network performance of the remaining 457 candidate nodes. Based on the current network configuration, the epoch period length... Number of blocks, number of candidate nodes Network complexity metrics The memory regulation value is calculated using a dynamic memory regulation function. .because When the value is between 0.7 and 1.0, the system automatically selects the number of extended memory segments. The performance prediction model is configured using this method. Based on the historical performance data of each node over the past 72 hours, including network latency time series, CPU utilization series, and memory utilization series, the prediction model generates a performance prediction score for the next epoch. The performance prediction results are shown in Table 3.
[0119] Table 3 Performance Prediction Results
[0120]
[0121] The technical team then applied the maximum weighted independent set algorithm to select the optimal combination of proposal nodes. The algorithm constructed a weighted undirected graph from 457 valid candidate nodes, using the overall performance score of each node as the vertex weight and the resource competition relationship between nodes as the edge weight. By analyzing the geographical distribution and hardware resource configuration of the nodes, the team determined the competition intensity matrix between nodes. The algorithm used dynamic programming to solve the maximum weighted independent set problem, ultimately selecting 25 mutually non-conflicting nodes with the largest total weight as the proposal nodes for Epoch 127. These 25 proposal nodes are geographically distributed across major regions of the country, all have hardware configurations meeting Class A standards, and all have expected network latency below 30ms. The final selected proposal node information is shown in Table 4.
[0122] Table 4. Proposal Node Selection Results
[0123]
[0124] During its actual operation in the 127th epoch, the system strictly followed the optimized consensus process. When the block height reached 63501, the proposal node with sequence number 001 began the block packaging operation, selecting 2847 carbon emission transactions from the transaction pool for packaging, achieving a transaction verification pass rate of 99.8%. The block data was immediately broadcast to other validator nodes after generation, with an average propagation delay of only 1.2 seconds. Upon receiving the block, validator nodes quickly completed validity checks and state execution verifications, with the entire verification process taking an average of 2.8 seconds. In the subsequent three rounds of voting, a total of 452 validator nodes participated, achieving a voting response rate of 98.9%, with an average confirmation time of 6.5 seconds per round. Based on the voting results, the system added corresponding consensus participation points to the nodes that participated in valid votes, accumulating a total of 1356 valid vote points.
[0125] The technical team collected a list of node scores submitted by each validator node after the end of the 127th epoch. According to Byzantine fault tolerance theory, the system needs to collect a sufficient number of these scores. A total of 312 valid score lists were collected, meeting the credibility requirements. The proposal nodes of the 128th epoch aggregated and verified the collected score lists, resolving the score discrepancies through a majority voting mechanism. The final score data was written into the block header at block height 63701, becoming a permanent record on the blockchain.
[0126] To evaluate the technical effectiveness of the algorithm of this invention, the technical team conducted a comparative test with the traditional proof-of-stake consensus algorithm. The traditional method uses a fixed node polling mechanism to select proposal nodes, lacks performance prediction and outlier detection functions, and exhibits significant performance bottlenecks when dealing with large-scale node networks. The comparative test results are shown in Table 5.
[0127] Table 5 Comparison of Traditional Methods and the Method of This Invention
[0128]
[0129] Traditional methods for solving the core technical problems of this invention mainly include simple random selection algorithms, round-robin mechanisms based on stake ratios, and performance filtering methods with fixed thresholds. These traditional methods have significant limitations when dealing with large-scale distributed networks, primarily manifested in the lack of intelligent node performance evaluation mechanisms, the inability to effectively identify and eliminate abnormal nodes, and overly simplistic node selection strategies lacking global optimization considerations. The technological advancements of this invention compared to traditional methods are mainly reflected in the introduction of an outlier detection mechanism based on statistical principles, which can automatically identify and promptly eliminate nodes with abnormal performance, significantly improving the overall stability and reliability of the consensus network. The application of the carbon-inclusive performance prediction model enables the system to accurately predict the future performance of nodes based on historical data, providing a scientific basis for node selection and avoiding the limitations of traditional methods that rely on static information. The innovative application of the maximum weighted independent set algorithm achieves global optimization of proposal node selection, ensuring that the selected node combinations have both high performance and avoid resource competition, resulting in better overall performance compared to traditional greedy selection methods. The introduction of a dynamic memory adjustment mechanism allows the performance prediction model to adaptively adjust parameter configurations according to network size and complexity, achieving a dynamic balance between computational efficiency and prediction accuracy, solving the problem that traditional fixed parameter configurations cannot adapt to complex network environments.
[0130] The following is another specific application scenario of the present invention, Example 3: A technical team is responsible for developing an atmospheric environmental quality monitoring network system based on blockchain technology. This system needs to process data from air quality monitoring stations across the country in real time. Concentration data Emissions data and Content information. During system operation, the technical team discovered that as the number of monitoring stations increased, traditional consensus algorithms experienced significant performance degradation when processing high-frequency environmental data. Particularly under severe weather conditions, the network connections of some monitoring nodes became unstable, leading to a significant decrease in the efficiency of the entire consensus network. To address this key technical issue, the technical team decided to adopt the carbon-inclusive blockchain consensus algorithm proposal node selection optimization method of this invention.
[0131] The technical team initiated a new consensus process at the start of Epoch 45, at the current block height. The system has a total of There are 10 candidate environmental monitoring nodes, distributed across major regions including North China, East China, and South China. The candidate nodes are numbered according to their geographical location and the order in which they joined the network, with a number range of [range missing]. The technical team used the blockchain smart contract interface to query each candidate node in the 44th epoch (…). Consensus efficiency score of (Epoch) These scores are calculated based on a combination of factors, including a node's voting participation rate in the previous era, data reporting accuracy, and network response time. The basic information distribution of candidate nodes is shown in Table 6.
[0132] Table 6. Regional Distribution of Candidate Nodes
[0133]
[0134] The technical team then performed a statistical analysis process to calculate the mathematical characteristic parameters of the consensus efficiency scores for all candidate nodes. By statistically calculating the scores of 360 nodes, the mathematical mean was obtained. Score, standard deviation Points. The system is set with a variable adjustment coefficient. Based on this, the outlier determination criterion is determined as follows: In other words, nodes with a score below 54.14 are identified as outliers. The distribution characteristics of consensus efficiency scores, based on statistical analysis, are shown in Table 7.
[0135] Table 7. Statistical Analysis of Consensus Efficiency Score
[0136]
[0137] Based on outlier determination criteria The technical team identified 29 outlier nodes whose performance significantly deviated from the normal range. These nodes are denoted as follows: Outlier nodes are mainly concentrated in remote areas with unstable network connections and early deployment sites with severely outdated equipment. Specifically, they exhibit problems such as data transmission latency exceeding 5 seconds, voting response timeout frequency exceeding 15%, and environmental data reporting accuracy below 85%. The identification results of outlier nodes are shown in Table 8.
[0138] Table 8 Outlier Node Identification Results
[0139]
[0140] The technical team then applied the carbon inclusive performance prediction model and the maximum weighted independent set algorithm to comprehensively evaluate the remaining 331 valid candidate nodes. Based on the current network configuration parameters, the epoch period length... The network complexity index reflects the geographical distribution complexity and communication topology among nodes. The performance prediction model, based on the Transformer-XL architecture, uses 32 memory segments to process historical environmental data reporting records, network communication logs, and device operating status information of nodes. The prediction model outputs the expected performance score for each node over the next 150 block periods and constructs a weighted graph structure based on the resource competition relationships among nodes. By solving the maximum weighted independent set problem, the algorithm ultimately selected 18 non-conflicting nodes with the highest overall weight as the proposal node list for Epoch 45. The proposal node selection results are shown in Table 9.
[0141] Table 9 Proposal Node Selection Results
[0142]
[0143] During the actual operation of the 45th epoch, the technical team strictly followed the optimized consensus algorithm to execute a multi-round voting verification process. When the block height reached... At that time, the proposal node with sequence number 023 began the block packaging operation, selecting 1265 air quality monitoring records from the environmental data transaction pool for packaging. These monitoring records included real-time data from 89 monitoring stations in North China. Concentration data Emissions data and air quality index calculation results. Once generated, the block data is immediately broadcast to other verification nodes via a peer-to-peer network protocol, with an average network propagation delay of 0.8 seconds. Upon receiving the block, the verification nodes quickly initiate the verification and execution process, comprehensively verifying the integrity of the environmental monitoring data, the validity of the timestamp, and the correctness of the digital signature. The entire verification process takes an average of 1.9 seconds.
[0144] Based on the consensus algorithm mechanism, the system executes... Round-robin voting verification process. At block height. Various consensus rounds In this process, validator nodes vote based on block verification results and broadcast their votes to other nodes. The scoring mechanism designed by the technical team requires each validator node to score the voting behavior of other nodes. When a validator receives a score from a node at a certain height... and consensus phase After a valid vote, the system automatically records 1 consensus participation point for that voting node. Assuming that in the consensus process of a specific block, there are a total of 18 validator nodes, and 3 rounds of voting are executed, the voting participation of each node in different rounds shows significant differences. Core nodes maintain high-frequency participation, while peripheral nodes exhibit occasional absences. The multi-round voting scoring is shown in Table 10.
[0145] Table 10: Scoring Statistics for Multiple Rounds of Voting
[0146]
[0147] After a block is successfully submitted to the blockchain, all validator nodes, according to the protocol requirements, compile the performance records of each node during this consensus round, generating a detailed score list containing the node's sequence number and corresponding consensus participation score. These score lists are then sent to the next height via an encrypted communication channel. The designated proposal node. According to Byzantine fault tolerance theory, the system needs to collect... Only by having each node send a scoring list can the reliability of the data be ensured. The number of malicious nodes that the consensus algorithm can tolerate is therefore sufficient. During the actual collection process, the proposal node at height 22502 received a total of 236 valid score lists, exceeding the minimum requirement and satisfying the Byzantine fault tolerance security conditions.
[0148] The proposing nodes aggregate and verify the consistency of the 236 collected scoring lists, employing a majority voting mechanism to handle potential scoring discrepancies. The verified scoring list data is formatted as structured information and written into the block header of block height 22502, becoming an immutable record on the blockchain. This blockchain-based scoring mechanism ensures the transparency, integrity, and historical traceability of node performance data, providing a reliable data foundation for the node selection process in the next epoch. When the block height reaches... At that time, the 45th epoch officially ended, and the system automatically entered the 46th epoch. The entire epoch iteration process continued to run according to a predetermined periodic rhythm, as follows: Figure 2 As shown.
[0149] To comprehensively evaluate the practical performance of the algorithm in this invention, the technical team designed a comparative test experiment with traditional consensus algorithms. Traditional methods employ a simple round-robin node selection mechanism, lacking statistical outlier detection and intelligent performance prediction capabilities, exhibiting significant technical limitations when handling large-scale environmental monitoring networks. The comparative test was conducted under the same network environment and data load conditions, covering 10 complete epochs. The performance comparison results are shown in Table 11.
[0150] Table 11 Performance Comparison of Traditional Algorithm and Algorithm of This Invention
[0151]
[0152] Traditional polling mechanisms select proposal nodes according to a preset node order or random methods, ignoring the impact of performance differences between nodes and changes in the network environment, and cannot effectively cope with the challenges of dynamic changes in node performance in large-scale distributed networks. Simple threshold filtering methods use fixed performance judgment criteria and lack the ability to adaptively adjust according to the overall network situation, easily leading to over-filtering or under-filtering when the network scales up or environmental conditions deteriorate. The significant technical advancements of this invention compared to traditional methods are mainly reflected in the introduction of an intelligent outlier detection mechanism based on statistical principles. By dynamically calculating the mathematical characteristic parameters of the network node performance distribution, it achieves accurate identification and automatic elimination of abnormal nodes, significantly improving the overall robustness and reliability of the consensus network. The innovative application of the carbon inclusive performance prediction model enables the system to predict the future performance of nodes based on historical data and the current network state, providing a scientific and quantitative basis for node selection decisions and avoiding the technical limitations of relying on static information in traditional methods. The ingenious application of the maximum weighted independent set algorithm achieves global optimization of proposal node selection, ensuring that the selected node combination has high performance while avoiding resource competition conflicts, and has a better overall coordination effect than traditional simple selection strategies. The organic combination of multi-round voting scoring mechanism and Byzantine fault tolerance design has built a sound node performance evaluation and incentive system, which not only improves the transparency and fairness of the consensus process, but also enhances the system's security protection against malicious attacks and node failures.
[0153] It should be noted that the variables involved in this invention are explained in detail in Table 12.
[0154] Table 12 Variable Explanation Table
[0155]
[0156] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. An optimized method for selecting proposal nodes in a carbon-inclusive blockchain consensus algorithm, characterized in that, include: A node initiates a new era, records the current block height as the block height value, counts the total number of candidate nodes as the candidate node number, assigns a candidate node number to each candidate node, and queries the consensus efficiency score of each candidate node in the previous era on the chain. The mathematical mean and standard deviation of the consensus efficiency scores of all candidate nodes are calculated using statistical methods. The deviation adjustment coefficient is used to determine whether the node scores meet the outlier criteria. Nodes that meet the outlier criteria are marked as outlier nodes. The network performance of candidate nodes is evaluated and predicted using a carbon inclusive performance prediction model and a dynamic memory adjustment function. Outlier nodes are removed from the candidate list for this epoch. The maximum weighted independent set algorithm is used to generate a list of proposal nodes for this epoch. The proposal nodes package blocks at a specified block height and broadcast the newly packaged block data to other validator nodes. The validator nodes perform transaction validity verification and state execution verification on the blocks packaged by the proposal nodes. The validator nodes vote on the blocks based on the verification results and broadcast the voting information to other nodes. The consensus algorithm executes a multi-round voting verification process. After receiving a valid vote, each node adds a consensus participation score to the node that sent the vote. After a block is committed, each node sends its node score list to the proposal node at the next height. Once the proposal node receives a sufficient number of score lists, it writes the score list data into the block header of the next block. The outlier determination condition refers to the mathematical condition for determining whether a node is an outlier node. When the difference between the mathematical mean and the node consensus efficiency score is greater than the product of the deviation adjustment coefficient and the standard deviation, the outlier determination condition is met. The specific structure of the carbon inclusive performance prediction model is a time-series prediction network based on the Transformer-XL architecture, including an encoder layer for processing historical node performance data, a decoder layer for generating future performance prediction results, and a memory mechanism for processing long-sequence node performance change patterns. The number of memory segments in the memory mechanism of the carbon inclusive performance prediction model is adjusted by a dynamic memory adjustment function according to the epoch period length and the number of candidate nodes. When the epoch period length is large or the number of candidate nodes is large, the number of memory segments is increased; when the epoch period length is small or the number of candidate nodes is small, the number of memory segments is decreased.
2. The method according to claim 1, characterized in that, The term "new era" refers to a time management unit in a blockchain system with a fixed number of blocks as the period, used to periodically adjust the qualifications of candidate nodes and update the identities of consensus participants.
3. The method according to claim 2, characterized in that, The consensus efficiency score refers to a numerical indicator that quantifies the performance of nodes in the consensus process. It is calculated by statistically analyzing the effective participation and response speed of nodes in each round of voting. The formula for calculating the consensus efficiency score is the number of times each node successfully participated in voting in the previous era, divided by the total number of voting rounds, and then multiplied by 100.
4. The method according to claim 3, characterized in that, The deviation adjustment coefficient refers to a numerical parameter that controls the strictness of outlier node identification and is used to adjust the sensitivity of outlier determination. The deviation adjustment coefficient ranges from 0.5 to 2.
0.
5. The method according to claim 4, characterized in that, The dynamic memory adjustment function calculates the memory adjustment value based on the epoch cycle length, the number of candidate nodes, and the network complexity index. The calculation formula for the memory adjustment value is the sum of the epoch cycle length divided by 100, the number of candidate nodes divided by 50, and the network complexity index divided by 10, divided by 3.
6. The method according to claim 5, characterized in that, When the memory adjustment value is in the range of 0 to 0.3, the basic memory segment number of 8 is used to adjust the memory mechanism parameters of the carbon inclusive performance prediction model; when the memory adjustment value is in the range of 0.3 to 0.7, the intermediate memory segment number of 16 is used; and when the memory adjustment value is in the range of 0.7 to 1.0, the extended memory segment number of 32 is used.
7. The method according to claim 6, characterized in that, The application steps of the maximum weighted independent set algorithm specifically include constructing a weighted undirected graph from the remaining candidate nodes after removing outliers, with each candidate node as a vertex of the graph, the consensus efficiency score of the candidate node as the vertex weight, establishing edge connections of the graph based on the network connectivity and resource competition relationship between candidate nodes, and applying a greedy algorithm or dynamic programming algorithm to solve for the maximum weighted independent set of the weighted undirected graph.
Citation Information
Patent Citations
Block chain Byzantine fault-tolerant consensus method based on collaborative filtering recommendation
CN115022326A
Node selection method, system and device based on block chain and storage medium
CN117675378A