A lawnmower map data processing method and computer storage medium

By constructing a spatial index structure for difference comparison and incremental data updates, the problem of high resource consumption in lawnmower extended mapping was solved, and efficient map data updates were achieved.

CN122170852APending Publication Date: 2026-06-09QINGTING INTELLIGENT TECHNOLOGY (SUZHOU) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
QINGTING INTELLIGENT TECHNOLOGY (SUZHOU) CO LTD
Filing Date
2026-03-31
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing lawnmowers suffer from excessive storage I/O and CPU resource consumption when expanding mapping, resulting in low map data update efficiency.

Method used

By acquiring map data of the original working area of ​​the lawnmower and incremental map data generated by the extended operation, a spatial index structure is constructed for difference comparison, incremental map data is extracted, and the original map data is updated based on the incremental data, avoiding full read and write operations.

Benefits of technology

It effectively reduces resource consumption during map data processing, improves the efficiency of map data updates when lawnmowers expand operations, and achieves efficient map data updates for the work area.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122170852A_ABST
    Figure CN122170852A_ABST
Patent Text Reader

Abstract

The application discloses a lawn mower map data processing method and a computer storage medium, and the method comprises the following steps: acquiring first map data corresponding to a work area of the lawn mower; collecting second map data generated by the lawn mower in an extended work process; comparing the second map data with the first map data, and extracting incremental map data existing in the second map data relative to the first map data; and updating the first map data corresponding to the work area based on the incremental map data. The application can realize efficient updating of work area map data and effectively reduce resource occupation in the map data processing process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, specifically to a method for processing lawnmower map data and a computer storage medium. Background Technology

[0002] High-precision point cloud maps are the foundation for realizing autonomous navigation and work area planning of intelligent lawnmowers. In the actual operation of lawnmowers, due to the need for work area expansion or supplementation of area details, it is often necessary to expand and build the existing point cloud map to update the map data.

[0003] In existing technologies, when lawnmowers perform extended mapping, they need to completely read the existing map data from the storage medium, merge the incremental map data collected during the extended operation with the existing map data, process it, and then write the merged full map data back to the storage medium. However, since the point cloud map data of the lawnmower's original working area is usually large, the amount of incremental map data generated by the extended operation is often much smaller than the original map data. Existing technologies perform full read and write operations on a large amount of existing map data in order to save a small amount of incremental data. At the same time, the full merging operation also brings additional computing power consumption, resulting in a large amount of storage medium I / O (Input / Output) resources and CPU (Central Processing Unit) resources being occupied. It can be seen that the existing lawnmower map data processing method has the problem of excessive storage I / O and CPU resource consumption when updating the map during extended mapping, making it difficult to complete the map data update efficiently.

[0004] The preceding description is intended to provide general background information and does not necessarily constitute prior art. Summary of the Invention

[0005] This application provides a method for processing lawnmower map data and a computer storage medium, which can achieve efficient updating of map data in the work area and effectively reduce resource consumption during map data processing.

[0006] In a first aspect, embodiments of this application provide a lawnmower map data processing method, including: Obtain the first map data corresponding to the work area of ​​the lawnmower; Collect second map data generated by the lawnmower during extended operations; The second map data and the first map data are compared, and incremental map data that differs from the first map data in the second map data is extracted; Based on the incremental map data, update the first map data corresponding to the work area.

[0007] Furthermore, in some embodiments of this application, comparing the second map data and the first map data, and extracting incremental map data in the second map data that differs from the first map data, includes: Construct a first spatial index structure for the first map data; Traverse the current data unit in the second map data and use the first spatial index structure to determine whether the current data unit exists in the first map data; All data units that are determined not to exist in the first map data are identified as the incremental map data.

[0008] Furthermore, in some embodiments of this application, the step of traversing the current data unit in the second map data and using the first spatial index structure to determine whether the current data unit exists in the first map data includes: Find the data unit that is closest to the current data unit in the first spatial index structure and designate it as the nearest neighbor data unit; Calculate the distance between the current data unit and the nearest neighbor data unit; If the distance is greater than a preset distance threshold, it is determined that the current data unit does not exist in the first map data.

[0009] Furthermore, in some embodiments of this application, the first spatial index structure is at least one of an octree, a voxel grid, or a kd-tree.

[0010] Furthermore, in some embodiments of this application, updating the first map data corresponding to the work area based on the incremental map data includes: Get the number of sub-map files in the storage medium that have stored map data; Based on the number of sub-map files and the size of the last sub-map file, determine the target sub-map file number and writing mode for this write operation; According to the writing mode, the incremental map data is written to or merged into the target sub-map file, and the disk write operation is performed.

[0011] Furthermore, in some embodiments of this application, determining the target sub-map file sequence number and writing mode for this write based on the number of sub-map files and the size of the last sub-map file includes: If the number of sub-map files is the initial value, it means that there is no map data in the storage medium. Then, the writing mode is set to the new creation mode, and the target sub-map file sequence number is set to the initial sequence number. If the size of the last sub-map file is greater than or equal to a preset file size threshold, then the writing mode is set to the new creation mode, and the target sub-map file number is set to the current number of sub-map files; If the size of the last sub-map file is less than the preset file size threshold, the write mode is set to append mode, and the target sub-map file number is set to the number of the last sub-map file.

[0012] Furthermore, in some embodiments of this application, the step of writing or merging the incremental map data into the target sub-map file according to the writing mode, and performing the disk write operation, includes: If the writing mode is a new creation mode, the incremental map data will be directly written to the target sub-map file; If the write mode is append mode, then the existing target sub-map file is read, the incremental map data is merged into the target sub-map file, and the merged map data is written back to the target sub-map file. The system write-to-disk function is invoked to write the incremental map data or the merged map data written to the target sub-map file to the physical storage medium.

[0013] Furthermore, in some embodiments of this application, the first map data and the second map data respectively include at least one of ordinary point cloud data, planar point cloud data and non-planar point cloud data.

[0014] Furthermore, in some embodiments of this application, after collecting the second map data generated by the lawnmower during extended operations, the method further includes: Keyframe point cloud data is extracted from the collected second map data, and the point cloud data of each keyframe are merged to obtain the map data to be processed. The map data to be processed is downsampled to obtain downsampled map data to be processed. Based on the height distribution of each point cloud data point in the downsampled map data to be processed, determine the minimum and maximum height of the work area; Based on the minimum and maximum altitudes, color attribute data is generated for each point cloud data point in the downsampled map data to be processed.

[0015] Furthermore, in some embodiments of this application, based on the minimum and maximum altitudes, a piecewise linear mapping method is used to generate brightness values ​​for red, green, and blue channels for each point cloud data point.

[0016] Furthermore, in some embodiments of this application, determining the minimum and maximum height of the work area based on the height distribution of each point cloud data point in the downsampled map data to be processed includes: Extract the height values ​​of all point cloud data points in the downsampled map data to be processed to form a height set; Sort the height set according to its numerical value to obtain the sorted height sequence; From the sorted height sequence, the minimum height and the maximum height are determined according to the number threshold of points within the preset height interval.

[0017] Furthermore, in some embodiments of this application, the method further includes: When a mapping instruction is received, if the first map data does not exist in the storage medium, the map data in memory is initialized to be empty; When an idle command is received, the acquisition of the second map data is stopped, and the first map data and the incremental map data stored in memory are released.

[0018] Secondly, embodiments of this application provide a lawnmower map data processing device, comprising: The first map module is used to acquire first map data corresponding to the work area of ​​the lawnmower; The second map module is used to collect second map data generated by the lawnmower during extended operations; The incremental module is used to compare the second map data and the first map data, and extract incremental map data in the second map data that differs from the first map data. The update module is used to update the first map data corresponding to the work area based on the incremental map data.

[0019] Thirdly, embodiments of this application provide a lawnmower robot, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the lawnmower map data processing method as described in the first aspect.

