Generic framework for industrial 4.0 applications based on internet of things