An improved genetic algorithm-based full-coverage field path planning method and device

By improving the genetic algorithm to optimize full-coverage path planning, the problems of repetitive operations and numerous turns in irregular farmland or obstacle environments of traditional algorithms are solved, and efficient field operations are achieved.

CN116050682BActive Publication Date: 2026-04-10SHANDONG COMP SCI CENTNAT SUPERCOMP CENT IN JINAN +2
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANDONG COMP SCI CENTNAT SUPERCOMP CENT IN JINAN
Filing Date
2022-08-29
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Traditional full-coverage path planning algorithms suffer from problems such as large areas of repetitive work and numerous turns in irregular farmland or areas with obstacles, resulting in low efficiency of unmanned agricultural machinery operations.

Method used

An improved genetic algorithm is used to construct a field environment map using a grid method. The fitness function, which combines chromosome encoding and multi-objective equilibrium criteria, with selection, crossover, and mutation operations, is used to optimize the full-coverage path planning.

Benefits of technology

It effectively reduces the area of ​​repetitive work and the number of turns, improving the efficiency and quality of unmanned agricultural machinery in the field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116050682B_ABST
    Figure CN116050682B_ABST
Patent Text Reader

Abstract

The present application relates to unmanned agricultural machinery technical field, specifically relates to a kind of full coverage field path planning method and device based on improved genetic algorithm.The method comprises: S1, constructs field environment map using grid method.S2, the free grid in field environment map is chromosomally encoded, and a plurality of initial chromosomes are randomly generated.S3, initial chromosome is adjusted, and legal chromosome is obtained.S4, construct fitness function based on multi-objective equilibrium criterion, determine the fitness of legal chromosome.S5, initial chromosome is evolved, and the next generation population is generated, as the parent population of next iteration.S6, determine whether to end this iteration, if yes, then the highest fitness chromosome in contemporary population is output for decoding, and full coverage path is obtained;If not, return to step S3.The present application can reduce repetitive work area and turning number, improve the field work efficiency and work quality of unmanned agricultural machinery.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of unmanned agricultural machines, in particular to a full-coverage field path planning method and device for unmanned agricultural machines based on an improved genetic algorithm. BACKGROUND

[0002] The full-coverage path planning (CCPP) algorithm is suitable for special scenarios of full coverage of the working area. Full-coverage field path planning is one of the key tasks for improving field work efficiency in smart farms. The success of automatic navigation agricultural machines depends on the ability to generate full-coverage paths in the field work area. Because the traditional full-coverage path planning algorithm is to generate full-coverage paths for rectangular sites or indoor mobile robots, it does not consider the complex field work environment. When planning a full-coverage path in the field, especially in the case of irregular field shapes or obstacles in the field, the traditional full-coverage path planning algorithm has problems such as large repeated work area and many turns, and the work efficiency is significantly lower than that in a rectangular field. SUMMARY

[0003] In view of the problems of large repeated work area and many turns of unmanned agricultural machines during full-coverage work, the present application proposes a full-coverage field path planning method and device based on an improved genetic algorithm, which can reduce the repeated work area and the number of turns, and effectively improve the field work efficiency and work quality of unmanned agricultural machines.

[0004] To achieve the above-mentioned purpose, the present application adopts the following technical scheme:

[0005] A full-coverage field path planning method based on an improved genetic algorithm, the method comprising the following steps:

[0006] S1, a grid method is used to construct a field environment map; the grids in the field environment map are divided into two types: free grids without obstacles and grids with obstacles.

[0007] S2, the free grids in the field environment map are encoded with chromosomes, and according to the field environment map after chromosome encoding, a plurality of initial chromosomes are randomly generated.

[0008] S3, the initial chromosomes are adjusted so that the chromosome path is the shortest continuous path, and a legal chromosome is obtained; the initial chromosome and the corresponding legal chromosome are combined to generate a chromosome pair, each chromosome pair is taken as a contemporary population, and the contemporary population is iterated. The initial chromosome refers to the most original chromosome in the parent population (contemporary population). The legal chromosome refers to the chromosome obtained after adjusting the path of the initial chromosome so that the path of the chromosome becomes the shortest continuous path.

[0009] S4, construct a fitness function based on a multi-objective balanced criterion, and use the fitness function to obtain the fitness of each legal chromosome in the current population.

