Block chain expandability improvement method based on dynamic node weighting and adaptive security defense
Through dynamic node weights and adaptive security defense mechanisms, node behavior in the blockchain network is monitored and optimized in real time, network performance bottlenecks and security issues are solved, efficient task allocation and enhanced defense capabilities are achieved, and the stability and security of the blockchain network are improved.
Patent Information
- Application Number
- CN202510699013.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-09-05
AI Technical Summary
When existing blockchain systems handle large-scale transactions, network performance bottlenecks, security risks and malicious node behaviors make it difficult to guarantee system efficiency and reliability, and the existing security mechanism lacks adaptability and flexibility, and cannot effectively deal with dynamically changing network environments.
By monitoring node behavior in real time, calculating node weights dynamically, analyzing attack patterns with machine learning algorithms, optimizing task allocation and defense strategies, early identification and isolation of abnormal nodes, and automatically adjusting defense strategies to enhance network security and scalability.
It significantly improves the scalability and security of the blockchain network, can adapt to network load changes, optimize resource utilization, reduce operation and maintenance costs, and enhance anti-attack capabilities and data integrity protection.
Smart Images

Figure CN120602132A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a method for improving blockchain scalability based on dynamic node weighting and adaptive security defense. Background Art
[0002] With the rapid development of blockchain technology, its application in a variety of fields, including decentralized networks, smart contracts, and cryptocurrencies, has become increasingly widespread. However, the scalability and security of blockchain networks have become key technical challenges hindering their widespread adoption. Existing blockchain systems face numerous challenges when processing large-scale transactions, including network performance bottlenecks, security risks, and malicious node behavior, which significantly impact the stability and efficiency of blockchain networks.
[0003] First, with the dramatic increase in the number of blockchain nodes, how to effectively improve network throughput and response speed while ensuring security has become a pressing technical challenge. Currently, traditional blockchain networks typically rely on static node allocation strategies, which makes them inflexible in the face of dynamically changing network environments (such as malicious attacks, network congestion, or node failures), making it difficult to ensure system efficiency and reliability. Furthermore, existing security mechanisms are often based on fixed rules, lacking adaptability and flexibility in the face of new attacks, thereby increasing the security risks of blockchain networks.
[0004] Secondly, the performance and stability of nodes in a blockchain network directly impact the overall performance of the network. Existing node evaluation methods often rely on single performance metrics (such as throughput and latency), while neglecting the comprehensive reliability and abnormal behavior monitoring of nodes. This results in the failure to promptly identify and isolate potentially malicious nodes, leading to performance degradation and security issues in the system, and even potentially posing serious security threats such as data tampering and double spending.
[0005] To address these issues, this paper proposes a blockchain scalability enhancement method based on dynamic node weighting and adaptive security defense. This method dynamically calculates node weights by comprehensively considering node performance, reliability, and anomaly scores, and optimizes node task allocation based on real-time network conditions, effectively improving network throughput and stability. Furthermore, this method enables real-time monitoring of node behavior, accurately identifying and isolating anomalous nodes. By combining machine learning algorithms to analyze attack patterns, it intelligently predicts potential threats and automatically adjusts defense strategies, significantly enhancing the security and anti-attack capabilities of blockchain networks. Summary of the Invention
[0006] This paper provides a method for improving blockchain scalability based on dynamic node weighting and adaptive security defense. This method monitors the behavior of each node in the blockchain network in real time, dynamically adjusts node weights based on their performance, reliability, and anomaly scores, and optimizes node task allocation. By collecting and analyzing attack data, identifying attack patterns, and predicting potential threats, and integrating machine learning algorithms to automatically adjust defense strategies, the method further enhances the security and scalability of the blockchain network.
[0007] To achieve the above object, the present invention adopts the following technical solutions:
[0008] A method for improving blockchain scalability based on dynamic node weighting and adaptive security defense, comprising the following steps:
[0009] S101: Monitor the behavior of nodes in the network in real time, perform statistical analysis on the historical data of nodes in the blockchain system, establish an expected baseline for node behavior, and use machine learning algorithms to continuously optimize and adjust the expected baseline based on real-time data. During node operation, compare the real-time data with the expected baseline data to calculate an anomaly score. When the anomaly score of a node exceeds the preset threshold T, the system sets the node to an isolated state. If the isolated node exhibits normal behavior that meets expectations during the evaluation period, it will be restored to an active state.
[0010] S102: Evaluate the node's performance score based on the node's throughput and latency, and evaluate the node's reliability score based on the node's uptime and error rate; dynamically calculate the node's weight based on the node's performance score, reliability score, and anomaly score, and optimize the node's task allocation based on the node weight;
[0011] S103: Collect and analyze historical attack data, identify attack patterns, use machine learning algorithms to predict potential threats, and automatically adjust defense strategies.
[0012] The calculation formula of the abnormality score is as follows:
[0013]
[0014] Among them, A n (t) is the anomaly score of node n at time t; D i (t) is the deviation between the actual value of the observed i-th indicator and the expected value; θ i is the weight coefficient of the i-th deviation indicator; k is the number of indicators considered in the calculation process.
[0015] The specific process of dynamically calculating node weights is as follows:
[0016] Compute node performance score P n :
[0017] P n =λ·TPS-θ·Latency
[0018] Among them, TPS is the throughput of the node, Latency is the delay time of the node, λ and θ are the defined weight coefficients;
[0019] Calculate the reliability score R of the node n :
[0020]
[0021] U R The time period during which the node has been running stably since the last startup; E R The frequency of node errors; and ω are defined weight coefficients;
[0022] Calculate node weight:
[0023] W n (t) = α·P n +β·R n -γ·A n (t)
[0024] W n (t) represents the weight of node n at time t, and α, β, and γ are the weight coefficients for adjusting the influence of each indicator.
[0025] The step S103 is specifically as follows:
[0026] First, the collected historical attack data is preprocessed and key features are extracted, including attack type, frequency, and severity;
[0027] Then, the prediction model is trained using historical attack data. The trained prediction model can predict the attack P that may be received at the next moment based on the input attack data characteristics. attack ;
[0028] Finally, based on the possible attack P attack , node weights, and real-time response metrics update the node's defense parameters for the next moment, adjusting the network defense strategy in real time. The defense parameter calculation formula is as follows:
[0029] L(t+1)=L(t)+η·(R(t)+τP attack (t+1)+δW(t)-L(t))
[0030] Where L(t) represents the defense parameter at time t, R(t) represents the real-time response metric, that is, the response effect of the current defense strategy to the attack, indicating the proportion of successful defense, η is the learning rate, τ is the adjustment coefficient, and δ is the influence coefficient of the node weight.
[0031] The real-time adjustment of network defense strategy is as follows:
[0032] Based on the size of the defense parameters, the defense strategy is divided into several response levels:
[0033] Low-level response: When the defense parameter L(t+1) is low, it means the risk of attack is low. Only light monitoring of attack events is required to maintain normal transaction processing.
[0034] Medium-level response: When the defense parameter L(t+1) is medium, it means that the system node may be in a high-risk state. The defense strategy should be moderately strengthened. It is necessary to enhance the monitoring of network traffic and strengthen the detection and recording of abnormal transactions.
[0035] High-level response: When the defense parameter L(t+1) is high, it means that the node faces a greater risk of attack and must take enhanced defense measures, such as limiting high-frequency trading and large-scale traffic, implementing regional network restrictions, and even isolating and blocking the node in real time.
[0036] The specific values of low, medium, and high are set based on demand or experience. They can be determined by percentile partitioning of the node's historical defense parameters: sort the node's historical defense parameters from smallest to largest, with L(t+1) values in the first 30% being low, between 30% and 70% being medium, and above 70% being high.
[0037] One or more technical solutions in the embodiments of the present invention have at least the following technical effects or advantages:
[0038] (1) Improving the scalability of blockchain networks: By dynamically adjusting node weights and optimizing task allocation, this invention significantly improves the scalability of blockchain networks. This method can effectively adapt to changes in network load, ensuring that network performance is not affected by bottlenecks in large-scale transaction processing or high-concurrency scenarios, and the system can operate stably.
[0039] (2) Enhance the security and defense capabilities of the blockchain network: Combining real-time node behavior monitoring, anomaly score calculation, and machine learning algorithms, it is possible to detect potential malicious nodes and attack patterns early and take automated isolation and defense measures. The system can dynamically adjust defense strategies, effectively improving the ability to predict and defend against various attacks, thereby significantly enhancing the blockchain network's anti-attack capabilities and data integrity protection.
[0040] (3) Optimizing node resource utilization and reducing maintenance costs: Through a dynamic weighting mechanism based on node performance, reliability, and anomaly scores, the present invention can achieve reasonable task allocation and optimize the utilization efficiency of node resources. At the same time, automated defense mechanisms and anomaly detection reduce the need for human intervention, lower operation and maintenance costs, and enhance the network's intelligence and adaptability. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present invention. Throughout the drawings, the same reference figures denote the same components. In the drawings:
[0042] Figure 1 This is a flowchart of the steps of a method for improving blockchain scalability with dynamic node weighting and adaptive security defense in an embodiment of the present invention;
[0043] Figure 2 This is a flow chart of calculating an abnormality score for each node and early detection and isolation of abnormal nodes in an embodiment of the present invention;
[0044] Figure 3 This is a flowchart of dynamically calculating node weights and optimizing node task allocation based on node performance, reliability, and anomaly scores in an embodiment of the present invention;
[0045] Figure 4 This is a flowchart of collecting and analyzing attack data, identifying attack patterns, using machine learning algorithms to predict potential threats, and automatically adjusting defense strategies in an embodiment of the present invention. DETAILED DESCRIPTION
[0046] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0047] Example 1:
[0048] The embodiment of the present invention provides a method for improving the scalability of blockchain based on dynamic node weighting and adaptive security defense, such as Figure 1 Shown, including:
[0049] S101: Monitor the behavior of nodes in the network in real time, calculate the anomaly score of each node, and detect and isolate abnormal nodes early;
[0050] S102: Dynamically calculate node weights based on node performance, reliability, and anomaly scores, and optimize node task allocation;
[0051] S103: Collect and analyze attack data, identify attack patterns, use machine learning algorithms to predict potential threats, and automatically adjust defense strategies.
[0052] The following details the specific implementation steps of the blockchain scalability improvement method based on dynamic node weighting and adaptive security defense provided by this embodiment:
[0053] As an implementation method of the embodiment of the present invention, the S101 is as follows: Figure 2 As shown, the following steps are included:
[0054] Specifically, the system first establishes an expected baseline for node behavior through statistical analysis of historical node data in the blockchain system. This baseline is then continuously optimized and adjusted using machine learning algorithms based on real-time data. During node operation, real-time data is compared with the expected baseline to calculate an anomaly score. When a node's anomaly score exceeds a preset threshold, T, the system places the node in quarantine. If the quarantined node demonstrates expected normal behavior within the evaluation period, it is restored to active status.
[0055] The specific process of calculating the anomaly score is as follows:
[0056] Step A1: Select k metrics to be considered during the calculation process, such as transaction failure rate, stability of participation in consensus rounds, consensus voting effectiveness, block interval, frequency of illegal smart contract calls, etc.
[0057] Step A2: Define weighting factors θ for each metric i .
[0058] Step A3: Record the deviation D between the observed i-th indicator and the expected value i (t);
[0059] Step A4: Calculate the anomaly score. The anomaly score formula is as follows:
[0060]
[0061] A n (t) is the anomaly score of node n at time t; D i (t) is the deviation between the actual value of the observed i-th indicator and the expected value; θ i is the weight coefficient of the i-th deviation indicator; k is the number of indicators considered in the calculation process.
[0062] If the isolated node exhibits expected normal behavior during the evaluation period, the specific process of restoring the active state is as follows:
[0063] Step B1: Record the isolation start time t iso .
[0064] Step B2: Define the evaluation period P.
[0065] Step B3: Continuously monitor the node's anomaly score A during the isolation period n (t).
[0066] Step B4: If the current time t satisfies tt iso ≥P and A n (t)≤T, the node returns to active state.
[0067] As an implementation method of the embodiment of the present invention, the S102 is as follows: Figure 3 As shown, the following steps are included:
[0068] First, the node performance score P is evaluated based on the node throughput and delay performance indicators. n ; Then evaluate the node reliability score R by analyzing the node's uptime and error rate n ; Record the node's abnormal score A n (t); Next, the node weight is dynamically calculated based on the node's performance, reliability, and anomaly score. Tasks are then assigned based on the node weight, with more critical tasks assigned to more reliable nodes (i.e., nodes with higher weights).
[0069] The specific process of dynamically calculating node weights is as follows:
[0070] Step C1: Define weighting factors λ, θ, ω, α, β, γ.
[0071] Step C2: Calculate the node performance score P n , P n The calculation formula is:
[0072] P n =λ·TPS-θ·Latency
[0073] The throughput of a TPS node is the number of transactions processed by the node per unit time; Latency is the delay time of the node, that is, the time from when the node receives a request to when it returns a response; λ and θ are the defined weight coefficients.
[0074] Step C3: Calculate the reliability score R of the node n , R n The calculation formula is:
[0075]
[0076] U R The time period during which the node has been running stably since the last startup; E R The frequency of node errors; and ω are defined weight coefficients.
[0077] Step C4: Calculate the node weight. The node weight calculation formula is:
[0078] W n (t) = α·P n +β·R n -γ·A n (t)
[0079] W n (t) represents the weight of node n at time t, P n is the performance index of the node, R n Score the reliability of the node, A n (t) is the abnormality score of the node, α, β, and γ are the weight coefficients for adjusting the influence of each indicator.
[0080] As an implementation method of the embodiment of the present invention, the S103 is as follows: Figure 4 As shown, the following steps are included:
[0081] First, historical attack data is collected, including the type, source, time, frequency, and severity of the attacks. Next, machine learning models are applied to analyze the collected attack data to identify patterns and trends in the attack data. Then, by learning from the attack data, possible future attacks are predicted. Defense parameters are then updated based on the prediction results. Finally, network defense strategies are adjusted in real time based on the defense parameters.
[0082] Applying machine learning models to analyze collected attack data, identify patterns and trends in the attack data, and then predict future attacks by learning from the attack data. The specific process is as follows:
[0083] E1: Data preprocessing: Clean and denoise the collected attack data.
[0084] E2: Feature extraction and selection: Extract key features from attack data, such as attack type, frequency, and severity.
[0085] E3: Use historical attack data to train the random forest model and adjust the parameters to optimize the model's prediction performance. After training, the random forest model generates a function f(·), which can predict the possible attack P at time t+1 based on the input attack data characteristics. attack(t+1):
[0086] P attack (t+1)=f(AttackType,Frequency,Severity)
[0087] The node updates the defense parameters at time t+1 based on the prediction results. The specific process is as follows:
[0088] D1: Define the learning rate η, which determines the magnitude of defense parameter adjustment.
[0089] D2: Update defense parameters. The formula is:
[0090] L(t+1)=L(t)+η·(R(t)+τP attack (t+1)+δW(t)-L(t))
[0091] L(t) represents the defense parameter at time t, R(t) represents the real-time response metric, which measures the effectiveness of the current defense strategy in responding to attacks and indicates the percentage of successful defenses. η represents the learning rate. τ is a custom adjustment coefficient used to control the weight of attack predictions in defense parameter updates, and δ represents the influence coefficient of node weights.
[0092] Adjust network defense strategies in real time based on defense parameters. The details are as follows:
[0093] Based on the size of the defense parameters, the defense strategy is divided into several response levels:
[0094] Low-level response: When the defense parameter L(t+1) is low, it means the risk of attack is low. Only light monitoring of attack events is required to maintain normal transaction processing.
[0095] Medium-level response: When the defense parameter L(t+1) is medium, it means that the system node may be in a high-risk state. The defense strategy should be moderately strengthened. It is necessary to enhance the monitoring of network traffic and strengthen the detection and recording of abnormal transactions.
[0096] High-level response: When the defense parameter L(t+1) is high, it means that the node faces a greater risk of attack and must take enhanced defense measures, such as limiting high-frequency trading and large-scale traffic, implementing regional network restrictions, and even isolating and blocking the node in real time.
[0097] The specific values of low, medium, and high can be set based on demand or experience. Furthermore, low, medium, and high are determined by percentile partitioning of the node's historical defense parameters: sorting the node's historical defense parameters from smallest to largest, with L(t+1) values in the first 30% being low, between 30% and 70% being medium, and above 70% being high.
[0098] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0099] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0100] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0101] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0102] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0103] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.
Claims
1. A blockchain scalability improvement method based on dynamic node weighting and adaptive security defense, characterized in that: The following steps are involved: S101: Monitor the behavior of nodes in the network in real time, perform statistical analysis on the historical data of nodes in the blockchain system, establish an expected baseline for node behavior, and use machine learning algorithms to continuously optimize and adjust the expected baseline based on real-time data; During node operation, real-time data is compared with expected baseline data to calculate anomaly scores; When a node's anomaly score exceeds the preset threshold T, the system sets the node to an isolated state. If the isolated node exhibits expected normal behavior during the evaluation period, it will be restored to an active state. S102: Evaluate the node's performance score based on the node's throughput and latency, and evaluate the node's reliability score based on the node's uptime and error rate; dynamically calculate the node's weight based on the node's performance score, reliability score, and anomaly score, and optimize the node's task allocation based on the node weight; S103: Collect and analyze historical attack data, identify attack patterns, use machine learning algorithms to predict potential threats, and automatically adjust defense strategies.
2. A blockchain scalability improvement method based on dynamic node weighting and adaptive security defense according to claim 1, characterized in that: The calculation formula of the abnormality score is as follows: Among them, A n (t) is the anomaly score of node n at time t; D i (t) is the deviation between the actual value of the observed i-th indicator and the expected value; θ i is the weight coefficient of the i-th deviation indicator; k is the number of indicators considered in the calculation process.
3. A blockchain scalability improvement method based on dynamic node weighting and adaptive security defense according to claim 2, characterized in that: The specific process of dynamically calculating node weights is as follows: Compute node performance score P n : P n =λ·TPS-θ·Latency Among them, TPS is the throughput of the node, Latency is the delay time of the node, λ and θ are the defined weight coefficients; Calculate the reliability score R of the node n : U R The period of stable operation of the node since the last startup; R The frequency of node errors; and ω are defined weight coefficients; Calculate node weight: W n (t)=α·P n +β·R n -γ·A n (t) W n (t) represents the weight of node n at time t, and α, β, and γ are the weight coefficients for adjusting the influence of each indicator.
4. A blockchain scalability improvement method based on dynamic node weighting and adaptive security defense according to claim 3, characterized in that: The step S103 is specifically as follows: First, the collected historical attack data is preprocessed and key features are extracted, including attack type, frequency, and severity; Then, the prediction model is trained using historical attack data. The trained prediction model can predict the attack P that may be received at the next moment based on the input attack data characteristics. attack ; Finally, based on the possible attack P attack , node weights, and real-time response metrics update the node’s defense parameters for the next moment and adjust the network defense strategy in real time.
5. A blockchain scalability improvement method based on dynamic node weighting and adaptive security defense according to claim 4, characterized in that: The calculation formula of the defense parameter is as follows: L(t+1)=L(t)+η·(R(t)+τp attack (t+1)+δW(t)-L(t)) Where L(t) represents the defense parameter at time t, R(t) represents the real-time response metric, that is, the response effect of the current defense strategy to the attack, indicating the proportion of successful defense, η is the learning rate, τ is the adjustment coefficient, and δ is the influence coefficient of the node weight.
6. A blockchain scalability improvement method based on dynamic node weighting and adaptive security defense according to claim 5, characterized in that: The prediction model is a random forest model.
7. A blockchain scalability improvement method based on dynamic node weighting and adaptive security defense according to claim 6, characterized in that: The real-time adjustment of network defense strategy is as follows: Based on the size of the defense parameters, the defense strategy is divided into several response levels: Low-level response: When the defense parameter L(t+1) is low, it means the risk of attack is low. Only light monitoring of attack events is required to maintain normal transaction processing. Medium-level response: When the defense parameter L(t+1) is medium, it means that the system node may be in a high-risk state. The defense strategy should be moderately strengthened. It is necessary to enhance the monitoring of network traffic and strengthen the detection and recording of abnormal transactions. High-level response: When the defense parameter L(t+1) is high, it means that the node faces a greater risk of attack and must take enhanced defense measures, such as limiting high-frequency trading and large-scale traffic, implementing regional network restrictions, and even isolating and blocking the node in real time. The specific values of lower, medium, and higher are set according to needs or experience.
8. A blockchain scalability improvement method based on dynamic node weighting and adaptive security defense according to claim 7, characterized in that: Low, medium, and high are determined by the percentile division method of the node's historical defense parameters: the historical defense parameters of the node are sorted in ascending order, L(t+1) in the first 30% is low, between 30%-70% is medium, and after 70% is high.