The smart manufacturing system can become a linked network with the help of the Internet of Things (IoT). Devices connected to the IoT are susceptible to various attacks and assaults. An effective protection plan is needed to ensure that the billions of IoT nodes are protected from these hazards. The security mechanisms on IoT devices are ineffective due to resource limitations. As a result, the academic community has recently paid attention to the cloud-, fog-, and edge-based IoT systems. A robust cloud provider is in the cloud or fog to perform computationally demanding activities, including safety, data analysis, decision-making process, and monitoring. Hash identities and upgraded Rivest–Shamir–Adleman (RSA) have been used to secure the IoT device’s data. A four-prime integer of 512 bits makes up the proposed security algorithm. A hash signature is used to provide device authentication. An effective clustering method for sensing devices based on the node level, separation from the clusters, remaining energy, and fitness has been presented for long network life. The suggested swarm-based method determines the sensor nodes’ fitness. A deep neural network- (DNN-) based resource scheduling algorithm (DNN-RSM) is meant to reduce the delay and communications overhead for IoT components in the hybrid cloud system. For optimum resource allocation, all queries originating from the cluster head are categorised using DNN based on their storage, processing, and bandwidth needs. The suggested structure delivers better outcomes, particularly regarding energy use, delay, and safety level. The results of the simulation provide credence to the concept that the proposed strategy is superior to the current system. The suggested scheme includes stringent security, decreased energy usage, decreased latency, and efficient resource utilization.