Network security prediction method and device, electronic equipment, medium and product

By using the triangular oscillation diffusion function in the pre-trained model in network security prediction, the problems of gradient disappearance and neuron necrosis caused by classic activation functions are solved, and the accuracy and convergence speed of network security situation prediction are improved.

CN118740488APending Publication Date: 2024-10-01CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410990278.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing network security situation prediction methods use classic activation functions such as "S-type" and "ReLU-type" functions, which are prone to gradient disappearance or gradient explosion, mean shift, slow convergence speed, weak sparse expression ability, neuron necrosis, etc. problem, resulting in poor prediction accuracy.

Method used

The triangular oscillatory diffusion function in the pre-trained model is used to determine the output parameter set and hidden layer state parameters of the neural network gate unit to alleviate the problems of gradient disappearance, gradient explosion and neuron necrosis, and improve the convergence speed and prediction accuracy of the model.

Benefits of technology

By using the triangular oscillation diffusion function, the convergence speed and accuracy of the network security prediction model are improved, problems such as gradient disappearance, gradient explosion and neuron necrosis are solved, and the prediction accuracy is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118740488A_ABST
    Figure CN118740488A_ABST
Patent Text Reader

Abstract

The invention provides a network security prediction method and device, electronic equipment, a medium and a product, and relates to the field of network security, and the method comprises the steps: obtaining a network security situation data set; based on the network security situation data set, determining an output parameter set of a neural network gating unit in the pre-training model by using a triangular oscillation dispersion (TOD) function in the pre-training model; determining hidden layer state parameters in the pre-training model based on the output parameter set; and determining a network security prediction result based on the hidden layer state parameters. According to the method disclosed by the invention, the triangular oscillation dispersion function in the pre-training model is utilized, so that the problems of gradient disappearance, gradient explosion, neuronal necrosis and the like generated when the model is used are relieved, and the convergence speed of the model and the accuracy of network security prediction are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of network security, and in particular to a network security prediction method, device, electronic device, medium and product. Background Art

[0002] As an important part of network security situation awareness, network security situation prediction describes the dynamic changes of security situation over time, specifically predicting future situation values ​​based on historical situation values. As a comprehensive cloud security protection product, Mobile Cloud Security Center has many functions. Network security situation prediction is involved in the anti-brute force cracking and dynamic honeypot security protection processes of the Cloud Security Center, as well as threat detection function modules such as web backdoors, system backdoors, and abnormal logins.

[0003] Typical network security situation prediction methods include gray theory prediction, time series prediction, etc. However, due to the complexity, nonlinearity, and time-varying characteristics of network security situation change trends, the prediction accuracy of many classic prediction methods is not ideal. In order to avoid the above problems, the use of neural network technology for network security prediction has gradually become a mainstream trend. At present, the relevant technologies usually use "S-type" and "ReLU-type" functions as neural network activation functions. Neural network models using this type of activation function are prone to gradient disappearance or gradient explosion, mean shift (non-zero mean), slow convergence, weak sparse expression ability, neuron necrosis, etc. during the training process, which will lead to poor network security prediction accuracy. Summary of the invention

[0004] The present disclosure provides a network security prediction method, device, electronic device, medium and product to solve the problems in the related technology. By utilizing the triangular oscillation diffusion function in the pre-trained model, the problems such as gradient vanishing, gradient explosion, neuron necrosis, etc. generated when the model is used are alleviated, and the convergence speed of the model and the accuracy of network security prediction are improved.

[0005] The first aspect of the present disclosure proposes a network security prediction method, which includes: obtaining a network security situation data set; based on the network security situation data set, using the triangular oscillation diffusion function in the pre-trained model, determining an output parameter set of a neural network gating unit in the pre-trained model; based on the output parameter set, determining a hidden layer state parameter in the pre-trained model; based on the hidden layer state parameter, determining a network security prediction result.

[0006] In some embodiments of the present disclosure, based on a network security situation data set, using a triangular oscillator diffusion function in a pre-trained model, determining an output parameter set of a neural network gating unit in the pre-trained model includes: preprocessing the security event data to obtain a pre-processed data set; based on the pre-processed data set, determining a data matrix of the pre-processed data set; based on matrix features in the data matrix, target network weights and target bias in the pre-trained model, using a triangular oscillator diffusion function, determining input gate output parameters, output gate output parameters and forgetting gate output parameters of the pre-trained model.

[0007] In some embodiments of the present disclosure, preprocessing includes at least one of data filtering processing, standardization processing, digitization processing and time series processing.

[0008] In some embodiments of the present disclosure, determining the hidden layer state parameters in the pre-trained model based on the output parameter set includes: determining the memory unit output parameters in the pre-trained model using the point-by-point product method based on the input gate output parameters and the forget gate output parameters; determining the hidden layer state parameters using the point-by-point product method based on the output gate output parameters and the memory unit output parameters.

[0009] In some embodiments of the present disclosure, the method also includes: obtaining a training sample set; determining the safety state value corresponding to the training sample set based on the training sample set; and iterating the network weights and bias of the model to be trained based on the training sample set and the safety state value to obtain a pre-trained model.

