A data transmission threat detection method and system based on AI

By combining rule matching, nearest neighbor algorithm and decision tree algorithm in the data transmission threat detection system, the detection logic is optimized, which solves the problem of insufficient flexibility and false positives and false negatives of the traditional system, and achieves more efficient and accurate threat detection.

CN117938496BActive Publication Date: 2024-09-17JIANGSU DONGYUN CLOUD COMPUTING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410097918.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-24
Publication Date
2024-09-17
Estimated Expiration
2044-01-24

AI Technical Summary

Technical Problem

Traditional data transmission threat detection systems lack flexibility and adaptability, are difficult to catch unknown attacks, and are prone to false positives and false negatives, resulting in insufficient defense capabilities and overburdened security teams.

Method used

Adopt an AI-based data transmission threat detection system, including a rule matching module, a nearest neighbor algorithm model module and a result analysis module, to detect anomalies through data filtering, structured transformation, Euclidean distance calculation and majority voting principle, and use decision trees Algorithms optimize results to reduce false positives and false negatives.

Benefits of technology

It improves the efficiency and accuracy of network threat detection, can detect various types of threats more comprehensively, reduces false positives and negatives, and enables real-time response and self-adjustment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117938496B
    Figure CN117938496B
Patent Text Reader

Abstract

The present invention relates to the technical field of data transmission threat detection, specifically a data transmission threat detection method and system based on AI drive, including a rule matching module, a nearest neighbor algorithm model module and a result analysis module. In the present invention, the rule matching module collects data packet information through a network monitoring device, filters irrelevant information, reconstructs sessions and performs structured conversion on the collected data, and compares it with the signatures and rules in the data rule library, marks the successfully matched data as abnormal, and outputs the structured data and the matching results, the nearest neighbor algorithm model module extracts data features from the data packet information, uses the nearest neighbor algorithm to perform abnormality detection, and outputs the confidence and abnormal results, and the result analysis module compares the output results in the rule matching module and the nearest neighbor algorithm model module, and determines the final result and optimization processing according to the comparison results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data transmission threat detection, and specifically to an AI-driven data transmission threat detection method and system. Background Art

[0002] Traditional data transmission threat detection systems mainly rely on static means for security protection. Usually, these systems have a rule base that contains the characteristics and signatures of various known threats. In this way, when network traffic passes through the monitoring point, the system will check whether each data packet matches a rule in the rule base. If a match is found, the system considers that a potential threat has been detected and triggers an alarm. In addition, some traditional methods also use predefined thresholds to determine whether network behavior is abnormal. For example, a sudden increase in traffic may indicate the occurrence of a denial of service attack.

[0003] However, a major disadvantage of traditional methods is the lack of flexibility and adaptability. With the rapid development of the network environment and the continuous evolution of attack methods, new threats are difficult to be captured in a timely manner by static rule bases. This makes traditional systems lack the ability to defend against unknown attacks. Once the rule base needs to be updated, it usually requires manual intervention, which is not only time-consuming and labor-intensive, but also difficult to respond in real time.

[0004] In addition, due to the reliance on fixed rules or thresholds, traditional methods are prone to high false positive rates. This is because the rules may mistakenly mark legitimate network behaviors as threats, resulting in a large number of false alarms, which increases the burden on security teams. At the same time, strict matching rules can also lead to false negatives, and some clever attacks may be designed to circumvent these rules and thus be successfully executed without triggering alarms. Summary of the invention

[0005] The purpose of the present invention is to provide an AI-driven data transmission threat detection method and system to solve the problems raised in the above background technology.

[0006] To achieve the above objectives, one of the objectives of the present invention is to provide an AI-driven data transmission threat detection system, which includes a rule matching module, a nearest neighbor algorithm model module and a result analysis module, wherein:

[0007] The rule matching module collects data packet information through network monitoring equipment, filters irrelevant information, reconstructs sessions and performs structural conversion on the collected data, and compares it with the signatures and rules in the data rule library, marks the successfully matched data as abnormal, and outputs the structured data and matching results;

[0008] The nearest neighbor algorithm model module extracts data features from data packet information, uses the nearest neighbor algorithm to perform anomaly detection, finds K nearest neighbors by calculating the Euclidean distance between the sample to be analyzed and the sample in the training set, and applies the majority voting principle to determine whether the sample is abnormal and the prediction confidence, where K represents the number of nearest neighbors considered when performing classification and regression, and outputs the confidence and abnormality results;

