An end-to-end performance analysis system and method based on an attention mechanism
Patent Information
- Application Number
- CN202511691096.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-09-04
- Estimated Expiration
- 2045-11-18
AI Technical Summary
[0003]然而,泄漏信息中通常包含大量冗余信息与噪声,且敏感信息的泄漏往往分散在多个时间节点或特征维度,同时受设备硬件差异、防护机制等因素影响,特征间的关联关系具有动态性和不确定性,当前的分析方法依赖人工经验,缺乏普适性,难以适应多样化的分析场景
1、本发明通过Z分数标准化、陷波滤波与小波阈值去噪的组合方式处理加密芯片的原始电磁辐射数据,再经一级滑动窗口截取与二级双向LSTM编码器提取时序组合特征,有效滤除冗余噪声与干扰信号,精准保留数据时序关联信息,为敏感特征提取提供高质量数据支撑,解决传统数据处理精度不足的问题。
Smart Images

Figure CN121750190B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of network security, specifically to an end-to-end performance analysis system and method based on an attention mechanism. Background Technology
[0002] Side-channel performance analysis (SSMA), a key technology for evaluating the security of cryptographic devices, captures physical leaks generated during device operation, analyzes the correlation between leaked information and sensitive data, and thus assesses the device's resistance to attacks. With the development of encryption algorithm protection technologies, physical leaks in devices are becoming more concealed and dispersed, placing higher demands on the accuracy, efficiency, and adaptability of SSMA.
[0003] However, leaked information usually contains a lot of redundant information and noise, and the leakage of sensitive information is often scattered across multiple time points or feature dimensions. At the same time, due to factors such as differences in equipment hardware and protection mechanisms, the correlation between features is dynamic and uncertain. Current analysis methods rely on human experience, lack universality, and are difficult to adapt to diverse analysis scenarios. Summary of the Invention
[0004] The purpose of this invention is to provide an end-to-end performance analysis system and method based on an attention mechanism to solve the problems raised in the prior art.
[0005] To achieve the above objectives, the present invention provides the following technical solution: an end-to-end performance analysis method based on an attention mechanism, the method comprising the following steps: Step S1: Obtain the raw performance data generated during the runtime of the object to be analyzed, and process the raw performance data to obtain standardized data; Furthermore, step S1 includes: The object to be analyzed is an encryption chip. The electromagnetic radiation generated by the encryption chip during the operation is sampled by an electromagnetic radiation detector to obtain raw performance data. The raw performance data is a time-series signal. Each raw performance data includes several sampling points and the electromagnetic radiation intensity corresponding to the sampling points. Each sampling point corresponds to a time. The process of processing the raw performance data to obtain standardized data includes: The Z-score method is used to process each piece of raw performance data to obtain a preliminary standardized signal; The method for determining the Z-score is as follows: For a single piece of raw performance data R=[r1, r2, ..., r T ], where T represents the total number of sampling points, and r represents the radiation intensity of the corresponding sampling point; calculate the mean and standard deviation of the raw performance data: ; ; in This represents the mean of the original performance data. Represents the radiation intensity at the t-th sampling point. This represents the standard deviation of the original performance data; Then, standardization is performed on each sampling point in the original performance data R based on the mean and standard deviation of the original performance data: ; in The initial standardized radiation intensity corresponding to the radiation intensity at the t-th sampling point; according to The initial standardized signal S = [s1, s2, ..., s] is constructed. T ], where T represents the total number of sampling points, s T The initial standardized radiation intensity represents the radiation intensity corresponding to the Tth sampling point; Configure the center frequency, bandwidth, and attenuation coefficient of the notch filter, and input the preliminary normalized signal into the notch filter to obtain the intermediate signal: The intermediate signal is denoised using the wavelet thresholding method to obtain a standardized signal, which is used as the standardized data.
[0006] Step S2: Input the standardized data into the encoder, the encoder outputs temporal combination features, and perform weighted aggregation on the temporal combination features according to the attention mechanism to obtain sensitive features; Furthermore, step S2 includes: The encoder includes a primary encoder and a secondary encoder; The first-level encoder is used to set a sliding window of a fixed size, and to extract standardized data segment by segment according to the sliding window to obtain several signal segments; the signal segments are then subjected to linear transformation to obtain a signal vector. The secondary encoder employs a bidirectional long short-term memory artificial neural network, including a forward long short-term memory artificial neural network and a backward long short-term memory artificial neural network. The core parameters for configuring a bidirectional long short-term memory network include input gate parameters, forget gate parameters, and output gate parameters. Among them, the input gate parameters, forget gate parameters, and output gate parameters are all trainable weight matrices and trainable bias terms. The initial values of the trainable weight matrices and trainable bias terms are set through a random initialization method to ensure that the parameters are evenly distributed in the initial state.
[0007] The signal vectors are input sequentially into the feedforward long short-term memory artificial neural network from earliest to latest time to obtain the feedforward vector: The first step is to calculate the input gating value: the current input signal vector is concatenated with the temporal correlation vector of the previous time step according to the dimension to form a forward concatenation vector. The initial temporal correlation vector is set to a zero vector with the same dimension as the signal vector. The forward concatenation vector is multiplied by the trainable weight matrix of the input gate, and the trainable bias term of the input gate is added to obtain the forward input linear result. The sigmoid activation function is applied to the forward input linear result to map the result to the interval [0, 1] to generate the forward input gating value. This value is used to adjust the proportion of effective information in the current signal vector. The closer the value is to 1, the more effective information in the current signal vector can participate in the subsequent correlation operation. The second step is to calculate the forgetting gate value: using the same forward concatenation vector as in the first step, perform matrix multiplication with the trainable weight matrix of the forgetting gate, and add the trainable bias term of the forgetting gate to obtain the forward forgetting linear result; apply the sigmoid activation function to the forward forgetting linear result to generate the forward forgetting gate value. This value is used to adjust the proportion of historical information retained in the temporal correlation vector of the previous time step. The closer the value is to 1, the more historical temporal correlation information of the previous time step needs to be retained. The third step is to generate candidate time series information: generate trainable weight matrices and trainable bias terms for candidate time series information; continue to use the forward concatenation vector, perform matrix multiplication with the trainable weight matrix of candidate time series information, and superimpose the trainable bias terms of candidate time series information to obtain forward candidate linear results; apply the tanh activation function to the forward candidate linear results, map the results to the interval [-1, 1], and generate forward candidate time series information, which contains the potential time series features after fusing the current signal vector with the historical correlation information of the previous time step; The fourth step is to update the current temporal correlation vector: multiply the forward forgetting gate value with the temporal correlation vector of the previous time step by dimension to selectively retain historical temporal correlation information; multiply the forward input gate value with the forward candidate temporal information by dimension to selectively input effective information of the current signal vector; add the two product results by dimension to generate the temporal correlation vector of the current time step. This state integrates the filtered historical information and the current signal vector information and is the core storage carrier of forward temporal correlation. The fifth step is to generate the current temporal feature vector: perform matrix multiplication on the forward concatenation vector and the trainable weight matrix of the output gate, and add the trainable bias term of the output gate to obtain the forward output linear result; apply the sigmoid activation function to the forward output linear result to generate the forward output gate value, which is used to regulate the output ratio of the current temporal correlation vector to the temporal feature vector; apply the tanh activation function to the current temporal correlation vector, and multiply it by the forward output gate value in terms of dimension to generate the forward temporal feature vector corresponding to the current signal vector.
[0008] Finally, all signal vectors are arranged in the order of their corresponding forward temporal feature vectors from early to late, maintaining the original temporal order, to form a forward vector. Each dimension of this vector corresponds to a forward temporal feature of a signal vector and fully contains the continuous temporal correlation information of the signal vectors from early to late.
[0009] The signal vectors are input into the backward long short-term memory artificial neural network in chronological order from late to early to obtain the backward vector. The processing method is the same as that for obtaining the forward vector, only the order of input signal vectors is different.
[0010] The forward and backward vectors of each signal vector are concatenated to obtain the combined feature vector of that signal vector. All combined feature vectors are arranged in chronological order to obtain the temporal combined feature. Calculate the average value of each dimension of all combined feature vectors in the time series combined features to generate a reference feature vector; subtract each combined feature vector from the reference feature vector according to each dimension to obtain the deviation value of each combined feature vector in each dimension, forming the deviation vector of each combined feature vector; sum the absolute values of the deviation vector in each dimension according to the corresponding dimension to obtain the total deviation value of each combined feature vector; each total deviation value corresponds to a time series combined feature, the larger the value, the higher the probability that the time series combined feature contains sensitive information; the smaller the value, the lower the probability that the time series combined feature contains sensitive information.
[0011] The total deviation value is divided by the sum of all total deviation values to map the total deviation value to the interval between 0 and 1, thus obtaining the attention weight; The combined feature vector is multiplied by its corresponding attention weight according to the dimension to obtain a weighted combined feature vector; all weighted combined feature vectors are summed according to the dimension to obtain a sensitive feature vector, which is used to represent the sensitive feature.
[0012] Step S3: Design a classifier to map the sensitive features to a probability distribution of the running state; Furthermore, step S3 includes: The operating state refers to the intermediate value output by the encryption chip before the final calculation result when it performs the calculation. The classifier includes a hidden layer and an output layer. The sensitive features are input into the hidden layer, and the sensitive features are transformed into intermediate vectors through a preset hidden layer weight matrix. The dimension of the intermediate vectors is higher than that of the sensitive features, which is used to increase the vector dimension and avoid information compression and loss. The output layer is used to transform the intermediate vectors into result vectors through a preset output layer weight matrix. The dimension of the result vectors is the same as the number of values of the intermediate values, which is used to map the sensitive features. Divide the value of each dimension in the result vector by the sum of the values of all dimensions to obtain a probability vector, which is used to transform the values of each dimension into a probability distribution of the running state.
[0013] Step S4: Train the operation analysis model based on the probability distribution of the operation status; Furthermore, step S4 includes: The operational analysis model includes an encoder and a classifier; The intermediate value of the actual output of the encryption chip is recorded by the algorithm logic, and the intermediate value of the actual output is converted into a tag vector by one-hot encoding. The dimension of the tag vector is the same as that of the probability vector. Using the probability vector and label vector as input, a cross-entropy loss function is defined. The output of the cross-entropy loss function is the electromagnetic loss value, which represents the deviation between the probability vector and the label vector. The gradient of the electromagnetic loss value with respect to each parameter in the encoder and classifier is calculated using the backpropagation algorithm. The gradient direction represents the direction of parameter adjustment, and the gradient magnitude represents the degree of influence of the parameter on the electromagnetic loss value. The magnitude of each parameter is updated according to the gradient of each parameter to train the running analysis model.
[0014] An end-to-end performance analysis system based on an attention mechanism, comprising a data acquisition and processing module, a feature encoding and extraction module, a classification mapping probability module, and a model training and update module; The data acquisition and processing module is used to acquire the raw performance data generated during the runtime of the object to be analyzed, and to process the raw performance data to obtain standardized data. The data acquisition and processing module includes a raw data acquisition unit and a standardized data generation unit; The raw data acquisition unit is used to acquire raw performance data; The standardized data generation unit is used to process the original performance data using the Z-score method to obtain a preliminary standardized signal, input the preliminary standardized signal into a notch filter to obtain an intermediate signal, and then denoise the intermediate signal using the wavelet thresholding method to obtain a standardized signal, which is used as the standardized data.
[0015] The feature encoding extraction module is used to input the standardized data into the encoder to output temporal combination features, and to perform weighted aggregation of the temporal combination features according to the attention mechanism to obtain sensitive features; The feature encoding extraction module includes a temporal feature generation unit and a sensitive feature extraction unit; The temporal feature generation unit is used to input the standardized data into the first-level encoder and the second-level encoder to obtain temporal combined features; The sensitive feature extraction unit is used to calculate the average value of each dimension of all combined feature vectors in the temporal combined features according to the attention mechanism to generate a reference feature vector, subtract each combined feature vector from the reference feature vector by each dimension to obtain a deviation vector, sum the numerical values of each dimension of the deviation vector to obtain the total deviation value, divide the total deviation value by the sum of all total deviation values to obtain the attention weight, and multiply each combined feature vector by its corresponding attention weight by each dimension and then sum them by each dimension to obtain the sensitive feature.
[0016] The classification mapping probability module is used to design the classifier to map the sensitive features to the probability distribution of the running state; The classification mapping probability module includes a classifier operation unit and a probability distribution generation unit; The classifier operation unit is used to design a classifier that includes a hidden layer and an output layer. The sensitive features are input into the hidden layer and transformed into an intermediate vector through a preset hidden layer weight matrix. Then, the intermediate vector is transformed into a result vector through a preset output layer weight matrix. The probability distribution generation unit is used to divide the value of each dimension in the result vector by the sum of the values of all dimensions to obtain a probability vector. The probability vector is used to transform the values of each dimension into a probability distribution of the running state.
[0017] The model training and update module is used to train the operation analysis model according to the probability distribution of the operation status; The model training and update module includes a training label generation unit and a model parameter update unit; The training label generation unit is used to record the intermediate values of the actual output of the encryption chip through algorithm logic, and to convert the intermediate values of the actual output into label vectors using one-hot encoding. The dimension of the label vectors is the same as that of the probability vectors. The model parameter update unit is used to take the probability vector and label vector as input, define the cross-entropy loss function to output the electromagnetic loss value, calculate the gradient of the electromagnetic loss value with respect to each parameter in the encoder and classifier through the backpropagation algorithm, and update the magnitude of each parameter according to the gradient of each parameter.
[0018] The output of the data acquisition and processing module is connected to the input of the feature encoding extraction module; the output of the feature encoding extraction module is connected to the input of the classification mapping probability module; and the output of the classification mapping probability module is connected to the input of the model training and update module.
[0019] Compared with the prior art, the beneficial effects of the present invention are: 1. This invention processes the original electromagnetic radiation data of the encryption chip through a combination of Z-score normalization, notch filtering and wavelet threshold denoising. Then, it extracts the temporal combination features through a first-level sliding window truncation and a second-level bidirectional LSTM encoder. This effectively filters out redundant noise and interference signals, accurately preserves the temporal correlation information of the data, provides high-quality data support for sensitive feature extraction, and solves the problem of insufficient accuracy in traditional data processing.
[0020] 2. This invention calculates the deviation between temporal combination features and reference feature vectors through an attention mechanism, generates attention weights, and aggregates the combination features by weight. It can automatically identify and focus on key temporal nodes containing sensitive information, avoid interference from irrelevant features, eliminate the need for manual feature selection, break through the limitations of traditional methods that rely on human experience, and significantly improve the accuracy of sensitive information identification.
[0021] 3. This invention integrates data processing, feature extraction, classification mapping and model training through an end-to-end architecture. It combines the cross-entropy loss function and backpropagation algorithm to dynamically update parameters, enabling the model to adapt to differences in encryption chip hardware and changes in protection mechanisms without additional manual adjustments. This enhances the universality of diverse scenarios and improves the overall efficiency of performance analysis. Attached Figure Description
[0022] Figure 1 This is a flowchart illustrating an end-to-end performance analysis method based on an attention mechanism according to the present invention. Figure 2 This is a schematic diagram of the structure of an end-to-end performance analysis system based on an attention mechanism according to the present invention. Detailed Implementation
[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] Example 1: As Figure 1 As shown, this invention provides a technical solution: an end-to-end performance analysis method based on an attention mechanism, which includes the following steps: Step S1: Obtain the raw performance data generated during the runtime of the object to be analyzed, and process the raw performance data to obtain standardized data; Step S1 includes: The object to be analyzed is an encryption chip. The electromagnetic radiation generated by the encryption chip during the operation is sampled by an electromagnetic radiation detector to obtain raw performance data. The raw performance data is a time-series signal. Each raw performance data includes several sampling points and the electromagnetic radiation intensity corresponding to the sampling points. Each sampling point corresponds to a time. The process of processing the raw performance data to obtain standardized data includes: The Z-score method is used to process each piece of raw performance data to obtain a preliminary standardized signal; The method for determining the Z-score is as follows: For a single piece of raw performance data R=[r1, r2, ..., r T ], where T represents the total number of sampling points, and r represents the radiation intensity of the corresponding sampling point; calculate the mean and standard deviation of the raw performance data: ; ; in This represents the mean of the original performance data. Represents the radiation intensity at the t-th sampling point. This represents the standard deviation of the original performance data; Then, standardization is performed on each sampling point in the original performance data R based on the mean and standard deviation of the original performance data: ; in The initial standardized radiation intensity corresponding to the radiation intensity at the t-th sampling point; according to The initial standardized signal S = [s1, s2, ..., s] is constructed. T ], where T represents the total number of sampling points, s T The initial standardized radiation intensity represents the radiation intensity corresponding to the Tth sampling point; Configure the center frequency, bandwidth, and attenuation coefficient of the notch filter, and input the preliminary normalized signal into the notch filter to obtain the intermediate signal: The intermediate signal is denoised using the wavelet thresholding method to obtain a standardized signal, which is used as the standardized data.
[0025] Step S2: Input the standardized data into the encoder, the encoder outputs temporal combination features, and perform weighted aggregation on the temporal combination features according to the attention mechanism to obtain sensitive features; Step S2 includes: The encoder includes a primary encoder and a secondary encoder; The first-level encoder is used to set a sliding window of a fixed size, and to extract standardized data segment by segment according to the sliding window to obtain several signal segments; the signal segments are then subjected to linear transformation to obtain a signal vector. The secondary encoder employs a bidirectional long short-term memory artificial neural network, including a forward long short-term memory artificial neural network and a backward long short-term memory artificial neural network. The core parameters for configuring a bidirectional long short-term memory network include input gate parameters, forget gate parameters, and output gate parameters. Among them, the input gate parameters, forget gate parameters, and output gate parameters are all trainable weight matrices and trainable bias terms. The initial values of the trainable weight matrices and trainable bias terms are set through a random initialization method to ensure that the parameters are evenly distributed in the initial state.
[0026] The signal vectors are input sequentially into the feedforward long short-term memory artificial neural network from earliest to latest time to obtain the feedforward vector: The first step is to calculate the input gating value: the current input signal vector is concatenated with the temporal correlation vector of the previous time step according to the dimension to form a forward concatenation vector. The initial temporal correlation vector is set to a zero vector with the same dimension as the signal vector. The forward concatenation vector is multiplied by the trainable weight matrix of the input gate, and the trainable bias term of the input gate is added to obtain the forward input linear result. The sigmoid activation function is applied to the forward input linear result to map the result to the interval [0, 1] to generate the forward input gating value. This value is used to adjust the proportion of effective information in the current signal vector. The closer the value is to 1, the more effective information in the current signal vector can participate in the subsequent correlation operation. The second step is to calculate the forgetting gate value: using the same forward concatenation vector as in the first step, perform matrix multiplication with the trainable weight matrix of the forgetting gate, and add the trainable bias term of the forgetting gate to obtain the forward forgetting linear result; apply the sigmoid activation function to the forward forgetting linear result to generate the forward forgetting gate value. This value is used to adjust the proportion of historical information retained in the temporal correlation vector of the previous time step. The closer the value is to 1, the more historical temporal correlation information of the previous time step needs to be retained. The third step is to generate candidate time series information: generate trainable weight matrices and trainable bias terms for candidate time series information; continue to use the forward concatenation vector, perform matrix multiplication with the trainable weight matrix of candidate time series information, and superimpose the trainable bias terms of candidate time series information to obtain forward candidate linear results; apply the tanh activation function to the forward candidate linear results, map the results to the interval [-1, 1], and generate forward candidate time series information, which contains the potential time series features after fusing the current signal vector with the historical correlation information of the previous time step; The fourth step is to update the current temporal correlation vector: multiply the forward forgetting gate value with the temporal correlation vector of the previous time step by dimension to selectively retain historical temporal correlation information; multiply the forward input gate value with the forward candidate temporal information by dimension to selectively input effective information of the current signal vector; add the two product results by dimension to generate the temporal correlation vector of the current time step. This state integrates the filtered historical information and the current signal vector information and is the core storage carrier of forward temporal correlation. The fifth step is to generate the current temporal feature vector: perform matrix multiplication on the forward concatenation vector and the trainable weight matrix of the output gate, and add the trainable bias term of the output gate to obtain the forward output linear result; apply the sigmoid activation function to the forward output linear result to generate the forward output gate value, which is used to regulate the output ratio of the current temporal correlation vector to the temporal feature vector; apply the tanh activation function to the current temporal correlation vector, and multiply it by the forward output gate value in terms of dimension to generate the forward temporal feature vector corresponding to the current signal vector.
[0027] Finally, all signal vectors are arranged in the order of their corresponding forward temporal feature vectors from early to late, maintaining the original temporal order, to form a forward vector. Each dimension of this vector corresponds to a forward temporal feature of a signal vector and fully contains the continuous temporal correlation information of the signal vectors from early to late.
[0028] The signal vectors are input into the backward long short-term memory artificial neural network in chronological order from late to early to obtain the backward vector. The processing method is the same as that for obtaining the forward vector, only the order of input signal vectors is different.
[0029] The forward and backward vectors of each signal vector are concatenated to obtain the combined feature vector of that signal vector. All combined feature vectors are arranged in chronological order to obtain the temporal combined feature. Calculate the average value of each dimension of all combined feature vectors in the time series combined features to generate a reference feature vector; subtract each combined feature vector from the reference feature vector according to each dimension to obtain the deviation value of each combined feature vector in each dimension, forming the deviation vector of each combined feature vector; sum the absolute values of the deviation vector in each dimension according to the corresponding dimension to obtain the total deviation value of each combined feature vector; each total deviation value corresponds to a time series combined feature, the larger the value, the higher the probability that the time series combined feature contains sensitive information; the smaller the value, the lower the probability that the time series combined feature contains sensitive information.
[0030] The total deviation value is divided by the sum of all total deviation values to map the total deviation value to the interval between 0 and 1, thus obtaining the attention weight; The combined feature vector is multiplied by its corresponding attention weight according to the dimension to obtain a weighted combined feature vector; all weighted combined feature vectors are summed according to the dimension to obtain a sensitive feature vector, which is used to represent the sensitive feature.
[0031] Step S3: Design a classifier to map the sensitive features to a probability distribution of the running state; Step S3 includes: The operating state refers to the intermediate value output by the encryption chip before the final calculation result when it performs the calculation. The classifier includes a hidden layer and an output layer. The sensitive features are input into the hidden layer, and the sensitive features are transformed into intermediate vectors through a preset hidden layer weight matrix. The dimension of the intermediate vectors is higher than that of the sensitive features, which is used to increase the vector dimension and avoid information compression and loss. The output layer is used to transform the intermediate vectors into result vectors through a preset output layer weight matrix. The dimension of the result vectors is the same as the number of values of the intermediate values, which is used to map the sensitive features. Divide the value of each dimension in the result vector by the sum of the values of all dimensions to obtain a probability vector, which is used to transform the values of each dimension into a probability distribution of the running state.
[0032] Step S4: Train the operation analysis model based on the probability distribution of the operation status; Step S4 includes: The operational analysis model includes an encoder and a classifier; The intermediate value of the actual output of the encryption chip is recorded by the algorithm logic, and the intermediate value of the actual output is converted into a tag vector by one-hot encoding. The dimension of the tag vector is the same as that of the probability vector. Using the probability vector and label vector as input, a cross-entropy loss function is defined. The output of the cross-entropy loss function is the electromagnetic loss value, which represents the deviation between the probability vector and the label vector. The gradient of the electromagnetic loss value with respect to each parameter in the encoder and classifier is calculated using the backpropagation algorithm. The gradient direction represents the direction of parameter adjustment, and the gradient magnitude represents the degree of influence of the parameter on the electromagnetic loss value. The magnitude of each parameter is updated according to the gradient of each parameter to train the running analysis model.
[0033] For example: Object to be analyzed: AES-128 encryption chip; Raw performance data type: Electromagnetic radiation signal when the encryption chip performs one round of AES computation; Intermediate value: S-box output of the first round of the AES algorithm; Raw performance data acquisition: Electromagnetic radiation was sampled during the first round of computation of the AES-128 encryption chip using an electromagnetic radiation detector; the sampling rate was set to 125 MS / s and the sampling duration was set to 10 μs, resulting in one original time-series signal; this signal contains 1250 sampling points, and the electromagnetic radiation intensity at each sampling point corresponds to a range of -60 to -30, with the unit being dBμV / m; Preliminary standardization process: The Z-score method is used to process the original time-series signal; the mean of all sampling points of the original signal is calculated. = -45dBμV / m, standard deviation =5dBμV / m; thus, a preliminary standardized signal is obtained, containing 1250 sampling points with a value range of -3 to 3; Noise reduction processing: The initial standardized signal is input into a notch filter; the filter center frequency is set to 50Hz and the 3dB bandwidth is set to 1Hz to obtain an intermediate signal; the intermediate signal is then denoised using the wavelet thresholding method, with the wavelet basis set to db4 and the decomposition level set to 3, to obtain a standardized signal containing 1250 sampling points with a value range of -2.8 to 2.9. Level 1 encoder operations: The sliding window size is set to 10 sampling points, and the step size is 5 sampling points. The standardized signal containing 1250 sampling points is segmented to obtain 249 signal segments. The linear transformation parameters of the first-level encoder are configured, with the weight matrix dimension being 10×20 and the bias term dimension being 20×1. Each signal segment is multiplied by the weight matrix and the bias term is added to obtain 249 signal vectors, each with a dimension of 20×1. Second-level encoder operation: The second-level encoder adopts a bidirectional long short-term memory artificial neural network, with independent parameters for the forward and backward networks; The feedforward network is fed 249 signal vectors. Each signal vector is processed by the feedforward network to generate a feedforward local vector with a dimension of 32×1. The 249 feedforward local vectors are arranged in their original order to form a feedforward vector with a dimension of 249×32. The backward network is fed 249 signal vectors in chronological order from late to early. Each signal vector is processed by the backward network to generate a backward local vector with a dimension of 32×1. The 249 backward local vectors are arranged in the original chronological order to form a backward vector with a dimension of 249×32. The forward local vector and backward local vector corresponding to each signal vector are concatenated to obtain 249 combined feature vectors, each with a dimension of 64×1. All combined feature vectors are arranged in chronological order to form a temporal combined feature with a dimension of 249×64. Attention mechanism computation: The mean of each dimension of the 249 combined feature vectors in the temporal combined features is calculated to generate a reference feature vector with a dimension of 64×1. The difference between each combined feature vector and the reference feature vector is calculated dimensionally to obtain 249 deviation vectors, each with a dimension of 64×1. The squares of the values in each dimension of each deviation vector are summed to obtain 249 total deviation values, ranging from 0.5 to 12.3. Each total deviation value is divided by the sum of all total deviation values, resulting in a sum of 1562.8, yielding 249 attention weights, ranging from 0.0003 to 0.0079. Each combined feature vector and its corresponding attention weight are multiplied dimensionally to obtain 249 weighted combined feature vectors. All weighted combined feature vectors are summed dimensionally to obtain the sensitive feature vector. Classifier operation: The classifier consists of a hidden layer and an output layer. The hidden layer is configured with a weight matrix of dimension 64×128 and a bias term of dimension 128×1. After the sensitive feature vector is input into the hidden layer, it is multiplied by matrix multiplication and the bias term is superimposed to obtain an intermediate vector. The output layer is configured with a weight matrix and a bias term. After the intermediate vector is input into the output layer, it is multiplied by matrix multiplication and the bias term is superimposed to obtain a result vector. The value of each dimension of the result vector is divided by the sum of the values of all dimensions, which is 89.6, to obtain a probability vector with dimension 256×1 and a value range of 0.001 to 0.052. Tag vector generation: The AES algorithm is used to logically record the output of the encryption chip S-box, which is 0x32 (decimal 50). This real value is then converted into a tag vector using one-hot encoding. The vector has a dimension of 256×1, with the 51st dimension (counting from 0) having a value of 1 and the other dimensions having a value of 0. Model training: Using probability vectors and label vectors as input, a cross-entropy loss function is defined, with an initial output electromagnetic loss value of 0.86. The Adam optimizer is selected, with an initial learning rate of 0.001. 1000 sets of standardized signal and label vectors are input for each training data iteration, and the training is conducted for 100 rounds. After each training round, 500 sets of validation data are used to monitor the loss value. By the 100th round, the electromagnetic loss value drops to 0.08, and the prediction accuracy on the validation set reaches 92%. The training is then complete, and the running analysis model is obtained. The analysis model is used to verify the encryption performance of the cryptographic chip, for example: Sensitive feature splitting optimization: The S-box operation module of AES is split into several independent sub-modules; the electromagnetic radiation signal of the split encryption chip is re-acquired and processed according to step S1 to obtain a new standardized signal; the new standardized signal is input into the analysis model, and the highest value of the output attention weight decreases from 0.0079 to 0.0032, and the probability vector prediction accuracy decreases from 92% to 65%. Random clock delay optimization: At the moment corresponding to the signal vector of the encryption chip, i.e., the moment when the first-level encoder intercepts the signal segment, a delay of 1-3 clock cycles is inserted, with the clock frequency set to 11MHz and a single clock cycle of approximately 90.9ns; the electromagnetic radiation signal of the encryption chip after the delay is re-acquired and processed according to step S1 to obtain a new standardized signal; the new standardized signal is input into the running analysis model, and the correlation between the output time series combination features before and after the delay is reduced by 40%, and the probability vector prediction accuracy is reduced to 62%. Optimization and verification: Repeat steps S1 to S3 on the optimized encryption chip. The final electromagnetic loss value stabilizes at 0.52, and there is no obvious high value concentration area of attention weight, thus obtaining the optimized AES-128 encryption chip.
[0034] Example 2: Figure 2 As shown, the present invention provides an end-to-end performance analysis system based on an attention mechanism. The system includes a data acquisition and processing module, a feature encoding extraction module, a classification mapping probability module, and a model training and update module. The data acquisition and processing module is used to acquire the raw performance data generated during the runtime of the object to be analyzed, and to process the raw performance data to obtain standardized data. The data acquisition and processing module includes a raw data acquisition unit and a standardized data generation unit; The raw data acquisition unit is used to acquire raw performance data; The standardized data generation unit is used to process the original performance data using the Z-score method to obtain a preliminary standardized signal, input the preliminary standardized signal into a notch filter to obtain an intermediate signal, and then denoise the intermediate signal using the wavelet thresholding method to obtain a standardized signal, which is used as the standardized data.
[0035] The feature encoding extraction module is used to input the standardized data into the encoder to output temporal combination features, and to perform weighted aggregation of the temporal combination features according to the attention mechanism to obtain sensitive features; The feature encoding extraction module includes a temporal feature generation unit and a sensitive feature extraction unit; The temporal feature generation unit is used to input the standardized data into the first-level encoder and the second-level encoder to obtain temporal combined features; The sensitive feature extraction unit is used to calculate the average value of each dimension of all combined feature vectors in the temporal combined features according to the attention mechanism to generate a reference feature vector, subtract each combined feature vector from the reference feature vector by each dimension to obtain a deviation vector, sum the numerical values of each dimension of the deviation vector to obtain the total deviation value, divide the total deviation value by the sum of all total deviation values to obtain the attention weight, and multiply each combined feature vector by its corresponding attention weight by each dimension and then sum them by each dimension to obtain the sensitive feature.
[0036] The classification mapping probability module is used to design the classifier to map the sensitive features to the probability distribution of the running state; The classification mapping probability module includes a classifier operation unit and a probability distribution generation unit; The classifier operation unit is used to design a classifier that includes a hidden layer and an output layer. The sensitive features are input into the hidden layer and transformed into an intermediate vector through a preset hidden layer weight matrix. Then, the intermediate vector is transformed into a result vector through a preset output layer weight matrix. The probability distribution generation unit is used to divide the value of each dimension in the result vector by the sum of the values of all dimensions to obtain a probability vector. The probability vector is used to transform the values of each dimension into a probability distribution of the running state.
[0037] The model training and update module is used to train the operation analysis model according to the probability distribution of the operation status; The model training and update module includes a training label generation unit and a model parameter update unit; The training label generation unit is used to record the intermediate values of the actual output of the encryption chip through algorithm logic, and to convert the intermediate values of the actual output into label vectors using one-hot encoding. The dimension of the label vectors is the same as that of the probability vectors. The model parameter update unit is used to take the probability vector and label vector as input, define the cross-entropy loss function to output the electromagnetic loss value, calculate the gradient of the electromagnetic loss value with respect to each parameter in the encoder and classifier through the backpropagation algorithm, and update the magnitude of each parameter according to the gradient of each parameter.
[0038] The output of the data acquisition and processing module is connected to the input of the feature encoding extraction module; the output of the feature encoding extraction module is connected to the input of the classification mapping probability module; and the output of the classification mapping probability module is connected to the input of the model training and update module.
[0039] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
Claims
1. An end-to-end performance analysis method based on an attention mechanism, characterized in that: The method includes the following steps: Step S1: Obtain the raw performance data generated during the runtime of the object to be analyzed, and process the raw performance data to obtain standardized data; Step S2: Input the standardized data into the encoder, the encoder outputs temporal combination features, and perform weighted aggregation on the temporal combination features according to the attention mechanism to obtain sensitive features; Step S3: Design a classifier to map the sensitive features to a probability distribution of the running state; Step S2 includes: The encoder includes a primary encoder and a secondary encoder; The first-level encoder is used to set a sliding window of a fixed size, and to extract standardized data segment by segment according to the sliding window to obtain several signal segments; the signal segments are then subjected to linear transformation to obtain a signal vector. The secondary encoder employs a bidirectional long short-term memory artificial neural network, including a forward long short-term memory artificial neural network and a backward long short-term memory artificial neural network. The signal vectors are input sequentially into the feedforward long short-term memory artificial neural network in chronological order from morning to night to obtain the feedforward vector; The signal vectors are input sequentially into the backward long short-term memory artificial neural network in chronological order from late to early to obtain the backward vector. The forward and backward vectors of each signal vector are concatenated to obtain the combined feature vector of that signal vector. All combined feature vectors are arranged in chronological order to obtain the temporal combined feature. Calculate the average value of each dimension of all combined feature vectors in the time series combined features to generate a reference feature vector; subtract each combined feature vector from the reference feature vector according to each dimension to obtain the deviation value of each combined feature vector in each dimension, forming the deviation vector of each combined feature vector; sum the absolute values of the deviation vector in each dimension according to the corresponding dimension to obtain the total deviation value of each combined feature vector. The total deviation value is divided by the sum of all total deviation values to map the total deviation value to the interval between 0 and 1, thus obtaining the attention weight; Multiply the combined feature vector by its corresponding attention weight according to the dimension to obtain a weighted combined feature vector; sum all the weighted combined feature vectors according to the dimension to obtain a sensitive feature vector, which is used to represent the sensitive feature. Step S4: Train the operation analysis model based on the probability distribution of the operation status.
2. The end-to-end performance analysis method based on attention mechanism according to claim 1, characterized in that: Step S1 includes: The object to be analyzed is an encryption chip. The electromagnetic radiation generated by the encryption chip during the operation is sampled by an electromagnetic radiation detector to obtain raw performance data. The raw performance data is a time-series signal. Each raw performance data includes several sampling points and the electromagnetic radiation intensity corresponding to the sampling points. Each sampling point corresponds to a time. The process of processing the raw performance data to obtain standardized data includes: The Z-score method is used to process each piece of raw performance data to obtain a preliminary standardized signal; The preliminary standardized signal is input into a notch filter to obtain an intermediate signal; the intermediate signal is then denoised using a wavelet thresholding method to obtain a standardized signal, which is used as the standardized data.
3. The end-to-end performance analysis method based on an attention mechanism according to claim 2, characterized in that: Step S3 includes: The operating state refers to the intermediate value output by the encryption chip before the final calculation result when it performs the calculation. The classifier includes a hidden layer and an output layer. The sensitive features are input into the hidden layer, and the sensitive features are transformed into intermediate vectors through a preset hidden layer weight matrix. The dimension of the intermediate vectors is higher than that of the sensitive features. The output layer is used to transform the intermediate vectors into result vectors through a preset output layer weight matrix. The dimension of the result vectors is the same as the number of values of the intermediate values, and it is used to map the sensitive features. Divide the value of each dimension in the result vector by the sum of the values of all dimensions to obtain a probability vector, which is used to transform the values of each dimension into a probability distribution of the running state.
4. The end-to-end performance analysis method based on an attention mechanism according to claim 3, characterized in that: Step S4 includes: The operational analysis model includes an encoder and a classifier; The intermediate value of the actual output of the encryption chip is recorded by the algorithm logic, and the intermediate value of the actual output is converted into a tag vector by one-hot encoding. The dimension of the tag vector is the same as that of the probability vector. Using the probability vector and label vector as input, a cross-entropy loss function is defined. The output of the cross-entropy loss function is the electromagnetic loss value, which represents the deviation between the probability vector and the label vector. The gradient of the electromagnetic loss value with respect to each parameter in the encoder and classifier is calculated using the backpropagation algorithm. The gradient direction represents the direction of parameter adjustment, and the gradient magnitude represents the degree of influence of the parameter on the electromagnetic loss value. The magnitude of each parameter is updated according to the gradient of each parameter to train the running analysis model.
5. An end-to-end performance analysis system based on an attention mechanism, applied to the end-to-end performance analysis method based on an attention mechanism as described in any one of claims 1-4, characterized in that: The system includes a data acquisition and processing module, a feature encoding and extraction module, a classification mapping probability module, and a model training and update module. The data acquisition and processing module is used to acquire the raw performance data generated by the object to be analyzed during runtime, and process the raw performance data to obtain standardized data. The feature encoding and extraction module is used to input the standardized data into the encoder to output temporal combined features, and perform weighted aggregation of the temporal combined features according to the attention mechanism to obtain sensitive features. The classification mapping probability module is used to design a classifier to map the sensitive features to a probability distribution of the running state; the model training and update module is used to train the running analysis model according to the probability distribution of the running state. The output of the data acquisition and processing module is connected to the input of the feature encoding extraction module; the output of the feature encoding extraction module is connected to the input of the classification mapping probability module; and the output of the classification mapping probability module is connected to the input of the model training and update module.
6. The end-to-end performance analysis system based on an attention mechanism according to claim 5, characterized in that: The data acquisition and processing module includes a raw data acquisition unit and a standardized data generation unit; The raw data acquisition unit is used to acquire raw performance data; The standardized data generation unit is used to process the original performance data using the Z-score method to obtain a preliminary standardized signal, input the preliminary standardized signal into a notch filter to obtain an intermediate signal, and then denoise the intermediate signal using the wavelet thresholding method to obtain a standardized signal, which is used as the standardized data.
7. An end-to-end performance analysis system based on an attention mechanism according to claim 5, characterized in that: The feature encoding extraction module includes a temporal feature generation unit and a sensitive feature extraction unit; The temporal feature generation unit is used to input the standardized data into the first-level encoder and the second-level encoder to obtain temporal combined features; The sensitive feature extraction unit is used to calculate the average value of each dimension of all combined feature vectors in the temporal combined features according to the attention mechanism to generate a reference feature vector, subtract each combined feature vector from the reference feature vector by each dimension to obtain a deviation vector, sum the numerical values of each dimension of the deviation vector to obtain the total deviation value, divide the total deviation value by the sum of all total deviation values to obtain the attention weight, and multiply each combined feature vector by its corresponding attention weight by each dimension and then sum them by each dimension to obtain the sensitive feature.
8. An end-to-end performance analysis system based on an attention mechanism according to claim 5, characterized in that: The classification mapping probability module includes a classifier operation unit and a probability distribution generation unit; The classifier operation unit is used to design a classifier that includes a hidden layer and an output layer. The sensitive features are input into the hidden layer and transformed into an intermediate vector through a preset hidden layer weight matrix. Then, the intermediate vector is transformed into a result vector through a preset output layer weight matrix. The probability distribution generation unit is used to divide the value of each dimension in the result vector by the sum of the values of all dimensions to obtain a probability vector. The probability vector is used to transform the values of each dimension into a probability distribution of the running state.
9. An end-to-end performance analysis system based on an attention mechanism according to claim 5, characterized in that: The model training and update module includes a training label generation unit and a model parameter update unit; The training label generation unit is used to record the intermediate values of the actual output of the encryption chip through algorithm logic, and to convert the intermediate values of the actual output into label vectors using one-hot encoding. The dimension of the label vectors is the same as that of the probability vectors. The model parameter update unit is used to take the probability vector and label vector as input, define the cross-entropy loss function to output the electromagnetic loss value, calculate the gradient of the electromagnetic loss value with respect to each parameter in the encoder and classifier through the backpropagation algorithm, and update the magnitude of each parameter according to the gradient of each parameter.