The invention provides a discrete element modeling method for stochastic void defect materials based on hyperelliptic equation, which can randomly generate ellipse, rhombus, star or rectangular cavitydefects with different flatness by controlling parameters, and is used for discrete element simulation research of hard and brittle materials. The concrete steps are as follows: defining the main physical parameters of the material, generating particles in a closed calculation area and assigning microscopic contact property parameters to the particles, and randomly determining a certain number ofvoid defect centers with random positions; Based on the hyperelliptic equation, the hole defect patterns with different shapes are constructed at each center point. Delete the particles in each holedefect pattern, select the appropriate contact model, delete the wall of the closed area, and form the discrete element model of the hole defect. The method of the invention is simple and feasible, and the size, shape, angle and flatness of the formed hole defects are controllable, so that the generated material model is closer to the reality, so that the simulation calculation result is more accurate, and the simulation effectiveness is improved.