Path optimization method and device of sweeping robot and electronic equipment

Through improved genetic algorithms, the path of sweeping robots is optimized, which solves the problems of unclear, insufficient smoothness and insufficient dynamic obstacle avoidance capabilities in path planning, and achieves more efficient, safe and intelligent cleaning path planning.

CN119440011APending Publication Date: 2025-02-14CHINA TELECOM CORP LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411580695.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

When planning the path of the sweeping robot, there are problems such as unclear cleaning paths, lack of path smoothness considerations, and insufficient dynamic obstacle avoidance capabilities.

Method used

By obtaining the environmental modeling diagram of the area to be cleaned, the cleaning path collection is determined, and the cleaning path is optimized using improved genetic algorithms until the preset number of iterations is reached. The improved genetic algorithm gradually optimizes the path through fitness functions, cross-operations and mutated operations to ensure the shortest, smoother, minimum energy consumption and effective obstacle avoidance.

Benefits of technology

The precision, efficiency and intelligence of the path planning of the sweeping robot has been realized, the cleaning efficiency and safety have been improved, and the problems of unclear paths, insufficient smoothness and insufficient dynamic obstacle avoidance capabilities have been solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119440011A_ABST
    Figure CN119440011A_ABST
Patent Text Reader

Abstract

The invention discloses a path optimization method and device for a sweeping robot and electronic equipment. The method comprises the steps that an environment modeling graph of a to-be-cleaned area is acquired, and a cleaning path set is determined according to the environment modeling graph; the cleaning path set is optimized through an improved genetic algorithm, optimization is stopped until a preset number of iterations is reached, a target cleaning path set is obtained, and the improved genetic algorithm gradually optimizes an initial cleaning path in the cleaning path set at least through a fitness function, crossover operation and mutation operation; and determining the cleaning path with the highest fitness value in the target cleaning path set as an optimal path. According to the method and the device, the technical problems that the sweeping path is not clear, the path smoothness consideration is lacked and the dynamic obstacle avoidance capability is insufficient during path planning of the sweeping robot in the prior art are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of robotics technology, and more specifically, to a path optimization method, device, and electronic device for a sweeping robot. Background Art

[0002] With the accelerated pace of life and the increasing requirements for cleanliness of home and office environments, traditional manual cleaning methods can no longer meet the needs of modern life. In this context, the emergence of smart sweeping robots not only caters to the market demand for efficient and convenient cleaning equipment, but is also one of the iconic products in the development of the smart home industry. It not only simplifies cleaning work, but also greatly improves cleaning efficiency and cleanliness, bringing users an unprecedented convenient experience.

[0003] The development of sweeping robots can be traced back to the end of the last century. At that time, most products adopted a random walk cleaning strategy. Although this strategy is relatively simple to implement, it has obvious defects in cleaning effect and efficiency. With the continuous development of sensor technology and navigation algorithms, sweeping robots have begun to shift towards planned cleaning. The core of planned cleaning lies in path planning technology. Through built-in sensors and algorithms, the robot can perceive the environment, locate itself, and pre-plan the optimal cleaning path. This breakthrough in key technology enables sweeping robots to not only cover more cleaning areas, but also significantly reduce the number of repeated cleanings, thereby improving the overall cleaning effect and efficiency.

[0004] However, although path planning technology has been widely used and studied, there are still some problems that cannot be ignored. First, most planning methods fail to fully consider the smoothness of the path, which causes the sweeping robot to move jerkily during the cleaning process, increases wear on the robot itself, and affects the cleaning effect. Secondly, for dynamic obstacles in complex environments, the obstacle avoidance capabilities of related technologies are limited, which hinders the efficient operation of robots in dynamic environments and increases uncertainty and risks in the cleaning process. Furthermore, the genetic algorithms in related technologies have inherent defects in path planning, such as premature convergence and poor local search capabilities, which limit the optimization effect of the algorithm and the accuracy of path planning.

[0005] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0006] The embodiments of the present application provide a path optimization method, device and electronic device for a sweeping robot, so as to at least solve the technical problems in the related art of unclear cleaning paths, lack of consideration of path smoothness and insufficient dynamic obstacle avoidance capability when the sweeping robot is planning its path.

[0007] According to one aspect of an embodiment of the present application, a path optimization method for a sweeping robot is provided, comprising: obtaining an environmental modeling map of an area to be cleaned, and determining a cleaning path set based on the environmental modeling map, wherein the cleaning area is the actual area to be cleaned by the sweeping robot, the environmental modeling map is a coding map for distinguishing obstacle areas and obstacle-free areas in the cleaning area, and the cleaning path set includes multiple initial cleaning paths in the cleaning area; optimizing the cleaning path set by an improved genetic algorithm, and stopping the optimization after reaching a preset number of iterations to obtain a target cleaning path set, wherein the improved genetic algorithm gradually optimizes the initial cleaning paths in the cleaning path set at least through a fitness function, a crossover operation, and a mutation operation, and the fitness function includes a first function with the shortest cleaning path as a goal, a second function with the highest cleaning path smoothness as a goal, a third function with the minimum total cleaning path consumption as a goal, and a fourth function with the goal of avoiding obstacles; determining the cleaning path with the highest fitness value in the target cleaning path set as the optimal path.

[0008] Optionally, after determining the cleaning path set according to the environmental modeling diagram, the method also includes: obtaining a first cleaning path set corresponding to the cleaning area, wherein the first cleaning path set includes a preliminary feasible path obtained after path planning for the cleaning area; dividing the cleaning path set into multiple clusters, and determining the centroids of the multiple clusters, wherein the multiple clusters are used to represent multiple groups of cleaning routes with similar path characteristics, and the centroids are used to represent the average path characteristics of each cluster; determining a first distance and a second distance of a target cluster, wherein the target cluster is any one of the multiple clusters, the first distance is used to represent the distance from each initial cleaning path in the target cluster to the centroid of the target cluster, and the second distance is used to represent the average distance from all initial cleaning paths in the target cluster to the centroid of the target cluster; determining discrete paths in the cleaning path set based on the first distance and the second distance, wherein the discrete paths are used to represent abnormal paths in the cleaning path set; and replacing discrete paths with cleaning paths in the first cleaning path set.

[0009] Optionally, the cleaning path set is optimized by an improved genetic algorithm, including: using the fitness function in the improved genetic algorithm to determine the fitness values ​​of multiple initial cleaning paths in the cleaning path set, and arranging the fitness values ​​of the multiple initial cleaning paths in order from high to low to obtain a cleaning path sequence; dividing the cleaning path sequence into a first-level sequence, a second-level sequence, and a third-level sequence; copying the cleaning paths in the first-level sequence, and optimizing the cleaning paths in the second-level sequence and the third-level sequence through crossover operations and mutation operations in the improved genetic algorithm, until the optimization is stopped after a preset number of iterations is reached.

[0010] Optionally, the cleaning paths in the second level sequence and the third level sequence are optimized by crossover operations and mutation operations in an improved genetic algorithm, including: determining a second cleaning path set from the second level sequence and the third level sequence, wherein the second cleaning path set includes cleaning paths in the second level sequence and the third level sequence that need to be optimized; determining the individual similarity of the target cleaning paths in the second cleaning path set, wherein the target cleaning paths include a first cleaning path and a second cleaning path, the first cleaning path and the second cleaning path are any two cleaning paths in the second cleaning path set, and the individual similarity is used to measure the degree of similarity between the first cleaning path and the second cleaning path; when the individual similarity is greater than or equal to a similarity threshold, optimizing the target cleaning path by a mutation operation, and when the individual similarity is less than the similarity threshold, optimizing the target cleaning path by a crossover operation.

[0011] Optionally, determining a second cleaning path set from the second level sequence and the third level sequence includes: determining the sum of the fitness of the second level sequence and the third level sequence, and determining the individual fitness of the second level sequence and the third level sequence, wherein the sum of the fitness is used to represent the sum of the fitness values ​​of all cleaning paths in the second level sequence and the third level sequence, and the individual fitness is used to represent the fitness value of each cleaning path in the second level sequence and the third level sequence; determining the individual probability of each cleaning path in the second level sequence and the third level sequence being selected based on the sum of the fitness and the individual fitness; and adding the cleaning paths whose individual probability is greater than the probability threshold to the second cleaning path set.

