Detection method, system, device and medium based on abnormal traffic sample enhancement

Through the abnormal traffic sample enhancement technology, the problem of insufficient detection performance of network security defense models in complex network environments is solved. By generating and training abnormal traffic samples, the detection accuracy and ability of security defense models are improved, and the network security protection system is enhanced Resistance ability.

CN118054972BActive Publication Date: 2024-11-12SHIJIAZHUANG UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410431040.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-11
Publication Date
2024-11-12
Estimated Expiration
2044-04-11

AI Technical Summary

Technical Problem

The existing network security defense model is difficult to cope with complex network environments in network security exercises, resulting in insufficient detection performance, mainly due to the distribution deviation of normal traffic samples and abnormal traffic samples and the learning of the characteristics of limited abnormal traffic samples by dynamic machine learning detection methods. insufficient.

Method used

By obtaining normal flow samples and abnormal flow samples, use the preset abnormal flow generation model to enhance abnormal flow samples, increasing the number and quality of abnormal flow samples, thereby training the security defense model and improving its detection performance. The specific steps include inputting normal and abnormal traffic samples into an abnormal traffic generation model, generating enhanced abnormal traffic samples, and training the security defense model based on these samples, adjusting the generation parameters until the preset detection accuracy requirements are met.

Benefits of technology

It improves the detection accuracy and ability of the security defense model, enhances the ability to identify abnormal traffic, reduces the deviation between normal and abnormal traffic sample distribution, stabilizes the detection performance, and enhances the resistance of the network security protection system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118054972B_ABST
    Figure CN118054972B_ABST
Patent Text Reader

Abstract

The present invention provides a detection method, system, device and medium based on abnormal traffic sample enhancement, which relates to the technical field of digital information transmission network security. The method comprises: obtaining normal traffic samples and abnormal traffic samples within a first preset time period; inputting the normal traffic samples, abnormal traffic samples and preset generation parameters into a preset abnormal traffic generation model to obtain a first abnormal traffic sample output by the abnormal traffic generation model; according to the first abnormal traffic sample, performing abnormal traffic sample enhancement on the business traffic sample within a second preset time period; training a security defense model based on the business traffic sample after the abnormal traffic sample enhancement to obtain a trained security defense model; wherein the trained security defense model is used to detect abnormal traffic samples in business traffic samples. The present invention can improve the detection performance of the security defense model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of digital information transmission technology, and in particular to a detection method, system, device and medium based on abnormal traffic sample enhancement. Background Art

[0002] With the continuous development of digital information transmission technology, network security issues have received more and more attention. In the attack and defense phase of network security exercises, the network attacks launched by the attack team are complex and diverse, and the security defense models in the relevant network security defense systems are mostly applicable to typical network security scenarios. However, at different stages of network security exercises, different network security situations may occur, resulting in corresponding fluctuations in the protection level of the security defense model; and due to the deviation in the distribution of normal traffic samples and abnormal traffic samples, the dynamic machine learning detection method of the security defense model can only learn the characteristics of a limited number of abnormal traffic samples, which is difficult to cope with the complex network environment during the drilling process, hindering the effective use of the security defense model.

[0003] Therefore, there is an urgent need for a method that can improve the detection performance of security defense models. Summary of the invention

[0004] The embodiments of the present invention provide a detection method, system, device and medium based on abnormal traffic sample enhancement, which can increase the number of abnormal traffic samples input into a security defense model and improve the detection performance of the security defense model.

[0005] In a first aspect, an embodiment of the present invention provides a detection method based on abnormal traffic sample enhancement, comprising:

[0006] Obtaining normal traffic samples and abnormal traffic samples within a first preset time period; the samples are data samples;

[0007] Inputting the normal traffic sample, the abnormal traffic sample and the preset generation parameters into a preset abnormal traffic generation model to obtain a first abnormal traffic sample output by the abnormal traffic generation model; wherein the preset generation parameters are used to determine the scale and discreteness of the abnormal traffic sample output by the abnormal traffic generation model;

[0008] According to the first abnormal traffic sample, performing abnormal traffic sample enhancement on the service traffic sample within the second preset time period;

[0009] Based on the business traffic samples enhanced by the abnormal traffic samples, a security defense model is trained to obtain a trained security defense model; wherein the trained security defense model is used to detect abnormal traffic samples in the business traffic samples.

[0010] In a possible implementation, the training of the security defense model based on the service traffic sample enhanced by the abnormal traffic sample to obtain the trained security defense model includes:

[0011] Inputting the enhanced business traffic sample of the abnormal traffic sample into the security defense model to obtain a second abnormal traffic sample output by the security defense model;

[0012] Determine the detection accuracy of the security defense model based on the second abnormal traffic sample and the abnormal traffic sample corresponding to the business traffic sample after the abnormal traffic sample is enhanced;

[0013] Adjust the generation parameters, and use the adjusted generation parameters as the preset generation parameters, and re-execute the step of inputting the normal traffic sample, the abnormal traffic sample and the preset generation parameters into the preset abnormal traffic generation model until the preset requirements are met, so as to obtain the optimal generation parameters and the trained security defense model; wherein the preset requirements are set according to the detection accuracy.

[0014] In a possible implementation, after training the security defense model based on the service traffic sample enhanced by the abnormal traffic sample to obtain the trained security defense model, the method further includes:

[0015] Acquire a traffic sample to be identified, and obtain a third abnormal traffic sample according to normal traffic samples, abnormal traffic samples, the optimal generation parameters and the abnormal traffic generation model within a third preset time period before the traffic sample to be identified;

[0016] The third abnormal traffic sample is used to enhance the traffic sample to be identified, and the traffic sample to be identified after the abnormal traffic sample enhancement is input into the trained security defense model to obtain the abnormal traffic sample in the traffic sample to be identified.

[0017] In a possible implementation, the method further includes:

[0018] Acquire a plurality of different preset generation parameters, and normal traffic samples and abnormal traffic samples within a fourth preset time period;

[0019] For each preset generation parameter, the step of inputting the normal traffic sample, the abnormal traffic sample and the preset generation parameter into a preset abnormal traffic generation model is performed to obtain the detection accuracy of the security defense model under the preset generation parameter;