[0020] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the lawnmower map data processing method described in the first aspect.

[0021] This application provides a method for processing lawnmower map data and a computer storage medium. The method first acquires the original first map data of the work area and collects second map data generated from extended operations. Then, it compares the two, extracting incremental map data from the second map data relative to the first map data. Finally, it updates the original first map data based on the incremental map data. This method abandons the traditional approach of processing all map data at once, processing only the incremental portion that differs from the original map. It eliminates the need for a full read, merge, and rewrite of the original complete first map data, reducing the ineffective use of storage and computing resources during map data updates from the source. It also makes map data updates more targeted, directly addressing the differences generated by extended operations, effectively improving the overall efficiency of map data updates in lawnmower extended operation scenarios and achieving efficient updates of map data for the work area. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is an application environment diagram of the lawnmower map data processing method provided in the embodiments of this application; Figure 2 This is a flowchart illustrating the lawnmower map data processing method provided in an embodiment of this application; Figure 3 This is a schematic flowchart of the incremental comparison provided in the embodiments of this application; Figure 4 This is a schematic diagram of the map update process provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of the lawnmower map data processing device provided in the embodiments of this application; Figure 6 This is a schematic diagram of the structure of the lawnmower robot provided in the embodiments of this application. Detailed Implementation

[0024] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of systems and methods consistent with those detailed in the appended claims or with some aspects of this application.

[0025] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover descriptions such as non-exclusive inclusion, so that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, components, features, and elements with the same names in different embodiments of this application may have the same meaning or different meanings, the specific meaning of which must be determined by its interpretation in that specific embodiment or further in conjunction with the context of that specific embodiment.

[0026] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.

[0027] In the following description, the use of suffixes such as "module," "part," or "unit" to denote elements is solely for the purpose of illustrative purposes and has no specific meaning in itself. Therefore, "module," "part," or "unit" may be used interchangeably.

[0028] To address the aforementioned technical problems and overcome the shortcomings of existing technologies, this application provides a lawnmower map data processing method and a computer storage medium, which can achieve efficient updating of map data in the work area and effectively reduce resource consumption during map data processing.

[0029] Please see Figure 1 , Figure 1 This is a schematic diagram of an application scenario for the lawnmower map data processing method provided in this application embodiment. The application scenario is applied to a lawn environment, where both the lawnmower robot 1 and the base station 2 are located. When the lawnmower robot 1 performs automatic mowing operations in the lawn environment, it acquires first map data corresponding to the work area of ​​the lawnmower 1; collects second map data generated by the lawnmower 1 during the extended operation; compares the second map data with the first map data, and extracts incremental map data in the second map data that differs from the first map data; and updates the first map data corresponding to the work area based on the incremental map data.

[0030] Please see Figure 2 , Figure 2 This is a flowchart illustrating a lawnmower map data processing method according to an embodiment of this application. Specifically, the lawnmower map data processing method provided in this embodiment may include the following steps: S1. Obtain the first map data corresponding to the work area of ​​the lawnmower; Specifically, in step S1, after receiving the extended mapping instruction for the work area, the lawnmower robot retrieves the complete map data corresponding to the already worked area from its local storage medium. This first map data is the data that has already been partially mapped and stored. This first map data may include at least one of ordinary point cloud data, planar point cloud data, and non-planar point cloud data. Ordinary point cloud data reflects the overall spatial point cloud characteristics of the worked area, planar point cloud data reflects the spatial characteristics of the planar structures within the worked area, and non-planar point cloud data reflects the spatial characteristics of the non-planar structures within the worked area. All types of data are standardized point cloud data, capable of fully reflecting the geographic spatial characteristics corresponding to the worked area, and serve as the basis for subsequent map data comparison and updates.

[0031] For example, a lawnmower robot has completed the basic mapping of the eastern area of ​​a private garden and stored the general point cloud data of the area, including the overall spatial features of the lawn, the planar point cloud data of the hard edges of the lawn and the stone path, and the non-planar point cloud data of the flower bed and small rockery on the east side, on its local hard drive. When it is necessary to extend the lawnmower operation to the western area of ​​the garden and update the map, the robot first retrieves the three types of point cloud data (or any one or two of them) of the eastern area from the hard drive through the data acquisition module. This data is the first map data processed in this operation.

[0032] S2. Collect second map data generated by the lawnmower during extended operations; Specifically, in step S2, after the lawnmower robot enters the extended work area, it uses its onboard LiDAR, IMU (Inertial Measurement Unit), and other sensing devices to collect real-time 3D spatial point cloud data and device pose data of the extended work area. Simultaneously, it uses the LiDAR inertial odometry calculation method to solve the collected raw data, obtaining various point cloud and pose information for each frame of LiDAR in the map coordinate system. After data integration and standardization, complete map data corresponding to the entire extended work area is formed, i.e., the second map data. This second map data matches the point cloud data type of the first map data, and can also contain at least one of ordinary point cloud data, planar point cloud data, and non-planar point cloud data, respectively reflecting the overall spatial, planar, and non-planar spatial characteristics of the extended work area.

[0033] For example, a lawnmower robot enters the lawn area on the west side of the garden to mow the lawn. During the operation, the lidar continuously scans the spatial environment of the western area, and the IMU simultaneously collects the robot's motion pose data. After algorithm calculation and data integration, ordinary point cloud data containing the overall spatial features of the western lawn, planar point cloud data of the western wooden platform and the edge of the lawn, and non-planar point cloud data of the western shrub bed and stone bench are obtained. These three types of data (or any one or two of them) are the second map data processed in this case.

[0034] Furthermore, in some embodiments, the first map data and the second map data respectively include at least one of ordinary point cloud data, planar point cloud data and non-planar point cloud data.

[0035] S3. Compare the second map data with the first map data, and extract the incremental map data in the second map data that differs from the first map data; Specifically, for step S3, after receiving the first map data and the second map data, the lawnmower robot classifies them according to the type of point cloud data. It performs a targeted comparative analysis of the first map data and the second map data of the same type across the entire domain. Based on the corresponding type of data in the first map data, it filters out the spatial point cloud data of the same type in the second map data that does not appear in the first map data, i.e., the difference data of each type of data. After sorting and integrating all the difference data of all types, it determines them as the incremental map data generated by this extended operation.

[0036] For example, the second map data on the west side of the garden includes ordinary point clouds of the west lawn, planar point clouds of the west wooden platform, and non-planar point clouds of the west shrubbery, as well as a small amount of overlapping point cloud data at the junction of the east and west sides. Using the first map data on the east side as a benchmark, after comparing the ordinary, planar, and non-planar point cloud data one by one, the ordinary point cloud data unique to the west lawn, the planar point cloud unique to the wooden platform, and the non-planar point cloud data unique to the shrubbery are selected as the incremental map data extracted in this study. S4. Update the first map data corresponding to the work area based on the incremental map data; Specifically, in step S4, after the lawnmower receives the transmitted incremental map data, it first splits the incremental map data according to the point cloud data type. Then, based on the incremental map data of each type, it supplements and integrates the corresponding type of point cloud data in the original stored first map data. The incremental map data of each type is merged into the same type of data in the first map data. Then, the merged point cloud data of each type is integrated as a whole to form a new complete map data that includes both the original work area and the expanded work area. Subsequently, the updated map data is re-stored to the local storage medium to replace the original first map data, thus completing the overall update of the work area map data.

[0037] For example, the incremental data extracted above, including the ordinary point cloud unique to the lawn on the west side of the garden, the planar point cloud unique to the wooden platform, and the non-planar point cloud unique to the shrub bed, are respectively integrated into the corresponding ordinary, planar, and non-planar point cloud data in the first map data of the eastern area of ​​the garden. Then, they are integrated into a complete point cloud map data that includes the entire eastern and western areas of the private garden. This new map data is then stored on the robot's local hard drive to complete the update of the map data for the garden's work area.