[0010] In some embodiments of the present disclosure, based on the training sample set and the safety event value, iterating the network weights and bias of the model to be trained to obtain the pre-trained model includes: based on the training sample set and the safety event value, according to the preset loss function, using a first-order optimization algorithm, iterating the network weights and bias of the model to be trained; when the error value calculated using the preset loss function is less than the preset value, determining the corresponding network weights and bias as the target network weights and target bias; bringing the target network weights and targets into the model to be trained to obtain the pre-trained model.

[0011] The second aspect of the present disclosure proposes a network security prediction device, which includes: an acquisition unit, used to acquire a network security situation data set; a first processing unit, used to determine the output parameter set of the neural network gating unit in the pre-trained model based on the network security situation data set and using the triangular oscillation diffusion function in the pre-trained model; a second processing unit, used to determine the hidden layer state parameters in the pre-trained model based on the output parameter set; and a prediction unit, used to determine the network security prediction result based on the hidden layer state parameters.

[0012] The third aspect embodiment of the present disclosure proposes an electronic device, comprising: a processor and a memory for storing a computer program that can be run on the processor, wherein the processor, when used to run the computer program, executes the method described in the first aspect embodiment of the present disclosure.

[0013] The fourth aspect embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the method described in the first aspect embodiment of the present disclosure.

[0014] The fifth aspect embodiment of the present disclosure provides a computer program product, including a computer program, which implements the method described in the first aspect embodiment of the present disclosure when executed by a processor.

[0015] In summary, the network security prediction method proposed in the present disclosure includes: obtaining a network security situation data set; based on the network security situation data set, using the triangular oscillation diffusion function in the pre-trained model, determining the output parameter set of the neural network gating unit in the pre-trained model; based on the output parameter set, determining the hidden layer state parameters in the pre-trained model; based on the hidden layer state parameters, determining the network security prediction result. The method disclosed in the present disclosure alleviates the problems of gradient vanishing, gradient explosion, neuron necrosis, etc. generated when the model is used by using the triangular oscillation diffusion function in the pre-trained model, thereby improving the convergence speed of the model and the accuracy of network security prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0017] Figure 1 An example diagram of a Sigmoid function and its derivative function provided in an embodiment of the present disclosure;

[0018] Figure 2 An example diagram of a tanh function and its derivative function provided in an embodiment of the present disclosure;

[0019] Figure 3 An example of a ReLU function and its derivative function provided in an embodiment of the present disclosure;

[0020] Figure 4 An example of an X-ReLU function and its derivative function provided in an embodiment of the present disclosure;

[0021] Figure 5 A schematic diagram of a flow chart of a network security prediction method provided by an embodiment of the present disclosure;

[0022] Figure 6An example of a triangular oscillating diffusion function and its derivative function provided in an embodiment of the present disclosure;

[0023] Figure 7 A flowchart of another network security prediction method provided by an embodiment of the present disclosure;

[0024] Figure 8 A flowchart of another network security prediction method provided by an embodiment of the present disclosure;

[0025] Fig. 9 A schematic diagram of a model structure of a network security prediction model provided in an embodiment of the present disclosure;

[0026] Fig.10 A schematic diagram of a bidirectional long short-term memory network structure of a network security prediction model provided by an embodiment of the present disclosure;

[0027] Fig.11 A flowchart of a network security prediction method provided by an embodiment of the present disclosure;

[0028] Fig.12 A schematic diagram of the structure of a network security prediction device provided by an embodiment of the present disclosure;

[0029] Fig.13 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0030] The embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions.

[0031] As an important part of network security situation awareness, network security situation prediction describes the dynamic changes of security situation over time, specifically predicting future situation values ​​based on historical situation values. As a comprehensive cloud security protection product, Mobile Cloud Security Center has many functions. Network security situation prediction is involved in the anti-brute force cracking and dynamic honeypot security protection processes of the Cloud Security Center, as well as threat detection function modules such as web backdoors, system backdoors, and abnormal logins.

[0032] Typical network security situation prediction methods include gray theory prediction, time series prediction, etc. However, due to the complexity, nonlinearity, and time-varying characteristics of network security situation change trends, the prediction accuracy of many classic prediction methods is not ideal. In order to avoid the above problems, the use of neural network technology for network security prediction has gradually become a mainstream trend. At present, the relevant technologies usually use "S-type" and "ReLU-type" functions as neural network activation functions. Neural network models using this type of activation function are prone to gradient disappearance or gradient explosion, mean shift (non-zero mean), slow convergence, weak sparse expression ability, neuron necrosis, etc. during the training process, which will lead to poor network security prediction accuracy.

[0033] The following first describes the activation function in the above-mentioned related technology:

[0034] 1. “S-shaped” activation function

[0035] The sigmoid and tanh activation functions are the "S-type" activation functions commonly used in the early days of neural networks. The sigmoid function and its derivative function are as follows:

[0036]

[0037] Depend on Figure 1 As shown in the figure, the sigmoid function and its derivative function graph show that the output range of the sigmoid activation function is (0,1), it has a non-zero mean, and has bidirectional saturation. When the output of the neural network is large or small, the sigmoid derivative tends to 0, causing the model to converge very slowly during the back propagation process, that is, the gradient disappears.

