Shortest path blocking method and device based on deep reinforcement learning

The deep reinforcement learning method is used to encode and decode the network graph, optimize the network structure and content information, solve the inefficiency and resource limitations of the shortest path blocking problem in network blocking, and achieve better blocking strategies and path selection.

CN114389990BActive Publication Date: 2024-09-03NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210018514.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-07
Publication Date
2024-09-03
Estimated Expiration
2042-01-07

AI Technical Summary

Technical Problem

It is difficult for the existing technology to effectively solve the shortest path blocking problem in the network blocking problem, especially when the attacker's strategy changes and the defender's path selection is complex, and due to resource limitations, blocking needs to be performed in batches, resulting in blocking. The solution is inefficient.

Method used

Using a method based on deep reinforcement learning, the network graph is mapped to a low-dimensional vector space through the encoder to obtain the action representation vector and the graph state representation vector, and is trained through the deep Q network to output the optimal blocking solution and use the reinforcement learning algorithm Optimize network structure and content information to achieve shortest path blocking.

Benefits of technology

It improves the efficiency and effect of network blocking, can optimize the blocking strategy of nodes or links in multiple rounds of operations, maximizes the shortest path selection of the defender, solves the blocking problem under resource constraints, and achieves better network blocking solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114389990B
    Figure CN114389990B
Patent Text Reader

Abstract

The present application relates to a shortest path blocking method and device based on deep reinforcement learning. The method comprises: obtaining a network graph, mapping the network graph to a low-dimensional vector space using an encoder, obtaining an action representation vector and a graph state representation vector, using the action representation vector as an action of reinforcement learning, and the graph state representation vector as a state of reinforcement learning, inputting them into a decoder, modeling the action and state into a deep Q network through the decoder, and training the deep Q network, and outputting the optimal blocking solution of the network graph to be blocked after inputting the network graph to be blocked. The use of this method makes it possible to solve the shortest path blocking problem by deep learning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network blocking technology, and in particular to a shortest path blocking method and device based on deep reinforcement learning. Background Art

[0002] As one of the most important combinatorial optimization problems, the network blocking problem aims to provide the blocking strategy of the attacker and the path selection strategy of the defender under the condition that both the attacker and the defender can achieve the optimal goal. In the shortest path blocking problem of the network blocking problem, without considering the defensive measures taken by the defender, the path selection strategy of the defender can be simplified to solve the shortest path problem between two points in the network, but the network state will change with the attacker's strategy. The goal of the attacker is to increase the length of certain nodes or edges by blocking them, so as to maximize the shortest path that the defender can choose. Considering that in actual situations, due to the limitation of blocking resources, multiple targets need to be blocked, then the blocking may not be simultaneous, but sequential or batched. Therefore, the problem is simplified, considering the situation where only one node is blocked for each action and multiple rounds of actions are performed, then each action only needs to block the nodes or links in the shortest path of the current network, but there may be multiple shortest paths of the same length before blocking.

[0003] Obviously, the shortest path blocking is an NP-hard problem, which is usually solved by means of a planning model. Summary of the invention

[0004] Based on this, it is necessary to provide a shortest path blocking method and device based on deep reinforcement learning to address the above technical problems.

[0005] A shortest path blocking method based on deep reinforcement learning, the method comprising:

[0006] Obtain a network diagram; the nodes in the network diagram are network devices with communication functions, the start node and the target node directly include multiple connection links, and when the communication function of the network device is damaged due to an attack by an attacker, other shortest paths are selected for communication;

[0007] The network graph is mapped to a low-dimensional vector space using an encoder to obtain an action representation vector and a graph state representation vector; wherein the action representation vector is obtained by encoding the location information, attribute information and connection relationship of the node with other nodes; the graph state representation vector is obtained by encoding a virtual node, which is connected to the nodes in the network graph and collects the information of the nodes in the network graph;

