Based on the data of residents'living time allocation,this paper uses structural equation,3SLS and dual machine learning model to study the influence of physical activity and sedentary behavior on the life satisfaction of working resi-dents in Beijing in their free time.The results show that the total duration of behavior has the greatest impact on life satisfaction,and any length of sports is conducive to improving life satisfac-tion,but the sedentary behavior of more than 3 hours per day has a negative impact on it,and the impact is significantly dif-ferent on working days and rest days obvious.In addition,from the perspective of sedentary behavior types,the life satisfaction of residents who are mainly traffic sedentary increases with the increase of sedentary time;residents who are mainly learning sedentary or entertainment-oriented have an inverted'U'type of life satisfaction with sedentary time.For the three types of sedentary behavior,sports have a greater positive impact on the life satisfaction of residents with learning sedentary behavior dif-ferent among the three types of sedentary behaviors,and more sports are needed after learning.Further analysis shows that"health effect"and"substitution effect"are important mecha-nisms for these two types of behaviors to influence life satisfac-tion.