End-to-end performance analysis system and method based on attention mechanism

By employing an end-to-end performance analysis method based on an attention mechanism, the accuracy and adaptability issues in side-channel analysis are resolved, enabling efficient and automated identification and analysis of sensitive information, and adapting to diverse encryption chip scenarios.

CN121750190APending Publication Date: 2026-03-27SHANGHAI JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-18
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing technologies suffer from insufficient accuracy and low efficiency in side-channel performance analysis, making it difficult to adapt to diverse analysis scenarios and lacking universality due to reliance on human experience.

Method used

An end-to-end performance analysis method based on attention mechanism is adopted. The electromagnetic radiation data of the encryption chip is processed by Z-score normalization, notch filtering and wavelet thresholding. The temporal combination features are extracted by combining a first-level sliding window and a second-level bidirectional LSTM encoder. The feature bias is calculated by using attention mechanism to generate weighted aggregation. The classifier is designed to be mapped to the probability distribution of the running state. The model is trained by combining cross-entropy loss function and backpropagation algorithm.

Benefits of technology

It effectively filters out redundant noise, accurately retains data time-series correlation information, automatically identifies sensitive information, improves identification accuracy, adapts to differences in encryption chip hardware and changes in protection mechanisms, and enhances universality and analysis efficiency for diverse scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
Patent Text Reader

Abstract

The invention discloses an end-to-end performance analysis system and method based on an attention mechanism, and relates to the field of network security. Original performance data of an encryption chip is collected and preprocessed, and noise is eliminated through Z-score standardization, notch filtering and wavelet denoising; using a sliding window and a bidirectional long-short-term memory artificial neural network to extract combined features with time sequence association; an attention mechanism is introduced to automatically calculate a deviation value of each moment feature and generate a weight, and irrelevant interference is inhibited; the weighted and aggregated sensitive features are mapped into probability distribution of an operation state through a classifier; the system integrates the modules, and through end-to-end training, model parameters are optimized through a cross entropy loss function and a back propagation algorithm. According to the method, the automation and self-adaption of feature extraction are realized, and the precision and anti-interference performance of side channel analysis and the universality of diversified scenes are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

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 attention mechanism based end-to-end performance analysis method, characterized in that: The method comprises the following steps: Step S1, obtaining original performance data generated by a to-be-analyzed object in operation, and processing the original performance data to obtain standardized data; Step S2, inputting the standardized data into an encoder, the encoder outputting time sequence combination features, and weighting and aggregating the time sequence combination features according to an attention mechanism to obtain sensitive features; Step S3, designing a classifier to map the sensitive features to a probability distribution of an operating state; Step S4, training an operation analysis model according to the probability distribution of the operating state. 2.The end-to-end performance analysis method based on attention mechanism according to claim 1, wherein: The step S1 comprises: The to-be-analyzed object is an encryption chip, and the original performance data is obtained by sampling electromagnetic radiation generated when the encryption chip is operated by an electromagnetic radiation detector; the original performance data is a time sequence signal, each piece of original performance data comprises a plurality of sampling points and electromagnetic radiation intensity corresponding to the sampling points, and each sampling point corresponds to a time point; The process of processing the original performance data to obtain standardized data comprises: The original performance data is processed by a Z-score method to obtain a preliminary standardized signal; The preliminary standardized signal is input into a notch filter to obtain an intermediate signal, and the intermediate signal is denoised by a wavelet threshold method to obtain a standardized signal as the standardized data. 3.The end-to-end performance analysis method based on attention mechanism according to claim 2, characterized in that: The step S2 comprises: The encoder comprises a primary encoder and a secondary encoder; The primary encoder is configured to set a fixed-size sliding window, segmentally cut the standardized data according to the sliding window to obtain a plurality of signal segments, and perform linear transformation on the signal segments to obtain signal vectors; The secondary encoder adopts a bidirectional long short-term memory artificial neural network, comprising a forward long short-term memory artificial neural network and a backward long short-term memory artificial neural network; The signal vectors are sequentially input into the forward long short-term memory artificial neural network in chronological order from early to late to obtain forward vectors; The signal vectors are sequentially input into the backward long short-term memory artificial neural network in chronological order from late to early to obtain backward vectors; The forward vector and the backward vector of each signal vector are spliced to obtain a combination feature vector of the signal vector, and all combination feature vectors are arranged in chronological order to obtain the time sequence combination features; The average value of each dimension of all combination feature vectors in the time sequence combination features is calculated to generate a reference feature vector; the difference between each combination feature vector and the reference feature vector is calculated in each dimension to obtain a deviation value of each combination feature vector in each dimension, and a deviation vector of each combination feature vector is formed; the absolute values of the deviation vector in each dimension are summed according to the corresponding dimensions to obtain a total deviation value of each combination 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 of 0 to 1 to obtain an attention weight; The combination feature vector and the corresponding attention weight are multiplied in each dimension to obtain a weighted combination feature vector; and all weighted combination feature vectors are summed in each dimension to obtain a sensitive feature vector for representing the sensitive features.

