Network malicious behavior message backtracking generation method and system based on information guidance
By extracting feature and detecting the original traffic data of network nodes, a multi-level correlation network is built, which solves the problem of difficult to identify network malicious behavior and backtracking paths in the existing technology, and achieves efficient protection of power grid network security.
Patent Information
- Application Number
- CN202510679371.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2025-08-29
AI Technical Summary
Existing network security protection methods are difficult to accurately identify the specific attack stage and association of network malicious behavior, and it is difficult to quickly and accurately trace the message path, resulting in difficulty in emergency response and traceability investigation of network security incidents.
The original traffic data of the target network node is collected, transmission feature extraction process is performed, the protocol identification distribution characteristics and interaction timing trajectory characteristics are generated, and the abnormal traffic detection model is used for judgment, a multi-level correlation network is built to generate a malicious behavioral message backtracking chain.
It improves the accuracy of malicious behavior detection and network security protection efficiency, and can quickly and accurately identify the source and propagation path of the attack, helping power grid network security personnel take timely response measures.
Smart Images

Figure CN120567466A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network security technology, and in particular to an information-oriented network malicious behavior message backtracing generation method and system. Background Art
[0002] In today's digital age of power grids, networks have become an integral part of people's lives and work. With the rapid development of network technology, cyberattacks are becoming increasingly rampant, causing significant losses to power grids. Malicious cyberattacks are concealed, complex, and diverse, making traditional network security measures ineffective in combating them.
[0003] Currently, the detection and analysis of malicious network activity primarily relies on monitoring and analyzing network traffic. However, existing technologies typically simply detect abnormal patterns in traffic, making it difficult to accurately identify the specific attack stages and correlations of malicious activity. Furthermore, after detecting malicious traffic, it is difficult to quickly and accurately trace the message path to determine the attack source and propagation path. This significantly complicates emergency response and investigation of cybersecurity incidents. Summary of the Invention
[0004] In view of the above-mentioned problems, in combination with the first aspect of the present invention, an embodiment of the present invention provides an information-oriented network malicious behavior message backtracing generation method, the method comprising:
[0005] Collecting an original traffic data set of a target network node, wherein the original traffic data set includes multiple sets of communication protocol identifiers and corresponding payload content sequences;
[0006] Performing transmission feature extraction processing on the original traffic data set to obtain protocol identification distribution features and interaction time sequence trajectory features of the payload content sequence;
[0007] Based on the protocol identifier distribution feature and the interaction time series trajectory feature, an abnormal traffic detection model is called, and malicious behavior determination processing is performed on the original traffic data set by the abnormal traffic detection model to obtain abnormal traffic data and a corresponding attack stage label sequence;
[0008] Performing behavior feature vector mapping processing on the abnormal traffic data according to the attack phase label sequence to generate a behavior feature vector set of the target packet cluster;
[0009] A multi-level association network is constructed based on the behavior feature vector set, and message backtracking path generation processing is performed on the target message cluster through the multi-level association network to output a malicious behavior message backtracking chain.
[0010] On the other hand, an embodiment of the present invention also provides an information-guided network malicious behavior message backtracing generation system, including a processor and a machine-readable storage medium, the machine-readable storage medium is connected to the processor, the machine-readable storage medium is used to store programs, instructions or codes, and the processor is used to execute the programs, instructions or codes in the machine-readable storage medium to implement the above method.
[0011] Based on the above aspects, the embodiment of the present invention collects the original traffic data of the target network node and performs transmission feature extraction processing, which can comprehensively obtain the protocol identification distribution characteristics and interaction timing trajectory characteristics of the load content sequence, and calls the abnormal traffic detection model for judgment based on the protocol identification distribution characteristics and interaction timing trajectory characteristics. It can more accurately identify abnormal traffic data and the corresponding attack stage label sequence, thereby improving the accuracy of malicious behavior detection. The abnormal traffic data is mapped to a behavioral feature vector according to the attack stage label sequence, and the generated behavioral feature vector set can more comprehensively reflect the characteristics of malicious behavior. Based on the behavioral feature vector set, a multi-level association network is constructed and a message backtracing path generation process is performed, which can quickly and accurately output the malicious behavior message backtracing chain, which helps the network security personnel of the power grid to timely understand the source and propagation path of the attack, so as to take effective countermeasures, thereby greatly improving the efficiency and accuracy of network security protection. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 It is a schematic diagram of the execution flow of the information-oriented network malicious behavior message backtracing generation method provided by an embodiment of the present invention.
[0013] Figure 2 It is a schematic diagram of exemplary hardware and software components of the information-oriented network malicious behavior message backtracing generation system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0014] The present invention will be described in detail below with reference to the accompanying drawings. Figure 1 This is a flow chart of an information-guided network malicious behavior message backtracing generation method provided by an embodiment of the present invention. The information-guided network malicious behavior message backtracing generation method is introduced in detail below.
[0015] Step S110: collecting an original traffic data set of a target network node, wherein the original traffic data set includes multiple groups of communication protocol identifiers and corresponding payload content sequences.
[0016] In the power grid, target network nodes include servers in the grid dispatch center, smart meters and relay protection devices in substations, and inverter communication modules in distributed energy access points. To collect raw traffic data, network traffic collection equipment is deployed at the network interfaces of these nodes. For example, a network splitter is connected to the network interface of a server in the grid dispatch center, which proportionally copies the network traffic flowing through that interface to the traffic collection equipment.
[0017] Traffic collection devices sample network traffic at fixed intervals based on pre-set sampling rules. During the sampling process, they parse each collected data packet. Different communication protocols use different identification methods to determine the protocol identifier. For the IEC60870-5-104 protocol, the device checks the packet header for specific start characters, such as 0x68, and then verifies that the length and control fields comply with the protocol specifications. For the Modbus protocol, the device identifies the slave address and function code.
[0018] At the same time, the traffic collection device records the payload content sequence corresponding to each data packet. Under the IEC60870-5-104 protocol, the payload content sequence may include telemetry data, such as analog quantities like voltage, current, and power, as well as telesignaling data, such as switch status and switch position. Under the Modbus protocol, the payload content sequence may be the data value in a register. Over time, the traffic collection device continuously collects data, ultimately forming a raw traffic data set containing multiple sets of communication protocol identifiers and corresponding payload content sequences.
[0019] Step S120: performing transmission feature extraction processing on the original traffic data set to obtain protocol identification distribution features and interaction timing trajectory features of the payload content sequence.
[0020] In order to mine valuable transmission features from the raw traffic data set, a series of processing is required. The specific steps are as follows:
[0021] Step S121: performing protocol analysis framework loading processing on the original traffic data set to obtain a protocol analysis rule set corresponding to each communication protocol identifier.
[0022] In the traffic analysis system, the first step is to load the protocol parsing framework. This framework is a knowledge base that stores parsing rules for various power grid-related communication protocols. For example, in code implementation, the protocol parsing rules can be stored in a data structure, such as a Python dictionary.
[0023] The IEC60870-5-104 protocol's parsing rules set specifies the message format, field definitions, and encoding methods. The message format specifies the order of the start character, length field, control field, and application service data unit (ASDU). The field definitions clarify the meaning and function of each field, such as the start character marking the beginning of a message and the length field indicating the message length. The encoding method also describes the data encoding rules for each field, such as the possibility of binary encoding for the length field.
[0024] For the Modbus protocol, the parsing rules define the range of slave addresses, the meaning of function codes, and the length and format of the data field. Slave addresses are typically integers between 1 and 247. Different function codes represent different operations, such as 0x03 for reading a holding register. The length and format of the data field vary depending on the function code. Once the protocol parsing framework is loaded, the traffic analysis system can parse the different protocol messages in the raw traffic data according to these rules.
[0025] Step S122: traverse the payload content sequence, perform byte-by-byte matching processing on the header field of each payload content according to the protocol parsing rule set, and extract the protocol type identifier.
[0026] After loading the protocol parsing rule set, the traffic analysis system begins to traverse the payload content sequence in the original traffic data set. For each payload content, the traffic analysis system performs a byte-by-byte match starting from the header.
[0027] Taking the IEC 60870-5-104 protocol as an example, the traffic analysis system first checks whether the first byte is a specific start character, such as 0x68. If a match is found, the traffic analysis system then checks the subsequent length field. The length field typically occupies two bytes. The traffic analysis system combines these two bytes into an integer according to the protocol parsing rules to obtain the packet length. The traffic analysis system then parses the control field, which contains multiple bits, each representing a different meaning, such as the send sequence number or the receive sequence number. By parsing these bits, the traffic analysis system confirms whether the packet complies with the IEC 60870-5-104 protocol.
[0028] For the Modbus protocol, the traffic analysis system checks whether the first byte is a valid slave address, and then checks whether the second byte is a valid function code. If a match is found, the traffic analysis system extracts the protocol type identifier, indicating that the payload content belongs to the Modbus protocol. Through this byte-by-byte matching method, the traffic analysis system can accurately identify the protocol type corresponding to each payload content.
[0029] Step S123: constructing a protocol frequency histogram according to the distribution density of the protocol type identifier, and performing smoothing filtering on the protocol frequency histogram through a sliding window mechanism to generate a protocol identification distribution feature.
[0030] After extracting the protocol type identifiers from all payloads, the traffic analysis system begins constructing a protocol frequency histogram. The traffic analysis system uses a data structure, such as a dictionary, to count the number of times each protocol type identifier appears over a period of time. The dictionary key is the protocol type identifier, and the value is the number of times the protocol appears.
[0031] Assume that during the statistical time period, the number of occurrences of the IEC60870-5-104 protocol is recorded as A, the number of occurrences of the Modbus protocol is recorded as B, and the number of occurrences of other protocols is recorded as C. The traffic analysis system constructs a protocol frequency histogram with protocol type as the horizontal axis and frequency of occurrence as the vertical axis. This histogram intuitively shows the distribution of different protocols in the raw traffic data set.
[0032] To reduce noise and fluctuations in the data, the traffic analysis system uses a sliding window mechanism to smooth the protocol frequency histogram. The traffic analysis system sets a sliding window size, such as a fixed time interval T. Within each sliding window, the traffic analysis system calculates the average protocol frequency.
[0033] In practice, the traffic analysis system maintains a time window of length T, which slides forward over time. Within each window, the system counts the occurrences of each protocol and calculates the average. By continuously moving the window, the system smoothes the entire protocol frequency histogram. After smoothing and filtering, the resulting protocol identification distribution features more accurately reflect the usage frequency and distribution patterns of different protocols in the power grid.
[0034] Step S124: Perform timestamp field positioning processing on the payload content sequence, extract the sending timestamp and receiving timestamp of each payload content, calculate the transmission delay sequence based on the difference between the sending timestamp and the receiving timestamp, and use the time series segmentation algorithm to divide the transmission delay sequence into multiple continuous time windows.
[0035] In raw traffic data, each payload typically contains both a send and receive timestamp. Different protocols may place these timestamps in different locations. The traffic analysis system uses the previously loaded protocol parsing rules to accurately locate the send and receive timestamp fields in each payload.
[0036] For some protocols, the timestamp may be a separate field directly included in the packet; for other protocols, the timestamp may need to be calculated from other fields. For example, in some custom protocols, the timestamp may be calculated using the packet sequence number and a fixed transmission interval.
[0037] The traffic analysis system extracts the sending and receiving timestamps and calculates the difference between them to obtain the transmission delay of each payload content. The traffic analysis system arranges the transmission delays of all payload contents in chronological order to form a transmission delay sequence.
[0038] To further analyze the variations in transmission delay, the traffic analysis system uses a time series segmentation algorithm to divide the transmission delay sequence into multiple continuous time windows. The traffic analysis system can employ a fixed-length segmentation method, which divides the transmission delay sequence into multiple time windows of equal length at preset time intervals. For example, if the time interval is set to t, the traffic analysis system divides the transmission delay sequence into a time window with every t data points. Each time window contains a certain amount of transmission delay data, facilitating subsequent analysis of the local characteristics of the transmission delay.
[0039] Step S125: Count the transmission sequence dependencies between the payload contents in each time window, construct an interaction timing trajectory directed graph corresponding to the time window, and perform topological structure feature extraction processing on the interaction timing trajectory directed graph to generate interaction timing trajectory features.
[0040] Within each defined time window, the traffic analysis system calculates the transmission sequence dependencies between payload contents. In power grid communications, different devices have a specific communication sequence. For example, in a substation, smart meters periodically send data to a data acquisition terminal, which then forwards the data to the power grid dispatch center.
[0041] Based on these transmission order dependencies, the traffic analysis system constructs a directed graph of interaction time-series traces. The nodes in the graph represent different devices or communication entities, the edges represent the communication relationships between them, and the direction of the edges indicates the direction of data transmission. Edge weights can be set based on factors such as communication frequency and the amount of data transferred.
[0042] For example, within a time window, smart meter A sends data multiple times to data acquisition terminal B, and the traffic analysis system records the number of transmissions. In the directed graph of the interaction time series trajectory, there is an edge from node A to node B, and the edge weight is the number of transmissions. Similarly, if data acquisition terminal B sends data a certain number of times to the power grid dispatch center C, the graph will also contain an edge from node B to node C, and the edge weight is the corresponding number of transmissions.
[0043] After constructing the directed graph of interaction time series trajectories, the traffic analysis system extracts topological features. The topological features that the traffic analysis system can extract include node degrees (in-degree and out-degree), shortest path length, clustering coefficient, etc.
[0044] The degree of a node indicates the number of connections between it and other nodes. The in-degree indicates the number of edges pointing to the node, and the out-degree indicates the number of edges emanating from the node. The shortest path length indicates the length of the shortest communication path between two nodes. The clustering coefficient indicates how tightly connected a node's neighbors are.
[0045] The traffic analysis system generates interactive time-series trajectory features by extracting and analyzing these topological structure features, thereby reflecting the communication patterns and interaction rules between devices in the power grid.
[0046] Step S126: performing correlation index processing on the protocol identification distribution feature and the interaction time sequence trajectory feature, and storing them in a distributed traffic feature database.
[0047] After obtaining the protocol identifier distribution features and interaction time series trace features, the traffic analysis system performs correlation indexing on these two features. The traffic analysis system can use a hash index method, using the timestamp or unique identifier of the packet as the index key to correlate the protocol identifier distribution features and interaction time series trace features.
[0048] For example, the traffic analysis system generates a unique identifier for each time period's traffic data and associates the protocol identifier distribution characteristics and interaction time series trajectory characteristics corresponding to that time period with this identifier. This allows users to quickly locate the corresponding protocol identifier distribution characteristics and interaction time series trajectory characteristics when querying traffic characteristics for a specific time period.
[0049] After the correlation indexing is complete, the traffic analysis system stores the correlated feature data in a distributed traffic feature database. This distributed traffic feature database uses a distributed storage architecture, such as HBase or Cassandra, to improve data storage capacity and read / write performance. During storage, the traffic analysis system stores feature data according to predefined partitioning rules, such as by time range or data type, to facilitate subsequent data management and querying.
[0050] Step S130: calling an abnormal traffic detection model based on the protocol identifier distribution feature and the interaction time series trajectory feature, performing malicious behavior determination processing on the original traffic data set through the abnormal traffic detection model, and obtaining abnormal traffic data and a corresponding attack stage label sequence.
[0051] After obtaining the protocol identifier distribution characteristics and interaction time series trajectory characteristics, the traffic analysis system calls the abnormal traffic detection model to determine malicious behavior on the original traffic data set. The specific steps are as follows:
[0052] Step S131: Call the protocol feature encoder of the abnormal traffic detection model to perform context-aware encoding processing on the protocol identifier distribution feature to generate a multi-dimensional protocol feature vector; the protocol feature encoder is composed of a multi-layer convolutional neural network, and the size of the convolution kernel of each layer is aligned with the field length of the protocol identifier.
[0053] The protocol feature encoder in the abnormal traffic detection model is composed of a multi-layer convolutional neural network (CNN). The traffic analysis system inputs the protocol identification distribution features into the protocol feature encoder for context-aware encoding processing.
[0054] In CNN, the size of each convolution kernel is aligned with the length of the protocol identifier field. For example, if the length of a field in the protocol identifier is L, the corresponding convolution kernel size is also set to L. In this way, the convolution kernel can effectively extract local features from the distribution characteristics of the protocol identifier.
[0055] In the first convolutional layer, the convolution kernel performs a sliding convolution operation on the protocol identifier distribution features, generating multiple feature maps. Each feature map represents a different local feature of the protocol identifier distribution features. The feature maps are then transformed nonlinearly using an activation function (such as the ReLU function) to enhance the expressive power of the features.
[0056] Next, the traffic analysis system feeds the feature map output by the first convolutional layer into the next convolutional layer, repeating the convolution and activation operations. After multiple layers of convolution, the traffic analysis system obtains multiple feature maps of different scales.
[0057] Finally, the traffic analysis system concatenates and pools these feature maps to generate a multi-dimensional protocol feature vector. This multi-dimensional protocol feature vector contains rich contextual information about the protocol's distribution characteristics, which can better represent the characteristics and patterns of the protocol.
[0058] Step S132: Call the time series feature encoder of the abnormal traffic detection model to perform recurrent neural network encoding processing on the interactive time series trajectory features to generate a time series feature vector; the time series feature encoder includes a bidirectional long short-term memory network unit for capturing long-term dependencies between time windows.
[0059] The abnormal traffic detection model's time series feature encoder includes a bidirectional long short-term memory (Bi-LSTM) unit. The traffic analysis system inputs the interactive time series trajectory features into the time series feature encoder for recurrent neural network encoding.
[0060] The Bi-LSTM cell can capture long-term dependencies between time windows. It consists of a forward LSTM cell and a backward LSTM cell. The forward LSTM cell processes the interactive time-series trajectory features in chronological order, and the backward LSTM cell processes the interactive time-series trajectory features in reverse chronological order.
[0061] In the forward LSTM cell, each time step receives the interactive time-series trajectory features of the current time window and the hidden state of the previous time step as inputs. The LSTM cell controls the flow and memory of information through the forget gate, input gate, and output gate. The forget gate determines which information from the previous time step needs to be forgotten, the input gate determines which information from the current time step needs to be added to the memory cell, and the output gate determines the output information of the current time step.
[0062] The working principle of the backward LSTM cell is similar to that of the forward LSTM cell, except that the processing order is reversed. By combining the outputs of the forward and backward LSTM cells, the traffic analysis system can make full use of the forward and backward information of the time series and capture more comprehensive long-term dependencies.
[0063] After being processed by the Bi-LSTM cell, the traffic analysis system obtains the hidden state of each time window. The traffic analysis system performs concatenation or pooling operations on these hidden states to generate a time-series feature vector. This time-series feature vector can reflect the time dynamic changes and long-term dependencies of the interactive time-series trajectory features.
[0064] Step S133: Perform feature dimension alignment processing on the multi-dimensional protocol feature vector and the time-series feature vector, and perform feature concatenation processing through a fully connected layer to generate a joint feature vector.
[0065] After obtaining the multi-dimensional protocol feature vector and the time-series feature vector, the traffic analysis system first performs feature dimension alignment processing on them. Since the dimensions of the multi-dimensional protocol feature vector and the time-series feature vector may be different, the traffic analysis system needs to adjust their dimensions to be the same through linear transformation or pooling operations.
[0066] For example, if the dimension of the multi-dimensional protocol feature vector is M and the dimension of the time-series feature vector is N, and M > N, the traffic analysis system can expand the dimension of the time-series feature vector to M through a fully connected layer; if M < N, the traffic analysis system can perform a pooling operation on the time-series feature vector to reduce its dimension to M.
[0067] After dimensional alignment, the traffic analysis system concatenates the multidimensional protocol feature vector and the time series feature vector using a fully connected layer. The fully connected layer concatenates the two vectors in a predetermined order to form a new vector, the joint feature vector. This joint feature vector incorporates information from both the protocol identifier distribution and the interaction time series trajectory, providing a more comprehensive representation of the raw traffic data.
[0068] Step S134: Classify the joint feature vector through the classification network of the abnormal traffic detection model, output the malicious behavior probability distribution, and perform threshold judgment processing on the original traffic data set based on the malicious behavior probability distribution to extract the abnormal traffic data and its corresponding attack stage label sequence.
[0069] The classification network of the abnormal traffic detection model classifies the joint feature vector. The specific steps are as follows:
[0070] Step S1341: Perform multi-head attention weight initialization processing on the joint feature vector through the multi-head attention mechanism of the classification network, generate an initial query vector and key-value vector corresponding to each attention head, and calculate the similarity score between the initial query vector and the key-value vector through matrix multiplication to obtain the initial attention weight distribution.
[0071] The multi-head attention mechanism of the classification network first initializes the multi-head attention weights on the joint feature vector. The multi-head attention mechanism projects the joint feature vector into multiple low-dimensional subspaces, each corresponding to an attention head.
[0072] For each attention head, the traffic analysis system converts the joint feature vector into the initial query vector, key-value vector, and value vector respectively through linear transformation. Then, the traffic analysis system calculates the similarity score between the initial query vector and the key-value vector of each attention head through matrix multiplication.
[0073] Specifically, the traffic analysis system performs a dot product operation on the initial query vector and the key-value vector to generate a similarity matrix. Each element in the similarity matrix represents the similarity between the query vector and the key-value vector. To control the range of similarity scores, the traffic analysis system can scale the similarity matrix.
[0074] After scaling, the traffic analysis system obtains the initial attention weight distribution. The initial attention weight distribution indicates the importance of different parts of the joint feature vector to each attention head.
[0075] Step S1342: Normalize the initial attention weight distribution to generate a standardized attention weight matrix, and perform weighted aggregation on the joint feature vector according to the standardized attention weight matrix to generate an attention feature subset corresponding to each attention head.
[0076] The traffic analysis system normalizes the initial attention weight distribution to ensure that the weight value is between 0 and 1 and the sum is 1. The traffic analysis system can use the Softmax function to normalize the initial attention weight distribution to obtain a standardized attention weight matrix.
[0077] Each element in the normalized attention weight matrix represents the weight of each part of the joint feature vector under the corresponding attention head. The traffic analysis system performs weighted aggregation on the joint feature vector based on the normalized attention weight matrix.
[0078] Specifically, the traffic analysis system multiplies the normalized attention weight matrix by the joint feature vector element-by-element and then sums the results. This yields a subset of attention features corresponding to each attention head. Each subset focuses on a different part of the joint feature vector, extracting distinct feature information.
[0079] Step S1343: perform channel splicing processing on the multiple attention feature subsets to generate a multi-head attention fusion feature vector, and perform nonlinear activation function processing on the multi-head attention fusion feature vector to generate a high-order feature representation.
[0080] The traffic analysis system performs channel splicing on multiple attention feature subsets. Channel splicing is to connect multiple attention feature subsets together along the channel dimension to form a new vector, namely the multi-head attention fusion feature vector.
[0081] The multi-head attention fusion feature vector combines the different feature information extracted by multiple attention heads, and can more comprehensively represent the feature information of the joint feature vector. To further enhance the expressiveness of features, the traffic analysis system applies a nonlinear activation function to the multi-head attention fusion feature vector. Common nonlinear activation functions include the ReLU function. Using the ReLU function, the traffic analysis system sets elements in the multi-head attention fusion feature vector that are less than 0 to 0, while elements that are greater than 0 remain unchanged. This introduces nonlinear factors, enabling the model to learn more complex feature patterns and generate higher-order feature representations. The higher-order feature representation incorporates the rich information of the joint feature vector after the multi-head attention mechanism and nonlinear transformation, and can better reflect the characteristic nature of the original traffic data.
[0082] Step S1344: Mapping the high-order feature representation to the malicious behavior classification space through the fully connected layer of the classification network to generate an initial classification probability distribution.
[0083] The fully connected layer of the classification network receives high-level feature representations as input. Each neuron in the fully connected layer is connected to every element in the high-level feature representation. Through a series of linear transformations and weight parameters, the fully connected layer maps the high-level feature representations into the malicious behavior classification space. The malicious behavior classification space contains multiple different categories, each representing a possible type of malicious or normal behavior.
[0084] During the calculation process of the fully connected layer, the traffic analysis system first performs matrix multiplication on the high-order feature representation and the weight matrix of the fully connected layer to obtain an intermediate result. The traffic analysis system then adds the bias vector to the intermediate result to obtain a new vector. The traffic analysis system can then optionally use the Softmax function to process this new vector and convert it into a probability distribution. The Softmax function converts each element in the vector into a probability value between 0 and 1, and the sum of all probability values is 1. In this way, the traffic analysis system obtains an initial classification probability distribution, which represents the probability that the original traffic data belongs to each malicious behavior category.
[0085] Step S1345: Scaling the initial classification probability distribution based on a learnable temperature parameter, dynamically adjusting the confidence calibration of the classification probability distribution by optimizing the temperature parameter, and determining the attack phase label sequence corresponding to the abnormal traffic data based on the adjusted malicious behavior probability distribution, and performing timestamp alignment processing on the attack phase label sequence and the corresponding abnormal traffic data.
[0086] To fine-tune the initial classification probability distribution, the traffic analysis system introduces a learnable temperature parameter to scale it. The learnable temperature parameter is a parameter that can be optimized during model training. The traffic analysis system divides each probability value in the initial classification probability distribution by the learnable temperature parameter to obtain the scaled probability value.
[0087] By adjusting the learnable temperature parameter, the traffic analysis system can dynamically adjust the confidence calibration of the classification probability distribution. When the learnable temperature parameter is large, the classification probability distribution becomes smoother, and the probability differences between categories are reduced. When the learnable temperature parameter is small, the classification probability distribution becomes sharper, and the model has higher confidence in certain categories.
[0088] During the model training process, the traffic analysis system uses a loss function to evaluate the difference between the adjusted classification probability distribution and the true label, and updates the learnable temperature parameters through optimization algorithms (such as the stochastic gradient descent algorithm) so that the adjusted classification probability distribution more accurately reflects the true situation.
[0089] Based on the adjusted malicious behavior probability distribution, the traffic analysis system determines the attack phase label sequence corresponding to the abnormal traffic data. The traffic analysis system selects the category with the highest probability value as the attack phase label corresponding to the abnormal traffic data. Simultaneously, the traffic analysis system aligns the attack phase label sequence with the corresponding abnormal traffic data by performing timestamp alignment. This means that the traffic analysis system records the timestamp of each abnormal traffic data point and associates it with the corresponding attack phase label, facilitating subsequent analysis and backtracking of the malicious behavior time series.
[0090] Step S140: performing behavior feature vector mapping processing on the abnormal traffic data according to the attack phase label sequence to generate a behavior feature vector set of the target message cluster.
[0091] To deeply analyze the behavioral characteristics of abnormal traffic data, the traffic analysis system maps the abnormal traffic data to behavioral feature vectors based on the attack phase label sequence. The specific steps are as follows:
[0092] Step S141: performing protocol payload separation processing on the abnormal traffic data, and extracting the operation instruction field and parameter sequence in the payload content.
[0093] The traffic analysis system first performs protocol payload separation on abnormal traffic data. Different communication protocols have different message formats. The traffic analysis system uses the previously loaded protocol parsing rule set to separate the protocol header and payload content in the abnormal traffic data.
[0094] After extracting the payload content, the traffic analysis system further extracts the operation instruction field and parameter sequence. For some protocols, the operation instruction field may be a specific byte or byte sequence that indicates the type of operation to be performed on the message. For example, in the Modbus protocol, the function code is the operation instruction field. Different function codes represent different operations, such as reading a register or writing a register.
[0095] The parameter sequence is the specific data associated with the operation instruction. In the Modbus protocol, when the function code is to read a register, the parameter sequence may include the register address and quantity to be read; when the function code is to write a register, the parameter sequence may include the register address and data value to be written. The traffic analysis system parses the payload content and accurately extracts the operation instruction field and parameter sequence according to the protocol rules.
[0096] Step S142: performing lexical analysis on the operation instruction field to generate a lexical unit stream of the operation instruction, constructing an abstract syntax tree of the operation instruction based on the lexical unit stream, and extracting control flow relationships between syntax tree nodes.
[0097] The traffic analysis system performs lexical analysis on the extracted operation instruction fields. Lexical analysis is the process of breaking down the operation instruction fields into lexical units. Each lexical unit represents a basic semantic unit in the operation instruction, such as a keyword, identifier, or operator.
[0098] For example, for a custom operation instruction "READ_REGISTER0x1010," the lexical analyzer breaks it down into lexical units such as "READ_REGISTER" (keyword), "0x10" (identifier, indicating the register address), and "10" (identifier, indicating the number of registers). The traffic analysis system arranges these lexical units in sequence to generate the lexical unit stream of the operation instruction.
[0099] Next, the traffic analysis system constructs an abstract syntax tree (AST) for the instruction based on the lexical unit stream. An AST is a tree structure that represents the grammatical structure of an instruction. The nodes of the tree represent lexical units, and the edges represent the grammatical relationships between lexical units.
[0100] The traffic analysis system analyzes the abstract syntax tree (AST) to extract control flow relationships between tree nodes. Control flow relationships describe the execution order and logical relationships of operation instructions. For example, in an operation instruction containing a conditional statement, the AST can clearly represent the branches and execution paths of the conditional statement. By extracting control flow relationships, the traffic analysis system can gain a deeper understanding of the semantics and execution logic of the operation instruction.
[0101] Step S143: Generate a semantic dependency graph of the operation instruction based on the control flow relationship, perform graph structure feature encoding processing on the semantic dependency graph, and generate an operation instruction feature vector.
[0102] The flow analysis system generates a semantic dependency graph for the operation instructions based on the extracted control flow relationships. The semantic dependency graph is a directed graph in which nodes represent the elements in the operation instructions (such as variables, operators, function calls, etc.), and edges represent the semantic dependencies between elements.
[0103] For example, in an operation instruction, if the value of a variable depends on the calculation result of another variable, then there will be an edge in the semantic dependency graph from the node of the dependent variable to the node of the dependent variable. By constructing the semantic dependency graph, the traffic analysis system can more comprehensively represent the semantic information of the operation instruction.
[0104] Next, the traffic analysis system performs graph structural feature encoding on the semantic dependency graph. Graph structural feature encoding is the process of converting the structural information of a graph into a vector representation. The traffic analysis system can use a graph neural network (GNN) for graph structural feature encoding.
[0105] GNNs extract and update features for each node in the semantic dependency graph. In each GNN layer, a node receives feature information from its neighboring nodes and combines it with its own features for updates. After processing through multiple layers of GNNs, each node receives a feature vector containing the graph's structural information. The traffic analysis system can aggregate these node feature vectors (e.g., summing or averaging) to generate an operation instruction feature vector. This operation instruction feature vector contains both semantic and structural information about the operation instruction and effectively represents its characteristics.
[0106] Step S144: performing stage boundary detection processing on the attack stage label sequence, determining the time span and context constraints of each attack stage, and performing context-aware weighted processing on the operation instruction feature vector based on the context constraints to generate a context-enhanced feature vector.
[0107] The traffic analysis system performs phase boundary detection on the attack phase label sequence. Phase boundary detection is the process of determining the start and end time of each attack phase. The traffic analysis system can determine phase boundaries by analyzing label changes within the attack phase label sequence. For example, a phase boundary is identified when a label changes from one attack phase type to another.
[0108] After determining the phase boundaries, the traffic analysis system can determine the time span of each attack phase. Simultaneously, the traffic analysis system analyzes the contextual information of each attack phase and determines the contextual constraints. Contextual constraints can include information such as the relationship between attack phases and the execution environment of the operational instructions.
[0109] Based on the contextual constraints, the traffic analysis system performs context-aware weighted processing on the operation instruction feature vectors. The traffic analysis system first calculates the correlation score between each operation instruction feature vector and the contextual constraints. The correlation score can be obtained by calculating the similarity between the vectors (such as cosine similarity).
[0110] The traffic analysis system then weights the operation instruction feature vectors based on their relevance scores. Operation instruction feature vectors with high relevance scores are assigned larger weights, while those with low relevance scores are assigned smaller weights. The weighted operation instruction feature vectors then undergo a linear transformation (such as a fully connected layer) to generate context-enhanced feature vectors. These context-enhanced feature vectors combine the characteristic information of the operation instruction with contextual information, more accurately representing the characteristics of the operation instruction at a specific attack stage.
[0111] Step S145: constructing a parameter dependency chain according to the arrangement order of the parameter sequence, performing sequence modeling processing on the parameter dependency chain, and generating a parameter sequence feature vector.
[0112] The traffic analysis system constructs a parameter dependency chain based on the order of parameter sequences. A parameter dependency chain is an ordered sequence in which each parameter element has a dependency relationship with the previous and next parameter elements. For example, in an operation instruction, parameter elements may be dependent on each other in the execution order, and the value of a subsequent parameter may depend on the calculation result of the previous parameter.
[0113] The traffic analysis system performs sequence modeling on parameter dependency chains. This can be done using recurrent neural networks (RNNs) or their variants, such as long short-term memory (LSTM) networks and gated recurrent units (GRUs). For example, LSTMs process each parameter element in a parameter dependency chain sequentially.
[0114] At each time step, the LSTM receives the current parameter element and the hidden state from the previous time step as input. The LSTM controls the flow and memory of information through forget gates, input gates, and output gates, thereby capturing long-term dependencies within the parameter dependency chain. After processing by the LSTM, the traffic analysis system obtains the hidden state for each time step.
[0115] The traffic analysis system can use the hidden state of the last time step as the parameter sequence feature vector. The parameter sequence feature vector contains the order information and dependency relationship of the parameter sequence and can effectively represent the characteristics of the parameter sequence.
[0116] Step S146: performing feature fusion processing on the context-enhanced feature vector and the parameter sequence feature vector to generate a behavior feature vector, and performing cluster analysis processing on multiple behavior feature vectors in the same attack phase to generate a set of behavior feature vectors of the target message cluster.
[0117] The traffic analysis system fuses the context-enhanced feature vector with the parameter sequence feature vector. This feature fusion can be achieved by concatenating the context-enhanced feature vector and the parameter sequence feature vector in sequence to form a new vector, the behavior feature vector. This concatenation preserves the original information of both vectors, ensuring that the behavior feature vector contains the combined characteristics of the operation instruction and the parameter sequence.
[0118] The traffic analysis system performs cluster analysis on multiple behavioral signature vectors within the same attack phase. Cluster analysis is the process of grouping similar behavioral signature vectors into the same cluster. The traffic analysis system can use clustering algorithms, such as the K-means clustering algorithm.
[0119] The K-means clustering algorithm first randomly selects K centroids and assigns each behavioral feature vector to the cluster with the closest centroid. Next, the centroid of each cluster is updated to the mean of all behavioral feature vectors within that cluster. This process is repeated until the centroid no longer changes or the preset number of iterations is reached.
[0120] After cluster analysis, the traffic analysis system generates multiple clusters, each representing a target packet cluster. The traffic analysis system aggregates (e.g., averages) the behavioral feature vectors within each cluster to generate a set of behavioral feature vectors for the target packet cluster. This set of behavioral feature vectors for the target packet cluster effectively represents the behavioral characteristic patterns of abnormal traffic data within the same attack phase.
[0121] Step S150: constructing a multi-level association network based on the behavior feature vector set, performing message backtracking path generation processing on the target message cluster through the multi-level association network, and outputting a malicious behavior message backtracking chain.
[0122] To effectively analyze and trace the target packet cluster, the traffic analysis system constructs a multi-level correlation network based on the behavioral feature vector set and generates a packet traceback path through this network. The specific steps are as follows:
[0123] Step S151: performing similarity matrix calculation processing on the set of behavioral feature vectors to generate a cosine similarity score between each pair of feature vectors.
[0124] The traffic analysis system processes each pair of feature vectors in the set of behavioral feature vectors. For any two behavioral feature vectors, the cosine similarity score between them is calculated. Specifically, the two vectors are first subjected to a dot product operation, which takes into account the product of the values of the two vectors in each dimension and sums them. Then, the modulus of the two vectors is calculated, which is a calculation result of the sum of the squares of the values of each dimension of the vectors. Finally, the result of the dot product is divided by the product of the moduli of the two vectors to obtain the cosine similarity score between the two vectors. This calculation is performed for all pairs of vectors in the set of behavioral feature vectors, resulting in a similarity matrix, in which each element represents the cosine similarity score between the corresponding vector pair.
[0125] Step S152: constructing a fully connected weighted graph according to the cosine similarity scores, wherein the nodes in the fully connected weighted graph represent behavior feature vectors and the edge weights represent cosine similarity scores.
[0126] The traffic analysis system constructs a fully connected weighted graph based on the generated similarity matrix. In this fully connected weighted graph, each behavioral feature vector is represented by a node. Because it is a fully connected graph, there is an edge between any two nodes. The edge weight is the cosine similarity score between the behavioral feature vectors represented by the two nodes. This constructed fully connected weighted graph can intuitively demonstrate the similarity relationships between behavioral feature vectors.
[0127] Step S153: performing hierarchical clustering processing based on approximate nearest neighbors on the fully connected weighted graph, using the Canopy clustering algorithm to pre-divide the coarse-grained clusters, and then executing a bottom-up aggregation strategy within the cluster, merging the two nodes with the highest similarity each time until a preset clustering threshold is reached.
[0128] The traffic analysis system clusters fully connected weighted graphs. First, the Canopy clustering algorithm is used. It sets two distance thresholds to quickly partition nodes in the fully connected weighted graph into coarse-grained clusters. Once these coarse-grained clusters are obtained, a bottom-up aggregation strategy is implemented within each cluster. Specifically, the two most similar nodes are merged each time. The feature vector of the merged node is derived by, for example, taking a weighted average of the feature vectors of the two original nodes. This merging process is repeated until a pre-set clustering threshold is reached.
[0129] Step S154: construct a hierarchical tree structure according to the merging order in the clustering process, and convert the hierarchical tree structure into a multi-level association network; each level of the multi-level association network corresponds to a different attack stage granularity, the high level represents the macro attack stage association, and the low level represents the micro operation instruction association.
[0130] Based on the order in which nodes are merged during the hierarchical clustering process, the traffic analysis system constructs a hierarchical tree structure. This structure is a tree-like structure, with leaf nodes representing the original behavioral feature vectors and internal nodes representing the merged clusters. This structure is then transformed into a multi-level association network. Within this multi-level association network, each level has a different meaning. High-level levels reflect the connections between macro-attack stages, providing a holistic understanding of the general direction of malicious behavior at different stages. Low-level levels display detailed connections between micro-operational instructions, reflecting relationships at the specific operational level.
[0131] Step S155: performing center vector calculation processing on each feature cluster node to generate a cluster center feature vector, and performing reverse index mapping processing on the cluster center feature vector and the original message to establish a bidirectional lookup table.
[0132] The traffic analysis system processes each feature cluster node in the multi-level association network and calculates its center vector. For each cluster, all behavioral feature vectors within the cluster are subjected to a comprehensive calculation, such as averaging, to obtain the cluster center feature vector. These cluster center feature vectors are then mapped to the original message using a reverse index. This establishes a correspondence, allowing the corresponding original message to be found using the cluster center feature vector, and vice versa, thus forming a bidirectional lookup table.
[0133] Step S156: Selecting an initial feature cluster node from the highest level of the multi-level association network as a backtracking starting point, and obtaining an initial message set corresponding to the initial feature cluster node according to the bidirectional lookup table.
[0134] The traffic analysis system selects an initial feature cluster node from the highest level of the multi-level correlation network as the starting point for backtracking. This highest-level feature cluster node represents the correlation information of the macro-attack phase. Starting from this point, backtracking can comprehensively grasp the development of malicious behavior. Based on the previously established bidirectional lookup table, the traffic analysis system can obtain the initial set of packets corresponding to this initial feature cluster node. These packets serve as the starting data for subsequent backtracking analysis.
[0135] Step S157: Traverse the adjacent feature cluster nodes that are connected to the initial feature cluster node in the multi-level association network, generate candidate backtracking path branches, and perform path weight accumulation processing on each candidate backtracking path branch, and sort the candidate backtracking path branches according to the path weight accumulation processing results, retaining the top N high candidate backtracking path branches as the candidate path set.
[0136] The traffic analysis system begins traversing the adjacent feature cluster nodes connected to the initial feature cluster node in the multi-level association network. These adjacent feature cluster nodes are connected to the initial feature cluster node to form candidate backtracking path branches. For each candidate backtracking path branch, path weights are accumulated. Path weights can be determined based on edge weights (i.e., cosine similarity scores). The weights of all edges in a candidate backtracking path branch are summed to obtain the path base weight. Simultaneously, the timestamp sequence of packets corresponding to each feature cluster node in the candidate backtracking path branch is obtained. The variance of the time intervals between adjacent packets is calculated, and a temporal continuity score is generated based on this variance. The smaller the variance, the higher the score. The path base weight and temporal continuity score are normalized to the same dimensional range. The normalized path base weight and temporal continuity score are then linearly combined using a preset weight coefficient to generate a comprehensive path confidence score. The candidate backtracking path branches are prioritized based on the comprehensive path confidence score, and the top N candidate backtracking path branches with the highest scores are retained as the candidate path set.
[0137] Step S158: Perform timing consistency verification on the candidate path set to detect whether the timestamps of the messages in the candidate paths meet the timing tolerance range specified by the network protocol, and verify the compatibility of the transmission direction with the protocol interaction logic. Eliminate candidate paths with timing conflicts to obtain a valid backtracking path set.
[0138] The traffic analysis system verifies the timing consistency of the candidate path set. In power grid communications, the network protocol has clear provisions for the transmission timing of messages, such as a specific time interval between certain messages, or transmission in a fixed order. The traffic analysis system detects the timestamps of the messages in the candidate path to determine whether they are within the timing fault tolerance range specified by the network protocol. At the same time, it verifies whether the transmission direction of the messages in the candidate path is consistent with the protocol interaction logic, such as whether there is a fixed transmission direction between the request message and the response message. If the candidate path has a message transmission direction that does not comply with the protocol interaction logic or the timestamp does not meet the requirements, it is considered that the candidate path has a timing conflict and is removed from the candidate path set, thereby obtaining a valid backtracking path set.
[0139] Step S159: Perform comprehensive scoring and sorting on the valid backtracking paths according to the path weight and timing consistency score, select the path with the highest score as the malicious behavior message backtracking chain, and map the feature cluster nodes in the malicious behavior message backtracking chain back to the original message sequence to generate a message backtracking chain with timing marks.
[0140] The traffic analysis system once again ranks the paths in the valid backtracking path set based on a comprehensive score. The path weights and temporal consistency scores are standardized again, and then linearly combined using different weight coefficients to obtain the final comprehensive score. The path with the highest comprehensive score is selected as the malicious behavior message backtracking chain. This backtracking chain can most accurately reflect the propagation path and development process of malicious behavior in the network. Finally, through the previously established bidirectional lookup table, the feature cluster nodes in the malicious behavior message backtracking chain are mapped back to the original message sequence. These original messages are arranged in the order of the backtracking chain, and a timestamp is added to each message to generate a message backtracking chain with a time sequence mark. In this way, the entire process of malicious behavior from the beginning to the development and the specific message information corresponding to each stage can be clearly seen.
[0141] For example, after step S150, the method further includes:
[0142] Step S210: Perform protocol syntax verification on the abnormal traffic data to detect whether the abnormal traffic data meets the syntax constraints in the protocol specification. When a syntax error is detected in the protocol field, mark the abnormal traffic data as a protocol violation message.
[0143] After obtaining the abnormal traffic data and the corresponding attack phase tag sequence, further inspection of the abnormal traffic data is required. Protocol syntax verification is a key step in ensuring that the abnormal traffic data complies with communication protocol specifications. Different communication protocols, such as IEC60870-5-104 and Modbus, have their own strict syntax constraints.
[0144] The IEC60870-5-104 protocol has clear regulations for message formats, field lengths, and encoding methods. For example, the message's starting character must be a specific value, the length field must accurately reflect the message's actual length, and each bit in the control field has a fixed meaning and value range. The traffic analysis system examines each message in the abnormal traffic data field field by field based on these grammatical constraints.
[0145] The Modbus protocol also has corresponding syntax rules for slave addresses, function codes, and data fields. The slave address must be within the legal range, the function code must be a valid code specified by the protocol, and the length and format of the data field must meet the requirements. During the inspection process, the traffic analysis system compares each field of abnormal traffic data with the protocol specifications.
[0146] If the traffic analysis system detects a syntax error in the protocol field, such as a mismatch between the length field value and the actual message length or an invalid function code, it will mark the abnormal traffic data as a protocol violation message. Marking protocol violation messages facilitates further analysis and processing of abnormal traffic.
[0147] Step S220: Perform field repair processing on the protocol violation message, including extracting the legal field value range defined in the protocol specification; performing legality verification on the violation field based on the protocol semantic constraints, generating a compliant value that satisfies both grammatical and semantic constraints through a finite state machine, and using the compliant value to replace the violation field to generate a repair message.
[0148] For abnormal traffic data marked as protocol violation packets, field repair is required. First, the traffic analysis system extracts the legal field value ranges defined in the protocol specification. For example, in the IEC60870-5-104 protocol, the length field has a specified value range, and each bit in the control field also has its own legal value. The traffic analysis system stores these legal value ranges for subsequent verification and repair.
[0149] Next, the traffic analysis system verifies the validity of the offending field based on the protocol's semantic constraints. These constraints consider not only the grammatical rules of the fields but also the logical relationships and practical meaning between them. For example, in a message containing multiple data fields, the values of some fields may be constrained by other fields. The traffic analysis system analyzes the relationship between the offending field and other fields to determine whether it complies with the protocol's semantic requirements.
[0150] To generate compliant values that satisfy both syntactic and semantic constraints, the traffic analysis system uses a finite state machine. A finite state machine is a mathematical model that transitions to the next state based on the current state and input conditions. In the case of protocol field repair, the finite state machine can gradually generate compliant values based on the protocol specification and the current violation field.
[0151] The states of a finite state machine can represent different values of a protocol field, and the input conditions can be the rules and constraints in the protocol specification. By continuously transitioning states based on the input conditions, the finite state machine can ultimately generate a compliant value that satisfies both syntactic and semantic constraints.
[0152] The traffic analysis system replaces the offending fields with the generated compliant values, generating a repair message. The repair message complies with the protocol specifications in both syntax and semantics and can participate in normal network communications.
[0153] Step S230: Re-inject the repair message into the network traffic to perform transmission status monitoring.
[0154] After generating the repair message, the traffic analysis system reinjects it into the network traffic. This reinjection process ensures that the repair message is properly integrated into the original network communication environment. The traffic analysis system routes the repair message to the appropriate network node based on the network topology and communication rules.
[0155] At the same time, the traffic analysis system monitors the transmission status of the repair message. During transmission, the traffic analysis system records information such as the repair message's send time, receive time, and transmission path. By analyzing this information, it can determine whether the repair message is transmitting normally and whether there are any problems such as packet loss or delay.
[0156] The method for monitoring the transmission status may include deploying monitoring equipment at key nodes of the network to collect real-time transmission data of the repair message. The traffic analysis system may also obtain feedback information about the repair message by interacting with other devices in the network.
[0157] Step S240: When it is detected that the repair message is successfully transmitted, the corresponding node status mark in the malicious behavior message backtracking chain is updated.
[0158] If the traffic analysis system detects that the repair message is successfully transmitted, it means that the repair measures are effective and the repair message can participate in network communications normally. At this time, the traffic analysis system will update the status mark of the corresponding node in the malicious behavior message backtracking chain.
[0159] The malicious behavior message traceback chain records the propagation path of malicious behavior within the network and the message information at each stage. Each node corresponds to a message or a group of related messages, and the node's status flag indicates the processing status of the message. When the repair message is successfully transmitted, the traffic analysis system updates the corresponding node's status flag to "Repair Successful" or a similar status.
[0160] Updating node status tags helps more accurately reflect the handling process and results of malicious behavior. For example, when assessing the impact and severity of malicious behavior, node status tags can be used to determine which packets have been effectively repaired.
[0161] Step S250: When the repair message transmission is detected to be abnormal, the corresponding node is marked as a persistent attack node and an alarm mechanism is triggered.
[0162] If the traffic analysis system detects abnormal transmission of the repair message, such as packet loss, excessive delay, or reception errors, it indicates that the repair measures may not have achieved the expected results and the repair message still has problems. In this case, the traffic analysis system will mark the corresponding node in the malicious behavior message backtracking chain as a persistent attack node.
[0163] Marking a persistent attack node indicates that the malicious behavior represented by the packet is likely persistent and requires further processing and attention. Simultaneously, the traffic analysis system triggers an alert mechanism. This alert mechanism can be implemented in a variety of ways, such as sending emails or text messages to notify relevant network administrators, or issuing audible and visual alarms in the monitoring system.
[0164] The purpose of triggering an alert mechanism is to promptly alert network administrators to take action and further analyze and address the malicious behavior associated with persistent attack nodes. Based on the alert information, network administrators can conduct in-depth inspections of related network equipment and communication protocols to identify the root cause of the problem and implement appropriate solutions.
[0165] In the above embodiments, the collected raw traffic data may contain privacy-sensitive data, such as the specific operating parameters of certain devices in the power grid and user electricity usage information. To protect this privacy-sensitive data, the traffic collection device encrypts the data during the data collection phase. Symmetric encryption algorithms, such as the AES algorithm, can be used to encrypt the collected data before storage and transmission.
[0166] The distributed traffic signature database employs strict access control mechanisms for data storage. Only authorized personnel can access the database data, and detailed logs are kept of access behavior. Furthermore, the database is regularly backed up to prevent data loss or corruption.
[0167] During data processing, the traffic analysis system desensitizes privacy-sensitive data. For example, information involving user identities is anonymized and replaced with randomly generated identifiers. This effectively protects user privacy without affecting data analysis and processing.
[0168] In terms of AI model construction and training, the abnormal traffic detection model consists of a protocol feature encoder, a time series feature encoder, and a classification network. The protocol feature encoder is composed of a multi-layer convolutional neural network, and its training process can use a large amount of normal and abnormal traffic data as a training set.
[0169] When training the protocol feature encoder, the protocol identifier distribution features are used as input. By adjusting the convolution kernel weight parameters, the encoder can better extract protocol features. During training, a loss function, such as the cross-entropy loss function, is used to evaluate the difference between the encoder output and the true label. By continuously iteratively updating the weight parameters, the loss function value is gradually reduced, thereby improving the encoder performance.
[0170] The temporal feature encoder includes a bidirectional long short-term memory network unit, and its training process is also based on a large amount of interactive temporal trajectory feature data. During training, the bidirectional long short-term memory network unit learns to capture the long-term dependencies between time windows. Similarly, a loss function is used to evaluate the difference between the output and the true label, and an optimization algorithm is used to update the network weight parameters.
[0171] The classification network is trained based on the joint feature vector. The joint feature vector is input into the classification network, and by adjusting the weight parameters of the fully connected layer, the network accurately classifies traffic data and outputs a probability distribution of malicious behavior. During the training process, appropriate loss functions and optimization algorithms are used to continuously improve the accuracy and reliability of the classification network.
[0172] Through the above detailed implementation steps, it is possible to effectively detect malicious behavior in the power grid, generate an accurate message backtracking chain, and repair and process abnormal traffic, thereby improving the security and reliability of the power grid network.
[0173] Figure 2 A schematic diagram illustrates exemplary hardware and software components of an information-driven malicious network behavior message backtracking generation system 100, which can implement the concepts of the present application and is provided in some embodiments of the present application. The system 100 can be the aforementioned traffic analysis system. For example, the processor 120 can be used in the information-driven malicious network behavior message backtracking generation system 100 and used to perform the functions of the present application.
[0174] The information-oriented network malicious behavior message backtracking generation system 100 can be a general-purpose server or a special-purpose server, both of which can be used to implement the information-oriented network malicious behavior message backtracking generation method of the present application. Although only one server is shown in this application, for convenience, the functions described in this application can be implemented in a distributed manner on multiple similar platforms to balance the processing load.
[0175] For example, the information-oriented network malicious behavior message backtracing generation system 100 may include a network port 110 connected to the network, one or more processors 120 for executing program instructions, a communication bus 130, and different forms of storage media 140, such as a disk, ROM, or RAM, or any combination thereof. Exemplarily, the information-oriented network malicious behavior message backtracing generation system 100 may also include program instructions stored in ROM, RAM, or other types of non-temporary storage media, or any combination thereof. The method of the present application can be implemented according to these program instructions. The information-oriented network malicious behavior message backtracing generation system 100 also includes an I / O interface 150 between the computer and other input and output devices.
[0176] For ease of explanation, only one processor is described in the information-guided network malicious behavior message backtracing generation system 100. However, it should be noted that the information-guided network malicious behavior message backtracing generation system 100 in the present application can also include multiple processors, so the steps performed by one processor described in the present application can also be performed jointly or individually by multiple processors. For example, if the processor of the information-guided network malicious behavior message backtracing generation system 100 executes step A and step B, it should be understood that step A and step B can also be performed jointly by two different processors or individually in one processor. For example, the first processor executes step A, the second processor executes step B, or the first processor and the second processor execute steps A and B together.
[0177] In addition, an embodiment of the present invention also provides a readable storage medium, in which computer-executable instructions are preset. When the processor executes the computer-executable instructions, the above-mentioned information-guided network malicious behavior message backtracing generation method is implemented.
[0178] It should be noted that in order to simplify the description of the present invention and thus help understand one or more embodiments of the invention, in the foregoing description of the embodiments of the present invention, multiple features are sometimes combined into one embodiment, figure or description thereof.
Claims
1. A method for generating network malicious behavior message backtracing based on information guidance, characterized in that: The method comprises: Collecting an original traffic data set of a target network node, wherein the original traffic data set includes multiple sets of communication protocol identifiers and corresponding payload content sequences; Performing transmission feature extraction processing on the original traffic data set to obtain protocol identification distribution features and interaction time sequence trajectory features of the payload content sequence; Based on the protocol identifier distribution feature and the interaction time series trajectory feature, an abnormal traffic detection model is called, and malicious behavior determination processing is performed on the original traffic data set by the abnormal traffic detection model to obtain abnormal traffic data and a corresponding attack stage label sequence; Performing behavior feature vector mapping processing on the abnormal traffic data according to the attack phase label sequence to generate a behavior feature vector set of the target packet cluster; A multi-level association network is constructed based on the behavior feature vector set, and message backtracking path generation processing is performed on the target message cluster through the multi-level association network to output a malicious behavior message backtracking chain.
2. The method according to claim 1, characterized in that The performing transmission feature extraction processing on the original traffic data set to obtain the protocol identification distribution feature and interaction time sequence trajectory feature of the payload content sequence includes: Performing protocol analysis framework loading processing on the original traffic data set to obtain a protocol analysis rule set corresponding to each communication protocol identifier; Traversing the payload content sequence, performing byte-by-byte matching processing on the header field of each payload content according to the protocol parsing rule set, and extracting the protocol type identifier; Constructing a protocol frequency histogram according to the distribution density of the protocol type identifier, and performing smoothing filtering on the protocol frequency histogram through a sliding window mechanism to generate a protocol identification distribution feature; Performing timestamp field positioning processing on the payload content sequence, extracting the sending timestamp and receiving timestamp of each payload content, calculating a transmission delay sequence based on the difference between the sending timestamp and the receiving timestamp, and dividing the transmission delay sequence into multiple continuous time windows using a time series segmentation algorithm; In each time window, the transmission sequence dependency between payload contents is counted, a directed graph of interaction trajectories corresponding to the time window is constructed, and topological structure features are extracted from the directed graph of interaction trajectories to generate interaction time series trajectory features. The protocol identification distribution feature and the interaction time sequence trajectory feature are associated and indexed, and stored in a distributed traffic feature database.
3. The method according to claim 2, characterized in that The abnormal traffic detection model is called based on the protocol identifier distribution feature and the interaction time series trajectory feature, and malicious behavior determination processing is performed on the original traffic data set by the abnormal traffic detection model to obtain abnormal traffic data and a corresponding attack stage label sequence, including: Calling the protocol feature encoder of the abnormal traffic detection model to perform context-aware encoding processing on the protocol identifier distribution feature to generate a multi-dimensional protocol feature vector; the protocol feature encoder is composed of a multi-layer convolutional neural network, and the size of the convolution kernel of each layer is aligned with the field length of the protocol identifier; Calling the time series feature encoder of the abnormal traffic detection model to perform recurrent neural network encoding processing on the interactive time series trajectory features to generate a time series feature vector; the time series feature encoder includes a bidirectional long short-term memory network unit for capturing long-term dependencies between time windows; Aligning the multi-dimensional protocol feature vector with the time series feature vector in terms of feature dimensions, performing feature concatenation through a fully connected layer, and generating a joint feature vector; The joint feature vector is classified by the classification network of the abnormal traffic detection model, and a malicious behavior probability distribution is output. The original traffic data set is subjected to threshold judgment processing based on the malicious behavior probability distribution to extract the abnormal traffic data and its corresponding attack stage label sequence.
4. The method according to claim 3, characterized in that The method further comprises: classifying the joint feature vector by the classification network of the abnormal traffic detection model, outputting a malicious behavior probability distribution, performing threshold determination processing on the original traffic data set based on the malicious behavior probability distribution, and extracting the abnormal traffic data and its corresponding attack stage label sequence, including: Performing multi-head attention weight initialization processing on the joint feature vector through the multi-head attention mechanism of the classification network, generating an initial query vector and a key-value vector corresponding to each attention head, and calculating the similarity score between the initial query vector and the key-value vector through matrix multiplication to obtain an initial attention weight distribution; Normalizing the initial attention weight distribution to generate a standardized attention weight matrix, and performing weighted aggregation on the joint feature vector according to the standardized attention weight matrix to generate an attention feature subset corresponding to each attention head; Perform channel splicing processing on the multiple attention feature subsets to generate a multi-head attention fusion feature vector, and perform nonlinear activation function processing on the multi-head attention fusion feature vector to generate a high-order feature representation; Mapping the high-order feature representation to the malicious behavior classification space through the fully connected layer of the classification network to generate an initial classification probability distribution; The initial classification probability distribution is scaled based on a learnable temperature parameter, the confidence calibration of the classification probability distribution is dynamically adjusted by optimizing the temperature parameter, and the attack phase label sequence corresponding to the abnormal traffic data is determined based on the adjusted malicious behavior probability distribution, and the attack phase label sequence is timestamp aligned with the corresponding abnormal traffic data.
5. The method according to claim 1, characterized in that The performing behavior feature vector mapping processing on the abnormal traffic data according to the attack phase label sequence to generate a behavior feature vector set of a target message cluster includes: Performing protocol payload separation processing on the abnormal traffic data to extract the operation instruction field and parameter sequence in the payload content; Performing lexical analysis on the operation instruction field to generate a lexical unit stream of the operation instruction, constructing an abstract syntax tree of the operation instruction based on the lexical unit stream, and extracting control flow relationships between syntax tree nodes; Generate a semantic dependency graph of the operation instruction based on the control flow relationship, perform graph structure feature encoding processing on the semantic dependency graph, and generate an operation instruction feature vector; Performing stage boundary detection processing on the attack stage label sequence to determine the time span and context constraints of each attack stage, and performing context-aware weighted processing on the operation instruction feature vector based on the context constraints to generate a context-enhanced feature vector; Constructing a parameter dependency chain according to the arrangement order of the parameter sequence, performing sequence modeling processing on the parameter dependency chain, and generating a parameter sequence feature vector; The context enhancement feature vector and the parameter sequence feature vector are subjected to feature fusion processing to generate a behavior feature vector, and a cluster analysis processing is performed on multiple behavior feature vectors in the same attack stage to generate a behavior feature vector set of the target message cluster.
6. The method according to claim 5, characterized in that The performing context-aware weighted processing on the operation instruction feature vector based on the context constraint condition to generate a context-enhanced feature vector includes: Extracting a phase transition identifier from the attack phase tag sequence to determine a predecessor phase and a successor phase of the current attack phase; Obtain a set of historical behavior feature vectors corresponding to the precursor stage, calculate the semantic similarity between the historical behavior feature vectors and the current operation instruction feature vector, and construct a context attention weight matrix based on the semantic similarity. Perform attention weighting processing on the current operation instruction feature vector, and input the weighted operation instruction feature vector into the gated recurrent unit for temporal feature integration processing to generate a temporal context feature vector. Performing adversarial training on the predicted behavior feature vector of the subsequent stage to generate an adversarial feature vector under context constraints; The temporal context feature vector and the adversarial feature vector are subjected to feature concatenation processing to generate a context enhanced feature vector, and the context enhanced feature vector is subjected to dimension reduction processing to keep the dimension consistent with that of the parameter sequence feature vector.
7. The method according to claim 1, characterized in that The constructing of a multi-level association network based on the behavioral feature vector set includes: Performing similarity matrix calculation processing on the set of behavioral feature vectors to generate a cosine similarity score between each pair of feature vectors; Constructing a fully connected weighted graph based on the cosine similarity scores, wherein nodes in the fully connected weighted graph represent behavior feature vectors and edge weights represent cosine similarity scores; The fully connected weighted graph is subjected to hierarchical clustering based on approximate nearest neighbors. After pre-dividing the coarse-grained clusters using the Canopy clustering algorithm, a bottom-up aggregation strategy is executed within the cluster, merging the two nodes with the highest similarity each time until a preset clustering threshold is reached; A hierarchical tree structure is constructed according to the merging order in the clustering process, and the hierarchical tree structure is converted into a multi-level association network; each level of the multi-level association network corresponds to a different attack stage granularity, with the high level representing the macro attack stage association and the low level representing the micro operation instruction association; A center vector calculation process is performed on each feature cluster node to generate a cluster center feature vector, and a reverse index mapping process is performed between the cluster center feature vector and the original message to establish a bidirectional lookup table.
8. The method according to claim 7, characterized in that The step of performing message tracing path generation processing on the target message cluster through the multi-level association network and outputting a malicious behavior message tracing chain includes: Selecting an initial feature cluster node from the highest level of the multi-level association network as a backtracking starting point, and obtaining an initial message set corresponding to the initial feature cluster node according to the bidirectional lookup table; Traversing the adjacent feature cluster nodes that are connected to the initial feature cluster node in the multi-level association network, generating candidate backtracking path branches, and performing path weight accumulation processing on each candidate backtracking path branch, and sorting the candidate backtracking path branches according to the path weight accumulation processing results, retaining the top N candidate backtracking path branches with the highest weight as the candidate path set; Performing temporal consistency verification on the candidate path set to detect whether the timestamps of the messages in the candidate paths meet the temporal fault tolerance range specified by the network protocol, and verifying the compatibility of the transmission direction with the protocol interaction logic, eliminating candidate paths with timing conflicts, and obtaining a valid backtracking path set; The effective backtracking paths are comprehensively scored and sorted according to the path weight and temporal consistency score, and the path with the highest score is selected as the malicious behavior message backtracking chain. The characteristic cluster nodes in the malicious behavior message backtracking chain are mapped back to the original message sequence to generate a message backtracking chain with a timing mark.
9. The method according to claim 8, characterized in that The step of performing path weight accumulation processing on each candidate backtracking path branch, and sorting the candidate backtracking path branches according to the path weight accumulation processing result, and retaining the top N high-weight paths as the candidate path set, includes: Extract the edge weights between adjacent feature cluster nodes in the candidate backtracking path branches, construct an edge weight sequence, normalize the edge weight sequence, and calculate the path dynamic weight based on the sliding average algorithm; Obtain the timestamp sequence of the message corresponding to each feature cluster node in the candidate backtracking path branch, calculate the time interval variance of adjacent messages, and generate a temporal continuity score based on the time interval variance. The smaller the variance, the higher the score. Normalizing the path base weight and the temporal continuity score, and linearly combining the normalized path base weight and the temporal continuity score using a preset weight coefficient to generate a path comprehensive confidence score; The candidate backtracking path branches are prioritized according to the comprehensive confidence score, and the top N candidate backtracking path branches with the highest confidence are retained as a candidate path set.
10. A network malicious behavior message backtracing generation system based on information guidance, characterized in that: It includes a processor and a memory, the memory is connected to the processor, the memory is used to store programs, instructions or codes, and the processor is used to execute the programs, instructions or codes in the memory to implement the information-guided network malicious behavior message backtracing generation method described in any one of claims 1 to 9.
Citation Information
Cited By
Network space asset fingerprint identification method and system
CN121098627A
Network transmission protocol intrusion detection method and system
CN121173605A
Data stream analysis detection method and device for private protocol of gatekeeper isolation component
CN121441813A
Method and device for processing network security data
CN121690627A
