## 4 BILSTM-Transformer Based Bems Model
### Microgrid Optimization Method Based on Cognitive Control
#### 4.5.3 Quantification of Information Gap
\[C(t)=\sum_{i=1}^{n}\bigl{(}C_{\text{energy}}(t)+C_{\text{gap}}(t)\bigr{)} \tag{23}\]  
In Function (23), \(C_{\text{energy}}(t)\) represents the energy cost at time step \(t\), and \(C_{\text{gap}}(t)\) represents the cost due to information gaps. In offline training, the cognitive control system evaluates the scheduling effect based on this cost function. By minimizing this joint-cost function, the cognitive control system can balance the relationship between data loss, information uncertainty, and actual energy consumption in an uncertain environment, so as to realize the optimal scheduling of BEMS. The program implementation of the joint-cost function is shown in Algorithm 4. ``` for each time step t do  Calculate energy cost C_energy(t)  Calculate information gap cost C_gap(t)  Compute total cost:  C(t) = \(\Sigma\_\)i = 1\(\text{\text{\text{\text{\text{\text{\text{\text{\text{\text{\text{ \



after a certain period, and the latest data provided by CPS is used to update the model to ensure the timeliness of network parameters. In the online phase, the system predicts changes in the load of the small and further optimizes these predictions through a filtering process. The main purpose of filtering is to remove noise and outliers from the data, ensuring that the model can make more accurate and stable decisions. This method enables the system to accurately track the real-time trend in power demand in shopping malls, providing a reliable basis for subsequent scheduling. Once the filtered forecast data are available, the CPS will enable BEMS to guide the decentralized, real-time dispatch of EVs across multiple parking lots. This approach not only balances the load between different parking lots but also flexibly adjusts the charging strategy based on fluctuations in the mall's load demand, thus avoiding the strain on the mall's overall power system. This scheduling process continues during mall business hours, ensuring efficient distribution of power resources to meet the needs of malls and electric vehicles at different times of the day. A large amount of data generated during the scheduling process is collected by the CPS, including load prediction values, filtered data, and the charging status of electric vehicles in the parking lot, etc., which are recorded and fed back to the system for subsequent offline retraining to improve the performance of the model. By learning and optimizing historical data, the system can better adapt to the fluctuating pattern of power demand in shopping malls and gradually improve the overall decision-making ability and accuracy of the BEMS system, so as to achieve more efficient power management. Figure 3 shows the operational process of the entire system. ## 5 Result Analysis

This Section is divided into three paragraphs. Section 5.1 introduces the training and testing sets of the experiment, as well as different comparison samples. Section 5.2 introduces the learning performance of the BiLSTM-Transformer network. Section 5.3 analyzed the forecasting results of different situations

### Experimental Dataset and Comparative Samples

In order to effectively predict the load of the mall after scheduling, we collected data for 100 days of the year as the original research material. First, we generated the optimized dataset by simulated annealing (SA). The dataset records in detail key data such as the \(P_{\text{grid}}(t)\), the \(P_{\text{demand}}(t)\), the charging and discharging power of electric vehicles \(P_{\text{EVi}}(t)\), and the time-of-use electricity price (C) of the upper and lower grids. The optimized dataset

Figure 3: Overall implementation procedure of BiLSTM–Transformer-based BEMS model. serves as the basis for subsequent model training. The optimised 100-day grid power consumption dataset is shown in Figure 4, where different colours are used to represent the grid power consumption curves for different days, and the daily grid power consumption is divided into 720 steps for subsequent network learning.