[0038] The tanh function and its derivative function are as follows:

[0039]

[0040] like Figure 2 As shown in the figure, the tanh function and its derivative function images show that the tanh activation function solves the problem of non-zero mean of the sigmoid activation function, but the same bidirectional saturation still causes the gradient vanishing problem to exist.

[0041] 2. "ReLU type" activation function

[0042] In 2010, Hinton first proposed rectified linear units [8] (ReLU) as an activation function. The ReLU activation function and its derivative function are:

[0043]

[0044] like Figure 3 As shown in the figure, the ReLU function and its derivative function graph show that the ReLU activation function is a piecewise function. On the positive semi-axis, the output parameter of the function is equal to the input value, while on the negative semi-axis it is forced to be 0. Due to this feature, the ReLU activation function solves the gradient vanishing problem of the "S-type" activation function. At the same time, the setting of some neurons to 0 also makes the network sparse to a certain extent. However, the hard saturation setting of the negative semi-axis to 0 may cause the model to have "necrosis" of neurons during the training process, and also makes the data distribution have a non-zero mean, affecting the gradient descent process.

[0045] 3. Variant "ReLU type" activation function

[0046] In order to solve the problem of "death" of the negative semi-axis neurons in ReLU, activation functions such as Leaky ReLU[9], PReLU

[10] , Noisy ReLU

[11] , ReLU-softplus

[12] , and ReLU softsign

[13] have been introduced one after another. The activation functions of Leaky ReLU, PReLU, and Noisy ReLU (collectively referred to as X-ReLU) and their derivative functions are as follows:

[0047]

[0048] Among them: a is a constant in the RLeaky ReLU function, a is a training parameter in the PReLU function, and a is a random number in the Noisy ReLU function.

[0049] like Figure 4 As shown in the figure, it can be seen from the X-ReLU function image that Leaky ReLU, PReLU and Noisy ReLU alleviate the problem of hard saturation of the negative half axis of ReLU to a certain extent by introducing parameters on the basis of ReLU, but the introduced parameters increase the complexity of the model, and the non-zero mean problem still exists.

[0050] For other variant functions, such as the relu-softplus combined activation function, although the soft saturation on the negative semi-axis alleviates the "neuron necrosis" problem, the function has exponentials and the derivative has mutations near the zero point of the negative semi-axis, which affects the convergence of the model. For example, the relu-softsign combined activation function has soft saturation characteristics on the negative semi-axis, and the derivative has no mutations near the zero point, which improves the problem of insufficient convergence of the relu-softplus model near the zero point, but still has the problem of non-zero mean.

[0051] The method proposed in the present invention utilizes the triangular oscillation diffusion function in the pre-trained model, thereby alleviating the problems of gradient vanishing, gradient explosion, neuron necrosis, etc. generated when the model is used, thereby improving the convergence speed of the model and the accuracy of network security prediction.

[0052] The network security prediction method provided by this application is described in detail below with reference to the accompanying drawings.

[0053] Figure 5 A flowchart of a network security prediction method provided by an embodiment of the present disclosure. Figure 4 As shown, the network security prediction method includes steps 101-104.

[0054] Step 101: Obtain a network security situation dataset.

[0055] In some embodiments, network security situation data may be obtained through platforms such as a network cloud service platform and a network security monitoring platform. The present disclosure does not limit the method for obtaining network security situation data.

[0056] In some embodiments, network security situation data may include: attacking host IP, attacked host IP, transmission protocol, protocol status, number of attacks suffered by the host, attack type, attack severity, etc., which is not limited in this disclosure.

[0057] Step 102, based on the network security situation data set, using the triangular oscillation diffusion function in the pre-trained model, determine the output parameter set of the neural network gating unit in the pre-trained model.

[0058] In some embodiments, the neural network gating unit in the pre-trained model may include an input gating unit, an output gating unit, and a forgetting gating unit.

[0059] That is, the output parameter set may include input gate output parameters, output gate output parameters and forget gate output parameters.

[0060] In some embodiments, the triangular oscillatory diffusion function is as follows Figure 6 As shown, the TOD function and its derivative function are as follows:

[0061]

[0062] In some embodiments, the acquired security situation data set is converted into a matrix form so that the pre-trained model can perform data processing on the network security situation data set; then based on the matrix features in the data matrix, the target network weights and target bias in the pre-trained model, the triangular oscillation diffusion function is used to determine the input gate output parameters, output gate output parameters and forgetting gate output parameters of the pre-trained model.

[0063] Specifically, the security incident data can be preprocessed to obtain a preprocessed data set; based on the preprocessed data set, the data matrix of the preprocessed data set is determined; based on the matrix features in the data matrix, the target network weights and the target bias in the pretrained model, the triangular oscillation diffusion function is used to determine the input gate output parameters, output gate output parameters and forgetting gate output parameters of the pretrained model.

[0064] The preprocessing may include at least one of data filtering, standardization, digitization and time series processing.

[0065] Step 103, based on the output parameter set, determine the hidden layer state parameters in the pre-trained model.

