Network attack defense model establishment method, device, electronic device and storage medium

Through the method of hierarchical features and generating rule sets, a network attack defense model is formed, which solves the problems of high cost and long time of identifying network attack behaviors in the existing technology, and achieves fast and economical attack behavior identification and defense.

CN116232686BActive Publication Date: 2024-09-13BEIJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310015825.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-04
Publication Date
2024-09-13
Estimated Expiration
2043-01-04

AI Technical Summary

Technical Problem

Existing network attack defense models are costly and time-consuming to identify the type of network attack behavior, making it difficult to take defensive measures quickly and effectively.

Method used

By obtaining network attack behavior information, classifying characteristics and generating multiple training sets and rule sets, screening low-cost rule combinations to form a network attack defense model, we can identify and defend against network attack behavior as early as possible.

Benefits of technology

It reduces the cost and time of identifying network attack behaviors, improves the speed and accuracy of identification, and ensures that defensive measures are taken in a timely manner.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116232686B
    Figure CN116232686B
Patent Text Reader

Abstract

The present application provides a method, device, electronic device and storage medium for establishing a network attack defense model, which uses low-cost features to identify the type of network attack behavior as much as possible, and uses high-cost features to identify the type of network attack behavior when low-cost features cannot accurately identify the type of network attack behavior. The cost of identifying network attack behavior is reduced, and network attack behavior is identified more quickly, so that defensive measures can be taken against network attack behavior as early as possible.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information security technology, and in particular to a method, device, electronic device and storage medium for establishing a network attack defense model. Background Art

[0002] In the related art, the network attack defense model is established based on a large number of network attack behavior characteristics. Although it can better identify the type of network attack behavior, the cost of identifying network attack behavior is high and the time required to identify network attack behavior is long. Summary of the invention

[0003] In view of this, the purpose of this application is to propose a method, device, electronic device and storage medium for establishing a network attack defense model.

[0004] Based on the above objectives, the present application provides a method for establishing a network attack defense model, including:

[0005] Obtain information about network attack behaviors;

[0006] Obtain at least two levels of characteristics of the network attack behavior based on the network attack behavior information;

[0007] At least two training sets are obtained according to at least two levels of features;

[0008] According to at least two training sets, at least two rule sets are obtained;

[0009] The rules in at least two rule sets are screened and combined to obtain a network attack defense model.

[0010] The present application also provides a network attack defense model establishment device, comprising:

[0011] A network attack behavior information acquisition module is used to acquire network attack behavior information;

[0012] A feature acquisition module, used to acquire at least two levels of features of network attack behavior according to network attack behavior information;

[0013] A training set acquisition module, used to obtain at least two training sets according to at least two levels of features;

[0014] A rule set acquisition module, used to obtain at least two rule sets based on at least two training sets;

[0015] The network attack defense model building module is used to filter and combine the rules in at least two rule sets to obtain a network attack defense model.

[0016] The present application also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above method when executing the program.

[0017] The present application also provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute the above method.

[0018] From the above, it can be seen that the network attack defense model establishment method, device, electronic device and storage medium provided by the present application use low-cost features to identify the type of network attack behavior as much as possible, and use high-cost features to identify the type of network attack behavior when low-cost features cannot accurately identify the type of network attack behavior. Reduce the cost of identifying network attack behavior, and identify network attack behavior more quickly, so as to take defensive measures against network attack behavior as early as possible. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solution in the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0020] Figure 1 A flowchart of a method for establishing a network attack defense model according to an embodiment of the present application.

[0021] Figure 2 A schematic diagram of the structure of a network attack defense model establishment device according to an embodiment of the present application.

[0022] Figure 3 A schematic diagram of the hardware structure of the server according to an embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0024] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be understood by people with ordinary skills in the field to which the present application belongs. "Include" or "comprising" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.

[0025] In the related art, the network attack defense model is established based on a large number of network attack behavior features. The operating cost of this network attack defense model is the sum of the time and computer resources required to extract and test features from the monitored original data stream. Therefore, since a large number of features are used in the discrimination process, although the network attack defense model of the related art can better discriminate the type of network attack behavior, the cost of discriminating network attack behavior is high and the time of discriminating network attack behavior is long.

[0026] Based on the above-mentioned defects of the related art, the embodiments of the present application provide a method, device, electronic device and storage medium for establishing a network attack defense model.