[0010] S5, evolve the initial chromosome in the current population to generate the next generation population as the parent population for the next iteration.

[0011] S6, determine whether to end this iteration, if yes, output and decode the chromosome with the highest fitness in the current population to obtain the full coverage path; if not, increase the iteration number by 1, and return to execute step S3 for the next iteration. Preferably, the maximum number of iterations is 1000.

[0012] Further, the step S1 constructs the field environment map by using the grid method, which comprises:

[0013] S11, divide the farmland into several square grids with equal area according to the shape of the farmland, and mark the obstacles existing in the field; the square grid with obstacles is the obstacle grid, and the square grid without obstacles is the free grid.

[0014] S12, when the farmland boundary is irregular or there are obstacles in the field, perform inflation processing on the farmland boundary or the obstacle boundary to supplement a regular boundary or a boundary regular obstacle to obtain an inflated and quantized field grid map.

[0015] S13, mark the inflated and quantized field grid map to obtain the field environment map.

[0016] Further, the initial chromosome is adjusted to make the path of the chromosome the shortest continuous path to obtain a legal chromosome, which comprises:

[0017] S31, if the path of the initial chromosome is continuous, no adjustment is needed.

[0018] S32, if the path of the initial chromosome is not continuous, insert the shortest continuous path between the interval paths, and delete the repeated path number of the initial chromosome after the interval path, repeat the above process until all paths are continuous, thus generating a legal chromosome; the shortest continuous path is obtained by using the Floyd algorithm.

[0019] Further, the fitness function based on the multi-objective balanced criterion is constructed, which comprises:

[0020] S41, the following formula is used to obtain the repeated operation area, the number of turns and the number of U-turns of the i-th legal chromosome in the current population:

[0021]

[0022]

[0023]

[0024]

[0025]

[0026] wherein, , and represent the repeated work area, the number of turns and the number of U-turns of the i-th legal chromosome, represents the length of the legal chromosome , represents the length of the legal chromosome after removing the repeated genes, represents the modulo operation, represents the moving direction of the autonomous driving agricultural machine at the grid number , and represent whether there is a turn or a U-turn behavior at the grid number .

[0027] S42, according to the repeated work area, the number of turns and the number of U-turns of the i-th legal chromosome in the current population, the corresponding weight coefficients are obtained by using the following formula , and :

[0028]

[0029]

[0030]

[0031]

[0032]

[0033]

[0034]

[0035]

[0036]

[0037] wherein, , and Qi represents the weight coefficient of the i-th legal chromosome in the current population corresponding to the repeated work area, the number of turns and the number of U-turns, 、 and Qi represents the weight coefficient of the i-th legal chromosome in the parent population corresponding to the repeated work area, the number of turns and the number of U-turns, 、 and Qi represents the weight coefficient of the i-th legal chromosome in the current population corresponding to the repeated work area, the number of turns and the number of U-turns, 、 and Qi represents the weight coefficient of the i-th legal chromosome in the current population corresponding to the repeated work area, the number of turns and the number of U-turns,

[0038] S43, according to the weight coefficient of the i-th legal chromosome in the current population and the repeated work area, the number of turns and the number of U-turns, the fitness function is determined as follows:

[0039]

[0040] wherein, Qi represents the fitness value of the i-th legal chromosome, 、 and Qi represents the weight coefficient of the i-th legal chromosome in the current population corresponding to the repeated work area, the number of turns and the number of U-turns, 、 and Qi represents the weight coefficient of the i-th legal chromosome in the current population corresponding to the repeated work area, the number of turns and the number of U-turns,

[0041] Further, the evolution includes selection operation, crossover operation and mutation operation.

[0042] Further, the specific process of the selection operation is:

[0043] The roulette method is used as the selection operator, the probability of each chromosome being selected in the population is proportional to the value of its fitness, then the probability of each chromosome being selected is :

[0044]

[0045] The offspring chromosome generated after chromosome selection needs to be adjusted according to the adjustment method in step S3, so that the chromosome path is the shortest continuous path, to generate a legal feasible full coverage path.

[0046] Further, the specific process of the crossover operation is:

[0047] The single-point crossover method is used for the crossover operation, two chromosomes are randomly selected in the current population for crossover, a crossover point is first randomly determined, then all genes before the crossover point in another chromosome are deleted, and finally the remaining genes are filled in order after the crossover point; the offspring chromosome generated after the chromosome crossover is adjusted according to the adjustment method in step S3, so that the chromosome path is the shortest continuous path, to generate a legal feasible full coverage path.

[0048] Further, the specific process of the mutation operation is:

[0049] The basic bit mutation method is used for the mutation operation, a chromosome is randomly selected in the current population, two points are first randomly determined as gene mutation points, and then the two gene bits are exchanged; the offspring chromosome generated after the chromosome mutation needs to be adjusted according to the adjustment method in step S3, so that the chromosome path is the shortest continuous path, to generate a legal feasible full coverage path.

[0050] Further, the determination of whether to end the current iteration comprises:

[0051] It is determined whether the current iteration number reaches the set maximum iteration number or whether the fitness of the legal chromosome in the current population is within the set threshold range.

[0052] The application also relates to a device for realizing the full coverage field path planning method based on the improved genetic algorithm, which comprises a field environment map construction module and a path planning module based on the improved genetic algorithm.

[0053] The field environment map construction module is used for constructing a field environment map by using the grid method; the grids in the field environment map are divided into two types, i.e., free grids without obstacles and grids with obstacles.

[0054] The path planning module based on the improved genetic algorithm is used for chromosome coding of free grids in a field environment map, randomly generates a plurality of initial chromosomes according to the field environment map after chromosome coding, is also used for adjusting the initial chromosomes, so that the chromosome path is the shortest continuous path, and a legal chromosome is obtained, the initial chromosome and the corresponding legal chromosome are combined to generate a chromosome pair, each chromosome pair is used as a contemporary population, and iteration is carried out by using the contemporary population, is also used for constructing an adaptability function based on a multi-objective balance criterion, and adaptabilities of each legal chromosome in the contemporary population are obtained by using the adaptability function, is also used for evolving the initial chromosomes in the contemporary population to generate a next generation population as a parent population for next iteration, and is also used for judging whether the current iteration number reaches a set maximum iteration number or whether the adaptabilities of the legal chromosomes in the contemporary population are all within a set threshold range, if yes, the chromosome with the highest adaptability in the contemporary population is output and decoded to obtain the full coverage path, and if no, the iteration number is increased by 1, and the next iteration is carried out.

[0055] Compared with the prior art, the application has the following advantages:

[0056] (1) The application provides a full coverage field path planning method based on an improved genetic algorithm, which is mainly aimed at irregular field shapes and obstacles in the field, and can seek a full coverage field path with a good balance between repeated operation area and turning number, effectively reduces the repeated operation area and the turning number, and improves the working efficiency and quality of the agricultural machine.

[0057] (2) The application provides a chromosome coding mode based on adjacent grids and a corresponding chromosome adjustment mode, which can adjust any generated chromosome to a legal chromosome, corresponding to a feasible full coverage path. After adjusting the chromosome, a large number of invalid solutions can be avoided, and the convergence speed of the algorithm is effectively improved. The evolution mode for chromosome coding provided by the application can enhance the optimization ability of the algorithm, effectively avoid premature algorithm, and improve the effectiveness of the full coverage field path planning. BRIEF DESCRIPTION OF DRAWINGS

[0058] Figure 1 is a method flowchart of the application;

[0059] Figure 2a is a field map before quantization;

[0060] Figure 2b is a field environment map after quantization;

[0061] Figure 3 is a field environment map after inflation and quantization;

[0062] Figure 4 is a marked field environment map;

[0063] Figure 5 is a schematic diagram of a field environment code;

[0064] Figure 6 is a schematic diagram of adjacent grids;

[0065] Figure 7 is a schematic diagram of a full-coverage field path of a plow algorithm without obstacles;

[0066] Figure 8 is a schematic diagram of a full-coverage field path of a plow algorithm with obstacles;

[0067] Figure 9 is a schematic diagram of an initial chromosome;

[0068] Figures 10a-10d is a schematic diagram of initial chromosome adjustment;

[0069] Figure 11 is a schematic diagram of an adjusted chromosome;

[0070] Figure 12 is a schematic diagram of an initial population based on chromosome pairs;