[0020] According to each preset generation parameter and the corresponding detection accuracy, a fitting function of the detection accuracy of the security defense model with the preset generation parameter as a variable is established;

[0021] The preset requirement is set based on the difference between the detection accuracy estimate determined by the fitting function and the detection accuracy of the corresponding security defense model.

[0022] In a possible implementation, adjusting the generation parameters includes:

[0023] Based on the generated parameters, determining whether the preset requirements are met;

[0024] If the preset requirements are not met, the coefficients in the fitting function are adjusted according to the gradient descent method and the preset requirements, the fitting function is determined according to the adjusted coefficients, and the generation parameters are adjusted according to the fitting function.

[0025] In one possible implementation, the abnormal traffic generation model is a preset adversarial generative network model, which includes a generator and a discriminator. The generator generates initial abnormal traffic samples based on normal traffic samples and abnormal traffic samples within a time period. The discriminator is a residual network-based discriminator. The residual network-based discriminator discriminates the initial abnormal traffic samples, and obtains the final abnormal traffic samples based on the discrimination results and generation parameters.

[0026] In a possible implementation, after obtaining the traffic sample to be identified, the method further includes:

[0027] Determine the operation state of the abnormal traffic generation model; wherein the operation state includes skipping and working;

[0028] If the running state of the abnormal traffic generation model is skip, the traffic sample to be identified is input into the security defense model to obtain the abnormal traffic sample in the traffic sample to be identified;

[0029] If the operating status of the abnormal traffic generation model is working, the step of obtaining a third abnormal traffic sample based on normal traffic samples, abnormal traffic samples, the optimal generation parameters and the abnormal traffic generation model within a third preset time period before the traffic sample to be identified is executed.

[0030] In a second aspect, an embodiment of the present invention provides a detection system based on abnormal traffic sample enhancement, including:

[0031] An acquisition module, used to acquire normal flow samples and abnormal flow samples within a first preset time period; the samples are data samples;

[0032] A generation module, used for inputting the normal traffic sample, the abnormal traffic sample and preset generation parameters into a preset abnormal traffic generation model to obtain a first abnormal traffic sample output by the abnormal traffic generation model; wherein the preset generation parameters are used to determine the scale and discreteness of the abnormal traffic sample output by the abnormal traffic generation model;

[0033] A training module is used to enhance the business traffic samples within a second preset time period according to the first abnormal traffic samples; and to train a security defense model based on the business traffic samples after the abnormal traffic samples are enhanced to obtain a trained security defense model; wherein the trained security defense model is used to detect abnormal traffic samples in the business traffic samples.

[0034] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the method described in the first aspect or any possible implementation method of the first aspect are implemented.

[0035] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect or any possible implementation method of the first aspect are implemented.

[0036] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0037] The embodiment of the present invention can obtain a first abnormal traffic sample corresponding to the preset generation parameters output by the abnormal traffic generation model by inputting preset generation parameters into a preset abnormal traffic generation model, and then enhance the abnormal traffic sample through the first abnormal traffic sample and the business traffic sample, so as to train the security defense model and obtain a trained security defense model. The abnormal traffic samples in the training set for training the security defense model can be increased, thereby improving the detection capability and detection accuracy of the security defense model. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0039] Figure 1 It is a flow chart of an implementation of a detection method based on abnormal traffic sample enhancement provided by an embodiment of the present invention;

[0040] Figure 2 It is a flow chart of another detection method based on abnormal traffic sample enhancement provided by an embodiment of the present invention;

[0041] Figure 3 It is a structural schematic diagram of an abnormal traffic generation model provided by an embodiment of the present invention;

[0042] Figure 4 is a graph showing changes in the objective function value corresponding to the security defense model provided by an embodiment of the present invention;

[0043] Figure 5 is a structural schematic diagram of a detection system based on abnormal traffic sample enhancement provided by an embodiment of the present invention;

[0044] Figure 6 is a schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0045] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.

[0046] In order to make the purpose, technical solutions and advantages of the present invention more clear, specific embodiments will be described below in conjunction with the accompanying drawings.

[0047] Figure 1 The implementation flow chart of the detection method based on abnormal traffic sample enhancement provided by the embodiment of the present invention is described in detail as follows:

[0048] Step S101, obtaining normal traffic samples and abnormal traffic samples within a first preset time period; the samples are data samples.

[0049] In this embodiment, the normal traffic sample can be the normal traffic data determined by the detection of the security defense model, or it can be the normal traffic data determined additionally; during the training process, the normal traffic sample can be continuously updated according to the latest determined normal traffic data, so that the abnormal traffic sample output by the subsequent abnormal traffic generation model can change with the update of the normal traffic sample. The abnormal traffic sample can be the abnormal traffic data determined by the security defense model, or it can be the abnormal traffic data determined additionally.

[0050] Here, the detection method based on abnormal traffic sample enhancement provided by the present invention is mainly applied to the connection between the government or enterprise intranet and extranet, such as the firewall, intrusion detection system (IDS) and intrusion prevention system (IPS) at the connection. Normal traffic samples can be real network traffic data of normal business transactions, such as normal business transaction data of the office automation (OA) system at the connection between the government intranet and extranet, normal business transaction data at the connection between the enterprise intranet and extranet, such as normal operation data in the enterprise OA server, normal game data flowing through the firewall of the game server of the game company, etc. Abnormal traffic samples can be distributed denial of service (DDoS) attack data, cross-site scripting attack (XSS) data, penetration test data and worm data, etc.

[0051] Step S102, input normal traffic samples, abnormal traffic samples and preset generation parameters into a preset abnormal traffic generation model to obtain a first abnormal traffic sample output by the abnormal traffic generation model; wherein the preset generation parameters are used to determine the scale and discreteness of the abnormal traffic samples output by the abnormal traffic generation model.

[0052] In this embodiment, the scale and discreteness of the generated first abnormal traffic sample meet the requirements of the preset generation parameters, so that the abnormal traffic sample can be enhanced later. At the same time, by inputting the normal traffic sample and the abnormal traffic sample into the abnormal traffic generation model, the generated first abnormal traffic sample can be changed with the update of the normal traffic sample, rather than being changed and generated only on the basis of the abnormal traffic sample.

