From the perspective of cognitive mechanisms, this research discusses the effects of cognitive flexibility, entrepreneurial self-efficacy, and optimism on entrepreneurship competence. Qualitative interviews have revealed the general relationship between key concepts. SEM analysis further shows that cognitive flexibility has a positive direct effect on entrepreneurial self-efficacy; entrepreneurial self-efficacy has a positive direct effect on entrepreneurship competence; cognitive flexibility has a positive direct effect on entrepreneurship competence; cognitive flexibility has a positive indirect effect on entrepreneurship competence through entrepreneurial self-efficacy; optimism moderates the relationship between cognitive flexibility and entrepreneurship competence, with an inverted U-shaped moderation effect. According to the results, this research offers some suggestions to improve entrepreneurs’ entrepreneurship competence from the perspective of cognition and positive psychology, hoping that through the overall improvement of entrepreneurs’ entrepreneurship competence, it can be beneficial to the open innovation atmosphere of the whole society.