[0071] Figure 13 is a schematic diagram of a chromosome crossover operation;

[0072] Figure 14 is a schematic diagram of a chromosome mutation operation;

[0073] Figure 15 is a schematic diagram of an optimal chromosome;

[0074] Figure 16 is a schematic diagram of an optimal full-coverage field path. DETAILED DESCRIPTION

[0075] The present application will be further described below in conjunction with the accompanying drawings:

[0076] As shown in Figure 1 a full-coverage field path planning method based on an improved genetic algorithm, the method comprising the following steps:

[0077] Step 1: Field environment map construction based on grid method

[0078] S11, the present application constructs a full-coverage field path planning map for unmanned agricultural machine operation area by using a grid method, as shown in FIG. 2, first, the farmland is divided into square grids with equal area according to the shape of the farmland, and the obstacles existing in the field are marked. Figure 2a is a field map before quantization; Figure 2b is a field environment map after quantization, in Figure 2b not only the grids are divided, but also the inaccessible grids are marked as obstacles.

[0079] S12, when the farm field boundary is irregular or there are obstacles in the field, it is necessary to perform inflation processing to supplement a regular boundary or a regular obstacle. The quantized field environment map after inflation is shown in Figure 3 .

[0080] S13, as shown in Figure 4 , the quantized field grid map after inflation is marked. The unmanned agricultural machine can only travel in four directions, i.e., forward, backward, left, and right. The black area is an obstacle area, and the blank area is a free area. The unmanned agricultural machine needs to traverse the free area, and the following conditions are met: (1) the unmanned agricultural machine must traverse the entire working area; (2) the unmanned agricultural machine must avoid all static obstacles; (3) the unmanned agricultural machine passes through the already worked area as little as possible; and (4) the unmanned agricultural machine reduces the number of turns as much as possible during working.

[0081] For convenience of description, the present application uses a 3*4 field grid map as shown in Figure 5 as an example, wherein the blank area is a free area, the area filled with diagonal lines is an obstacle area, and the grid numbered 1 is the starting point of the agricultural machine working. The numbering is in the order of from left to right and from bottom to top.

[0082] As shown in Figure 6 , in the field grid map, the grid adjacent to the number has four, which are , , , , wherein is the number of columns of the grid map. That is, when the grid numbered , the only movable direction is these four. At the same time, for the boundary grid, the moving direction can be two or three; for the situation that there are obstacles around, the moving direction will be reduced; for the unreachable grid, i.e., the grid surrounded by obstacles, the obstacles are marked.

[0083] The most commonly used method for full coverage field path planning is the plow algorithm, the basic idea of which is: using a bow-shaped search method for coverage, the unmanned agricultural machine performs coverage work in a back-and-forth manner in a certain direction. When an obstacle is encountered, move one vehicle distance upward to cross the obstacle; after crossing the obstacle, return to the original working direction to continue working; when reaching the working boundary, move in the opposite direction along the current working direction, and repeat this process to achieve the purpose of traversing the entire working area. As shown in Figure 7 , it is a full coverage field path planning diagram of the plow algorithm when there is no obstacle.

[0084] When the field working area has obstacles or the boundary is irregular, the full coverage field path planning of the plow algorithm is as shown in Figure 8As shown, at this time, the planned full-coverage field operation path repeats a large work area and too many turns. In order to solve this problem, the present application proposes another full-coverage path planning algorithm, that is, a full-coverage field path planning method based on an improved genetic algorithm, to adapt to the situation that the work area has obstacles or the boundary is irregular.

[0085] Due to the characteristics of genetic algorithm such as easy to code, global optimization ability and strong scalability, the present application adopts an improved genetic algorithm as a basic model for solving the full-coverage field path planning problem.

[0086] Step2: Chromosome coding mode based on adjacent grids

[0087] The purpose of the present application is to perform full traversal on free grids, and the traversal order is the final planned full-coverage path. The coding mode of base 10 is adopted, and each chromosome represents a feasible solution, corresponding to a full-coverage field path of the present application.

[0088] In order to ensure full traversal of free grids, that is, the corresponding free grids need to appear at least once in the chromosome, and the obstacle area grids cannot appear in the chromosome. According to the above Figure 4 As shown in the field environment, a randomly generated initial chromosome As shown in the field environment, a randomly generated initial chromosome Figure 9 As shown in the field environment, a randomly generated initial chromosome