[0008] The action representation vector is used as the action of reinforcement learning, and the graph state representation vector is used as the state of reinforcement learning, which are input into the decoder. The action and state are modeled as a deep Q network through the decoder, and the deep Q network is trained. After the network graph to be blocked is input, the optimal blocking solution of the network graph to be blocked is output.

[0009] In one of the embodiments, it also includes: using information aggregation to propagate features of the graph structure of the network graph to obtain a graph state representation vector; wherein, in the nth propagation round, the node aggregates information of n-hop neighboring nodes.

[0010] In one embodiment, the method further includes: modeling the action and state into a deep Q network by a decoder:

[0011]

[0012] Where W4∈R p×1 , W5∈R p×1 is a learnable parameter in the deep Q network, z a , are the actions and states respectively.

[0013] In one of the embodiments, it also includes: constructing a loss function for training the deep Q network; the loss function includes: learning loss and graph reconstruction loss.

[0014] In one embodiment, the method further includes: constructing a loss function for training the deep Q network based on the Bellman equation:

[0015]

[0016] Among them, θ Q ={θ E ,θ D}, θ E ={W1, W2, W3} are the learning parameters of the encoder, θ D ={W4, W5} are the learning parameters of the decoder, α is the hyperparameter, γ is the discount factor, represents the parameters of the target network, n is the number of nodes in the graph reconstruction loss, and s i,j Indicates whether nodes i and j are connected, y i and j is its representation vector.

[0017] A shortest path blocking device based on deep reinforcement learning, the device comprising:

[0018] A graph acquisition module is used to acquire a network graph; the nodes in the network graph are network devices with communication functions, the start node and the target node directly contain multiple connection links, and when the communication function of the network device is damaged due to an attack by an attacker, other shortest paths are selected for communication;

[0019] An encoding module, used to map the network graph to a low-dimensional vector space using an encoder to obtain an action representation vector and a graph state representation vector; wherein the action representation vector is obtained by encoding the location information, attribute information and connection relationship of a node with other nodes; and the graph state representation vector is obtained by encoding a virtual node, which is connected to the nodes in the network graph and collects information of the nodes in the network graph;

[0020] A decoding module is used to input the action representation vector as the action of reinforcement learning and the graph state representation vector as the state of reinforcement learning into a decoder, model the action and state into a deep Q network through the decoder, and train the deep Q network. After inputting the network graph to be blocked, the optimal blocking solution of the network graph to be blocked is output.

[0021] In one of the embodiments, the encoding module is also used to perform feature propagation on the graph structure of the network graph by information aggregation to obtain a graph state representation vector; wherein, in the nth propagation round, the node aggregates information of n-hop neighboring nodes.

[0022] In one embodiment, the decoding module is further used to model the action and state as a deep Q network through a decoder:

[0023]

[0024] Where W4∈R p×1 , W5∈R p×1 is a learnable parameter in the deep Q network, z a , are the actions and states respectively.

[0025] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0026] Obtain a network diagram; the nodes in the network diagram are network devices with communication functions, the start node and the target node directly include multiple connection links, and when the communication function of the network device is damaged due to an attack by an attacker, other shortest paths are selected for communication;

[0027] The network graph is mapped to a low-dimensional vector space using an encoder to obtain an action representation vector and a graph state representation vector; wherein the action representation vector is obtained by encoding the location information, attribute information and connection relationship of the node with other nodes; the graph state representation vector is obtained by encoding a virtual node, which is connected to the nodes in the network graph and collects the information of the nodes in the network graph;

[0028] The action representation vector is used as the action of reinforcement learning, and the graph state representation vector is used as the state of reinforcement learning, which are input into the decoder. The action and state are modeled as a deep Q network through the decoder, and the deep Q network is trained. After the network graph to be blocked is input, the optimal blocking solution of the network graph to be blocked is output.

[0029] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0030] Obtain a network diagram; the nodes in the network diagram are network devices with communication functions, the start node and the target node directly include multiple connection links, and when the communication function of the network device is damaged due to an attack by an attacker, other shortest paths are selected for communication;