[0038] This embodiment first acquires the map data of the original work area, then collects the newly added map data of the expanded area, and after comparing and extracting the difference increments, updates the original map only based on the incremental data. There is no need to perform full read, write and merge operations on the large amount of original map data. This fundamentally reduces unnecessary storage medium read and write operations and data operation operations during the map update process, effectively reduces the occupation of storage IO resources and CPU computing power, improves the efficiency of map data update when the lawnmower robot expands its operations, and makes the map data processing flow more in line with the actual expansion mapping operation needs of the lawnmower robot.

[0039] Furthermore, such as Figure 3 As shown, in some embodiments, step S3, "comparing the second map data with the first map data and extracting incremental map data in the second map data that differs from the first map data," may specifically include: S31. Construct a first spatial index structure for the first map data; Specifically, for step S31, based on the three-dimensional spatial distribution characteristics of the first map data, a first spatial index structure adapted for spatial retrieval of point cloud data is constructed. This structure rationally divides the three-dimensional spatial region of the first map data and establishes corresponding spatial index information for each data unit in the first map data. This allows for the rapid location of relevant data units at any spatial position in the first map data without the need for a full traversal search of the first map data, significantly improving the retrieval efficiency of subsequent data unit existence determination. For example, the first map data for the eastern area of ​​a private garden where the lawnmower has been operating is three-dimensional point cloud data. Based on the three-dimensional spatial coordinates of this point cloud data, an octree-like first spatial index structure is constructed, dividing the three-dimensional space of the eastern area into multiple subspaces according to certain rules. Each subspace stores the point cloud data units within that area, and an index association is established between each subspace and the point cloud data units.

[0040] S32. Traverse the current data unit in the second map data and use the first spatial index structure to determine whether the current data unit exists in the first map data; Specifically, for step S32, a single point cloud data unit in the second map data is selected as the current data unit in a preset order. The three-dimensional spatial coordinate information of the current data unit is extracted and input into the constructed first spatial index structure. Through the spatial retrieval logic of the structure, the region in the first map data that matches the spatial location of the current data unit is quickly found, and it is determined whether there is a point cloud data unit corresponding to the current data unit in the region. After the judgment of a single current data unit is completed, the next data unit is selected and the above operation is repeated until the traversal and judgment of all data units in the second map data are completed.

[0041] For example, the second map data of the western area of ​​the garden collected by the lawnmower extension operation contains several point cloud data units. One point cloud data unit in the western lawn is selected as the current data unit, its three-dimensional spatial coordinates are extracted and input into the octree spatial index structure of the eastern first map data. After retrieval, it is found that there is no matching data in the octree subspace corresponding to the coordinates in the eastern area, and it is determined that the current data unit does not exist in the first map data. Then, a point cloud data unit at the junction of the east and west sides is selected as the current data unit. After retrieval in the index structure, it is found that there is matching data in the eastern area, and it is determined that the current data unit exists in the first map data.

[0042] S33. All data units that are determined not to exist in the first map data are identified as incremental map data; Specifically, for step S33, the judgment results of all data units are summarized and organized, and all point cloud data units in the second map data that are judged to be "not present in the first map data" are selected. These data units are integrated according to their three-dimensional spatial distribution characteristics to form complete incremental map data. This data is the new difference data in the second map data relative to the first map data, which can be directly used for subsequent updates of the original map data.

[0043] For example, after summarizing all the judgment results of the second map data on the west side of the garden, all point cloud data units in areas such as the west lawn, the west wooden platform, and the west shrubbed that are determined not to exist in the first map data on the east side are selected. These data units are then integrated into a complete set of point cloud data, which is the incremental map data corresponding to this expansion operation.

[0044] This embodiment constructs a first spatial index structure for the first map data. Based on this structure, it quickly determines whether data units in the second map data exist in the first map data, replacing the traditional method of comparing the entire area one by one. This significantly reduces the amount of retrieval and computation during the data comparison process, improves the extraction efficiency of incremental map data, and makes the existence judgment of data units more consistent with the spatial distribution characteristics of point cloud maps, thereby improving the accuracy of incremental data extraction and laying the foundation for efficient map updates in the future.

[0045] Furthermore, in some embodiments, step S32, "traversing the current data unit in the second map data and using the first spatial index structure to determine whether the current data unit exists in the first map data," may specifically include: S321. Find the data unit that is closest to the current data unit in the first spatial index structure and use it as the nearest neighbor data unit; further, in some embodiments, the first spatial index structure is at least one of an octree, a voxel grid or a kd-tree (k-dimensional tree).

[0046] Specifically, in step S321, the core feature information of the three-dimensional spatial coordinates of the current data unit to be judged in the second map data is extracted. Based on the spatial retrieval logic of the constructed first spatial index structure, the data unit with the closest spatial distance to the current data unit is quickly retrieved within the entire range of data units in the first map data. This retrieved data unit is then determined as the nearest neighbor data unit corresponding to the current data unit. This process mainly relies on the spatial partitioning and index association characteristics of the spatial index structure, eliminating the need for a full traversal of the first map data, and can quickly complete the location and filtering of the nearest neighbor data unit.

[0047] For example, an octree-like spatial index structure has been constructed based on the first map data of the area east of the private garden. A lawn point cloud data unit in the second map data of the area west of the garden is selected as the current data unit. Its three-dimensional spatial coordinates (12, 9, 0.2) are extracted and input into the octree index structure for retrieval. The point cloud data unit (7, 6, 0.2) with the closest spatial position in the first map data of the east side is quickly located. This unit is the nearest neighbor data unit obtained in this retrieval.

[0048] S322. Calculate the distance between the current data cell and its nearest neighbor data cell; Specifically, for step S322, based on the Euclidean distance calculation rule of the midpoint in three-dimensional space, the complete three-dimensional spatial coordinates (X, Y, Z) of the current data unit and its corresponding nearest neighbor data unit are extracted respectively. The two sets of coordinate values ​​are substituted into the spatial distance calculation formula to accurately calculate the actual straight-line distance between the two data units and obtain the specific distance quantification value. This value provides the core quantitative basis for subsequent determination of whether the current data unit exists in the first map data.

[0049] For example, if the coordinates of the current data unit are (12, 9, 0.2) and the coordinates of the corresponding nearest neighbor data unit are (7, 6, 0.2), after substituting into the Euclidean distance calculation formula, the actual spatial distance between the two is 6 meters. If a point cloud data unit (5, 4, 0.2) at the junction of the east and west sides is selected as the current data unit, the coordinates of the nearest neighbor data unit obtained by retrieval are (5.1, 4.05, 0.2), and the actual spatial distance between the two is calculated to be 0.11 meters.

[0050] S323. If the distance is greater than a preset distance threshold, then it is determined that the current data unit does not exist in the first map data; Specifically, for step S323, the calculated actual spatial distance value is compared with the distance threshold preset for point cloud map data processing. If the actual distance is greater than the preset distance threshold, it means that the current data unit is far away from the point cloud data unit with the closest spatial location in the first map data, and the two are not point cloud data in the same spatial location. Therefore, it is determined that the current data unit does not exist in the first map data. If the actual distance is less than or equal to the preset distance threshold, it is determined that the current data unit exists in the first map data.

[0051] For example, a distance threshold of 1 meter is set for the point cloud map data processing of the private garden. The actual distance between the current data unit of the western lawn and its nearest neighbor data unit is 6 meters, which is greater than the preset threshold of 1 meter. Therefore, it is determined that the current data unit does not exist in the first map data of the eastern side. The actual distance between the current data unit at the junction of the east and west sides and its nearest neighbor data unit is 0.11 meters, which is less than the preset threshold of 1 meter. Therefore, it is determined that the current data unit exists in the first map data of the eastern side.