[0089] However, the above chromosome is an illegal chromosome, because the unmanned agricultural machine cannot move directly from number 1 to number 8. Therefore, the initial chromosome needs to be adjusted, and the adjustment method is as follows:

[0090] (1) If the path is continuous, no adjustment is needed.

[0091] (2) If the path is not continuous, a continuous free grid needs to be inserted in the interval path to make it continuous, and the insertion method is the shortest continuous path between the interval grids, and the path numbers that have appeared after the initial chromosome are deleted. The shortest path between interval grids belongs to the multi-source path problem, and Dijkstra algorithm is suitable for solving single-source path problem, and A* algorithm may not get the shortest path, so Floyd algorithm can be used to get the shortest continuous path. Repeat the above process until all paths are continuous, and thus a legal chromosome is generated.

[0092] Figure 9 As shown in the initial chromosome adjustment process Figures 10a-10d As shown in the initial chromosome adjustment process As shown in the initial chromosome adjustment process Figure 11 As shown in the initial chromosome adjustment process

[0093] Step3: Generate initial population

[0094] According to Step2, the chromosome coding mode based on adjacent grids is randomly generated chromosomes as the initial population. The feature is that each chromosome is divided into two parts, the initial chromosome and the adjusted chromosome. The initial chromosome has the same length and is used for crossover, mutation and other evolutionary operations. The adjusted chromosome has different lengths, and each gene site and its adjacent gene site are continuously adjacent in the field grid map, representing a feasible full coverage path. The initial population based on chromosome pairs is shown in Figure 12 Figure 12 In Figure 12 , there are Q chromosome pairs in total. In each chromosome pair, there is an initial chromosome X and a legal chromosome Y.

[0095] Step4: Constructing fitness function based on multi-objective balance criterion

[0096] The fitness function is the basis for genetic algorithm iteration, which is related to the quality of the result and the convergence speed. The main goal of full coverage path planning is to reduce the number of turns and U-turns as much as possible while meeting the free grid full coverage. Because turning or U-turn will produce a deceleration-acceleration process, which will increase the energy consumption of agricultural machinery. But in actual situation, we often increase the number of turns or U-turns to reduce the repeated work area, or increase the repeated work area to reduce the number of turns or U-turns, so in order to balance the three planning targets of U-turns, turns and repeated work area, the invention proposes a fitness function based on multi-objective balance criterion, which is defined as follows:

[0097]

[0098] wherein, represents the fitness value of the i-th chromosome, , and are the weight coefficients of the repeated work area, the number of turns and the number of U-turns of the i-th chromosome, respectively, , and are the calculation functions of the repeated work area, the number of turns and the number of U-turns of the i-th chromosome, respectively.

[0099] Since the U-turn in the field consumes the most, and the repeated work area should be reduced as much as possible, the initial weight values of , and are set to 0.3, 0.2 and 0.5, respectively. Then the weight coefficient adaptive mechanism is used to ensure the balance of the three targets, and the update iteration formula is as follows:

[0100]

[0101]

[0102]

[0103]

[0104]

[0105]

[0106]

[0107]

[0108]

[0109] wherein, , and represent the weight coefficient of the repeated working area, the number of turns and the number of U-turns corresponding to the i-th legal chromosome in the current population, Q represents the total number of legal chromosomes in the current population, , and represent the weight coefficient of the repeated working area, the number of turns and the number of U-turns corresponding to the i-th legal chromosome in the parent population, , and respectively represent the repeated working area, the number of turns and the number of U-turns of the i-th chromosome in the current population, , and respectively represent the average of the repeated working area, the number of turns and the number of U-turns of all chromosomes in the parent population.

[0110] The repeated working area, the number of turns and the number of U-turns are calculated according to the Y chromosome in the chromosome pair, and the calculation formula is as follows:

[0111]

[0112]

[0113]

[0114]

[0115]

[0116] wherein, , and respectively represent the repeated working area, the number of turns and the number of U-turns of the i-th chromosome, denotes the length of the chromosome denotes the length of the chromosome denotes the length of the chromosome denotes the length of the chromosome after removing duplicate genes denotes the modulo operation denotes the moving direction of the autonomous agricultural machine at the grid number denotes whether there is a turning or U-turn behavior at the grid number denotes whether there is a turning or U-turn behavior at the grid number denotes whether there is a turning or U-turn behavior at the grid number denotes whether there is a turning or U-turn behavior at the grid number