[0053] Optionally, the generation parameters include a data scale parameter and a data discreteness parameter. Among them, the data scale parameter can control the scale of the output abnormal traffic samples, that is, it can be the size of the data volume of the output abnormal traffic samples, or it can be the percentage of the abnormal traffic samples finally output to all generated abnormal traffic samples, or it can be the ratio of the output abnormal traffic samples to the business traffic samples for subsequent abnormal traffic sample enhancement; the data discreteness parameter can control the similarity or deviation between the output abnormal traffic samples and the input abnormal traffic samples. Here, the larger the data discreteness parameter, the higher the discretization degree of the output abnormal traffic samples, and the greater the difference between the output abnormal traffic samples and the input abnormal traffic samples.

[0054] Step S103: Based on the first abnormal traffic sample, abnormal traffic sample enhancement is performed on the service traffic sample within the second preset time period.

[0055] In this embodiment, the first abnormal traffic sample can be merged or mixed with the business traffic sample to increase the proportion of abnormal traffic samples in the obtained traffic sample, reduce the deviation between the abnormal traffic sample and the normal traffic sample in the obtained traffic sample, and enhance the abnormal traffic sample, which is conducive to the subsequent effective training of the security defense model and improves the accuracy of the security defense model in detecting abnormal traffic samples.

[0056] Here, the second preset time period can be a continuous period of time after the first preset time period, so that the data similarity between the generated first abnormal traffic sample and the business traffic sample is high, thereby ensuring the detection level of the trained security defense model and reducing the fluctuation of the detection accuracy of the security defense model.

[0057] Step S104, training a security defense model based on the business traffic samples enhanced by the abnormal traffic samples to obtain a trained security defense model; wherein the trained security defense model is used to detect abnormal traffic samples in the business traffic samples.

[0058] In this embodiment, after the business traffic samples are enhanced for abnormal traffic samples, the abnormal traffic samples therein can be improved, and the deviation between the distribution of abnormal traffic samples and normal traffic samples can be reduced. Then, the security defense model can be trained to improve the accuracy of the security defense model in identifying abnormal traffic samples, thereby improving the overall detection accuracy of the security defense model for abnormal traffic samples and normal traffic samples. This can improve the accuracy of detecting abnormal traffic samples in business traffic samples using the trained security defense model, thereby enhancing the ability of the network security protection system using the security defense model to resist abnormal traffic data.

[0059] Here, the security defense model can be any of the following models: decision tree model, random forest model, naive Bayes model, adaptive boosting (Adaptive Boosting, AdaBoost) model, etc.

[0060] Taking the enterprise OA server as an example, the normal operation data flowing into the OA server is the normal traffic sample, and the relevant attack data of the attack server is the abnormal traffic sample. A security defense model can be set in the firewall of the OA server, and an abnormal traffic generation model is also set before the security defense model of the firewall. During the training process, the abnormal traffic samples and normal traffic samples determined by the firewall detection can be input into the abnormal traffic generation model to obtain a first abnormal traffic sample generated by the abnormal traffic generation model that is similar to the relevant attack data of the attack OA server. The first abnormal traffic sample and the business traffic sample of the OA server are used to train the security defense model in the firewall.

[0061] The embodiment of the present invention can obtain a first abnormal traffic sample corresponding to the preset generation parameters output by the abnormal traffic generation model by inputting preset generation parameters into a preset abnormal traffic generation model, and then enhance the abnormal traffic sample through the first abnormal traffic sample and the business traffic sample, so as to train the security defense model and obtain a trained security defense model. The abnormal traffic samples in the training set for training the security defense model can be increased, thereby improving the detection capability and detection accuracy of the security defense model.

[0062] In one embodiment, training a security defense model based on a business traffic sample enhanced by an abnormal traffic sample to obtain a trained security defense model may include: first inputting the business traffic sample enhanced by the abnormal traffic sample into the security defense model to obtain a second abnormal traffic sample output by the security defense model; then determining the detection accuracy of the security defense model based on the second abnormal traffic sample and the abnormal traffic sample corresponding to the business traffic sample enhanced by the abnormal traffic sample; then adjusting the generation parameters, and using the adjusted generation parameters as the preset generation parameters, and re-executing the step of inputting the normal traffic sample, the abnormal traffic sample and the preset generation parameters into the preset abnormal traffic generation model until the preset requirements are met, thereby obtaining the optimal generation parameters and the trained security defense model; wherein the preset requirements are set according to the detection accuracy.

[0063] In this embodiment, see Figure 2 Another implementation flow chart of a detection method based on abnormal traffic sample enhancement is shown. When training a security defense model, after obtaining the second abnormal traffic sample output by the security defense model, the detection accuracy of the security defense model is determined by analyzing the second abnormal traffic sample output by the security defense model, thereby determining whether the business traffic sample enhanced by the abnormal traffic sample obtained by adjusting the preset generation parameters is suitable for the security defense model, and whether the security defense model is trained.

[0064] Here, the generation parameters will affect the ratio of normal traffic samples and abnormal traffic samples in the business traffic samples input into the security defense model. By adjusting the generation parameters, the normal traffic samples and abnormal traffic samples in the business traffic samples after the abnormal traffic samples are enhanced can be evenly distributed, so as to find the generation parameters that are most suitable for training the security defense model, thereby improving the detection accuracy of the final security defense model.

[0065] Optionally, the detection method based on abnormal traffic sample enhancement provided in this embodiment may also include: first, obtaining multiple different preset generation parameters, as well as normal traffic samples and abnormal traffic samples within a fourth preset time period; second, for each preset generation parameter, executing the step of inputting the normal traffic sample, the abnormal traffic sample and the preset generation parameter into the preset abnormal traffic generation model to obtain the detection accuracy of the security defense model under the preset generation parameter; then, based on each preset generation parameter and the corresponding detection accuracy, establishing a fitting function of the detection accuracy of the security defense model with the preset generation parameter as a variable; finally, setting the preset requirements based on the difference between the detection accuracy estimate determined by the fitting function and the detection accuracy of the corresponding security defense model.