[0012] Optionally, the similarity threshold is updated in the following manner: determining an initial similarity threshold, and dividing all individual similarities into a first similarity set and a second similarity set based on the initial similarity threshold, the first similarity set being a set of individual similarities greater than the initial similarity threshold, and the second similarity set being a set of individual similarities less than or equal to the initial similarity threshold; determining a first average similarity of the first similarity set, and determining a second average similarity of the second similarity set, wherein the first average similarity is used to represent the average value of all similarities in the first similarity set, and the second average similarity is used to represent the average value of all similarities in the second similarity set; updating the initial similarity threshold based on the first average similarity and the second average similarity, and stopping the updating until the difference between the updated similarity threshold and the similarity threshold obtained by the last update is less than a preset parameter.

[0013] Optionally, the method also includes: determining a mutation probability of a target cleaning path for a mutation operation and determining a crossover probability of a target cleaning path for a crossover operation through an activation function, wherein the activation function is used to convert a fitness value corresponding to the target cleaning path into a probability value.

[0014] According to another aspect of an embodiment of the present application, a path optimization device for a sweeping robot is also provided, comprising: a first determination module, used to obtain an environmental modeling map of an area to be cleaned, and determine a cleaning path set based on the environmental modeling map, wherein the cleaning area is the actual area to be cleaned by the sweeping robot, the environmental modeling map is a coding map used to distinguish between obstacle areas and obstacle-free areas in the cleaning area, and the cleaning path set includes multiple initial cleaning paths in the cleaning area; an optimization module, used to optimize the cleaning path set by an improved genetic algorithm, and stop the optimization after reaching a preset number of iterations to obtain a target cleaning path set, wherein the improved genetic algorithm gradually optimizes the initial cleaning paths in the cleaning path set by at least a fitness function, a crossover operation, and a mutation operation, and the fitness function includes a first function with the shortest cleaning path as the goal, a second function with the highest cleaning path smoothness as the goal, a third function with the minimum total cleaning path consumption as the goal, and a fourth function with the goal of avoiding obstacles; a second determination module, used to determine the cleaning path with the highest fitness value in the target cleaning path set as the optimal path.

[0015] According to another aspect of an embodiment of the present application, there is also provided an electronic device, including: a memory and a processor, wherein the memory is used to store program instructions; the processor is connected to the memory and is used to execute the path optimization method for implementing the above-mentioned sweeping robot.

[0016] According to another aspect of the embodiments of the present application, a non-volatile storage medium is further provided, the non-volatile storage medium including a stored computer program, wherein the device where the non-volatile storage medium is located executes the path optimization method of the above-mentioned sweeping robot by running the computer program.

[0017] According to another aspect of the embodiments of the present application, a computer program product is also provided, including computer instructions, which implement the path optimization method of the above-mentioned sweeping robot when executed by a processor.

[0018] In an embodiment of the present application, an environmental modeling map of the area to be cleaned is obtained, and a cleaning path set is determined based on the environmental modeling map, wherein the cleaning area is the actual area to be cleaned by the sweeping robot, and the environmental modeling map is a coding map for distinguishing obstacle areas and obstacle-free areas in the cleaning area, and the cleaning path set includes multiple initial cleaning paths in the cleaning area; the cleaning path set is optimized by an improved genetic algorithm until the optimization is stopped after a preset number of iterations is reached, and a target cleaning path set is obtained, wherein the improved genetic algorithm gradually optimizes the initial cleaning paths in the cleaning path set at least through a fitness function, a crossover operation, and a mutation operation, and the fitness function includes a first optimization operation with the shortest cleaning path as the goal. function, a second function with the goal of maximizing the smoothness of the cleaning path, a third function with the goal of minimizing the total consumption of the cleaning path, and a fourth function with the goal of avoiding obstacles; the cleaning path with the highest fitness value in the target cleaning path set is determined as the optimal path, thereby achieving the purpose of optimizing the cleaning path of the sweeping robot and improving the cleaning efficiency and safety, thereby realizing the precision, efficiency and intelligence of the path planning of the sweeping robot, providing a more reliable and advanced technical effect for automated cleaning of homes and offices, and further solving the technical problems of unclear cleaning paths, lack of consideration of path smoothness, and insufficient dynamic obstacle avoidance capability in path planning of the sweeping robot in the related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0020] Figure 1 is a hardware structure diagram of a computer terminal for implementing a path optimization method for a sweeping robot according to an embodiment of the present application;

[0021] Figure 2 is a flow chart of a path optimization method for a sweeping robot according to an embodiment of the present application;

[0022] Figure 3 is an environmental modeling diagram of a cleaning area according to an embodiment of the present application;

[0023] Figure 4 is a flow chart of a population initialization strategy according to an embodiment of the present application;

[0024] Figure 5 is a flow chart of an improved proportional selection operator according to an embodiment of the present application;

[0025] Figure 6 is a schematic diagram of a two-point flip cross according to an embodiment of the present application;

[0026] Figure 7 is a flowchart of updating a similarity threshold according to an embodiment of the present application;

[0027] Figure 8a is a schematic diagram of a path obtained by random walking in a comparative test according to an embodiment of the present application;

[0028] Figure 8b It is a schematic diagram of a path obtained by the ox-plowing bow method in a comparative test according to an embodiment of the present application;

[0029] Figure 8c It is a schematic diagram of a path obtained by combining the dichotomy method with the ox-plowing bow method in a comparative test according to an embodiment of the present application;

[0030] Figure 8d is a schematic diagram of a path obtained by a genetic algorithm in a comparative test according to an embodiment of the present application;

[0031] Figure 8e is a schematic diagram of a path obtained by using an ant colony algorithm in a comparative experiment according to an embodiment of the present application;

[0032] Figure 8f is a schematic diagram of a path obtained by path optimization in a comparative test according to an embodiment of the present application;

[0033] Figure 9a is a schematic diagram of a path obtained by using an IGA algorithm in a comparative test according to an embodiment of the present application;

[0034] Figure 9b is a schematic diagram of a path obtained by using the IAGA algorithm in a comparative test according to an embodiment of the present application;

[0035] Fig.10 It is a structural diagram of a path optimization device for a sweeping robot according to an embodiment of the present application. DETAILED DESCRIPTION

[0036] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0037] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0038] First, some nouns or terms that appear in the process of explaining the embodiments of the present application are subject to the following explanations:

[0039] K-means (K-means clustering algorithm): K-means is an unsupervised learning clustering algorithm used to divide objects in a data set into K clusters based on similarity. Each cluster is represented by its centroid (i.e., the average value of the cluster). The algorithm minimizes the distance from the objects in the cluster to the centroid of its cluster through an iterative process, thereby achieving a clustering effect. In this application, K-means is used to stratify the population individuals of the genetic algorithm to achieve more accurate selection operations and improve algorithm efficiency.

[0040] IAGA (Improved Adaptive Genetic Algorithm): An improved genetic algorithm that improves the performance and adaptability of the algorithm by adaptively adjusting the algorithm parameters and operation strategies based on the traditional genetic algorithm. In this application, IAGA is used for path planning of a sweeping robot. It can dynamically adjust the cleaning path according to environmental changes, while optimizing the path length, smoothness, total consumption and obstacle avoidance effect.

[0041] IGA (Improved Genetic Algorithm): An algorithm that is improved on the basis of the standard genetic algorithm. It usually modifies certain genetic operations or parameter settings to improve the algorithm's search efficiency and optimization effect. In the comparative experiment of this application, IGA is used to compare with IAGA to verify the effect of adaptive genetic algorithm on the path planning performance of the sweeping robot.

[0042] Environment Modeling: In robotics, the process of creating a digital model or map of the environment a robot works in. This model is used for robot localization, navigation, and path planning.

[0043] Grid method: A modeling method that divides the environment space into grids (grids), each grid represents a discrete area in the environment, which can be used to represent obstacles or passable areas. In this application, the grid method is used to construct the environment model, and each grid uses the number "0" or "1" to represent an obstacle-free or obstacle area.

[0044] A* algorithm: A graph search algorithm used to find the shortest path from the starting point to the end point, combining the breadth-first search and heuristic search characteristics of the Dijkstra algorithm. However, when there are multiple minimum values, the A* algorithm cannot guarantee the search for the optimal path, that is, it is easy to fall into the minimum point.

[0045] Dijkstra algorithm: an algorithm for solving the single-source shortest path problem, which can find the shortest path from one vertex to all other vertices in a graph. Although the algorithm has a high success rate and good robustness in obtaining the shortest path, its fatal flaw is the low efficiency of node traversal in large-scale complex path topology networks, which requires a lot of memory space and computing time.

[0046] Genetic algorithm: A global optimization technology based on natural selection and genetics, which simulates the selection, crossover and mutation operations in the biological evolution process to find the optimal solution to the problem. However, standard genetic algorithms have inherent defects such as premature convergence and poor local search capabilities. They may converge to the local optimal solution too early in the iterative process and fail to find the global optimal solution.