[0027] The network attack defense model establishment method, device, electronic device and storage medium provided by the present application use low-cost features to identify the type of network attack behavior as much as possible, and use high-cost features to identify the type of network attack behavior when low-cost features cannot accurately identify the type of network attack behavior. Reduce the cost of identifying network attack behavior, and identify network attack behavior more quickly, so as to take defensive measures against network attack behavior as early as possible.

[0028] Figure 1 A flow chart of a method for establishing a network attack defense model provided in an embodiment of the present application is shown.

[0029] like Figure 1 As shown, the embodiment of the present application provides a method for establishing a network attack defense model, including:

[0030] Step S101: Obtain network attack behavior information.

[0031] In this embodiment, the network attack behavior information may include the attack type of the network attack behavior, the description of the network attack behavior and the distinguishing features of the network attack behavior. For example, the attack type of the network attack behavior may include denial of service, unauthorized access, eavesdropping, business flow analysis, bypass control, virus and authorized infringement. For example, the description of the network attack behavior may include "denial of service: the legitimate access of information users to information or other resources is unconditionally blocked", "unauthorized access: system resources are used by an unauthorized entity, resulting in the destruction of system data". For example, the distinguishing features of denial of service may include exceeding the limit of communication traffic during normal operation of the system, a large number of DNS and PTR query requests, and the TCP and UDP data packets and data segments that do not belong to normal connection communications only contain text and numeric characters (such as: no spaces, punctuation and control characters); the distinguishing features of unauthorized access may include users intentionally avoiding the system access control mechanism to use network devices and resources abnormally, users arbitrarily expand their authority to access information beyond their authority, users clear logs, delete copied files and change certain system settings after logging into the system, and users automatically execute script instructions and download unknown programs after entering the system.

[0032] Step S102: Obtain at least two levels of features of the network attack behavior according to the network attack behavior information.

[0033] As an optional embodiment, the at least two levels of features include N-level features arranged from low to high judgment costs, wherein N is a positive integer greater than 1. The N-level features may include first-level features, second-level features, ... N-th-level features arranged from low to high judgment costs.

[0034] In this embodiment, the judgment cost can be the sum of the time and computer resources required to extract and test the feature from the monitored original data stream in order to determine whether the network attack behavior includes the feature. The time required for extracting the feature, the time required for testing the feature, the computer resources required for extracting the feature, and the computer features required for testing the feature are weighted respectively, and the corresponding numerical values ​​of the feature are weighted to obtain the judgment cost of the feature.

[0035] In specific implementation, features are graded according to judgment costs, and features with similar judgment costs are classified into the same level of features. In this way, multiple training sets with different levels of judgment costs can be obtained, and then multiple rule sets including rules with different levels of judgment costs can be obtained.

[0036] In this embodiment, the features can be divided into four levels of features. For example, the first level feature of denial of service can be the communication flow that exceeds the limit when the system is working normally, the second level feature can be the appearance of a large number of DNS and PTR query requests, the third level feature can be the appearance of TCP and UDP data packets that do not belong to normal connection communication, and the fourth level feature can be that the data segment content only contains text and numeric characters (such as: no spaces, punctuation and control characters); the first level feature of unauthorized access can be that the user intentionally circumvents the system access control mechanism to use network devices and resources abnormally, the second level feature can be that the user arbitrarily expands the authority to access information beyond the authority, the third level feature can be that the user clears the log, deletes the copied files and changes some system settings after logging into the system, and the fourth level feature can be that the user automatically executes script instructions and downloads unknown programs after entering the system. The embodiment of this application does not limit the number of levels of features.

[0037] Step S103: Obtain at least two training sets based on at least two levels of features.

[0038] As an optional embodiment, at least two training sets include N training sets arranged from small to large in number of features. The N training sets may include a first training set, a second training set, ..., and an Nth training set. For the N training sets arranged from small to large in number of features, any one of the training sets is obtained based on all features whose level is less than or equal to the training set sequence number. That is, the first training set is obtained based on the first-level features, the second training set is obtained based on the first-level features and the second-level features, ..., the Nth training set is obtained based on the first-level features to the Nth-level features.