[0066] In this embodiment, before adjusting and determining the generation parameters, a plurality of different preset generation parameters can be pre-determined, and abnormal traffic samples can be generated respectively using these preset generation parameters, and the security defense model can be trained to obtain the detection accuracy corresponding to each preset generation parameter, so that the relationship between the generation parameters and the detection accuracy can be determined, that is, a suitable expression is selected to generate a fitting function of the detection accuracy of the security defense model with the preset generation parameters as variables, so that the generation parameters can be gradually adjusted according to the fitting function, and the optimal generation parameters can be determined quickly and accurately.

[0067] Among them, by presetting the generation parameters and the corresponding detection accuracy, a fitting function of the detection accuracy of the security defense model with the preset generation parameters as variables is established, which can be based on the expression: , establish the fitting function; where, Represents the detection accuracy of the security defense model, Indicates the data scale parameter in the generation parameters, represents the data dispersion parameter in the generated parameters, represents a constant, and Indicates the corresponding coefficient.

[0068] Here, since there is a difference between the obtained fitting function and the corresponding true function, the coefficients in the fitting function are uncertain, and the optimal generation parameters cannot be determined only by the generated fitting function. Therefore, the objective function can be the minimum difference between the detection accuracy estimate determined by the fitting function and the detection accuracy of the corresponding security defense model. The minimum value of the objective function can be solved using the gradient descent method, and preset requirements can be set based on the detection accuracy estimate determined by the fitting function and the detection accuracy of the corresponding security defense model. The subsequent security defense model training and optimization are carried out to determine the optimal generation parameters and the trained security defense model. Among them, the difference in establishing the objective function can use the mean square error. The smaller the mean square error, the better the fitting function fits. For example, the objective function can be , where represents the objective function, represents the detection accuracy of the trained security defense model, represents the estimated value of the detection accuracy determined by the fitting function, express and expected value.

[0069] In addition, when using the gradient descent method to solve the minimum value of the objective function, the preset requirement may be that the derivative value of the objective function determined based on the detection accuracy estimate and the detection accuracy of the corresponding security defense model is within a preset range.

[0070] Optionally, adjusting the generation parameters in this embodiment may include: first determining whether preset requirements are met based on the generation parameters; if the preset requirements are not met, adjusting the coefficients in the fitting function according to the gradient descent method and the preset requirements, determining the fitting function according to the adjusted coefficients, and adjusting the generation parameters according to the fitting function.

[0071] In this embodiment, the detection accuracy estimate corresponding to the generation parameter and the detection accuracy of the security defense model corresponding to the generation parameter can be determined, and then the derivative value of the objective function can be calculated. When the derivative value is not within the preset range, the coefficients in the fitting function can be adjusted in the direction of the gradient descent through the gradient descent method and preset requirements to obtain the adjusted coefficients, so that a new expression of the fitting function can be obtained; and then the generation parameters corresponding to the expression are solved when the detection accuracy is the largest to obtain the adjusted generation parameters.

[0072] Here, we can use the expression: , adjust the coefficients in the fitting function; where, Indicates the gradient descent method The coefficients of the fitting function are Indicates the gradient descent method The coefficients of the fitting function are represents the learning rate, It represents the objective function established by minimizing the difference between the detection accuracy estimate determined by the fitting function and the detection accuracy of the corresponding security defense model. represents the partial derivative corresponding to the objective function. In addition, since there are two coefficients in the fitting function set in this embodiment, namely and ,therefore, Can be taken as and , to determine the two coefficients in the fitting function separately.

[0073] Among them, the stochastic gradient descent method is used for solving, and the value of the partial derivative corresponding to the objective function is determined according to the coefficients, generation parameters and the detection accuracy of the corresponding trained security defense model determined in the previous iteration. That is, the generation parameters and the corresponding detection accuracy determined in the previous iteration are used as samples selected in the solution process, so that the fitting curve gradually approaches the real curve corresponding to the detection accuracy of the security defense model.

[0074] In addition, the preset requirement can also be set to that the number of iterations of the gradient descent method to solve the objective function reaches a maximum number of iterations, and the coefficient corresponding to the last iteration is used as the final coefficient to obtain the corresponding optimal generation parameter.

[0075] Exemplarily, preset values ​​of coefficients and preset generation parameters in the fitting function are set in advance, and the detection accuracy of the trained security defense model is obtained by the method in the above embodiment; in the first iteration, the preset generation parameters and the corresponding detection accuracy are used as the first sample, and the coefficients of the fitting function are adjusted according to the preset values ​​of the coefficients, the learning rate and the first sample to obtain the first coefficient value of the fitting function; according to the first coefficient value, the expression corresponding to the fitting function is determined, and the generation parameters are adjusted to obtain the detection accuracy of the trained security defense model, and determine whether the preset requirements are met; if the preset requirements are not met, continue to the second iteration.

[0076] Correspondingly, in the second iteration, the adjusted generation parameters and the corresponding detection accuracy are used as the second sample. According to the first coefficient value, the learning rate and the second sample, the coefficient of the fitting function is adjusted to obtain the second coefficient value of the fitting function, and the generation parameters are adjusted to obtain the detection accuracy of the trained security defense model, and determine whether it meets the preset requirements; if it does not meet the preset requirements, continue to the next iteration until the preset requirements are met, that is, the calculated derivative value of the objective function is within the preset range, and the coefficient of the fitting function converges, so as to obtain the optimal coefficient of the fitting function, so that the real curve corresponding to the detection accuracy of the fitting function and the security defense model is close, and then the optimal generation parameters can be determined to obtain the final trained security defense model.

[0077] In one embodiment, after training a security defense model based on a business traffic sample enhanced by an abnormal traffic sample to obtain a trained security defense model, it may also include: first obtaining a traffic sample to be identified, and obtaining a third abnormal traffic sample based on normal traffic samples, abnormal traffic samples, optimal generation parameters and abnormal traffic generation models within a third preset time period before the traffic sample to be identified; then using the third abnormal traffic sample to perform abnormal traffic sample enhancement on the traffic sample to be identified, and inputting the traffic sample to be identified after the abnormal traffic sample enhancement into the trained security defense model to obtain an abnormal traffic sample in the traffic sample to be identified.