[0066] In some embodiments, the memory unit output parameters in the pre-trained model can be determined based on the input gate output parameters and the forget gate output parameters using the point-by-point product method; and then the hidden layer state parameters can be determined based on the output gate output parameters and the memory unit output parameters using the point-by-point product method.

[0067] Step 104: Determine a network security prediction result based on the hidden layer state parameters.

[0068] In some embodiments, the pre-trained model can autonomously determine the network security prediction results corresponding to the network security situation data set based on the determined hidden layer state parameters.

[0069] In summary, the network security prediction method proposed in the present disclosure includes: obtaining a network security situation data set; based on the network security situation data set, using the triangular oscillation diffusion function in the pre-trained model, determining the output parameter set of the neural network gating unit in the pre-trained model; based on the output parameter set, determining the hidden layer state parameters in the pre-trained model; based on the hidden layer state parameters, determining the network security prediction result. The method disclosed in the present disclosure alleviates the problems of gradient vanishing, gradient explosion, neuron necrosis, etc. generated when the model is used by using the triangular oscillation diffusion function in the pre-trained model, thereby improving the convergence speed of the model and the accuracy of network security prediction.

[0070] Figure 7 A flowchart of a network security prediction method proposed in the present disclosure is further shown. Figure 5 The following is further explained based on the embodiment shown. Figure 7 As shown, the method comprises the following steps:

[0071] Step 201: Acquire a network security situation data set.

[0072] In some embodiments, the principle of step 201 is similar to Figure 5 The step 101 shown is the same as that shown in FIG. 101 , and reference may be made to the relevant description of the embodiment shown in step 101 , which will not be repeated here.

[0073] Step 202: pre-process the safety event data to obtain a pre-processed data set.

[0074] In some embodiments, preprocessing includes at least one of data filtering processing, standardization processing, digitization processing and time series processing.

[0075] For example, the obtained network security situation value data set X = {x1, x2, x3, ..., xn} is preprocessed, including: data filtering (to remove sample attributes that have no practical significance), digitization (to convert categorical features into numerical values ​​through one-hot encoding), standardization (to reduce the difference in numerical values) and time series processing (combining current data with historical data), and finally forming a preprocessed data set X* = {x1, x2, x3, ..., xn}.

[0076] Step 203: Determine a data matrix of the preprocessed data set based on the preprocessed data set.

[0077] In some embodiments, since the preprocessed data set includes a time attribute, the preprocessed data set may be arranged according to the time attribute to determine a data matrix corresponding to the preprocessed data set, so as to use the data matrix to determine a network security prediction result.

[0078] Step 204, based on the matrix features in the data matrix, the target network weights and the target bias in the pre-trained model, the input gate output parameters, the output gate output parameters and the forget gate output parameters of the pre-trained model are determined using the triangular oscillation diffusion function.

[0079] In some embodiments, the data in the data matrix are acquired from time 1 to time T, so the matrix feature Xt*={x 1t ,x 2t ,x 3t ,...,x nt} as the input value, through the gate control unit of the TOD-BiLSTM neural network, the input gate output parameter i is obtained by the combined effect of the gate control unit and the TOD activation function t , the output parameter of the forget gate is f t And the output gate output parameter o t .

[0080] Specifically, the forget gate output parameter f t It can be determined by the following formula:

[0081]

[0082] f t =TOD(W f·X+b f ) (Formula 12)

[0083] Among them, x t represents the matrix characteristics at time t, h t-1 represents the hidden state at time t-1, TOD represents the formula of the above formula 9, W f represents the preset weights of the forget gated unit network in the pre-trained model, b f They are respectively the preset biases of the forget gated unit network in the LSTM representation pre-training model.

[0084] Specifically, the input gate output parameter i t It can be determined by the following formula:

[0085] i t =TOD(W i ·X+b i ) (Formula 13)

[0086] The meanings of its parameters are similar or identical to those of the above formula and will not be repeated here.

[0087] Specifically, the output gate outputs parameter o t It can be determined by the following formula:

[0088] o t =TOD(W o ·X+b o ) (Formula 14)

[0089] The meanings of its parameters are similar or identical to those of the above formula and will not be repeated here.

[0090] It should be understood that the number of nodes in the network input layer in the pre-trained model is the final matrix feature number n (that is, the total number of parameters in the above data matrix); the number of nodes in the output layer is 1 (because situation prediction is a single variable prediction problem).

[0091] Step 205, based on the input gate output parameter and the forget gate output parameter, the output parameter of the memory unit in the pre-trained model is determined by using the point-by-point product method.

[0092] In some embodiments, the memory unit output parameter may be determined by the following formula:

[0093]

[0094] Among them, c t represents the output parameter of the memory unit at time t, and tanh is expressed as the formula shown in formula 3, Represents point-by-point product, and the other parameters have similar or identical meanings to the above formula, which will not be repeated here.

[0095] Step 206, based on the output parameters of the output gate and the output parameters of the memory unit, the hidden layer state parameters are determined using the point-by-point product method.

[0096] In some embodiments, the hidden layer state parameter may be determined by the following formula:

[0097]

