Introduction

Economic development and the ecological environment are double-edged swords that are more prominent in resource-based cities and developing countries. Since its reform and opening up, China’s economy has achieved rapid growth, but the driving force of economic development mainly depends on a large amount of resource input (Li and Lin 2017). Relevant data show that for every 100 million US dollars of GDP created by China, it needs to consume approximately 29 thousand tons of oil equivalent, which is 2.1 times that of the USA, 3 times that of Germany, and 3.1 times that of Japan (Bai and Nie 2018). According to the World Air Quality Report (2018), China accounts for 57 of the 100 most polluted cities in the world. This development model at the expense of the natural environment not only severely damages the ecological environment but is also not conducive to regional high-quality development. With the depletion of natural resources and the deterioration of the ecological environment, the Chinese government is aware that the extensive development model that relies on resource input to achieve economic growth is unsustainable. Therefore, how to reduce environmental pollution and improve ecological efficiency while also achieving economic development has become the focus of attention of scholars.

Ecological efficiency mainly examines the impact of human economic production activities on the ecological environment, and its connotation is to create higher economic efficiency with a smaller investment of resources while reducing environmental pollution (Zhang et al. 2017b; Becker 2011). With the development of industrialization and informatization, the factors affecting urban ecological efficiency have gradually increased but mainly include industrial agglomeration and environmental regulation.

Existing research has explored the impact of industrial agglomeration on urban ecological efficiency from the following three aspects. First, proper industrial agglomeration can break through the “Solo Paradox” and improve urban ecological efficiency. According to competitive effects, the aggregation of enterprises of the same type in a region will form a competitive relationship. To achieve long-term development, new technologies must be continuously developed to enhance product competitiveness and seize market share (Liu et al. 2016). Porter’s innovation-driven development theory believes that innovation comes from corporate competition, and healthy competition is conducive to corporate growth and regional economic development (Ambec et al. 2013). Marshall (2009) and Krugman (1990) believed that industrial agglomeration had strong economic and technological externalities and was an important engine to promote economic development and increase production efficiency. Zhang et al. (2021) believed that industrial agglomeration could form a vertical industrial chain, reduce information costs, optimize resource allocation, coordinate industrial development, and improve urban ecological efficiency.

Second, industrial agglomeration hinders the improvement of ecological efficiency. On the one hand, due to the nature of manufacturing input and output, a large number of pollutants will inevitably be emitted during the process of industrial agglomeration, which will destroy the ecological environments of the local and neighboring cities; On the other hand, according to the law of diminishing marginal effects, industrial agglomeration exceeding a certain threshold may produce a “crowding effect,” leading to chaotic economic order, vicious competition, and uneven resource allocation (Chen et al. 2020). In fact, the current industrial development in China is still in the middle and low end of the global industrial chain, the quality of industrial agglomeration is low, and the structure is unreasonable (Wu et al. 2021). In particular, a large number of high-pollution and high-energy-consuming enterprises have gathered in the central and western regions, which not only accelerates resource consumption and environmental pollution, but also inhibits the improvement of ecological efficiency.

Third, there is a nonlinear relationship between industrial agglomeration and ecological efficiency. With the application of statistical modeling and multivariate data, scholars have found that the relationship between industrial agglomeration and ecological efficiency is actually more complicated. Zhang and Dou (2016) combined the environmental pollution index and the spatial measurement model to prove that industrial agglomeration and pollution discharge have an inverted U-shaped relationship, which is more obvious in eastern China. However, Pei et al. (2021) used the Copeland-Taylor model combined with data from prefecture-level cities in the Yangtze River Delta from 2006 to 2016 to prove that the industrial agglomeration of subsectors had a significant U-shaped relationship with environmental pollution. Chen et al. (2020) simultaneously explored the impact of industrial agglomeration on environmental pollution and ecological efficiency through the spatial Durbin model and believed that industrial agglomeration and environmental pollution had a significant inverted U-shaped relationship but a significant U-shaped relationship with ecological efficiency.

The environment, as a “product” of public nature, has a strong “negative externality” (Yang et al. 2021). Relying on the unilateral market system and public environmental literacy makes it difficult to correct “market failures,” and appropriate environmental regulatory policies must be formulated in accordance with the development of the regional economic environment and ecological quality. Existing research shows that environmental regulations have a dual impact on ecological efficiency (Li and Wu 2017). On the one hand, reasonable environmental regulations can strengthen the technology and innovation compensation effects of enterprises, thereby increasing the production efficiency and improving the ecological environment. Rubashkina et al. (2015) proved that appropriate environmental regulations could encourage European companies to pay greater attention to green innovative technologies and increase the number of patent applications. Through air pollutant emission data and the slack-based measure model (SBM), Zhang et al. (2020) believed that appropriate environmental regulations improved the ecological efficiency of the Yangtze River Delta in China. On the other hand, the “compliance cost effect” produced by environmental regulations may increase the additional environmental costs of enterprises and weaken product competitiveness. Chakraborty and Chatterjee (2017) found that environmental regulations have significantly increased the cost of Indian dye manufacturers and reduced their product competitiveness. Li and Lin (2017) believed that excessive environmental regulations would hinder the original innovation of enterprises, and the local government should reduce policy intervention and strengthen the flexibility of enterprises to market changes. In fact, due to the dual pressure of economic development and job promotion, local governments often deliberately lower environmental standards and promote economic growth at the expense of the ecological environment, which is more obvious in developing countries. How to effectively use market mechanisms and environmental regulatory systems, combine fiscal, financial, and industrial policies, and form a multiparty joint effort to improve ecological efficiency is the key to China’s transition from industrial civilization to ecological civilization.

Existing studies have achieved rich conclusions in related fields. Nevertheless, certain problems are worthy of further discussion. First, urban ecological efficiency is not only related to external driving factors such as economy and industry, but also depends on internal evolutionary mechanisms such as technological progress and scale efficiency. However, most of the previous studies only used the DEA model to measure the urban ecological efficiency, and seldom combined the ML index to explore its internal evolution mechanism from pure technological efficiency (PEFFCH), technological progress (TECH), and scale efficiency (SECH). Second, the first law of geography claims that geographical proximity or economic complementarity has a significant impact on urban ecological efficiency, but some studies only use non-spatial econometric models or construct distance matrices to explore its influencing factors. In fact, non-spatial models and distance matrices cannot fully reflect the complexity and spillover effects between research units, so it is necessary to adopt asymmetric economic distance matrices and spatial econometrics models. Third, most previous studies have investigated the impact of industrial agglomeration and environmental regulations on ecological efficiency at the provincial level (Zhang et al. 2017a), while urban studies are relatively rare. Finally, with the development and popularization of positioning and observation technologies, the phenomenon of spatial stratified heterogeneity has become more prominent (Wang et al. 2010), while existing studies have neglected the impact of spatial stratified heterogeneity on urban ecological efficiency.