[0078] In this embodiment, when the security defense model provided by the present invention is used to detect the traffic sample to be identified, a third abnormal traffic sample that meets the optimal generation parameters is first generated by the abnormal traffic generation model, and the third abnormal traffic sample is used to enhance the traffic sample to be identified. Then, the traffic sample to be identified after the abnormal traffic sample enhancement is identified and detected to obtain the abnormal traffic sample, thereby improving the detection accuracy of the traffic sample to be identified.

[0079] Moreover, after the detection of the traffic samples to be identified is completed, the real abnormal traffic samples can be determined by analyzing the traffic samples to be identified, so as to determine the detection accuracy of the security defense model for the traffic samples to be identified. If the detection accuracy is lower than the preset accuracy, it means that the traffic samples to be identified in the environment where the security defense model is applied have changed or fluctuated. At this time, the security defense model can continue to be trained to improve the detection accuracy of the security defense model.

[0080] Here, when continuing to train the security defense model, the determined real abnormal traffic samples can be added to the abnormal traffic samples in the input abnormal traffic generation model, so that the abnormal traffic samples generated by the abnormal traffic generation model also change with the changes of the traffic samples to be identified, thereby improving the detection accuracy of the security defense model.

[0081] Optionally, the abnormal traffic generation model is a preset adversarial generative network model, which includes a generator and a discriminator. The generator generates initial abnormal traffic samples based on normal traffic samples and abnormal traffic samples within a time period. The discriminator is a residual network-based discriminator. The residual network-based discriminator discriminates the initial abnormal traffic samples, and obtains the final abnormal traffic samples based on the discrimination results and generation parameters.

[0082] In this embodiment, the abnormal traffic generation model may be a generative adversarial network model or a deep convolutional generative adversarial network (DCGAN) model.

[0083] Taking the DCGAN model as an example, the DCGAN model consists of a generator G and a discriminator D. The generator G and the discriminator D use a fully convolutional neural network model, and stride convolution is used in the fully convolutional neural network instead of a deterministic spatial pooling function (such as maximum pooling), allowing the network to learn its own spatial downsampling. The fully convolutional neural network also includes global average pooling to improve the stability of the model and prevent the generator from compressing all samples to one point.

[0084] Here, when the neural network propagates the gradient backward during the back-propagation process. As the network depth increases, the gradient gradually decreases during the propagation process, resulting in the inability to effectively adjust the weights of the previous network layer. Therefore, as the network depth increases, the training error will also increase, resulting in deterioration of performance in the training and testing phases. Based on this, the discriminator is constructed using the residual network in the convolutional neural network model. In the residual block of the residual network, the input is directly copied to the output and then added to the result of a convolution operation to form a residual connection. This design enables the network to better transfer gradients during back-propagation, thereby optimizing the training effect of deep networks.

[0085] See also Figure 3The structural diagram of the abnormal traffic generation model shown in the figure, in DCGAN, the input of the generator G is the normal traffic sample y and the abnormal traffic sample x, the output of the generator G is the generated initial abnormal traffic sample G(z), and the role of the discriminator D is to judge the generated initial abnormal traffic sample G(z) to determine whether it is a real abnormal traffic sample. The goal of the generator G is to make the generated abnormal traffic sample G(z) mistakenly regarded as a real abnormal traffic sample by the discriminator D as a real abnormal traffic sample, thereby deceiving the discriminator D. The training goal of the generator G is to minimize the difference between the generated abnormal traffic sample G(z) and the real abnormal traffic sample x. The goal of the discriminator D is to distinguish the abnormal traffic sample G(z) generated by the generator G from the real abnormal traffic sample x as much as possible.

[0086] There is a game process between the generator G and the discriminator D. Since the generator G hopes to continuously update and generate more realistic abnormal traffic samples in an attempt to deceive the discriminator D, the discriminator D also continuously updates and improves its ability to identify data, hoping to distinguish the abnormal traffic samples generated by the generator G from the real abnormal traffic samples. This process can be trained through optimization methods such as the least squares method to achieve adversarial learning between the generator G and the discriminator D.

[0087] In addition, after the training of the generator G and the discriminator D is completed, the discriminator D also adjusts the abnormal traffic samples to be output according to the generation parameters. Among them, the sample size of the abnormal traffic samples to be output is adjusted according to the data scale parameter in the generation parameters; the discretization degree between the abnormal traffic samples to be output and the abnormal traffic samples input to the generator is determined, and the abnormal traffic samples that meet the data discreteness parameter are screened according to the data discreteness parameter in the generation parameters to obtain the final abnormal traffic samples.

[0088] Here, the degree of discretization between the abnormal traffic sample to be output and the real abnormal traffic sample in the input generator G is determined by calculating the cosine similarity between the abnormal traffic sample to be output and each sample in the abnormal traffic sample in the input generator. If the cosine similarity is less than the data discreteness parameter, the abnormal traffic sample is not output.

[0089] In one embodiment, after obtaining the traffic sample to be identified, it can also include: first determining the operating status of the abnormal traffic generation model; wherein the operating status includes skipping and working; if the operating status of the abnormal traffic generation model is skipping, the traffic sample to be identified is input into the security defense model to obtain the abnormal traffic sample in the traffic sample to be identified; if the operating status of the abnormal traffic generation model is working, executing the step of obtaining the third abnormal traffic sample based on the normal traffic sample, abnormal traffic sample, optimal generation parameters and abnormal traffic generation model within a third preset time period before the traffic sample to be identified.

[0090] In this embodiment, the operating state of the abnormal traffic generation model can be adjusted, where the operating state is skip, indicating that the abnormal traffic generation model is in a closed state or not running, and the traffic sample to be identified passes directly and is input into the security defense model of the network security protection system for detection and identification; the operating state is working, indicating that the abnormal traffic generation model is in an open state or in normal use, and the abnormal traffic generation model can construct abnormal traffic samples corresponding to the optimal generation parameters, merge them with the traffic samples to be identified, and then input them into the security defense model of the network security protection system for detection and identification.

[0091] In addition, when the operating state is working, the security defense model can also be trained according to the normal traffic samples and abnormal traffic samples detected before the operating state is switched to obtain the optimal generation parameters and the trained security defense model, and then the abnormal traffic generation model is used to generate abnormal traffic samples corresponding to the optimal generation parameters, the abnormal traffic samples are merged with the traffic samples to be identified, and input into the security defense model of the network security protection system for detection and identification.