[0052] This embodiment quickly retrieves the nearest neighbor data unit of the current data unit in the first spatial index structure, and completes the quantitative judgment by combining the three-dimensional spatial distance calculation with the preset threshold. It establishes a unified quantitative standard for the existence judgment of data units, effectively avoids the misjudgment problem caused by fuzzy matching, and improves the accuracy of the judgment. At the same time, the spatial index structure ensures the retrieval efficiency, making the extraction process of incremental map data both accurate and efficient.

[0053] Furthermore, such asFigure 4 As shown, in some embodiments, step S4, "updating the first map data corresponding to the work area based on incremental map data," may specifically include: S41. Obtain the number of sub-map files containing stored map data in the storage medium; Specifically, for step S41, statistical information of the sub-map files used to store map data of the work area is read from the lawnmower's local storage medium to accurately obtain the total number of sub-map files corresponding to the current work area stored in the storage medium. These sub-map files are stored sequentially according to the lawnmower's mapping and extended mapping operation order. Their total number directly reflects the storage distribution of existing map data and is the core foundational data for subsequently determining the target file to be written and the operation mode. For example, if the lawnmower has completed the basic mapping of the area on the east side of the private garden, the map data for this area is stored sequentially as two independent sub-map files on the local hard drive. After reading the statistical information from the hard drive, the number of stored sub-map files is found to be 2. If the lawnmower is mapping a lawn for the first time, and there is no map data for that work area in the local storage medium, the number of stored sub-map files obtained after reading is 0.

[0054] S42. Determine the target sub-map file number and writing mode for this write based on the number of sub-map files and the size of the last sub-map file; Specifically, for step S42, based on the total number of sub-map files obtained, it is first determined whether map data for the current working area already exists in the storage medium. If so, the actual storage size of the last (i.e., the sub-map file with the largest sequence number) sub-map file is read from the storage medium. Then, combined with the preset file storage judgment criteria, the target sub-map file sequence number to be written to for this incremental map data is determined after comprehensive analysis, and the corresponding writing mode is matched. The target sub-map file sequence number follows the continuous numbering rule of the original sub-map files, and the writing mode is a dedicated data operation method adapted to the sub-map file storage rules. The determination of both is based on the core principle of adapting to incremental data storage and reducing invalid read and write operations.

[0055] For example, the preset file size criterion for storing lawnmower map data is 10MB. If the number of stored sub-map files is 2, and the actual storage size of the last sub-map file with sequence number 1 is 8MB, which is less than the preset standard, then the sequence number of the target sub-map file is determined to be 1, and the write mode is append mode. If the actual size of the last sub-map file is 12MB, which is greater than the preset standard, then the sequence number of the target sub-map file is determined to be 2 (consistent with the number of stored files), and the write mode is new mode. If the number of stored sub-map files is 0, it means there is no original map data, so the sequence number of the target sub-map file is directly determined to be 0, and the write mode is new mode.

[0056] S43. Based on the write mode, write or merge the incremental map data into the target sub-map file and perform the disk write operation; Specifically, for step S43, the corresponding sub-map file is accurately located in the lawnmower's local storage medium according to the determined target sub-map file number, and then the corresponding storage operation is performed on the incremental map data according to the matching write mode. After the incremental map data writing or merging operation is completed, the system-specific operation instruction is called to perform the disk write operation, and the incremental map data (or merged map data) temporarily stored in memory is synchronized to the physical storage medium to ensure the persistence and stability of data storage.

[0057] For example, if the target sub-map file is determined to be number 1 and the write mode is append mode, the sub-map file with number 1 is first located on the hard drive, the original map data in the file is read, the incremental map data is completely merged with the original data, and then rewritten to the sub-map file with that number. If the target sub-map file is determined to be number 2 and the write mode is new mode, the sub-map file with number 2 is directly created on the hard drive, and the incremental map data is directly written to the new file without reading other existing files. After the above write or merge operation is completed, the system command is called to synchronize the data in memory to the physical hard drive medium, completing the disk write and avoiding data loss due to temporary storage in memory.

[0058] This embodiment obtains the number of existing sub-map files in the storage medium, determines the target write sequence number and write mode of the incremental data based on the size of the last file, and then completes the data writing / merging according to the mode and performs the disk write operation. This achieves the adaptive storage of incremental map data without having to read and write the original map data in its entirety, reducing invalid I / O operations on the storage medium. The disk write operation also ensures the stability and persistence of map data storage, improving the efficiency of map data updates and the reliability of storage.

[0059] Furthermore, in some embodiments, step S42, "determining the target sub-map file sequence number and writing mode for this write based on the number of sub-map files and the size of the last sub-map file," may specifically include: S421. If the number of sub-map files is the initial value, it means that there is no map data in the storage medium. Then, the write mode is set to the new creation mode, and the target sub-map file sequence number is set to the initial sequence number. Specifically, for step S421, it is first determined whether the number of existing sub-map files obtained from the storage medium is the initial value. This value indicates that no map data for the current work area is stored in the storage medium, indicating that the mapping operation for this area is being performed for the first time. If it is determined to be the initial value, the write mode for this incremental map data is set to the new creation mode, and the target sub-map file sequence number is set to the initial sequence number. The two match and adapt to the map data storage requirements for the first mapping, realizing the initial ordered storage of map data. The preset file size threshold for lawnmower map data storage is 10MB, the initial value of the number of sub-map files is 0, and the initial sequence number is 0. When the lawnmower performs mapping operation on a private garden lawn area for the first time, the number of sub-map files read from the local hard drive for this area is 0, which is determined to be the initial value. Therefore, the write mode is set to the new creation mode, and the target sub-map file sequence number is set to 0.

[0060] S422. If the size of the last sub-map file is greater than or equal to the preset file size threshold, the write mode is set to the new creation mode, and the target sub-map file number is set to the current number of sub-map files; Specifically, for step S422, if the number of sub-map files is not the initial value, it means that the storage medium already contains map data for the current working area. First, the actual storage size of the last (largest) sub-map file is read from the storage medium and compared with a preset file size threshold. If the actual size is greater than or equal to the preset file size threshold, the write mode is set to new mode, and the target sub-map file number is set to the total number of currently stored sub-map files. This ensures the continuous and orderly sequencing of sub-map files and avoids the large size of a single file affecting subsequent reading efficiency. For example, the private garden area has completed one basic mapping and one extended mapping. The local hard drive contains 2 sub-map files (numbered 0 and 1). The preset file size threshold is 10MB. The actual size of the last sub-map file with number 1 is 11MB, which is ≥10MB. Therefore, the write mode is set to new mode, and the target sub-map file number is set to the current file number 2.

[0061] S423. If the size of the last sub-map file is less than the preset file size threshold, then the write mode is set to append mode, and the target sub-map file sequence number is set to the sequence number of the last sub-map file; Specifically, for step S423, if the number of sub-map files is not the initial value, and the actual storage size of the last sub-map file is less than the preset file size threshold, it indicates that the last sub-map file still has remaining storage space. Therefore, the write mode is set to append mode, and the target sub-map file number is set to the sequence number of the last sub-map file. This achieves incremental map data supplementary storage to existing files, avoiding the creation of meaningless new files. For example, the private garden area already has 2 stored sub-map files (sequence numbers 0 and 1). The actual size of the last sub-map file with sequence number 1 is read as 8MB, which is less than the preset file size threshold of 10MB. Therefore, the write mode is set to append mode, and the target sub-map file number is set to the sequence number 1 of the last file.

[0062] This embodiment accurately determines the writing sequence number and mode of incremental data based on whether the number of sub-map files is the initial value and the comparison results of the last file size with the preset threshold. It standardizes the orderly management of sub-map files, avoids the creation of meaningless new files and the problem of excessive data volume in a single file, reduces invalid operations on the storage medium, reduces IO resource consumption, and lays an orderly storage foundation for the rapid reading and multiple expansion updates of map data.

