## 3 Case Study
### Data Preprocessing  
The flow diagram of the preprocessing operations adopted in this study is shown in Figure 14.  
The processing of each step is described as follows. 1. Data Cleaning. Many problems may occur during data collection, such as malfunctioning of vehicle sensors, poor network transmission when uploading data, etc. Therefore, the collected data may contain outliers and missing values. Observation of the dataset reveals that the following special cases occur: * The vehicle models collected in the dataset are of the same brand and the same model, and thus the Vehicle ID field and the data collection time field do not affect this study; * The vehicle operating states collected in the dataset are all in the purely electric operating state, and the operating mode data fields are all \"1\"; * The total number of individual batteries for the selected models is 95, and the total number of individual battery temperature probes is 34, and both fields are fixed values;  
Figure 14: Preprocessing flow diagram. Figure 13: Raw and used fault codes and their corresponding number of faults: (**a**) raw fault codes; (**b**) selected fault codes; (**c**) expanded fault codes. The maximum voltage battery number, the minimum voltage battery number, the maximum temperature subsystem number, and the minimum temperature subsystem number are all \"1\";
* The charging and storage device fault code list field is null, with no available data;
* There are several cases with the same value: fault codes \"8192\", \"32,768\", \"40,960\", \"57,344\", and \"73,728\" in the \"speed\" column; fault code \"4096\" in the \"vehicle_state\" column; fault codes \"8192\", \"32,768\", \"40,960\", \"57,344\", \"65,536\", \"73,728\" in the \"max_alarm_lv\" column; fault codes \"32,768\", \"40,960\", \"57,344\", \"65,536\", \"73,728\" in the \"dcdc_stat\" column; fault codes \"8192\", \"32,768\", \"40,960\", \"65,536\", \"73,728\" in the \"gear\" column. The above situations do not affect the feature extraction project of this study and are deleted (Table 2). Therefore, the data dimension has changed from 36 to 21. Data expansion. Since the number of various types of data samples in the training data have a large gap, i.e., the training samples are unbalanced, this will lead to a large deviation in the accuracy of the training results. Therefore, oversampling the data samples with a small number of sample categories and reducing the number of larger samples constitute two steps that were applied to achieve the purpose of balancing the samples simultaneously. Data with more than 1250 data volumes were randomly sampled to 1250 pieces of data. Because most of the data volume of generating operational fault data was not up to 1250, the linear difference method was utilized for data expansion; the formula for linear interpolation is:  
\[x_{\text{new}}=x_{\text{a}}+\frac{(x_{\text{b}}-x_{\text{a}})}{\sigma}\times\delta \tag{2}\]  
where \(x_{\text{new}}\) is the newly generated sample data; \(x_{\text{a}}\) and \(x_{\text{b}}\) are the two original sample data before and after, respectively; \(\sigma\) is the number of new data inserted in the middle of the original sample; \(\delta\) is the location of the new data generation (From Figure 10b,c). Data normalization. To remove the magnitude gap present between dimensional data and retain the relationships that exist in the original data, we normalized the data. The practice max-min normalization maps the data values to the range of [0, 1], as  
\[x_{\text{norm}}=\frac{x-x_{\text{min}}}{x_{\text{max}}-x_{\text{min}}} \tag{3}\]  
where \(x_{\text{norm}}\) is the normalized data; \(x\) is the original data; \(x_{\text{max}}\) is the maximum value of the column in which the sample data are located; \(x_{\text{min}}\) is the minimum value of the column in which the sample data are located. Correlation analysis. After the above processing steps, the dataset was reduced to 21 columns, including 20 columns of data utilized for feature extraction and the last column of labeled data.