[0092] Here, when there is a large amount of business traffic data, the running state can be set to skip to avoid affecting the circulation of business traffic data and corresponding services. In other periods with less business traffic data, the running state can be switched to work to continuously train the security defense model, reduce the impact of abnormal traffic sample fluctuations, and improve the detection accuracy of the security defense model.

[0093] In a specific embodiment, the detection method based on abnormal traffic sample enhancement provided by the present application is used for detection, and the security defense model is trained and tested using the original business traffic sample to verify the effectiveness of the method provided by the present application, wherein the security defense model is verified using a decision tree model, a random forest model, a naive Bayes model, and an AdaBoost model, respectively, and the corresponding experimental results are shown in Tables 1 and 2 below:

[0094] Table 1 Detection results of the detection method based on abnormal traffic sample enhancement

[0095]

[0096] Table 2 Detection results of the security defense model trained with the original business traffic samples

[0097]

[0098] From Table 1 and Table 2 above, it can be seen that compared with the case of using the original business traffic samples to train the security defense model, the balanced data set provided in this application has a slight decrease in some indicators on the decision tree model, and has improved on the Naive Bayes, Random Forest and AdaBoost models. This is because the normal traffic samples in the original data set account for a large proportion, and the classifier tends to learn the normal traffic samples, so that more than 90% of the predicted data are correctly classified normal traffic samples. After the data set is balanced, the proportion of normal traffic samples and abnormal traffic samples is similar, and the ability of the classifier to learn normal traffic samples and abnormal traffic samples is roughly the same, so the predicted correctly classified data has the same proportion of normal traffic samples and abnormal traffic samples. The F1-Score in Table 1 and Table 2 can be regarded as the overall performance of the security defense model detection. The detection effect obtained by using the method provided in this application has a relatively large improvement in this indicator, which verifies the effectiveness of the detection method based on abnormal traffic sample enhancement proposed by us, and can solve the problem of unbalanced distribution of normal traffic samples and abnormal traffic samples.

[0099] In Tables 1 and 2 above, accuracy represents the ratio of correctly predicted samples to the total number of samples, precision represents the ratio of correctly predicted sample instances to the total number of predicted sample instances, recall represents the ratio of predicted samples to total samples in the data set, and F1-Score is the weighted average of accuracy and recall. Accuracy, precision, recall and F1-Score are calculated using the following formulas:

[0100] Accuracy = (TP+TN) / (TP+FP+FN+PN);

[0101] Precision = TP / (TP+FP);

[0102] Recall = TP / (TP+FN);

[0103] F1-Score = (2×precision×recall) / (precision+recall);

[0104] Among them, TP is a true positive sample, which indicates a correctly classified positive sample; TN is a true negative sample, which indicates an accurately classified negative sample; FP is a false positive sample, which indicates a negative sample that is incorrectly classified as positive; FN is a false negative sample, which indicates a positive sample that is incorrectly classified as negative. Here, positive samples represent abnormal traffic samples, and negative samples represent normal traffic samples; true positive samples are abnormal traffic samples detected as abnormal traffic samples by the security defense model, true negative samples are normal traffic samples detected as normal traffic samples by the security defense model, false positive samples are normal traffic samples detected as abnormal traffic samples by the security defense model, and false negative samples are abnormal traffic samples detected as normal traffic samples by the security defense model.

[0105] In a specific embodiment, a preset requirement is set with a maximum number of iterations of 500, and a preset security defense model is trained. During the training process, the objective function, that is, the loss function, continues to decrease. In the 8th iteration of training, the corresponding objective function value is 2.6033, and in the 317th iteration of training, the corresponding objective function value is 0.813, and the objective function value has dropped significantly.

[0106] See also Figure 4 The change diagram of the objective function value corresponding to the security defense model shown in the figure shows the change of the objective function value in nearly 500 iterations of the security defense model of this embodiment during the training process. The value of the objective function drops rapidly at the beginning of training, stabilizes between 0.8-0.9 after about 400 trainings, and completes the training at 500 times, obtaining the optimal generation parameters and the corresponding trained security defense model. Here, Figure 4 The horizontal axis represents the number of iterations in the security defense model training process, and the vertical axis represents the objective function value.

[0107] The embodiment of the present invention can obtain a first abnormal traffic sample corresponding to the preset generation parameters output by the abnormal traffic generation model by inputting preset generation parameters into a preset abnormal traffic generation model, and then enhance the abnormal traffic sample through the first abnormal traffic sample and the business traffic sample, so as to train the security defense model and obtain a trained security defense model, which can increase the abnormal traffic samples in the training set for training the security defense model and improve the detection capability and detection accuracy of the security defense model; by adjusting the generation parameters and using the adjusted generation parameters as the preset generation parameters, the security defense model is continuously trained, and the optimal generation parameters and the trained security defense model can be determined, so as to generate the abnormal traffic sample most suitable for the security defense model according to the optimal generation parameters, and further improve the detection capability and detection accuracy of the security defense model; at the same time, by training the preset security defense model, the optimal generation parameters can be obtained quickly and accurately, so as to quickly and accurately complete the training of the security defense model and improve the efficiency of model training.

[0108] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0109] The following is a system embodiment of the present invention. For details not described in detail therein, reference may be made to the corresponding method embodiment described above.

[0110] Figure 5 The structural diagram of the detection system based on abnormal traffic sample enhancement provided by an embodiment of the present invention is shown. For the convenience of explanation, only the part related to the embodiment of the present invention is shown, which is described in detail as follows:

[0111] like Figure 5 As shown, the detection system 50 based on abnormal traffic sample enhancement includes:

[0112] The acquisition module 51 is used to acquire normal flow samples and abnormal flow samples within a first preset time period; the samples are data samples;

[0113] A generation module 52 is used to input the normal traffic sample, the abnormal traffic sample and the preset generation parameters into a preset abnormal traffic generation model to obtain a first abnormal traffic sample output by the abnormal traffic generation model; wherein the preset generation parameters are used to determine the scale and discreteness of the abnormal traffic sample output by the abnormal traffic generation model;