[0063] Furthermore, in some embodiments, step S43, "writing or merging incremental map data into the target sub-map file according to the writing mode, and performing disk write operation," may specifically include: S431. If the write mode is new mode, the incremental map data will be written directly to the target sub-map file; Specifically, for step S431, when it is determined that the storage of this incremental map data adopts the new creation mode, a new sub-map file with the corresponding sequence number is created in the lawnmower's local storage medium according to the determined target sub-map file sequence number. There is no need to read data from other existing sub-map files in the storage medium; the incremental map data organized in memory is directly written completely into the newly created target sub-map file. This operation involves only a single write operation, without any additional read or merge operations, minimizing I / O operations on the storage medium. When the lawnmower expands the mapping of the private garden area, and the write mode is determined to be the new creation mode with the target sub-map file sequence number 2, a new sub-map file with sequence number 2 is created directly in the local hard drive. The incremental point cloud map data generated by the expansion operation on the west side of the garden is directly written into this new file, without reading data from the existing sub-map files with sequence numbers 0 and 1 in the hard drive.

[0064] S432. If the write mode is append mode, then read the existing target sub-map file, merge the incremental map data into the target sub-map file, and then write the merged map data back to the target sub-map file; Specifically, for step S432, when it is determined that the storage of the incremental map data adopts the append mode, the existing target sub-map file is first located in the lawnmower's local storage medium, and the original map data in the file is completely read into memory. Then, the incremental map data in memory is fully integrated and merged with the read original map data to form a new merged map data. Finally, the merged map data is completely written back to the original target sub-map file, completing the supplementary storage of incremental data to the existing file. When the lawnmower expands the mapping of the private garden area, it is determined that the writing mode is append mode and the target sub-map file number is 1. First, the original point cloud map data of the eastern part of the garden in the sub-map file of number 1 is read from the local hard disk, and it is merged with the incremental point cloud map data of the western part of the garden in memory. Then, the merged complete point cloud map data is written back to the sub-map file of number 1 on the hard disk.

[0065] S433. Call the system disk write function to write the incremental map data or merged map data written to the target sub-map file to the physical storage medium; Specifically, for step S433, after completing the direct write operation in the new creation mode or the read, merge, and write-back operation in the append mode, the dedicated disk write function of the lawnmower main control system is called. This triggers low-level system instructions to synchronize the incremental map data (in new creation mode) or the merged map data (in append mode) temporarily stored in memory from memory to the actual storage area of ​​physical storage media such as hard disks, achieving persistent data storage rather than just storing it in temporary memory. For example, after completing the direct write of the incremental map data on the west side of the garden to the sub-map file of sequence number 2 on the hard disk, or the merge and write-back to the sub-map file of sequence number 1, the fsync() class system disk write function is called to synchronize the corresponding incremental map data or merged map data in memory to the physical storage sector of the hard disk, completing the data disk write.

[0066] This embodiment provides storage operations that match and adapt to two write modes: creation and append. The creation mode directly writes incremental data, reducing I / O operations, while the append mode makes full use of the remaining storage space of existing files to improve storage utilization. The unified system disk write operation synchronizes memory data to the physical storage medium, effectively avoiding data loss, ensuring storage stability, and significantly reducing storage I / O and CPU computing power consumption, thereby improving the storage and update efficiency of incremental map data.

[0067] Furthermore, in some embodiments, after collecting the second map data generated by the lawnmower during extended operations, the lawnmower map data processing method may further include: S301. Extract keyframe point cloud data from the acquired second map data, and merge the keyframe point cloud data to obtain the map data to be processed; Specifically, for step S301, key frame point cloud data that can fully reflect the spatial characteristics of the extended operation area are selected from the second map data collected by the lawnmower. The selection criteria are the pose change threshold of the point cloud frame. That is, when the position or yaw angle change of consecutive point cloud frames exceeds the preset threshold, the frame is determined to be a key frame. After the selection is completed, all the extracted key frame point cloud data are integrated and merged according to spatial location characteristics to form a complete set of unprocessed map data that can characterize the core spatial characteristics of the extended operation area. Redundant non-key frame data is removed to achieve the initial simplification of map data.

[0068] For example, the second map data collected by the lawnmower during the expansion operation of the western area of ​​the private garden contains 100 frames of continuous point cloud data. After filtering by thresholds of 1m position change and 30° yaw angle change, 20 key frame point cloud data are extracted. After merging these 20 frames of data, a map data to be processed is obtained that can fully reflect the spatial characteristics of the lawn, wooden platform and shrub beds in the western area.

[0069] S302. Perform downsampling processing on the map data to be processed to obtain downsampled map data to be processed; Specifically, for step S302, a downsampling algorithm adapted to point cloud data is used to simplify the merged map data to be processed. While retaining the core spatial geometric features of the expanded work area, some redundant point cloud data points are removed to reduce the total amount of map data and reduce the computational load of subsequent data processing. At the same time, it ensures that the processed point cloud data can still accurately reflect the actual spatial situation of the work area.

[0070] For example, voxel downsampling is performed on the above map data containing 20 keyframe point clouds. By setting an appropriate voxel resolution, the amount of point cloud data is reduced by 60% after processing, but the planar features of the lawn on the west side of the garden, the three-dimensional features of the shrub beds, and the edge features of the wooden platform are still completely preserved, resulting in the downsampled map data.

[0071] S303. Determine the minimum and maximum height of the work area based on the height distribution of each point cloud data point in the downsampled map data to be processed; Specifically, in step S303, the height coordinates of all point cloud data points in the downsampled map data to be processed are extracted, and statistical analysis is performed on all height coordinates. Based on the distribution characteristics of the height values, the minimum and maximum heights within the lawnmower's current extended work area are determined. The minimum and maximum heights provide the core quantitative basis for generating color attributes for the point cloud data, allowing the color attributes to be correlated with the actual height characteristics of the work area.

[0072] For example, after extracting the z-axis height coordinates of all point clouds in the map data to be processed after downsampling on the west side of the garden, it was found that the height of the lawn point cloud in this area was concentrated between 0.1 and 0.3 m, the height of the wooden platform was 0.5 m, and the height of the edge of the shrub bed was 1.2 m. Based on the height distribution characteristics, the minimum height of this extended operation area was determined to be 0.1 m and the maximum height was 1.2 m.

[0073] S304. Generate color attribute data for each point cloud data point in the downsampled map data to be processed, based on the lowest and highest altitudes; Furthermore, in some embodiments, based on the lowest and highest altitudes, a piecewise linear mapping method is used to generate brightness values ​​for the red, green, and blue channels for each point cloud data point.

[0074] Specifically, for step S304, based on the determined minimum and maximum heights of the work area, the median height value is first calculated, dividing the height range of the work area into two segmented intervals. Then, using a piecewise linear mapping method, calculation rules for the corresponding red, green, and blue channel brightness values ​​are set for each segmented interval. Based on the actual height coordinates of each point cloud data point in the downsampled map data to be processed, the calculation rules for the corresponding interval are substituted to calculate the red, green, and blue channel brightness values ​​of the point, assigning unique color attribute data to each point cloud data point, thus giving the point cloud map height visualization features.

[0075] For example, the lowest height in the western area of ​​the garden is 0.1m and the highest height is 1.2m. The calculated median height is 0.65m, dividing the height into two intervals: <0.65m and ≥0.65m. For point cloud points <0.65m (lawn, wooden platform), the brightness values ​​of the green and blue channels are calculated according to the linear mapping rule, while the red channel is 0. For point cloud points ≥0.65m (shrub beds), the brightness values ​​of the red and blue channels are calculated according to the linear mapping rule, while the green channel is 0. Finally, corresponding RGB color attributes are generated for each point cloud data point in the western area, with the lawn showing a blue-green tone, the wooden platform showing a dark green tone, and the shrub beds showing a red-blue tone.