[0098] Among them, h t represents the hidden layer state parameter at time t. The other parameters have similar or identical meanings to the above formula and will not be described here.

[0099] Step 207: Determine the network security prediction result based on the hidden layer state parameters.

[0100] In some embodiments, the pre-trained model uses a bidirectional long short-term memory network (BiLSTM), obtains two hidden layer states with opposite time series through a forward long short-term memory network (LSTM) and a backward LSTM, and then connects them to obtain the same output, that is, the total state parameters of the hidden layer at the same moment are generated through the forward hidden layer state parameters and the backward hidden layer state parameters at the same moment, and the pre-trained model outputs the network security prediction result through the total hidden layer state parameters.

[0101] Specifically, the forward hidden layer state parameters can be obtained by the following formula 17:

[0102]

[0103] Among them, LSTM is a set of formulas shown in the above formulas 11 to 17.

[0104] Specifically, the backward hidden layer state parameters can be obtained by the following formula 18:

[0105]

[0106] The total state parameter of the hidden layer can be obtained by the following formula 19:

[0107]

[0108] Where: T represents the sequence length of the time series in the preprocessed dataset.

[0109] In summary, the network security prediction method disclosed in the present invention includes: obtaining a network security situation data set; preprocessing the security event data to obtain a preprocessed data set; determining the data matrix of the preprocessed data set based on the preprocessed data set; based on the matrix features in the data matrix, the target network weights and the target bias in the pretrained model, using the triangular oscillation diffusion function, determining the input gate output parameters, output gate output parameters and forget gate output parameters of the pretrained model; based on the input gate output parameters and the forget gate output parameters, using the point-by-point product method, determining the memory unit output parameters in the pretrained model; based on the output gate output parameters and the memory unit output parameters, using the point-by-point product method, determining the hidden layer state parameters; based on the hidden layer state parameters, determining the network security prediction result. The method disclosed in the present invention The method disclosed in the present invention alleviates the problems of gradient vanishing, gradient explosion, neuron necrosis, etc. generated when the model is used by using the triangular oscillation diffusion function in the pretrained model, thereby improving the convergence speed of the model and the accuracy of network security prediction.

[0110] Figure 8 A flowchart of a network security prediction method proposed in the present disclosure is further shown. Figure 5 The step 101 is performed before the step 101 to illustrate the method of obtaining the pre-trained model. Figure 8 As shown, the method comprises the following steps:

[0111] Step 801: Obtain a training sample set.

[0112] In some embodiments, the method of obtaining the training sample set is similar to that of obtaining the network security situation data set, and reference may be made to the above description, which will not be repeated here.

[0113] Step 802: Based on the training sample set, determine the safety event value corresponding to the training sample set.

[0114] In some embodiments, the security event value can be a preset parameter, for example, using numbers 0-10 to represent different degrees of hazard: 0 is no hazard, 1 is level I hazard, 2 is level II hazard, 3 is level III hazard,..., 10 is level X hazard, then the network security situation value Y = {0,1,2,...,9}.

[0115] Then, the hazard level of the samples in the training sample set is determined through the data in the training sample set, thereby determining the safety event value corresponding to the training sample set.

[0116] Step 803, based on the training sample set and the safety event value, iterate the network weight and bias of the model to be trained to obtain a pre-trained model.

[0117] Specifically, you can obtain the pre-trained model through the following steps:

[0118] 1. Based on the training sample set and the safety event value, according to the preset loss function, the first-order optimization algorithm is used to iterate the network weights and bias of the training model.

[0119] 2. When the error value calculated by using the preset loss function is less than the preset value, the corresponding network weight and bias are determined as the target network weight and target bias;

[0120] 3. Bring the target network weights and targets into the model to be trained to obtain a pre-trained model.

[0121] For example, the network security real situation value Y t ={0,1,2,...,9} is used as the output value of the neural network in the model to be trained, the mean square error function MSE is selected as the objective function of the model, the Adam algorithm is used to update the weights and bias of the neural network, and the Dropout technology is applied to prevent overfitting until the training error of the model reaches the preset target.

[0122] It should be understood that the present disclosure does not limit the preset loss function, which can be a loss function such as the mean absolute error function (MAE) in addition to the mean square error function; the present disclosure does not limit the first-order optimization algorithm, which can be an algorithm such as the stochastic gradient descent algorithm in addition to the Adam algorithm.

[0123] It should be understood that the present disclosure does not limit other parameter settings of the model to be trained. For example, the number of hidden layer nodes, learning rate, number of iterations and the variation range of hyperparameters are empirically selected from [1,100], [0.001,0.1], [100,500] and [1,42] respectively.

[0124] In summary, the network security prediction method disclosed in the present invention includes: obtaining a training sample set; determining the security event value corresponding to the training sample set based on the training sample set; iterating the network weights and bias of the model to be trained based on the training sample set and the security event value to obtain a pre-trained model. The method disclosed in the present invention uses the training sample set and the security event value to iterate the network weights and bias of the model to be trained, so as to give the model appropriate model parameters and improve the prediction accuracy of the pre-trained model.

[0125] The following is an exemplary description of the disclosed method.

[0126] 1. Triangular oscillator diffusion function.