[0047] Sigmoid activation function: A continuous function that maps input values ​​to between 0 and 1. It is used as an activation function in neural networks and machine learning to introduce nonlinear features to the network layer.

[0048] In order to solve the problem of insufficient path planning capability of the sweeping robot in the related art, the present application embodiment provides a path optimization method for the sweeping robot, which can be run on Figure 1 In the computer terminal shown, the computer terminal is described below.

[0049] The path optimization method embodiment of the sweeping robot provided in the embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal for implementing a path optimization method for a sweeping robot. Figure 1As shown, the computer terminal 10 may include one or more (102a, 102b, ..., 102n are used to illustrate) processors (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions connected via a wired and / or wireless network. In addition, it may also include: a display, a keyboard, a cursor control device, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, and a BUS bus. Those skilled in the art can understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0050] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0051] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the path optimization method of the sweeping robot in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the path optimization method of the sweeping robot described above is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0052] The transmission module 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission module 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission module 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0053] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 .

[0054] It should be noted that, in some optional embodiments, the above Figure 1 The computer terminal shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. It should be noted that Figure 1 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the computer terminal described above.

[0055] In the above-mentioned operating environment, an embodiment of the present application provides an embodiment of a path optimization method for a sweeping robot. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0056] Figure 2 is a flow chart of a path optimization method for a sweeping robot according to an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:

[0057] Step S202, obtain the environmental modeling map of the area to be cleaned, and determine the cleaning path set based on the environmental modeling map, wherein the cleaning area is the actual area to be cleaned by the sweeping robot, the environmental modeling map is a coded map for distinguishing between the obstacle area and the obstacle-free area of ​​the cleaning area, and the cleaning path set includes multiple initial cleaning paths in the cleaning area.

[0058] In the above step S202, the sweeping robot needs to obtain the environmental modeling map of the area to be cleaned through its built-in environmental perception system. Among them, the environmental modeling map can be constructed by the grid method, and the cleaning area is divided into multiple grids to distinguish between obstacle areas and obstacle-free areas. Each grid is identified by different codes, such as "0" represents a free area without obstacles, and "1" represents an area with obstacles. Suppose the length and width of the cleaning area are L and W respectively, and the width of each grid is b, then the number of grids that the entire cleaning area can be divided into is (L / b)×(W / b).

[0059] like Figure 3 As shown in the figure, this encoding method enables the environment modeling diagram to intuitively reflect the layout and obstacle distribution of the cleaning area, providing a clear basis for subsequent path planning.

[0060] Furthermore, combined with the above environmental modeling graph, a set of cleaning paths can be generated through a semi-random population initialization strategy based on an improved A* algorithm. This strategy aims to balance the diversity and quality of the population, ensuring that the population contains as many feasible paths as possible, while also considering the connectivity and safety of the paths, avoiding the emergence of a large number of invalid paths, and laying a solid foundation for the optimization process.

[0061] Step S204, optimizing the cleaning path set by an improved genetic algorithm until the optimization is stopped after a preset number of iterations is reached, and obtaining a target cleaning path set, wherein the improved genetic algorithm gradually optimizes the initial cleaning paths in the cleaning path set at least through a fitness function, a crossover operation, and a mutation operation, and the fitness function includes a first function with the shortest cleaning path as the goal, a second function with the highest cleaning path smoothness as the goal, a third function with the minimum total cleaning path consumption as the goal, and a fourth function with the goal of avoiding obstacles.

[0062] In the above step S204, after the initial cleaning path set is determined, the cleaning path set can be optimized by an improved genetic algorithm. Among them, the fitness function in the improved genetic algorithm comprehensively considers four key factors: the total length, smoothness, total consumption and dynamic interval between obstacles of the path to achieve multi-objective optimization. The design of the fitness function ensures that the path is not only the shortest and smoothest, but also can effectively avoid obstacles, while minimizing energy consumption and time consumption, thereby improving the cleaning efficiency and the performance of the robot.

[0063] The improved genetic algorithm also uses adaptive crossover and mutation operations to dynamically adjust parameters according to the similarity of individuals in the population and the real-time evolution, further ensuring the diversity of individuals and the quality of the population. Before the adaptive crossover and mutation operations, the K-means clustering algorithm can also be used to accurately stratify individuals to ensure that high-quality individuals can enter the next generation of populations, thereby improving the overall adaptability of the population. This adaptive genetic algorithm improvement strategy not only speeds up the convergence of the algorithm, but also enables path planning to better adapt to complex and changing environments, improving the intelligence level of the sweeping robot.

[0064] Step S206: determine the cleaning path with the highest fitness value in the target cleaning path set as the optimal path.

[0065] In the above step S206, all paths in the target cleaning path set are sorted according to the fitness value, and the path with the highest fitness value is selected as the optimal path. The fitness value reflects the comprehensive performance of the path under the constraints of the fitness function, including factors such as path length, smoothness, total consumption, and dynamic interval with obstacles. The selection of the optimal path ensures the best effect of the cleaning operation under multiple constraints, and realizes the comprehensive optimization of cleaning efficiency, energy consumption, safety and path smoothness.

[0066] Through the above steps S202 to S206, the purpose of optimizing the cleaning path of the sweeping robot and improving the cleaning efficiency and safety is achieved, thereby realizing the precision, efficiency and intelligence of the path planning of the sweeping robot, providing a more reliable and advanced technical effect for the automated cleaning of homes and offices, and thus solving the technical problems of unclear cleaning paths, lack of consideration of path smoothness, and insufficient dynamic obstacle avoidance capabilities of sweeping robots in path planning in related technologies. The following is a detailed description.

[0067] In the above step S202, after determining the cleaning path set according to the environment modeling diagram, the method also includes: obtaining a first cleaning path set corresponding to the cleaning area, wherein the first cleaning path set includes a preliminary feasible path obtained after path planning for the cleaning area; dividing the cleaning path set into multiple clusters, and determining the centroids of the multiple clusters, wherein the multiple clusters are used to represent multiple groups of cleaning routes with similar path characteristics, and the centroids are used to represent the average path characteristics of each cluster; determining a first distance and a second distance of a target cluster, wherein the target cluster is any one of the multiple clusters, the first distance is used to represent the distance from each initial cleaning path in the target cluster to the centroid of the target cluster, and the second distance is used to represent the average distance from all initial cleaning paths in the target cluster to the centroid of the target cluster; determining discrete paths in the cleaning path set based on the first distance and the second distance, wherein the discrete paths are used to represent abnormal paths in the cleaning path set; replacing discrete paths with cleaning paths in the first cleaning path set.

[0068] In the embodiment of the present application, after determining the cleaning path set according to the environment modeling diagram, a path optimization and screening mechanism based on the K-means clustering algorithm is further introduced to improve the population quality and eliminate abnormal paths. Specifically, this process includes obtaining a first cleaning path set corresponding to the cleaning area, dividing the cleaning path set into multiple clusters through the K-means clustering algorithm, determining the centroid of the cluster, and identifying and replacing discrete paths based on distance calculation. The specific process is as follows Figure 4 As shown:

[0069] Step 1: First, randomly generate several initial solutions to form an initial population, each solution represents a cleaning path. That is, multiple cleaning paths are randomly generated to form an initial population of cleaning path sets, providing a starting point for subsequent optimization.

[0070] Step 2: Use the A* algorithm to plan the path of the cleaning area to obtain a preliminary optimized feasible path to form the first set of cleaning paths. The basic principle of the A* algorithm is to combine the characteristics of breadth-first search and best-first search, and to determine the search priority by calculating the heuristic function value of each node, so as to favor those paths that are more likely to reach the target during the search process. In the path planning scenario of the sweeping robot, specifically:

[0071] In the cleaning scenario, the Euclidean distance or Manhattan distance can be used as a heuristic function to calculate the straight-line distance from the current grid to the end point of the cleaning as the estimated cost. Initially, the cleaning start point is added to the open set, where the open set stores the cleaning nodes that the current algorithm needs to consider, and the closed set contains the cleaning nodes that have been considered. For each cleaning node, calculate its total cost, which consists of two parts: the actual cost from the start point to the current node (g value), and the estimated cost from the current node to the target node (h value). Select the node with the smallest f value from the open set as the current node and check its adjacent nodes. If the adjacent node is not in the closed set and is not on an obstacle, calculate its g value and f value and add it to the open set. Repeat this process until the target node is found or the open set is empty. When the target node is found, backtrack along the lowest cost path from the target node to the start node to construct a complete cleaning path. For each step of the search, move the current node from the open set to the closed set to avoid repeated searches.

