The optimization of the sampling scheme is particularly important in order to achieve sustainability in quality management. This paper discusses the problem of optimizing the design of metrological sampling scheme when the mean is a random variable. Assuming that the prior distribution of product means is known, a Bayesian posterior probability is calculated by using the likelihood function with decision variables to measure the sampling risk, and the expected cost of the sampling scheme is calculated based on the protection of producer and user risk in combination with the Taguchi quality loss function. The influence of model parameters on the selection of the optimal sampling scheme is investigated through sensitivity analysis. The model constructed in this paper solves the problem of sampling design in the case of food processing enterprises, quantifies the quality loss of products in the sampling process, facilitates sustainable quality management of enterprises, and has important theoretical significance and application value for sustainable business management of food processing enterprises.