In recent years, China has been continuously increasing the supply of artificial intelligence education policies to promote the deep integration of artificial intelligence and education. Offering artificial intelligence courses during basic education can cultivate students' AI literacy and enhance the country's future technological competitiveness. However, due to factors such as a shortage of AI teachers and inadequate practical conditions, the current effectiveness of AI courses in primary and secondary schools is not ideal. In light of this, this study is based on the background of school-enterprise cooperation, and integrates the "competition and education" mechanism into informal AI courses design and practice. Using a design-based research paradigm, the study proposes a design framework from four dimensions: goals, theme areas and content, methods and steps, and evaluation, and then improves and refines the framework through two rounds of iterations, to provide reference for the development and practice of artificial intelligence courses.