Atmospheric stellar occultation observation technology is an advanced space-based detection technology that can measure the vertical distribution of trace gas composition, temperature, and aerosol content in a planet's atmosphere. In this study, an inversion algorithm of the onion-peeling method was constructed to invert the transmittance obtained from the forward mask. The method used three-dimensional ray tracing simulation to obtain the transmission path of the light in the Earth's atmosphere. The relevant parameters were then combined in the HITRAN database, and line-by-line integration was performed to calculate the atmospheric transmittance. The value of transmittance was then used as an input to calculate the vertical distribution of oxygen molecules using the single-wavelength inversion onion-peeling method. Finally, the oxygen molecule content was compared to the value attained by the Mass Spectrometer and Incoherent Scatter Radar Extended (MSISE00) atmospheric model to determine the relative error of our model. The maximum error was found to be 0.3%, which is low enough to verify the reliability of our algorithm. Using Global-scale Observations of the Limb and Disk (GOLD) measured data to invert the oxygen number density, we calculated its relative deviation from the published result to further verify the algorithm. The inversion result was affected by factors such as prior data, absorption spectral line type, the ellipticity of the earth, and orbit accuracy. Analysis of these error-influencing factors showed that the seasons and the Earth's ellipticity only effected the accuracy of the model by 0.001% and could therefore be ignored. However, latitude and solar activity had a greater impact on accuracy, in the order of 0.1%. The absorption line type affected the accuracy of the model by as much as 1%. All three of these factors therefore need to be considered during the inversion process.