The construction machinery and vehicles, especially the explosion-proof and explosion-isolation ability of the vehicles are playing an increasingly important role in the complex and unpredictable emergency rescue field. In this paper, the explosion-proof housing of hydraulic system power unit applied in engineering machinery is investigated, wherein the power unit includes motor, power supply and control element. Motor-driven hydraulic pump provides the necessary power for the hydraulic system. The gas explosion process, basic parameters, flame acceleration mechanism and the theory model of gas explosion in finite space are analyzed. Relevant mathematical models of the experimental gas explosion for explosion-proof cavity are established. Furthermore, the models are analyzed by numerical method. We simulate the dynamic process of explosion by software. The analysis, examination and simulation of structural strength are conducted on the explosion-proof cavity according to the maximum explosion pressure obtained from the simulation results. The reasonable design parameters satisfying the explosion-proof requirements are obtained. The explosion-proof cavity which is processed according to the design parameters is tested. The explosion-proof performance is verified by analyzing the experimental results. According to the test standard, the impact test, thermal test, pressure test, overpressure test and propagation test under internal ignition for the cavity are conducted. The results show that the pressure test coincides with the simulation results. The remaining test results also satisfy the experimental purpose. The reasonableness of the design of the explosion-proof cavity is verified, which can meet the actual requirements of the equipment.