[0076] In this embodiment, the second map data collected during the extended operation of the lawnmower is processed sequentially by keyframe extraction and merging, and downsampling and simplification. While preserving the core spatial features of the area, the amount of data is reduced, thereby reducing the CPU computing power consumption of subsequent processing. Then, extreme values ​​are determined based on the height distribution of the operation area, and color attribute data is generated through piecewise linear mapping. This gives the point cloud map a high degree of visualization, improves the readability and usability of the map, and provides better map data support for core operation functions such as autonomous navigation of the lawnmower.

[0077] Furthermore, in some embodiments, step S303, "determining the minimum and maximum height of the work area based on the height distribution of each point cloud data point in the downsampled map data to be processed," may specifically include: S3031. Extract the height values ​​of all point cloud data points in the downsampled map data to be processed, and form a height set; Specifically, in step S3031, the spatial height coordinates of every point cloud data point are extracted from the downsampled map data to be processed corresponding to the lawnmower extension operation without omission. All extracted height values ​​are integrated to form a height set containing the height information of all point cloud data points in the operation area. This height set completely covers the point cloud height features of all terrain and objects in the operation area, serving as the basis for subsequent analysis and determination of height extrema.

[0078] For example, the map data to be processed after downsampling the western extension operation of the lawnmower in the private garden contains 5,000 point cloud data points. The z-axis height coordinate value of each point cloud point is extracted one by one and integrated to form a height set containing 5,000 height values, which are distributed between 0.1m and 1.2m, covering the point cloud heights of areas such as lawns, wooden platforms, and shrub beds.

[0079] S3032. Sort the height set according to its numerical value to obtain the sorted height sequence; Specifically, in step S3032, the formed height set is numerically sorted, and the originally disordered height set is organized into an ordered height sequence according to the height values ​​in ascending order. This sorting process makes the height values ​​of the work area exhibit a continuous gradient change characteristic, facilitating subsequent traversal in a fixed direction and selection of height values ​​that meet the judgment criteria, thus avoiding the judgment confusion caused by disordered traversal.

[0080] For example, sorting the above set of 5,000 height values ​​in ascending order yields an ordered height sequence starting from 0.1m and gradually increasing to 1.2m. In the sequence, the preceding values ​​correspond to the point cloud at a lower point in the work area, and the following values ​​correspond to the point cloud at a higher point in the work area.

[0081] S3033. From the sorted height sequence, determine the minimum height and the maximum height respectively according to the number threshold of points within the preset height interval; Specifically, for step S3033, based on the sorted height sequence, the minimum and maximum heights of the work area are determined by traversing in different directions twice and combining the quantization threshold.

[0082] When determining the minimum height, the height sequence is traversed from front to back, and each height value in the sequence is selected as a value to be determined. It is then checked whether the number of point clouds corresponding to the height values ​​within a preset height interval reaches a preset point count threshold. The first value to be determined that meets this condition is the minimum height of the working area. Similarly, when determining the maximum height, the height sequence is traversed from back to front, and each height value in the sequence is selected as a value to be determined. It is then checked whether the number of point clouds corresponding to the height values ​​within a preset height interval reaches a preset point count threshold. The first value to be determined that meets this condition is the maximum height of the working area. This method effectively eliminates interference from abnormal height values ​​corresponding to isolated points and noise points, ensuring that the determined extreme height values ​​closely match the true height characteristics of the working area.

[0083] For example, a preset height range of 0.1m and a point count threshold of 10 are set for the work area on the west side of the garden. When determining the minimum height, the height sequence is traversed from front to back. The first value to be determined is 0.1m. The height values ​​within the subsequent 0.1m height range correspond to 20 point cloud data points, reaching the threshold of 10. Therefore, 0.1m is determined as the minimum height of this area. When determining the maximum height, the height sequence is traversed from back to front. The first value to be determined is 1.2m. The height values ​​within the preceding 0.1m height range correspond to 15 point cloud data points, reaching the threshold. Therefore, 1.2m is determined as the maximum height of this area. If there is an isolated point height value of 0.05m in the sequence (corresponding to only 1 point cloud), and the number of points within the subsequent 0.1m height range does not reach the threshold, this value will be skipped directly to avoid interference from outliers in determining the minimum height.

[0084] This embodiment extracts point cloud height values ​​to form a set, sorts them, and then combines them with a preset height range and a point quantity threshold. It traverses in different directions to determine the minimum and maximum height of the work area, effectively eliminating interference from abnormal height values ​​such as isolated points and noise points. This ensures that the determined height extreme values ​​accurately match the true height characteristics of the work area, and the determination results are comprehensive and reliable. This provides an accurate quantitative benchmark for generating color attributes from point cloud data based on height features, ensuring the accuracy of the height visualization attribute construction.

[0085] Furthermore, in some embodiments, the lawnmower map data processing method may further include: S01. When a mapping instruction is received, if the first map data does not exist in the storage medium, the map data in memory is initialized to be empty; Specifically, for step S01, after receiving the mapping instruction, the main control system of the lawnmower first searches the local storage medium to check whether the storage medium contains the first map data corresponding to the current work area. If the search result is that there is no first map data for the work area in the storage medium, it means that this is the first basic mapping of the area. At this time, the main control system initializes the dedicated space in memory used for storing and processing map data, and sets the map data in the space to an empty state to ensure that there is no other irrelevant data left in the memory. This reserves a clean and independent memory space for subsequent collection and processing of map data for the work area, and avoids residual data from interfering with the data collection and processing of this mapping.

[0086] After the lawnmower receives a mapping instruction to build a basic map of a newly built private garden lawn, the main control system searches the local hard drive and finds that there is no first map data corresponding to the garden lawn. Then, it initializes the storage space in memory used to store point cloud map data, clearing all the data in the space to prepare memory for subsequent collection of point cloud data of the garden.

[0087] S02. When an idle command is received, stop collecting second map data and release the first map data and incremental map data stored in memory; Specifically, in step S02, when the lawnmower's main control system receives an idle command, it determines that the current map building or expansion operation has been completed and no further map data acquisition and processing is needed. First, it sends a stop command to the map data acquisition module, immediately stopping the acquisition of the second map data corresponding to the lawnmower's expansion operation and terminating the data acquisition work of sensors such as the LiDAR and inertial measurement unit. Then, the main control system releases all types of map data temporarily stored in memory, clearing all the first map data of the current working area and the incremental map data extracted in this operation, reclaiming the memory space occupied by the map data, and returning it to the system's general memory pool. After the lawnmower completes the expansion mapping operation of the aforementioned private garden lawn, the main control system receives the idle command and immediately sends a stop command to the LiDAR and IMU, terminating the acquisition of point cloud data and pose data of the garden area. Simultaneously, it releases all the original first map data of the garden and the incremental map data extracted in this expansion mapping, reclaiming memory resources and putting the lawnmower into standby mode.

[0088] This embodiment performs dedicated operations for mapping and idle commands. When a mapping command is received, if there is no existing map data, the memory is initialized to avoid interference from residual data in memory on map construction and to ensure the accuracy of mapping. When an idle command is received, map data acquisition is stopped in time and the map data temporarily stored in memory is released to quickly reclaim memory resources, reduce system memory usage, avoid squeezing out system computing power, ensure the normal operation of other core functions of the lawnmower, and improve system resource utilization efficiency and the stability and smoothness of operation.

[0089] To facilitate understanding of the lawnmower map data processing method provided in this embodiment, which is mainly applied to systems including lawnmower robots and base stations, the specific process is as follows: Step 1. After receiving the "Create Map" instruction, execute steps 3 and 5.

[0090] Step 2. After receiving the "Expand Mapping" instruction, execute steps 3, 4 and 5 in sequence.