[0072] Step 3: Use the K-means clustering method to cluster the initial population, divide the population into K clusters, and determine the centroid of each cluster. The K-means clustering algorithm can divide the above cleaning path set into multiple clusters by analyzing the similarity of the paths. Each cluster represents a group of cleaning routes with similar path characteristics, and each centroid represents the average characteristics of the paths within the cluster.

[0073] Step 4: Calculate the distance from all individuals to the nearest centroid, which is the first distance mentioned above. After clustering is completed, calculate the distance from each path in the cluster to its cluster centroid. This distance reflects the degree of difference between the individual and the average path characteristics in the cluster.

[0074] Step 5: Calculate the average distance from all individuals in each cluster to their corresponding centroid as the distance threshold, that is, the second distance mentioned above. This second average distance quantifies the overall similarity of the paths within the cluster and is used as a criterion for subsequent judgment of whether an individual is a discrete path.

[0075] Step 6: Based on the first distance and the second distance, determine the individuals whose distance to the nearest centroid exceeds the distance threshold, i.e., discrete paths. By comparing the first distance and the second distance, individuals with significantly different characteristics from the average path in the cluster, i.e., discrete paths, can be identified. These paths are often abnormal or inefficient and need to be replaced to optimize population quality.

[0076] Step 7: Finally, replace the discrete path with the high-quality cleaning path generated by the A* algorithm in Step 2.

[0077] Specifically, for each individual marked as a discrete path, one or more high-quality paths are selected from the first set of cleaning paths generated by algorithm A for replacement. When selecting a replacement path, the path closest to the starting point and end point of the discrete path, or the path with the highest score under the fitness function evaluation, can be considered to ensure that the replaced path can better adapt to the cleaning needs while improving the overall performance of the population. After the replacement operation is completed, the discrete paths in the population are replaced by high-quality cleaning paths, and the quality of the population is improved. By introducing better paths, not only the overall performance of the population is improved, but also the stability of the population quality is ensured, providing a more solid starting point for subsequent genetic algorithm optimization.

[0078] In the above steps, the optimization of the sweeping path set is achieved through the synergy of K-means clustering and A algorithm. First, the randomly generated initial sweeping path set is optimized by the A algorithm to generate preliminary feasible high-quality paths. Then, the K-means clustering algorithm is used to analyze the similarity and clustering of the paths. With the help of the first and second distances from the individuals in the cluster to the centroid, discrete paths, that is, abnormal paths or paths that differ significantly from the average path characteristics in the cluster, can be efficiently identified. Finally, by replacing the discrete paths with higher-quality paths generated by the A* algorithm, not only the inefficient paths are eliminated, but also the quality of the population is further improved, ensuring the diversity and quality of the paths in the subsequent genetic algorithm optimization process.

[0079] The implementation of this series of steps not only improves the quality of the cleaning path set, ensures the efficiency and adaptability of the paths in the population, but also solves the problem of insufficient path diversity and stability in traditional genetic algorithms through optimization and replacement mechanisms. Ultimately, the optimized cleaning path set will serve as the starting point for iterative optimization of the genetic algorithm. Through subsequent adaptive crossover and mutation operations, the comprehensive performance of the path will be further improved, and the total path length, smoothness, total consumption, and obstacle avoidance will be optimized, ensuring that the sweeping robot can complete the cleaning task efficiently and safely in complex environments.

[0080] In the above step S204, the cleaning path set is optimized by using an improved genetic algorithm, including: using the fitness function in the improved genetic algorithm to determine the fitness values ​​of multiple initial cleaning paths in the cleaning path set, and arranging the fitness values ​​of the multiple initial cleaning paths in order from high to low to obtain a cleaning path sequence; dividing the cleaning path sequence into a first-level sequence, a second-level sequence, and a third-level sequence; copying the cleaning paths in the first-level sequence, and optimizing the cleaning paths in the second-level sequence and the third-level sequence through the crossover operation and mutation operation in the improved genetic algorithm, until the optimization is stopped after reaching a preset number of iterations.

[0081] In the embodiment of the present application, the cleaning path set is optimized by an improved genetic algorithm. This process aims to further improve the comprehensive performance of the cleaning path and ensure that the path is optimal under multi-objective constraints such as total length, smoothness, total consumption and obstacle avoidance. The specific process is as follows Figure 5 As shown:

[0082] Step 1: First, the fitness function is used to calculate the fitness value of each initial cleaning path in the cleaning path set (parent population). Among them, the fitness function comprehensively considers four factors: total path length, smoothness, dynamic distance between obstacles and total consumption, and assigns a comprehensive score to each path, reflecting the comprehensive performance of the path under the conditions of satisfying multi-objective constraints. The fitness function includes the first function with the shortest cleaning path as the goal, the second function with the highest cleaning path smoothness as the goal, the third function with the minimum total cleaning path consumption as the goal, and the fourth function with the goal of avoiding obstacles. The following is an introduction to these four objective functions:

[0083] (1) The shortest cleaning path:

[0084] Since the total path length is required to be the shortest, and the total path length is inversely proportional to the fitness, the first function constructed for this indicator is as follows:

[0085] fit1=1 / d 总

[0086] In the formula, fit1 represents the first function, d 总 Represents the total length of the path, which is calculated as follows:

[0087]

[0088] In the formula, (x i ,y i ) represents the coordinates of the ith point, (x i+1 ,y i+1 ) represents the coordinates of the i+1th point, n represents the total number of points in the path, and i represents the index used to traverse all points in the path.

[0089] (2) The cleaning path has the highest smoothness:

[0090] Since the path smoothness is required to be maximized, and the path smoothness is proportional to the fitness, the second function constructed for this indicator is as follows:

[0091] fit2 = S(n)

[0092] Where fit2 represents the second function and S(n) represents the path smoothness.

[0093] Since the robot is subject to kinematic and dynamic constraints during its movement, it should try to avoid sharp changes in direction between straight segments. This sudden change in curvature will reduce walking efficiency. A high-smoothness path means that the angle formed between three adjacent points is large, which usually also indicates that the distance between the three points is long. Therefore, the concept of path smoothness can be transformed into calculating the distance between all three adjacent points in the path. The calculation formula is as follows:

[0094]

[0095] In the formula, (x i+2 ,y i+2 ) represents the coordinates of the i+2th point.

[0096] (3) The total consumption of the cleaning path is minimal:

[0097] Since the total path consumption is required to be minimized, and the total consumption is inversely proportional to the fitness, the third function constructed for this indicator in this application is as follows:

[0098] fit3=1 / nK(n)

[0099] Where fit3 represents the third function, K(n) represents the total energy consumption of turning, that is, the total path consumption, and n represents the number of turns.

[0100] The embodiment of the present application divides the consumption into two parts: time consumption and energy consumption. The minimum time consumption of the path is converted into the minimum number of turns, and the minimum energy consumption is converted into the minimum turning angle. Assuming that the total number of turns is n, the consumption of the i-th turn is w i , then the total energy consumption of turning can be expressed as K(n):

[0101]

[0102] (4) Effectively realize dynamic obstacle avoidance:

[0103] Since this application requires to achieve the maximum path smoothness, and the path smoothness is proportional to the fitness, the fitness function constructed by this application for this indicator is as follows:

[0104]

[0105] In the formula, Relative velocity coefficient, v k represents the speed of obstacle k, v0 represents the moving speed of sweeping robot k; Spa represents the set spacing threshold; R0 represents the radius of the sweeping robot; R k represents the radius of obstacle k; D min Indicates the shortest distance between each point on the path and the obstacle.

[0106] Effective dynamic obstacle avoidance means that for a certain path, the minimum distance between each point on the path and the dynamic obstacle must be greater than the sum of the radius of the robot and the obstacle. i , the position of an obstacle k is (x k (t i ),y k (t i )), then at time t i A point on the path (x i ,y i ) and the distance d between the obstacle k k (t i )for:

[0107]

[0108] Then the shortest distance between each point on the path and obstacle k is:

[0109] D min =min(d k (t i ))

[0110] D min The smaller it is, the easier it is for the robot to collide with obstacles.

[0111] The comprehensive fitness function proposed in the embodiment of the present application organically integrates four effective constraints, and can effectively plan a route with the highest cleaning efficiency, the lowest total consumption and the strongest feasibility. At the same time, because the fitness function takes into account the dynamic distance between the sweeping robot and the obstacle, it is convenient to carry out local path planning and realize dynamic obstacle avoidance. The sweeping robot perceives the surrounding environment information through the built-in environmental perception device. When no obstacle is detected, it carries out cleaning along the current optimal path; when an obstacle is detected, it first determines the dynamic distance between itself and the obstacle, as well as the minimum distance between obstacles, and uses a genetic algorithm for local path planning to make the path jump out of the local minimum point.