[0009] The result analysis module compares the output results in the rule matching module and the nearest neighbor algorithm model module, and when they are consistent, determines the prediction result as the final result;

[0010] When the comparison is inconsistent, the structured data in the rule matching module and the confidence in the nearest neighbor algorithm model module are integrated with the original input data. The result analysis module uses a decision tree algorithm to predict whether the result is abnormal, and compares the prediction result with the output results in the rule matching module and the nearest neighbor algorithm model module respectively. According to the comparison results, the rule matching module and the nearest neighbor algorithm model module are optimized respectively. After the optimization, the result prediction and comparison are performed again according to the previous logic until the final result is determined.

[0011] As a further improvement of the present technical solution, the rule matching module includes a transmission data acquisition unit and a transmission data analysis unit. The transmission data acquisition unit collects data packet information through a network monitoring device; the transmission data analysis unit filters irrelevant information, reconstructs sessions and performs structured conversion on the collected data, and compares the data with signatures and rules in a data rule library. Successfully matched data is marked as abnormal, and the structured data and matching results are output.

[0012] As a further improvement of the present technical solution, the nearest neighbor algorithm model module includes a transmission data processing unit and a nearest neighbor algorithm analysis unit, the transmission data processing unit extracts data features from the data packet information; the nearest neighbor algorithm analysis unit uses the nearest neighbor algorithm to perform anomaly detection, calculates the Euclidean distance between the sample to be analyzed and the sample in the training set, finds K nearest neighbors, and applies the majority voting principle to judge whether the sample is abnormal and the prediction confidence, where K represents the number of nearest neighbors considered when performing classification and regression, and outputs the confidence and whether the result is abnormal.

[0013] As a further improvement of the present technical solution, the result analysis module includes a result comparison unit, a result determination unit and a feedback optimization unit. The result comparison unit compares the prediction results in the transmission data analysis unit and the nearest neighbor algorithm analysis unit. When they are consistent, the prediction result is determined to be the final result; when they are inconsistent, the structured data in the transmission data analysis unit in the comparison rule matching module and the confidence in the nearest neighbor algorithm analysis unit are integrated with the original input data, and the integrated data is sent to the result determination unit; the result determination unit uses a decision tree algorithm to predict the result of the data state, compares the predicted result with the prediction results in the transmission data analysis unit and the nearest neighbor algorithm analysis unit, respectively, and starts the feedback optimization unit for optimization processing according to the comparison result.

[0014] As a further improvement of the technical solution, the nearest neighbor algorithm analysis unit uses the nearest neighbor algorithm to perform anomaly detection, specifically including:

[0015] Calculate the distance between the extracted data features and all samples in the training data set. The calculation formula includes the Euclidean distance. According to the calculated distance, select the K nearest neighbors, check the labels of the neighbors, and determine the classification of the new sample based on the majority voting principle. When most neighbors are abnormal data, the extracted data features are marked as abnormal, where K represents the number of nearest neighbors considered when performing classification and regression.

[0016] As a further improvement of the technical solution, the result determination unit uses a decision tree algorithm to predict the result of the data state, specifically including:

[0017] Calculate the entropy of the entire data set. Entropy is a measure of data impurity and determines how much randomness exists in the data. For each class in the data set, calculate the product of the probability of occurrence and the logarithm of this probability. Add all these products and take the negative value.

[0018] For each feature in the data set, the data set is divided into several subsets according to the different values ​​of the feature, and the entropy of each subset is calculated. The weighted sum is taken by the size of each subset to obtain the overall entropy after the data set is divided by this feature.

[0019] Information gain is equal to the difference between the original entropy of the data set and the conditional entropy after partitioning according to the feature. The difference indicates the degree to which the randomness of the data is reduced by considering this feature;

[0020] Compare the information gain of all features and select the feature with the largest information gain as the split point;

[0021] Split the dataset using the selected features and repeat the above process for each subset until all instances belong to the same category.

[0022] As a further improvement of the technical solution, the result determination unit starts the feedback optimization unit to perform optimization processing according to the comparison result, specifically including:

