## 3 Dataset Processing Based on Simulated Annealing Algorithm
Tarrival represents the range of the arrival time of the electric vehicle; \(i\) indicates the serial number of the vehicle. \[t_{6}\leq T_{\text{arrival}}^{i}\leq t_{7} \tag{6}\]  
Equation (7) is the interval range for the departure time of each vehicle. \(T_{8}\) is 21:00; \(T_{9}\) is 22:00. Tdepeture indicates the departure time of each vehicle; \(i\) indicates the serial number of the vehicle. \[t_{8}\leq T_{\text{departure}}^{i}\leq t_{9} \tag{7}\]  
Equation (8) shows the value of the initial SOC range. \[0.3\leq\text{SOC}_{\text{initial}}\leq 0.35 \tag{8}\]  
Equation (9) indicates the target value of the SOC, i.e., the lowest value after charging is completed. SOCrequired has a value of 0.2. \[\text{SOC}_{\text{finally}}=\text{SOC}_{\text{initial}}+\text{SOC}_{\text{required}} \tag{9}\]  
Equation (10) represents the SOC constraints. \[\text{SOC}_{\text{min}}\leq\text{SOC}(T)\leq\text{SOC}_{\text{max}} \tag{10}\]  
Equation (11) indicates the change in SOC, where \(S\) represents the battery capacity of the electric vehicle, Kop represents the charging power, and Koi represents the discharge power. \[\text{SOC}(T)= \begin{cases}SOC(T-1)+\frac{P_{\text{EVi}}(T)\cdot T\cdot\text{ Kop}}{S},&0<P_{\text{EVi}}(T)\\ SOC(T-1)+\frac{P_{\text{EVi}}(T)\cdot T}{S\cdot\text{Kot}},&P_{\text{EVi}}(T)<0 \end{cases}  \tag{11}\]  
Equation (12) represents the value of \(P_{\text{EVi}}\), where \(P_{\text{charge}}\) represents the charging power; \(P_{\text{discharge}}\) represents the discharge power; \(P_{\text{nothing}}\) means that it is neither charging nor discharging at this time. \[P_{\text{EVi}}= \begin{cases}P_{\text{charge}},&0\leq P_{\text{EVi}}\\ P_{\text{discharge}},&0\geq P_{\text{EVi}}\\ P_{\text{nothing}},&0=P_{\text{EVi}}\end{cases}  \tag{12}\]  
Equation (13) represents the fitness function in the simulated annealing algorithm. The goal of the fitness function is to minimize the cost of electricity and meet the requirements of the eventual SOC increase. Penalties are imposed if the SOC requirements are not met. SOC\({}_{\text{final}}\) is the ultimate SOC for electric vehicles. \[\text{Fitness}= \begin{cases}\text{Cost},&if\text{SOC}_{\text{final}}\geq\text{ SOC}_{\text{initial}}+\text{SOC}_{\text{required}}\\ \infty,&if\text{SOC}_{\text{final}}<\text{SOC}_{\text{initial}}+\text{SOC}_{ \text{required}}\end{cases}  \tag{13}\]  
Equation (14) indicates the probability formula for accepting the new solution. where Current Fitness is the fitness value of the current solution; New Fitness is the fitness value of the new solution; Temperature is the current \"temperature\". \[P_{\text{accept}}=\text{exp}(\frac{\text{Current Fitness}-\text{New Fitness}}{ \text{Temperature}}) \tag{14}\]  
Equation (15) indicates the temperature update formula (cooling rate). where Cooling Rate is the cooling rate, which in this model is 0.98. \[\text{Temperature}=\text{Temperature-Cooling Rate} \tag{15}\]  
Equation (16) indicates that the load of the mall is lost at a certain time step in the attack simulation formula, and the load is set to 0 at this time. \[P_{\text{grid}}=0 \tag{16}\]  
In summary, this section demonstrates the effectiveness of the BEMS model constructed using the Simulated Annealing algorithm in optimizing EV charging and discharging behaviors and reducing costs, while also introducing attack simulations. Additionally, this model provides a dataset for subsequent machine learning applications.