Building air conditioning systems, electric vehicles and battery energy storage systems all provide substantial flexibility for grid operations. However, the joint optimization strategy involving these three demand response resources in buildings has been infrequently studied. This research proposes a day-ahead optimization strategy to coordinate the joint operation of air conditioning systems and electric vehicles. In this framework, cooling load is predicted using an autoregressive exogenous model, while electric vehicle charging load is predicted through Monte Carlo simulations. An evaluation method is introduced to assess the comprehensive benefits of the demand response strategy, considering thermal comfort, economic efficiency, and grid friendliness. Using an office building in Tianjin, China, as a case study, the results indicate that the joint optimization strategy reduces operational costs by 3.71 % and peak electricity load by 38.62 % compared to the original strategy. Furthermore, it enhances the grid friendliness of the energy system by 42.64 %. The configuration of the battery energy storage system is also explored in conjunction with the optimization strategy to further improve grid friendliness. The impact of economic factors and thermal comfort on the configuration of the battery energy storage system is discussed. In the case study, raising the upper temperature limit by 1 °C can save at least 17.1 % in capacity, while battery energy storage system investment and operational costs can respectively be reduced by 55.04 % and 27.14 % within the thermal comfort range.