[0117] Step 5: selection operation

[0118] The roulette method is used as the selection operator in the application, which selects individuals with low fitness and high fitness to ensure the diversity of the population and avoid the algorithm falling into a local optimal solution. The probability of each chromosome being selected in the population is proportional to the value of its fitness, and the probability of each chromosome being selected is :

[0119]

[0120] The offspring chromosomes generated after chromosome selection need to be adjusted according to the adjustment method in Step 1 to generate a legal and feasible full coverage path.

[0121] Step 6: crossover operation

[0122] Crossover operation is one of the important steps of genetic algorithm evolution, and its idea is to randomly select two chromosomes in the parent population with a large probability to perform crossover operation, generate chromosomes with both parent characteristics and new genetic characteristics, and enhance the optimization ability of the algorithm.

[0123] The single-point crossover method is used for crossover operation in the application: two chromosomes are randomly selected in the parent population for crossover, a crossover point is first randomly determined, then all genes before the crossover point in the other chromosome are deleted, and finally the remaining genes are filled in order after the crossover point. The value range of crossover probability is generally set between . The crossover operation schematic diagram is shown in Figure 13 .

[0124] The offspring chromosomes generated after chromosome crossover need to be adjusted according to the adjustment method in Step 1 to generate a legal and feasible full coverage path.

[0125] Step 7: mutation operation

[0126] The mutation operation is one of the important steps of the evolution of the genetic algorithm, and the idea is to randomly select a chromosome in the parent population with a small probability to perform mutation operation, to generate a child chromosome with new genetic information, and to effectively avoid premature convergence of the algorithm.

[0127] The basic bit mutation method is used for the mutation operation in the application: a chromosome is randomly selected in the parent population, two points are randomly determined as gene mutation points, and then the two gene bits are exchanged. The value range of the mutation probability is generally set between 0.001 and 0.01. The mutation operation schematic diagram is shown in Figure 14 .

[0128] The child chromosome generated after the mutation of the chromosome needs to be adjusted according to the adjustment method in Step 1 to generate a legal and feasible full coverage path.

[0129] Step 8: termination condition

[0130] The genetic algorithm generally has two termination methods, one is the number of generations, and the other is the stable result. The number of generations refers to setting a maximum number of iterations T, and when the maximum number of iterations T is reached, the algorithm is terminated and the optimal solution is output; the stable result refers to setting a stable integer M, and when the fitness value does not change for M consecutive times or the difference with the optimal solution is less than δ, the algorithm is terminated and the optimal solution is output. In this paper, the advantages of the two termination algorithms are combined, a reasonable number of iterations T=1000 is set, and when the algorithm tends to be stable for a long time δ=0.01, the algorithm is terminated in advance and the optimal solution is output.

[0131] Step 9: decoding output

[0132] The application considers the repeated operation area and the number of turns comprehensively, and proposes a full coverage field path planning method based on improved genetic algorithm, which balances the two while reducing the repeated operation area and the number of turns. After the iteration of the algorithm, the chromosome with the highest fitness in the last generation population is output for decoding, and the optimal chromosome is shown in Figure 15 .

[0133] According to the chromosome adjustment method in Step 1, since the optimal chromosome satisfies that the adjacent genes are two by two, no adjustment is needed, and the corresponding full coverage path planning after decoding is shown in Figure 16 .

[0134] Figure 8 and Figure 16 are respectively the full coverage field path planning schematic diagram based on the plough algorithm and the improved genetic algorithm. It can be seen from the comparison that when there are obstacles in the operation area or the operation boundary is irregular, the full coverage operation efficiency of the plough algorithm is low, and at this time the full coverage field path planning method based on the improved genetic algorithm should be selected to achieve the purpose of reducing the repeated operation area and the number of operations.

[0135] The application also relates to a device for realizing the full-coverage field path planning method based on the improved genetic algorithm, which comprises a field environment map construction module and a path planning module based on the improved genetic algorithm.

