It is believed that the hard X-ray emission in the luminous active galactic nuclei ( AGNs ) is from the hot corona above the cool accretion disk . However , the formation of the corona is still debated . Liu et al . investigated the spectrum of the corona heated by the reconnection of the magnetic field generated by dynamo action in the thin disk and emerging into the corona as a result of buoyancy instability . In the present paper , we improve this model to interpret the observed relation of the hard X-ray spectrum becoming softer at higher accretion rate in luminous AGNs . The magnetic field is characterized by \beta _ { 0 } , i.e. , the ratio of the sum of gas pressure and radiation pressure to magnetic pressure in the disk ( \beta _ { 0 } = ( P _ { g,d } + P _ { r,d } ) / P _ { B } ) . Besides , both the intrinsic disk photons and reprocessed photons by the disk are included as the seed photons for inverse Compton scattering . These improvements are crucial for investigating the effect of magnetic field on the accretion disk-corona when it is not clear whether the radiation pressure or gas pressure dominates in thin disk . We change the value of \beta _ { 0 } in order to constrain the magnetic field in the accretion disk . We find that the energy fraction released in the corona ( f ) gradually increases with the decrease of \beta _ { 0 } for the same accretion rate . When \beta _ { 0 } decreases to less than 50 , the structure and spectrum of the disk-corona is independent on accretion rate , which is similar to the hard spectrum found in Liu et al . ( 2003 ) . Comparing with the observational results of the hard X-ray bolometric correction factor in a sample of luminous AGNs , we suggest that the value of \beta _ { 0 } is about 100-200 for \alpha = 0.3 and the energy fraction f should be larger than 30 \% for hard X-ray emission .