[0039] In this way, the next training set includes one more level of features than the previous training set, that is, each training set consists of the previous training set and new features with a higher cost. The cost of the features included in the training set increases with the increase of the sequence number, so that the cost of the rules included in the rule set obtained according to the training set also increases with the increase of the sequence number.

[0040] Step S104: Obtain at least two rule sets based on at least two training sets.

[0041] Rule sets are used for classification and contain multiple rules for predicting the category of items to be classified based on features. Each rule contains a rule antecedent and a rule consequent. The rule antecedent is the premise and the rule consequent is the predicted category. When an item to be classified meets all the premises of the rule antecedent, it is predicted that the item to be classified belongs to the predicted category of the rule consequent. The expressive power of rule sets is almost equivalent to that of decision trees, but rule sets are easier to interpret than decision trees and do not need to take into account the hierarchical structure.

[0042] In this embodiment, multiple training sets are used to perform machine learning respectively to obtain multiple rule sets.

[0043] As an optional embodiment, step S104 may include the following steps:

[0044] For N training sets, the N training sets are respectively input into the rule extraction algorithm to obtain N rule sets arranged in order corresponding to the N training sets. That is, the first training set is input into the rule extraction algorithm to obtain the first rule set; the second training set is input into the rule extraction algorithm to obtain the second rule set... the Nth training set is input into the rule extraction algorithm to obtain the Nth rule set.

[0045] In this embodiment, the rule extraction algorithm may be a RIPPER algorithm or a C4.5 algorithm. The embodiment of the present application does not limit the selection of the rule extraction algorithm.

[0046] The RIPPER algorithm is a decision tree heuristic algorithm that uses the information generation function Gain(x) to evaluate the expected reduction in entropy caused by adding a certain attribute. Since the RIPPER algorithm does not provide a learning method for network attack behavior information related to the attributes of the data set, it must be extended to meet the needs. The extension method is to let the information generation function be: (2 Gain -1) / ((A)+1) w , where Cost(A) is the cost of using the attribute, and w is a cost evaluation constant between 0 and 1. A satisfactory set of rules can be obtained by adjusting w.

[0047] The C4.5 algorithm is a decision tree generation algorithm. A decision tree can be generated by the C4.5 algorithm, and then rules are extracted from the decision tree to obtain a rule set.

[0048] In this way, the corresponding rule set is generated through the training set, so that the cost of the rules included in the rule set increases with the increase of the sequence number.

[0049] Step S105: Filter and combine rules in at least two rule sets to obtain a network attack defense model.

[0050] In this embodiment, the rules are screened according to their accuracy, and the rules that meet the accuracy requirements and have the lowest possible cost are screened out to form a network attack defense model.

[0051] As an optional embodiment, step S105 may include the following steps:

[0052] The accuracy of the rules included in the first rule set among the N rule sets in distinguishing network attack behaviors is tested.

[0053] In response to determining that the accuracy of the rules included in the first rule set in distinguishing network attack behaviors is greater than or equal to an accuracy threshold, the rules are added to the network attack defense model.

[0054] In specific implementation, each network attack behavior may have a different accuracy threshold, and the accuracy threshold may be the accuracy of the rules in the Nth rule set for discrimination. Selecting the accuracy of the rules contained in the Nth rule set as the accuracy threshold can better assess whether a rule is a better rule. Because the training set of the Nth rule set contains features of all levels, the rules contained in the Nth rule set are all the rules with the highest cost, and most of the time the rules with the highest cost have the highest discrimination accuracy. Therefore, when the discrimination accuracy of a rule with a lower cost is greater than the discrimination accuracy of the rule with the highest cost, the rule can be assessed as being better than the rule with the highest cost.

[0055] For the second rule set to the N-1th rule set among the N rule sets, the rules included in each rule set are tested sequentially to determine the accuracy of the network attack behavior whose determination accuracy of the previous rule set is less than the accuracy threshold.

[0056] In response to determining that the accuracy of the rule included in any one of the second rule set to the N-1th rule set in distinguishing network attack behaviors is greater than or equal to the accuracy threshold, the rule is added to the network attack defense model.

