1. A method for optimizing battery usage of an electronic device, the method comprising: determining, by a criticality detection unit of the electronic device, a degree of criticality of environment in which one or more sensors are operating based on one or more pre-defined conditions, the electronic device receiving sensor data captured from the one or more sensors; determining, by a monitoring unit of the electronic device, a plurality of parameters comprising at least one of an energy level of the electronic device, an available processing power, and an available communication network bandwidth associated with the electronic device; and processing, by a battery optimization unit of the electronic device, a first portion of the sensor data locally based on the degree of criticality of environment and a priority based rule engine, wherein the priority based rule engine is configured to optimize battery usage of the electronic device based on the plurality of parameters by: assigning a value to each of the plurality of parameters to generate a rule, wherein the value indicates a degree of criticality associated with each of the one or more parameters, and comparing the rule with a plurality of rules to identify one or more operations to be performed while processing the data.