Typically, smart grid systems enhance the ability of conventional power system networks as it is vulnerable to several kinds of attacks. These vulnerabilities might cause the attackers or intruders to collapse the entire network system thus breaching the confidentiality and integrity of smart grid systems. Thus, for this purpose, Intrusion detection system (IDS) plays a pivotal part in offering a reliable and secured range of services in the smart grid framework. Several existing approaches are there to detect the intrusions in smart grid framework, however they are utilizing an old dataset to detect anomaly thus resulting in reduced rate of detection accuracy in real-time and huge data sources. So as to overcome these limitations, the proposed technique is presented which employs both real-time raw data from the smart grid network and KDD99 dataset thus detecting anomalies in the smart grid network. In the grid side data acquisition, the power transmitted to the grid is checked and enhanced in terms of power quality by eradicating distortion in transmission lines. In this approach, power quality in the smart grid network is enhanced by rectifying the fault using a FACT device termed UPQC (Unified Power Quality Controller) and thereby storing the data in cloud storage. The data from smart grid cloud storage and KDD99 are pre-processed and are optimized using Improved Aquila Swarm Optimization (IASO) to extract optimal features. The probabilistic Recurrent Neural Network (PRNN) classifier is then employed for the prediction and classification of intrusions. At last, the performance is estimated and the outcomes are projected in terms of grid voltage, grid current, Total Harmonic Distortion (THD), voltage sag/swell, accuracy, precision, recall, F-score, false acceptance rate (FAR), and detection rate of the classifier. The analysis is compared with existing techniques to validate the proposed model efficiency.