A method for generating a virtual boundary of a working region performed by a self-moving robot comprising the following steps: acquiring a plurality of recording points of a mobile positioning module which circles for a predetermined number of loops along a patrol path, wherein the patrol path is a loop formed by the boundary of the working region where the self-moving robot is located; the predetermined number of loops being greater than or equal to 2; storing the recording points corresponding to a first circle walked in a first storage linked list, and storing the remaining recording points in a second storage linked list; successively retrieving each recording point in the first storage linked list as a basic coordinate point, and querying the second storage linked list to successively select m recording point groups corresponding to each basic coordinate point, wherein each recording point group comprises a plurality of recording points closest to the currently selected basic coordinate point in the first storage linked list, and the number of recording points of the m recording point groups is successively increased as m becomes larger; wherein m is an integer not less than 1; acquiring boundary fitting points corresponding to the basic coordinate points according to each basic coordinate point and m corresponding recording point groups respectively; forming a boundary fitting point sequence from a set of a plurality of boundary fitting points by: respectively acquiring barycenter points of each recording point group; respectively acquiring a tangent line and a normal line corresponding to the barycenter point of each recording point group; respectively acquiring m eccentricities corresponding to each basic coordinate point, wherein an eccentricity (Excen) represents the deviation degree of the basic coordinate point and each barycenter point corresponding to the basic coordinate point and is defined according to the following formula: Excen = 1 − a b; wherein a and b represent the distance between the current basic coordinate point and the tangent and normal lines respectively; and acquiring the maximum eccentricity of the m eccentricities corresponding to the current basic coordinate point, and taking the barycenter point corresponding to the maximum eccentricity as the boundary fitting point corresponding to the current basic coordinate point; acquiring boundary points according to the boundary fitting point sequence; successively connecting the boundary points to generate a virtual boundary of the working region. acquiring a plurality of recording points of a mobile positioning module which circles for a predetermined number of loops along a patrol path, wherein the patrol path is a loop formed by the boundary of the working region where the self-moving robot is located; the predetermined number of loops being greater than or equal to 2; storing the recording points corresponding to a first circle walked in a first storage linked list, and storing the remaining recording points in a second storage linked list; successively retrieving each recording point in the first storage linked list as a basic coordinate point, and querying the second storage linked list to successively select m recording point groups corresponding to each basic coordinate point, wherein each recording point group comprises a plurality of recording points closest to the currently selected basic coordinate point in the first storage linked list, and the number of recording points of the m recording point groups is successively increased as m becomes larger; wherein m is an integer not less than 1; acquiring boundary fitting points corresponding to the basic coordinate points according to each basic coordinate point and m corresponding recording point groups respectively; forming a boundary fitting point sequence from a set of a plurality of boundary fitting points by: respectively acquiring barycenter points of each recording point group; respectively acquiring a tangent line and a normal line corresponding to the barycenter point of each recording point group; respectively acquiring m eccentricities corresponding to each basic coordinate point, wherein an eccentricity (Excen) represents the deviation degree of the basic coordinate point and each barycenter point corresponding to the basic coordinate point and is defined according to the following formula: Excen = 1 − a b; wherein a and b represent the distance between the current basic coordinate point and the tangent and normal lines respectively; and respectively acquiring barycenter points of each recording point group; respectively acquiring a tangent line and a normal line corresponding to the barycenter point of each recording point group; respectively acquiring m eccentricities corresponding to each basic coordinate point, wherein an eccentricity (Excen) represents the deviation degree of the basic coordinate point and each barycenter point corresponding to the basic coordinate point and is defined according to the following formula: Excen = 1 − a b; wherein a and b represent the distance between the current basic coordinate point and the tangent and normal lines respectively; and acquiring the maximum eccentricity of the m eccentricities corresponding to the current basic coordinate point, and taking the barycenter point corresponding to the maximum eccentricity as the boundary fitting point corresponding to the current basic coordinate point; acquiring boundary points according to the boundary fitting point sequence; successively connecting the boundary points to generate a virtual boundary of the working region.