The invention belongs to the technical field of affinal drug and diet formulas and novel resource foods and provides a medical formula food, a specific medical formula food or a non-specific medical formula food for people suffering from gastric ulcer and duodenal ulcer. The formula is designed according to requirements shown in the special medical purpose formula food general rule and physical characteristics of people suffering from gastric ulcer and duodenal ulcer, and utilizes multiple edible drugs according to a conventional traditional Chinese medicine quintessence theory. The multiple edible traditional Chinese medicine extract products extracted by a pre-hydrolysis SBE technology, multiple microencapsulated probiotics, short peptides extracted by biological enzymolysis, prebiotics, amino acids, carbohydrate, health grease, multiple vitamins and mineral matters are mixed and the mixture is processed to form the finished food. The food can be used as a single nutrition source satisfying nutritional requirements of people suffering from gastric ulcer and duodenal ulcer and has effects of promoting digestion and purgation, relieving stasis and harmonizing stomach, drying damp and strengthening spleen, tonifying spleen and regulating the flow of vital energy, soothing liver and regulating qi, nourishing yin and stomach, adjusting and reinforcing qi of middle-jiao energy and improving immunity.