[0091] Step 3. Initialize the first ordinary point cloud, the first non-planar point cloud, the first planar point cloud, and the first colored point cloud as empty point clouds.

[0092] Step 4. Read the number of point cloud files from the first file, denoted as . Then, the sequence number is read sequentially from the hard drive. The ordinary submap point clouds are directly merged and stored in the first ordinary point cloud in memory; the point clouds with sequence numbers are read sequentially from the hard drive. The non-planar sub-map point clouds are directly merged and stored in the first non-planar point cloud in memory; the point clouds with sequence numbers are read sequentially from the hard drive. The planar sub-map point clouds are directly merged and stored in the first planar point cloud in memory; the point clouds with sequence numbers are read sequentially from the hard drive. The colored sub-map point clouds are directly merged and stored in the first colored point cloud in memory.

[0093] Step 5. Begin continuously collecting 3D LiDAR and IMU data. Use the LiDAR Inertial Odometry (LIO) algorithm to obtain the point cloud and pose of the LiDAR in the map coordinate system for each frame. The first frame of LiDAR point cloud is determined as a keyframe. For each subsequent frame of point cloud, if the position difference between its pose and the pose of the previous keyframe is greater than a threshold... Or the yaw angle difference is greater than the threshold. If the current frame's point cloud is not considered a keyframe, then it is determined to be a keyframe; otherwise, it is considered a non-keyframe. For each keyframe, its point cloud representation in the map coordinate system is stored in memory. Specifically, . Step 6. After receiving the "Save Map" instruction, execute steps 7 through 19 in sequence.

[0094] Step 7. Initialize the incremental ordinary point cloud, incremental colored point cloud, incremental planar point cloud, and incremental non-planar point cloud as empty point clouds. If the above point clouds already exist, reset them to empty point clouds.

[0095] Step 8. Simply merge the point clouds in the map coordinate system corresponding to each keyframe to obtain the second ordinary map point cloud. If the first ordinary map point cloud is empty, add all points in the second ordinary map point cloud to the incremental ordinary point cloud. Otherwise, construct an octree using the first ordinary map point cloud; for each point in the second ordinary map point cloud, find the nearest neighbor in the first ordinary map point cloud and calculate the distance to the nearest neighbor; if the distance to the nearest neighbor is greater than a threshold... Then, add the points from the second ordinary map point cloud to the incremental ordinary point cloud.

[0096] Step 9. If the first ordinary point cloud is empty, it means this is not incremental mapping. Set the sequence number of the point cloud to 0, and set the flag for whether to overwrite the original point cloud to yes. Otherwise, read the number of point cloud files from the first file, and record it as . .if Then set the sequence number written to the point cloud to 0. Set the flag indicating whether to overwrite the existing point cloud to "yes"; otherwise, read the sequence number. The size of the ordinary submap point cloud, if greater than or equal to a threshold Then set the sequence number written to the point cloud to 0. Set the flag indicating whether it covers the original point cloud to "Yes"; if it is less than the threshold... Then set the sequence number written to the point cloud to 0. The indicator for whether to cover the original point cloud should be set to "No". Specifically, .

[0097] Step 10. If the flag indicating whether to overwrite the existing point cloud is "yes", then take the sequence number of the point cloud to be written. ,Bundle Write to the first file. If the flag indicating whether to overwrite the existing point cloud is "yes," then write the incremental ordinary point cloud from memory directly to the disk at the specified index. If a regular sub-point cloud file already exists, it will be overwritten; otherwise, the index will be read from the hard drive. Take the ordinary sub-point cloud file, merge it directly with the incremental ordinary point cloud, and then write the merged point cloud to the hard drive with the sequence number [number missing]. The ordinary sub-point cloud file is then written to disk using the fsync() system call.

[0098] Step 11. Add all points from the second ordinary point cloud to the first ordinary point cloud, merge them with the original first ordinary point cloud, and then perform a resolution adjustment. Voxel downsampling is performed to obtain a new first ordinary point cloud. All points in the second ordinary point cloud are then processed at a resolution of [resolution value missing]. Voxel downsampling yields the third ordinary point cloud.

[0099] Step 12. For the new first ordinary point cloud, take the z-coordinates of all points as a set. Sort the z-coordinates in ascending order. Then iterate through the sorted z-coordinates from front to back, and for each z-coordinate... Determine whether the following conditions are met. If satisfied, put As the minimum height Then stop traversing. If no z-coordinate satisfies the above condition, then take the first sorted z-coordinate as the minimum height. .in, It is a threshold number of points that meet the set conditions. It is a set height threshold, specifically, Then, iterate through the sorted z-coordinates from back to front, for each z-coordinate... Determine whether the following conditions are met. If satisfied, put As the highest height Then stop iterating. If no z-coordinate satisfies the above condition, then take the last z-coordinate after sorting as the highest height. .in, This indicates the number of elements in the set.

[0100] Step 13. Create an incremental color point cloud. The XYZ coordinates of each point in the incremental color point cloud are the same as the XYZ coordinates of points with the same index in the incremental ordinary point cloud. The color attribute of any point in the incremental color point cloud is calculated according to the following formula: in This represents the z-coordinate of the point. , , These are the brightness values ​​of the three channels of the point.

[0101] Step 14. If the flag indicating whether to overwrite the existing point cloud is "Yes", then write the incremental color point cloud from memory directly to the hard drive at the specified index. If the color sub-point cloud file already exists, overwrite it; otherwise, read the sequence number from the hard drive. The color sub-point cloud file is directly merged with the incremental color point cloud, and then the merged point cloud is written to the hard drive at sequence number [number missing]. The color sub-point cloud file is then written to disk using the fsync() system call.

[0102] Step 15. Initialize the second planar point cloud and the second non-planar point cloud to empty. Calculate the normal vector of each point in the third ordinary point cloud using principal component analysis. For each point, if the absolute value of the z-component of its normal vector is greater than a threshold... Then add the point to the second plane point cloud; if the absolute value of the z-component of its normal vector is less than a threshold. Then, add the points mentioned above to the second non-planar point cloud. Specifically, .

[0103] Step 16. If the first planar map point cloud is an empty point cloud, then add all points from the second planar map point cloud to the incremental planar point cloud. Otherwise, construct an octree using the first planar map point cloud; for each point in the second planar map point cloud, find the nearest neighbor in the first planar point cloud map and calculate the distance to the nearest neighbor; if the distance to the nearest neighbor is greater than a threshold... If the first non-planar map point cloud is empty, then all points in the second non-planar map point cloud are added to the incremental non-planar point cloud. Otherwise, an octree is constructed using the first non-planar map point cloud; for each point in the second non-planar map point cloud, the nearest neighbor is found in the first non-planar point cloud map, and the distance to the nearest neighbor is calculated; if the distance to the nearest neighbor is greater than a threshold... Then, the points in the second non-planar map point cloud are added to the incremental non-planar point cloud.

[0104] Step 17. If the flag indicating whether to overwrite the existing point cloud is "yes", then write the incremental planar point cloud from memory directly to the disk at the specified index. If the planar sub-point cloud file already exists, overwrite it; otherwise, read the file from the hard drive at the specified index. The planar sub-point cloud file is directly merged with the incremental planar point cloud, and then the merged point cloud is written to the hard drive at sequence number [number missing]. The planar sub-point cloud file is then written to disk using the fsync() system call.

[0105] Step 18. If the flag indicating whether to overwrite the existing point cloud is "Yes", then write the incremental non-planar point cloud from memory directly to the disk at the specified index. If the non-planar sub-point cloud file already exists, overwrite it; otherwise, read the sequence number from the hard drive. The non-planar sub-point cloud file is directly merged with the incremental non-planar point cloud, and then the merged point cloud is written to the hard drive at sequence number [number missing]. The non-planar sub-point cloud file is then written to disk using the fsync() system call.

