Gastric ulcers are characterized by damage to the stomach lining and are often triggered by substances such as ethanol and non-steroidal anti-inflammatory drugs. Patchouli alcohol (PA) has demonstrated effectiveness in treating gastric ulcers through antioxidative and anti-inflammatory effects. However, the water insolubility of PA and rapid gastric emptying cause low drug concentration and poor absorption in the stomach, resulting in limited treatment efficacy of PA. This study develops an oral gastroretentive raft forming system (GRFDDS) containing the aminated hollow mesoporous silica nanoparticles (NH2-HMSN) for PA delivery. The application of NH2-HMSN can enhance PA-loading capacity and water dispersibility, promoting bio-adhesion to the gastric mucosa and sustained drug release. The incorporation of PA-loaded NH2-HMSN (NH2-HMSN-PA) into GRFDDS can facilitate gastric drug retention and achieve long action, thereby improving therapeutic effects. The results reveal that NH2-HMSN-PA protects the gastric mucosa damage by inhibiting NLRP3-mediated pyroptosis. The GRFDDS, optimized through orthogonal design, demonstrates the gastric retention capacity and sustained drug release, exhibiting significant therapy efficacy in an ethanol-induced acute gastric ulcersmodel and an aspirin-induced chronic gastric ulcersmodel through antioxidation, anti-pyroptosis, and anti-inflammation. This study provides a potential strategy for enhancing druggability of insoluble natural compounds and therapeutic management of gastric ulcers.