Industrial structure upgrading is an important prerequisite for achieving regional ecological environment protection and high-quality development, and environmental regulation can improve the capacity of scientific and technological innovation and promote industrial structure transformation and upgrading. Based on the panel data of 78 cities in the Yellow River Basin, the relationships among environmental regulation, scientific and technological innovation, and industrial structure upgrading in the Yellow River Basin were analyzed using the mediating effect model and the panel threshold model. The results showed the following findings: (1) Although both formal and informal environmental regulations can promote industrial structure upgrading in the Yellow River Basin, regional heterogeneity and temporal stage characteristics are observed. (2) Transmission mechanism test results show that formal and informal environmental regulations directly affect industrial structure upgrading and indirectly act on it through the level of scientific and technological innovation, showing a significant mediating effect. (3) Taking scientific and technological innovation as the threshold variable, formal environmental regulations have a corresponding relationship with industrial structure upgrading in the form of a broken line, and informal environmental regulations significantly promote industrial structure upgrading after scientific and technological innovation crosses a certain threshold. Finally, we discuss the article and make corresponding suggestions in terms of environmental regulation and technological innovation.