Urban community open spaces are external spaces for public use that meet the needs of residents in their daily lives, and which gradually become the basic unit for activities and fitness. The arrival of the era of ‘national fitness’ requires the formation of public activity spaces that benefit all ages. Yet most construction targets of urban community open spaces are homogenised and are not diversified for all age groups. This phenomenon leads to a spatial and temporal mismatch between the allocation of space for community sports activities and the needs of residents. We quantitatively analysed time periods, demanded area and preferred types of activities required by all age groups. We further defined the objectives for the provision of physical activity functions in community open spaces. We also constructed a method for matching and optimising the supply and demand of sports and fitness functions in community open spaces, which was based on the calculation of supply and demand, the matching analysis model and the optimisation of supply and demand gaps. Accordingly, based on the distribution of demand points, we can clarify the amount and radius of each point, and calculate the matching relationship with the Maximum Capacity Limitation Coverage Model. When the implementation rate of demand at the covered points is less than 67%, it means that there is a demand gap. In response to the gap, optimisation has been achieved by establishing a time-sharing utilisation mechanism and using excessive supply space for renovation. The results of the study can help optimise the mismatch and long-term layout of physical activities for all residents in urban communities. The proposed sustainable optimising strategy suggests the importance and necessity of meeting the spatial needs of sports activities for all age groups in high-density cities with insufficient open spaces.