Multi-agricultural machinery task allocation method based on improved linear adaptive inheritance
By improving the linear adaptive genetic algorithm and dynamically adjusting the crossover and variability rates, the problem that multi-agricultural machinery task allocation method is easily trapped in local optimal solutions, and more efficient and accurate task allocation is achieved.
Patent Information
- Application Number
- CN202411457254.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-02-14
AI Technical Summary
The existing multi-agricultural machinery task allocation method is prone to falling into local optimal solutions, and the parameter settings are sensitive, making it difficult to adapt to the current search status.
The improved linear adaptive genetic algorithm is adopted to dynamically adjust the crossover and mutation rates, and the global search ability of the population is enhanced, avoid premature convergence, and improve the opportunity to find the global optimal solution.
The trap of local optimal solution is effectively avoided, the efficiency and accuracy of task allocation are improved, and the adaptability of the algorithm is enhanced.
Smart Images

Figure CN119443596A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of multi-agricultural machinery task allocation, and in particular relates to a multi-agricultural machinery task allocation method based on improved linear adaptive genetics. Background Art
[0002] As a core key technology in the smart agricultural technology system, the automatic navigation technology of agricultural machinery has been continuously improved and popularized in recent years, making it possible for multiple agricultural machinery to work together. The collaborative operation technology of multiple agricultural machinery or multiple types of agricultural machinery can give full play to the advantages of group operation, improve the efficiency of agricultural machinery operation, reduce production costs and improve production benefits.
[0003] The collaborative operation of multiple agricultural machinery involves many key technologies such as task allocation, automatic navigation, environmental perception and positioning, automatic control, communication and information sharing, among which task allocation is one of the research focuses. The principle is to maximize the value of tasks and minimize production costs. However, due to the limitations of the control and planning algorithms of multiple agricultural machinery, when the number of iterations is small and the number of samples is small, it is easy to fall into the local optimal situation.
[0004] In the prior art, the traditional genetic algorithm is generally used to solve the problem of agricultural machinery task allocation. The process is as follows: S1. Select a suitable encoding method (binary encoding) to convert the task allocation situation into individual chromosomes; S2. Randomly generate a certain number of individuals as the initial population, and it must be ensured that the individuals in the population can cover the solution space of the task allocation; S3. Calculate the fitness value of each individual and evaluate it according to the fitness function. Individuals with high fitness represent better task allocation solutions; S4. Select individuals with higher fitness for reproduction. Common selection methods include roulette selection and tournament selection; S5. Select two or more individuals for crossover operation (recombination) to generate new individuals. It is necessary to ensure that the individuals after crossover still meet the constraints of task allocation; S6. Mutate some individuals and change some gene values of individuals to increase the diversity of the population. Ensure that the mutation is carried out under a certain probability and follow the rules of task allocation; S7. Replace individuals with lower fitness with newly generated individuals to form a new generation of population; S8. Determine whether the maximum number of iterations is met. If it is met, end the iteration process and output the result, otherwise return to S4.
[0005] However, the crossover and mutation probabilities in existing methods are fixed during the iteration process, and do not reflect a random process. At the same time, existing methods are often very sensitive to parameter settings such as population size, crossover rate, and mutation rate. Different settings may lead to completely different results, and lack the ability to adaptively adjust parameters according to the current search state. This will easily lead to a stagnant state and fall into a local optimal solution, which will greatly reduce the number of feasible solutions. Summary of the invention
[0006] In order to solve the above technical problems, the present invention proposes a multi-agricultural machinery task allocation method based on improved linear adaptive genetics to solve the problems existing in the above prior art.
[0007] To achieve the above object, the present invention provides a method for allocating tasks of multiple agricultural machinery based on improved linear adaptive genetic algorithm, comprising:
[0008] Constructing a multi-agricultural machinery operation task set and a multi-agricultural machinery operation task site based on the operation scene of the multi-agricultural machinery, and constructing an input data set based on the multi-agricultural machinery operation task set and the multi-agricultural machinery operation task site;
[0009] Construct a multi-agricultural machinery task scheduling evaluation model based on the performance parameters of agricultural machinery;
[0010] Constructing an improved linear adaptive genetic algorithm, inputting the input data set into the improved linear adaptive genetic algorithm for iterative optimization and allocation calculation, and obtaining an adaptive optimal allocation result;
[0011] The adaptive optimal allocation result is input into the multi-agricultural machinery task scheduling evaluation model to evaluate the rationality of the allocated tasks and generate the optimal allocation result.
[0012] Preferably, the multi-agricultural machinery operation task set includes the operation type, operation area and the number of operation plots;
[0013] The multi-agricultural machinery operation task site includes a site number, a site endpoint, an endpoint of the head of the field, an entrance endpoint and an endpoint of an obstacle.
[0014] Preferably, in the multi-agricultural machinery task scheduling evaluation model, the cost function is expressed as:
[0015]
[0016] Among them, f is the function of collaborative cost, f_cost is the minimum cost, α, β and γ are weight coefficients, ti is the operating time of the i-th agricultural machine, task_pre is the percentage of the workload, and Si is the operating distance of the i-th agricultural machine.
[0017] Preferably, in the multi-agricultural machinery task scheduling evaluation model, the constraints include: the performance parameters of the agricultural machinery are known, the amount of tasks required before the agricultural machinery operates is known, the number of agricultural machinery is less than or equal to the amount of tasks to be completed, and one agricultural machinery is responsible for one operation task.
[0018] Preferably, the operation process of the improved linear adaptive genetic algorithm includes:
[0019] Generate an initial population of size N using binary encoding, define the crossover probability Pm, the mutation probability Pe, and the number of iterations K of the genetic algorithm;
[0020] Perform genetic iteration based on the order of the random sequence: Generate a random sequence Rr, and specify a threshold Re, where Rr ∈ [0, 1). If Rr < Re, then crossover occurs; otherwise, if Rr > Re, no crossover occurs;
[0021] From the first generation of offspring, generate a random number Rm, where Rm ∈ [0, 1). If Rm < Pe, then the individual performs a mutation operation; otherwise, the individual remains unchanged. Calculate the fitness function of the individual and repeat this step;
[0022] Adopt an elitist strategy to update the optimal solution of each generation of the population, select the optimal individual, and update the offspring population;
[0023] Update the offspring population, set the thresholds for the mutation rate and the selection rate, and specify the maximum mutation probability, the minimum mutation probability, the maximum selection probability, and the minimum selection probability;
[0024] Adopt an improved adaptive strategy to dynamically change the crossover probability and the mutation probability according to the fitness value;
[0025] Update the optimal solution, select the optimal individual, and update the offspring population. If the number of iterations is reached, select the individual with the highest fitness in the current population as the solution for this task assignment, and output the optimal result at the same time.
[0026] Preferably, the process of performing genetic based on the order of the random sequence further includes: Select based on the roulette wheel method to obtain the parent generation and a random sequence from 1 to m, specify the crossover threshold Re, and Rr ∈ [0, 1). If Rr < Re, then single-factor crossover occurs; if Rr > Re, then two-factor crossover occurs to obtain the offspring individuals after crossover.
[0027] Preferably, the process of adopting an elitist strategy to update the optimal solution, select the optimal individual, and update the offspring population further includes: During the gene encoding process, mutate the genes that exceed the range. The expression for mutating the genes that exceed the range is:
[0028]
[0029] where, is the upper and lower limit interval of the mutation rate.
[0030] Preferably, the process of adopting an improved adaptive strategy to change the crossover probability and the mutation probability according to the fitness value further includes: When adopting the cosine-improved adaptive strategy in combination with the crossover and mutation operators, dynamically adjust the crossover and mutation probabilities or parameters when generating new individuals;
[0031] The expression for the probability of adjusting crossover is:
[0032]
[0033] The expression for adjusting the probability of mutation is:
[0034]
[0035] Among them, P cmax , P cmin Respectively represent the maximum and minimum values of the crossover probability, f max is the maximum value of population fitness, f min is the minimum value of population fitness, f avg represents the average value of the population fitness, f(i) is the current value of the fitness of the i-th individual, P mmax , P mmin They represent the maximum and minimum values of the mutation probability respectively.
[0036] Compared with the prior art, the present invention has the following advantages and technical effects:
[0037] The improved linear adaptive genetic method for allocating tasks of multiple agricultural machinery of the present invention obtains parameter information of agricultural machinery and parameter information of farmland, sets input parameters according to tasks; constructs a task set of multiple agricultural machinery and a task scheduling evaluation model of multiple agricultural machinery; and obtains the optimal allocation scheme of agricultural machinery according to the input parameters, the task scheduling evaluation model of multiple agricultural machinery and the improved linear adaptive genetic algorithm, in conjunction with the scheduling system of the cloud service platform and the self-organizing network, and the parameter information of agricultural machinery received in real time. The improved linear adaptive genetic algorithm designed by the present invention adopts dynamic mutation rate and crossover rate to adjust the global search ability of the population, adjusts the algorithm parameters, accelerates the convergence speed, avoids premature convergence in the search process, and increases the chance of finding the global optimal solution. . BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0039] Figure 1 A task allocation flow chart of an embodiment of the present invention;
[0040] Figure 2 A schematic diagram of a single factor crossover according to an embodiment of the present invention;
[0041] Figure 3 A schematic diagram of a two-factor crossover according to an embodiment of the present invention;
[0042] Figure 4 The figure is a flow chart of the optimization of the adaptive algorithm according to the embodiment of the present invention. DETAILED DESCRIPTION
[0043] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0044] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0045] Embodiment 1
[0046] like Figure 1-2 As shown, this embodiment provides a method for allocating tasks of multiple agricultural machines based on improved linear adaptive genetics, including:
[0047] The multiple agricultural machines are an agricultural machine group, which is at least five agricultural machines, and the multi-agricultural machine task allocation method is based on an improved linear adaptive strategy to perform task allocation on the agricultural machine group, including the following:
[0048] S100, constructing a multi-agricultural machinery operation task set {S1, S2, S3} according to the operation scene of multiple agricultural machinery, and constructing a multi-agricultural machinery operation task site {Site1, Site2, Site3};
[0049] S200, constructing a multi-agricultural machinery task scheduling evaluation model according to the performance parameters of agricultural machinery operations;
[0050] S300, build a multi-agricultural machinery task scheduling system based on cloud service platform and wireless ad hoc network;
[0051] S400. When the information of the working plot and the working agricultural machinery are available and there are new tasks to be completed, the system can upload the information to the cloud service platform, allocate the new tasks through the improved linear adaptive genetic algorithm, and use the multi-agricultural machinery task scheduling evaluation model to evaluate the rationality of the allocated tasks, so as to obtain the optimal allocation result.
[0052] Furthermore, step S100 specifically includes:
[0053] S101, the operation task set of multiple agricultural machines includes: operation type type, operation area M1, M2, M3, and the number of operation plots num;
[0054] S102. The specific operation site of multiple agricultural machinery includes: ① Site number: 1, 2, 3... ② Site endpoint: (x1, y1), (x2, y2), (x3, y3), (x4, y4) ③ Endpoint of the field: (x5, y5), (x6, y6), (x7, y7), (x8, y8) ④ Entrance endpoint: (x9, y9), (x 10 ,y 10 ),(x 11 ,y 11 ),(x 12 ,y 12 )⑤The end point of the obstacle: (x 13 ,y 13 ),(x 14 ,y 14 ),(x 15 ,y 15 ),(x 16 ,y 16 );⑥The endpoints of the site entrance and exit: (x 17 ,y 17 ),(x 18 ,y 18 );
[0055] Furthermore, step S200 specifically includes:
[0056] S201. Define parameters, define symbols, set multiple agricultural machines of the specified target to start working at the same time, and stop working after the agricultural machines have finished working.
[0057] Performance parameters of agricultural machinery: num_ma represents the number of agricultural machinery, the set {a1, a2, .... anum_ma} represents num_ma agricultural machinery, num_rows represents the number of rows of operation, the set {v1, v2, ... vnum_ma} represents the speed of num_ma agricultural machinery, longshu represents the number of ridges of operation, and Ti represents the i-th operation task. The performance parameters of the i-th agricultural machinery can be expressed as a = {v i ,d i ,w,t i}(i=1,2,m), where v i represents the average speed of the i-th agricultural machine (km / h), d i represents the operating width of the i-th agricultural machine (m), t i represents the completion time of the i-th agricultural machine operation (h).
[0058] S202, the multi-agricultural machinery task scheduling evaluation model includes a cost function and constraint conditions,
[0059] The cost function includes:
[0060] Among them, f is the function of collaborative cost, f_cost is the minimum cost, α, β and γ are weight coefficients, t i is the operation time of the i-th agricultural machine, task_pre is the percentage of the workload, S i is the operating distance of the i-th agricultural machine.
[0061] S203, calculate the operation time of a single agricultural machine, the operation time consists of two parts, namely ti = ti 直 +ti 转 ;
[0062] where t i Straight is the time that the agricultural machinery works in a straight line in the field, t i直 It is directly related to the ridge length and the number of ridges operated, m, and the ridge length is L. d , the speed of the agricultural machinery is v i , then we have:
[0063] Turning operation time t i转 The working width W of the agricultural machinery and the turning speed v 转 , related to the turning radius R.
[0064] S204, calculating the operation distance S of the agricultural machine i The operation distance of a single agricultural machine also consists of two parts, namely S i =S i直 +S i转 , where S i Straight is the distance that the agricultural machinery operates in a straight line in the field, S i The length is directly related to the ridge length and the number of ridges operated, m, and the ridge length is L. d , then we have: S i直 =m×L d ;
[0065] There are two cases for turning operation: Case 1: Turning when the field boundary is perpendicular to the operation path, the turning radius R = W / 2, where W is the operation width of the agricultural machinery, and the theoretical length of the turning path is
[0066]
[0067] Case 2: When the headland boundary is not perpendicular to the working path, the angle between the headland boundary and the working path is θ, and the straight line travel of the turning path is recorded as △, Δ = Wcotθ, and the theoretical length of the turning path is:
[0068] S205, calculate the percentage of the amount of work done by the agricultural machinery: suppose the amount of task assigned at the beginning is task_arr, and the amount of task at a certain moment is tem_task. Then the percentage of the amount of work done by the agricultural machinery is:
[0069]
[0070] Further, the constraint conditions include:
[0071] (1) The performance parameters of the agricultural machinery, such as the time and speed for operating one ridge, are known;
[0072] (2) The amount of tasks to be performed before the agricultural machinery operation is known;
[0073] (3) The number n of agricultural machinery is less than or equal to the amount of tasks m to be completed, i.e., n ≤ m;
[0074] (4) One agricultural machinery is responsible for one task, i.e., one agricultural machinery operates on one area;
[0075] Further, in step S202, only considering the single-factor case, taking [α, β, γ] = [1, 0, 0], which is the maximum operation time of the agricultural machinery, a multi-machine collaborative cost function is constructed at the cost of the longest operation time of the agricultural machinery: f = max(t i ), and the objective function is to minimize the cost, i.e., min(f) = min(max(t i ));
[0076] Further, the improved linear adaptive genetic algorithm described in step S400 includes:
[0077] S401. Generate an initial population of N according to the coding method, define the crossover probability Pm, the mutation probability Pe, and the number of iterations K of the genetic algorithm;
[0078] S402. Perform genetic operations in the order of a random sequence. Generate a random sequence Rr and specify a threshold Re;
[0079] And Rr ∈ [0, 1). If Rr < Re, then crossover occurs; otherwise, if Rr > Re, no crossover occurs;
[0080] S403. Generate a random number Rm, Rm ∈ [0, 1), from the first generation of offspring. If Rm < Pe, then this individual performs the mutation operation; otherwise, this individual remains unchanged. Calculate the fitness function of the individual and repeat this step.
[0081] S404. Adopt the elitist strategy, update the optimal solution, select the optimal individual, and update the offspring population;
[0082] S405. Update the offspring population, set limits on the mutation rate and the selection rate, and specify the maximum mutation probability, the minimum mutation probability, the maximum selection probability, and the minimum selection probability;
[0083] S406. Adopt an improved adaptive strategy to change the probabilities of crossover and mutation according to the fitness value. The change of the crossover probability is as follows:
[0084]
[0085] The change of the mutation probability is as follows:
[0086]
[0087] Among them, P cmax , P cmin respectively represent the maximum and minimum values of the crossover probability, f max is the maximum value of the population fitness value, f min is the minimum value of the population fitness value, f avg represents the average value of the population fitness value, and f(i) is the fitness value of the current i-th individual. P mmax , P mmin respectively represent the maximum and minimum values of the mutation probability.
[0088] Update the optimal solution, select the optimal individual, and update the offspring population;
[0089] S407. Judge whether the iteration times are reached. If the iteration times are not reached, return to step S402. If the iteration times are reached, select the individual with the highest fitness value in the current population as the solution for this task assignment, and output the optimal result at the same time.
[0090] Furthermore, S402 may further include: selecting based on the roulette wheel method to obtain the parent generation and a random sequence from 1 to m, specifying a threshold Re, and Rr ∈ [0, 1). If Rr < Re, single-factor crossover occurs. On the contrary, if Rr > Re, then two-factor crossover is performed. Finally, the offspring individuals after crossover are obtained. The single-factor crossover is as shown in Figure 2 and the two-factor crossover is as shown in Figure 3 .
[0091] Furthermore, S403 may further include: during the gene coding process, mutate these genes that exceed the range. The mutation method is determined by the following formula:
[0092]
[0093] is the upper and lower limit intervals of the mutation rate;
[0094] Furthermore, S406 may further include: when adopting the cosine-improved adaptive strategy in combination with the crossover and mutation operators, the probabilities or parameters of crossover and mutation can be dynamically adjusted when generating new individuals, so that the algorithm can better adapt to the current training situation. The improvement method is determined by the following formula:
[0095] Changes in crossover probability:
[0096]
[0097] Changes in mutation probability:
[0098]
[0099] Among them, P cmax , P cmin Respectively represent the maximum and minimum values of the crossover probability, f max is the maximum value of population fitness, f min is the minimum value of population fitness, f avg represents the average value of the population fitness, and f(i) is the current fitness value of the i-th individual. mmax , P mmin They represent the maximum and minimum values of the mutation probability respectively.
[0100] Furthermore, the improved linear adaptive genetic multi-agricultural machinery task scheduling system described in step S300 includes an agricultural machinery end, a server end and a client end. The agricultural machinery itself carries a GPS system and a set of self-organizing network communication systems, which are for realizing real-time positioning of agricultural machinery and interactive communication with other agricultural machinery; the server end contains a storage function for storing the historical trajectory of the agricultural machinery, the real-time status information of the agricultural machinery and the experimental plot information; the client end is used to issue instructions and tasks to the agricultural machinery.
[0101] The above are only preferred specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for allocating tasks of multiple agricultural machinery based on improved linear adaptive genetic algorithm, characterized in that: It includes the following steps: Construct a multi - agricultural - machine operation task set and the operation task sites of multi - agricultural machines based on the operation scenarios of multi - agricultural machines, and construct an input data set based on the multi - agricultural - machine operation task set and the operation task sites of multi - agricultural machines; Construct a multi - agricultural - machine task scheduling evaluation model based on the performance parameters of agricultural machines; Construct an improved linear adaptive genetic algorithm, input the input data set into the improved linear adaptive genetic algorithm for iterative optimization and allocation calculation, and obtain an adaptive optimal allocation result; Input the adaptive optimal allocation result into the multi - agricultural - machine task scheduling evaluation model to evaluate the rationality of the allocated tasks, and generate an optimal allocation result.
2. The method for allocating multiple agricultural machinery tasks based on improved linear adaptive genetic algorithm according to claim 1 is characterized in that: The multi - agricultural - machine operation task set includes operation types, operation areas, and the number of plots for operation; The operation task sites of the multi - agricultural machines include site numbers, site endpoints, endpoints of field heads, entrance endpoints, and endpoints of obstacles.
3. The method for allocating multiple agricultural machinery tasks based on improved linear adaptive genetic algorithm according to claim 1 is characterized in that: In the multi - agricultural - machine task scheduling evaluation model, the expression of the cost function is: where f is the function of collaborative cost, f_cost is the minimum cost, α, β, and γ are weight coefficients, ti is the operation time of the i - th agricultural machine, task_pre is the percentage of the completed workload, and Si is the operation distance of the i - th agricultural machine.
4. The method for allocating tasks of multiple agricultural machines based on improved linear adaptive genetic algorithm according to claim 1 is characterized in that: In the multi - agricultural - machine task scheduling evaluation model, the constraint conditions include: the performance parameters of agricultural machines are known, the amount of tasks required before the operation of agricultural machines is known, the number of agricultural machines is less than or equal to the amount of tasks to be completed, and one agricultural machine is responsible for one operation task.
5. The method for allocating tasks of multiple agricultural machines based on improved linear adaptive genetic algorithm according to claim 1 is characterized in that: The operation process of the improved linear adaptive genetic algorithm includes: Generate an initial population of size N using binary coding, define the crossover probability Pm, the mutation probability Pe, and the number of iterations K of the genetic algorithm; Perform genetic iterations based on the order of a random sequence: Generate a random sequence Rr, and specify a threshold Re, and Rr ∈ [0, 1). If Rr < Re, then crossover occurs; otherwise, if Rr > Re, then no crossover occurs; From the first generation of offspring, generate a random number Rm, Rm ∈ [0, 1). If Rm < Pe, then this individual performs mutation operation; otherwise, this individual remains unchanged. Calculate the fitness function of the individual, and repeat this step; Adopt an elitist strategy to update the optimal solution of each generation of the population, select the optimal individual, and update the offspring population; Update the offspring population, set the thresholds of the mutation rate and the selection rate, and specify the maximum mutation probability, the minimum mutation probability, the maximum selection probability, and the minimum selection probability; Adopt an improved adaptive strategy to dynamically change the crossover probability and the mutation probability according to the fitness; Update the optimal solution, select the optimal individual, and update the offspring population. If the number of iterations is reached, then select the individual with the highest fitness in the current population as the solution for this task allocation, and output the optimal result at the same time.
6. The method for allocating tasks of multiple agricultural machines based on improved linear adaptive genetic algorithm according to claim 5 is characterized in that: The process of performing genetic based on the order of a random sequence also includes: Select based on the roulette - wheel method to obtain the parent generation and a random sequence from 1 to m, specify the crossover threshold Re, and Rr ∈ [0, 1). If Rr < Re, then single - factor crossover occurs; if Rr > Re, then two - factor crossover occurs to obtain the offspring individuals after crossover.
7. The method for allocating tasks of multiple agricultural machines based on improved linear adaptive genetic algorithm according to claim 5 is characterized in that: The process of adopting the elite strategy, updating the optimal solution, selecting the optimal individual, and updating the offspring population also includes: in the process of gene encoding, mutating the genes that are out of range, and the expression for mutating the genes that are out of range is: in, is the upper and lower limits of the mutation rate.
8. The method for allocating tasks of multiple agricultural machines based on improved linear adaptive genetic algorithm according to claim 5 is characterized in that: The process of changing the crossover probability and mutation probability according to the fitness by using the improved adaptive strategy also includes: dynamically adjusting the crossover and mutation probabilities or parameters when generating new individuals by using the cosine improved adaptive strategy in combination with the crossover and mutation operators; The expression for the probability of adjusting crossover is: The expression for adjusting the probability of mutation is: Among them, P cmax , P cmin Respectively represent the maximum and minimum values of the crossover probability, f max is the maximum value of population fitness, f min is the minimum value of population fitness, f avg represents the average value of the population fitness, f(i) is the current value of the fitness of the i-th individual, P mmax , P mmin They represent the maximum and minimum values of the mutation probability respectively.