4. The end-to-end performance analysis method based on attention mechanism according to claim 3, characterized in that: The step S3 comprises: The running state is an intermediate value output by the encryption chip before a final operation result is output when the encryption chip performs an operation; The classifier comprises a hidden layer and an output layer; the sensitive feature is input into the hidden layer, and the sensitive feature is converted into an intermediate vector through a preset hidden layer weight matrix; the intermediate vector has a higher dimension than the sensitive feature; the output layer is used for converting the intermediate vector into a result vector through a preset output layer weight matrix; the result vector has the same dimension as the number of values of the intermediate value, and is used for mapping the sensitive feature; The values of each dimension in the result vector are divided by the sum of the values of all dimensions respectively to obtain a probability vector; the probability vector is used for converting the values of each dimension into a probability distribution of the running state.

5. The end-to-end performance analysis method based on attention mechanism according to claim 4, characterized in that: The step S4 comprises: The running analysis model comprises an encoder and a classifier; The intermediate value actually output by the encryption chip is recorded through an algorithm logic, and the actually output intermediate value is converted into a label vector through one-hot encoding; the label vector has the same dimension as the probability vector; The probability vector and the label vector are taken as inputs, a cross-entropy loss function is defined, the output of the cross-entropy loss function is an electromagnetic loss value, which is used for representing the deviation between the probability vector and the label vector; the gradient of each parameter in the encoder and the classifier with respect to the electromagnetic loss value is calculated through a back propagation algorithm; the gradient direction represents the direction of parameter adjustment, and the gradient size represents the influence degree of the parameter on the electromagnetic loss value; the size of each parameter is updated according to the gradient of each parameter, and the running analysis model is trained.

6. An attention mechanism-based end-to-end performance analysis system, applied to the attention mechanism-based end-to-end performance analysis method of any one of claims 1-5, characterized in that: The system comprises a data acquisition and processing module, a feature coding and extraction module, a classification and mapping probability module and a model training and updating module; the data acquisition and processing module is used for acquiring original performance data generated when a to-be-analyzed object runs, and processing the original performance data to obtain standardized data; the feature coding and extraction module is used for inputting the standardized data into an encoder to output time sequence combination features, and weighting and aggregating the time sequence combination features according to an attention mechanism to obtain sensitive features; The classification and mapping probability module is used for designing a classifier to map the sensitive features into a probability distribution of a running state; the model training and updating module is used for training a running analysis model according to the probability distribution of the running state; The output end of the data acquisition and processing module is connected to the input end of the feature coding and extraction module; the output end of the feature coding and extraction module is connected to the input end of the classification and mapping probability module; and the output end of the classification and mapping probability module is connected to the input end of the model training and updating module.

7. The end-to-end performance analysis system based on attention mechanism according to claim 6, wherein: The data acquisition and processing module comprises an original data acquisition unit and a standardized data generation unit; The original data acquisition unit is used for acquiring original performance data; The standardized data generation unit is used for processing the original performance data through a Z-score method to obtain a preliminary standardized signal, inputting the preliminary standardized signal into a notch filter to obtain an intermediate signal, and then de-noising the intermediate signal through a wavelet threshold method to obtain a standardized signal as the standardized data. 8.The attention mechanism based end-to-end performance analysis system of claim 6, wherein: The feature coding and extraction module comprises a time sequence feature generation unit and a sensitive feature extraction unit; The timing feature generation unit is configured to input the standardized data into a primary encoder and a secondary encoder to obtain timing combination features; The sensitive feature extraction unit is configured to calculate a reference feature vector according to an average value of each dimension of all combination feature vectors in the timing combination features, and to obtain a deviation vector by subtracting the reference feature vector from each combination feature vector in the timing combination features, and to obtain a total deviation value by summing the values of each dimension of the deviation vector, and to obtain an attention weight by dividing the total deviation value by a sum of all total deviation values, and to obtain a sensitive feature by multiplying each combination feature vector by the corresponding attention weight and summing the values of each dimension. 9.The attention mechanism based end-to-end performance analysis system of claim 6, wherein: The classification mapping probability module includes a classifier operation unit and a probability distribution generation unit; The classifier operation unit is configured to design a classifier including a hidden layer and an output layer, to input the sensitive feature into the hidden layer to convert the sensitive feature into an intermediate vector through a preset hidden layer weight matrix, and to convert the intermediate vector into a result vector through a preset output layer weight matrix of the output layer; The probability distribution generation unit is configured to divide the value of each dimension of the result vector by a sum of the values of all dimensions to obtain a probability vector, and to convert the value of each dimension of the probability vector into a probability distribution of an operating state. 10.The attention mechanism based end-to-end performance analysis system of claim 6, wherein: The model training update module includes a training label generation unit and a model parameter update unit; The training label generation unit is configured to record an intermediate value actually output by the encryption chip through an algorithm logic, and to convert the intermediate value actually output by the encryption chip into a label vector through one-hot encoding, wherein the label vector has the same number of dimensions as the probability vector; The model parameter update unit is configured to take the probability vector and the label vector as input, to define a cross-entropy loss function to output an electromagnetic loss value, to calculate a gradient of each parameter in the encoder and the classifier with respect to the electromagnetic loss value through a back propagation algorithm, and to update the size of each parameter according to the gradient of each parameter.