[0112] Next, the calculated fitness values ​​are arranged in descending order to generate a sequence of sweeping paths. This sorting process helps identify the paths with the best performance and those that need to be improved, providing a basis for subsequent genetic operations.

[0113] Step 2: K-means clustering algorithm is still used to cluster individuals in the parent population. K-means algorithm can divide the population into multiple clusters based on the similarity between individuals (here K=3 is set to distinguish between good, medium and poor individuals). Individuals in each cluster have similar path characteristics, while the path characteristics between clusters are significantly different.

[0114] Step 3: After clustering, calculate the distance between the individuals in the cluster and the centroid of each cluster. By comparing the distance from the individual to the centroid, we can identify those abnormal individuals that deviate from the average characteristics of the cluster, that is, discrete paths, and then remove the discrete paths to avoid their influence on subsequent genetic operations and ensure the quality of the population.

[0115] Step 4: Based on the average distance from the individuals in the cluster to the centroid, the individuals in the cleaning path sequence are divided into three levels: excellent, medium, and inferior, namely the first-level sequence, the second-level sequence, and the third-level sequence. Specifically, individuals with a smaller distance from the centroid are classified as excellent individuals, those with a moderate distance are classified as medium individuals, and those with a larger distance are classified as inferior individuals.

[0116] Step 5: For superior individuals (first-level sequence), due to their higher fitness values, they can be directly copied and passed to the next generation of population to ensure that the population always contains the path with the highest fitness value.

[0117] Step 6: For the sweeping paths in the second-level sequence and the third-level sequence, the crossover and mutation operations in the improved genetic algorithm are used for optimization. Specifically, the optimization operations include improved proportional selection, adaptive crossover and mutation operations, and dynamic adjustment of similarity threshold strategies. Specifically, in the second and third-level sequences, the roulette method is used for selection, that is, the probability of an individual being selected is proportional to its fitness value. However, in order to avoid weakening the advantages of high-quality individuals, the K-means clustering algorithm is used to further refine the proportional selection to ensure the diversity and quality of the population. At the same time, the two-point flip crossover and adaptive crossover mutation strategies are also introduced for genetic operations. The two-point flip crossover randomly sets two crossover points in the coding string of the paired individuals, flips and exchanges the fragments that need to be crossed, and improves the diversity of individuals. The setting of the adaptive crossover mutation probability ensures that the algorithm can dynamically adjust the crossover and mutation probabilities according to the real-time evolution of the population, which not only ensures the exploration ability of the population, but also avoids premature convergence to the local optimal solution.

[0118] After the optimization operation of the genetic algorithm, the cleaning path in the population will gradually evolve towards the optimal solution. This process will continue until the preset number of iterations is reached. The number of iterations is set to take into account the real-time nature of the algorithm and the limitation of computing resources to ensure that the best path is found within a limited computing time.

[0119] Through the above process, the present invention can effectively optimize the set of cleaning paths, ensuring that the final planned path can not only cover the entire cleaning area and avoid obstacles, but also excel in terms of path smoothness and total consumption. This multi-objective optimization strategy not only improves the cleaning efficiency and safety of the sweeping robot, but also enhances its adaptability and stability to complex environments, representing the innovative direction of the path planning technology of the sweeping robot. Finally, the set of cleaning paths obtained through iterative optimization of the genetic algorithm will be further screened to determine the optimal path, which will be used to guide the actual cleaning operation of the sweeping robot and achieve efficient, safe, and energy-saving cleaning effects.

[0120] Optionally, the cleaning paths in the second level sequence and the third level sequence are optimized by crossover operations and mutation operations in an improved genetic algorithm, including: determining a second cleaning path set from the second level sequence and the third level sequence, wherein the second cleaning path set includes cleaning paths in the second level sequence and the third level sequence that need to be optimized; determining the individual similarity of the target cleaning paths in the second cleaning path set, wherein the target cleaning paths include a first cleaning path and a second cleaning path, the first cleaning path and the second cleaning path are any two cleaning paths in the second cleaning path set, and the individual similarity is used to measure the degree of similarity between the first cleaning path and the second cleaning path; when the individual similarity is greater than or equal to a similarity threshold, optimizing the target cleaning path by a mutation operation, and when the individual similarity is less than the similarity threshold, optimizing the target cleaning path by a crossover operation.

[0121] Among them, determining the second cleaning path set from the second level sequence and the third level sequence includes: determining the sum of the fitness of the second level sequence and the third level sequence, and determining the individual fitness of the second level sequence and the third level sequence, wherein the sum of the fitness is used to represent the sum of the fitness values ​​of all cleaning paths in the second level sequence and the third level sequence, and the individual fitness is used to represent the fitness value of each cleaning path in the second level sequence and the third level sequence; determining the individual probability of each cleaning path in the second level sequence and the third level sequence being selected based on the sum of the fitness and the individual fitness; adding the cleaning paths whose individual probability is greater than the probability threshold to the second cleaning path set.

[0122] In the embodiment of the present application, by optimizing the cleaning paths in the second-level sequence and the third-level sequence, the comprehensive performance of each path in the population in terms of total length, smoothness, total consumption and obstacle avoidance is improved. This multi-objective optimization strategy not only improves the cleaning efficiency and safety of the sweeping robot, but also enhances its adaptability and stability to complex environments. Ultimately, after the improved genetic algorithm optimization, the cleaning paths in the population will gradually evolve toward the optimal solution, realizing effective path planning for the cleaning area. The specific process can be as follows:

[0123] First, the process of determining the second set of sweeping paths from the second-level sequence and the third-level sequence is performed based on the proportional selection operator in the improved genetic algorithm, which combines individual fitness and total fitness to select some paths for subsequent genetic operations in a probabilistic manner. Specifically:

[0124] For all the cleaning paths in the second-level sequence and the third-level sequence, calculate the sum of their fitness. The sum of fitness reflects the comprehensive performance level of the entire sequence and is a global performance indicator used to calculate the probability of an individual being selected. The specific calculation formula is as follows:

[0125]

[0126] In the formula, N represents the size of the group, F(x i ) represents the fitness value of the i-th cleaning path (individual), F total Represents the total fitness.

[0127] At the same time, for each cleaning path in the sequence, its individual fitness value is calculated. The individual fitness value is calculated based on the comprehensive fitness function proposed in the present invention, which considers key factors such as the total length of the path, smoothness, dynamic spacing between obstacles and total consumption, and gives each path a comprehensive score.

[0128] According to the fitness value of each individual and the total fitness of the sequence, the probability of the individual being selected is calculated. The specific calculation formula is as follows:

[0129]

[0130] In the formula, p(x i ) represents the individual probability. This formula ensures that the path with better performance has a higher probability of being selected, so that it has the opportunity to maintain and strengthen its advantages during the genetic process.

[0131] Secondly, the individual similarity calculation is performed in the second sweep path set. Its purpose is to evaluate the differences between the paths in the set, so as to guide the type of genetic operation. If the similarity between the paths is high, it means that the genetic differences are small. At this time, new gene combinations can be introduced through mutation operations to prevent the population from converging to the local optimal solution too early. On the contrary, if the similarity between the paths is low, it means that the genetic differences are large, and it is more suitable to reorganize the paths through crossover operations to accelerate the evolution of the population towards the optimal solution. The specific calculation formula is as follows:

[0132]

[0133] Where Sim(A,B) represents the similarity between individual A (i.e., the first cleaning path in the above target cleaning path) and individual B (i.e., the second cleaning path in the above target cleaning path), reflecting the degree of difference between the two paths in gene sequence, i.e., the degree of similarity of path characteristics; A i represents the i-th gene of the chromosome corresponding to individual A, B i It represents the i-th gene of the chromosome corresponding to individual B, and L is the length of the chromosome.

[0134] Finally, the individual similarity is compared with the set similarity threshold to decide whether to perform a mutation operation or a crossover operation.

[0135] If the individual similarity is greater than or equal to the similarity threshold, it means that the difference between the two paths is small, and there may be a tendency for a local optimal solution. At this time, the path will be optimized through a uniform mutation operation. The uniform mutation operation can introduce random mutations in the path, break the limitation of the local optimal solution, improve the exploration ability of the population, and avoid premature convergence.