[0136] The field environment map construction module is used for constructing the field environment map by using the grid method; the grids in the field environment map are divided into two types, i.e., free grids without obstacles and grids with obstacles.

[0137] The path planning module based on the improved genetic algorithm is used for performing chromosome coding on the free grids in the field environment map, randomly generating a plurality of initial chromosomes according to the field environment map after the chromosome coding, adjusting the initial chromosomes so that the chromosome paths are the shortest continuous paths to obtain legal chromosomes, combining the initial chromosomes and the corresponding legal chromosomes to generate chromosome pairs, taking each chromosome pair as a current population, performing iteration by using the current population, constructing an adaptability function based on a multi-objective balance criterion, respectively obtaining the adaptabilities of the legal chromosomes in the current population by using the adaptability function, performing evolution on the initial chromosomes in the current population to generate a next generation population as a parent population for the next iteration, determining whether the current iteration number reaches a set maximum iteration number or the adaptabilities of the legal chromosomes in the current population are all within a set threshold range, if yes, outputting and decoding the chromosome with the highest adaptability in the current population to obtain the full-coverage path, and if no, increasing the iteration number by 1 and performing the next iteration.

[0138] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described modules can refer to the corresponding process in the foregoing method embodiments, which will not be described here again.

[0139] The foregoing embodiments only describe the preferred embodiments of the application, and do not limit the scope of the application, and various modifications and improvements to the technical solutions of the application made by those skilled in the art without departing from the design spirit of the application shall fall within the protection scope of the claims of the application.

Claims

1. An improved genetic algorithm-based full-coverage field path planning method, characterized in that: The method includes the following steps: S1. A field environment map is constructed using a grid method; the grids in the field environment map are divided into two types: free grids without obstacles and grids with obstacles; S2. Chromosome encoding is performed on the free grid in the field environment map, and several initial chromosomes are randomly generated based on the chromosome-encoded field environment map; S3. Adjust the initial chromosomes to make the chromosome path the shortest continuous path to obtain legal chromosomes; combine the initial chromosomes with their corresponding legal chromosomes to generate chromosome pairs, and use each chromosome pair as the current population for iteration; S4. Construct a fitness function based on the multi-objective equilibrium criterion, and use the fitness function to obtain the fitness of each legal chromosome in the current population. S5. Evolve the initial chromosomes in the current population to generate the next generation population, which will serve as the parent population for the next iteration. S6. Determine whether to end the current iteration. If yes, output the chromosome with the highest fitness in the current population and decode it to obtain the full coverage path. If no, increment the iteration count by 1 and return to step S3 to perform the next iteration. The construction of the fitness function based on the multi-objective equilibrium criterion includes: S41. The following formulas are used to calculate the area of ​​repeated operations, the number of turns, and the number of U-turns for the i-th legal chromosome in the current population: wherein, , and represent the repeated working area, the number of turns and the number of U-turns of the i-th legal chromosome, respectively, represents the length of the legal chromosome , represents the length of the legal chromosome after removing the repeated genes, represents the modulo operation, represents the moving direction of the autonomous driving agricultural machine at the grid number , and represent whether there is a turn or a U-turn behavior at the grid number . S42、According to the repeating operation area, the turning number and the U-turn number of the i-th legal chromosome in the current population, the corresponding weight coefficient is obtained by using the following formula , and : wherein, , and represent the weight coefficients of the repeated work area, the number of turns and the number of U-turns corresponding to the i-th legal chromosome in the current population, Q represents the total number of legal chromosomes in the current population, , and represent the weight coefficients of the repeated work area, the number of turns and the number of U-turns corresponding to the i-th legal chromosome in the parent population, , and respectively represent the repeated work area, the number of turns and the number of U-turns of the i-th legal chromosome in the current population, , and respectively represent the average of the repeated work area, the number of turns and the number of U-turns of all chromosomes in the parent population; S43. Based on the weight coefficient of the i-th legal chromosome in the current population, the area of ​​repeated operations, the number of turns, and the number of U-turns, the fitness function is determined as follows: wherein, represents the fitness value of the i-th legal chromosome, , and represent the weight coefficients of the repeated work area, the number of turns, and the number of U-turns of the i-th legal chromosome, respectively, , and represent the calculation functions of the repeated work area, the number of turns, and the number of U-turns of the i-th legal chromosome, respectively.