[0031] The network graph is mapped to a low-dimensional vector space using an encoder to obtain an action representation vector and a graph state representation vector; wherein the action representation vector is obtained by encoding the location information, attribute information and connection relationship of the node with other nodes; the graph state representation vector is obtained by encoding a virtual node, which is connected to the nodes in the network graph and collects the information of the nodes in the network graph;

[0032] The action representation vector is used as the action of reinforcement learning, and the graph state representation vector is used as the state of reinforcement learning, which are input into the decoder. The action and state are modeled as a deep Q network through the decoder, and the deep Q network is trained. After the network graph to be blocked is input, the optimal blocking solution of the network graph to be blocked is output.

[0033] The above-mentioned shortest path blocking method, device, computer equipment and storage medium based on deep reinforcement learning maps the network graph to a low-dimensional vector space through an encoder to obtain an action representation vector and a graph state representation vector. The action representation vector is obtained by encoding the node's position information, attribute information and connection relationship with other nodes. The graph state representation vector is obtained by encoding virtual nodes. The virtual nodes are connected to the nodes in the network graph and collect the information of the nodes in the network graph, so that the information contained in the network graph can be greatly expressed. Then, the action representation vector is used as the action of reinforcement learning, and the graph state representation vector is used as the state of reinforcement learning. They are input into the decoder, and the action and state are modeled as a deep Q network through the decoder. The information on the network structure and network content can be learned by using reinforcement learning. It makes it possible to solve the shortest path blocking problem by deep learning. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is a flowchart of a shortest path blocking method based on deep reinforcement learning in one embodiment;

[0035] Figure 2 It is a structural block diagram of a shortest path blocking device based on deep reinforcement learning in one embodiment;

[0036] Figure 3 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0038] In one embodiment, Figure 1 As shown, a shortest path blocking method based on deep reinforcement learning is provided, comprising the following steps:

[0039] Step 102, obtaining a network diagram.

[0040] The nodes in the network diagram are network devices with communication functions. The starting node and the target node directly contain multiple connection links. When the communication function of the network device is damaged due to the attack of the attacker, other shortest paths are selected for communication.

[0041] Step 104, using an encoder to map the network graph to a low-dimensional vector space to obtain an action representation vector and a graph state representation vector.

[0042] The action representation vector is obtained by encoding the node's location information, attribute information and connection relationship with other nodes; the graph state representation vector is obtained by encoding virtual nodes, which are connected to the nodes in the network graph and collect the information of the nodes in the network graph.

[0043] Step 106, the action representation vector is used as the action of reinforcement learning, and the graph state representation vector is used as the state of reinforcement learning, and is input into the decoder. The action and state are modeled as a deep Q network through the decoder, and the deep Q network is trained. After the network graph to be blocked is input, the optimal blocking solution of the network graph to be blocked is output.

[0044] In the above shortest path blocking method based on deep reinforcement learning, the network graph is mapped to a low-dimensional vector space through an encoder to obtain an action representation vector and a graph state representation vector. The action representation vector is obtained by encoding the node's position information, attribute information and connection relationship with other nodes. The graph state representation vector is obtained by encoding virtual nodes. The virtual nodes are connected to the nodes in the network graph and collect the information of the nodes in the network graph, so that the information contained in the network graph can be greatly expressed. Then, the action representation vector is used as the action of reinforcement learning, and the graph state representation vector is used as the state of reinforcement learning. They are input into the decoder, and the action and state are modeled as a deep Q network through the decoder. The information on the network structure and network content can be learned by using reinforcement learning. This makes it possible to solve the shortest path blocking problem by deep learning.

[0045] For the shortest circuit blocking problem, it can be described as:

