In this paper, the automatic pricing and replenishment decision-making problem for vegetable category goods is studied. Using the K-means clustering model, random forest, LSTM long and short-term memory model, and nonlinear programming, the distribution law and interrelationship of each category and single product of vegetables are analyzed in detail based on the commodity information, sales flow details, wholesale price, and loss rate data of the vegetable category. Firstly, the correlation between the sales volume of vegetable categories and seasons was revealed by analyzing the total sales volume and sales volume of each time, and eight major categories were obtained by cluster analysis, and the combination of strongly correlated individual products was further determined by correlation analysis. Secondly, this paper predicts the sales volume of the vegetable category in the coming week through the random forest model, and further optimizes the pricing strategy by combining it with the LSTM model, so that the superstore can meet the market demand while ensuring the maximization of revenue. Finally, for the sales space limitation, this paper applies nonlinear programming to solve the problem of selecting the most appropriate 27–33 sales items and solves the stocking and pricing strategy that obtains a total profit of 597.13 RMB. Through the combined use of these methods, this paper provides effective strategy suggestions for superstores in market competition.