The possible contributions of this study are as follows: First, we use the super-efficiency SBM model and ArcGis to measure the temporal and spatial evolution characteristics of urban ecological efficiency, and combine the ML index to explore its internal evolution mechanism from TECH, PEFFCH, and SECH. Second, we use a big panel dataset of 269 Chinese cities to extend the research unit from the provincial and departmental levels to prefecture-level cities, thus producing more accurate and robust empirical results. Third, we incorporate industrial agglomeration, environmental regulation, and ecological efficiency into a unified analysis framework, and construct a spatial Durbin model under three weight matrices (distance matrix, economic distance matrix, and asymmetric economic distance matrix) to examine the impact of industrial agglomeration and environmental regulation on ecological efficiency and its spatial spillover effects. Finally, we use the geographic detector model to prove the heterogeneous impact of single and interactive variables on urban ecological efficiency from the perspective of spatial stratified heterogeneity. The significance of this study is that we not only reveal the temporal and spatial evolution characteristics and internal driving mechanisms of urban ecological efficiency, but also provide a policy basis for improving urban ecological efficiency. In addition, we also provide empirical evidence for studying the relationship between environmental regulation, industrial agglomeration and ecological efficiency, and provide a reference for other developing countries to promote industrial agglomeration and strengthen environmental regulations.

Methods and procedures

Analytical framework

Exploring the spatial and temporal distribution pattern of urban ecological efficiency, internal driving mechanisms and external influencing factors are conducive to the optimal allocation of resources, the adjustment of economic and industrial development methods, and the improvement of urban ecological efficiency. Based on the panel data of 269 cities in China from 2008 to 2017, using the super-efficiency SBM model, ML index, and SDM under different weight matrices, we explored the temporal and spatial pattern of ecological efficiency, the internal evolution mechanism, and the direct and spillover effects of industrial agglomeration and environmental regulation on ecological efficiency. In addition, considering the spatial stratified heterogeneity of ecological efficiency, we use geographic detector to measure it and explain its reasons (Fig.1).

Fig. 1
figure 1

Analytical framework

Input and output indexes

Before measuring the urban ecological efficiency and ML index, we needed to construct corresponding input and output indexes. With reference to relevant literature, the input indexes of this study included labor, land resources, and capital input (Zhou et al. 2018). Labor input was expressed by the number of urban employees (unit: 10,000 persons); land resource input was expressed by the area of urban construction land (unit: square kilometers); and capital input was represented by the capital stock. Goldsmith’s perpetual inventory method (PIM) is the commonly used method for measuring capital stock: Kit=Iit+(1-δ)Kit−1 (Goldsmith 1951), where K represents the capital stock; I, δ, and t represent the total fixed capital investment, depreciation rate, and year, respectively. With reference to the relevant literature (Zhang et al. 2004; Li et al. 2019), the total fixed capital investment in the base period was divided by 10% as the base period capital stock, and the annual depreciation rate was set to 9.6%.

Output indexes are mainly divided into desirable output and undesired output. We referred to the relevant literature and selected GDP as the desirable output (Zhang et al. 2011). To enhance the comparability of the data, 2008 was taken as the base period, and the GDP index was used to convert the nominal GDP into the real GDP at comparable prices to eliminate the impact of inflation. Moreover, industrial wastewater emissions (unit: 10,000 tons), industrial sulfur dioxide emissions (t), and industrial waste gas emissions (t) were selected as the undesirable output indexes.

Explanatory variables

Core explanatory variables

Industrial agglomeration (IND)

On the one hand, existing research believes that industrial agglomeration can form an interconnected industrial network, thereby achieving complementary production, sharing resources, reducing production costs, and achieving externality benefits; On the other hand, industrial agglomeration can also cause the concentrated emissions of pollutants and the excessive use of natural resources, thereby destroying the ecological environment. With reference to relevant literature, this paper used the location quotient of the number of industrial employees to indicate the level of industrial agglomeration (Morrissey 2016). In addition, we used IND2 to test the impact of further expansion of the level of industrial agglomeration on urban ecological efficiency.

Environmental regulation (ER)

ER is an important measure for the government to formulate environmental standards to limit the emission of pollutants by enterprises. Appropriate environmental regulations can promote technological upgrading of enterprises to improve urban ecological efficiency. This study used a comprehensive index of various pollutant emissions to express the intensity of environmental regulations (Chen et al. 2010). The calculation steps are as follows: First, standardize industrial wastewater, industrial sulfur dioxide, and industrial waste gas emissions.

$$ {UE}_{ij}^s=\left[{UE}_{ij}-\min \left({UE}_j\right)\right]/\left[\left(\max {UE}_j\right)-\min \left({UE}_j\right)\right] $$
(1-1)

where UEij is the emission amount of pollutant j in city i; max(UEj) and min(UEj) refer to the maximum and minimum pollutant emission amounts, respectively; and UEijs is the standardized value. Second, the proportion and intensity of pollutant emissions in different cities greatly vary, and the adjustment coefficient is used to reflect the difference in pollutant emissions:

$$ {W}_j={UE}_{ij}/{\overline{UE}}_{ij} $$
(1-2)

where is the average value of pollutant emission of j, and Wj represents the weight of pollutant j. Finally, we calculate the strength of environmental regulations (ERi):

$$ {ER}_i=\frac{1}{3}{\sum}_{j=1}^3{W}_j{UE}_{ij}^S $$
(1-3)

Control variables

We selected transportation development (TRA), population density (POP), foreign direct investment (FDI), and technological innovation (TEC) as the four control variables of this study.

TRA

Transportation development can reduce transportation costs and improve resource circulation efficiency, but it can also accelerate resource consumption and environmental pollution. Based on the availability of data, we use the area of urban roads to indicate the level of transportation development.

POP

High population agglomeration is a sign of urban economic prosperity and social development; however, population agglomeration can also bring environmental pollution, traffic congestion and other problems, leading to conflicts between economic development and the ecological environment. We used the ratio of the permanent resident population to the urban administrative area to express the population density.

FDI

The introduction of foreign direct investment can bring advanced management experience and technology to improve the production efficiency of enterprises. We obtained FDI data from the China City Statistical Yearbook.

TEC

The impact of technological innovation on urban ecological efficiency is a long-term process. Considering the cumulative and lag effects of technological innovation, this study used the R&D capital stock to measure technological innovation.

Methodology

Super-efficient SBM model considering undesirable output

Ecological efficiency can be measured in many ways, including material flow analysis (Hawkins et al. 2007), ecological footprint (Yang and Yang 2019), and DEA (Chen and Wu 2018; Yang et al. 2015). Among these approaches, DEA, which is an important method of efficiency research, was proposed by famous American operations researchers Charnes et al. (1978). This model can determine the frontier of nonparametric effective production and evaluate the effectiveness of decision-making units (DMUs) with multiple input and output indicators, and it is widely used in many aspects, such as resource utilization and technological innovation (Li and Lin 2017; Wu et al. 2019). The traditional DEA model is based on the proportional reduction of input or the proportional expansion of output and does not fully consider the slackness of input or output variables, which may lead to inaccurate estimation results (Yang et al. 2015). Therefore, Tone and Tsutsui (2010) further modified the model to effectively solve this problem. This study constructs an urban ecological efficiency measurement model on the basis of the Super-SBM-DEA model proposed by Tone.

