The invention relates to the technical field of distance sensor packaging, and provides a packaging structure and packaging method of a distance sensor. The packaging structure comprises a substrate, a light-emitting chip, a sensing chip, an insulating support and a light blocking glue wall assembly; the light blocking glue wall assembly comprises at least one of a surrounding glue wall and a separating glue wall, and the surrounding glue wall surrounds the side face of the substrate and the side face of the insulating support; and the separation glue wall is connected to the sensing chip, is located between a receiving end photosensitive area and a transmitting end photosensitive area, and is connected with the insulating support. According to the packaging structure and packaging method of the distance sensor, the light blocking glue wall assembly is adopted to prevent light leakage, the technical problem that an existing distance sensor is low in detection accuracy is solved, and therefore the detection accuracy of the distance sensor is improved.