[0046] Given a graph G, the defender transmits information between a determined starting node s and a target node t using the shortest path. The path length between the starting node s and the target node t in the graph is defined as the sum of the lengths of the links traversed in the st path. The attacker uses a multi-round blocking strategy to attack the defender's network. Each round of blocking only attacks one node. After the node is attacked, it is considered invalid and the defender cannot pass through. The ultimate goal of the attacker is to use limited blocking resources R to block some nodes in the network in the optimal node blocking order to maximize the defender's shortest path. When the resources are sufficient, the defender will have no st path to pass through, that is, the st path is completely blocked.

[0047] The formal modeling is as follows:

[0048] In the graph G(N,A), N represents the node set, A represents the link set, n represents the number of nodes in G, and α i represents the i-th node in the blocking graph G, K = {α1, α2, …, α k} represents the ordered blocking set of the attacker, and L(G) is defined as the sum of the lengths of all links in graph G. L(G\{α1,α2,…,α k}) represents the node set K = {α1, α2, …, α k} is arranged in order to block the nodes in G in turn, and the shortest path length in the graph, ANPL (Accumulated Normalized Path Length) value represents the normalized path length value. Since this problem considers the complete blocking of the node, that is, the node cannot pass after blocking, and there are more than two st paths in the network, so after each blocking, if there is still a shortest path, then the shortest path length must be less than the sum of the lengths of all links. Based on this, the expression of ANPL is given as follows:

[0049]

[0050] The ANPL value can be used to evaluate the blocking strategy.

[0051] Specifically, the definitions of the various elements in the Markov process of the present invention are as follows:

[0052] Environment: Given a graph G

[0053] Status: Updated graph after blocking the node

[0054] Action: Block node α i

[0055] Reward: The reduction in SPNI-DRL after taking the action.

[0056] Among them, the intelligent agent perceives the environment and obtains the observation process, corresponding to the attacker obtaining network information such as structure, path length, current blocking situation, etc.; the action taken by the intelligent agent corresponds to a round of blocking; the reward given by the environment to the intelligent agent's action corresponds to the change of the shortest path in the graph; the state update corresponds to the new network state after the node in the graph is blocked.

[0057] After the blocking process modeling is completed, it is necessary to consider which action is relatively "correct" in a certain state. In this calculation framework, the current graph G is first encoded to obtain the feature representation vector of each node: the node's location information, attribute information (blocking cost) and connection with other nodes are obtained. Then the obtained feature representation vector is decoded and mapped to a Q value, which is used to predict the benefits of blocking the node. The larger the Q value, the higher the priority of selecting the node for blocking. Based on the Q value obtained by decoding each node, a greedy strategy is used to select actions in the training stage, that is, the node with the highest Q value is selected with probability (1-ε), and any other node is randomly selected with probability ε. When there is no path between nodes st, a round of blocking ends. During the blocking process, the state-action-reward transfer tuple of step j is saved and stored in the experience replay pool for learning to update model parameters. The transfer tuple of step j is (S i ,A i ,R (i,i+1) ,S i+1 ,…,S i+j-1 ,A i+j-1 ,R (i+j-1,i+j) ,S i+j ), cumulative reward value

[0058] After generating enough blocking case samples using a large number of simulated graphs, a large number of state-action-reward transition tuples are also stored in the experience replay pool. Batches of training samples are extracted from the experience replay pool for training and the learning parameters of the encoder and decoder are updated to obtain the shortest path blocking model based on deep reinforcement learning.

[0059] The following is a detailed description of the settings for the encoder and decoder:

[0060] The encoder attempts to map the graph G to a low-dimensional vector space, including obtaining the node's location information, attribute information (blocking cost), and connections with other nodes, encoding them into a feature representation vector for each node, namely, an action representation vector, as a possible action (a); constructing a virtual node connected to all nodes in the graph, but the actual nodes in the graph do not point to the virtual node, and also gathering the information of other nodes to the virtual node for encoding to obtain a feature representation vector, namely, a graph state representation vector, as a graph state representation (st). The action representation vector and graph state representation vector obtained in this way can fully obtain the features containing rich information about the action and state, so that they can be more effectively used to estimate the action a in state st. i The action benefit Q(st,a i ).