Assuming that n DMUs are present in the production input process, each DMU contains m production input elements, q1 desirable output elements, and q2 undesirable output elements. The Super-SBM-DEA model, including the undesirable output, is as follows:

$$ {\displaystyle \begin{array}{c}\min p=\frac{1+\frac{1}{m}\sum \limits_{i=\mathrm{l}}^m{S}_i^{-}/{x}_{ik}}{1-\frac{1}{q_1+{q}_2}\left(\sum \limits_{r=1}^{q_1}{S}_r^{-}/{y}_{rk}+\sum \limits_{t=1}^{q_2}{S}_t^{b-}/{y}_{ik}^b\right)\ }\\ {}s.t.\left\{\begin{array}{c}\sum \limits_{j=1,j\ne k}^n{x}_{ij}{\lambda}_j-{s}_i^{-}\le {x}_{ik}\\ {}\sum \limits_{j=1,\ne k}^n{y}_{ij}^b{\lambda}_j-{s}_r^{b-}\le {y}_{rk}\\ {}\begin{array}{c}1-\frac{1}{q_1+{q}_2}\left({\sum}_{r=1}^{q_1}{s}_r^{-}/{y}_{rk}+{\sum}_{t=1}^{q_2}{s}_t^{b-}/{y}_{ik}^b\right)>0\\ {}\lambda, {s}^{-},{s}^{-}\ge 0;i=1,2,\cdots, m;t=1,2,\cdots, n\end{array}\end{array}\right.\end{array}} $$
(2)

where p is the urban ecological efficiency; xik, yik, and ybik represent the ith input element, bth desirable output, and tth undesirable output of the kth city, respectively; si, sr+, and stb− represent the slack variables of the input factors, desirable output, and undesirable output, respectively; and λ is the weight vector.

Malmquist–Luenberger (ML)

The Malmquist index was firstly proposed by Caves et al. (1982). However, the traditional Malmquist index did not include environmental constraints, such as energy consumption and pollutant emissions. Chung et al. (1997) proposed the ML index, which can measure undesired output, such as pollutant emissions, based on the directional distance function. The ML index is currently widely used in various fields, such as ecology, energy, and economy (Emrouznejad and Yang 2016; Arabi et al. 2014; Li and Liu 2019). This paper refers to Chung et al. (1997) and Chang et al. (2016) to calculate the urban ML index between period t and period t+1. The specific model is as follows:

$$ {ML}_{\boldsymbol{t}}^{t+1}={\left\{\frac{\left[1+{\overrightarrow{D}}_0^t\left({x}^t,{y}^t,{b}^t;{\mathrm{g}}^t\right)\right]}{\left[1+{\overrightarrow{D}}_0^t\left({x}^{t+1},{y}^{t+1},{b}^{t+1};{\mathrm{g}}^{t+1}\right)\right]}\times \frac{\left[1+{\overrightarrow{D}}_0^t\left({x}^t,{y}^t,{b}^t;{\mathrm{g}}^t\right)\right]}{\left[1+{\overrightarrow{D}}_0^t\left({x}^{t+1},{y}^{t+1},{b}^{t+1};{\mathrm{g}}^{t+1}\right)\right]}\right\}}^{\frac{1}{2}} $$
(3)
$$ {ML}_t^{t+1}={TECH}_t^{t+1}\times {PEFFCH}_t^{t+1}\times {SECH}_1^{t+1} $$
(4)

where D represents the production unit DMUs; and x, y, d, and g represent the production input, desirable output, undesirable output, and direction vector, respectively. MLtt+1 represents the change of TFP from period t to t+1. If MLtt+1>1, then the TFP has been improved, and vice versa. MLtt+1 can be further decomposed into efficiency change (EFFCH) and technical progress (TECH). In the case of variable returns to scale (VRS), EFFCH can be decomposed into pure technical efficiency (PEFFCH) and scale efficiency (SECH) (Chung et al. 1997). By analyzing the TECH, PEFFCH, and SECH indexes, we can explore the internal evolutionary mechanism of ecological efficiency (Zhang et al. 2011; Choi et al. 2015).

$$ {TECH}_t^{t+1}={\left\{\frac{\left[1+{\overrightarrow{D}}_c^{t+1}\left({x}^t,{y}^t,{b}^t;{\mathrm{g}}^t\right)\right]}{\left[1+{\overrightarrow{D}}_c^t\left({x}^t,{y}^t,{b}^t;{\mathrm{g}}^t\right)\right]}\times \frac{\left[1+{\overrightarrow{D}}_c^{t+1}\left({x}^{t+1},{y}^{t+1},{b}^{t+1};{\mathrm{g}}^{t+1}\right)\right]}{\left[1+{\overrightarrow{D}}_c^t\left({x}^{t+1},{y}^{t+1},{b}^{t+1};{\mathrm{g}}^{t+1}\right)\right]}\right\}}^{\frac{1}{2}} $$
(5-1)
$$ {PEFFCH}_t^{t+1}=\frac{1+{\overrightarrow{D}}_v^t\left({x}^t,{y}^t,{b}^t;{\mathrm{g}}^t\right)}{1+{\overrightarrow{D}}_v^{t+1}\left({x}^{t+1},{y}^{t+1},{b}^{t+1};{\mathrm{g}}^{t+1}\right)} $$
(5-2)
$$ {SECH}_t^{t+1}=\frac{\left[1+{\overrightarrow{D}}_c^t\left({x}^t,{y}^t,{b}^t;{\mathrm{g}}^t\right)\right]/\left[1+{\overrightarrow{D}}_c^t\left({x}^t,{y}^t,{b}^t;{\mathrm{g}}^t\right)\right]}{\left[1+{\overrightarrow{D}}_c^{t+1}\left({x}^{t+1},{y}^{t+1},{b}^{t+1};{\mathrm{g}}^{t+1}\right)\right]/\left[1+{\overrightarrow{D}}_c^{t+1}\left({x}^{t+1},{y}^{t+1},{b}^{t+1};{\mathrm{g}}^{t+1}\right)\right]} $$
(5-3)

where and represent the directional distance function based on VRS and constant return to scale (CRS), respectively. PEFFCH represents the impact of production management level on ecological efficiency. PEFFCH>1 means efficiency improvement; otherwise, it indicates a decrease in efficiency. SECH represents the impact of production scale on ecological efficiency. SECH>1 means close to the optimal production scale; otherwise, it means far from the optimal scale. TECH represents the production technology change of the DMUs from period t to t+1. If TECH>1, then the production technology has improved; otherwise, it means the production technology has declined.

Hot spot analysis

Hot spot analysis can identify significant high or low values to analyze the spatial distribution characteristics of the observed object (Xu et al. 2019; Ord 1995). This paper uses a hot spot analysis model to identify areas with high or low values of ecological efficiency. The specific model is as follows:

$$ {G}_i^{\ast }=\frac{\sum \limits_{j=1}^n{w}_{ij}{x}_j-\overline{X\sum \limits_{j=1}^n{w}_{ij}}}{S\sqrt{n\sum \limits_{j=1}^n{w}_{ij}^2}-{\left(\sum \limits_{j=1}^n{w}_{ij}\right)}^2} $$
(6-1)

where wij represents the spatial weight matrix; xj is the observation value of unit j; \( \overline{X} \)is the sample mean; S is the sample variance; n is the total number of samples. Other variables in the model include:

$$ \overline{X}=\frac{\sum \limits_{j=1}^n{x}_j}{n}\ \mathrm{and}\ S=\sqrt{\frac{\sum \limits_{j=1}^n{x}_j^2}{n}-{\left(\overline{X}\right)}^2} $$
(6-2)

If the Gi value is high and significant, it indicates a significant hot spot (higher ecological efficiency value); If Gi is negative and significant, it is a cold spot (Xu et al. 2021; ESRI 2016).

Spatial econometric model

Observed values of geographic samples usually have spatial autocorrelation, and it is necessary to consider geographic factors to establish an appropriate spatial measurement model. Based on the theory of spatial econometrics, we have established three models to explore the factors affecting urban ecological efficiency.

The spatial lag model (SLM) mainly reveals whether ecological efficiency has spread in space (Elhorst 2012). The specific model is as follows:

$$ {EE}_{it}=\delta \sum \limits^n{w}_{ij}{EE}_{it}+{\beta}_1{IDN}_{it}+{\beta}_2{IDN^2}_{it}+{\beta}_3{ER}_{it}+{\beta}_4{TRA}_{it}+{\beta}_5{POP}_{it}+{\beta}_6{FDI}_{it}+{\beta}_7{TEC}_{it}+{\mu}_i+{\varepsilon}_{it} $$
(7)

where EEit is the explained variable, which refers to urban ecological efficiency of city i in year t; β1, β2, …β7 are the influencing coefficients of urban ecological efficiency, δ is the spatial autoregressive coefficient, μi is the individual fixed effect, and εit is the random error term.

The spatial error model (SEM) reflects the error through the spatial covariance of different regions and mainly explains the influence of neglected variables on the model (Han 2020). The specific model is as follows:

$$ {EE}_{it}={\beta}_1{IDN}_{it}+{\beta}_2{IDN^2}_{it}+{\beta}_3{ER}_{it}+{\beta}_4{TRA}_{it}+{\beta}_5{POP}_{it}+{\beta}_6{FDI}_{it}+{\beta}_7{TEC}_{it}+{\mu}_i+{\gamma}_{it} $$
(8)
$$ {\gamma}_{it}=\lambda \sum \limits_{j=1}^n{w}_{it}{\gamma}_{it}+{\varepsilon}_{it} $$
(8-1)

where γit is the autocorrelation term of the spatial error, and λ is the autocorrelation coefficient.

The spatial Durbin model (SDM) considers the dependent variable is affected by the independent variables and dependent variables in this region and other regions. LeSage and Pace (2009) pointed out that the SDM can efficiently capture the direct and spillover effects produced by the observed individual. The specific model is as follows:

$$ {EE}_{it}=\delta \sum \limits_{j=1}^n{w}_{ij}{EE}_{it}+{\beta}_1{IDN}_{it}+{\beta}_2{IDN^2}_{it}+{\beta}_3{ER}_{it}+{\beta}_4{TRA}_{it}{\beta}_5{POP}_{it}+{\beta}_6{FDI}_{it}+{\beta}_7{TEC}_{it}+{\theta}_1\sum \limits_{j=1}^n{w}_{ij}{IDN}_{it}+{\theta}_2\sum \limits_{j=1}^n{w}_{ij}{IDN^2}_{it}+{\theta}_3\sum \limits_{j=1}^n{w}_{ij}{ER}_{it}+{\theta}_4\sum \limits_{j=1}^n{w}_{ij}{TRA}_{it}+{\theta}_5\sum \limits_{j=1}^n{w}_{ij}{POP}_{it}+{\theta}_6\sum \limits_{j=1}^n{FDI}_{it}+{\theta}_7\sum \limits_{j=1}^n{TEC}_{it}+{\mu}_i+{\varepsilon}_{it} $$
(9)

where β1, β2β7 represent the coefficients of explanatory variables; θ1, θ2θ7 represents the spatial autocorrelation coefficient of exogenous variables; other parameters are consistent with the above model.

Spatial weight setting

Different types of spatial weight matrices reflect the complex relationships between cities. To comprehensively reflect the impact of distance, economy, and their interaction effects on urban ecological efficiency, this paper constructs the following three spatial weight matrices (Table 1).

Table 1 Three spatial weight matrices

(1) Geographic distance weight matrix (W1)

The first law of geography states that the smaller the distance between cities, the greater the spatial interaction (Liu et al. 2020)

(2) Economic distance weight matrix (W2)

With the continuous development of modern transportation, economy has gradually become the dominant factor affecting urban development in addition to geographical factors. This paper considers economic and geographic factors to construct an economic distance matrix W2.

(3) Asymmetric economic distance weight matrix (W3)

Generally, cities with high economic levels will have a strong influence on cities with low economic levels (Li et al. 2019). The asymmetric economic distance matrix organically combines the economic and distance matrices, which can efficiently describe the comprehensiveness and complexity of the spatial effects.

where d2ij represents the straight-line distance between the administrative center of city i and j; GDPi and GDPj represent the GDP of cities i and j; diag(...) is a diagonal matrix, and GDPa represents the average GDP of all cities.

Spatial stratified heterogeneity measure

Although the spatial econometric model includes spatial and economic factors, the spatial stratified heterogeneity of ecological efficiency has not been considered. According to Wang et al.’s (2016) research, spatial stratified heterogeneity refers to uneven distributions of traits, events, or their relationship across a region or, simply, spatial variation of attributes. The geographical detector can explore the spatial stratified heterogeneity of the explained variable Y and its influencing factors to a certain extent, which is an important tool to measure the spatial stratified heterogeneity (Wang et al. 2010; Polykretis and Alexakis 2021). The model is as follows:

$$ q=1-\frac{\sum \limits_{h=1}^L{N}_h{\sigma}_h^2}{{N\sigma}^2}=1-\frac{SSW}{SST} $$
(10-1)
$$ SSW=\sum \limits_{h=1}^L{N}_h{\sigma}_h^2\cdotp SST={N\sigma}^2 $$
(10-2)

Specifically, the study area is composed of N units and is stratified into h=1, 2, . . ., L stratum; stratum h is composed of Nh units; σ2 represents the variance of ecological efficiency; SSW and SST are within sum of squares and total sum of squares, respectively. The value of the q-statistic is between 0 and 1. The higher the value of q, the greater the spatial stratified heterogeneity of the explained variable, and the stronger the explanatory power of the independent variable X to the explained variable Y.

Research area and data sources

Based on the availability of data, we used 269 prefecture-level cities in China from 2008 to 2017 as the research unit (Fig.2). According to the division of administrative regions, this paper divided China into eastern, central, western, and northeastern regions. Among them, the eastern region includes 85 cities, such as Beijing, Shanghai, and Guangzhou, and is the most economically developed region in China. The central region includes 79 cities, such as Zhengzhou, Wuhan, and Hefei, and is the second echelon of China’s economic and industrial development. The western region includes 68 cities, such as Chongqing, Xi’an, and Guiyang, and has relatively backward economic and industrial development. The northeastern region includes 37 cities, such as Changchun, Harbin, and Shenyang, and the economic and industrial development is facing transformation and upgrading. The labor force, land resources, capital stock, and pollutant emissions data came from the “China City Statistical Yearbook” and “China Environmental Statistical Yearbook.” The GDP per capita came from the website of the prefecture-level city government. The numbers of permanent residents came from the statistical bulletin of prefecture-level cities.

Fig. 2
figure 2

Map of China's administrative divisions

Results

The temporal and spatial evolution characteristics of urban ecological efficiency

We used the super-SBM model to measure the ecological efficiency of 269 cities in China and combined hot spot analysis in ArcGIS to explore the temporal and spatial evolution characteristics of urban ecological efficiency in 2008, 2011, 2014, and 2017. The results are shown in Fig. 3.

Fig. 3
figure 3

Hot spot analysis of urban ecological efficiency. Note: The hot spot analysis tool in ArcGis 10.3 divides the city into hot spot cities and cold spot cities according to the size of the city’s ecological efficiency. The hot spot city has a value greater than 0 and is green, while the cold spot city has a value less than 0 and is red

In general, China’s urban ecological efficiency had strong temporal and spatial heterogeneity, and the spatial pattern of “high in the east and low in the west” was the most prominent. Specifically, in 2008, the ecological efficiency hotspot cities were mainly concentrated in the eastern coastal areas such as Shenzhen, Guangzhou, and Zhongshan, as well as the “Hubao Eyu” and “Shandong Peninsula” urban agglomerations. Ecological efficiency cold spot cities were mainly distributed in Yichun and Hegang in the northeast and Anhui, Shaanxi, Hunan, and Hubei in the central and western regions. In 2011, the ecological efficiency hotspot cities were still concentrated in the eastern coastal areas. For example, the ecological efficiency of Beijing, Foshan, and Shenzhen was 1.434, 1.431, and 1.005 respectively, and they were the most ecologically efficient cities. Ecological efficiency cold spot cities were mainly distributed in central and western regions such as Baise, Guangxi, and Xuancheng, Anhui, and the number increased from 156 in 2008 to 170 in 2011. This result may be because the eastern coastal areas of China have a strong industrial foundation and advantages in technology, talent, and capital, which enable them to improve urban ecological efficiency through industrial structure optimization and technological progress while also developing the economy. Compared with 2011, the spatial pattern of ecological efficiency in 2014 did not change much, showing an obvious phenomenon of “spatial solidification.” In 2017, the number of cold spot cities in the central region decreased significantly, while that in the western region increased rapidly. For example, the ecological efficiency of Pingliang, Lanzhou, and Shangluo were all less than 0.3, indicating they were significant cold spot cities. This result is mainly because China has adopted a gradient development strategy for a long time, which has resulted in the ecological efficiency pattern of east>central>west becoming more prominent over time. In addition, the productivity of the western region is relatively backward, which will consume many resources to obtain the same economic benefits, resulting in overall low ecological efficiency.

Referring to the research of Wen et al. (2021) and Taylor (2000), cumulative sum plots and bootstrapping were combined to detect the change point of ecological efficiency (Fig.4). We found that approximately 2012 was the change point of the ecological efficiency of China’s eastern, central, western, and northeastern regions, and the confidence interval was 95%. This result was mainly because the cumulative sum plots tended to expand subtle changes, and the decline in urban ecological efficiency in approximately 2012 was even greater, making it easier to be detected by the cumulative sum plots. After the 2008 global economic crisis, the Chinese government vigorously promoted industrialization and urbanization to fully restore economic development. On the one hand, the industrial development demand for steel, cement, and land resources has sharply increased, thus resulting in the massive emissions of industrial wastewater and waste gas. On the other hand, rapid urbanization has attracted many people into cities, leading to the concentrated discharge of domestic sewage, garbage, and automobile exhaust, causing serious damage to the ecological environment. Due to the cumulative and lagging nature of changes in the ecological environment, the environmental damage caused by the development of industrialization and urbanization was not immediately reflected, which led to structural changes in ecological efficiency in approximately 2012.

Fig. 4
figure 4

The cumulative sum charts of urban ecological efficiency in 2008–2017

At the provincial level, the average ecological efficiency of Beijing, Shanghai, and Hainan from 2008 to 2017 was 1.045, 0.863 and 0.833, respectively, and they were the regions with the highest ecological efficiency (Table 2). Compared with other cities, Beijing and Shanghai have significant talent, capital, and policy advantages, while Hainan has abundant tourism resources. With the deepening of the division of urban functions, the economic development models of Beijing, Shanghai, and Hainan have gradually changed from the original high-polluting and high-energy-consuming industries to high-value-added, high-efficiency tertiary industries and modern service industries. For example, in 2017, the tertiary industry in Beijing and Shanghai accounted for more than 80% of the GDP, becoming an important engine driving economic development. Tourism accounts for 49% of Hainan’s GDP and has become a pillar industry in Hainan Province.

Table 2 Average value of provincial ecological efficiency from 2008 to 2017

The ecological efficiency of Gansu, Chongqing, Jiangxi, Qinghai, and Ningxia in the central and western regions were relatively low from 2008 to 2017 (0.415, 0.385, 0.377, 0.365, and 0.288, respectively). On the one hand, the central and western regions have a fragile ecological environment, overexploited resources, and relatively backward environmental awareness. On the other hand, the central and western regions are the main undertaking areas for high-pollution and high-energy-consuming industries in the eastern region. However, we also noticed that the ecological efficiency of the central and western regions showed a slow growth trend after 2014. This phenomenon shows that the central and western regions are also strengthening ecological compensation while developing the economy.

The internal evolution mechanism of urban ecological efficiency

Urban ecological efficiency is not only closely related to external factors such as the level of economic and industrial development and business environment but also depends on internal driving factors such as technological progress, production management level, and technological catch-up speed. To further explore the internal evolution mechanism of urban ecological efficiency, we used the decomposed ML index to analyze it from the perspectives of TECH, PEFFCH, and SECH. The results are shown in Table 3 and Fig. 5.

Table 3 The average values of TECH, PEFFCH and SECH in different regions from 2008 to 2017
Fig. 5
figure 5

Average values of TECH, PEFFCH and SECH in different cities from 2008 to 2017

The TECH index of the four main regions of China was greater than 1, which indicated that TECH has improved the ecological efficiency of the eastern, central, western, and northeastern regions. Among them, the TECH index of the eastern and northeastern regions represented by Shenzhen and Changchun was significantly higher than that of the central and western regions. This result is mainly because the eastern region has an obvious location advantage, talent advantages, and a good innovation environment, which are conducive to technology transfer and knowledge exchange among enterprises, thereby expanding the “innovation compensation effect” and improving urban ecological efficiency. The PEFFCH index of the central and northeastern regions represented by Wuhan and Harbin was relatively high, indicating that the production management level and resource allocation efficiency of enterprises in the central and northeastern regions have been rapidly improved. However, the PEFFCH index of the western region was 0.990, which restricts the improvement of ecological efficiency to a certain extent. This situation may be because the development of the western region is still dominated by an extensive economy, the allocation of capital, energy, and other factors is unreasonable, and the management level is relatively low. Moreover, the western region has undertaken most of the eliminated industries in the eastern region, which may also be one of the reasons for the decline in PEFFCH. From the perspective of the SECH index, major cities such as Beijing, Guangzhou, and Shenzhen in the eastern region have relatively low SECH indexes. This situation shows that the resources in the eastern region are overconcentrated and the marginal revenue is gradually decreasing, which is also proven by its PEFFCH value being less than 1. Therefore, the eastern region should focus on improving resource utilization efficiency instead of blindly increasing resource inputs and expanding the production scale. However, the SECH in the central and western regions was greater than 1, which indicated that the concentration of resources in the central and western regions could expand the production efficiency and enhance corporate competitiveness.

Model testing and regression results of spatial econometrics

Spatial autocorrelation test

The economic matrix, economic distance matrix, and asymmetric economic distance matrix were selected to test the spatial autocorrelation of ecological efficiency of 269 cities in China from 2008 to 2017. The results show that the global Moran index under different spatial matrices from 2008 to 2017 is significantly positive, indicating that the urban ecological efficiency has a strong positive correlation (Table 4). Therefore, the spatial econometric model should be used to further analyze its influencing factors.

Table 4 Spatial autocorrelation test under different weight matrices

Spatial econometric model selection

With reference to the research of Wen et al. (2020), we use Lagrange Multiplier (LM) tests (Anselin 1988) and robust LM tests (Anselin et al. 1996) to select appropriate spatial econometric models (Table 5). Both the LM and robust LM tests show that the hypotheses of no spatially lagged dependent variable and the hypotheses of no spatially auto-correlated error term are rejected. This result shows that the non-spatial model is rejected, and the spatial autocorrelation and spatial error correlation coexist in the model (Pace and LeSage 2009). In this case, LeSage and Pace (2009) recommend using Wald and LR tests to determine whether SDM can be reduced to SLM and SEM: (1) If θ=0, the SDM model can be reduced to the SLM model; (2) If θ=−βδ, the SDM model can be reduced to the SEM model. We found that the Wald and LR test rejected the hypothesis at the 1% significance level, indicating that SDM is more suitable for this study.

Table 5 LM, Wald, LR, and Hausman tests under different weight matrices

Finally, P<0.01 of the Hausman test under different matrices rejected random effects (Table 5); thus, a fixed-effects model should be used. However, the fixed effects model is divided into three types (time fixed, space fixed, and double fixed). To compare which fixed-effects model has the best fitting effect, we tested its R2 and log-likelihood index. The results show that the R2 and log-likelihood of the space fixed effects and the double fixed effects model under different matrices are significantly greater than the time fixed effects model (Table 6). However, the R2 and log-likelihood index of the space and double fixed effects models are similar. After comprehensively comparing the performance of each influencing factor, we finally choose the space fixed effects model for fitting analysis. Overall, under the weight matrices of W1, W2, and W3, the R2 of the SDM was 0.8873, 0.8863, and 0.8849, respectively, and the log-likelihood index was 2378.02, 2373.11, and 2364.31, respectively, indicating that the model construction and index selection were relatively reasonable.

Table 6 R2 and log-likelihood tests under different weight matrices

Estimation results

To objectively and accurately evaluate the regression results, this study compared and analyzed the traditional panel model and the spatial Durbin model under three different weight matrices (Table 7).

Table 7 Regression results of spatial Durbin model with fixed effects

The IND coefficients under the traditional panel model and the spatial Durbin model were both significantly negative, but the coefficients of the traditional panel model were smaller than those of the spatial Durbin model with different spatial weight matrices. This finding showed that ignoring spatial and economic factors would underestimate the impact of IND on urban ecological efficiency. Moreover, the coefficients of IND2 under the W1, W2, and W3 matrices were 0.0079, 0.0118, and 0.0119, respectively, and all passed the significance test. This result showed that industrial agglomeration has had a certain threshold effect on the improvement of urban ecological efficiency. Only when industrial agglomeration exceeds a certain scale will it generate external benefits and improve ecological efficiency. It is undeniable that industrial agglomeration can generate more external benefits through market effects, cost of living effects, and technology spillover effects and is regarded as an engine driving economic growth. We should also realize that as the largest manufacturing country in the world, China’s industrial agglomeration level is still in a relatively low position. The industrial agglomeration areas of most cities place the same or different types of enterprises in a specific space. However, these companies have failed to develop additional technical and economic ties, and some companies may even maliciously compete for market share and commercial interests. Moreover, most Chinese companies are foundries in developed countries such as the USA and Europe and are still at the middle and lower ends of the industry chain. The large-scale agglomeration of these enterprises not only seriously consumes natural resources but also discharges a large amount of harmful substances, which aggravates environmental pollution.

The coefficients of ER under W1, W2, and W3 matrices are 0.0609, 0.0551, and 0.0599, respectively, and all pass the significance test. This finding shows that environmental regulation has a significant positive effect on urban ecological efficiency, which is consistent with the study of Lanoie et al. (2011). On the one hand, the “Porter Hypothesis” believed that environmental regulations can promote enterprises to increase investment in scientific research and upgrade technological equipment, thereby forming a certain “innovation compensation effect” and improving urban ecological efficiency. In addition, China’s rapid economic development has increased the demand for energy and materials, resulting in the massive discharge of sulfur dioxide, nitrogen oxides, and wastewater. However, traditional methods (landfill and plant purification) cannot efficiently eliminate the harm of chemical pollution to the ecological environment and human health. Therefore, the improvement of the ecological efficiency and ecological environment increasingly depends on environmental regulations and technological progress. On the other hand, environmental pollution has become one of the important problems in developed and developing countries. Formulating corresponding laws and regulations, increasing penalties for environmental pollution, and solving environmental pollution from the source have become important measures to improve ecological efficiency.

Direct and spillover effects

Considering the existence of spatial spillover effects, the total effect needs to be decomposed into direct effects and spillover effects to better explain the influence of industrial agglomeration and environmental regulations on urban ecological efficiency (Chen and Ye 2019).

The direct effects of IND and IND2 passed the significance test under W1, W2, and W3, but IND was significantly negative and IND2 was significantly positive (Table 8). This finding shows that the direct effects of IND on urban ecological efficiency have certain threshold effects. Only when industrial agglomeration reaches a certain scale can it break through the “Solo Paradox” and have a positive impact on the ecological efficiency of the local city. We also noticed that the spillover effects of IND and IND2 under the W1 matrix passed the 0.01 significance test; however, they failed the significance test under the W2 and W3 matrices. This result shows that only under the distance matrix can industrial agglomeration exert its spatial spillover effect to improve the ecological efficiency of neighboring cities. This situation may be due to the strong distance sensitivity of the spillover effects of industrial agglomeration. Specifically, the introduction of economic factors has weakened the distance sensitivity of industrial agglomeration to the ecological efficiency of neighboring cities.

Table 8 Direct effects and spillover effects

The direct and spillover effects of the ER under the W1, W2, and W3 matrices are significantly positive, which was consistent with the expected results. Specifically, under the W1, W2, and W3 matrices, for every 1% increase in the intensity of environmental regulations, the ecological efficiency of local cities will increase by 0.0610%, 0.0559%, and 0.0606% and that of neighboring cities will increase by 0.0388%, 0.0308%, and 0.0553%, respectively. This result shows that the “innovation compensation effect” produced by environmental regulation is greater than the “compliance cost,” which verifies the applicability of the Porter hypothesis in urban ecological efficiency to a certain extent.

Transportation development (TRA) was negatively correlated with urban ecological efficiency and passed the 0.01 significance test. We tried to explain this result from the following aspects. First, ecological efficiency is a comprehensive index that considers economic development and the ecological environment, which means that the evaluation of ecological efficiency not only considers economic development but also considers the ecological environment. Although the improvement of transportation level can promote the flow of factors and economic development, it also accelerates resource consumption and environmental pollution (haze pollution, black and odorous water bodies, etc.). When the environmental pollution effect brought by transportation development is greater than the economic development effect, it will have a negative impact on ecological efficiency. In addition, as the world’s largest infrastructure construction country, a large part of China’s economic development is driven by infrastructure investment. However, the construction of transportation infrastructure needs to consume many resources, and the particularly dense and unreasonably designed infrastructure not only fails to produce transportation network effects but also causes a waste of resources. Finally, the improvement of the transportation level may produce a “siphon effect,” attracting a large number of people and industries into the city, thereby increasing energy consumption and generating a large amount of domestic sewage, garbage, and automobile exhaust.

The direct effect of population density under the W2 and W3 matrices is significantly negative, and the spillover effect is positive, indicating that population agglomeration may cause environmental pollution and traffic congestion, which is not conducive to the improvement of local urban ecological efficiency. Under the W1, W2, and W3 matrices, the direct effects and spillover effects of FDI are significantly positive. This finding shows that the introduction of FDI did not produce a “pollution haven” effect but instead brought many advanced experience, technology, and management models, which improved the urban ecological efficiency. Moreover, technological innovation had a strong positive impact on the ecological efficiency of local cities, but it had a significant negative impact on the ecological efficiency of neighboring cities, which could be explained by the “rebound effect” (Bye et al. 2018). Specifically, technological innovation has improved the resource utilization efficiency of local cities; however, for neighboring cities, the improvement of resource utilization efficiency will further expand the demand for resources, thereby offsetting the resource consumption saved by technological innovation.

Robustness test

With reference to the relevant literature, we conducted robustness tests on the above main results from the following two aspects to ensure the reliability of the research conclusions (Zheng et al. 2014). First, we introduced the first-order lag term of the explained variable to investigate the influence of factors other than the explanatory variable on the explained variable. Moreover, we used the number of industrial enterprises above a designated size to characterize the level of industrial agglomeration to test the robustness of the model.

The first-order lag term of the explained variable was significantly positive, which showed that the changes in ecological efficiency had strong time inertia (Table 9). The U-shaped relationship between ecological efficiency and industrial agglomeration was supported, and environmental regulations could still promote the improvement of ecological efficiency, indicating that the above research conclusions were reliable. In fact, this paper evaluated the impact of industrial agglomeration and environmental regulation on urban ecological efficiency based on three spatial weight matrices, which also verified the robustness of the model to a certain extent.

Table 9 Robustness test

Spatial stratified heterogeneity assessment

With the development and popularization of positioning and observation technologies, whether at a finer or larger research scale, the problem of spatial stratified heterogeneity has become prominent (Wang et al.2010). Spatial stratified heterogeneity, referring to the within-strata variance less than the between strata variance, is a unique geographical phenomenon. Considering that ecological efficiency may have a certain spatial stratified heterogeneity, we need to measure it with a geographical detector model and explain its reasons.

The results showed that all explanatory variables passed the 0.01 significance test (Table 10). Among them, the q values of IND, IND2, and ER were 0.1799, 0.1897, and 0.1659, respectively, which had the most significant impacts on urban ecological efficiency. On the one hand, industrial agglomeration has strong technology and management spillover effects and is an important engine for promoting economic development and improving ecological efficiency. On the other hand, due to excessive emissions and lack of supervision, although industrial agglomeration has promoted economic development, it has also led to environmental pollution and ecological damage. It is worth noting that the q value of POP was relatively small, indicating that the distribution patterns of ecological efficiency and population density had certain spatial differences.

Table 10 The q-statistic values and p values for the ecological efficiency determinants from the factor detector

The interaction detection of seven explanatory variables found that the interaction term of the explanatory variable had a higher impact on ecological efficiency than a single explanatory variable (Table 11). For example, the impact of IND on ecological efficiency was 0.1799, and the impact of the interaction term of IND and ER on ecological efficiency was 0.2786. This result shows that urban ecological efficiency is affected by multiple factors, and it is necessary to comprehensively utilize industrial agglomeration, environmental regulation, technological innovation, and other approaches to reduce environmental pollution and improve ecological efficiency.

Table 11 Detection of interaction factors of ecological efficiency

Conclusions and discussion

For any country, ecological efficiency and economic development are double-edged swords. It is inevitable to sacrifice the ecological environment in exchange for economic development, especially in developing countries where science and technology are relatively backward. Despite these facts, when faced with rapid economic development, we can still achieve green and coordinated development through environmental regulations and industrial agglomeration. This paper explored the spatial and temporal distribution patterns of ecological efficiency in 269 cities in China from 2008 to 2017 and its internal driving mechanism through the Super-SBM-DEA model and ML index. In addition, combined with the spatial Durbin model under different weight matrices, we investigated the direct and spillover effects of industrial agglomeration and environmental regulations on urban ecological efficiency. Furthermore, we also explore the spatial stratified heterogeneity of ecological efficiency and its driving factors through the geographic detector model. We hope that this research provides a reference for improving the ecological efficiency of China and other developing countries.

First, we found that due to differences in industrial structure and production efficiency, China’s urban ecological efficiency had strong temporal and spatial heterogeneity, and the spatial pattern of “high in the east and low in the west” was the most prominent, which was consistent with the research of Zhang et al. (2011). The change point of China’s urban ecological efficiency was 2012. Specifically, ecological environmental changes have strong accumulation and lag, and the environmental damage caused by industrialization and urbanization could not be reflected immediately, which led to structural changes in ecological efficiency in approximately 2012. Due to the different life cycles of cities, the internal evolution mechanism of urban ecological efficiency had significant differences. TECH, PEFFCH, and SECH contributed the most to the ecological efficiency of the eastern, central, and western regions, respectively. Relatedly, Yasmeen et al. (2020) used the SBM-DEA model, combined with energy-saving emission reduction and economic development data, to prove that the relatively high level of technology in eastern China has a strong promotion effect on the ecological environment.

Second, the industrial agglomeration coefficient under the traditional panel model was significantly smaller than the coefficient under the W1, W2, and W3 matrices. This finding shows that if spatial and economic factors are not considered, the impact of industrial agglomeration on urban ecological efficiency will be underestimated. During the study period, the level of industrial agglomeration in China was relatively low, which inhibited the growth of urban ecological efficiency. However, as the scale and intensity of industrial agglomeration continue to increase, it can effectively break through the “Solo Paradox” and improve urban ecological efficiency. Similarly, Chen et al. (2020) found that further expansion of industrial agglomeration can reduce environmental pollution and improve ecological efficiency. Under the W1, W2, and W3 matrices, the coefficients of environmental regulation were 0.0609, 0.0551, and 0.0599, respectively, and all passed the 0.01 significance test, which was consistent with most existing studies (Wang et al. 2019).

Third, the direct effect of industrial agglomeration on urban ecological efficiency had a significant U-shaped relationship. However, the spillover effect of industrial agglomeration may have strong distance sensitivity, leading to its failure to pass the significance test under the economic distance matrix and the asymmetric economic distance matrix. In other words, the introduction of economic factors has weakened the distance sensitivity of industrial agglomeration to the ecological efficiency of neighboring cities. Moreover, the direct and spillover effects of ER under the W1, W2, and W3 matrices were significantly positive, which was consistent with the expected results. Specifically, under the W1, W2, and W3 matrices, for every 1% increase in the intensity of environmental regulations, the ecological efficiency of local cities will increase by 0.0601%, 0.0559%, and 0.0606%, respectively, and that of the neighboring cities will increase by 0.0388%, 0.0308%, and 0.0553%, respectively. This result shows that the “innovation compensation effect” formed by environmental regulations is greater than the “compliance cost,” which verifies the applicability of the “Porter Hypothesis” in urban ecological efficiency to a certain extent.

Finally, the model test demonstrated that the current infrastructure construction in China consumes many resources and cannot produce traffic network effects in a short time, which may not be conducive to the improvement of urban ecological efficiency. The introduction of FDI did not produce a “pollution paradise effect” but instead brought advanced experience, technology, and management models to improve urban ecological efficiency. Technological innovation has improved the ecological efficiency of local cities, but due to the “rebound effect,” it has expanded the resource demand of neighboring cities, resulting in a significantly negative spillover effect. In addition, the geographical detector shows that each variable has a certain impact on the urban ecological efficiency, and the impact of the interaction term is greater than that of a single variable.

Policy recommendations

  1. (1)

    Optimize the allocation of resources and promote the coordinated development of urban ecological efficiency. Due to the industrial foundation and location advantages, China’s urban ecological efficiency has strong temporal and spatial heterogeneity, which has become an important factor restricting the coordinated development of regions. As a high-value area of ecological efficiency, the eastern region should give full play to its leading role and strengthen cooperation with the central and western regions in ecological governance. The central and western regions should pay attention to pollution control while developing the economy, and actively learn from the advanced pollution control technologies and experience of the eastern region. In addition, it is necessary to optimize the allocation of resources through industrial transfer and talent introduction measures to improve the level of technological progress and scale efficiency in the central and western regions, and promote the coordinated and efficient development of urban ecological efficiency.

  2. (2)

    Expand the scale of industrial agglomeration and optimize the industrial structure. Our research shows that industrial agglomeration and ecological efficiency have a certain U-shaped relationship, that is, only when industrial agglomeration breaks a certain threshold can the ecological efficiency of local and neighboring cities be improved. Therefore, it is necessary to further utilize the industrial agglomeration advantages of major urban agglomerations, extend the industrial chain, broaden the value chain, and help more cities cross the “turning point” of industrial agglomeration through the development of specialization and clustering. In addition, considering that ecological efficiency has strong spatial autocorrelation and spillover effects, policy makers must eliminate local protectionism, lay out industrial development from the perspective of regional integration, and strengthen information sharing and exchanges and cooperation between cities.

  3. (3)

    Strengthen environmental regulations and pollution control investment. Appropriate environmental regulations can effectively expand the “innovation compensation effect,” accelerate technology transfer and knowledge exchange between enterprises, enhance product competitiveness, and improve urban ecological efficiency. However, due to performance appraisal and job promotion, local governments have lowered environmental regulatory requirements in pursuit of economic development. This is not only not conducive to industrial transformation and upgrading, but also hinders the improvement of urban ecological efficiency to a certain extent. Therefore, local governments should transform the economic growth mode, regard environmental protection as an important assessment indicator, and vigorously develop high-tech and clean energy. Meanwhile, it is necessary to establish appropriate environmental regulatory policies, eliminate backward production capacity and high-polluting enterprises, promote enterprises to carry out technological innovation, and expand the “innovation compensation effect” of environmental regulation.

The limitations of this study are as follows: on the one hand, we did not consider the impact of different types of industrial agglomeration and environmental regulations on urban ecological efficiency. Previous studies have shown that different types of industrial agglomeration may produce varying externalities (e.g., Marshall–Arrow–Romer, Porter, and Jacobs externalities). Therefore, we should pay attention to whether different types of industrial agglomeration and urban ecological efficiency still follow a U-shaped relationship, and which type of industrial agglomeration can maximize urban ecological efficiency. On the other hand, our research shows that ecological efficiency is affected by multiple factors. How to construct a more reasonable ecological efficiency evaluation system and choose a more appropriate evaluation model is the focus of future research.