[0023] When the prediction result of the result determination unit is different from that of the comparison transmission data analysis unit, the feedback optimization unit optimizes the data in the transmission data analysis unit in the rule matching module by standardizing the data, calculating the covariance matrix, solving the eigenvalues ​​and eigenvectors, selecting eigenvectors to form a new feature space, and transforming the original data into a low-dimensional space through these vectors, maintaining the maximum degree of data variance, simplifying the complexity of the data set and highlighting the main structure of the data for optimization processing;

[0024] When the prediction result of the result determination unit is different from that of the nearest neighbor algorithm analysis unit, the feedback optimization unit adjusts the K value in the nearest neighbor algorithm analysis unit and optimizes the model by increasing the K value. The size of the K value determines the model's sensitivity to noise and its robustness to outliers.

[0025] The second object of the present invention is to provide a method for a data transmission threat detection system based on AI drive, comprising the following method steps:

[0026] S1. The rule matching module collects data packet information through network monitoring equipment, filters irrelevant information, reconstructs sessions and performs structural conversion on the collected data, and compares it with the signatures and rules in the data rule library. The successfully matched data is marked as abnormal, and the structured data and matching results are output;

[0027] S2, the nearest neighbor algorithm model module extracts data features from the data packet information, uses the nearest neighbor algorithm to detect anomalies, calculates the Euclidean distance between the sample to be analyzed and the sample in the training set, finds the K nearest neighbors, and applies the majority voting principle to determine whether the sample is abnormal and the prediction confidence, where K represents the number of nearest neighbors considered during classification and regression, and outputs the confidence and abnormality results;

[0028] S3, the result analysis module compares the output results in the rule matching module and the nearest neighbor algorithm model module, and when they are consistent, determines the prediction result as the final result;

[0029] When there is inconsistency in the comparison, the structured data in the rule matching module and the confidence in the nearest neighbor algorithm model module are integrated with the original input data. The result analysis module uses the decision tree algorithm to predict whether the result is abnormal, and compares the prediction result with the output results in the rule matching module and the nearest neighbor algorithm model module respectively. According to the comparison results, the rule matching module and the nearest neighbor algorithm model module are optimized respectively. After the optimization, the result prediction and comparison are performed again according to the previous logic until the final result is determined.

[0030] Compared with the prior art, the present invention has the following beneficial effects:

[0031] 1. This AI-driven data transmission threat detection method and system collects data packet information through network monitoring equipment, filters irrelevant information, reconstructs sessions and performs structural conversion on the collected data, and compares it with the signatures and rules in the data rule library. The successfully matched data is marked as abnormal, and the structured data and matching results are output. Data features are extracted from the data packet information, and anomaly detection is performed using the nearest neighbor algorithm. The Euclidean distance between the sample to be analyzed and the sample in the training set is calculated to find the K nearest neighbors, and the majority voting principle is applied to determine whether the sample is abnormal and the prediction confidence, where K represents the number of nearest neighbors considered when performing classification and regression. The confidence and abnormality results are output, and the output results of the two are compared. When they are consistent, the prediction result is determined as the final result. Combining the two, various types of network threats can be detected more comprehensively, improving the overall detection efficiency and accuracy.

[0032] 2. When the AI-driven data transmission threat detection method and system are inconsistent, the structured data and confidence are integrated with the original input data, and the decision tree algorithm is used to predict whether the result is abnormal. The predicted result is compared with the output results of the two, and the two are optimized according to the comparison results. After the optimization, the results are predicted and compared again according to the previous logic until the final result is determined. It can continuously learn and adjust its own detection logic to better identify threats and reduce false positives and negatives. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 It is a schematic diagram of the overall module of the present invention;

[0034] Figure 2 It is a schematic diagram of each module unit of the present invention;

[0035] Figure 3 It is a schematic diagram of the overall method process of the present invention.

[0036] In the figure: 100, rule matching module; 101, transmission data acquisition unit; 102, transmission data analysis unit; 200, nearest neighbor algorithm model module; 201, transmission data processing unit; 202, nearest neighbor algorithm analysis unit; 300, result analysis module; 301, result comparison unit; 302, result determination unit; 303, feedback optimization unit. DETAILED DESCRIPTION

[0037] The following will be combined with the accompanying drawings in the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0038] See also Figure 1-3 One of the purposes of this embodiment is to provide an AI-driven data transmission threat detection system, including a rule matching module 100, a nearest neighbor algorithm model module 200 and a result analysis module 300.

