Cancer and heredity have a certain relationship, a lot of factors can contribute to the occurrence of cancer, such as genes, that is, related to genetic factors, and external environmental factors. Long-term exposure to poor living environment, such as exposure to chemicals or long-term diet irregularity, like to eat pickled, overnight or stimulating food, and there is a clear Helicobacter pylori infection, etc., as well as staying up late, stress, etc. may be a contributing factor to the occurrence of cancer. Therefore, in short, the occurrence of cancer is caused by both internal and external factors, and the internal factors are also related to heredity, so when there is a family history of heredity, that is, the immediate family members, for example, the mother and father have stomach cancer, the chances of the child having stomach cancer are much higher than normal people. It is recommended that this part of the population should be regularly checked for Helicobacter pylori and gastroenteroscopy, and early treatment should be carried out if problems are detected at an early stage, and should not wait until the patient does experience weight loss or obvious upper abdominal discomfort, as well as gastrointestinal symptoms, and then go to do a checkup, which may delay the development of the disease. Therefore, the presence of gastric cancer in the immediate family can be related to heredity, and early prevention and treatment are needed.