[0136] On the contrary, if the individual similarity is less than the similarity threshold, it means that the difference between the two paths is large and there is a large optimization space. At this time, the path will be optimized through a two-point crossover operation. The crossover operation can exchange gene fragments in two paths in a genetic way, promote the recombination of high-quality genes in the population, optimize and improve path characteristics, and thus improve the overall quality of the population.

[0137] It should be noted that the two-point crossover operator is improved in the embodiment of the present application, such as Figure 6 As shown, two crossover points (such as c and f) are randomly set in the coding strings of two paired individuals, the fragments that need to be crossed are selected for flipping, and then part of the chromosomes of the two individuals between the two set crossover points are exchanged, thereby further ensuring individual diversity.

[0138] Optionally, when performing the above-mentioned mutation operation or crossover operation, it also includes: determining the mutation probability of the target cleaning path for mutation operation through an activation function, and determining the crossover probability of the target cleaning path for crossover operation, wherein the activation function is used to convert the fitness value corresponding to the target cleaning path into a probability value.

[0139] In the embodiment of the present application, the Sigmoid activation function is introduced and improved, and a new adaptive crossover probability and adaptive mutation probability are designed, which can dynamically adjust the crossover probability and mutation probability according to the individual fitness value and the real-time evolution of the population. This adjustment mechanism accelerates the convergence of the algorithm to the optimal solution while maintaining the diversity of the population. The specific expression is as follows:

[0140]

[0141] In the formula, p c is the population crossover probability; p m is the population mutation probability; fit i represents the fitness value of the i-th individual, fit max Indicates the maximum individual fitness value, fit min Represents the minimum individual fitness value, fit avg represents the average individual fitness value.

[0142] Optionally, when performing the above-mentioned mutation operation or crossover operation, the similarity threshold is updated in the following manner: determining an initial similarity threshold, and dividing all individual similarities into a first similarity set and a second similarity set according to the initial similarity threshold, the first similarity set being a set of individual similarities greater than the initial similarity threshold, and the second similarity set being a set of individual similarities less than or equal to the initial similarity threshold; determining a first average similarity of the first similarity set, and determining a second average similarity of the second similarity set, wherein the first average similarity is used to represent the average value of all similarities in the first similarity set, and the second average similarity is used to represent the average value of all similarities in the second similarity set; updating the initial similarity threshold according to the first average similarity and the second average similarity, and stopping the updating when the difference between the updated similarity threshold and the similarity threshold obtained by the last update is less than a preset parameter.

[0143] In the embodiment of the present application, a mechanism for dynamically adjusting the similarity threshold is also introduced when performing the above optimization operation. By monitoring the evolution of the population, such as the average fitness, the trend of the optimal solution, etc., the similarity threshold is adaptively adjusted. This mechanism helps to flexibly select mutation or crossover operations at different evolutionary stages, which not only ensures the diversity of the population, but also speeds up the convergence of the algorithm to the optimal solution. The specific process is as follows Figure 7 As shown:

[0144] First, an initial estimate is selected for the similarity threshold, which will be used to determine whether the similarity between individuals is high enough to determine the type of subsequent genetic operation. The setting of the initial similarity threshold needs to take into account the initial state of the population and the optimization goal. Usually, an intermediate value is selected so that it can be dynamically adjusted during the population evolution process.

[0145] After determining the initial similarity threshold, all calculated individual similarities are divided into two groups. The first similarity set N1 contains individual pairs whose individual similarity is greater than the initial similarity threshold, and there is a high similarity between these individual pairs; the second similarity set N2 contains individual pairs whose individual similarity is less than or equal to the initial similarity threshold, and there is a low similarity between them, indicating that there are large genetic differences.

[0146] For the first similarity set N1 and the second similarity set N2, the average of all individual similarities in each set is calculated, that is, the first average similarity and the second average similarity These averages reflect the distribution of similarity in the population and are crucial for dynamically adjusting the similarity threshold.

[0147] According to the first average similarity and the second average similarity Update the initial similarity threshold. The specific update formula is:

[0148]

[0149] In the formula, T represents the updated similarity threshold, are the second average similarities of the first similarity set N1 and the second similarity set N2 for the individual This formula aims to find the balance between the two sets, ensuring that the algorithm can both identify and utilize local optimal solutions and maintain the ability to explore new solutions. The updated similarity threshold will be used for the next round of individual similarity division.

[0150] Repeat the above similarity threshold update process until the difference t between the updated similarity threshold and the last updated similarity threshold is less than the preset parameter ΔT. The preset parameter ΔT is usually a very small positive number used to determine whether the threshold has reached a stable state. Once this termination condition is met, the similarity threshold will no longer be updated, and the genetic operation will perform adaptive crossover or mutation operations based on the final similarity threshold.

[0151] Through the above-mentioned process of dynamically updating the similarity threshold, the present invention can automatically adjust the execution of crossover and mutation operations according to the changes in the similarity between individuals during the population evolution process to maintain the diversity of the population, avoid premature convergence, and accelerate the convergence speed of the algorithm to the global optimal solution. The implementation of this strategy helps to achieve more efficient, more stable and more comprehensive optimization in the genetic algorithm, and the final planned path will better meet the comprehensive requirements of the sweeping robot in terms of cleaning efficiency, smoothness, energy consumption and safety.

[0152] In the embodiment of the present application, by introducing a semi-random population initialization strategy based on the improvement of the A* algorithm and combining it with the K-means clustering algorithm, the diversity and quality of the population are effectively balanced, and the initial performance of the algorithm is significantly improved. In addition, for complex environments, especially in the presence of dynamic obstacles, the application creatively constructs a multi-objective fitness function, which comprehensively considers the total path length, smoothness, dynamic interval with obstacles and total consumption, and realizes multi-objective optimization, ensuring that the sweeping robot is both efficient and safe during cleaning operations. At the genetic operation level, innovative improvements have been made to the proportional selection operator, two-point crossover operation and mutation operation. Individual stratification is achieved through the K-means clustering algorithm, ensuring that superior individuals can enter the next generation. At the same time, the two-point flip crossover operation is used to improve the genetic diversity of the population, and the adaptive crossover and mutation mechanism dynamically adjusts the operation probability according to the population evolution situation, further accelerating the convergence of the algorithm to the optimal solution, and effectively avoiding problems such as premature convergence and insufficient local search capabilities.

[0153] In order to verify the practicality of this method, this application conducted a series of simulation experiments, aiming to generate a feasible path starting from the starting point and covering the entire cleaning area. In order to comprehensively evaluate the performance of the IAGA method proposed in this application, this application set up two sets of comparative experiments. In the specific implementation, in order to select the optimal parameters, the actual size of the sweeping robot's activity area and the real-time requirements of the algorithm were comprehensively considered, and the population size was finally determined to be 50 and the maximum number of iterations was 80. The experimental environment configuration is shown in Table 1:

[0154] Table 1 Experimental environment configuration

[0155] name Configuration Information operating system Windows 11 Development Language Python 3.10 Development Tools Pycharm Development Framework Numpy, Scikit-learn, Scipy, Matplotlib, etc.

[0156] Comparative experiment 1:

[0157] In the experiment, the simulation environment was first constructed and divided into 20×20 grids according to the grid method. In all the following environment images, there are four obstacles (black areas), the green dot in the lower left corner represents the starting point, and the red dot in the upper right corner is the end point.

[0158] IAGA is compared with five other commonly used full coverage path planning algorithms. The final paths generated by these four algorithms are shown in Figure 8. Figure 8a Shown is the path obtained by the random walk algorithm, which has a high repetition rate and misses many areas. Figure 8b The path obtained by the ox-plowing bow method is shown. The repetition rate is reduced, but many areas are ignored and it is not suitable for complex environments. Figure 8c It shows the path obtained by combining the binary method with the ox-plowing bow method, which covers more areas but still misses some areas. Figure 8dThe results of the genetic algorithm are shown. The genetic algorithm is prone to getting stuck in local optimal solutions and therefore cannot achieve comprehensive coverage. Figure 8e The results of the ant colony algorithm are shown. The ant colony algorithm can easily achieve full coverage, but the repetition rate increases significantly, which greatly wastes resources, and the algorithm runs inefficiently.

[0159] In contrast, the final convergence result of the present method is shown in Figure 8f Compared with the path obtained by the random walk algorithm, IAGA reduces the repetition rate while improving the coverage rate; compared with the paths obtained by the ox-ploughing bow method and the binary method combined with the ox-ploughing bow method, although the repetition area of ​​IAGA has increased, the coverage rate has also been improved, which is enough to meet the needs of daily cleaning; compared with the path obtained by the genetic algorithm, IAGA not only achieves full coverage, but also improves the cleaning efficiency. These simulation results fully demonstrate the effectiveness and feasibility of the method of this application.