[0114] The training module 53 is used to enhance the business traffic samples within the second preset time period according to the first abnormal traffic samples; and to train the security defense model based on the business traffic samples after the abnormal traffic samples are enhanced to obtain a trained security defense model; wherein the trained security defense model is used to detect abnormal traffic samples in the business traffic samples.

[0115] In a possible implementation, the training module 53 is specifically used for:

[0116] Inputting the enhanced business traffic sample of the abnormal traffic sample into the security defense model to obtain a second abnormal traffic sample output by the security defense model;

[0117] Determine the detection accuracy of the security defense model based on the second abnormal traffic sample and the abnormal traffic sample corresponding to the business traffic sample after the abnormal traffic sample is enhanced;

[0118] Adjust the generation parameters, and use the adjusted generation parameters as the preset generation parameters, and re-execute the step of inputting normal traffic samples, abnormal traffic samples and preset generation parameters into the preset abnormal traffic generation model until the preset requirements are met, and obtain the optimal generation parameters and the trained security defense model; wherein the preset requirements are set according to the detection accuracy.

[0119] In a possible implementation, the detection system 50 based on abnormal traffic sample enhancement further includes a detection module, which is used to:

[0120] Obtaining a traffic sample to be identified, and obtaining a third abnormal traffic sample based on normal traffic samples, abnormal traffic samples, optimal generation parameters, and an abnormal traffic generation model within a third preset time period before the traffic sample to be identified;

[0121] The third abnormal traffic sample is used to enhance the traffic sample to be identified, and the traffic sample to be identified after the abnormal traffic sample enhancement is input into the trained security defense model to obtain the abnormal traffic sample in the traffic sample to be identified.

[0122] In a possible implementation, the training module 53 is further used to:

[0123] Acquire a plurality of different preset generation parameters, and normal traffic samples and abnormal traffic samples within a fourth preset time period;

[0124] For each preset generation parameter, the step of inputting the normal traffic sample, the abnormal traffic sample and the preset generation parameter into the preset abnormal traffic generation model is performed to obtain the detection accuracy of the security defense model under the preset generation parameter;

[0125] According to each preset generation parameter and the corresponding detection accuracy, a fitting function of the detection accuracy of the security defense model with the preset generation parameter as a variable is established;

[0126] The preset requirement is set based on the difference between the detection accuracy estimate determined by the fitting function and the detection accuracy of the corresponding security defense model.

[0127] In a possible implementation, the training module 53 is specifically used for:

[0128] Based on the generated parameters, determine whether the preset requirements are met;

[0129] If the preset requirements are not met, the coefficients in the fitting function are adjusted according to the gradient descent method and the preset requirements, the fitting function is determined according to the adjusted coefficients, and the generation parameters are adjusted according to the fitting function.

[0130] In one possible implementation, the abnormal traffic generation model is a preset adversarial generative network model, which includes a generator and a discriminator. The generator generates initial abnormal traffic samples based on normal traffic samples and abnormal traffic samples within a time period. The discriminator is a residual network-based discriminator. The residual network-based discriminator discriminates the initial abnormal traffic samples, and obtains the final abnormal traffic samples based on the discrimination results and generation parameters.

[0131] In a possible implementation, the detection system 50 based on abnormal traffic sample enhancement further includes a setting module, which is used to:

[0132] Determine the operation status of the abnormal traffic generation model; wherein the operation status includes skipping and working;

[0133] If the running state of the abnormal traffic generation model is skip, the traffic sample to be identified is input into the security defense model to obtain the abnormal traffic sample in the traffic sample to be identified;

[0134] If the operating status of the abnormal traffic generation model is working, the step of obtaining a third abnormal traffic sample is executed based on normal traffic samples, abnormal traffic samples, optimal generation parameters and abnormal traffic generation model within a third preset time period before the traffic sample to be identified.

[0135] Figure 6 Schematic diagram of an electronic device provided by an embodiment of the present invention. Figure 6 As shown, the electronic device 60 of this embodiment includes: a processor 61, a memory 62, and a computer program 63 stored in the memory 62 and executable on the processor 61. When the processor 61 executes the computer program 63, the steps in the above-mentioned detection method embodiments based on abnormal traffic sample enhancement are implemented, for example Figure 1Alternatively, when the processor 61 executes the computer program 63, the functions of each module in the above-mentioned system embodiments are realized, for example, Figure 5 The functions of modules 51 to 53 are shown.

[0136] Exemplarily, the computer program 63 may be divided into one or more modules / units, one or more modules / units are stored in the memory 62 and executed by the processor 61 to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program 63 in the electronic device 60. For example, the computer program 63 may be divided into Figure 5 Modules 51 to 53 are shown.

[0137] The electronic device 60 may include, but is not limited to, a processor 61 and a memory 62. Those skilled in the art will appreciate that Figure 6 It is only an example of the electronic device 60 and does not constitute a limitation of the electronic device 60. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.

[0138] The processor 61 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0139] The memory 62 may be an internal storage unit of the electronic device 60, such as a hard disk or memory of the electronic device 60. The memory 62 may also be an external storage device of the electronic device 60, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 60. Further, the memory 62 may also include both an internal storage unit of the electronic device 60 and an external storage device. The memory 62 is used to store computer programs and other programs and data required by the electronic device. The memory 62 may also be used to temporarily store data that has been output or is to be output.

[0140] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0141] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0142] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0143] In the embodiments provided by the present invention, it should be understood that the disclosed systems / electronic devices and methods can be implemented in other ways. For example, the system / electronic device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, the indirect coupling or communication connection of the system or unit can be electrical, mechanical or other forms.

[0144] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0145] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0146] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. Computer-readable media can include: any entity or device that can carry computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0147] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such 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, and should be included in the protection scope of the present invention.

Claims