[0061] Specifically, both the action representation vector and the graph state representation vector correspond to the node representation vector in the network. Therefore, when encoding and generating the node representation vector, it is necessary to capture the attribute information of the node and link as well as the structural information of the graph. In addition, since different blocking cases have different graph structures or starting node and target node pairs st, the node that can affect the shortest path of the defender is always relative to the current blocking case and the node pair st. Therefore, the node representation vector must also be able to obtain the relative position information of the node in the entire graph.

[0062] Based on the above considerations, the encoder part is based on the graph neural network (GNN) architecture and adopts information aggregation for feature propagation of graph structures. In the first round of feature propagation, each node (including virtual nodes) aggregates the information of all neighboring nodes; in each subsequent round of feature propagation, the node increases the neighboring view of one hop and obtains the information of the corresponding node. Due to the small-world characteristics of the network, any node can obtain the information of any node in the graph within 6 rounds of feature propagation. Finally, on the graph of n+1 nodes, after K times of information aggregation, the representation vector of the virtual node is obtained as the state representation vector of the graph, and the representation vectors of the remaining nodes are used as the action representation vector.

[0063] For the decoder, the above encoder can obtain the action representation a and state representation st of the input case. The task of the decoder is to map each action to a real value Q(st,a) in conjunction with the state. Q(st,a) is used to predict the maximum benefit that can be brought by executing action a under state st. Traditional Q learning methods use Q tables to update and record each pair of state-action values. When encountering large-scale problems, the space of state-action pairs will become very large, and the cost of updating state-action values ​​will become more difficult. Current work uses more functions to estimate Q(st,a). Usually, this function is obtained by learning methods, such as building a neural network for learning. When the function that estimates Q(st,a) is a deep neural network, the corresponding method is the deep Q network DQN.

[0064] This paper uses a two-layer perceptron with activation function ReLU to parameterize the Q function, which is defined as:

[0065]

[0066] Where W4∈R p×1 , W5∈R p×1 is a learnable parameter in the model, z a , They are the action representation vector and state representation vector output by the encoder respectively.

[0067] For the training part, as can be seen from the above description, it contains two parts of learnable parameters, namely the encoder parameters θE = {W1, W2, W3} and decoder parameters θ D ={W4, W5}. Since the model can predict the Q value for each action and state pair, that is, Q pred (a,st)=f(st,a;θ E ,θ D ). In general, cases or data have true labels Q true (st,a), then we can use the idea of ​​regression problem to minimize Q pred and Q true The gap is used to update the parameters, but in the shortest path network blocking problem, there are no real labels for regression learning.

[0068] Based on the Bellman equation, Q pred (a,st) is considered as Q k (a,st), Q true Considered , and then consider keeping and utilizing the original structure of the graph to the greatest extent possible, and design the loss function as follows:

[0069] where θ Q ={θ E ,θ D}. It includes two parts: Q learning loss and graph reconstruction loss. The Q learning loss part minimizes Q pred and Q true The graph reconstruction loss is used to maintain the structural information of the graph in the encoding vector space. α is a hyperparameter that weighs the ratio of Q learning loss and graph reconstruction loss. γ is a discount factor that determines the weight of future rewards. When γ = 0, it means that the model only considers current rewards and ignores future rewards. When γ = 1, it means that the model pays more attention to future rewards. During training, batches of training samples (st i ,a i ,r i,i+j ,st i+j )~U(D) is used for training. Represents the parameters of the target network, the target network is separated by a certain number of steps, and then the parameters of the Q network θ Q Copy it and put it into the model unchanged. In the graph reconstruction loss, n is the number of nodes, s i,j Indicates whether nodes i and j are connected, y i and j is its representation vector. The parameter update is performed using the batch gradient descent method.