[0039] The transmission data collection unit 101 in the rule matching module 100 uses network monitoring equipment to collect data packet information data in data transmission, including but not limited to source IP address, destination IP address, port number, protocol type and timestamp, etc., and sends the collected data to the transmission data analysis unit 102.

[0040] The transmission data analysis unit 102 performs rule matching on the collected data according to the known attack flags in the data rule base, specifically including:

[0041] The rule matching process is to match patterns on data streams to determine whether there are known attack behaviors. When implementing rule matching, the matching is performed by comparing the various signatures and rules indicating malicious activities contained in the data rule library;

[0042] Before the rule matching process begins, it is crucial to pre-process the data. Through data filtering and classification, irrelevant or duplicate information can be removed; through session reconstruction, data packets belonging to the same communication session are integrated to ensure that each session or flow is complete and an end-to-end communication session view is achieved; including parsing protocol data at different levels, extracting protocol-specific information such as request methods and paths, and standardizing and formatting key information such as source and destination IP addresses, ports, and protocol header contents into structured data to facilitate the matching of signatures and patterns in the rule base;

[0043] Convert the original data packet information into an analyzable structured form. The network data packet exists in a layered data protocol format. Each layer of the protocol (such as the Ethernet layer, the IP layer, the TCP / UDP layer, etc.) has its standard header structure. By identifying the protocol layer inside the data packet, the key information to be extracted is determined. After determining the key information to be extracted, such as the IP protocol layer, the field information in the header is parsed and extracted according to the standard structure of the protocol header of the layer. For example, in the IP protocol header, the source IP address, the destination IP address, etc. are extracted. The extracted original field data such as the IP address and the port number exist in binary form. The 32-bit binary IP address is converted into a decimal dot-separated format (such as 192.168.1.1), and the 16-bit binary port number is converted into a decimal value, so as to perform a structured conversion, and the structured data is used as the output of the transmission data analysis unit 102.

[0044] The structured data obtained by preprocessing is matched and compared with each rule in the rule library one by one. The rule is based on a specific string or byte sequence, and the corresponding part of the data packet content is used to match the rule; the rule is related to the IP address or port, and the IP address or port field of the extracted data packet is compared with the corresponding content of the rule; it is realized through conditional judgment, such as logical expression evaluation, when the extracted features meet the conditions defined by the rule, the rule is considered to be matched, otherwise, it is not matched, wherein a successful match means that the data is abnormal data, otherwise it is normal data, and the transmission data analysis unit 102 uses the matching result as the output of the unit;

[0045] The comparison process involves verifying several key indicators, including but not limited to frequent and abnormal access attempts, atypical port usage, and suspicious protocol behavior. For example, a typical port scanning behavior is defined as an IP address attempting to connect to 1,000 or more different ports of the same target IP within 10 minutes, and converting it into a rule, such as a "continuous connection attempt rule". The "continuous connection attempt rule" is applied to each of the above data packets to check the number of times the same source IP sends requests to different ports of the same target IP. That is, if the same source IP attempts to connect to 1,000 or more different ports within 10 minutes, it is determined that the port scanning behavior defined by the rule is matched.

[0046] The transmission data analysis unit 102 sends the structured data and the matching result as output results to the result comparison unit 301 in the result analysis module 300 .

[0047] The transmission data processing unit 201 in the nearest neighbor algorithm model module 200 extracts the transmission data features collected by the transmission data acquisition unit 101, including but not limited to data packet size, transmission frequency, traffic distribution and activity time, and sends the extracted data features to the nearest neighbor algorithm analysis unit 202.

[0048] The nearest neighbor algorithm analysis unit 202 uses the nearest neighbor algorithm to perform data anomaly judgment on the data features sent by the transmission data processing unit 201, specifically including:

[0049] Training data preparation: Use public databases to collect normal and abnormal behavior data of the network to construct training data sets. In order to reduce the impact of outliers and noise on the model, improve the robustness of the model to outliers, reduce interference with model training and prediction, and thus improve the performance and stability of the model, the mean and standard deviation of the feature columns in the training data are calculated, the original value is subtracted from the mean and then divided by the standard deviation, and the data is converted into a distribution with a mean of 0 and a standard deviation of 1, so that the feature weights remain balanced; and the training data sets are labeled as normal and abnormal;

