Sensor network programs that predict and control security have been studied using a huge amount of data. This work views The inadequacy of current security measures is a problem with security standards. To make it simpler to choose security measures that would meet needs, have an impact on genuine security, and maintain track of the network's counting process, the concept of a "network security line" has been proposed. Network security was altered both before and after the event, according to these changes. The security of the topology is then assessed as a counterattack defense utilizing a number of stochastic process-based models. Lastly, by creating a distributed data model, a risk-receiving data model, data feature removal, reconstruction, and an evaluation approach are used to create the experimental risk model. According to the testing findings, when the distance is between 10 and 40 meters, this method is more than 90% successful. The operating power, which is less than the standard requirement, is 196~461 Hz. They perform better in real-time than conventional models. The date timing discrepancy is no more than 0.3 seconds. Despite the improved precision, the relative error is reduced by 3%.