An effective technique in designing routing algorithms for Wireless Sensor Networks (WSNs) is named clustering nodes, which augments the network lifespan. More tasks are performed by the Cluster Heads (CHs) of the clustered WSNs, thereby consuming more energy. Hence, a secure energy-efficient Routing Protocol (RP) centered on micro-segmentation and batch authentication is proposed here. The proposed method begins by initializing the WSN nodes. After that, a random key is engendered for every node centered on their Node ID. The nodes undergo a Micro-segmentation process; in addition, they are securely grouped utilizing the Supremum Distance based K-Prototype (SD-KP) algorithm. Now, a fog layer with a number of fog nodes is initialized; also, every single micro-segmented group is assigned with an optimal fog node. Then, by using the Quasi Deterministic Sequence-Black Widow Optimization (QDS-BWO) algorithm, the optimal fog nodes are selected. By using the Root Squared- Diffie Hellman (R2-DH) technique, a key agreement is created for each group centered on their Node IDs. By using the Bitwise Cyclic Shift –BLAKE 512 (BCS-BLAKE-512) algorithm, the created keys are converted into hashcode. Now, for the purpose of performing batch authentication, the hashcode of each group is sent to the trusted authority. Subsequent to verification, data sensing occurs. Lastly, by using the Elliptic Curve Cryptography (ECC) algorithm, the data is securely encrypted and it is transmitted via the routes selected utilizing the Learned Gradient Weight Initialization-based Geography and Energy Aware Routing (LGWI-GEAR) algorithm. The proposed framework's efficacy is proved by the experimental outcomes.