[0057] In this embodiment, for rules whose accuracy meets the accuracy threshold requirement when discriminating network attack behaviors, the rules are directly added to the network attack defense model, and the discrimination accuracy of the network attack behaviors corresponding to the rules in other rule sets is no longer tested. For network attack behaviors whose accuracy does not meet the accuracy threshold requirement when discriminating network attack behaviors, the accuracy of the rules when discriminating the network attack behaviors continues to be tested in subsequent rule sets until the accuracy of the corresponding rules meets the accuracy threshold requirement or when the N-1th rule set is tested, the accuracy of the rules in the N-1th rule set still does not meet the accuracy threshold requirement.

[0058] According to the N-1th rule set, the network attack behavior whose accuracy is less than the accuracy threshold is determined, and the corresponding rules included in the Nth rule set are added to the network attack defense model.

[0059] In this embodiment, for network attack behaviors whose accuracy of the rules in the N-1th rule set still does not meet the accuracy threshold requirement, the corresponding rules in the Nth rule set are directly added to the network attack defense model.

[0060] In this way, through multi-level testing, the network attack defense model obtained is composed of low-cost rules as much as possible, which can reduce the cost of identifying network attack behaviors and identify network attack behaviors more quickly, so as to take defensive measures against network attack behaviors as early as possible.

[0061] As an optional embodiment, obtaining network attack behavior information includes:

[0062] Obtain a list of threats to information assets.

[0063] In this embodiment, the information asset threat list is obtained according to the actual situation of the user.

[0064] Obtain network attack behavior information based on the information asset threat list.

[0065] In this embodiment, the network attack behavior information is obtained based on the information asset threat list, that is, based on the actual situation of the user.

[0066] In this way, the network attack behavior information only includes network attack behaviors that the user may encounter and that are threatening to the user. The network attack behavior information is prevented from including network attack behaviors that the user will not encounter or will not threaten the user, thereby avoiding reducing the accuracy of the obtained network attack defense model and avoiding increasing the cost of the network attack defense model.

[0067] As an optional embodiment, obtaining an information asset threat list includes:

[0068] Get information asset information.

[0069] In this embodiment, information asset information is obtained by referring to the OCATVE method, that is, information about important information assets, security requirements and threats, and current organizational structure strengths and vulnerabilities is obtained from senior managers, actual operation areas, and ordinary members and IT members in the actual operation areas, thereby obtaining information asset information.

[0070] Based on the information asset information, a list of information asset threats is obtained.

[0071] In this embodiment, the information asset threat list may include network attack threats faced by the information assets.

[0072] In this way, the corresponding information asset threat list is obtained through the user's actual information asset information, so that the network attack defense model obtained according to the information asset threat list is adapted to the user's actual situation, thereby improving the defense effect of the network attack defense model.

[0073] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a network attack defense model establishment device.

[0074] Figure 2 A schematic diagram of a network attack defense model establishment device according to an embodiment of the present application is shown.

[0075] refer to Figure 2 , a network attack defense model building device, comprising:

[0076] The network attack behavior information acquisition module is used to obtain network attack behavior information.

[0077] The feature acquisition module is used to acquire at least two levels of features of the network attack behavior according to the network attack behavior information.

[0078] The training set acquisition module is used to obtain at least two training sets according to at least two levels of features.

[0079] The rule set acquisition module is used to obtain at least two rule sets according to at least two training sets.

[0080] The network attack defense model building module is used to filter and combine the rules in at least two rule sets to obtain a network attack defense model.

[0081] For the convenience of description, the above device is described by dividing it into various modules according to its functions. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0082] The device of the above embodiment is used to implement the corresponding network attack defense model establishment method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0083] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for establishing a network attack defense model described in any of the above-mentioned embodiments is implemented.

[0084] Figure 3 A more specific server hardware structure diagram provided in this embodiment is shown, and the server may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the internal communication of the device.

[0085] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0086] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.

[0087] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured as a component in the server (not shown in the figure), or it can be externally connected to the server to provide corresponding functions. The input device can include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device can include a display, a speaker, a vibrator, an indicator light, etc.

[0088] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the server and other devices. The communication module can realize communication through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0089] The bus 1050 comprises a path for transmitting information between various components of the server (eg, the processor 1010 , the memory 1020 , the input / output interface 1030 , and the communication interface 1040 ).

[0090] It should be noted that, although the above electronic device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the electronic device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above electronic device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.

[0091] The electronic device of the above-mentioned embodiment is used to implement the corresponding network attack defense model establishment method in any of the above-mentioned embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0092] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the network attack defense model establishment method described in any of the above embodiments.