[0106] Step 19. Add all points from the second planar point cloud to the first planar point cloud to obtain a new first planar point cloud. Add all points from the second non-planar point cloud to the first non-planar point cloud to obtain a new first non-planar point cloud.

[0107] Step 20. Upon receiving the "idle" instruction, stop executing step 5 and reset the first ordinary point cloud, the first non-planar point cloud, the first planar point cloud, and the first colored point cloud to empty point clouds.

[0108] In addition, this embodiment constructs ordinary point clouds, planar point clouds and non-planar point clouds, but planar point clouds and non-planar point clouds can also be distinguished by adding an attribute to each point in the ordinary map, instead of explicitly saving planar point clouds and non-planar point clouds.

[0109] In summary, the lawnmower map data processing method provided in this embodiment first acquires the map data of the original working area, then collects the newly added map data of the expanded area, and after comparing and extracting the difference increments, updates the original map only based on the incremental data. This eliminates the need for full read / write and merging operations on the large volume of original map data, fundamentally reducing unnecessary storage medium read / write operations and data operation operations during the map update process. This effectively reduces the occupation of storage I / O resources and CPU computing power, improves the efficiency of map data updates when the lawnmower robot expands its operations, and makes the map data processing flow more in line with the actual expanded mapping needs of the lawnmower robot.

[0110] It should be understood that, although Figure 2 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order in which these steps are executed, and they can be performed in other orders. Furthermore, Figure 2At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0111] To facilitate better implementation of the lawnmower map data processing method of this application, this application also provides a lawnmower map data processing device based on the above-described lawnmower map data processing method. The meanings of the terms used are the same as in the above-described lawnmower map data processing method, and specific implementation details can be found in the descriptions in the method embodiments.

[0112] Please see Figure 5 , Figure 5 This is a schematic diagram of the lawnmower map data processing device provided in an embodiment of this application. The lawnmower map data processing device may specifically include a first map module 201, a second map module 202, an incremental module 203, and an update module 204, as follows: The first map module 201 is used to acquire first map data corresponding to the work area of ​​the lawnmower; The second map module 202 is used to collect second map data generated by the lawnmower during the extended operation; Incremental module 203 is used to compare the second map data and the first map data, and extract incremental map data in the second map data that differs from the first map data. The update module 204 is used to update the first map data corresponding to the work area based on the incremental map data.

[0113] Specific limitations regarding the lawnmower map data processing device can be found in the limitations of the lawnmower map data processing method described above, and will not be repeated here. Each module in the aforementioned lawnmower map data processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.

[0114] The lawnmower map data processing device provided in this embodiment updates the original map data by extracting incremental map data when updating the map data for extended lawnmower operations, thereby achieving efficient updating of the map data for the work area and effectively reducing resource consumption during map data processing.

[0115] In one embodiment, a lawnmower robot is provided, the internal structure of which can be shown in the following diagram:Figure 6 As shown, the lawnmower robot includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the lawnmower robot is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements the methods described in any of the foregoing embodiments of this application.

[0116] This application also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, are used to implement the methods described in any of the foregoing embodiments of this application.

[0117] This application also provides a chip for executing instructions, which is used to perform the methods described in any of the foregoing embodiments executed by an electronic device as described in any of the foregoing embodiments of this application.

[0118] This application also provides a computer program product, which includes a computer program that, when executed by a processor, can implement the methods described in any of the foregoing embodiments executed by an electronic device as described in any of the foregoing embodiments of this application.

[0119] It should be noted that the functions or steps that the computer-readable storage medium or lawnmower robot can achieve are described in the relevant descriptions of the server side and client side in the aforementioned method embodiments. To avoid repetition, they will not be described one by one here.

[0120] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0121] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0122] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method for processing lawnmower map data, characterized in that, include: Obtain the first map data corresponding to the work area of ​​the lawnmower; Collect second map data generated by the lawnmower during extended operations; The second map data and the first map data are compared, and incremental map data that differs from the first map data in the second map data is extracted; Based on the incremental map data, update the first map data corresponding to the work area.

2. The lawnmower map data processing method according to claim 1, characterized in that, The step of comparing the second map data and the first map data, and extracting incremental map data in the second map data that differs from the first map data, includes: Construct a first spatial index structure for the first map data; Traverse the current data unit in the second map data and use the first spatial index structure to determine whether the current data unit exists in the first map data; All data units that are determined not to exist in the first map data are identified as the incremental map data.

3. The lawnmower map data processing method according to claim 2, characterized in that, The step of traversing the current data unit in the second map data and using the first spatial index structure to determine whether the current data unit exists in the first map data includes: Find the data unit that is closest to the current data unit in the first spatial index structure and designate it as the nearest neighbor data unit; Calculate the distance between the current data unit and the nearest neighbor data unit; If the distance is greater than a preset distance threshold, it is determined that the current data unit does not exist in the first map data.

4. The lawnmower map data processing method according to claim 1, characterized in that, The step of updating the first map data corresponding to the work area based on the incremental map data includes: Get the number of sub-map files in the storage medium that have stored map data; Based on the number of sub-map files and the size of the last sub-map file, determine the target sub-map file number and writing mode for this write operation; According to the writing mode, the incremental map data is written to or merged into the target sub-map file, and the disk write operation is performed.

5. The lawnmower map data processing method according to claim 4, characterized in that, The step of determining the target sub-map file sequence number and writing mode for this write based on the number of sub-map files and the size of the last sub-map file includes: If the number of sub-map files is the initial value, it means that there is no map data in the storage medium. Then, the writing mode is set to the new creation mode, and the target sub-map file sequence number is set to the initial sequence number. If the size of the last sub-map file is greater than or equal to a preset file size threshold, then the writing mode is set to the new creation mode, and the target sub-map file number is set to the current number of sub-map files; If the size of the last sub-map file is less than the preset file size threshold, the write mode is set to append mode, and the target sub-map file number is set to the number of the last sub-map file.

6. The lawnmower map data processing method according to claim 4, characterized in that, The step of writing or merging the incremental map data into the target sub-map file according to the writing mode, and performing the disk write operation, includes: If the writing mode is a new creation mode, the incremental map data will be directly written to the target sub-map file; If the write mode is append mode, then the existing target sub-map file is read, the incremental map data is merged into the target sub-map file, and the merged map data is written back to the target sub-map file. The system write-to-disk function is invoked to write the incremental map data or the merged map data written to the target sub-map file to the physical storage medium.

7. The lawnmower map data processing method according to claim 1, characterized in that, After acquiring the second map data generated by the lawnmower during extended operations, the method further includes: Keyframe point cloud data is extracted from the collected second map data, and the point cloud data of each keyframe are merged to obtain the map data to be processed. The map data to be processed is downsampled to obtain downsampled map data to be processed. Based on the height distribution of each point cloud data point in the downsampled map data to be processed, determine the minimum and maximum height of the work area; Based on the minimum and maximum altitudes, color attribute data is generated for each point cloud data point in the downsampled map data to be processed.

8. The lawnmower map data processing method according to claim 7, characterized in that, The step of determining the minimum and maximum altitude of the work area based on the altitude distribution of each point cloud data point in the downsampled map data to be processed includes: Extract the height values ​​of all point cloud data points in the downsampled map data to be processed to form a height set; Sort the height set according to its numerical value to obtain the sorted height sequence; From the sorted height sequence, the minimum height and the maximum height are determined according to the number threshold of points within the preset height interval.

9. The lawnmower map data processing method according to claim 1, characterized in that, The method further includes: When a mapping instruction is received, if the first map data does not exist in the storage medium, the map data in memory is initialized to be empty; When an idle command is received, the acquisition of the second map data is stopped, and the first map data and the incremental map data stored in memory are released.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the lawnmower map data processing method as described in any one of claims 1 to 9.