2. The full coverage field path planning method based on improved genetic algorithm according to claim 1, characterized in that: The method of constructing field environment maps using a raster method includes: S11. Divide the farmland into several squares of equal area according to the shape of the farmland, and mark the obstacles in the field; the squares with obstacles are called obstacle grids, and the squares without obstacles are called free grids. S12. When the farmland boundary is irregular or there are obstacles in the field, the farmland boundary or obstacle boundary is expanded to make it a regular boundary or an obstacle with a regular boundary, and the expanded and quantified field grid map is obtained. S13. Mark the expanded and quantized field grid map to obtain a field environment map.

3. The full coverage field path planning method based on improved genetic algorithm according to claim 2, characterized in that: The process of adjusting the initial chromosome to obtain a valid chromosome by making the chromosome path the shortest continuous path includes: S31. If the initial chromosome path is continuous, no adjustment is needed; S32. If the initial chromosome path is not continuous, insert the shortest continuous path between the intervening paths, and delete the path numbers that the initial chromosome has repeated after the intervening paths. Repeat the above process until all paths are continuous, thus generating a valid chromosome. The shortest continuous path is obtained using the Floyd algorithm.

4. The full coverage field path planning method based on improved genetic algorithm according to claim 3, characterized in that: The evolution includes selection, crossover, and mutation operations.

5. The full coverage field path planning method based on improved genetic algorithm according to claim 4, characterized in that, The specific process of the selection operation is as follows: The roulette wheel method is used as the selection operator, and the probability of each chromosome being selected is proportional to its fitness value, and the probability of each chromosome being selected is : The offspring chromosomes generated after chromosome selection need to be adjusted according to the adjustment method in step S3 to make the chromosome path the shortest continuous path, so as to generate a legal and feasible full-coverage path.

6. The full coverage field path planning method based on improved genetic algorithm according to claim 4, characterized in that, The specific process of the crossover operation is as follows: The single-point crossover method is used for the crossover operation, two chromosomes are randomly selected from the current population for the crossover operation, a crossover point is first randomly determined, then all genes before the crossover point in the other chromosome are deleted, and finally the remaining genes are filled in sequence after the crossover point; the offspring chromosome generated after the chromosome crossover is adjusted according to the adjustment method in step S3, so that the chromosome path is the shortest continuous path, to generate a legal feasible full coverage path.

7. The method according to claim 6, wherein, The specific process of the mutation operation is as follows: The basic bit mutation method is used for the mutation operation, a chromosome is randomly selected from the current population, two points are first randomly determined as gene mutation points, and then the two gene bits are exchanged; the offspring chromosome generated after the chromosome mutation needs to be adjusted according to the adjustment method in step S3, so that the chromosome path is the shortest continuous path, to generate a legal feasible full coverage path.

8. The full coverage field path planning method based on improved genetic algorithm according to claim 1, characterized in that, The determination of whether to end the current iteration comprises: Determining whether the current iteration number reaches the set maximum iteration number or whether the fitness of the legal chromosomes in the current population is within the set threshold range.

9. A device for implementing a full-coverage field path planning method based on an improved genetic algorithm, the device being used to implement the full-coverage field path planning method based on the improved genetic algorithm according to claim 1, characterized in that: The device comprises a field environment map construction module and a path planning module based on an improved genetic algorithm; The field environment map construction module is configured to construct a field environment map by using a grid method; the grids in the field environment map are divided into two types, i.e., free grids without obstacles and grids with obstacles; The path planning module based on the improved genetic algorithm is configured to code the free grids in the field environment map as chromosomes, randomly generate a plurality of initial chromosomes according to the chromosome-coded field environment map, adjust the initial chromosomes so that the chromosome path is the shortest continuous path, obtain legal chromosomes, combine the initial chromosomes and the corresponding legal chromosomes to generate chromosome pairs, use the current population for iteration, construct an adaptive function based on a multi-objective balance criterion, use the adaptive function to obtain the fitness of each legal chromosome in the current population, evolve the initial chromosomes in the current population to generate a next generation population as the parent population for the next iteration, and determine whether to end the current iteration, if yes, output and decode the chromosome with the highest fitness in the current population to obtain a full coverage path, and if not, increase the iteration number by 1 and perform the next iteration.