The Internet of Things (IoT) connects schemes, programs, data management, and operations, and as they continuously assist in the corporation, they may be a fresh entryway for cyber-attacks. Presently, illegal downloading and virus attacks pose significant threats to IoT security. These risks may acquire confidential material, causing reputational and financial harm. In this paper hybrid optimization mechanism and deep learning,a frame is used to detect the attack prevention in IoT. To develop a cybersecurity warning system in a huge data set, the cybersecurity warning systems index system is first constructed, then the index factors are picked and measured, and finally, the situation evaluation is done.Numerous bio-inspired techniques were used to enhance the productivity of an IDS by lowering the data dimensionality and deleting unnecessary and noisy input. The Grey Wolf Optimization algorithm (GWO) is a developed bio-inspired algorithm that improves the efficacy of the IDS in detecting both regular and abnormal congestion in the network. The smart initialization step integrates the different pre-processing strategies to make sure that informative features are incorporated in the early development stages, has been improved. Researchers pick multi-source material in a big data environment for the identification and verification of index components and present a parallel reduction approach based on the classification significance matrix to decrease data underlying data characteristics. For the simulation of this situation, grey wolf optimization and whale optimization were combined to detect the attack prevention and the deep learning approach was presented. Utilizing system software plagiarism, the TensorFlow deep neural network is intended to classify stolen software. To reduce the noise from the signal and to zoom the significance of each word in the perspective of open-source plagiarism, the tokenization and weighting feature approaches are utilized. Malware specimens have been collected from the Mailing database for testing purposes. The experimental findings show that the suggested technique for measuring cyber security hazards in IoT has superior classification results to existing methods. Hence to detect the attack prevention in IoT process Whale with Grey wolf optimization (WGWO) and deep convolution network is used.