## 3 The Proposed SP-IoUAV Model
### Intrusion Detection System (IDS)
#### 3.3.2 Intrusion Detection Engine
```
Data: Current Blacklist Blacklistcurrent, New Intrusion \(\varepsilon\)new Result: Updated Blacklist Blacklistupdated begin ifenew is not in Blacklistcurrentthen Add \(\varepsilon\)new to Blacklistcurrent using Equation (26); end if else Update the entry for \(\varepsilon\)new in Blacklistcurrent using Equation (26); end if Blacklistupdated \(\leftarrow\) Blacklistcurrent; end
```
**Algorithm 8** Blacklist Management Algorithm

**Real-Time Alert Provision:** In our proposed model, real-time alert provision serves as a crucial mechanism for promptly notifying key stakeholders about detected security threats. Specifically, the mechanism sends alerts to the smart city control center, the privacy-preserving ensemble, and individual UAVs. When it comes to UAVs, real-time alert provision offers flexibility in notification methods. Depending on the nature and severity of the detected intrusion, UAV operators can receive notifications either on a global level, where all UAVs are informed collectively, or on an individual level, where each UAV is notified separately. This adaptability allows UAV operators to tailor their response strategies based on the specific context of the intrusion. By notifying the smart city control center, the privacy-preserving ensemble, and UAVs in a timely manner, our proposed model ensures a coordinated and swift response to security threats. This proactive approach enhances the overall security and resilience of UAV operations in the dynamic smart-city environment, facilitating effective threat mitigation and safeguarding critical assets and data. Algorithm 9 summarizes the real-time alert provision mechanism. ```
Data: Detected Intrusion Type \(T_{\text{intrusion}}\), UAV Operators' Preference \(P_{\text{UAV}}\) Result: Alert Notifications begin ifDetected Intrusion Type \(T_{\text{intrusion}}\) is Criticalthen Send alert to smart city control center; Send alert to Pprivacy-preserving ensemble; end if ifUAV Operators' Preference \(P_{\text{UAV}}\) is Globalthen Send global alert to all UAVs; end if elseifUAV Operators' Preference \(P_{\text{UAV}}\) is Individualthen for each UAV in the networkdo Send individual alert to UAV; end if end if
```
**Algorithm 9** Real-Time Alert Provision Algorithm

**Real-Time Alert Provision Algorithm**In the real-time alert provision algorithm, the variables \(T_{\text{intrusion}}\) and \(P_{\text{UAV}}\) hold crucial roles. \(T_{\text{intrusion}}\) represents the type of detected intrusion, while \(P_{\text{UAV}}\) captures the UAV operators' preferences for alert notifications, whether they prefer global alerts or individual alerts. The algorithm begins by assessing the severity of the detected intrusion. For critical intrusions, alerts are dispatched to the smart city control center, the privacy-preserving ensemble, and UAVs based on their specified preference. In cases where the intrusion is not deemed critical, the algorithm sends alerts exclusively to UAVs, again adhering to their preferred notification method. By employing this approach, the algorithm ensures that relevant entities receive timely notifications tailored to the nature of the intrusion and the specific preferences of UAV operators. #### 3.3.4 Intrusion Detection Database

The database is a crucial component in our proposed model, serving as a central repository for securely storing and managing critical information related to the intrusion detection system (IDS). It plays a pivotal role in efficiently storing preprocessed data collected by the data collector from various sources within the UAV network. These data are critical for the intrusion detection engine's real-time decision-making, anomaly detection, and classification, which employs powerful convolutional neural network-long short-term memory (CNN-LSTM) algorithms. In addition, the database maintains a complete record of all identified intrusions and their types, providing valuable historical references for analysis and auditing.