Node allocation method and device, equipment and medium
By optimizing node allocation in a distributed consensus system and determining the optimal attribution of nodes based on communication delay and load difference values, the high latency and DDoS attack problems caused by unreasonable node allocation are solved, and the communication efficiency and security of the system are improved.
Patent Information
- Application Number
- CN202510653101.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-20
- Publication Date
- 2025-08-05
AI Technical Summary
In a distributed consensus system, due to unreasonable node allocation, there is a high communication delay in the same subset, which in turn makes nodes with higher communication delays the target of DDoS attacks, consume resources and block the network.
By obtaining the communication delay amount and load difference between nodes, the optimal attribution probability value of each node is determined, and the node allocation to each subset is optimized to ensure that low-latency nodes are preferred, dynamically balanced the subset load, and prevent resource overload.
It significantly improves the efficiency of internal message transmission in the subset, avoids high-latency link interference, effectively distributes high-latency nodes, eliminates DDoS attack vulnerabilities, and improves system communication efficiency and security.
Smart Images

Figure CN120434005A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network security technology, and in particular to a node allocation method, apparatus, device and medium. Background Art
[0002] In distributed consensus systems (such as blockchains or IoT networks), a node grouping mechanism is often used to divide the nodes in the distributed consensus system into different subsets. Each subset independently handles specific consensus tasks (such as transaction verification and data synchronization). Through this parallel processing architecture, distributed consensus systems can significantly improve overall throughput and response efficiency.
[0003] However, existing technologies typically rely on manual experience to assign nodes to subsets, which can result in high communication latency between nodes within the same subset. Of particular note, these nodes with high communication latency are often vulnerable to distributed denial-of-service (DDoS) attacks. Attackers can target these high-latency nodes with intensive invalid request flooding attacks, exhausting their computing resources and network bandwidth, thereby impacting the consensus efficiency of the entire subset and even causing network congestion.
[0004] Therefore, node allocation measures against DDoS attacks in distributed consensus systems are imminent. Summary of the Invention
[0005] The embodiments of the present application provide a node allocation method, apparatus, device, and medium to address the problem in the related art that, in a distributed consensus system, due to unreasonable allocation of subsets, there are nodes with higher communication delays in the same subset, which in turn causes the nodes with higher communication delays to be exploited by attackers as targets of DDoS attacks, consuming resources and blocking the network.
[0006] In a first aspect, an embodiment of the present application provides a node allocation method, the method comprising:
[0007] For any subset in the distributed consensus system, obtain the communication delay between any two nodes to be assigned, and the difference between the maximum node load and the minimum node load in the subset; and determine the probability value of each node to be assigned belonging to the subset based on the communication delay between any two nodes and the difference;
[0008] For each node to be assigned, the target subset to which the node belongs is determined according to the maximum probability value of the node belonging to each subset.
[0009] In a second aspect, an embodiment of the present application further provides a node allocation device, the device comprising:
[0010] a processing module configured to obtain, for any subset in the distributed consensus system, a communication delay between any two nodes to be assigned and a difference between a maximum node load and a minimum node load in the subset, and determine a probability value of each node to be assigned belonging to the subset based on the communication delay between any two nodes and the difference;
[0011] The determination module is used to determine, for each node to be assigned, the target subset to which the node belongs according to the maximum value of the probability value of the node belonging to each subset.
[0012] In a third aspect, an embodiment of the present application further provides an electronic device, which includes at least a processor and a memory, and the processor is used to implement the steps of the node allocation method as described in any one of the above items when executing a computer program stored in the memory.
[0013] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the node allocation method as described in any one of the above items.
[0014] In an embodiment of the present application, an electronic device obtains the communication delay between any two nodes to be assigned and the difference between the maximum and minimum node loads in the subset for any subset in a distributed consensus system. Based on the communication delay and difference between any two nodes, the electronic device determines the probability that each node to be assigned belongs to the subset. For each node to be assigned, the electronic device determines the target subset to which the node belongs based on the maximum probability of the node belonging to each subset. In this embodiment of the present application, the electronic device calculates the communication delay between nodes and determines the difference between the maximum and minimum node loads of each subset. Based on the communication delay and the difference, the electronic device determines the optimal probability of each node belonging to the subset. This method significantly improves the message transmission efficiency within the subset by ensuring that low-latency nodes are prioritized, avoiding the interference of high-latency links on the consensus process. It not only effectively disperses potential high-latency nodes, eliminating the vulnerability of attackers exploiting centralized delays to launch DDoS attacks, but also prevents resource-overloaded nodes from becoming attack targets by dynamically balancing subset loads. While maintaining efficient consensus, it builds a more robust defense system and improves the communication efficiency and security of the distributed consensus system. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0016] Figure 1 A schematic diagram of a process based on a node allocation method provided in an embodiment of the present application;
[0017] Figure 2 A schematic diagram of a typical DDoS attack process provided in an embodiment of the present application;
[0018] Figure 3 A schematic diagram of a hierarchical optimization structure provided in an embodiment of the present application;
[0019] Figure 4 A detailed process diagram of a subset allocation provided in an embodiment of the present application;
[0020] Figure 5 A schematic diagram of the structure of a subset allocation device provided in an embodiment of the present application;
[0021] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] The present application will be further described in detail below with reference to the accompanying drawings. It is apparent that the embodiments described are only a portion of the embodiments of the present application, not all of them. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present application without creative effort are intended to fall within the scope of protection of the present application.
[0023] In order to reasonably perform subset allocation and reduce the risk of DDoS attacks, the embodiments of the present application provide a node allocation method, apparatus, device and medium.
[0024] The node allocation method includes: for any subset in a distributed consensus system, the electronic device obtains the communication delay between any two nodes to be allocated, and the difference between the maximum node load and the minimum node load in the subset, and determines the probability value of each node to be allocated belonging to the subset based on the communication delay and the difference between the any two nodes; for each node to be allocated, determines the target subset to which the node belongs based on the maximum value of the probability value of the node belonging to each subset.
[0025] Example 1:
[0026] Figure 1 A schematic diagram of a process based on a node allocation method provided in an embodiment of the present application, the process includes the following steps:
[0027] S101: For any subset in the distributed consensus system, obtain the communication delay between any two nodes to be assigned, and the difference between the maximum node load and the minimum node load in the subset, and determine the probability value of each node to be assigned belonging to the subset based on the communication delay between any two nodes and the difference.
[0028] The node allocation method provided in the embodiment of the present application is applied to an electronic device, which may be an intelligent device such as a scheduler, a PC or a server.
[0029] In a distributed consensus system, in order to optimize the node allocation strategy, the probability value of a node belonging to a certain subset can be dynamically calculated by the following method: the communication delay between any two nodes in the subset is collected to measure the communication efficiency of the network topology; and the difference between the maximum node load and the minimum node load in the subset is calculated to reflect the current load balancing situation, where the difference can be called the load balancing factor of the subset.
[0030] Among them, a distributed consensus system refers to a network system composed of multiple independent nodes, such as a blockchain, a distributed database, etc., and the independent node can be a computer or a server.
[0031] The electronic device can combine the communication delay between the nodes and the difference to determine the probability value of each node to be assigned belonging to the subset. In one example, a probability assessment model can be pre-built. The electronic device can input the communication delay between every two nodes in the subset and the difference into the probability assessment model. The probability assessment model then determines the probability of each node being assigned to the subset, thereby reducing communication overhead while improving overall load balancing.
[0032] S102: For each node to be assigned, determine the target subset to which the node belongs based on the maximum probability value of the node belonging to each subset.
[0033] After determining the probability value of each node belonging to each subset, the electronic device may determine, for each node to be assigned, a target subset to which the node belongs based on the maximum value of the probability value of the node belonging to each subset.
[0034] With the rapid development of the Internet of Things (IoT), the number of IoT devices is also growing rapidly. However, even so, there remains a significant global demand gap for IoT devices. While the functions of these numerous devices are not complex, they are often limited in terms of processing power and resources. Manufacturers generally focus more on their primary functions when manufacturing these devices, paying insufficient attention to the network security properties of the devices. This makes it easy for hackers to control these devices by implanting malicious programs, using them as springboards or zombie hosts to further enrich their attack resources or build their own botnets. For example, DDoS attacks allow hackers to simultaneously control a large number of zombie hosts through a master control terminal, launching fully or semi-automatically attacks against numerous potential targets within various networks, including the IoT. Therefore, security measures against DDoS attacks are urgently needed. The methods provided in the embodiments of the present application can eliminate the vulnerability of attackers exploiting centralized delays to launch DDoS attacks, reducing the risk of DDoS attacks. Using the methods provided in the embodiments of the present application, electronic devices can divide their nodes into multiple independent subsets, each of which can independently run a consensus protocol to reduce the impact of an attack on a single area. Dynamic partitioning of nodes can be achieved through optimization models to meet the requirements of indicators such as communication delay, health and load balancing.
[0035] Figure 2 A schematic diagram of a typical DDoS attack process provided in an embodiment of the present application.
[0036] Depend on Figure 2 It can be seen that hackers can control a large number of zombie hosts at the same time through the main control end, and launch attacks on many potential targets in various networks, including the Internet of Things, fully or semi-automatically.
[0037] Because in the embodiment of the present application, the electronic device calculates the communication delay between nodes and determines the difference between the maximum node load and the minimum node load of each subset, and determines the optimal belonging probability value of each node based on the communication delay and the difference. This method significantly improves the message transmission efficiency within the subset by ensuring that low-latency nodes are prioritized, and avoids the interference of high-latency links on the consensus process; it not only effectively disperses potential high-latency nodes and eliminates the vulnerability of attackers using centralized delays to launch DDoS attacks, but also prevents resource-overloaded nodes from becoming attack targets by dynamically balancing subset loads. While maintaining efficient consensus, a more robust defense system is built, improving the communication efficiency and security of the distributed consensus system.
[0038] Example 2:
[0039] In order to improve the accuracy of node allocation, based on the above embodiment, in the embodiment of the present application, before determining the probability value of each node to be allocated belonging to the subset based on the communication delay amount and the difference between any two nodes, the method further includes:
[0040] For each node in the distributed consensus system, determine the health of the node based on the online time of the node in a preset time period before the current time;
[0041] The determining, based on the communication delay amount and the difference between any two nodes, a probability value of each node to be assigned belonging to the subset includes:
[0042] The probability value of each node to be allocated belonging to the subset is determined according to the communication delay between any two nodes, the difference and the health of each node.
[0043] In actual scenarios, when the health of nodes in a subset is low, the subset is easily targeted by DDoS attacks. Therefore, the electronic device can determine the probability value of each node to be assigned belonging to the subset based on the health of each node.
[0044] Specifically, the electronic device can also determine the health of each node in the distributed consensus system. In one example, the electronic device can determine the online duration of the node in a preset time period before the current time, and determine the ratio of the online duration to the total duration of the preset time period as the health of the node. The electronic device can send a monitoring message to the node at a preset time interval. If the node is online, the node will send a feedback message to the electronic device after receiving the monitoring message. If the node is not online, the feedback message will not be sent to the electronic device. The electronic device can obtain the number of feedback messages received from the node in the preset time period before the current time, and determine the online duration of the node based on the product of the number and the duration corresponding to the preset time interval.
[0045] The electronic device can determine the probability value of each node to be assigned belonging to the subset based on the communication delay between any two nodes, the determined difference and the health of each node. In one example, the electronic device can input the communication delay between any two nodes, the determined difference and the health of each node into a pre-trained probability assessment model, and the probability assessment model determines the probability of each node being assigned to the subset.
[0046] Example 3:
[0047] In order to accurately and effectively perform node allocation, based on the above embodiments, in the embodiment of the present application, the probability value of each node to be allocated belonging to the subset is determined based on the communication delay between any two nodes, the difference, and the health of each node, including:
[0048] The probability value of each node to be assigned belonging to the subset is determined by the following formula:
[0049]
[0050] Among them, K is the number of pre-saved subsets, L is the kth subset, (i, j)∈L means that node i and node j belong to the kth subset, x ik is the probability value to be determined that node i belongs to the kth subset, x jk is the to-be-determined probability value of node j belonging to the kth subset, d ij is the communication delay between node i and node j, λ is the pre-saved load weight, IB k is the difference of the kth subset, μ is the pre-saved health weight, H i is the health of node i.
[0051] In order to accurately and effectively perform node allocation, the electronic device can determine the probability value of each node to be allocated belonging to the subset by the following formula:
[0052]
[0053] Among them, K is the number of pre-saved subsets, L is the kth subset, (i, j)∈L means that node i and node j belong to the kth subset, x ik is the probability value to be determined that node i belongs to the kth subset, x jk is the to-be-determined probability value of node j belonging to the kth subset, d ij is the communication delay between node i and node j, λ is the pre-saved load weight, IB k is the difference of the kth subset, μ is the pre-saved health weight, H i is the health of node i.
[0054] In order to ensure the convexity of the function, x ik is a continuous parameter and the final optimization result of the objective function, that is, the optimal allocation solution for each node to which subset it belongs. Therefore, the physical meaning of this objective function is to minimize communication latency and improve efficiency within subsets; balance subset loads and improve resource utilization; and maximize health and enhance subset robustness.
[0055] The constraints for calculating the probability value of each node belonging to a subset are:
[0056]
[0057] Constraint one restricts each node to belong to only one subset, and constraint two restricts the number of nodes in each subset to not be too small, in order to meet the security requirements of the consensus protocol and prevent some subsets from being too small and losing their ability to resist attacks.
[0058] Assuming that some nodes in the distributed consensus system are in a position with high network latency or have low computing power, if the subsets are not allocated reasonably, these nodes may become bottlenecks, resulting in a decrease in consensus efficiency, and even being exploited by attackers to become targets of DDoS attacks. The optimization goal of the embodiment of the present application is to construct multiple subsets so that the communication delay between nodes in each subset is low, the load within the subset is balanced, and nodes with strong computing power are given priority to participate in the consensus. Assuming that there are 6 nodes participating in the consensus, the distributed consensus system is divided into three consensus subsets by calculating and reasonably allocating the nodes: Subset A: {1,2}, with low communication latency, strong computing power, and balanced load; Subset B: {3,4}, although the latency is high, the two are adjacent to each other, the load is high but balanced; Subset C: {5,6}, with medium latency, moderate load, and strong computing power.
[0059] This enables faster communication within the same subset, avoids message propagation across high-latency paths, and makes the load within each subset more consistent, improving robustness. Consensus tasks are mainly assigned to nodes with high computing power, improving overall processing speed, reducing consensus failures caused by single-node overload, and lowering the DDoS attack surface.
[0060] Example 4:
[0061] In order to determine the connection relationship between nodes, based on the above embodiments, in an embodiment of the present application, the method further includes:
[0062] After each node is allocated, for any subset of the distributed consensus system, determining a first ratio of the traffic transmitted between any two nodes in the subset to the maximum traffic transmitted in advance for the any two nodes, and a second ratio of the attack traffic transmitted between any two nodes to the total traffic transmitted between the any two nodes; and determining a connection probability value for a connection between every two nodes in the subset based on the first ratio and the second ratio;
[0063] For any two nodes, the connection relationship between the two nodes is determined based on whether the connection probability value between the two nodes is greater than a preset value.
[0064] During a DDoS attack, traditional static routing tables cannot be dynamically adjusted, causing normal service requests and attack traffic to share congested links, leading to large-scale packet loss and service interruption. In the embodiments of the present application, electronic devices can avoid attack paths, prevent overloading of certain links, and disperse traffic by changing the connection relationships between nodes.
[0065] Specifically, after each node is allocated, the electronic device can determine, for any subset of the distributed consensus system, a first ratio of the traffic transmitted between any two nodes in the subset to a large transmission flow pre-saved for the arbitrary two nodes, and determine a second ratio of the attack traffic transmitted between any two nodes to the total traffic transmitted between the arbitrary two nodes. After obtaining the first ratio and the second ratio, the electronic device can determine the connection probability value of the connection between each two nodes in the subset based on the first ratio and the second ratio. In one example, the electronic device can input the first ratio and the second ratio into a pre-trained connection probability recognition model to obtain the connection probability value of the connection between each two nodes in the subset output by the connection probability recognition model.
[0066] The electronic device can determine, for any two nodes, that the connection relationship between the two nodes is connected if the connection probability value between the two nodes is greater than a preset value; and determine that the connection relationship between the two nodes is not connected if the connection probability value between the two nodes is not greater than the preset value.
[0067] Example 5:
[0068] In order to determine the connection probability value between nodes, based on the above embodiments, in an embodiment of the present application, determining the connection probability value of the connection between every two nodes in the subset based on the first ratio and the second ratio includes:
[0069] The connection probability value between each two nodes in the subset is determined by the following formula:
[0070]
[0071] Among them, x ij is the connection probability value between node i and node j, E is any subset, T ij is the traffic transmitted between node i and node j, C ij is the maximum transmission flow between node i and node j, b is the weight corresponding to the normal flow ratio, iso ij is a second ratio of the attack traffic transmitted between node i and node j to the total traffic transmitted between node i and node j.
[0072] The electronic device can determine the connection probability value between each two nodes in the subset by the following formula:
[0073]
[0074] Among them, x ij is the connection probability value between node i and node j, E is any subset, T ij is the traffic transmitted between node i and node j, C ij is the maximum transmission flow between node i and node j, b is the weight corresponding to the normal flow ratio, iso ij is a second ratio of the attack traffic transmitted between node i and node j to the traffic transmitted between node i and node j.
[0075] In the embodiments of the present application, based on traffic distribution and the load status of routing nodes, network path selection is optimized and malicious traffic is isolated, mitigating the impact of attack traffic on network stability and ensuring the smooth operation of normal communications. The physical significance of the function that determines the connection probability value lies in determining which paths are used to transmit normal traffic and isolating the set of paths that transmit attack traffic. This function can minimize the imbalance in traffic distribution across routing nodes across the entire network while isolating potential attack traffic.
[0076] The maximum transmission flow rate can also be called bandwidth capacity. ij represents the isolation weight of attack traffic on the link between node i and node j, iso ij The larger the value, the more attack traffic the link carries and the more significant the isolation effect. In the optimization process, it should be avoided or marked for isolation. ij The smaller it is, the higher the proportion of normal traffic is considered to be, and it belongs to a secure communication link.
[0077] Specifically, the second ratio can be calculated by the following formula:
[0078]
[0079] iso ij is the second ratio, A ij is the attack traffic transmitted between node i and node j, T ij is the traffic transmitted between node i and node j.
[0080] The constraints for calculating the connection probability value are:
[0081] x ij ·T ij ≤C ij
[0082] Among them, x ij is the connection probability value between node i and node j, Tij is the traffic transmitted between node i and node j, C ij is the maximum transmission flow between node i and node j.
[0083] This constraint states that the traffic on any link cannot exceed its bandwidth capacity.
[0084] The optimization goal of the embodiments of this application is to avoid attack paths, prevent overloading certain links, and disperse traffic while meeting link capacity constraints. The system intelligently evaluates link load, attack intensity, and isolation, dynamically adjusting routes to divert normal services away from attack paths while limiting attack traffic channels, ensuring the high accessibility and robustness of the distributed consensus system in complex environments.
[0085] Example 6:
[0086] In order to improve task execution efficiency, based on the above embodiments, in an embodiment of the present application, the method further includes:
[0087] Obtain the resource consumption and delay overhead of each task executed by each node in the distributed consensus system, as well as the pre-saved benefit value corresponding to the execution of each task. Determine the execution probability value of each node executing each task based on the resource consumption and delay overhead of each task executed by each node, as well as the pre-saved benefit value corresponding to the execution of each task.
[0088] For each node, if the execution probability value of the node for executing a task exceeds the probability value saved for the task, the node is determined to be the target node for executing the task; so that when the task is received, the target node executes the task.
[0089] In order to minimize the total resource consumption of task execution, while giving priority to the execution efficiency of high-priority tasks and reducing performance losses caused by malicious calls, electronic devices can determine the execution probability value of each node for each task, and then determine the tasks performed by each node.
[0090] Specifically, the electronic device can obtain the resource consumption and delay overhead of each node in the distributed consensus system to perform each task. In one example, the electronic device can locally save the resource consumption and delay overhead of each node in the distributed consensus system to perform each task. The electronic device can also locally pre-save the benefit value corresponding to the node performing each task, where the benefit value can also be called a weight. The electronic device can determine the execution probability value of each node performing each task based on the resource consumption and delay overhead of each node performing each task, and the pre-saved benefit value corresponding to the execution of each task. In one example, the electronic device can locally save a pre-trained task determination model. The electronic device can input the resource consumption and delay overhead of each node performing each task, and the pre-saved benefit value corresponding to the execution of each task, into the task determination model, and obtain the execution probability value of each node performing each task output by the task determination model.
[0091] After determining the execution probability value of each task at each stage, the electronic device can determine, for each node, if the execution probability value of the node for executing a task exceeds the probability value stored for the task, that node as the target node for executing the task. Upon receiving the task, the target node executes the task. There may be more than one node executing a task.
[0092] The electronic device's global coordination and feedback module collects and analyzes protection strategies and performance feedback from the consensus, routing, and application layers, dynamically adjusting and optimizing model parameters and unifying the three-layer protection strategies to form a systematic closed-loop protection system. First, it collects multi-layer performance data: at the consensus layer, it records node health, partition latency, and consensus efficiency; at the routing layer, it monitors link utilization, traffic distribution, and attack isolation effectiveness; and at the application layer, it analyzes smart contract execution efficiency, node load, and malicious call processing results. Based on the objective functions of each layer, it calculates the optimal results: subset partitioning for dynamic adjustment of consensus node distribution; routing connection topology for link load balancing and attack traffic isolation; and contract task allocation for optimizing task distribution and improving critical task execution efficiency. After calculating all optimal solutions, the adjusted results are evaluated and compared, forming a closed-loop monitoring, optimization, and feedback mechanism to continuously improve anti-DDoS capabilities and robustness.
[0093] Example 7:
[0094] In order to determine the execution probability value of each node executing each task, based on the above embodiments, in the embodiment of the present application, the execution probability value of each node executing each task is determined based on the resource consumption and delay overhead of each node executing each task, and the pre-stored benefit value corresponding to executing each task, including:
[0095] The execution probability value of each node executing each task is determined by the following formula:
[0096]
[0097] Among them, N is the distributed consensus system, M is the set of each task, x im is the probability value of node i executing task m, U im is the resource consumption of node i executing task m, a is the weight corresponding to the delay overhead, L im is the delay cost of node i executing task m, θ is the weight corresponding to the benefit, p m is the pre-saved profit value corresponding to executing task m; wherein, the profit value of executing a high-priority task is higher than the profit value of executing other tasks, and the profit values of executing other tasks are all preset values.
[0098] In the embodiment of the present application, the electronic device can determine the execution probability value of each node executing each task by using the following formula:
[0099]
[0100] Among them, N is the distributed consensus system, M is the set of each task, x im is the probability value of node i executing task m, U im is the resource consumption of node i executing task m, a is the weight corresponding to the delay overhead, L im is the delay cost of node i executing task m, θ is the weight corresponding to the benefit, and p m is the pre-saved profit value corresponding to executing task m; wherein, the profit value of executing a high-priority task is higher than the profit value of executing other tasks, and the profit values of executing other tasks are all preset values.
[0101] The benefit value of executing other tasks may be 0, that is, when determining the execution probability value of each node executing each task, only the benefit value of the high-priority task may be considered.
[0102] When only the benefit value of high-priority tasks is considered, the electronic device can determine the execution probability value of each node executing each task by the following formula:
[0103]
[0104] Among them, H is the high priority task set including high priority tasks, x ih is the probability value of node i executing task h, p his the pre-saved profit value corresponding to the execution of task h, where H≤M, that is, the total number of high-priority tasks is less than or equal to the total number of tasks.
[0105] The first term in the function that determines the execution probability value is the total resource and delay cost when executing all tasks (including ordinary contracts and defense contracts). The second term is the benefits and value brought by the scheduled high-priority tasks. When electronic devices perform task assignments, they tend to assign high-priority tasks h to nodes with lower execution costs, avoid scheduling tasks to nodes with high resource consumption and high latency, and prioritize critical tasks when resources are tight. This function takes resource efficiency, system latency, and priority scheduling into account, realizing an explainable and easy-to-implement contract task scheduling optimization mechanism that can effectively address challenges such as system resource competition between multiple tasks and high-priority business delays.
[0106] The constraints for calculating the execution probability value are:
[0107]
[0108] L im ≤L max
[0109] Among them, U im is the resource consumption of node i executing task m, x im is the probability value of node i executing task m, N is the distributed consensus system, Cap i is the total resource capacity saved for node i, L im The delay cost of executing task m for node i, L max The pre-saved delay threshold.
[0110] The constraints here limit the resource consumption to not exceed the total resource capacity, and the delay cannot be greater than the preset delay threshold to ensure the effectiveness and timeliness of communication.
[0111] Blockchain, a distributed ledger within a distributed consensus system, is a newly emerging technology. From a network security perspective, using this distributed technology to counter distributed attacks is a novel and effective defense strategy, significantly improving flexibility, efficiency, and security compared to traditional centralized defenses. Furthermore, convex optimization holds a significant position in mathematics, enabling it to estimate approximate optimal solutions for multiple variables through iterative optimization. Distributed consensus system-based defenses can be broadly divided into the consensus layer, routing layer, and application layer. Optimizing each layer independently and then integrating them into a coordinated overall framework can significantly enhance the network's resilience to DDoS attacks. Specifically, the consensus layer determines the subset to which a node belongs, the routing layer determines the connections between nodes, and the application layer determines the tasks each node performs.
[0112] Figure 3 A schematic diagram of a hierarchical optimization structure provided in an embodiment of the present application.
[0113] Depend on Figure 3 It can be seen that the protection based on the distributed consensus system can include the consensus layer, routing layer, and application layer.
[0114] This embodiment of the present application proposes an anti-DDoS method based on layered protection. To address the prevalence of malicious traffic on the existing internet, traditional centralized single-point defenses suffer from single-point limitations, poor flexibility, and a lack of theoretical guidance. This embodiment combines distributed consensus systems like blockchain with convex optimization theory, dividing the defense into three logical layers: the consensus layer, the routing layer, and the application layer. By designing independent convex optimization models and dynamic adjustment mechanisms for each layer, the distributed nature of blockchain is fully utilized, improving overall defense efficiency and robustness.
[0115] A consensus layer optimization method is proposed. Based on indicators such as communication delay, health and load balancing, a convex optimization model is constructed to divide the entire network nodes into multiple independent consensus subsets. Each subset runs the consensus protocol independently to reduce the impact of attacks on a single area; a routing layer optimization method is proposed. Based on traffic distribution and the load status of routing nodes, network path selection is optimized and malicious traffic is isolated, thereby reducing the impact of attack traffic on network stability; an application layer optimization method is proposed. Based on the execution priority, node load and calling behavior of smart contracts, the contract calling path and task allocation are dynamically adjusted to protect on-chain resources and improve contract execution efficiency; a global coordination and feedback mechanism is proposed. Based on multi-layer monitoring data and optimization feedback, the three-layer protection strategy is unified and coordinated and the optimization model parameters are adjusted to improve the protection effect and long-term stability of the system.
[0116] Based on this, the embodiments of the present application can, in existing Internet scenarios, quickly execute automated execution strategies in different hierarchical structures based on the characteristic status of network node traffic in a defense system composed of a distributed consensus system including blockchain, thereby ensuring the security of the defense system and the service availability of network users.
[0117] The purpose of the embodiments of this application is to provide an anti-DDoS method based on layered protection. This method primarily combines blockchain technology with convex optimization theory. Starting from the three logical protection layers of consensus, routing, and application, convex optimization functions are constructed to solve the optimal strategy, forming a complete defense logic framework. In this network scenario, when a hacker sends DDoS attack traffic from the network boundary into an autonomous domain, the defender needs to set optimization parameters based on the network conditions. Then, based on the optimization results, the final defense strategy at different levels is determined, and the defense system's structure is automatically adjusted to mitigate the impact of the DDoS attack.
[0118] Figure 4 A detailed process diagram of a subset allocation provided in an embodiment of the present application includes the following steps:
[0119] S401: Based on the consensus layer, determine the subset to which each node belongs.
[0120] S402: Based on the routing layer, determine the connection relationship between every two nodes.
[0121] S403: Based on the application layer, determine the tasks performed by each node.
[0122] Specifically, electronic devices can monitor the traffic situation of all nodes in the network, obtain key information such as load and latency, and customize the health of the network based on the defender's needs. They can also build a convex optimization model to select the optimal node subset partitioning scheme. They can also obtain the subset partitioning results of the consensus layer and identify the priority communication needs between key nodes. They can also monitor the utilization rate, attack traffic distribution, and link health status of the entire network links. They can also build an optimization model to output traffic allocation plans and attack traffic isolation paths. They can also obtain the communication path status of the routing layer, analyze the priority and execution requirements of the current contract tasks, build an optimization model, and output a contract task allocation plan. Finally, they can calculate the set of assigned nodes for each contract task. They can also collect feedback data from the three-layer optimization, evaluate the effects of the adjustments, record and compare them, and comprehensively output optimization strategies to complete the closed-loop optimization of system protection and continuously improve the anti-DDoS capability and robustness.
[0123] The consensus layer optimization method in the embodiment of the present application constructs a convex optimization model based on indicators such as communication delay, health and load balancing, divides the nodes of the entire network into multiple independent consensus subsets, and each subset independently runs the consensus protocol to reduce the impact of attacks on a single area; the routing layer protection method optimizes network path selection and isolates malicious traffic based on traffic distribution and the load status of routing nodes, thereby reducing the impact of attack traffic on network stability; the application layer protection method dynamically adjusts the contract call path and task allocation based on the execution priority, node load and calling behavior of the smart contract, thereby protecting on-chain resources and improving contract execution efficiency; the global coordination and feedback mechanism, based on multi-layer monitoring data and optimization feedback, unifies and coordinates the three-layer protection strategy and adjusts the optimization model parameters to improve the protection effect and long-term stability of the system.
[0124] Example 8:
[0125] Figure 5 A schematic diagram of the structure of a subset allocation device provided in an embodiment of the present application, the device comprising:
[0126] Processing module 501 is configured to obtain, for any subset in the distributed consensus system, a communication delay between any two nodes to be assigned, and a difference between a maximum node load and a minimum node load in the subset, and determine a probability value of each node to be assigned belonging to the subset based on the communication delay between any two nodes and the difference;
[0127] The determination module 502 is configured to determine, for each node to be assigned, a target subset to which the node belongs based on the maximum probability value of the node belonging to each subset.
[0128] In a possible implementation, the processing module 501 is further configured to determine, for each node in the distributed consensus system, the health of the node based on the online duration of the node within a preset time period before the current time;
[0129] The processing module 501 is further configured to determine a probability value of each node to be allocated belonging to the subset based on the communication delay between any two nodes, the difference, and the health of each node.
[0130] In a possible implementation, the processing module 501 is specifically configured to determine the probability value of each node to be assigned belonging to the subset by using the following formula:
[0131]
[0132] Among them, K is the number of pre-saved subsets, L is the kth subset, (i, j)∈L means that node i and node j belong to the kth subset, x ikis the probability value to be determined that node i belongs to the kth subset, x jk is the to-be-determined probability value of node j belonging to the kth subset, d ij is the communication delay between node i and node j, λ is the pre-saved load weight, IB k is the difference of the kth subset, μ is the pre-saved health weight, H i is the health of node i.
[0133] In one possible embodiment, the processing module 501 is further used to determine, for any subset of the distributed consensus system, after each node allocation is completed, a first ratio of the traffic transmitted between any two nodes in the subset to the maximum transmission traffic pre-saved for the any two nodes, and a second ratio of the attack traffic transmitted between any two nodes to the total traffic transmitted between the any two nodes; determine the connection probability value of the connection between every two nodes in the subset based on the first ratio and the second ratio; and determine, for any two nodes, the connection relationship between the two nodes based on whether the connection probability value of the connection between the two nodes is greater than a preset value.
[0134] In a possible implementation, the processing module 501 is specifically configured to determine a connection probability value of a connection between every two nodes in the subset using the following formula:
[0135]
[0136] Among them, x ij is the connection probability value between node i and node j, E is any subset, T ij is the traffic transmitted between node i and node j, C ij is the maximum transmission flow between node i and node j, b is the weight corresponding to the normal flow ratio, iso ij is a second ratio of the attack traffic transmitted between node i and node j to the total traffic transmitted between node i and node j.
[0137] In one possible implementation, the processing module 501 is further configured to obtain resource consumption and delay overhead of each node in the distributed consensus system executing each task, as well as a pre-stored benefit value corresponding to executing each task, and determine an execution probability value of each node executing each task based on the resource consumption and delay overhead of each node executing each task, as well as the pre-stored benefit value corresponding to executing each task;
[0138] For each node, if the execution probability value of the node for executing a task exceeds the probability value saved for the task, the node is determined to be the target node for executing the task; so that when the task is received, the target node executes the task.
[0139] In a possible implementation, the processing module 501 is specifically configured to determine the execution probability value of each node executing each task using the following formula:
[0140]
[0141] Among them, N is the distributed consensus system, M is the set of each task, x im is the probability value of node i executing task m, U im is the resource consumption of node i executing task m, a is the weight corresponding to the delay overhead, L im is the delay cost of node i executing task m, θ is the weight corresponding to the benefit, and p m is the pre-saved profit value corresponding to executing task m; wherein, the profit value of executing a high-priority task is higher than the profit value of executing other tasks, and the profit values of executing other tasks are all preset values.
[0142] Example 9:
[0143] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Based on the above embodiments, the embodiment of the present application further provides an electronic device, such as Figure 6 As shown, it includes: a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604;
[0144] The memory 603 stores a computer program. When the program is executed by the processor 601, the processor 601 performs the following steps:
[0145] For any subset in the distributed consensus system, obtain the communication delay between any two nodes to be assigned, and the difference between the maximum node load and the minimum node load in the subset; and determine the probability value of each node to be assigned belonging to the subset based on the communication delay between any two nodes and the difference;
[0146] For each node to be assigned, the target subset to which the node belongs is determined according to the maximum probability value of the node belonging to each subset.
[0147] In a possible implementation, before determining the probability value of each node to be assigned belonging to the subset based on the communication delay and the difference between any two nodes, the method further includes:
[0148] For each node in the distributed consensus system, determine the health of the node based on the online time of the node in a preset time period before the current time;
[0149] The determining, based on the communication delay amount and the difference between any two nodes, a probability value of each node to be assigned belonging to the subset includes:
[0150] The probability value of each node to be allocated belonging to the subset is determined according to the communication delay between any two nodes, the difference and the health of each node.
[0151] In a possible implementation, determining the probability value of each node to be assigned belonging to the subset based on the communication delay between any two nodes, the difference, and the health of each node includes:
[0152] The probability value of each node to be assigned belonging to the subset is determined by the following formula:
[0153]
[0154] Among them, K is the number of pre-saved subsets, L is the kth subset, (i, j)∈L means that node i and node j belong to the kth subset, x ik is the probability value to be determined that node i belongs to the kth subset, x jk is the to-be-determined probability value of node j belonging to the kth subset, d ij is the communication delay between node i and node j, λ is the pre-saved load weight, IB k is the difference of the kth subset, μ is the pre-saved health weight, H i is the health of node i.
[0155] In one possible implementation, the method further includes:
[0156] After each node is allocated, for any subset of the distributed consensus system, determining a first ratio of the traffic transmitted between any two nodes in the subset to the maximum traffic transmitted in advance for the any two nodes, and a second ratio of the attack traffic transmitted between any two nodes to the total traffic transmitted between the any two nodes; and determining a connection probability value for a connection between every two nodes in the subset based on the first ratio and the second ratio;
[0157] For any two nodes, the connection relationship between the two nodes is determined based on whether the connection probability value between the two nodes is greater than a preset value.
[0158] In a possible implementation, determining, based on the first ratio and the second ratio, a connection probability value of a connection between every two nodes in the subset includes:
[0159] The connection probability value between each two nodes in the subset is determined by the following formula:
[0160]
[0161] Among them, x ij is the connection probability value between node i and node j, E is any subset, T ij is the traffic transmitted between node i and node j, C ij is the maximum transmission flow between node i and node j, b is the weight corresponding to the normal flow ratio, iso ij is a second ratio of the attack traffic transmitted between node i and node j to the total traffic transmitted between node i and node j.
[0162] In one possible implementation, the method further includes:
[0163] Obtain the resource consumption and delay overhead of each task executed by each node in the distributed consensus system, as well as the pre-saved benefit value corresponding to the execution of each task. Determine the execution probability value of each node executing each task based on the resource consumption and delay overhead of each task executed by each node, as well as the pre-saved benefit value corresponding to the execution of each task.
[0164] For each node, if the execution probability value of the node for executing a task exceeds the probability value saved for the task, the node is determined to be the target node for executing the task; so that when the task is received, the target node executes the task.
[0165] In a possible implementation, determining the execution probability value of each node executing each task based on the resource consumption and delay overhead of each node executing each task and a pre-stored benefit value corresponding to executing each task includes:
[0166] The execution probability value of each node executing each task is determined by the following formula:
[0167]
[0168] Among them, N is the distributed consensus system, M is the set of each task, x im is the probability value of node i executing task m, U im is the resource consumption of node i executing task m, a is the weight corresponding to the delay overhead, L im is the delay cost of node i executing task m, θ is the weight corresponding to the benefit, and pm is the pre-saved profit value corresponding to executing task m; wherein, the profit value of executing a high-priority task is higher than the profit value of executing other tasks, and the profit values of executing other tasks are all preset values.
[0169] The communication bus mentioned in the server above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.
[0170] The communication interface is used for communication between the above electronic device and other devices.
[0171] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk memory. Alternatively, the memory may be at least one storage device located away from the processor.
[0172] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (NP), etc.; it can also be a digital signal processing processor (DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.
[0173] Example 10:
[0174] Based on the above embodiments, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program executable by an electronic device. When the program is executed on the electronic device, the electronic device implements the following steps:
[0175] The memory stores a computer program, which, when executed by the processor, causes the processor to perform the following steps:
[0176] For any subset in the distributed consensus system, obtain the communication delay between any two nodes to be assigned, and the difference between the maximum node load and the minimum node load in the subset; and determine the probability value of each node to be assigned belonging to the subset based on the communication delay between any two nodes and the difference;
[0177] For each node to be assigned, the target subset to which the node belongs is determined according to the maximum probability value of the node belonging to each subset.
[0178] In a possible implementation, before determining the probability value of each node to be assigned belonging to the subset based on the communication delay and the difference between any two nodes, the method further includes:
[0179] For each node in the distributed consensus system, determine the health of the node based on the online time of the node in a preset time period before the current time;
[0180] The determining, based on the communication delay amount and the difference between any two nodes, a probability value of each node to be assigned belonging to the subset includes:
[0181] The probability value of each node to be allocated belonging to the subset is determined according to the communication delay between any two nodes, the difference and the health of each node.
[0182] In a possible implementation, determining the probability value of each node to be assigned belonging to the subset based on the communication delay between any two nodes, the difference, and the health of each node includes:
[0183] The probability value of each node to be assigned belonging to the subset is determined by the following formula:
[0184]
[0185] Among them, K is the number of pre-saved subsets, L is the kth subset, (i, j)∈L means that node i and node j belong to the kth subset, x ik is the probability value to be determined that node i belongs to the kth subset, x jk is the to-be-determined probability value of node j belonging to the kth subset, d ij is the communication delay between node i and node j, λ is the pre-saved load weight, IB k is the difference of the kth subset, μ is the pre-saved health weight, H i is the health of node i.
[0186] In one possible implementation, the method further includes:
[0187] After each node is allocated, for any subset of the distributed consensus system, determining a first ratio of the traffic transmitted between any two nodes in the subset to the maximum traffic transmitted in advance for the any two nodes, and a second ratio of the attack traffic transmitted between any two nodes to the total traffic transmitted between the any two nodes; and determining a connection probability value for a connection between every two nodes in the subset based on the first ratio and the second ratio;
[0188] For any two nodes, the connection relationship between the two nodes is determined based on whether the connection probability value between the two nodes is greater than a preset value.
[0189] In a possible implementation, determining, based on the first ratio and the second ratio, a connection probability value of a connection between every two nodes in the subset includes:
[0190] The connection probability value between each two nodes in the subset is determined by the following formula:
[0191]
[0192] Among them, x ij is the connection probability value between node i and node j, E is any subset, T ij is the traffic transmitted between node i and node j, C ij is the maximum transmission flow between node i and node j, b is the weight corresponding to the normal flow ratio, iso ij is a second ratio of the attack traffic transmitted between node i and node j to the total traffic transmitted between node i and node j.
[0193] In one possible implementation, the method further includes:
[0194] Obtain the resource consumption and delay overhead of each task executed by each node in the distributed consensus system, as well as the pre-saved benefit value corresponding to the execution of each task. Determine the execution probability value of each node executing each task based on the resource consumption and delay overhead of each task executed by each node, as well as the pre-saved benefit value corresponding to the execution of each task.
[0195] For each node, if the execution probability value of the node for executing a task exceeds the probability value saved for the task, the node is determined to be the target node for executing the task; so that when the task is received, the target node executes the task.
[0196] In a possible implementation, determining the execution probability value of each node executing each task based on the resource consumption and delay overhead of each node executing each task and a pre-stored benefit value corresponding to executing each task includes:
[0197] The execution probability value of each node executing each task is determined by the following formula:
[0198]
[0199] Among them, N is the distributed consensus system, M is the set of each task, x im is the probability value of node i executing task m, U im is the resource consumption of node i executing task m, a is the weight corresponding to the delay overhead, L im is the delay cost of node i executing task m, θ is the weight corresponding to the benefit, and p m is the pre-saved profit value corresponding to executing task m; wherein, the profit value of executing a high-priority task is higher than the profit value of executing other tasks, and the profit values of executing other tasks are all preset values.
[0200] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt 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.) that contain computer-usable program code.
[0201] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, 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 flowchart and / or block diagram. 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.
[0202] 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.
[0203] 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.
[0204] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A node allocation method, characterized in that: The method comprises: For any subset in the distributed consensus system, obtain the communication delay between any two nodes to be assigned, and the difference between the maximum node load and the minimum node load in the subset; and determine the probability value of each node to be assigned belonging to the subset based on the communication delay between any two nodes and the difference; For each node to be assigned, the target subset to which the node belongs is determined according to the maximum probability value of the node belonging to each subset.
2. The method according to claim 1, characterized in that Before determining the probability value of each node to be assigned belonging to the subset based on the communication delay amount and the difference between any two nodes, the method further includes: For each node in the distributed consensus system, determine the health of the node based on the online time of the node in a preset time period before the current time; The determining, based on the communication delay amount and the difference between any two nodes, a probability value of each node to be assigned belonging to the subset includes: The probability value of each node to be allocated belonging to the subset is determined according to the communication delay between any two nodes, the difference and the health of each node.
3. The method according to claim 2, characterized in that The determining, based on the communication delay between any two nodes, the difference, and the health of each node, a probability value of each node to be assigned belonging to the subset includes: The probability value of each node to be assigned belonging to the subset is determined by the following formula: Among them, K is the number of pre-saved subsets, L is the kth subset, (i, j)∈L means that node i and node j belong to the kth subset, x ik is the probability value to be determined that node i belongs to the kth subset, x jk is the to-be-determined probability value of node j belonging to the kth subset, d ij is the communication delay between node i and node j, λ is the pre-saved load weight, IB k is the difference of the kth subset, μ is the pre-saved health weight, H i is the health of node i.
4. The method according to claim 1, wherein The method further comprises: After each node is allocated, for any subset of the distributed consensus system, determining a first ratio of the traffic transmitted between any two nodes in the subset to the maximum traffic transmitted in advance for the any two nodes, and a second ratio of the attack traffic transmitted between any two nodes to the total traffic transmitted between the any two nodes; and determining a connection probability value for a connection between every two nodes in the subset based on the first ratio and the second ratio; For any two nodes, the connection relationship between the two nodes is determined based on whether the connection probability value between the two nodes is greater than a preset value.
5. The method according to claim 4, characterized in that Determining a connection probability value between every two nodes in the subset according to the first ratio and the second ratio includes: The connection probability value between each two nodes in the subset is determined by the following formula: Among them, x ij is the connection probability value between node i and node j, E is any subset, T ij is the traffic transmitted between node i and node j, C ij is the maximum transmission flow between node i and node j, b is the weight corresponding to the normal flow ratio, iso ij is a second ratio of the attack traffic transmitted between node i and node j to the total traffic transmitted between node i and node j.
6. The method according to claim 1, characterized in that The method further comprises: Obtain the resource consumption and delay overhead of each task executed by each node in the distributed consensus system, as well as the pre-saved benefit value corresponding to the execution of each task. Determine the execution probability value of each node executing each task based on the resource consumption and delay overhead of each task executed by each node, as well as the pre-saved benefit value corresponding to the execution of each task. For each node, if the execution probability value of the node for executing a task exceeds the probability value saved for the task, the node is determined to be the target node for executing the task; so that when the task is received, the target node executes the task.
7. The method according to claim 6, characterized in that Determining the execution probability value of each node executing each task based on the resource consumption and delay overhead of each node executing each task and the pre-stored benefit value corresponding to executing each task includes: The execution probability value of each node executing each task is determined by the following formula: Among them, N is the distributed consensus system, M is the set of each task, x im is the probability value of node i executing task m, U im is the resource consumption of node i executing task m, a is the weight corresponding to the delay overhead, L im is the delay cost of node i executing task m, θ is the weight corresponding to the benefit, p m is the pre-saved profit value corresponding to executing task m; wherein, the profit value of executing a high-priority task is higher than the profit value of executing other tasks, and the profit values of executing other tasks are all preset values.
8. A node allocation device, characterized in that: The device comprises: a processing module configured to obtain, for any subset in the distributed consensus system, a communication delay between any two nodes to be assigned and a difference between a maximum node load and a minimum node load in the subset, and determine a probability value of each node to be assigned belonging to the subset based on the communication delay between any two nodes and the difference; The determination module is used to determine, for each node to be assigned, the target subset to which the node belongs according to the maximum value of the probability value of the node belonging to each subset.
9. An electronic device, characterized in that: The electronic device comprises at least a processor and a memory, and the processor is configured to implement the steps of the node allocation method according to any one of claims 1 to 7 when executing a computer program stored in the memory.
10. A computer-readable storage medium, characterized in that It stores a computer program, which, when executed by a processor, implements the steps of the node allocation method according to any one of claims 1 to 7.