Network security situation prediction method and device, electronic device, and readable storage medium
By using the random walk algorithm to calculate node similarities and predict network security situation values in complex networks, it solves the problem that traditional methods cannot effectively handle nonlinear data, and achieves high-precision and efficient network security situation prediction.
Patent Information
- Application Number
- CN202111456150.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-02
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2041-12-02
AI Technical Summary
Traditional time series analysis methods cannot effectively handle complex nonlinear and non-normally distributed network security situation data, resulting in low network security prediction accuracy and low processing efficiency.
Using the characteristics of complex network structures, the time series of network security situation values is obtained and converted into a visual graph. In the visual graph, the similarity between nodes is calculated based on random walk, and the node with the greatest similarity to the last node is determined. Predict the network security situation value at the next moment.
It achieves high-precision prediction of non-linear and non-normal distributed network security situation data, improves calculation efficiency and shortens processing time.
Smart Images

Figure CN114116850B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of network security situation awareness, and in particular to a network security situation prediction method and device, electronic equipment, and a readable storage medium. Background Art
[0002] The randomness and uncertainty of cyber attacks cause the changing process of network security to present complex nonlinear characteristics. Network security prediction requires processing network data generated by a variety of network devices, which often present macro nonlinear relationships and non-normal distribution characteristics. Traditional time series analysis methods usually cannot meet the accuracy required for prediction and have low processing efficiency when analyzing such large and complex data to predict the network security situation at the next moment. Summary of the invention
[0003] The purpose of the present invention is to address at least some of the above-mentioned deficiencies and to provide a network security situation prediction technology that uses complex network structure characteristics to process network security situation data with nonlinear and non-normal distribution.
[0004] In order to achieve the above object, the present invention provides a network security situation prediction method, comprising:
[0005] Obtain the time series of network security situation values;
[0006] Based on the network security situation values and corresponding moments in the time series, a visual graph is obtained;
[0007] In the visibility graph, similarities between the last node and other nodes are calculated based on random walks;
[0008] Determine the node with the greatest similarity to the last node, and based on this node and the last node, predict the network security situation value corresponding to the node at the next moment.
[0009] Optionally, the step of obtaining a time series of network security situation values includes:
[0010] Get {t1,t2,…,t N The time series {x1,x2,…,x} corresponding to the moment N}, where t n represents the nth moment, x n It represents the network security situation value corresponding to the nth moment, n=1,…,N, where N represents the length of the time series.
[0011] Optionally, the network security situation values and corresponding moments in the time series are converted into a visual graph, including:
[0012] Plot the time series in a bar graph and get N nodes, where the data of the nth node is (t n ,x n );
[0013] Traverse all nodes, and if any two nodes meet the mutual visualization conditions, establish a connection between the two nodes;
[0014] Among them, the mutual visualization conditions include:
[0015] For (t a ,x a ) and (t b ,x b Any node between the two nodes (t i ,x i ),x i ∈{x1,x2,…,x N},t a <t i <t b , all satisfy:
[0016]
[0017] Optionally, in the visual graph, calculating the similarity between the last node and other nodes based on random walk includes:
[0018] Perform a random walk in the visibility graph and calculate the probability of reaching each node after time t by walking from node x and the probability of reaching each node by walking from node y Among them, node x represents the last node in the visible graph (t N ,x N ), node y represents any node except node x;
[0019] Determine the similarity between node x and node y based on local random walk within unit time i, the expression is:
[0020]
[0021] Among them, k x and k y Represents the degree of node x and node y respectively, π xy (i) Representation The yth element in yx (i) Representation The x-th element in |E| represents the number of edges in the visible graph;
[0022] According to the similarity based on local random walks in each unit time, the similarity of random walks with superposition between nodes x and y in time t is calculated, and the expression is:
[0023]
[0024] Optionally, the probability of reaching each node after walking from node x after time t is calculated and the probability of reaching each node by walking from node y include:
[0025] Determine the probability transfer matrix P = {P cd} N×N , P cd It represents the probability of reaching node d in the next step from node c, and the expression is:
[0026]
[0027] Among them, k c represents the degree of node c, a cd Indicates the connection status between node c and node d. If there is a connecting edge, then a cd =1, otherwise, a cd = 0, V represents the set of nodes in the visible graph;
[0028] Set initial state is an N×1 column vector, where the element corresponding to node x is 1 and the other elements are 0. The initial state It is also an N×1 column vector, where the element corresponding to node y is 1 and the other elements are 0;
[0029] Iterative Calculation and The expressions are:
[0030]
[0031]
[0032] Among them, P T Represents the transpose of the probability transfer matrix P.
[0033] Optionally, the network security situation value corresponding to the node at the next moment is predicted by the following expression:
[0034]
[0035] Among them, x p Indicates the next time t N+1 The corresponding network security situation value, (t N ,xN ) represents the last node in the visible graph, (t M ,x M ) represents the node with the greatest similarity to the last node.
[0036] Optionally, the network security situation prediction method further includes:
[0037] According to the network security situation value obtained at the next moment and the prediction, the time series of the network security situation value is updated.
[0038] The present invention also provides a network security situation prediction device, comprising:
[0039] Data module, used to obtain the time series of network security situation values;
[0040] A visual graph module, used to convert network security situation values and corresponding moments in a time series into a visual graph;
[0041] A similarity module, used for calculating the similarity between the last node and other nodes in the visibility graph based on random walk;
[0042] The prediction calculation module is used to determine the node with the greatest similarity to the last node, and based on the node and the last node, predict the network security situation value corresponding to the node at the next moment and output it.
[0043] The present invention also provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of any one of the above-mentioned network security situation prediction methods are implemented.
[0044] The present invention also provides a readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned network security situation prediction methods are implemented.
[0045] The above technical solution of the present invention has the following advantages: the present invention provides a network security situation prediction method and device, an electronic device, and a readable storage medium. The present invention converts the network security situation value and the corresponding time into a visual graph, and uses the visual graph and link prediction to calculate the network security situation value at the next moment. The present invention combines complex networks with time series, which can achieve more accurate network security situation prediction, and has the advantages of high computing efficiency and short processing time when facing complex data with nonlinear and non-normal distribution. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 This is a schematic diagram of the steps of a network security situation prediction method in an embodiment of the present invention;
[0047] Figure 2 It is an example of a visual network construction rule in an embodiment of the present invention;
[0048] Figure 3 is a flow chart for establishing a visual graph in an embodiment of the present invention;
[0049] Figure 4 is a schematic diagram of a process of calculating the similarity between node x and node y in an embodiment of the present invention;
[0050] Figure 5 This is a schematic diagram of a network security situation prediction result in an embodiment of the present invention;
[0051] Figure 6 It is a schematic diagram of the structure of a network security situation prediction device in an embodiment of the present invention.
[0052] In the figure: 600: data module; 602: visual graph module; 604: similarity module; 606: prediction calculation module. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] like Figure 1 As shown, a network security situation prediction method provided by an embodiment of the present invention includes the following steps:
[0055] Step 100: Obtain a time series of network security situation values.
[0056] Preferably, this step includes obtaining {t1, t2, …, t N The time series of network security situation values corresponding to the time {x1,x2,…,x N}; where t n represents the nth moment, x n represents the network security situation value corresponding to the nth moment, n = 1, ..., N, N represents the length of the time series, that is, the time series {x1, x2, ..., x N}The total number of data included.
[0057] The network security situation value x can be abstracted as a function of time t, that is, x = f(t). The network security situation value is regarded as a time series for the following prediction, and the network security situation prediction problem is transformed into: it is known that {t1, t2, …, t N The time series of network security situation values at the moment {x1,x2,…,x N}, solve for t N+1 The sequence value x at the moment N+1 .
[0058] Step 102: Based on the network security situation values and corresponding moments in the time series, a visual graph is converted.
[0059] The visualization graph may be transformed using a visualization graph algorithm.
[0060] Step 104: In the visible graph, calculate the similarity between the last node and other nodes based on random walk.
[0061] The last node is the node corresponding to the last moment in the time series, and the other nodes are the remaining N-1 nodes in the node set corresponding to the view except the last node.
[0062] Step 106: determine the node with the greatest similarity to the last node, and based on the node and the last node, predict the network security situation value corresponding to the node at the next moment.
[0063] Link prediction in a network refers to predicting the possibility of a link between two nodes that have not yet been linked in the network using information such as known network nodes and network structure. The goal of link prediction is to estimate the possibility of a link between two nodes. Steps 104 and 106 perform link prediction based on a visual graph network, which can be implemented using a link prediction algorithm. The essence of link prediction is to calculate the probability of reaching one node from another node based on a random walk process, and then obtain the similarity between the two nodes, and the next node is predicted by the last node and the node with the highest similarity to it.
[0064] The network security situation prediction method provided by the present invention uses a visual graph and link prediction to realize situation prediction based on complex network structure characteristics, can quickly process network security situation data with nonlinear and non-normal distribution, and has high prediction accuracy.
[0065] Preferably, step 102 further comprises:
[0066] Plot the time series in a bar graph and get N nodes, where the data of the nth node is (t n ,x n );
[0067] Traverse all nodes, and if any two nodes meet the mutual visualization conditions, establish a connection between the two nodes.
[0068] Among them, the mutual visualization conditions, that is, the network construction rules of visual connection, include:
[0069] For (t a ,x a ) and (t b ,x b ) two nodes (i.e., the a-th node and the b-th node, x a 、x b ∈{x1,x2,…,x N Any node (t i ,x i ),x i ∈{x1,x2,…,x N},t a <t i <t b , all satisfy:
[0070]
[0071] By adopting the above method, the connection relationship of the visible graph can be quickly determined.
[0072] like Figure 2 As shown in Figure 1, the time series is depicted in a bar graph, that is, the data in the time series is represented by a bar. The height of the bar is the size of the network security situation value, and the position corresponds to the moment. When the line between the vertices of the bar does not cross other bars, the nodes represented by the two bars are said to be visible to each other. The vertex position of the nth bar, that is, the node (t n ,x n ), N nodes constitute the point set V, (t n ,x n )∈V. The process of constructing the visibility graph is as follows Figure 3 As shown in the figure, a connection is established between any two mutually visible nodes, that is, an edge is formed. The visible graph is also an undirected network, represented by G(V,E), where V represents the set of nodes and E represents the set of edges.
[0073] Preferably, if Figure 4 As shown, step 104 further includes:
[0074] Perform a random walk in the visible graph and calculate the probability of reaching each node after time t by walking from node x and the probability of reaching each node by walking from node y Among them, node x represents the last node in the visible graph (t N ,x N), node y represents any node except node x; for {t1, t2, …, t N The time series {x1,x2,…,x} corresponding to the moment N}, the range of t is [0,t end ],t end =t N -1;
[0075] Determine the similarity between node x and node y based on local random walk within unit time i, the expression is:
[0076]
[0077] in, represents the similarity based on local random walk, k x and k y Represents the degree of node x and node y respectively. The degree of a node is the number of edges associated with the node in the view, π xy (i) Representation The yth element in represents the probability of reaching node y from node x within time i, π yx (i) Representation The xth element in represents the probability of reaching node x from node y within time i, and |E| represents the number of edges in the visible graph; obviously,
[0078] According to the similarity based on local random walks in each unit time, the similarity of random walks with superposition between nodes x and y in time t is calculated, and the expression is:
[0079]
[0080] in, represents the similarity of the random walks with superposition. Similarly, Available, Finally, we get t = t end In the case of N ,x N ) and the similarity between the previous N-1 nodes.
[0081] The above implementation only calculates other nodes and the last node (t N ,x N ), there is no need to determine the similarity between all nodes, which effectively reduces the time of processing data.
[0082] Furthermore, if Figure 4 As shown, in step 104, the probability of reaching each node after walking from node x for time t is calculated. and the probability of reaching each node by walking from node y include:
[0083] Determine the probability transfer matrix P = {P cd} N×N , the element P of the probability transfer matrix P cd It represents the probability of reaching node d in the next step from node c, and the expression is:
[0084]
[0085] k c represents the degree of node c, a cd Indicates the connection status between node c and node d. If there is a connecting edge, then a cd =1, otherwise, a cd = 0, V represents the set of nodes in the visible graph;
[0086] Set initial state is an N×1 column vector, where the element corresponding to node x is 1 and the other elements are 0. The initial state It is also an N×1 column vector, where the element corresponding to node y is 1 and the other elements are 0;
[0087] Iterative Calculation and The expressions are:
[0088]
[0089]
[0090] Among them, P T Represents the transpose of the probability transfer matrix P.
[0091] By adopting the above method, the distribution probability after a period of time t of performing random walk on the nodes on the visibility graph G(V,E) can be determined.
[0092] Preferably, in step 106, the network security situation value corresponding to the node at the next moment is predicted by the following expression:
[0093]
[0094] Among them, x p Indicates the next time t N+1 The corresponding network security situation value, (t N ,x N ) represents the last node in the visible graph, (t M ,x M ) represents the node with the greatest similarity to the last node.
[0095] By adopting the above method, the network security situation value at the next moment can be quickly determined, and the accuracy of the prediction can be effectively improved.
[0096] Preferably, the network security situation prediction method further includes:
[0097] According to the next moment t N+1 And the predicted network security situation value x p , update the time series of network security situation values, and the time series of updated network security situation values can be expressed as {x1,x2,…,x N ,x N+1}, x N+1 =x p , corresponding to {t1,t2,…,t N ,t N+1}time.
[0098] Furthermore, based on the time series of the updated network security situation value, the process can return to step 100 to perform loop iterative calculations and continue to predict the network security situation value at subsequent moments. Figure 5 As shown, in a specific implementation, for a time series of network security situation values {x1, x2, x3, x N4}, the calculation can obtain x5, and after repeated iterations, x6 can be obtained, and so on, gradually completing the network security situation prediction for a longer period of time.
[0099] like Figure 6 As shown, the present invention also provides a network security situation prediction device, including a data module 600, a visual graph module 602, a similarity module 604 and a prediction calculation module 606, wherein:
[0100] The data module 600 is used to obtain the time series of network security situation values;
[0101] The visual graph module 602 is used to convert the network security situation value and the corresponding time in the time series into a visual graph;
[0102] The similarity module 604 is used to calculate the similarity between the last node and other nodes based on random walk in the visual graph;
[0103] The prediction calculation module 606 is used to determine the node with the greatest similarity to the last node, and based on the node and the last node, predict the network security situation value corresponding to the node at the next moment, and output it.
[0104] The data module 600 may be used to implement the above step 100 , the visual graph module 602 may be used to implement the above step 102 , the similarity module 604 may be used to implement the above step 104 , and the prediction calculation module 606 may be used to implement the above step 106 .
[0105] The information interaction, execution process and other contents between the modules of the above-mentioned network security situation prediction device are based on the same concept as the embodiment of the method of the present invention. For the specific contents, please refer to the description in the embodiment of the method of the present invention, and no further description is given here. In the above embodiments, the hardware module can be implemented mechanically or electrically. For example, a hardware module may include a permanent dedicated circuit or logic (such as a special processor, FPGA or ASIC) to complete the corresponding operation. The hardware module may also include programmable logic or circuits (such as a general-purpose processor or other programmable processor), which can be temporarily set by software to complete the corresponding operation. The specific implementation method (mechanical method, or a dedicated permanent circuit, or a temporarily set circuit) can be determined based on cost and time considerations.
[0106] In particular, in some preferred embodiments of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the network security situation prediction method described in any of the above embodiments are implemented.
[0107] In some other preferred embodiments of the present invention, a 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 network security situation prediction method described in any of the above embodiments are implemented.
[0108] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be implemented by instructing related hardware through a computer program. 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 above-mentioned network security situation prediction method embodiment, which will not be repeated here.
[0109] In summary, the present invention provides a network security situation prediction method and device, an electronic device, and a readable storage medium. The present invention first converts the situation sequence into a visible graph through a visible graph algorithm, and then uses a link prediction algorithm to perform prediction. The complex network structure characteristics are applied to process network security situation data with nonlinear and non-normal distribution, which has higher accuracy and higher processing efficiency.
[0110] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A network security situation prediction method, It is characterized in that The steps include: Obtain the time series of network security situation values; Based on the network security situation values and corresponding moments in the time series, a visual graph is obtained; In the visibility graph, calculating similarities between the last node and other nodes based on random walk; Determine the node with the greatest similarity to the last node, and based on the node and the last node, predict the network security situation value corresponding to the node at the next moment; Wherein, the time series of obtaining the network security situation value includes: Get {t 1 ,t 2 ,…,t N }The time series corresponding to the moment {x 1 ,x 2 ,…,x N }, where t n represents the nth moment, x n represents the network security situation value corresponding to the nth moment, n=1,…,N, N represents the length of the time series; The network security situation value and the corresponding time in the time series are converted into a visual graph, including: Plot the time series in a bar graph and get N nodes, where the data of the nth node is (t n ,x n ); Traverse all nodes, and if any two nodes meet the mutual visualization conditions, establish a connection between the two nodes; Among them, the mutual visualization conditions include: For (t a ,x a ) and (t b ,x b Any node between the two nodes (t i ,x i ),x i ∈{x 1 ,x 2 ,…,x N },t a <t i <t b , all satisfy: ; In the visualization graph, the similarity between the last node and other nodes is calculated based on random walk, including: Perform a random walk in the visibility graph and calculate the probability of reaching each node after time t by walking from node x and the probability of reaching each node by walking from node y ; where node x represents the last node in the visible graph (t N ,x N ), node y represents any node except node x; Determine the unit time i The similarity between internal node x and node y based on local random walk is expressed as: in, and Represent the degrees of node x and node y respectively, express The yth element in express The xth element in Represents the number of edges in the visible graph; According to the similarity based on local random walks in each unit time, the similarity of random walks with superposition between nodes x and y in time t is calculated, and the expression is: ; The probability of reaching each node after walking from node x after time t is calculated and the probability of reaching each node by walking from node y ,include: Determine the probability transfer matrix P={P cd } N×N , P cd It represents the probability of reaching node d from node c in the next step, and the expression is: in, represents the degree of node c, Indicates the connection status between node c and node d. If there is a connecting edge, then =1, otherwise, = 0, V represents the set of nodes in the visible graph; Set initial state is an N×1 column vector, where the element corresponding to node x is 1 and the other elements are 0. The initial state It is also an N×1 column vector, where the element corresponding to node y is 1 and the other elements are 0; Iterative Calculation and , the expressions are: Among them, P T represents the transpose of the probability transfer matrix P; The network security situation value corresponding to the node at the next moment is predicted by the following expression: in, Indicates the next moment The corresponding network security situation value, (t N ,x N ) represents the last node in the visible graph, (t M ,x M ) represents the node with the greatest similarity to the last node.
2. The network security situation prediction method according to claim 1, It is characterized in that Also includes: According to the network security situation value obtained at the next moment and the prediction, the time series of the network security situation value is updated.
3. A network security situation prediction device, It is characterized in that include: Data module, used to obtain the time series of network security situation values; A visual graph module, used to convert network security situation values and corresponding moments in a time series into a visual graph; A similarity module, used for calculating the similarity between the last node and other nodes in the visibility graph based on random walk; A prediction calculation module is used to determine the node with the greatest similarity to the last node, and based on the node and the last node, predict the network security situation value corresponding to the node at the next moment, and output it; Wherein, the time series of obtaining the network security situation value includes: Get {t 1 ,t 2 ,…,t N }The time series corresponding to the moment {x 1 ,x 2 ,…,x N }, where t n represents the nth moment, x n represents the network security situation value corresponding to the nth moment, n=1,…,N, N represents the length of the time series; The network security situation value and the corresponding time in the time series are converted into a visual graph, including: Plot the time series in a bar graph and get N nodes, where the data of the nth node is (t n ,x n ); Traverse all nodes, and if any two nodes meet the mutual visualization conditions, establish a connection between the two nodes; Among them, the mutual visualization conditions include: For (t a ,x a ) and (t b ,x b Any node between the two nodes (t i ,x i ),x i ∈{x 1 ,x 2 ,…,x N },t a <t i <t b , all satisfy: ; In the visualization graph, the similarity between the last node and other nodes is calculated based on random walk, including: Perform a random walk in the visibility graph and calculate the probability of reaching each node after time t by walking from node x and the probability of reaching each node by walking from node y ; where node x represents the last node in the visible graph (t N ,x N ), node y represents any node except node x; Determine the unit time i The similarity between internal node x and node y based on local random walk is expressed as: in, and Represent the degrees of node x and node y respectively, express The yth element in express The xth element in Represents the number of edges in the visible graph; According to the similarity based on local random walks in each unit time, the similarity of random walks with superposition between nodes x and y in time t is calculated, and the expression is: ; The probability of reaching each node after walking from node x after time t is calculated and the probability of reaching each node by walking from node y ,include: Determine the probability transfer matrix P={P cd } N×N , P cd It represents the probability of reaching node d from node c in the next step, and the expression is: in, represents the degree of node c, Indicates the connection status between node c and node d. If there is a connecting edge, then =1, otherwise, = 0, V represents the set of nodes in the visible graph; Set initial state is an N×1 column vector, where the element corresponding to node x is 1 and the other elements are 0. The initial state It is also an N×1 column vector, where the element corresponding to node y is 1 and the other elements are 0; Iterative Calculation and , the expressions are: Among them, P T represents the transpose of the probability transfer matrix P; The network security situation value corresponding to the node at the next moment is predicted by the following expression: in, Indicates the next moment The corresponding network security situation value, (t N ,x N ) represents the last node in the visible graph, (t M ,x M ) represents the node with the greatest similarity to the last node.
4. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, It is characterized in that When the processor executes the computer program, the steps of the network security situation prediction method described in any one of claims 1 or 2 are implemented.
5. A readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the network security situation prediction method described in any one of claims 1 or 2 are implemented.