[0160] Comparative experiment 2:

[0161] In order to verify the improvement of the IAGA algorithm performance by the adaptive operation mechanism, this application sets up a comparative experiment to compare the final paths obtained without adding the adaptive operation mechanism and with adding the adaptive operation mechanism, as shown in FIG9 . Figure 9a The path results obtained without adding the parameter-adaptive operation mechanism are shown. Although the repetition rate is reduced and the obstacle avoidance effect is very significant, which greatly improves the safety performance, in order to meet the obstacle avoidance requirements, some coverage is sacrificed and the cleaning requirements cannot be fully met. Figure 9b The path results obtained by adding the adaptive operation mechanism are shown. It can be seen from the figure that after adding the parameter adaptive operation mechanism, IAGA achieves a good balance between repetition rate, coverage and obstacle avoidance effect, proving the superiority of the improved adaptive genetic algorithm proposed in this application in path planning.

[0162] Evaluation indicators:

[0163] In order to more intuitively demonstrate the improvement of IAGA algorithm performance, this application selected coverage and repetition rate, two commonly used evaluation indicators in full coverage path planning algorithms, to compare algorithm performance. The experimental results shown in Table 2 clearly show that IAGA performs well in both repetition rate and coverage rate, which fully proves the practicality of the improved adaptive genetic algorithm proposed in this application in the field of path planning.

[0164] Table 2 Performance comparison of different algorithms

[0165] Indicator name Coverage Repetition rate Random Walk 83.87% 35.27% Ox-plowing bow method 89.49% 0 Binary method combined with ox-ploughing bow method 92.74% 5.80% Ant Colony Algorithm 100% 67.80% Traditional genetic algorithm 77.15% 16.38% IGA 90.05% 6.27% IAGA 100% 8.07%

[0166] In summary, the embodiments of the present application significantly improve the path planning efficiency of the sweeping robot in a complex environment, ensure the shortest and smoothness of the cleaning path, reduce the energy consumption and wear of the robot, and improve the overall economy and user experience of the cleaning operation. The dynamic obstacle avoidance capability is enhanced, and the robot can flexibly adjust the cleaning route according to the real-time position changes of the obstacles, which significantly improves safety and reduces the risk of collision with obstacles. The operational efficiency and stability of the genetic algorithm are improved, and the diversity of the population is maintained through dynamic parameter adjustment and individual similarity calculation, avoiding the trap of local optimal solutions and speeding up the algorithm to find the global optimal solution. Through the comprehensive optimization of the path planning algorithm, it not only performs well in the simulation environment, but also has high feasibility in practical applications, providing strong technical support for the efficient and intelligent cleaning of the sweeping robot in homes and offices, and is expected to promote technological progress and market development in the field of smart homes.

[0167] According to an embodiment of the present application, a path optimization device for a sweeping robot is provided. It should be noted that the path optimization device for a sweeping robot in the embodiment of the present application can be used to execute the path optimization method for a sweeping robot provided in the embodiment of the present application. The path optimization device for a sweeping robot provided in the embodiment of the present application is introduced below.

[0168] Fig.10 1 is a structural diagram of a path optimization device for a sweeping robot provided according to an embodiment of the present application. Fig.10 As shown, the device comprises:

[0169] A first determination module 1000 is used to obtain an environmental modeling map of the area to be cleaned, and determine a cleaning path set according to the environmental modeling map, wherein the cleaning area is an actual area to be cleaned by the cleaning robot, the environmental modeling map is a coding map for distinguishing an obstacle area and an obstacle-free area in the cleaning area, and the cleaning path set includes a plurality of initial cleaning paths in the cleaning area;

[0170] The optimization module 1002 is used to optimize the cleaning path set by using an improved genetic algorithm until the optimization is stopped after reaching a preset number of iterations, and obtain a target cleaning path set, wherein the improved genetic algorithm gradually optimizes the initial cleaning paths in the cleaning path set by at least using a fitness function, a crossover operation, and a mutation operation, and the fitness function includes a first function with the shortest cleaning path as the goal, a second function with the highest cleaning path smoothness as the goal, a third function with the minimum total cleaning path consumption as the goal, and a fourth function with the obstacle avoidance as the goal;

[0171] The second determination module 1004 is used to determine the cleaning path with the highest fitness value in the target cleaning path set as the optimal path.

[0172] Through the first determination module 1000, the optimization module 1002 and the second determination module 1004 in the path optimization device of the above-mentioned sweeping robot, the purpose of optimizing the cleaning path of the sweeping robot and improving the cleaning efficiency and safety is achieved, thereby realizing the precision, efficiency and intelligence of the path planning of the sweeping robot, providing a more reliable and advanced technical effect for automated cleaning of homes and offices, and further solving the technical problems of unclear cleaning paths, lack of path smoothness considerations and insufficient dynamic obstacle avoidance capabilities of sweeping robots in related technologies during path planning.

[0173] In the path optimization device of the sweeping robot provided in the embodiment of the present application, the first determination module is also used to obtain a first cleaning path set corresponding to the cleaning area, wherein the first cleaning path set includes a preliminary feasible path obtained after path planning for the cleaning area; the cleaning path set is divided into multiple clusters, and the centroids of the multiple clusters are determined, wherein the multiple clusters are used to represent multiple groups of cleaning routes with similar path characteristics, and the centroid is used to represent the average path characteristics of each cluster; a first distance and a second distance of a target cluster are determined, wherein the target cluster is any one of the multiple clusters, the first distance is used to represent the distance from each initial cleaning path in the target cluster to the centroid of the target cluster, and the second distance is used to represent the average distance from all initial cleaning paths in the target cluster to the centroid of the target cluster; discrete paths in the cleaning path set are determined based on the first distance and the second distance, wherein the discrete paths are used to represent abnormal paths in the cleaning path set; and discrete paths are replaced with cleaning paths in the first cleaning path set.

[0174] In the path optimization device of the sweeping robot provided in the embodiment of the present application, the optimization module is also used to use the fitness function in the improved genetic algorithm to determine the fitness values ​​of multiple initial cleaning paths in the cleaning path set, and arrange the fitness values ​​of the multiple initial cleaning paths in order from high to low to obtain a cleaning path sequence; divide the cleaning path sequence into a first-level sequence, a second-level sequence, and a third-level sequence; copy the cleaning paths in the first-level sequence, and optimize the cleaning paths in the second-level sequence and the third-level sequence through the crossover operation and mutation operation in the improved genetic algorithm, until the optimization is stopped after reaching a preset number of iterations.

[0175] In the path optimization device of the sweeping robot provided in the embodiment of the present application, the optimization module is also used to determine a second cleaning path set from the second level sequence and the third level sequence, wherein the second cleaning path set includes the cleaning paths that need to be optimized in the second level sequence and the third level sequence; determine the individual similarity of the target cleaning paths in the second cleaning path set, wherein the target cleaning paths include a first cleaning path and a second cleaning path, the first cleaning path and the second cleaning path are any two cleaning paths in the second cleaning path set, and the individual similarity is used to measure the degree of similarity between the first cleaning path and the second cleaning path; when the individual similarity is greater than or equal to the similarity threshold, optimize the target cleaning path through a mutation operation, and when the individual similarity is less than the similarity threshold, optimize the target cleaning path through a crossover operation.

[0176] In the path optimization device of the sweeping robot provided in the embodiment of the present application, the optimization module is also used to determine the sum of the fitness of the second level sequence and the third level sequence, and to determine the individual fitness of the second level sequence and the third level sequence, wherein the sum of the fitness is used to represent the sum of the fitness values ​​of all cleaning paths in the second level sequence and the third level sequence, and the individual fitness is used to represent the fitness value of each cleaning path in the second level sequence and the third level sequence; the individual probability of each cleaning path in the second level sequence and the third level sequence being selected is determined based on the sum of the fitness and the individual fitness; and the cleaning paths whose individual probability is greater than the probability threshold are added to the second cleaning path set.

[0177] In the path optimization device of the sweeping robot provided in an embodiment of the present application, the optimization module is also used to determine an initial similarity threshold, and divide all individual similarities into a first similarity set and a second similarity set according to the initial similarity threshold, the first similarity set being a set in which individual similarities are greater than the initial similarity threshold, and the second similarity set being a set in which individual similarities are less than or equal to the initial similarity threshold; determine a first average similarity of the first similarity set, and determine a second average similarity of the second similarity set, wherein the first average similarity is used to represent the average value of all similarities in the first similarity set, and the second average similarity is used to represent the average value of all similarities in the second similarity set; update the initial similarity threshold according to the first average similarity and the second average similarity, and stop updating until the difference between the updated similarity threshold and the similarity threshold obtained in the last update is less than a preset parameter.