[0093] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0094] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the network attack defense model establishment method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0095] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.

[0096] Although the present application has been described in conjunction with specific embodiments thereof, many alternatives, modifications and variations of these embodiments will be apparent to those skilled in the art in light of the foregoing description.

[0097] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of the present application.

Claims

1. A method for establishing a network attack defense model, characterized in that: include: Obtain information about network attack behaviors; Acquire at least two levels of features of the network attack behavior according to the network attack behavior information; According to the at least two levels of features, at least two training sets are obtained; the at least two levels of features include N levels of features arranged from low to high in judgment cost, wherein N is a positive integer greater than 1; the at least two training sets include N training sets arranged from small to large in number of features; Obtaining at least two rule sets according to the at least two training sets, including: inputting the N training sets into a rule extraction algorithm respectively to obtain N rule sets arranged in sequence corresponding to the N training sets; Filtering the rules in the at least two rule sets and combining them to obtain a network attack defense model; The method further includes screening the rules in the N rule sets by the following method to combine and obtain a network attack defense model: Testing the accuracy of the rules included in the first rule set of the N rule sets in distinguishing the network attack behavior; In response to determining that the accuracy of the rule included in the first rule set in discriminating the network attack behavior is greater than or equal to an accuracy threshold, adding the rule to the network attack defense model; For the second rule set to the N-1th rule set in the N rule sets, sequentially test the rules included in each rule set to determine the accuracy of the network attack behavior for which the determination accuracy of the previous rule set is less than the accuracy threshold; In response to determining that the accuracy of the rule included in any one of the second rule set to the N-1th rule set in discriminating the network attack behavior is greater than or equal to an accuracy threshold, adding the rule to the network attack defense model; The network attack behavior whose accuracy is less than the accuracy threshold is determined according to the N-1th rule set, and the corresponding rules included in the Nth rule set are added to the network attack defense model.

2. The model building method according to claim 1, characterized in that: The method further comprises obtaining the N training sets by the following method: For the N training sets arranged from small to large in number of features, any one of the training sets is obtained based on all features whose levels are less than or equal to the training set sequence number.

3. The model building method according to claim 1, characterized in that: The obtaining of network attack behavior information includes: Obtain a list of threats to information assets; The network attack behavior information is obtained according to the information asset threat list.

4. The model building method according to claim 3, characterized in that: The obtaining of the information asset threat list includes: Obtain information about information assets; The information asset threat list is obtained according to the information asset information.

5. The model building method according to claim 1, characterized in that: The rule extraction algorithms include RIPPER algorithm and C4.5 algorithm.

6. A network attack defense model establishment device, characterized in that: include: A network attack behavior information acquisition module is used to acquire network attack behavior information; A feature acquisition module, used to acquire at least two levels of features of the network attack behavior according to the network attack behavior information; A training set acquisition module, configured to obtain at least two training sets according to the at least two levels of features; the at least two levels of features include N levels of features arranged from low to high in judgment cost, wherein N is a positive integer greater than 1; the at least two training sets include N training sets arranged from small to large in number of features; A rule set acquisition module, used to obtain at least two rule sets according to the at least two training sets, including: inputting the N training sets into a rule extraction algorithm respectively to obtain N rule sets arranged in sequence corresponding to the N training sets; A network attack defense model building module, used for screening the rules in the at least two rule sets for combination to obtain a network attack defense model; The device also includes: Testing the accuracy of the rules included in the first rule set of the N rule sets in distinguishing the network attack behavior; In response to determining that the accuracy of the rule included in the first rule set in discriminating the network attack behavior is greater than or equal to an accuracy threshold, adding the rule to the network attack defense model; For the second rule set to the N-1th rule set in the N rule sets, sequentially test the rules included in each rule set to determine the accuracy of the network attack behavior for which the determination accuracy of the previous rule set is less than the accuracy threshold; In response to determining that the accuracy of the rule included in any one of the second rule set to the N-1th rule set in discriminating the network attack behavior is greater than or equal to an accuracy threshold, adding the rule to the network attack defense model; The network attack behavior whose accuracy is less than the accuracy threshold is determined according to the N-1th rule set, and the corresponding rules included in the Nth rule set are added to the network attack defense model.

7. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 5 when executing the program.

8. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions for causing a computer to execute the method according to any one of claims 1 to 5.