[0050] Distance calculation: Calculate the distance between the data features extracted by the transmission data processing unit 201 and all samples in the training data set, and the calculation formula includes the Euclidean distance; select the K nearest neighbors based on the calculated distance, check the labels of these neighbors, and determine the classification of the new sample based on the "majority voting" principle; when the majority of neighbors belong to "abnormal" data, the new sample, i.e., the data features extracted by the transmission data processing unit 201, is marked as abnormal, where K represents the number of nearest neighbors considered when performing classification and regression;

[0051] Results and confidence prediction: Based on the calculated distance, select the K nearest neighbors. Check the labels of these neighbors and determine the classification of the new sample based on the "majority voting" principle; if most neighbors are "abnormal" data, the new sample is also marked as abnormal. The abnormal confidence is calculated based on the relationship between the number of neighbors marked as abnormal and K. For example, if K=5 is selected and 3 samples are marked as abnormal, the confidence of the abnormality can be 3 / 5 (i.e. 60%).

[0052] The nearest neighbor algorithm analysis unit 202 sends the predicted result and confidence level to the result comparison unit 301 in the result analysis module 300 .

[0053] The result comparison unit 301 compares the prediction results of the transmission data analysis unit 102 and the neighbor algorithm analysis unit 202. When they are consistent, that is, the prediction results of the transmission data analysis unit 102 and the neighbor algorithm analysis unit 202 are both normal or abnormal, the final result is determined;

[0054] When the comparison is inconsistent, the structured data in the comparison transmission data analysis unit 102 and the confidence in the nearest neighbor algorithm analysis unit 202 are integrated with the original input data, and the integrated data is sent to the result determination unit 302. The result determination unit 302 uses the decision tree algorithm to predict the result of the data state, specifically including:

[0055] Training data collection: Use public databases to collect training data. The data features of the training data are the data features of the integrated data, including original input data, structured data, and confidence.

[0056] Model construction: Calculate the entropy of the entire data set. Entropy represents a measure of data impurity and determines how much randomness exists in the data. For each category in the data set, calculate the product of the probability of occurrence and the logarithm of this probability, then add all these products and take the negative value; for each feature in the data set, divide the data set into several subsets according to the different values ​​of the feature, and calculate the entropy of each subset. Then, weight the sum of the sizes of each subset to obtain the overall entropy after the data set is divided by this feature; information gain is equal to the difference between the original entropy of the data set and the conditional entropy after the feature is divided. This difference indicates the degree to which the randomness of the data is reduced by considering this feature; compare the information gain of all features, and select the feature with the largest information gain as the split point; split the data set with the selected feature, and then repeat the above process for each subset until all instances belong to the same category;

[0057] Result prediction: Input the integrated data into the constructed model, starting from the root node, select the corresponding branch according to the eigenvalue and the judgment condition; after entering the next node, select the corresponding branch to enter the next node according to the judgment condition of the current node and the eigenvalue; from the root node to the leaf node, branch selection is performed according to the eigenvalue until the leaf node is reached. The leaf node corresponds to the result of whether the data is abnormal, and the result of whether the data is abnormal is output.

[0058] The result determination unit 302 compares the predicted result with the predicted results in the comparison transmission data analysis unit 102 and the nearest neighbor algorithm analysis unit 202, respectively, and starts the feedback optimization unit 303 to perform optimization processing according to the comparison result, specifically including:

[0059] When the prediction result of the result determination unit 302 is different from that of the comparison transmission data analysis unit 102, the feedback optimization unit 303 optimizes the data in the transmission data analysis unit 102 by standardizing the data, calculating the covariance matrix, solving the eigenvalues ​​and eigenvectors, and then selecting the eigenvectors to form a new feature space, and transforming the original data into a low-dimensional space through these vectors, maintaining the maximum degree of data variance, thereby simplifying the complexity of the data set and highlighting the main structure of the data;

[0060] When the prediction result of the result determination unit 302 is different from that of the nearest neighbor algorithm analysis unit 202, the feedback optimization unit 303 adjusts the K value in the nearest neighbor algorithm analysis unit 202. A smaller K value makes the model sensitive to noise, while a larger K value may cause the model to be too robust to abnormal values. The model is optimized by increasing or decreasing the K value.

[0061] After the optimization process, the results are predicted and compared again according to the previous logic until the final result is determined.

[0062] The second objective of this embodiment is to provide a method for a data transmission threat detection system based on AI drive, including the following method steps:

