In the context of big data, from the perspective of network ecology, this article divides Weibo public opinion subjects into four groups based on their interest motivations: image managers, platform operators, public opinion consumers and network promoters. According to the four groups Extract Weibo public opinion risk factors based on the interest preferences of each community to construct a Weibo public opinion risk model. The model was verified using Weibo real-time data as a sample, and through logistic regression analysis, it was concluded that the prior cognition, information preference, behavioral preference, information person preference and other interest preferences of the Weibo public opinion subject community have an impact on the development trend of Weibo public opinion. The degree of influence coefficient is used to calculate the early warning level, thereby obtaining a Weibo public opinion early warning model that can be dynamically adjusted according to case updates. The research has important theoretical significance for deepening and enriching the research on online public opinion, and at the same time provides new methodological support for realizing public opinion risk early warning.