[0127] Depend on Figure 6 As shown in the figure, the TOD function and its derivative function graph show that the TOD activation function has the following properties:

[0128] (1) It is a nonlinear function itself and has the basic nonlinear expression ability of the activation function, which enables the neural network to arbitrarily approximate any nonlinear function and enhance the generalization ability of the model;

[0129] (2) The function is symmetric about the zero point and strictly conforms to the zero mean distribution, which solves the problem that the weight can only be updated in one direction when the function output is always positive or always negative;

[0130] (3) The derivative value of the function is large near the zero point, so it can accelerate the convergence of the model in the early stage of model training; and when it is far away from the zero point, it has a certain soft saturation, that is, the derivative gradually tends to 0, and finally the model converges to the optimal value;

[0131] (4) The output values ​​of the function are alternating between positive and negative, which ensures the freedom of direction of network parameter update and helps the network push weight and bias changes in the right direction;

[0132] (5) The output of some neurons is 0, which makes the network sparse and reduces the time and space complexity;

[0133] (6) The derivative output range is (-0.25, 0.33), which is moderate in size and avoids the gradient vanishing or gradient exploding problem in the reverse gradient descent process of the neural network;

[0134] (7) The derivatives are not set to “0” too often, thus avoiding the problem of network weights being unable to update due to “neuron necrosis”.

[0135] 2. A network security situation prediction model.

[0136] The model expands as Fig. 9 Its working principle is: through the forward long short-term memory network (LSTM) and the backward LSTM, two hidden layer states with opposite time series are obtained, and then they are connected to obtain the same output. The total hidden state Ht of TOD-BiLSTM (i.e. the above pre-trained model or the model to be trained) at time t contains the forward and backward

[0137] The internal structure of LSTM that constitutes the TOD-BiLSTM model is as follows: Fig.10 As shown, under the joint action of the input gate it, the forget gate ft, the output gate ot and the memory unit ct, the internal memory is selectively input, output and forgotten.

[0138] 3. An exemplary description of the above network security prediction method.

[0139] Network security situation prediction describes the behavior of security situation changing dynamically over time, and predicts future situation values ​​based on historical situation values. The prediction of network security time series data can assist in preventing network security incidents and provide decision support. Taking into account the superiority of the bidirectional long short-term memory (BiLSTM) network in processing information relevance, the invention proposes to use BiLSTM as a network security situation prediction model, and introduces a new TOD activation function to address the problems of gradient vanishing or gradient explosion, mean shift (non-zero mean), slow convergence, weak sparse expression ability, and neuron necrosis in the training process of the BiLSTM model, so that it has zero mean, soft saturation, and a certain sparsity. At the same time, its unique "oscillation diffusion" characteristics alleviate the problems of gradient vanishing or gradient explosion and neuron necrosis to a certain extent, and improve the convergence speed of the model.

[0140] The flowchart of the TOD-BiLSTM network security situation prediction method based on the improved activation function mechanism proposed in the present invention is as follows: Fig.11 The specific steps are:

[0141] Step 1: Collect and organize the network security situation value data set. The collected sample data attribute features include: attacking host IP, attacked host IP, transmission protocol, protocol status, number of attacks suffered by the host, attack type, attack severity, etc. Each feature value is recorded as x1, x2, x3, ..., xn, and finally the network security situation value data set X = {x1, x2, x3, ..., xn} is obtained.

[0142] Step 2: Divide the network security situation value data set X = {x1, x2, x3, ..., xn} into a training set Xtrain = {x1, x2, x3, ..., xn} and a test set Xtest = {x1, x2, x3, ..., xn}, and then preprocess the sample data, including: data filtering (removing sample attributes that have no practical significance), digitization (converting categorical features into numerical values ​​through one-hot encoding), standardization (reducing the difference in numerical values) and time series processing (combining current data with historical data), and finally form standard sample matrices Xtrain* = {x1, x2, x3, ..., xn} and Xtest* = {x1, x2, x3, ..., xn}.

[0143] Step 3: Determine the TOD-BiLSTM network topology structure through sample data X*={x1,x2,x3,...,xn}, including: the number of input layer nodes, the number of output layer nodes, the number of hidden layer nodes, the learning rate, the number of iterations, and the range of hyperparameter changes.

[0144] In the present invention, the number of input layer nodes of the TOD-BiLSTM network is the characteristic number n of the sample matrix finally formed; the number of output layer nodes is 1 (because situation prediction is a single variable prediction problem); the number of hidden layer nodes, learning rate, number of iterations and the variation range of hyperparameters are respectively [1,100], [0.001,0.1], [100,500] and [1,42] according to experience.

[0145] Step 4: Set the network security situation value Y according to the degree of harm of the network attack. If the numbers 0-10 are used to represent different degrees of harm: 0 is no harm, 1 is level I harm, 2 is level II harm, 3 is level III harm, ..., 10 is level X harm, then the network security situation value Y = {0, 1, 2, ..., 9}.

[0146] Step 5: Use the training set sample matrix feature Xtrain*={x1,x2,x3,...,xn} as the input of the TOD-BiLSTM network, use the real network security situation value Y={0,1,2,...,9} as the output, set the relevant network parameters in step 3 and then perform training.

