The rapid development of AIOT-related technologies has revolutionized various industries. The advantage of such real-time sensing, low costs, small sizes, and easy deployment makes extensive use of wireless sensor networks in various fields. However, due to the wireless transmission of data, and limited built-in power supply, controlling energy consumption and making the application of the sensor network more efficient is still an urgent problem to be solved in practice. In this study, we construct this problem as a tree structure wireless sensor network mathematical model, which mainly considers the QoS and fairness requirements. This study determines the probability of sensor activity, transmission distance, and transmission of the packet size, and thereby minimizes energy consumption. The Lagrangian Relaxation method is used to find the optimal solution with the lowest energy consumption while maintaining the network’s transmission efficiency. The experimental results confirm that the decision-making speed and energy consumption can be effectively improved.