A comparative analysis of tourists' recreation behavior and needs in national parks at home and abroad from the perspective of tourists' perceived value can provide a scientific basis for the realization of national parks' recreation function. Taking Yellowstone National Park and Wuyishan National Park as the cases, this paper divides the tourist value of national parks into seven dimensions: brand value, environmental value, experience value, service value, emotional value, cognitive value and cost value by collecting the online travel notes published by tourists and network text analysis in software, ROST CM6. The overall evaluation of Yellowstone National Park is much higher than that of Wuyishan National Park by comparing the evaluation of tourists from the two parks and scoring quantitatively.Based on this, it is concluded that the recreation needs of tourists in the national park are: getting close to nature, relaxing body and mind, increasing the characteristic experience, strengthening the body, seeking knowledge and aesthetics, etc. and the corresponding recreation function of the national park should include: natural display function, outdoor recreation function, natural science popularization function, natural aesthetic education function, etc. This paper puts forward five optimization suggestions, considering the actual situation of Wuyishan National Park, which includes multi-form natural display, abundant outdoor recreation products, construction of nature education system, improvement of infrastructure and establishment of brand image.