# Artificial Intelligence-Based Semantic Internet of Things in a User-Centric Smart City
## 3 AI-SIoT Architecture
### Service Management Layer
#### 3.2.2 AI Module
These approaches are usually applied to predict the activities of users. For example, the heart rate is monitored and the rate changing pattern can indicate the user's activity as shown in Figure 3.  
Generally speaking, smartphones report users' locations timely and periodically. The location data can be seen as a trigger event for a location-based automation service or as a logical reference for the recommendation service. In addition to the location data, the users' behaviors and actions  
Figure 3: Running predicting based on heart rate. are reported. These data are the important basis to construct the behavioral model of users that can represent the behavioral patterns inferred through machine learning techniques. A behavioral model usually contains time, locations, objects and contents. The behavioral content represents the interaction with the current target object. The behavioral modeling can refer to human beings and smart devices. There are two types of data in the modeling: registration data and service data. The registration data is produced when the smart devices are registered in the IoT platform. It may contain the basic information about the registered devices, such as the name, type, device ID, manufacturer, and more. The service data is produced in a timely manner by the smart devices, and it can represent the device's working status. The working state can be the on/off status, or some other functional states. In addition, the function data can be the sensed environmental parameters and the calculated working durations and etc. In the user identification submodule, the user identity can be detected and confirmed. In general, the smartphone, wearable devices or other personal devices can serve as the entrance to the SC via user logging. Through the user interfaces, these devices can perform multiple functions, such as locating users, controlling other devices, recording user characteristics, and more. The user characteristics can be used to describe users and facilitate the provisions of appropriate services. The submodule is empowered by the semantic analysis through the corresponding interface. The semantic analysis module can acquire detailed user information in various aspects. In the behavioral recognition submodule, the user behavior and device behavior are recognized and confirmed through the supports from the data analysis submodule and the semantic analysis module. The user behavior represents a series of user activities for a certain purpose, and the combinations and sequences of these activities are regular. The main objective of the behavior recognition submodule is discovering the behavioral patterns and constructing the behavioral model. For example, a user often puts milk in coffee with no sugar. The milk and coffee can be the key elements for the behavioral pattern of the drinking coffee and sugar may be included in another behavioral pattern. The user behavior recognition can provide assistance in user's daily living [51]. Similarly, the device behavior represents that one device or some devices implement a series of activities within a certain period of time. These activities of devices are implemented through manual operations or automatic operations. The automatic operation generally results from some trigger events. For example, an air conditioner is set to start cooling when the indoor temperature is above 30 \({}^{\circ}\)C. The indoor temperature is one example of the trigger event. The relationship between the two different behaviors, such as opening the door and turning on the air conditioner, is that the user behavior interacts with the devices, but the device behavior interacts with the environmental parameters or controllable events. Changing the environmental parameters or some events is the main purpose of users that are using devices. The user behavior can stimulate the corresponding device behavior. For example, people control the air conditioner, and the air conditioner can reduce the temperature. Some different device behaviors may result in the same results.