[0063] S1. The rule matching module 100 collects data packet information through the network monitoring device, filters irrelevant information, reconstructs the session and performs structured conversion on the collected data, and compares it with the signatures and rules in the data rule library, marks the successfully matched data as abnormal, and outputs the structured data and matching results;

[0064] S2, the nearest neighbor algorithm model module 200 extracts data features from the data packet information, uses the nearest neighbor algorithm to detect anomalies, calculates the Euclidean distance between the sample to be analyzed and the sample in the training set, finds the K nearest neighbors, and applies the majority voting principle to determine whether the sample is abnormal and the prediction confidence, where K represents the number of nearest neighbors considered when performing classification and regression, and outputs the confidence and abnormality results;

[0065] S3, the result analysis module 300 compares the output results of the rule matching module 100 and the nearest neighbor algorithm model module 200, and when they are consistent, determines the prediction result as the final result;

[0066] When there is inconsistency in the comparison, the structured data in the rule matching module 100 and the confidence in the neighbor algorithm model module 200 are integrated with the original input data, and the result analysis module 300 uses the decision tree algorithm to predict whether the result is abnormal, and compares the prediction result with the output results in the rule matching module 100 and the neighbor algorithm model module 200 respectively. According to the comparison results, the rule matching module 100 and the neighbor algorithm model module 200 are optimized respectively. After the optimization, the result prediction and comparison are performed again according to the previous logic until the final result is determined.

[0067] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and descriptions are only preferred examples of the present invention and are not intended to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims

1. An AI-driven data transmission threat detection system, characterized by: It comprises a rule matching module (100), a nearest neighbor algorithm model module (200) and a result analysis module (300), wherein: The rule matching module (100) collects data packet information through a network monitoring device, filters irrelevant information, reconstructs sessions and performs structural conversion on the collected data, and compares the collected data with signatures and rules in a data rule library, marks successfully matched data as abnormal, and outputs structured data and matching results; The nearest neighbor algorithm model module (200) extracts data features from data packet information, performs anomaly detection using the nearest neighbor algorithm, finds K nearest neighbors by calculating the Euclidean distance between the sample to be analyzed and the sample in the training set, and uses the majority voting principle to determine whether the sample is abnormal and the prediction confidence, wherein K represents the number of nearest neighbors considered when performing classification and regression, and outputs the confidence and abnormality results; The result analysis module (300) compares the output results of the rule matching module (100) and the nearest neighbor algorithm model module (200), and when they are consistent, determines the prediction result as the final result; When the comparison is inconsistent, the structured data in the rule matching module (100) and the confidence in the nearest neighbor algorithm model module (200) are integrated with the original input data, the result analysis module (300) uses a decision tree algorithm to predict whether the result is abnormal, and compares the prediction result with the output results in the rule matching module (100) and the nearest neighbor algorithm model module (200), respectively, and optimizes the rule matching module (100) and the nearest neighbor algorithm model module (200) according to the comparison result. After the optimization process, the result prediction and comparison are performed again according to the previous logic until the final result is determined; The rule matching module (100) comprises a transmission data collection unit (101) and a transmission data analysis unit (102), wherein the transmission data collection unit (101) collects data packet information through a network monitoring device; the transmission data analysis unit (102) filters irrelevant information, reconstructs sessions and performs structural conversion on the collected data, and compares the collected data with signatures and rules in a data rule library, marks successfully matched data as abnormal, and outputs the structured data and matching results; The nearest neighbor algorithm model module (200) comprises a transmission data processing unit (201) and a nearest neighbor algorithm analysis unit (202), wherein the transmission data processing unit (201) extracts data features from data packet information; the nearest neighbor algorithm analysis unit (202) uses the nearest neighbor algorithm to perform anomaly detection, calculates the Euclidean distance between the sample to be analyzed and the sample in the training set, finds K nearest neighbors, and applies the majority voting principle to respectively determine whether the sample is abnormal and the prediction confidence, wherein K represents the number of nearest neighbors considered when performing classification and regression, and outputs the confidence and abnormality results; The result analysis module (300) comprises a result comparison unit (301), a result determination unit (302) and a feedback optimization unit (303); the result comparison unit (301) compares the prediction results in the transmission data analysis unit (102) and the nearest neighbor algorithm analysis unit (202); when they are consistent, the prediction result is determined to be the final result; when they are inconsistent, the structured data in the transmission data analysis unit (102) in the rule matching module (100) and the confidence in the nearest neighbor algorithm analysis unit (202) are integrated with the original input data, and the integrated data is sent to the result determination unit (302); the result determination unit (302) uses a decision tree algorithm to predict the result of the data state, compares the predicted result with the prediction result of the transmission data analysis unit (102) and the prediction result in the nearest neighbor algorithm analysis unit (202), and starts the feedback optimization unit (303) to perform optimization processing according to the comparison result; The result determination unit (302) uses a decision tree algorithm to predict the result of the data state, specifically including: Calculate the entropy of the entire data set. Entropy is a measure of data impurity and determines how much randomness exists in the data. For each class in the data set, calculate the product of the probability of occurrence and the logarithm of this probability. Add all these products and take the negative value. For each feature in the data set, the data set is divided into several subsets according to the different values ​​of the feature, and the entropy of each subset is calculated. The weighted sum is taken by the size of each subset to obtain the overall entropy after the data set is divided by this feature. Information gain is equal to the difference between the original entropy of the data set and the conditional entropy after partitioning according to the feature. The difference indicates the degree to which the randomness of the data is reduced by considering this feature; Compare the information gain of all features and select the feature with the largest information gain as the split point; Split the dataset using the selected features and repeat the above process for each subset until all instances belong to the same category; The result determination unit (302) starts the feedback optimization unit (303) to perform optimization processing according to the comparison result, which specifically includes: When the prediction result of the result determination unit (302) is different from the prediction result of the transmission data analysis unit (102), the feedback optimization unit (303) optimizes the data in the transmission data analysis unit (102) in the rule matching module (100), by standardizing the data, calculating the covariance matrix, solving the eigenvalues ​​and eigenvectors, selecting eigenvectors to form a new feature space, and transforming the original data into a low-dimensional space through these vectors, thereby maintaining the maximum data variance, simplifying the complexity of the data set and highlighting the main structure of the data for optimization processing; When the prediction result of the result determination unit (302) is different from the prediction result of the nearest neighbor algorithm analysis unit (202), the feedback optimization unit (303) adjusts the K value in the nearest neighbor algorithm analysis unit (202) and optimizes the model by increasing the K value. The size of the K value determines the sensitivity of the model to noise and its robustness to abnormal values.

