Earthquakes are one of the main factors that cause structural disasters in current buildings. Under the action of earthquakes, adjacent building structures are generally in different vibration phases, and the structures are likely to collide with each other, and collisions may cause serious damage to the structure. In order to prevent damage to the designed buildings under certain earthquakes, this paper mainly focuses on the design and analysis of numerical algorithms for seismic nonlinear structural dynamic responses based on the HVSR algorithm. In the two-dimensional finite element analysis in this paper, the dam rockfill body adopts four-node isoparametric elements, and the equivalent linear model related to dynamic shear strain is used to reflect the dynamic nonlinear characteristics of the dam material. When the dynamic response is used as the constraint condition, the dynamic response can be used to judge whether the design variables meet the requirements; when the dynamic response is used as the optimization target, it is the optimization result of each step. Considering the importance of the instantaneous amplitude of acceleration response in the correction of nonlinear structure model.The acceleration response time series is divided into 15 time periods uniformly, and then the position corresponding to the peak point of the instantaneous amplitude in each time period is selected as the selected data point position. Apply the same seismic load to the bottom of the established nonlinear model, extract the dynamic response data of the top layer of the structure, and then extract the instantaneous amplitude of the main component of the structural dynamic response through the time-varying filter and Hilbert transform based on discrete analytical mode decomposition and the corresponding the instantaneous frequency. Under the action of these four ground motions, the collision force in the range of 0~50kN accounts for more than 87% of the total number of collisions. The results show that the HVSR algorithm can obtain the instantaneous characteristic parameters of the dynamic response of the nonlinear structure and realize the correction of the model.