Aiming at the safety problems of toxic, flammable and explosive chemicals used in middle school chemical experiments, such as human poisoning, skin corrosion, fire or explosion caused by improper experimental operation, a virtual simulation method of chemical experiments based on unity is proposed. Due to the need to analyze and compare the data in chemical experiments, summarize the experimental characteristics and data relevance. Therefore, based on the Apriori algorithm, this method deeply excavates the data obtained in the chemical experiment, uses Maya to model the experimental environment, uses unity to design the interactive functions in the experimental process, and uses visual effect graph technology, shader graph technology and other methods to realize the special effect simulation of various chemical experiments. With this method, the virtual simulation prototype system of middle school chemistry experiment is developed. The example shows that this method can vividly and realistically reproduce the simulation effect of chemical experiment, find the correlation between the experimental data, classification, properties and the overall characteristics of the data, describe and predict the development trend of the data, so as to make better use of these data to provide support for chemical experiment, and not only solve the problems of poisoning, corrosion of skin and It also solves the problems that it is difficult to scientifically compare data and find data relevance in traditional chemical experiments.