Stroke is a disease with a high fatality rate worldwide and a major cause of long-term disability. In the rehabilitation of limb motor function after stroke, the rehabilitation of upper limb function takes a long time and the recovery progress is slow, which seriously affects the patients' self-care ability in daily life. Repeated transcranial magnetic stimulation (rTMS) has been increasingly used to improve limb dysfunction in patients with stroke. However, a standardized reference for selecting a magnetic stimulation regimen is not available. Whether to increase the inhibition of the contralateral hemispheric motor cortex remains controversial. This study has evaluated the effects of different rTMS stimulation programs on upper limb function and corresponding brain functional network characteristics of patients with stroke and sought a new objective standard based on changes in brain network parameters to guide accurate rTMS stimulation programs. Thirty-six patients with stroke were selected and divided into control group and treatment group by number table method, with 18 patients in each group, and 3 patients in the control group were turned out and lost due to changes in disease condition. The treatment group was divided into two groups. TMS1 group was given 1 Hz magnetic stimulation in the M1 region of the contralesional hemisphere +10 Hz magnetic stimulation in the M1 region of the affected hemisphere, and the TMS2 group was given 10 Hz magnetic stimulation in the M1 region of the affected hemisphere. The control group was given false stimulation. The treatment course was once a day for 5 days a week for 4 weeks. The Fugl-Meyer Assessment for upper extremity (FMA-UE) sand near-infrared brain function were collected before treatment, 2 weeks after treatment, and 4 weeks after treatment, and the brain function network was constructed. Changes in brain oxygenated hemoglobin concentration and brain network parameters were analyzed with the recovery of motor function (i.e., increased FMA score). Meanwhile, according to the average increment of brain network parameters, the rTMS stimulation group was divided into two groups with good efficacy and poor efficacy. Network parameters of the two groups before and after rTMS treatment were analyzed statistically. (1) Before treatment, there was no statistical difference in Fugl-Meyer score between the control group and the magnetic stimulation group (p = 0.178).Compared with before treatment, Fugl-Meyer scores of 2 and 4 weeks after treatment were significantly increased in both groups (p <0.001), and FMA scores of 4 weeks after treatment were significantly improved compared with 2 weeks after treatment (p < 0.001). FMA scores increased faster in the magnetic stimulation group at 2 and 4 weeks compared with the control group at the same time point (p <0.001).TMS1 and TMS2 were compared at the same time point, FMA score in TMS2 group increased more significantly after 4 weeks of treatment (p = 0.010). (2) Before treatment, HbO2 content in healthy sensory motor cortex (SMC) area of magnetic stimulation group and control group was higher than that in other region of interest (ROI) area, but there was no significant difference in ROI between the two groups. After 4 weeks of treatment, the HbO2 content in the healthy SMC area was significantly decreased (p < 0.001), while the HbO2 content in the affected SMC area was significantly increased, and the change was more significant in the magnetic stimulation group (p < 0.001). (3) In-depth study found that with the recovery of motor function (FMA upper limb score increase ≥4 points) after magnetic stimulation intervention, brain network parameters were significantly improved. The mean increment of network parameters in TMS1 group and TMS2 group was significantly different (χ 2 = 5.844, p = 0.016). TMS2 group was more advantageous than TMS1 group in improving the mean increment of brain network parameters. (1) The rTMS treatment is beneficial to the recovery of upper limb motor function in stroke patients, and can significantly improve the intensity of brain network connection and reduce the island area. The island area refers to an isolated activated brain area that cannot transmit excitation to other related brain areas. (2) When the node degree of M1_Healthy region less than 0.52, it is suggested to perform promotion therapy only in the affected hemisphere. While the node degree greater than 0.52, and much larger than that in the M1_affected region. it is suggested that both inhibition in the contralesional hemisphere and high-frequency excitatory magnetic stimulation in the affected hemisphere can be performed. (3) In different brain functional network connection states, corresponding adjustment should be made to the treatment plan of rTMS to achieve optimal therapeutic effect and precise rehabilitation treatment.