Nonlinear optical (NLO) crystal is an important component in laser frequency converter and high-tech military technology. It is worth noting that the NLO properties of crystals are largely determined by spatial arrangement of anionic groups. Recently, compounds with tri-coordinated ionic group have gained extensive attention due to their extraordinary NLO properties. It is of great significance to explore the relationship between the microstructure of tri-coordinated ionic groups and macroscopic properties of the NLO compounds. This paper illustrates the structure function relationship of compounds with tri-coordinated anion groups (alkali metal/alkaline earth metal), and reveals how tri-coordination ion groups influence SHG effect, phase matching capability and band gap of the compounds. Tri-coordinated anionic groups can be divided into isolated anionic groups, cyclized anionic groups and chain anionic groups according to different spatial arrangement. Specifically, when isolated planar triangular group and triangular cone group are arranged in order, which in favor of the SHG effect in the whole material. Meanwhile, anionic groups in ring shape contribute to a larger band gap of the compounds compared with triangular cone groups.