[0147] Training process:

[0148] (1) Taking the sample matrix feature Xtrain*={x1t,x2t,x3t,...,xnt} of the network security situation training set at time t (t∈[1-T]) as the input value, the input gate output value it, the forget gate output value ft and the output gate output value ot are obtained by using the gating unit of the TOD-BiLSTM neural network and the combined effect of the gating unit and the TOD activation function (Formula 11-14);

[0149] (2) The input gate output value it and the forget gate output value ft obtained in process (1) are calculated by point-by-point product (Formula 15) to obtain the memory unit output value ct;

[0150] (3) Multiply the memory unit output value ct obtained in process (2) by the output gate output value ot obtained in process (1) point by point (Formula 16) to obtain the hidden layer state at time t∈[1-T]

[0151] (4) Repeat the process (1), (2), and (3) to calculate the hidden layer state at time t∈[T-1])

[0152] (5) The real network security situation value Yt = {0, 1, 2, ..., 9} is used as the output value of the TOD-BiLSTM neural network, the mean square error function MSE is selected as the objective function of the model, the Adam algorithm is used to update the weights and bias of the neural network, and the Dropout technology is applied to prevent overfitting until the training error of the model reaches the preset target.

[0153] At this point, the training is completed and the optimal model parameters (i.e., the relevant network parameters in step 3 and the weights and bias of the TOD-BiLSTM neural network) are obtained.

[0154] Step 6: Assign the optimal parameters obtained from the final training to the TOD-BiLSTM model.

[0155] Step 7: Input the test sample data set Xtest*={x1,x2,x3,...,xn} into the TOD-BiLS TM network model with optimal parameters, and obtain the predicted situation value Ypredict as the output result of the model, that is, the network security situation prediction result.

[0156] In summary, the present disclosure has the following beneficial effects:

[0157] The method disclosed in the present invention utilizes the triangular oscillation diffusion function in the pre-trained model, thereby alleviating the problems of gradient vanishing, gradient explosion, neuron necrosis, etc. generated when the model is used, thereby improving the convergence speed of the model and the accuracy of network security prediction.

[0158] Corresponding to the methods provided in the above-mentioned embodiments, the present disclosure also provides a network security prediction device. Since the device provided in the embodiment of the present disclosure corresponds to the methods provided in the above-mentioned embodiments, the implementation method of the method is also applicable to the device provided in this embodiment and will not be described in detail in this embodiment.

[0159] Fig.12 FIG. 4 is a schematic diagram of a network security prediction device 400 provided in an embodiment of the present disclosure. Fig.12 As shown, the network security prediction device includes:

[0160] An acquisition unit 410 is used to acquire a network security situation data set;

[0161] A first processing unit 420 is used to determine an output parameter set of a neural network gating unit in a pre-trained model based on a network security situation data set and using a triangular oscillation diffusion function in the pre-trained model;

[0162] A second processing unit 430 is used to determine the hidden layer state parameters in the pre-trained model based on the output parameter set;

[0163] The prediction unit 440 is used to determine the network security prediction result based on the hidden layer state parameters.

[0164] In some embodiments, the first processing unit 420 is also used to preprocess the security event data to obtain a preprocessed data set; determine the data matrix of the preprocessed data set based on the preprocessed data set; and determine the input gate output parameters, output gate output parameters and forgetting gate output parameters of the pretrained model using a triangular oscillation diffusion function based on the matrix features in the data matrix, the target network weights and target bias in the pretrained model.

[0165] In some embodiments, preprocessing includes at least one of data filtering processing, standardization processing, digitization processing and time series processing.

[0166] In some embodiments, the second processing unit 430 is also used to determine the memory unit output parameters in the pre-trained model based on the input gate output parameters and the forget gate output parameters using the point-by-point product method; and to determine the hidden layer state parameters based on the output gate output parameters and the memory unit output parameters using the point-by-point product method.

[0167] In some embodiments, the acquisition unit 410 is also used to acquire a training sample set; based on the training sample set, determine the safety event value corresponding to the training sample set; based on the training sample set and the safety event value, iterate the network weights and bias of the model to be trained to obtain a pre-trained model.

[0168] In some embodiments, the acquisition unit 410 is also used to iterate the network weights and biases of the model to be trained based on the training sample set and the safety event value, according to the preset loss function, and using a first-order optimization algorithm; when the error value calculated using the preset loss function is less than the preset value, the corresponding network weights and biases are determined as the target network weights and target biases; the target network weights and targets are brought into the model to be trained to obtain a pre-trained model.

[0169] In summary, the network security prediction device includes an acquisition unit for acquiring a network security situation data set;

[0170] The first processing unit is used to determine the output parameter set of the neural network gating unit in the pre-trained model based on the network security situation data set and the triangular oscillation diffusion function in the pre-trained model; the second processing unit is used to determine the hidden layer state parameters in the pre-trained model based on the output parameter set; the prediction unit is used to determine the network security prediction result based on the hidden layer state parameters. The device disclosed in the present invention alleviates the problems of gradient disappearance, gradient explosion, neuron necrosis, etc. generated when the model is used by using the triangular oscillation diffusion function in the pre-trained model, thereby improving the convergence speed of the model and the accuracy of network security prediction.

