Pot experiments were conducted to explore the effects of different rice straw returning soil on the community structure and function of bacteria in rice root, rhizosphere, leaf and phyllosphere under 7 conditions of rice straw combined with different fertilizers respectively. The results showed that: rice straw returning in different ways increased the content of soil pH and K, and reduced the accumulation of N, P and organic matter in soil, and different rice straw returning ways had different effects; rice straw returning reduced dry weight of rice grain, 2% of rice straw returning reduced rice grain greater than that of 1% rice straw returning; The reduction of NP combined fertilization is greater than that of NK combined fertilization and NPK combined fertilization. Except for the decrease of chao_1 index in rice root at maturity, rice straw returning significantly improved the abundance, diversity and evenness of bacteria in rice root, rhizosphere, leaf and phyllosphere. Rice straw returning increased the content of REEs in rice, and 2% of rice straw returning soil increased rare earth element (REE) content in rice grain greater than that of 1% rice straw returning soil. Different ways of rice straw returning soil reduced the abundance of Bacillus, while the abundance of Exiguobacterium in rice leaves was hundreds of times higher than that of the control group, and the genus in leaves was dozens of times higher than that of the control group, 2% of rice straw returning soil increased the abundance of harmful bacteria and pathogens of Acidovorax, Clostridium sensu stricto, Citrobacter, Curtobacterium, and 1% of rice straw returning soil promoted the abundance of nitrogen fixing bacteria, plant growth-promoting bacteria, stress resistant bacteria such as Lactobacillus, Azospira, Acinetobacter, Bradyrhizobium and Acidocella; Environmental factors such as available P, organic matter, total nitrogen, nitrate nitrogen, rare earth element content in rice roots, available K and soil moisture are important factors affecting the community structure of bacteria in rice roots, rhizosphere, leaf and phyllosphere at tillering stage of the rice. pH, REE content in rice roots, shoots, organic matter, total nitrogen, nitrate nitrogen and soil moisture content are the main environmental factors affecting the community structure of bacteria in rice roots, rhizosphere, leaf and phyllosphere at maturity stage of rice. 2% rice straw returning soil promoted the formation of harmful bacteria, which may be an important reason for its significant reduction in the dry weight of rice grains.