With the rise of fog computing, the architecture of IOT is evolving into a cloud-fog-end architecture, where fog computing and cloud computing complement each other. The Internet of Things produces a large amount of data with great value. More and more real-time data analytics scenarios need to be carried out in the fog environment. Data processing and analytics has formed a relatively mature technology stack in the cloud, but in the fog environment with limited resources, the supporting framework of data analytics is still in its infancy. This paper reviews relevant research work in this field. Furthermore, this paper proposes a new parallel programming model and its API, and constructs a lightweight parallel execution engine (LwPEE) suitable for fog computing environment. Finally, we evaluate the performance of LwPEE and conduct relevant analysis.