[0178] In the path optimization device of the sweeping robot provided in the embodiment of the present application, the optimization module is also used to determine the mutation probability of the target cleaning path for mutation operation and the crossover probability of the target cleaning path for crossover operation through an activation function, wherein the activation function is used to convert the fitness value corresponding to the target cleaning path into a probability value.

[0179] An embodiment of the present application also provides an electronic device, including: a memory and a processor, wherein the memory is used to store program instructions; the processor is connected to the memory and is used to execute the path optimization method for the above-mentioned sweeping robot.

[0180] It should be noted that the above electronic equipment is used to execute Figure 2 The path optimization method of the sweeping robot shown in the figure, therefore the relevant explanations and instructions in the above-mentioned path optimization method of the sweeping robot are also applicable to the electronic device, and will not be repeated here.

[0181] An embodiment of the present application also provides a non-volatile storage medium, which includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the above-mentioned path optimization method of the sweeping robot by running the computer program.

[0182] It should be noted that the above non-volatile storage medium is used to execute Figure 2 The path optimization method of the sweeping robot is shown, so the relevant explanations and instructions in the above path optimization method of the sweeping robot are also applicable to the non-volatile storage medium, and will not be repeated here.

[0183] An embodiment of the present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the path optimization method of the above-mentioned sweeping robot.

[0184] It should be noted that the above-mentioned computer program product is used to execute Figure 2 The path optimization method of the sweeping robot shown in the figure, therefore the relevant explanations and instructions in the above-mentioned path optimization method of the sweeping robot are also applicable to the computer program product, and will not be repeated here.

[0185] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0186] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0187] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0188] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0189] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0190] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0191] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A path optimization method for a sweeping robot, characterized in that: include: Acquire an environmental modeling map of the area to be cleaned, and determine a cleaning path set according to the environmental modeling map, wherein the cleaning area is an actual area to be cleaned by the cleaning robot, the environmental modeling map is a coding map for distinguishing an obstacle area and an obstacle-free area of ​​the cleaning area, and the cleaning path set includes a plurality of initial cleaning paths in the cleaning area; The cleaning path set is optimized by an improved genetic algorithm until the optimization is stopped after reaching a preset number of iterations, and a target cleaning path set is obtained, wherein the improved genetic algorithm gradually optimizes the initial cleaning paths in the cleaning path set at least by a fitness function, a crossover operation, and a mutation operation, and the fitness function includes a first function with the shortest cleaning path as the goal, a second function with the highest cleaning path smoothness as the goal, a third function with the minimum total cleaning path consumption as the goal, and a fourth function with the goal of avoiding obstacles; The cleaning path with the highest fitness value in the target cleaning path set is determined as the optimal path.

2. The method according to claim 1, characterized in that After determining the cleaning path set according to the environment modeling graph, the method further includes: Acquire a first cleaning path set corresponding to the cleaning area, wherein the first cleaning path set includes a preliminary feasible path obtained after path planning for the cleaning area; Dividing the cleaning path set into a plurality of clusters, and determining the centroids of the plurality of clusters, wherein the plurality of clusters are used to represent a plurality of groups of cleaning routes having similar path characteristics, and the centroids are used to represent the average path characteristic of each cluster; Determine a first distance and a second distance of a target cluster, wherein the target cluster is any one of the multiple clusters, the first distance is used to represent the distance from each initial cleaning path in the target cluster to the centroid of the target cluster, and the second distance is used to represent the average distance from all initial cleaning paths in the target cluster to the centroid of the target cluster; Determine a discrete path in the cleaning path set according to the first distance and the second distance, wherein the discrete path is used to represent an abnormal path in the cleaning path set; The discrete path is replaced by a cleaning path in the first cleaning path set.

3. The method according to claim 1, characterized in that The cleaning path set is optimized by an improved genetic algorithm, including: Using the fitness function in the improved genetic algorithm to determine the fitness values ​​of multiple initial cleaning paths in the cleaning path set, and arranging the fitness values ​​of the multiple initial cleaning paths in descending order to obtain a cleaning path sequence; Dividing the cleaning path sequence into a first level sequence, a second level sequence and a third level sequence; The sweeping paths in the first level sequence are copied, and the sweeping paths in the second level sequence and the third level sequence are optimized through the crossover operation and mutation operation in the improved genetic algorithm until the optimization is stopped after a preset number of iterations is reached.

4. The method according to claim 3, characterized in that: Optimizing the sweeping paths in the second level sequence and the third level sequence by crossover operation and mutation operation in the improved genetic algorithm, including: Determine a second cleaning path set from the second level sequence and the third level sequence, wherein the second cleaning path set includes cleaning paths in the second level sequence and the third level sequence that need to be optimized; Determining individual similarities of target cleaning paths in the second cleaning path set, wherein the target cleaning paths include a first cleaning path and a second cleaning path, the first cleaning path and the second cleaning path are any two cleaning paths in the second cleaning path set, and the individual similarities are used to measure the degree of similarity between the first cleaning path and the second cleaning path; When the individual similarity is greater than or equal to the similarity threshold, the target cleaning path is optimized through a mutation operation; when the individual similarity is less than the similarity threshold, the target cleaning path is optimized through a crossover operation.

5. The method according to claim 4, characterized in that Determining a second set of cleaning paths from the second level sequence and the third level sequence includes: Determine the fitness sum of the second level sequence and the third level sequence, and determine the individual fitness of the second level sequence and the third level sequence, wherein the fitness sum is used to represent the sum of the fitness values ​​of all cleaning paths in the second level sequence and the third level sequence, and the individual fitness is used to represent the fitness value of each cleaning path in the second level sequence and the third level sequence; Determining the individual probability of each cleaning path being selected in the second level sequence and the third level sequence according to the fitness sum and the individual fitness; The cleaning paths whose individual probabilities are greater than the probability threshold are added to the second cleaning path set.

6. The method according to claim 4, characterized in that The similarity threshold is updated in the following way: Determine an initial similarity threshold, and divide all individual similarities into a first similarity set and a second similarity set according to the initial similarity threshold, the first similarity set being a set of individual similarities greater than the initial similarity threshold, and the second similarity set being a set of individual similarities less than or equal to the initial similarity threshold; Determine a first average similarity of the first similarity set, and determine a second average similarity of the second similarity set, wherein the first average similarity is used to represent the average value of all similarities in the first similarity set, and the second average similarity is used to represent the average value of all similarities in the second similarity set; The initial similarity threshold is updated according to the first average similarity and the second average similarity, and the updating is stopped when the difference between the updated similarity threshold and the similarity threshold obtained in the last update is less than a preset parameter.

7. The method according to claim 4, characterized in that The method further comprises: The mutation probability of the target sweeping path performing the mutation operation and the crossover probability of the target sweeping path performing the crossover operation are determined by an activation function, wherein the activation function is used to convert the fitness value corresponding to the target sweeping path into a probability value.

8. A path optimization device for a sweeping robot, characterized in that: include: A first determination module is used to obtain an environmental modeling map of the area to be cleaned, and determine a cleaning path set according to the environmental modeling map, wherein the cleaning area is an actual area to be cleaned by the cleaning robot, the environmental modeling map is a coding map for distinguishing an obstacle area and an obstacle-free area of ​​the cleaning area, and the cleaning path set includes a plurality of initial cleaning paths in the cleaning area; an optimization module, configured to optimize the cleaning path set by an improved genetic algorithm until the optimization is stopped after reaching a preset number of iterations, and obtain a target cleaning path set, wherein the improved genetic algorithm gradually optimizes the initial cleaning paths in the cleaning path set by at least a fitness function, a crossover operation, and a mutation operation, and the fitness function includes a first function with the shortest cleaning path as a goal, a second function with the highest cleaning path smoothness as a goal, a third function with the minimum total cleaning path consumption as a goal, and a fourth function with the obstacle avoidance as a goal; The second determination module is used to determine the cleaning path with the highest fitness value in the target cleaning path set as the optimal path.

9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory is used to store program instructions; The processor is connected to the memory and is used to execute the path optimization method of the sweeping robot as described in any one of claims 1 to 7.

10. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the path optimization method of the sweeping robot according to any one of claims 1 to 7 by running the computer program.

11. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by the processor, the path optimization method of the sweeping robot described in any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Cleaning robot control method and cleaning robot

    CN119949696A