Working map processing method and self-moving device
By identifying and merging overlapping boundary areas in the intelligent robot's working map, the problem of data chaos caused by boundary overlap is solved, generating an independent and accurate working map, which improves robot navigation and user experience.
Patent Information
- Application Number
- CN202511226449.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-29
- Publication Date
- 2025-12-09
AI Technical Summary
In existing technologies, when intelligent robots build working maps, overlapping boundaries cause data chaos, affecting work efficiency and user experience. This is especially true in lawn environments, where overlapping boundaries can lead to data logic confusion and unclear user interface display.
By acquiring the target boundary line and historical boundary lines, it is determined whether there are overlapping areas. If there are overlaps, the boundary lines are merged to generate new target boundary lines, and the working map is updated to ensure that each boundary is independent and the data is accurate.
This solves the data chaos problem caused by overlapping boundaries. Each boundary in the generated working map is independent, the user interface is clear, data crossover and confusion are avoided, and the accuracy of robot navigation and user experience are improved.
Smart Images

Figure CN121089709A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of self-moving devices, in particular to a working map processing method and a self-moving device applying the same. BACKGROUND
[0002] With the development of science and technology, intelligent robots are gradually known by people, and more and more intelligent robots are applied in people's daily work and life. Common intelligent robots include intelligent lawn mowers, sweeping robots, snow sweepers, etc.
[0003] In the field of intelligent robots, a working map needs to be established before the robot works, such as user mapping and robot automatic mapping. The working map is of great significance for the autonomous navigation of the robot. The navigation algorithm needs to rely on the working map to plan the driving route, and the corresponding optimal path planning can also be obtained according to the shape and other attributes of the map.
[0004] Taking an intelligent lawn mower as an example, the actual lawn may not be continuous and complete, but may be separated by roads, fences, etc. It is necessary to establish multiple lawn boundaries. The newly established boundary may overlap with other established boundaries. If this overlapping situation is not handled, it will cause data confusion and affect the working efficiency of the machine and the user experience.
[0005] Therefore, it is necessary to design a working map processing scheme to solve the above problems. SUMMARY
[0006] In view of the deficiencies of the prior art, the present application provides an improved scheme: a working map processing method, the method is applied to a self-moving device, the self-moving device works in a working area according to the working map, the working map includes at least one historical boundary line, and the method includes:
[0007] acquiring a first target boundary line, and determining a first target boundary map according to the first target boundary line;
[0008] acquiring a historical boundary line stored in the working map, and determining a historical boundary map according to the historical boundary line;
[0009] determining whether there is an overlapping area between the first target boundary map and the historical boundary map one by one;
[0010] If there is an overlapping area, the first target boundary line and the historical boundary line are merged to obtain a second target boundary line, and the working map is updated according to the second target boundary line.
[0011] Preferably, the step of determining whether the first target boundary map and the historical boundary map have an overlapping area comprises:
[0012] acquiring identification information of the first target boundary map and the historical boundary map, the identification information comprising a first identification value of a position of an area on and inside a boundary line, and a second identification value of a position of an area outside the boundary line;
[0013] traversing the identification values of the first target boundary map and the historical map according to the coordinates of the positions;
[0014] when the identification values of the same position coordinates in the first target boundary map and the historical map are the first identification value, determining that the current coordinate position is an overlapping position of the first target boundary map and the historical map;
[0015] determining an overlapping area according to the number of overlapping positions, and determining that the first target boundary map and the historical boundary map have an overlapping area when the overlapping area exceeds a preset overlapping area value.
[0016] Preferably, the step of merging the first target boundary line and the historical boundary line to obtain a second target boundary line comprises: acquiring a closed outer contour line of the first target boundary line and the historical boundary line, and obtaining the second target boundary line according to the outer contour line.
[0017] Preferably, the historical boundary line has a code, and the step of updating the working map according to the second target boundary line comprises:
[0018] acquiring a target code, the target code being a code of a historical boundary line corresponding to a historical boundary map having an overlapping area with the first target boundary map;
[0019] adding the second target boundary line to the working map after deleting a historical boundary line corresponding to a historical boundary map having an overlapping area with the first target boundary map from the working map;
[0020] setting a code of the second target boundary line according to the target code.
[0021] Preferably, if the first target boundary map has overlapping areas with a plurality of historical boundary maps, the target code is one of the codes of the plurality of historical boundary lines.
[0022] Preferably, the working map further comprises a passageway connecting the historical boundary lines, and updating the working map according to the second target boundary line comprises: traversing the working map, finding the passageway in the working map, and determining the historical boundary lines connected at both ends of the passageway; and when it is determined that the historical boundary lines connected at both ends of the current passageway are both inside the second target boundary line, deleting the current passageway in the working map.
[0023] Preferably, if there is no overlapping area between the first target boundary map and the historical boundary map, updating the working map according to the first target boundary line.
[0024] Preferably, the obtaining of the first target boundary line comprises: controlling the self-moving device to move in a working area, and collecting trajectory points in real time, and generating a closed first target boundary line according to the trajectory points.
[0025] Preferably, the first target boundary line and the historical boundary line have a boundary type, the boundary type comprises an outer boundary type and an inner boundary type, the self-moving device is configured to work in an inner area of a boundary line of the outer boundary type and work in an outer area of a boundary line of the inner boundary type, and the reading of the historical boundary line stored in the working map comprises:
[0026] determining the boundary type of the first target boundary line;
[0027] when the type of the first target boundary line is the outer boundary type, obtaining the historical boundary line stored in the working map and having the boundary type of the outer boundary;
[0028] when the type of the first target boundary line is the inner boundary type, obtaining the historical boundary line stored in the working map and having the boundary type of the inner boundary.
[0029] The application further provides a self-moving device, comprising: a walking unit for walking in a working area; a working unit for working in the working area; an obtaining unit for obtaining a first target boundary line and a historical boundary line; and a processing unit in communication with the obtaining unit, for executing the working map processing method.
[0030] The application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the working map processing method.
[0031] Compared with the prior art, the application has the following beneficial effects: the processing method of the working map applied to the self-moving device provided by the application can determine whether there is overlap between boundaries when mapping, and if there is overlap, automatic merging is performed, so that each boundary in the generated working map is independent, and the data of each boundary will not appear cross confusion; in addition, when the working map is displayed to the user, the user will not be disturbed by the boundary overlap confusion, and the user can intuitively understand the shape of each boundary, which is convenient for subsequent user editing and other operations of the working map. BRIEF DESCRIPTION OF DRAWINGS
[0032] Figure 1 A hardware structure schematic diagram of a self-moving device is provided in the application.
[0033] Figure 2 A map processing method flow schematic diagram is provided in the application.
[0034] Figure 3 A bottom map processing schematic diagram in the processing method of the working map is provided in the application. DETAILED DESCRIPTION
[0035] The application will be further described in detail below in combination with the drawings and embodiments.
[0036] The terms used in the application are only for the purpose of describing specific embodiments, and are not intended to limit the application.
[0037] The map processing method described in the application is applicable to intelligent devices such as electric tools / electric devices, as long as the above-mentioned devices / tools can adopt the essential content of the technical solutions disclosed below, which falls within the protection scope of the application.
[0038] The terms used in the application are only for the purpose of describing specific embodiments, and are not intended to limit the application. For example, the words indicating the orientation or position relationship such as "upper", "lower", "front", "back" and the like are only based on the orientation or position relationship shown in the drawings, and are only for the convenience of describing the application and simplifying the description, and are not intended to indicate or imply that the device / element must have a specific orientation or be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the application.
[0039] With the rapid development of intelligent robot technology, mobile robots have been widely applied in household and industrial fields, covering various scenarios such as lawn mowing robots, sweeping robots, logistics handling robots, etc.
[0040] The robot needs to establish a work map before working, and plans a path and a working mode according to the work map. Taking an intelligent mower as an example, the working scene of the intelligent mower is a lawn, and the actual lawn is not necessarily continuous and complete, but may be separated by roads, fences and the like, and multiple lawn boundaries need to be established. The newly established boundary may partially overlap with other established boundaries. If the overlapping situation is not handled, two independent boundary data objects exist for the map, but because the two boundaries overlap, the following conflicts may occur:
[0041] 1. Two overlapping map graphics will be displayed on the APP of the user, which will be ugly if not handled. Moreover, the user can select the boundary to specify the machine to work in the boundary or delete the specified boundary. It is difficult to select the overlapping map graphics, and cognitive bias is likely to occur.
[0042] 2. The logic of the island data is confused. If there is an island in the original boundary, after the second boundary overlapping with the island appears, it is difficult to determine whether the island belongs to the original boundary or the next boundary, and the logic is confused, and it is difficult to avoid the island during navigation.
[0043] 3. The logic of the channel data is confused. In the multi-boundary scheme, the boundary is independent, and a channel needs to be designed to enable the machine to navigate to another boundary to work. If the two boundaries overlap, whether the channel is still needed to connect them; for example, two boundaries are originally independent and separated, and there is a channel connecting the two boundaries. Now the third boundary overlaps with the previous two boundaries, and the machine cannot determine whether to work through the channel connecting the three regions or move through the overlapping part of the three boundaries.
[0044] Therefore, it is necessary to provide a work map processing method and a self-moving device to solve the problem of data confusion caused by boundary overlap.
[0045] In order to more clearly illustrate the work map processing method provided by the embodiments of the present application, the technical solutions of the present application will be described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes can not be described in detail in some embodiments.
[0046] As shown in Figure 1 , the present application provides a self-moving device 100, which comprises a walking unit, a working unit, an acquisition unit and a processing unit.
[0047] The walking unit comprises wheels and a walking motor driving the wheels to realize the moving function of the self-moving device 100.
[0048] The working unit includes a cutting disc, a cutting motor driving the cutting disc, and in other embodiments, a cleaning roller brush, a cleaning motor driving the cleaning roller brush, etc.
[0049] The acquisition unit is configured to acquire boundary information, including a first target boundary line and a historical boundary line. Each time a boundary is generated, the acquisition unit acquires the boundary line, i.e., the first target boundary line, and acquires the historical boundary line stored in the working map.
[0050] The processing unit determines a first target boundary map according to the first target boundary line, the first target boundary map including the first target boundary line and the area inside the first target boundary line; the processing unit determines a historical boundary map according to the historical boundary line, the historical boundary map including the historical boundary line and the area inside the historical boundary line. When there are multiple historical boundary lines, a historical boundary map corresponding to each historical boundary line is determined respectively.
[0051] The processing unit determines whether there is an overlapping area between the first target boundary map and the historical boundary map. If there is an overlapping area, the first target boundary line and the historical boundary line are merged to obtain a second target boundary line, and the working map is updated according to the second target boundary line; if there is no overlapping area, the working map is updated according to the first target boundary line.
[0052] The self-moving device 100 walks along the boundary of the working area, collects positioning information of the self-moving device 100 at preset time intervals, obtains positioning information of each sampling point on the boundary, fits each sampling point into a line segment, and obtains a boundary line of the working area. The self-moving device 100 further includes a storage unit. Each time a boundary of a working area is generated, the storage unit stores the boundary information. In this embodiment, the working area includes multiple boundary lines, the self-moving device 100 can generate multiple boundary lines, and the storage unit stores multiple boundary information in the working map.
[0053] In this way, starting from the second boundary line, each time a boundary line is generated, the boundary line is compared with the stored boundary line. If there is an overlap, the boundary lines are merged, and the merged boundary line is stored. If there is no overlap, the boundary line is directly stored. In this way, each boundary in the working map is independent, the boundaries in the working map displayed by the user interface are also independent and have no overlap, the user will not select the wrong boundary, and the self-moving device 100 can navigate and plan according to the independent boundary, without data confusion.
[0054] In one embodiment, as Figure 2As shown, the embodiment of the present application provides a processing method of a working map of a self-moving device, which is applied to the self-moving device 100. The self-moving device works in a working area according to the working map. The working map includes at least one historical boundary line. The method provided by the embodiment of the present application is described in detail as follows.
[0055] S1, a first target boundary line is acquired, and a first target boundary map is determined according to the first target boundary line.
[0056] When the self-moving device 100 is mapping, the self-moving device is controlled to move in the working area and walk along the boundary of the working area. The positioning information of the self-moving device 100 is collected in real time at a preset time interval, the positioning information of each trajectory point on the boundary is obtained, each trajectory point is fitted into a line segment, and the boundary line of the working area is obtained. The mapping process includes that the user remotely controls the self-moving device 100 to walk and map, the self-moving device 100 automatically walks along the boundary to map, and the like. The mapping method is not limited in the present application.
[0057] In some embodiments, after the boundary line of the working area is generated, it is needed to determine whether the boundary line meets the mapping condition. When the boundary line does not meet the mapping condition, it indicates that the mapping fails, the self-moving device 100 generates a mapping failure signal and sends it to the user device, and the mapping failure information is displayed on the user device to prompt that the mapping needs to be re-performed. In other embodiments, the self-moving device 100 includes a display interface, and the mapping failure information is displayed on the display interface to prompt that the mapping needs to be re-performed.
[0058] In some embodiments, the mapping condition includes at least one of that the area of the boundary area reaches a preset area, the length of the circumscribed quadrilateral of the boundary reaches a preset length, and the width of the circumscribed quadrilateral of the boundary reaches a preset width.
[0059] In the present application, the specific values of the preset area, the preset length and the preset width are not limited, and can be set according to the actual size of the working area, so as to prevent the generated boundary line from being too small due to improper remote control of the user or deviation of the positioning, and the problem that the generated boundary line cannot be used to plan mowing.
[0060] In the present embodiment, the self-moving device 100 can build multiple boundary lines.
[0061] In the case that one historical boundary line has been stored in the working map, the self-moving device 100 can build a second boundary line. The present application defines that the boundary line generated after the first boundary in the working map as the first target boundary line.
[0062] When the mobile device 100 generates the first target boundary line according to the trajectory points, a first target boundary map is determined according to the first target boundary line. Specifically, a grid map is generated according to the first target boundary line, the grids in the grid map have position information, and a region composed of the grids on the first target boundary line and the grids inside the first target boundary line is set as the first target boundary map.
[0063] S2, a history boundary line stored in the working map is acquired, and a history boundary map is determined according to the history boundary line.
[0064] The history boundary line is all the history boundary lines contained in the working map stored by the mobile device 100 before this mapping.
[0065] In some embodiments, the history boundary map is determined according to the history boundary line. Specifically, a grid map is generated according to the history boundary line, the grids in the grid map have position information, and a region composed of the grids on the history boundary line and the grids inside the history boundary line is set as the history boundary map.
[0066] S3, whether there is an overlapping region between the first target boundary map and the history boundary map is determined one by one.
[0067] In at least one embodiment of the present application, the first target boundary map and the history boundary map are put into a base map for comparison to determine the overlapping region between the first target boundary map and the history boundary map. Specifically, the base map is a grid map with initial grid values, each grid has position information, for example, the initial grid is set to 0, and the grid values of all grids in the base map are 0. The base map can dynamically change the size and position of the base map according to the size and position of the map put in, so that the base map completely includes the map put in.
[0068] As shown in FIG. 8, a process for determining whether there is an overlapping region in step S3 of the present application is illustrated: Figure 3
[0069] As shown in the figure: the outermost circle in the figure indicates the outline of the base map, and the base map includes the first target boundary map and the history boundary map. The base map dynamically changes the size and position with the boundary map, which is an intelligent base map. After reading the history boundary map information, four vertices x max-old , x min-old , y max-old , y min-old of the circumscribed quadrilateral of the history boundary map are acquired, and four vertices x max1 , x min1 , y max1 , y min1 The four vertices of the historical boundary map circumscribed quadrilateral are compared with the vertices of the first target boundary map circumscribed quadrilateral respectively, the maximum and minimum points of the x axis and y axis are taken to generate the x max-new , y min-new , y max-new , y min-new .
[0070] If x view-max-new , y max-new , then the coordinates of the black dot in the frame start point of the bottom map are x view-max-new , y max-new . In this embodiment, the grid resolution is set to RESOLUTION = 0.05 m, and the size of the bottom map is: height Height view = (x max-new -x min-new ) / RESOLUTION, width Width view = (y max-new -y min-new ) / RESOLUTION.
[0071] Based on the new bottom map, the pixel coordinates of the contour points of the boundary are obtained. The data of each boundary is converted into binary data, and the data inside is composed of the following data: the unknown area is 0, the boundary is 1, and the area inside the boundary is 2. According to the coordinates of the boundary frame start point in the boundary data and the coordinates of the frame start point in the intelligent bottom map, the pixel position of the boundary under the intelligent bottom map can be obtained.
[0072] Based on the height and width of each boundary, Height map and Width map , and the frame start point (x map , y map ) of the boundary, how to convert the binary array of the boundary into a point on the bottom map is obtained.
[0073] First, the above multiple groups of arrays are processed one by one. It is assumed that the i-th data is currently being processed, the data value of the data is read, and if the value of the current data is equal to 1, which is the first identification value, it indicates that it is a boundary point, and subsequent processing is performed, otherwise the (i+1)th data is continuously processed until all data is processed.
[0074] If the value of the current data is the first identification value, the pixel coordinates of the current data in the boundary frame are calculated: if the current data is in the h-th row of the boundary frame, h = i / Width map , and is in the w-th column of the boundary frame, w = i / Width map , then the pixel coordinates (w, h) of the current data in the boundary frame can be obtained. The pixel coordinates (x pointy point ), where x point =(y view-max-new -y map ) / RESOLUTION+w,y point =(x view-max-new -x map ) / RESOLUTION+h. Save the processed contour data. With n boundaries, there will be n contour datasets.
[0075] In some embodiments, identification information of the first target boundary map and the historical boundary map is obtained. The identification information includes a first identification value for the location of areas located on and inside the boundary line, and a second identification value for the location of areas located outside the boundary line. Specifically, the first target boundary map is placed in the background... Figure 1 In the middle, put the historical boundary map into the bottom. Figure 1 Bases of the same size and in the same position Figure 2 In the middle. Set the first target boundary map at the bottom. Figure 1 The raster value of the grid cell occupied by the element has a first identifier value. For example, if the first identifier value is set to 255, then the element at the bottom... Figure 1 In the map, the grid value of the first target boundary line and its internal grid cells is 255, while the grid value of the grid cells outside the first target boundary line is 0, which is the second identifier value. Similarly, the historical boundary map is set at the bottom. Figure 2 The raster value of the grid cell occupied by the element has a first identifier value. For example, if the first identifier value is set to 255, then the bottom... Figure 2 In the historical boundary line and the raster inside it, the raster value is 255, and the raster value of the raster outside the historical boundary is 0, which is the second identifier value.
[0076] In some embodiments, the identifier values of the first target boundary map and the historical map are traversed one by one according to the coordinates of the location; when the identifier value of the same location coordinate in the first target boundary map and the historical boundary map is the first indicator value, the current coordinate position is determined to be the overlapping position of the first target boundary map and the historical map.
[0077] Specifically, traversing the bottom Figure 1 and bottom Figure 2 In the first target boundary map and the historical boundary map, when all the grids in the same position in the two base maps have a first identifier value, that is, when the grids in the same position in the first target boundary map and the historical boundary map have a first identifier value, in this embodiment, when the grid values of two grids in the same position are both 255, the grid is determined to be an overlapping grid of the first target boundary map and the historical boundary map.
[0078] The overlapping area is determined according to the number of overlapping positions, and when the overlapping area exceeds a preset overlapping area value, it is determined that the first target boundary map and the historical boundary map have an overlapping area.
[0079] In at least one embodiment of the present application, the area of one overlapping grid is set to 1, and the number of overlapping grids is the overlapping area of the first target boundary and the historical boundary. In other embodiments, the area of one overlapping grid can also be set to other values, which are not limited in the present application.
[0080] When the overlapping area exceeds the preset overlapping area value, it is determined that the first target boundary map and the historical boundary map have an overlapping area, that is, the first target boundary line and the historical boundary line have an overlapping area, and the contour data set of the historical boundary is saved; otherwise, there is no overlapping. For example, the preset overlapping area value is set to 0, that is, as long as there is one overlapping grid between the first target boundary and the historical boundary, it is considered that the two have an overlapping area and need to be merged. In other embodiments, the preset overlapping area can also be set to 5 or other values to avoid errors in the collected boundary data.
[0081] When there are multiple historical boundary lines in the working map, the first target boundary map can have overlapping areas with multiple historical boundary maps. Using the above overlapping judgment, the contour data sets of all historical boundary lines with an overlapping area exceeding the preset overlapping area value are saved. If n contour data sets are saved, it indicates that the first target boundary line has an overlapping area with n historical boundary lines.
[0082] S4, if there is an overlapping area, merging the first target boundary line and the historical boundary line to obtain a second target boundary line, and updating the working map according to the second target boundary line.
[0083] Specifically, merging the first target boundary line and the historical boundary line includes: obtaining a closed outer contour line of the first target boundary line and the historical boundary line as a second target boundary line.
[0084] In an embodiment of the present application, a background map with the same size as the base map is drawn, and the grid value in the background map is set to 0. The contour data set of the first target boundary and the contour data set of the historical boundary having an overlapping area with the first target boundary are added to the background map.
[0085] Specifically, the outermost contour point in the contour data set in the background map is taken, and in at least one embodiment of the present application, the boundary tracking method is used based on the Suzuki algorithm. The grid value of the grid in the contour data set is set to 255. Based on a map with a background color of 0 and a foreground pixel of 255, a foreground pixel (255) in the image is started, and the boundary is tracked along the pixel. Each time a boundary pixel is found, the adjacent boundary pixel is searched.
[0086] The boundary pixels of the contour are tracked by connected regions, and in the embodiment of the present application, the 8-connected region method is used: for each foreground pixel (255), it is determined whether there is a foreground pixel in its 8 neighbors. If so, the boundary tracking is continued. Through continuous boundary tracking, a closed contour is formed until the starting pixel is returned. In this process, each time a new contour is found, a contour is created and stored. When two contours overlap or are adjacent, the parent-child relationship is determined according to the geometric positions of the two contours.
[0087] The outer contour is regarded as the parent contour, and the inner contour is regarded as the child contour, such as a hole or a hollow region. Between contours in the same level, the brother contour relationship is identified, that is, which contour is in front of or behind the other contour.
[0088] In processing the contours, the Suzuki algorithm determines which contours are in a nested relationship by comparing the spatial positions of the contours.
[0089] Outer contour (parent contour): If one contour completely surrounds another contour, the outer contour is regarded as the parent contour, and the contained contour is regarded as the child contour.
[0090] Inner contour (child contour): If one contour is completely inside another contour, the inner contour is regarded as the child contour, and the parent contour is the contour surrounding it.
[0091] Specifically, first, all the extracted contours are traversed, and the coordinate information of each contour is compared. It is determined whether a point is inside the contour: for each pair of contours A and B, it is determined whether B is completely inside A.
[0092] Determination of whether a point is inside a polygon: for each point in contour B, it is determined whether it is inside the area represented by contour A.
[0093] In the embodiment of the present application, the ray method and the angle sum method are used to determine whether a point is inside a polygon. Specifically, the common algorithm for determining whether a point is inside a polygon using the ray method (Ray-Casting Algorithm) is used. A ray is emitted in an arbitrary direction from the target point, and then the number of intersection points of the ray with the polygon boundary is checked:
[0094] First, the direction of the ray is selected: a ray can be emitted in an arbitrary direction from the target point, and in the embodiment of the present application, a horizontal ray is selected, that is, a horizontal direction is selected to simplify the calculation.
[0095] Calculate intersection: For each edge of the polygon, check if the edge intersects the ray. Calculate the intersection point of the ray with each edge, and determine if the intersection point is within the valid range of the edge. In particular, if the ray intersects a vertex of the polygon, do not increment the intersection count, to avoid ambiguity from multiple intersections. If the number of intersections is odd, the point is inside the polygon; if the number of intersections is even, the point is outside the polygon.
[0096] Special case (point on the boundary): When the ray coincides with an edge, the point is considered to be on the boundary of the polygon. Determine by calculating the exact position of the intersection point.
[0097] Determination of parent-child relationship: If all points in the contour B are inside the contour A, A is the parent contour of B, and B is the child contour of A.
[0098] According to the Suzuki algorithm, the parent contour of the highest layer is considered to be the outermost contour line of the contour data set. This contour line is the only boundary that is preserved after merging multiple overlapping boundaries, which is the second target boundary line.
[0099] In an embodiment of the present application, the historical boundary line has a code, and after obtaining the second target boundary line, further comprising: obtaining a target code, the target code being the code of the historical boundary line corresponding to the historical boundary map that has an overlapping area with the first target boundary map; after deleting the historical boundary line corresponding to the historical boundary map that has an overlapping area with the first target boundary map in the working map, adding the second target boundary line to the working map; and setting the code of the second target boundary line according to the target code.
[0100] In an embodiment of the present application, each historical boundary line corresponds to a code. The code includes a number, a serial number, for example, the code is set to be a number code such as 1, 2, 3, or a different serial number, which is used to identify the historical boundary line. When the second target boundary line is added to the working map as described above, the code of the second target boundary line is set to be the code of the historical boundary line corresponding to the historical boundary map that has an overlapping area with the first target boundary map. For example, if the code of the historical boundary line corresponding to the historical boundary map that has an overlapping area with the first target boundary map is 3, the code of the second target boundary line is set to be 3, and when the working map is updated according to the second target boundary line, the historical boundary line with the code of 3 is deleted, and the second target boundary line with the code of 3 is added to the working map.
[0101] If the first target boundary map has an overlapping area with the plurality of historical boundary maps, the target coding is one of the plurality of historical boundary line codings. Preferably, when the coding is a numerical coding, the smallest numerical coding of the plurality of historical boundary lines is set as the target coding of the second target boundary line. For example, if the historical boundary line 1, the historical boundary line 2, and the historical boundary line 3 all have overlapping areas with the first target boundary map, the historical boundary line 1, the historical boundary line 2, the historical boundary line 3, and the first target boundary line are all merged to obtain the second target boundary line, and the coding of the second target boundary line is set as 1.
[0102] Each boundary line has an independent coding, and when the working map is used for subsequent mowing, the boundary line can be accurately called, and data confusion can be avoided.
[0103] In another embodiment of the present application, if the first target boundary map has no overlapping area with the historical boundary map, the working map is updated according to the first target boundary line.
[0104] Specifically, the first target boundary line is added to the working map, and the coding of the first target boundary line is set. Preferably, when the coding is a numerical coding, the largest numerical coding of the plurality of historical boundary lines is obtained, and the coding is set as the coding of the first target boundary line.
[0105] In an embodiment of the present application, the working map further includes a channel connecting the historical boundaries, and the self-moving device 100 can move between the independent boundary lines through the channel.
[0106] In the above updating of the second target boundary line to the working map, the working map is traversed to find the channel in the working map, and the historical boundary lines connected by the two ends of the channel are determined. When it is determined that the historical boundary lines connected by the two ends of the current channel are all inside the second target boundary line, the current channel is deleted from the working map. Otherwise, the channel in the working map is not processed.
[0107] After the above processing of the channel, the situation that the two ends of the channel have no boundary line connection in one boundary line is avoided, data is accurate when the working map is used for subsequent navigation, and data confusion can be avoided.
[0108] In an embodiment of the present application, the above working map processing is performed every time a first target boundary line is generated, and the working map is updated to include independent and non-overlapping boundary lines. After the updating is completed, the boundary lines in the working map are all updated to historical boundary lines.
[0109] In the embodiments of the present application, the first target boundary line and the historical boundary line have a boundary type, and the boundary type includes an outer boundary type and an inner boundary type. The self-moving device is configured to work in an inner region of the boundary line of the outer boundary type and work in an outer region of the boundary line of the inner boundary type. For example, the boundary line of the outer boundary type includes the outer edge of the lawn, and the boundary line of the inner boundary type includes the boundary line of the flower bed, the pool and other islands in the lawn.
[0110] In the above-mentioned obtaining the historical boundary line stored in the work map, the boundary type of the first target boundary line is determined.
[0111] When the type of the first target boundary line is the outer boundary type, the historical boundary line stored in the work map and having the boundary type of the outer boundary is obtained.
[0112] When the type of the first target boundary line is the inner boundary type, the historical boundary line stored in the work map and having the boundary type of the inner boundary is obtained.
[0113] The inner boundary and the outer boundary are processed respectively, that is, the inner boundary is only used to determine whether to overlap and whether to be merged with the inner boundary, and the outer boundary is only used to determine whether to overlap and whether to be merged with the outer boundary. It is ensured that the boundary line data is clear, and different types of boundary lines are not mixed and merged. At the same time, the scheme of the present application can not only automatically merge the outer boundary with an overlapping region, but also automatically merge the inner boundary with an overlapping region, so that the outer edges of the lawn are independent of each other, the data is accurate, and the islands are independent of each other, and the data is accurate.
[0114] In the embodiments of the present application, the inner boundary and the outer boundary can overlap.
[0115] The processing method of the work map applied to the self-moving device provided by the present application can determine whether there is overlap between the boundaries when mapping, and automatically merge if there is overlap. In this way, it is ensured that each boundary in the generated work map is independent, and the data of each boundary will not appear cross and confusion, and the data is accurate when using the work map for navigation. In addition, when the work map is displayed to the user, the user will not be disturbed by the confusion of the boundary overlap, and the user can intuitively understand the shape of each boundary, which is convenient for subsequent user editing and other operations on the work map.
[0116] The present application also discloses an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the above-mentioned processing method of the work map.
[0117] The electronic device is a server, a desktop computer, a tablet computer, a cloud server, a mobile terminal, and the like. The memory is a hard disk or a memory in the electronic device, or a U disk, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, and a flash card plugged into the electronic device. The processor can be a central processing unit (CPU), and can also be another general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or another programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and the like.
[0118] The electronic device provided in the application can automatically merge the boundaries with overlap from the mobile device during mapping, so that each boundary in the generated working map is independent, and the boundary data does not cross and is not chaotic, and the user can be presented with each independent and clear boundary, and the subsequent user can edit the working map and the like.
[0119] The application further discloses a computer readable medium, which stores a computer program. The computer program is executed by a processor to implement the working map processing method. The computer program includes computer program code, which can be in a source code form, an object code form, an executable file, or some intermediate form. The computer readable medium can include any entity or device capable of carrying the computer program code, a recording medium, a U disk, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, and the like.
[0120] The computer readable medium provided in the application can automatically merge the boundaries with overlap from the mobile device during mapping, so that each boundary in the generated working map is independent, and the boundary data does not cross and is not chaotic, and the map navigation is accurate, and the user can be presented with each independent and clear boundary, and the subsequent user can edit the working map and the like.
[0121] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks. Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.
[0122] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks. Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.
[0123] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks. Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.
[0124] Finally, it should be noted that the above embodiments merely serve the purpose of describing the technical solutions of the present application, instead of restricting it, and the protection scope of the present application should not be limited thereto. Even though the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any modification or easy-to-think change, or equivalent replacement of part of the technical features of the technical solutions recorded in the foregoing embodiments can be made within the technical scope disclosed by the present application, without departing from the spirit and scope of the technical solutions of the embodiments of the present application. Such modification, change or replacement should be encompassed within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for processing a working map, characterized in that, The method is applied to a self-moving device that operates within a working area based on a working map, the working map including at least one historical boundary line, the method comprising: Obtain the first target boundary line, and determine the first target boundary map based on the first target boundary line; Obtain the historical boundary lines stored in the working map, and determine the historical boundary map based on the historical boundary lines; Determine one by one whether there are overlapping areas between the first target boundary map and the historical boundary map; If there are overlapping areas, the first target boundary line is merged with the historical boundary line to obtain the second target boundary line, and the working map is updated according to the second target boundary line.
2. The method for processing a working map according to claim 1, characterized in that, The step of determining whether there is an overlap between the first target boundary map and the historical boundary map includes: Obtain the identification information of the first target boundary map and the historical boundary map. The identification information includes a first identification value of the location of the area located on and inside the boundary line, and a second identification value of the location of the area located outside the boundary line. Based on the coordinates of the location, the identifier values of the first target boundary map and the historical map are traversed one by one; When the identifier value of the same location coordinate in the first target boundary map and the historical map is the first identifier value, the current coordinate position is determined to be the overlapping position of the first target boundary map and the historical map; The overlapping area is determined based on the number of overlapping positions. When the overlapping area exceeds a preset overlapping area value, it is determined that there is an overlapping area between the first target boundary map and the historical boundary map.
3. The method for processing a working map according to claim 1, characterized in that, The step of merging the first target boundary line with the historical boundary line to obtain the second target boundary line includes: Obtain the outer contour line that closes the first target boundary line and the historical boundary line, and obtain the second target boundary line based on the outer contour line.
4. The method for processing a working map according to claim 1, characterized in that, The historical boundary line is encoded, and updating the working map based on the second target boundary line includes: Obtain the target code, which is the code of the historical boundary line corresponding to the historical boundary map that has an overlapping area with the first target boundary map; After deleting the historical boundary line corresponding to the historical boundary map that overlaps with the first target boundary map in the working map, the second target boundary line is added to the working map. The encoding of the second target boundary line is set according to the target encoding.
5. The method for processing a working map according to claim 4, characterized in that, The method further includes: If the first target boundary map overlaps with multiple historical boundary maps, the target code is one of the codes of the multiple historical boundary lines.
6. The method for processing a working map according to claim 1, characterized in that, The working map also includes channels for connecting the historical boundary lines, and updating the working map according to the second target boundary line includes: Traverse the working map, locate the channels in the working map, and determine the historical boundary lines connecting the two ends of the channels; When it is determined that the historical boundary lines connected to both ends of the current channel are both inside the second target boundary line, the current channel is deleted from the working map.
7. The method for processing a working map according to claim 1, characterized in that, The method further includes: If the first target boundary map and the historical boundary map do not overlap, the working map is updated based on the first target boundary line.
8. The method for processing a working map according to claim 1, characterized in that, The step of obtaining the first target boundary line includes: The self-moving device is controlled to move within the working area, and trajectory points are collected in real time. A closed first target boundary line is generated based on the trajectory points.
9. The method for processing a working map according to claim 1, characterized in that, The first target boundary line and the historical boundary line have boundary types, including outer boundary type and inner boundary type. The self-moving device is configured to work in the inner region of the outer boundary type boundary line and in the outer region of the inner boundary type boundary line. The step of acquiring the historical boundary lines stored in the working map includes: Determine the boundary type of the first target boundary line; When the type of the first target boundary line is an outer boundary type, retrieve the historical boundary lines with the outer boundary type that have been stored in the working map; When the type of the first target boundary line is an inner boundary type, retrieve the historical boundary lines with the inner boundary type that have been stored in the working map.
10. A self-moving device, characterized in that, The self-moving device includes: Walking units used for moving within the work area; Work units used to perform operations in the work area; Units used to acquire the first target boundary line and historical boundary lines; A processing unit that communicates with an acquisition unit to perform the processing method for the working map as described in any one of claims 1-9.