1. A detection method based on abnormal traffic sample enhancement, characterized in that: include: Obtaining normal traffic samples and abnormal traffic samples within a first preset time period; The sample is a data sample; Inputting the normal traffic sample, the abnormal traffic sample and the preset generation parameters into a preset abnormal traffic generation model to obtain a first abnormal traffic sample output by the abnormal traffic generation model; wherein the preset generation parameters are used to determine the scale and discreteness of the abnormal traffic sample output by the abnormal traffic generation model; According to the first abnormal traffic sample, performing abnormal traffic sample enhancement on the service traffic sample within the second preset time period; Based on the business traffic samples enhanced by the abnormal traffic samples, a security defense model is trained to obtain a trained security defense model; wherein the trained security defense model is used to detect abnormal traffic samples in the business traffic samples; The security defense model is trained based on the business traffic sample enhanced by the abnormal traffic sample to obtain the trained security defense model, including: Inputting the enhanced business traffic sample of the abnormal traffic sample into the security defense model to obtain a second abnormal traffic sample output by the security defense model; Determine the detection accuracy of the security defense model based on the second abnormal traffic sample and the abnormal traffic sample corresponding to the business traffic sample after the abnormal traffic sample is enhanced; Adjusting the generation parameters, and using the adjusted generation parameters as the preset generation parameters, re-performing the step of inputting the normal traffic sample, the abnormal traffic sample and the preset generation parameters into the preset abnormal traffic generation model until the preset requirements are met, and obtaining the optimal generation parameters and the trained security defense model; wherein the preset requirements are set according to the detection accuracy; The method further comprises: Acquire a plurality of different preset generation parameters, and normal traffic samples and abnormal traffic samples within a fourth preset time period; For each preset generation parameter, the step of inputting the normal traffic sample, the abnormal traffic sample and the preset generation parameter into a preset abnormal traffic generation model is performed to obtain the detection accuracy of the security defense model under the preset generation parameter; According to each preset generation parameter and the corresponding detection accuracy, a fitting function of the detection accuracy of the security defense model with the preset generation parameter as a variable is established; Setting the preset requirement based on a difference between the detection accuracy estimate determined by the fitting function and the detection accuracy of the corresponding security defense model; The adjusting generation parameters comprises: Based on the generated parameters, determining whether the preset requirements are met; If the preset requirements are not met, the coefficients in the fitting function are adjusted according to the gradient descent method and the preset requirements, the fitting function is determined according to the adjusted coefficients, and the generation parameters are adjusted according to the fitting function.

2. The detection method based on abnormal traffic sample enhancement according to claim 1 is characterized in that: After training the security defense model based on the service traffic sample enhanced by the abnormal traffic sample to obtain the trained security defense model, the method further includes: Acquire a traffic sample to be identified, and obtain a third abnormal traffic sample according to normal traffic samples, abnormal traffic samples, the optimal generation parameters and the abnormal traffic generation model within a third preset time period before the traffic sample to be identified; The third abnormal traffic sample is used to enhance the traffic sample to be identified, and the traffic sample to be identified after the abnormal traffic sample enhancement is input into the trained security defense model to obtain the abnormal traffic sample in the traffic sample to be identified.

3. The detection method based on abnormal traffic sample enhancement according to claim 1 or 2, characterized in that: The abnormal traffic generation model is a preset adversarial generative network model, which includes a generator and a discriminator. The generator generates initial abnormal traffic samples based on normal traffic samples and abnormal traffic samples within a time period. The discriminator is a discriminator based on a residual network. The discriminator based on the residual network discriminates the initial abnormal traffic samples, and obtains the final abnormal traffic samples based on the discrimination results and generation parameters.

4. The detection method based on abnormal traffic sample enhancement according to claim 2 is characterized in that: After obtaining the traffic sample to be identified, the following steps are also included: Determine the operation state of the abnormal traffic generation model; wherein the operation state includes skipping and working; If the running state of the abnormal traffic generation model is skip, the traffic sample to be identified is input into the security defense model to obtain the abnormal traffic sample in the traffic sample to be identified; If the operating status of the abnormal traffic generation model is working, the step of obtaining a third abnormal traffic sample based on normal traffic samples, abnormal traffic samples, the optimal generation parameters and the abnormal traffic generation model within a third preset time period before the traffic sample to be identified is executed.

5. A detection system based on abnormal traffic sample enhancement, characterized in that: include: An acquisition module, used to acquire normal flow samples and abnormal flow samples within a first preset time period; The sample is a data sample; A generation module, used for inputting the normal traffic sample, the abnormal traffic sample and preset generation parameters into a preset abnormal traffic generation model to obtain a first abnormal traffic sample output by the abnormal traffic generation model; wherein the preset generation parameters are used to determine the scale and discreteness of the abnormal traffic sample output by the abnormal traffic generation model; A training module is used to enhance the abnormal traffic samples of the service traffic samples within the second preset time period according to the first abnormal traffic samples; and to train the security defense model based on the service traffic samples after the abnormal traffic samples are enhanced to obtain the trained security defense model; wherein the trained security defense model is used to detect the abnormal traffic samples in the service traffic samples; The training module is specifically used for: Inputting the enhanced business traffic sample of the abnormal traffic sample into the security defense model to obtain a second abnormal traffic sample output by the security defense model; Determine the detection accuracy of the security defense model based on the second abnormal traffic sample and the abnormal traffic sample corresponding to the business traffic sample after the abnormal traffic sample is enhanced; Adjusting the generation parameters, and using the adjusted generation parameters as the preset generation parameters, re-performing the step of inputting the normal traffic sample, the abnormal traffic sample and the preset generation parameters into the preset abnormal traffic generation model until the preset requirements are met, and obtaining the optimal generation parameters and the trained security defense model; wherein the preset requirements are set according to the detection accuracy; The training module is also used to: Acquire a plurality of different preset generation parameters, and normal traffic samples and abnormal traffic samples within a fourth preset time period; For each preset generation parameter, the step of inputting the normal traffic sample, the abnormal traffic sample and the preset generation parameter into a preset abnormal traffic generation model is performed to obtain the detection accuracy of the security defense model under the preset generation parameter; According to each preset generation parameter and the corresponding detection accuracy, a fitting function of the detection accuracy of the security defense model with the preset generation parameter as a variable is established; Setting the preset requirement based on a difference between the detection accuracy estimate determined by the fitting function and the detection accuracy of the corresponding security defense model; The training module is specifically used for: Based on the generated parameters, determining whether the preset requirements are met; If the preset requirements are not met, the coefficients in the fitting function are adjusted according to the gradient descent method and the preset requirements, the fitting function is determined according to the adjusted coefficients, and the generation parameters are adjusted according to the fitting function.

6. An electronic device comprising a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

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