Approaches and algorithms for activity recognition have recently made substantialprogress due to advancements in pervasive and mobile computing, smart environmentsand ambient assisted living. Nevertheless, it is still difficult to achieve real-time continuousactivity recognition as sensor data segmentation remains a challenge. This paper presents anovel approach to real-time sensor data segmentation for continuous activity recognition.Central to the approach is a dynamic segmentation model, based on the notion ofvaried time windows, which can shrink and expand the segmentation window size by using temporal information of sensor data and activities as well as the state of activity recognition. The paper first analyzes the characteristics of activities of daily living from which the segmentation model that is applicable to a wide range of activity recognition scenarios is motivated and developed. It then describes the working mechanism and relevant algorithms of the model in the context of knowledge-driven activity recognition based on ontologies. The presented approach has been implemented in a prototype system and evaluated in a number of experiments. Results have shown average recognition accuracy above 83% in all experiments for real time activity recognition, which proves the approach and the underlying model.