[0070] The training process uses the BA model to generate simulation data for training and verifying whether the model converges. A total of one million network blocking cases were blocked. After each blocking case was completely blocked, batches of training samples were sampled from the experience replay pool to update the model parameters through the loss function. Every 500 blocking processes, tests were performed on the validation set (100 blocking cases).

[0071] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0072] In one embodiment, Figure 2 As shown, a shortest path blocking device based on deep reinforcement learning is provided, comprising: a graph acquisition module 202, an encoding module 204 and a decoding module 206, wherein:

[0073] A graph acquisition module 202 is used to acquire a network graph; the nodes in the network graph are network devices with communication functions, the start node and the target node directly include multiple connection links, and when the communication function of the network device is damaged due to an attack by an attacker, other shortest paths are selected for communication;

[0074] The encoding module 204 is used to map the network graph to a low-dimensional vector space using an encoder to obtain an action representation vector and a graph state representation vector; wherein the action representation vector is obtained by encoding the location information, attribute information and connection relationship of the node with other nodes; the graph state representation vector is obtained by encoding a virtual node, which is connected to the nodes in the network graph and collects the information of the nodes in the network graph;

[0075] The decoding module 206 is used to input the action representation vector as the action of reinforcement learning and the graph state representation vector as the state of reinforcement learning into the decoder, model the action and state into a deep Q network through the decoder, and train the deep Q network. After inputting the network graph to be blocked, the optimal blocking solution of the network graph to be blocked is output.

[0076] In one embodiment, the encoding module 204 is further used to perform feature propagation on the graph structure of the network graph by information aggregation to obtain a graph state representation vector; wherein, in the nth propagation round, the node aggregates information of n-hop neighbor nodes.

[0077] In one embodiment, the decoding module 206 is further configured to model the action and state as a deep Q network through a decoder:

[0078]

[0079] Where W4∈R p×1 , W5∈R p×1 is a learnable parameter in the deep Q network, z a , are the actions and states respectively.

[0080] In one of the embodiments, a loss function construction module constructs a loss function for training the deep Q network; the loss function includes: learning loss and graph reconstruction loss.

[0081] In one embodiment, the loss function construction module is further used to construct a loss function for training the deep Q network based on the Bellman equation:

[0082]

[0083] Among them, θ Q ={θ E ,θ D}, θ E ={W1, W2, W3} are the learning parameters of the encoder, θ D ={W4, W5} are the learning parameters of the decoder, α is the hyperparameter, γ is the discount factor, represents the parameters of the target network, n is the number of nodes in the graph reconstruction loss, and s i,j Indicates whether nodes i and j are connected, y i and j is its representation vector.

[0084] For the specific definition of the shortest circuit blocking device based on deep reinforcement learning, please refer to the definition of the shortest circuit blocking method based on deep reinforcement learning above, which will not be repeated here. Each module in the above-mentioned shortest circuit blocking device based on deep reinforcement learning can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0085] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a shortest path blocking method based on deep reinforcement learning is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0086] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0087] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned embodiment method when executing the computer program.

[0088] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method of the above embodiment are implemented.