2. The AI-driven data transmission threat detection system according to claim 1, characterized in that: The nearest neighbor algorithm analysis unit (202) performs anomaly detection using the nearest neighbor algorithm, specifically including: Calculate the distance between the extracted data features and all samples in the training data set. The calculation formula includes the Euclidean distance. According to the calculated distance, select the K nearest neighbors, check the labels of the neighbors, and determine the classification of the new sample based on the majority voting principle. When most neighbors are abnormal data, the extracted data features are marked as abnormal, where K represents the number of nearest neighbors considered when performing classification and regression.

3. A method for using the AI-driven data transmission threat detection system according to any one of claims 1-2, characterized in that: The method comprises the following steps: S1, the rule matching module (100) collects data packet information through a network monitoring device, filters irrelevant information, reconstructs sessions and performs structural conversion on the collected data, and compares the collected data with signatures and rules in a data rule library, marks successfully matched data as abnormal, and outputs the structured data and matching results; S2, the nearest neighbor algorithm model module (200) extracts data features from the data packet information, uses the nearest neighbor algorithm to perform anomaly detection, calculates the Euclidean distance between the sample to be analyzed and the sample in the training set, finds K nearest neighbors, and applies the majority voting principle to determine whether the sample is abnormal and the prediction confidence, where K represents the number of nearest neighbors considered when performing classification and regression, and outputs the confidence and abnormality results; S3, the result analysis module (300) compares the output results of the rule matching module (100) and the nearest neighbor algorithm model module (200), and when they are consistent, determines the prediction result as the final result; When the comparison is inconsistent, the structured data in the rule matching module (100) and the confidence in the nearest neighbor algorithm model module (200) are integrated with the original input data, and the result analysis module (300) uses a decision tree algorithm to predict whether the result is abnormal, and compares the prediction result with the output results in the rule matching module (100) and the nearest neighbor algorithm model module (200), respectively. According to the comparison results, the rule matching module (100) and the nearest neighbor algorithm model module (200) are optimized respectively. After the optimization, the result prediction and comparison are performed again according to the previous logic until the final result is determined.