[0171] In the embodiments provided in the present application, the methods and devices provided in the embodiments of the present application are introduced. In order to implement the functions in the methods provided in the embodiments of the present application, the electronic device may include a hardware structure and a software module, and implement the functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. A function of the functions may be executed in the form of a hardware structure, a software module, or a hardware structure plus a software module.

[0172] Fig.13 1 is a block diagram of an electronic device 500 for implementing the above network security prediction method according to an exemplary embodiment. For example, the electronic device 500 may be a mobile phone, a computer, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0173] Reference Fig.13 The electronic device 500 may include a communication interface 501, which can interact with other devices; a processor 502, which is connected to the communication interface 501 to interact with other devices and is used to execute the method provided by one or more of the above technical solutions when running a computer program; and a memory 503, on which the computer program is stored. Specifically, the specific processing process of the processor 502 can refer to the network security prediction method described in the above embodiments of the present disclosure.

[0174] Of course, in actual application, the various components in the electronic device 500 are coupled together through the bus system 505. It can be understood that the bus system 505 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 505 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Fig.13 Various buses are labeled as bus system 505 .

[0175] The memory 503 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device 500. Examples of such data include: any computer program used to operate on the electronic device 500.

[0176] The method disclosed in the above embodiment of the present application can be applied to the processor 502, or implemented by the processor 502. The processor 502 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 502 or the instruction in the form of software. The above processor 502 may be a general processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 502 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in the memory 503, and the processor 502 reads the information in the memory 503 and completes the steps of the above method in combination with its hardware.

[0177] In an exemplary embodiment, the electronic device 500 can be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), field programmable gate array (FPGA), general processor, controller, microcontroller (MCU), microprocessor, or other electronic components to execute the aforementioned method.

[0178] The embodiments of the present disclosure further provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the network security prediction method described in the above embodiments of the present disclosure.

[0179] An embodiment of the present disclosure further provides a computer program product, including a computer program, which is used by a processor to execute the network security prediction method described in the above embodiment of the present disclosure.

[0180] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0181] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0182] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.

[0183] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processing module, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (control method), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.

[0184] It should be understood that the various parts of the embodiments of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0185] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0186] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0187] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A network security prediction method, characterized in that: The method comprises: Obtain network security situation dataset; Based on the network security situation data set, using the triangular oscillation diffusion function in the pre-trained model, determining the output parameter set of the neural network gating unit in the pre-trained model; Based on the output parameter set, determining the hidden layer state parameters in the pre-trained model; Based on the hidden layer state parameters, a network security prediction result is determined.

2. The method according to claim 1, characterized in that The determining of the output parameter set of the neural network gating unit in the pre-training model based on the network security situation data set and using the triangular oscillation diffusion function in the pre-training model comprises: Preprocessing the safety event data to obtain a preprocessed data set; Based on the preprocessed data set, determining a data matrix of the preprocessed data set; Based on the matrix features in the data matrix, the target network weights and the target bias in the pre-trained model, the input gate output parameters, the output gate output parameters and the forget gate output parameters of the pre-trained model are determined using the triangular oscillation diffusion function.

3. The method according to claim 2, characterized in that The preprocessing includes at least one of data filtering processing, standardization processing, digitization processing and time series processing.

4. The method according to claim 2, characterized in that: The determining, based on the output parameter set, the hidden layer state parameters in the pre-trained model comprises: Based on the input gate output parameter and the forget gate output parameter, using the point-by-point product method, determine the memory unit output parameter in the pre-trained model; Based on the output parameters of the output gate and the output parameters of the memory unit, the hidden layer state parameters are determined by using a point-by-point product method.

5. The method according to claim 1, characterized in that The method further comprises: Obtain a training sample set; Based on the training sample set, determining a safety event value corresponding to the training sample set; Based on the training sample set and the safety event value, the network weights and bias of the model to be trained are iterated to obtain a pre-trained model.

6. The method according to claim 5, characterized in that The iterating the network weights and bias of the model to be trained based on the training sample set and the safety event value to obtain the pre-trained model includes: Based on the training sample set and the safety event value, according to a preset loss function, using a first-order optimization algorithm, iterate the network weights and bias of the training model; When the error value calculated by using the preset loss function is less than a preset value, the corresponding network weight and bias are determined as the target network weight and the target; The target network weight and the target are brought into the model to be trained to obtain a pre-trained model.

7. A network security prediction device, characterized in that: The device comprises: An acquisition unit, used for acquiring a network security situation data set; A first processing unit is used to determine an output parameter set of a neural network gating unit in the pre-training model based on the network security situation data set and using a triangular oscillation diffusion function in the pre-training model; A second processing unit, configured to determine a hidden layer state parameter in the pre-trained model based on the output parameter set; The prediction unit is used to determine the network security prediction result based on the hidden layer state parameter.

8. An electronic device, characterized in that: include: a processor and a memory for storing a computer program capable of being executed on the processor, Wherein, when the processor is used to run the computer program, it executes the method according to any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-6.

10. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 6.