[0089] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0090] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0091] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A shortest path blocking method based on deep reinforcement learning, characterized in that: The method comprises: Obtain a network graph; the nodes in the network graph are network devices with communication functions, the start node and the target node directly contain multiple connection links, and when the communication function of the network device is damaged due to the attack of the attacker, other shortest paths are selected for communication; the network graph is represented by G(N,A), N represents a node set, A represents a link set, K = {α1, α2, ..., α k } represents the ordered blocking set of the attacker, α i represents the blocking of the i-th node in the network graph G, L(G) is the sum of the lengths of all links in the network graph G, L(G\{α1,α2,…,α k }) represents the ordered blocking set K = {α1, α2, …, α k The order of arrangement of} blocks the nodes in the network graph G in turn, and the shortest path length in the graph; The network graph is mapped to a low-dimensional vector space using an encoder to obtain an action representation vector and a graph state representation vector; wherein the action representation vector is obtained by encoding the node's location information, attribute information, and connection relationship with other nodes; the graph state representation vector is obtained by encoding a virtual node, which is connected to the node in the network graph and collects information about the nodes in the network graph; the encoder is a graph neural network, and the graph structure of the network graph is propagated using information collection according to the graph neural network to obtain a graph state representation vector; wherein, in the nth propagation round, the node collects information about n-hop neighboring nodes; The action representation vector is used as the action of reinforcement learning, and the graph state representation vector is used as the state of reinforcement learning, and is input into a decoder. The action and state are modeled as a deep Q network through the decoder, and the deep Q network is trained. After inputting the network graph to be blocked, the optimal blocking solution of the network graph to be blocked is output; The evaluation of the optimal blocking scheme is: The smaller the ANPL value, the better the optimal blocking solution.

2. The method according to claim 1, characterized in that The action and state are modeled as a deep Q network through a decoder, comprising: The actions and states are modeled as a deep Q network through the decoder as: Where W4∈R p×1 , W5∈R p×1 is a learnable parameter in the deep Q network, z a , z st ∈R 1×p are the actions and states respectively.

3. The method according to claim 1, characterized in that The method comprises: A loss function for training the deep Q network is constructed; the loss function includes: learning loss and graph reconstruction loss.

4. The method according to claim 2, characterized in that: Constructing a loss function for training the deep Q network includes: Based on the Bellman equation, the loss function for training the deep Q network is constructed as: Among them, θ Q ={θ E ,θ D }, θ E ={W1, W2, W3} are the learning parameters of the encoder, θ D ={W4, W5} are the learning parameters of the decoder, α is the hyperparameter, γ is the discount factor, represents the parameters of the target network, n is the number of nodes in the graph reconstruction loss, and s i,j Indicates whether nodes i and j are connected, y i and j is its representation vector.

5. A shortest path blocking device based on deep reinforcement learning, characterized in that: The device comprises: The graph acquisition module is used to acquire a network graph; the nodes in the network graph are network devices with communication functions, the start node and the target node directly contain multiple connection links, and when the communication function of the network device is damaged due to the attack of the attacker, other shortest paths are selected for communication; the network graph is represented by G(N,A), N represents the node set, A represents the link set, K={α1,α2,…,α k } represents the ordered blocking set of the attacker, α i represents the blocking of the i-th node in the network graph G, L(G) is the sum of the lengths of all links in the network graph G, L(G\{α1,α2,…,α k }) represents the ordered blocking set K = {α1, α2, …, α k The order of arrangement of} blocks the nodes in the network graph G in turn, and the shortest path length in the graph; An encoding module is used to map the network graph to a low-dimensional vector space using an encoder to obtain an action representation vector and a graph state representation vector; wherein the action representation vector is obtained by encoding the node's location information, attribute information, and connection relationship with other nodes; the graph state representation vector is obtained by encoding a virtual node, which is connected to the node in the network graph and collects information about the nodes in the network graph; the encoder is a graph neural network, and the graph structure of the network graph is propagated using information collection according to the graph neural network to obtain a graph state representation vector; wherein, in the nth propagation round, the node collects information about n-hop neighbor nodes; A decoding module is used to input the action representation vector as the action of reinforcement learning and the graph state representation vector as the state of reinforcement learning into a decoder, model the action and state into a deep Q network through the decoder, and train the deep Q network. After inputting the network graph to be blocked, the optimal blocking solution of the network graph to be blocked is output; the evaluation of the optimal blocking solution is: The smaller the ANPL value, the better the optimal blocking solution.

6. The device according to claim 5, characterized in that The decoding module is also used to model the actions and states into a deep Q network through a decoder as: Where W4∈R p×1 , W5∈R p×1 is a learnable parameter in the deep Q network, z a , z st ∈R 1×p are the actions and states respectively.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.