Livestock grazing path planning method, device, electronic device and storage medium

By optimizing the ant colony algorithm, combining the target heuristic factor and comprehensive performance index, the problem of low efficiency in traditional grazing path planning is solved, and the optimal grazing path planning for obstacle avoidance and drinking water needs in grassland ecosystems is realized, which improves grazing efficiency and ecological protection.

CN118863202BActive Publication Date: 2025-08-22INST OF AGRI RESOURCES & REGIONAL PLANNING CHINESE ACADEMY OF AGRI SCI
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410987912.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2025-08-22
Estimated Expiration
2044-07-23

AI Technical Summary

Technical Problem

Traditional grazing path planning methods are inefficient and difficult to effectively avoid grazing prohibited areas and ensure drinking water needs in grassland ecosystems, resulting in excessive grazing and weakening of ecological functions.

Method used

The optimized ant colony algorithm is adopted, combined with the target heuristic factor and comprehensive performance index, and the calculation of the probability of transfer from the node and the incremental update of global pheromone concentration is planned, the optimal grazing path is avoided, and the distance from the drinking water point is minimized.

Benefits of technology

It improves the efficiency of grazing path planning, ensures that livestock can safely and effectively reach drinking water points in complex grassland environments, reduces overgrazing, and protects grassland ecosystems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118863202B_ABST
    Figure CN118863202B_ABST
Patent Text Reader

Abstract

The present invention provides a livestock grazing path planning method, device, electronic device, and storage medium, relating to the field of electronic digital data processing technology. The method comprises: establishing a grazing path planning objective function with the goals of minimizing the total length of the grazing path and minimizing the distance between the grazing path and the drinking water point; and using an optimized ant colony algorithm to calculate the grazing path planning objective function based on the location information of the drinking water points, grazing prohibited areas, grazing starting points, and grazing ending points in the target grazing area, as well as the location information of each grazing access point, to obtain the optimal grazing path for the livestock to be grazed within the target grazing area. The livestock grazing path planning method, device, electronic device, and storage medium provided by the present invention optimize the traditional ant colony algorithm by improving heuristic factors, introducing multi-objective optimization, and optimizing the global pheromone concentration update method. The optimized ant colony algorithm can effectively improve the efficiency of grazing path planning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic digital data processing, and in particular to a livestock grazing path planning method, device, electronic equipment and storage medium. Background Art

[0002] Grassland is an important part of the terrestrial ecosystem and plays a vital role in ecological security and animal husbandry development.

[0003] However, overgrazing and indiscriminate grazing have seriously exacerbated grassland degradation and weakened its ecological functions. Therefore, scientifically guiding grazing activities is crucial for monitoring and utilizing the entire grassland ecosystem.

[0004] However, the efficiency of traditional grazing path planning methods in related technologies is low. Therefore, how to improve the efficiency of grazing path planning is a technical problem that needs to be solved urgently in this field. Summary of the Invention

[0005] The present invention provides a livestock grazing path planning method, device, electronic device and storage medium, which are used to solve the defect of low grazing path planning efficiency of traditional grazing path planning methods in the prior art, and improve the grazing path planning efficiency.

[0006] The present invention provides a livestock grazing path planning method, comprising the following steps.

[0007] The objective function of grazing path planning is established with the goal of minimizing the total length of the grazing path and the distance between the grazing path and the drinking point.

[0008] Based on the location information of drinking water points, grazing prohibition areas, grazing starting points and grazing ending points in the target grazing area, as well as the location information of each grazing access point, the grazing path planning objective function is solved by an optimized ant colony algorithm to obtain the optimal grazing path for the livestock to be grazed in the target grazing area.

[0009] Among them, the target heuristic factor is introduced into the optimized ant colony algorithm to calculate the transfer probability of ants from any node to another node, and the optimized ant colony algorithm introduces a comprehensive performance index to update the global pheromone concentration increment after each iterative calculation; the target heuristic factor is determined based on the distance between any node and the grazing ban area closest to any node and the minimum radius of the livestock to be grazed starting from any node and bypassing the grazing ban area closest to any node; the comprehensive performance index is determined based on the function value of the grazing path planning objective function.

[0010] According to a livestock grazing path planning method provided by the present invention, based on the location information of drinking water points, grazing prohibited areas, grazing starting points, and grazing ending points in a target grazing area, as well as the location information of each grazing access point, an optimized ant colony algorithm is used to solve the grazing path planning objective function to obtain an optimal grazing path for the livestock to be grazed in the target grazing area, including:

[0011] acquiring an environmental map of the target grazing area based on a remote sensing image of the target grazing area;

[0012] Initializing parameters of the optimized ant colony algorithm, determining a starting node and an ending node in the environmental map based on the location information of the grazing starting point and the grazing ending point, determining each node in the environmental map based on the location information of each grazing access point, determining a drinking water node in the environmental map based on the location information of the drinking water point, and determining a prohibited grazing area and a prohibited grazing node in the environmental map based on the location information of the prohibited grazing area, wherein the parameters include the number of ants, the number of nodes on the grazing path, the maximum number of iterations, and various weight coefficients;

[0013] In this iterative calculation, after all ants are placed at the starting node, if any ant has not reached the ending node, a target heuristic factor corresponding to the node where any ant is currently located is determined based on the distance between the node where any ant is currently located and the prohibited grazing node closest to the node where any ant is currently located, and the minimum radius of the livestock to be grazed starting from the node where any ant is currently located and circumventing the prohibited grazing area closest to the node where any ant is currently located is determined; based on the target heuristic factor corresponding to the node where any ant is currently located, a transition probability of any ant from the node where any ant is currently located to each optional node is calculated; based on the transition probability of any ant from the node where any ant is currently located to each optional node, a next node to which any ant is to go is determined; the pheromone concentration on the path from the node where any ant is currently located to the next node to which any ant is to go is updated; and if it is determined that each ant has reached the ending node, a candidate grazing path obtained by this iterative calculation is obtained, and a function value of the grazing path planning objective function corresponding to the candidate grazing path obtained by this iterative calculation is obtained;

[0014] If the cumulative number of iterations does not reach the maximum number of iterations, obtaining a comprehensive performance index corresponding to the iterative calculation based on the function value of the grazing path planning objective function corresponding to the iterative calculation, updating the global pheromone concentration increment based on the comprehensive performance index corresponding to the iterative calculation, and then performing the next iterative calculation based on the updated global pheromone concentration increment until the cumulative number of iterations reaches the maximum number of iterations;

[0015] According to a livestock grazing path planning method provided by the present invention, the method determines a target heuristic factor corresponding to the node where any ant is currently located based on the distance between the node where any ant is currently located and the grazing prohibited node closest to the node where any ant is currently located, and the minimum radius of the livestock to be grazed that circumvents the grazing prohibited area closest to the node where any ant is currently located, including:

[0016] When the distance between the node where any ant is currently located and the forbidden grazing node closest to the node where any ant is currently located is greater than a first safety distance threshold, the target heuristic factor corresponding to the node where any ant is currently located is determined to be 1; when the distance between the node where any ant is currently located and the forbidden grazing node closest to the node where any ant is currently located is less than a second safety distance threshold, the target heuristic factor corresponding to the node where any ant is currently located is determined to be 0; when the distance between the node where any ant is currently located and the forbidden grazing node closest to the node where any ant is currently located is not greater than the first safety distance threshold and not less than the second safety distance threshold, half of the ratio of the distance between the node where any ant is currently located and the forbidden grazing node closest to the node where any ant is currently located to the minimum radius of the livestock to be grazed starting from the node where any ant is currently located and bypassing the forbidden grazing area closest to the node where any ant is currently located is determined as the target heuristic factor corresponding to the node where any ant is currently located;

[0017] The second safety distance threshold is smaller than the first safety distance threshold, and the second safety distance threshold and the first safety distance threshold are determined based on the minimum radius of the grazing ban area closest to the node where any ant is currently located, starting from the node where any ant is currently located.

[0018] According to a livestock grazing path planning method provided by the present invention, the method establishes a grazing path planning objective function with the goals of minimizing the total length of the grazing path and minimizing the distance between the grazing path and the drinking point, comprising: constructing a first sub-objective function of the grazing path planning objective function with the shortest total length of the grazing path as the planning objective, and constructing a second sub-objective function of the grazing path planning objective function with the minimum distance between the grazing path and the drinking point as the planning objective;

[0019] The formula of the first sub-objective function is expressed as:

[0020]

[0021]

[0022] in, represents the total number of nodes on the grazing path; Indicates the number of iterative calculations; Indicates the The first iteration calculates the corresponding candidate grazing path nodes; express The coordinate value of Indicates the The first iteration calculates the corresponding candidate grazing path nodes; express The coordinate value of Represents a slave node To Node The Euclidean distance of Indicates the The function value of the first sub-objective function corresponding to the candidate grazing path obtained by iterative calculation;

[0023] The formula of the second sub-objective function is expressed as:

[0024]

[0025]

[0026] in, Representation node Distance Node distance to the nearest water point; Indicates that the livestock to be grazed are from node Departure to bypass distance node the minimum radius of the nearest grazing ban area; Indicates the distance node The location coordinates of the nearest water point; Indicates the The function value of the second sub-objective function corresponding to the candidate grazing path obtained by the iteration;

[0027] The formula of the grazing path planning objective function is expressed as:

[0028]

[0029] in, Indicates the The function value of the grazing path planning objective function corresponding to the candidate grazing path obtained by iterative calculation.

[0030] According to a livestock grazing path planning method provided by the present invention, obtaining a comprehensive performance index corresponding to this iterative calculation based on the function value of the grazing path planning objective function corresponding to this iterative calculation includes:

[0031] Calculate the product of the function value of the first sub-objective function corresponding to the current iterative calculation and the first weight coefficient among the weight coefficients as the first intermediate result of the comprehensive performance index corresponding to the current iterative calculation; calculate the product of the function value of the second sub-objective function corresponding to the current iterative calculation and the second weight coefficient among the weight coefficients as the second intermediate result of the comprehensive performance index corresponding to the current iterative calculation;

[0032] After calculating the first intermediate result and the second intermediate result of the comprehensive performance index corresponding to this iterative calculation, they are used as the comprehensive performance index corresponding to this iterative calculation.

[0033] According to a livestock grazing path planning method provided by the present invention, the updating of the global pheromone concentration increment based on the comprehensive performance index corresponding to the current iterative calculation includes:

[0034] Based on the pheromone concentrations left by each ant on all candidate grazing paths calculated in this iteration, the updated global pheromone concentration increment is obtained.

[0035] According to a livestock grazing route planning method provided by the present invention, each grazing access point is determined based on the following steps:

[0036] Acquire remote sensing images of the target grazing area, characteristic information of each livestock to be grazed, and planning targets for each grazing route, wherein the characteristic information includes growth period information and health information;

[0037] Based on the remote sensing image, the target grazing area is divided into blocks of different forage grades, and based on characteristic information of each of the livestock to be grazed, the livestock to be grazed are grouped to obtain a group of livestock to be grazed corresponding to each forage grade, wherein the number of blocks of any one of the forage grades in the target grazing area is multiple;

[0038] Constructing an objective function corresponding to each grazing path planning objective, and for each forage grade, obtaining a cruising order of the livestock group to be grazed corresponding to each forage grade in the blocks of each forage grade based on a multi-objective dynamic programming algorithm and the objective function corresponding to each grazing path planning objective;

[0039] Based on the cruising sequence of the blocks of each forage grade, a grazing path for the livestock group to be grazed corresponding to each forage grade is determined.

[0040] The present invention also provides a livestock grazing path planning device, comprising the following modules:

[0041] The function building module is used to establish the grazing path planning objective function with the goal of minimizing the total length of the grazing path and minimizing the distance between the grazing path and the drinking point.

[0042] The path planning module is used to solve the grazing path planning objective function using an optimized ant colony algorithm based on the location information of drinking water points, grazing prohibited areas, grazing starting points, and grazing ending points in the target grazing area, as well as the location information of each grazing access point, to obtain the optimal grazing path for the livestock to be grazed in the target grazing area.

[0043] Among them, the target heuristic factor is introduced into the optimized ant colony algorithm to calculate the transfer probability of ants from any node to another node, and the optimized ant colony algorithm introduces a comprehensive performance index to update the global pheromone concentration increment after each iterative calculation; the target heuristic factor is determined based on the distance between any node and the grazing ban area closest to any node and the minimum radius of the livestock to be grazed starting from any node and bypassing the grazing ban area closest to any node; the comprehensive performance index is determined based on the function value of the grazing path planning objective function.

[0044] The present invention also provides an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the livestock grazing path planning methods described above is implemented.

[0045] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the livestock grazing path planning methods described above.

[0046] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements any of the livestock grazing path planning methods described above.

[0047] The livestock grazing path planning method, device, electronic device and storage medium provided by the present invention establish a grazing path planning objective function with the goal of minimizing the total length of the grazing path and minimizing the distance between the grazing path and the drinking water point. Based on the location information of the drinking water points, grazing prohibited areas, grazing starting points and grazing ending points in the target grazing area, and the location information of each grazing access point, the grazing path planning objective function is solved by an optimized ant colony algorithm to obtain the optimal grazing path for the livestock to be grazed in the target grazing area. The optimized ant colony algorithm introduces a target heuristic factor to calculate the transfer probability of ants from any node to another node. The optimized ant colony algorithm introduces a comprehensive performance index to update the global pheromone concentration increment after each iterative calculation. The target heuristic factor is used to calculate the transfer probability of ants from any node to another node. The optimized ant colony algorithm introduces a comprehensive performance index to update the global pheromone concentration increment after each iterative calculation. The factor is determined based on the distance between any node and the nearest grazing ban area from any node, and the minimum radius of the livestock to be grazed starting from any node and bypassing the nearest grazing ban area from any node. The comprehensive performance index is determined based on the function value of the grazing path planning objective function. By improving the heuristic factor, introducing multi-objective optimization, and optimizing the global pheromone concentration update method, the traditional ant colony algorithm is optimized. The optimized ant colony algorithm can effectively solve technical problems such as low grazing path planning efficiency and disordered planned grazing paths, effectively improve the grazing path planning efficiency, and more efficiently obtain the optimal grazing path planning in complex scenarios. It can better solve the problems of overgrazing and targetless grazing, and provide technical support for environmental protection and sustainable utilization of grassland resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0049] Figure 1 It is a flow chart of the livestock grazing path planning method provided by the present invention.

[0050] Figure 2 This is an example diagram of the locations of drinking water points, prohibited grazing areas, grazing starting points, and grazing access points in the target grazing area in the livestock grazing path planning method provided by the present invention.

[0051] Figure 3 This is a technical flow chart of livestock grazing path planning based on the optimized ant colony algorithm in the livestock grazing path planning method provided by the present invention.

[0052] Figure 4It is a schematic diagram of the area of ​​each forage grade in the target grazing area in the livestock grazing path planning method provided by the present invention.

[0053] Figure 5 It is a structural schematic diagram of the livestock grazing path planning device provided by the present invention.

[0054] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0055] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0056] In the description of the invention, it should be noted that, unless otherwise expressly specified or limited, the terms "mounted," "connected," and "connected" should be understood broadly. For example, they may refer to fixed, detachable, or integral connections; mechanical or electrical connections; direct or indirect connections through an intermediary; and internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on specific circumstances.

[0057] In the description of this application, the terms "first", "second", etc. are used to distinguish similar objects, and are not 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 this application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of the same type, and do not limit the number of objects. For example, the first object can be one or more. In addition, in the description of this application, "and / or" represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0058] It's important to note that grasslands are a vital component of terrestrial ecosystems, playing a crucial role in ecological security and animal husbandry development. Grassland quality and yield have a direct impact on both the economy and the ecology. However, overgrazing and indiscriminate grazing have severely exacerbated grassland degradation and weakened its ecological functions. Therefore, scientifically guiding grazing activities is crucial for monitoring and utilizing the entire grassland ecosystem.

[0059] In recent years, with the development of precision agriculture and animal husbandry, path planning algorithms have gained increasing attention in agricultural and animal husbandry management, particularly in grazing path planning. However, traditional path planning algorithms are difficult to directly apply to grazing scenarios and require improvements tailored to the specific characteristics of grazing tasks.

[0060] Ant Colony Optimization (ACO) is a heuristic algorithm that simulates the foraging behavior of ants in natural environments. In nature, ants release chemicals called pheromones along their paths as they search for food. Following ants sense the concentration of these pheromones and decide their own paths, collaboratively finding the shortest path without central control. This swarm intelligence-based behavior inspired the development of the ACO, which aims to solve complex optimization problems by simulating the collective optimization behavior of ants.

[0061] The design of the ant colony algorithm embodies several core features, most notably its distributed computing capabilities and probabilistic path selection strategy. These characteristics endow the ant colony algorithm with powerful capabilities in combinatorial optimization problems, enabling it to effectively find near-optimal solutions within the search space. The ant colony algorithm demonstrates significant advantages in solving problems such as the Traveling Salesman Problem (TSP). By simulating the indirect pheromone-based communication mechanism between individual ants, the algorithm is able to dynamically weigh multiple solutions, achieving a balance between global search and local exploration.

[0062] In addition, the ant colony algorithm has demonstrated its unique value in multiple application fields. In the field of logistics and transportation, the algorithm is widely used in path planning, vehicle scheduling, and cargo distribution, and can effectively optimize transportation efficiency and costs. In the field of network design, the ant colony algorithm can help design the optimal network topology and improve the communication efficiency of the network. At the same time, the algorithm has also demonstrated its potential application value in fields such as data mining, image processing, and machine learning, such as in feature selection, image segmentation, and classification problems. The reason why the ant colony algorithm can be widely used in these fields is because of its unique strategy of simulating the behavior of ants in nature. This strategy not only optimizes the search process, but also improves the quality of the solution.

[0063] The basic principle of the ant colony algorithm (ACO) is to solve problems by simulating the collective behavior of ants. The algorithm's core mechanisms include pheromone deposition and evaporation, probability-based state transition rules, and a pheromone update strategy. The detailed process and mathematical principles of the ACO are as follows.

[0064] The initialization step includes: at the beginning of the algorithm, the pheromone concentration on all paths is initialized to a very small positive value to ensure the exploration of the system. At the same time, a certain number of ants are randomly placed at the designated starting point.

[0065] The solution construction steps include: each ant selects its next node according to the transition probability until a complete path solution is constructed. The calculation of the transition probability is mainly based on its pheromone and the heuristic information of each path. Assuming that in a static known environment map, at time Located in Ants on a node Move to The process of each node is as follows. , Represents the total number of ants.

[0066] First, calculate the first The transition probability of each optional path around the node , and then the next node is determined by the roulette wheel selection mechanism: nodes. The calculation formula of the transition probability is as follows:

[0067] (1)

[0068] in, Indicates time From Node to Pheromone concentration of each node; The coefficient representing the pheromone concentration; The coefficient representing the heuristic information; Represents ants In the current An optional set of subsequent nodes around a node;

[0069] It should be noted that and The coefficients of pheromone concentration and heuristic information appear in the probability formula instead of a simple product. This is to more flexibly and effectively control the weight of the two in path selection. There are several reasons for this design: First, the flexibility of parameter adjustment: By using the power form, the algorithm designer can independently adjust the importance of pheromone and heuristic information. For example, when When (zero power is 1), path selection depends only on heuristic information; when When (zero power is 1), the path selection depends only on the pheromone concentration. and The value of can better control and optimize the algorithm performance at different stages of the search process.

[0070] Second, nonlinear effects: The power form can produce nonlinear effects, for example, when or When it is greater than 1, the influence of the corresponding factor will be amplified, which means that the probability of path selection will be more sensitive to changes in pheromone or heuristic information, thereby accelerating convergence. In some cases, nonlinear effects can help avoid local optimal solutions.

[0071] Indicates time From Node to The heuristic information of the path of the nodes is calculated as follows:

[0072] (2)

[0073] Where, For the Node to The Euclidean distance of the nodes.

[0074] The pheromone update step includes: every time all ants complete a complete solution construction, the pheromone concentration will be updated according to the path taken by the ants and the path quality. Node goes to The update of pheromone on the path segment when all ants search for a node can be expressed by formula (3). Global pheromone update refers to the update of pheromone on the entire path when all ants finish each round of iterative search, which can be expressed by formula (4) and formula (5).

[0075] (3)

[0076] (4)

[0077] (5)

[0078] Where, represents the local pheromone volatility coefficient; Indicates the initial value of pheromone; represents the global pheromone volatility coefficient, represents the pheromone residue factor; Indicates the path in the current iteration ( , ) on pheromones; Indicates the path in the current iteration ( , ) on the pheromone increment; represents the total number of ants; Represents ants In the path ( , )The concentration of pheromones left on the surface.

[0079] The ant-week model is used to calculate the pheromone concentration value. It can be calculated according to formula (6):

[0080] (6)

[0081] Where, represents the global pheromone constant; Represents ants The total length of the iterated path.

[0082] Roulette wheel selection, also known as proportional selection, is a selection strategy commonly used in ant colony algorithms and other heuristic algorithms. It is used to probabilistically select the next node from a set of candidate solutions. This mechanism simulates the rotation and selection process of a roulette wheel by assigning each candidate node a selection probability proportional to its pheromone concentration. This ensures that nodes with higher pheromone concentrations have a higher probability of being selected, while nodes with lower pheromone concentrations also have a chance of being retained, maintaining path selection diversity. The roulette wheel selection mechanism works as follows:

[0083] First, the pheromone concentration values ​​of all nodes are calculated. Pheromone concentration reflects the quality of candidate nodes; higher pheromone concentrations indicate a greater likelihood of selection. Second, each candidate node is assigned a selection probability proportional to its pheromone concentration.

[0084] The probability of selecting a candidate node The concentration of pheromone The sum of the pheromone concentrations of all candidate nodes The calculation formula is as follows:

[0085] (7)

[0086] Where, Indicates the The pheromone concentration of candidate nodes; is the total number of candidate nodes.

[0087] Calculate the cumulative probability of each candidate node to construct the roulette wheel. candidate nodes, and their cumulative probability Defined as front The sum of the probabilities of candidate nodes can be calculated using the following formula:

[0088] (8)

[0089] Randomly generate a number between 0 and 1 , select the first one that satisfies The candidate node is selected as the next node. This process simulates the rotation and stopping of the roulette wheel, where the cumulative probability is equivalent to the partition interval on the roulette wheel, and the random number This is equivalent to a stopping point. The key to the roulette wheel selection mechanism lies in the proportional relationship between pheromone concentration and selection probability. This ensures that nodes with high pheromone concentrations are more likely to be selected, thereby guiding the search process towards a more optimal solution. At the same time, due to the random nature of probabilistic selection, nodes with low pheromone concentrations also have a certain probability of being retained. This helps maintain path selection diversity and prevents the algorithm from prematurely falling into a local optimum.

[0090] However, grassland ecosystems have very rich biodiversity and complex ecological relationships. For example, there are some areas within the pasture that are not suitable for livestock to approach, such as degraded sand dunes, deep pits, and fences. These areas pose a threat to the health and safety of livestock, so they need to be set as grazing-prohibited areas. The traditional ant colony algorithm in the relevant technology does not have an obstacle avoidance function, which makes it difficult to achieve the purpose of prohibiting livestock from entering grazing-prohibited areas and reducing the probability of paths approaching grazing-prohibited areas when planning grazing paths based on the traditional ant colony algorithm in the relevant technology. For example, in the existing grazing model, herders are often required to guide livestock to fixed watering points for drinking water, but the traditional ant colony algorithm in the relevant technology is difficult to plan grazing paths passing through watering points according to actual conditions, which makes it difficult to ensure that livestock can replenish water in time during grazing when planning grazing paths based on the traditional ant colony algorithm in the relevant technology.

[0091] Therefore, the biodiversity and complex ecological relationships of grassland ecosystems make grazing path planning more complex, and the complexity of grazing path planning makes grazing path planning based on traditional algorithms such as ant colony algorithms inefficient.

[0092] The performance of the ant colony algorithm is affected by multiple factors, such as the pheromone evaporation rate, the choice of heuristic information, and the algorithm's parameter settings. Adjusting and optimizing these factors based on the specific problem can improve the algorithm's application effectiveness. Therefore, improving the ant colony algorithm, especially in specific environments, will further expand its application potential in solving complex path planning problems.

[0093] To address the complexity of grazing route planning, the present invention provides a livestock grazing route planning method based on an improved ant colony algorithm. This method takes into account factors such as animal husbandry habits and topography, optimizing the route planning process. By identifying high-quality grassland areas as patrol points using remote sensing data, efficient and accurate grazing route planning is achieved. Compared with traditional algorithms, this method can better address the problems of overgrazing and untargeted grazing, providing technical support for environmental protection and the sustainable use of grassland resources.

[0094] The following combination Figure 1 The livestock grazing path planning method of the present invention is described.

[0095] Figure 1 Schematic diagram of the livestock grazing path planning method provided by the present invention, such as Figure 1 As shown, the method includes the following steps: Step 101, establishing a grazing path planning objective function with the goal of minimizing the total length of the grazing path and minimizing the distance between the grazing path and the drinking point.

[0096] It should be noted that the embodiment of the present invention is implemented by a livestock grazing path planning device. The livestock grazing path planning device can be integrated into a user terminal. The user terminal can include a smartphone, a computer, a tablet computer, etc.

[0097] Specifically, the livestock to be grazed are the grazing objects of the planned grazing path in the grazing path planning method provided by the present invention, and the target grazing area is the grazing area of ​​the livestock to be grazed. Based on the livestock grazing path planning method provided by the present invention, a grazing path can be planned for the livestock to be grazed within the target grazing area.

[0098] The types of livestock to be grazed in the embodiment of the present invention may be cattle, sheep, horses, camels, etc.

[0099] It is understandable that the livestock to be grazed and the target grazing area in the embodiment of the present invention can be determined based on actual needs. The livestock to be grazed and the target grazing area in the embodiment of the present invention are not specifically limited.

[0100] Optionally, the target grazing area in the embodiment of the present invention may be an area covered by a family ranch, wherein a family ranch is a ranch operated and managed by a family as a unit.

[0101] It should be noted that a grazing path that is too long means that livestock need more time and energy to walk, which will increase the calories and water consumed by livestock, and have a negative impact on livestock health and productivity; a grazing path that is too long will cause livestock to graze for too long, thereby reducing grazing efficiency and reducing livestock production benefits; and a grazing path that is too long may lead to excessive use of certain areas, thereby affecting the vegetation and soil instructions in the above areas, exacerbating the problems of soil erosion and vegetation degradation.

[0102] Therefore, in the embodiment of the present invention, when planning grazing paths for livestock to be grazed in a target grazing area, the grazing target is to minimize the total length of the grazing paths.

[0103] It's important to note that livestock require regular watering during grazing to maintain their health and productivity. If the distance between grazing paths and watering points is too great, it increases the time and energy required for livestock to reach the watering points. Furthermore, excessive distances between grazing paths and watering points can lead to water shortages, impacting their health.

[0104] Therefore, in the embodiment of the present invention, when planning a grazing path for livestock to be grazed in a target grazing area, the grazing target is to minimize the distance between the grazing path and the drinking water point.

[0105] In the embodiment of the present invention, a grazing path planning objective function can be established by mathematical means, with the shortest total length of the grazing path and the smallest distance between the grazing path and the drinking water point as planning goals.

[0106] As an optional embodiment, a grazing path planning objective function is established with the goals of minimizing the total length of the grazing path and minimizing the distance between the grazing path and the drinking point, including: constructing a first sub-objective function in the grazing path planning objective function with the shortest total length of the grazing path as the planning goal, and constructing a second sub-objective function in the grazing path planning objective function with the minimum distance between the grazing path and the drinking point as the planning goal.

[0107] The formula of the first sub-objective function is expressed as:

[0108] (9)

[0109] (10)

[0110] in, represents the total number of nodes on the grazing path; Indicates the number of iterative calculations; Indicates the The first iteration calculates the corresponding candidate grazing path nodes; express The coordinate value of Indicates the The first iteration calculates the corresponding candidate grazing path nodes; express The coordinate value of Represents a slave node To Node The Euclidean distance of Indicates the The function value of the first sub-objective function corresponding to the candidate grazing path obtained by iterative calculation;

[0111] The formula of the second sub-objective function is expressed as:

[0112] (11)

[0113] (12)

[0114] in, Representation node Distance Node distance to the nearest water point; Indicates the livestock to be grazed from the node Departure to bypass distance node the minimum radius of the nearest grazing ban area; Indicates the distance node The location coordinates of the nearest water point; Indicates the The function value of the second sub-objective function corresponding to the candidate grazing path calculated by the iteration.

[0115] It should be noted that, in the embodiment of the present invention, the The function value of the second sub-objective function corresponding to the iteration calculation Determined as the The corresponding drinking frequency index is calculated for each iteration. This drinking frequency index ensures that all nodes on the livestock's grazing path are as close as possible to the drinking point, and that each node on the grazing path is linearly correlated with the distance to the drinking point. By setting an effective radius around the drinking point, this drinking frequency index can determine the livestock's proximity to a water source.

[0116] The formula of the grazing path planning objective function is expressed as:

[0117] (13)

[0118] in, Indicates the The function value of the grazing path planning objective function corresponding to the candidate grazing path obtained by iterative calculation.

[0119] Step 102: Based on the location information of drinking water points, grazing prohibited areas, grazing starting points, and grazing ending points in the target grazing area, as well as the location information of each grazing access point, the optimized ant colony algorithm is used to calculate the grazing path planning objective function to obtain the optimal grazing path for the livestock to be grazed in the target grazing area.

[0120] Among them, the target heuristic factor is introduced into the optimized ant colony algorithm to calculate the transfer probability of ants from any node to another node. The optimized ant colony algorithm introduces a comprehensive performance index to update the global pheromone concentration increment after each iterative calculation. The target heuristic factor is determined based on the distance between any node and the nearest grazing prohibited area from any node and the minimum radius of the livestock to be grazed starting from any node to bypass the nearest grazing prohibited area from any node. The comprehensive performance index is determined based on the function value of the grazing path planning objective function.

[0121] It should be noted that, in the embodiment of the present invention, the drinking water points, grazing prohibition areas, grazing starting points, and grazing visit points in the target grazing area may be predefined according to actual conditions.

[0122] Figure 2 This is an example diagram of the locations of drinking water points, prohibited grazing areas, grazing starting points, and grazing access points in the target grazing area in the livestock grazing path planning method provided by the present invention. The locations of drinking water points, prohibited grazing areas, grazing starting points, and grazing access points in the target grazing area can be as follows: Figure 2 shown.

[0123] It should be noted that Figure 2 The positions of the drinking water points, prohibited grazing areas, grazing starting points, and grazing access points in the target grazing area shown in FIG. 1 are merely examples. In the embodiment of the present invention, the positions of the drinking water points, prohibited grazing areas, grazing starting points, and grazing access points in the target grazing area are not specifically limited.

[0124] It should be noted that, in the embodiment of the present invention, the positions of the grazing start point and the grazing end point in the target grazing area may be the same or different.

[0125] In the embodiment of the present invention, the location information of the drinking water points, the prohibited grazing areas, the grazing starting point, and the grazing ending point in the target grazing area, as well as the location information of each grazing access point, can be obtained in a variety of ways. For example, in the embodiment of the present invention, the location information of the drinking water points, the prohibited grazing areas, the grazing starting point, and the grazing ending point in the target grazing area, as well as the location information of each grazing access point, can be obtained based on user input. Alternatively, in the embodiment of the present invention, the location information of the drinking water points, the prohibited grazing areas, the grazing starting point, and the grazing ending point in the target grazing area, as well as the location information of each grazing access point, can be received from other electronic devices.

[0126] Figure 3 This is a technical flow chart of livestock grazing path planning based on the optimized ant colony algorithm in the livestock grazing path planning method provided by the present invention. Figure 3 As shown, the embodiment of the present invention is based on the optimized ant colony algorithm. Starting from the grazing starting point in the target grazing area, it cruises through the grazing access points in the target grazing area, simulates grazing behavior, and finally reaches the grazing end point. The optimal grazing path in the target grazing area can be output.

[0127] The optimized ant colony algorithm in the embodiment of the present invention improves the adaptive target heuristic factor on the basis of the traditional ant colony algorithm, which is used to calculate the transition probability of ants from any node to another node, so that the planned optimal grazing path has the characteristics of automatic obstacle avoidance and efficient search.

[0128] The optimized ant colony algorithm in the embodiment of the present invention also adds a comprehensive performance index on the basis of the traditional ant colony algorithm to update the panoramic pheromone increment after each iterative calculation, so as to obtain the optimal grazing path that comprehensively meets the shortest total length of the grazing path and the smallest distance between the grazing path and the drinking water point according to actual needs.

[0129] As an optional embodiment, based on the location information of drinking water points, grazing prohibition areas, grazing starting points and grazing ending points in the target grazing area, as well as the location information of each grazing access point, an optimized ant colony algorithm is used to calculate the grazing path planning objective function to obtain the optimal grazing path for the livestock to be grazed in the target grazing area, including: obtaining an environmental map of the target grazing area based on remote sensing images of the target grazing area.

[0130] Specifically, in an embodiment of the present invention, remote sensing images of the target grazing area can be obtained in a variety of ways. For example, in an embodiment of the present invention, satellite remote sensing technology can be used to obtain remote sensing images of the target grazing area; or, in an embodiment of the present invention, drone technology can also be used to obtain remote sensing images of the target grazing area.

[0131] After obtaining the remote sensing image of the target grazing area, remote sensing inversion can be performed on the remote sensing image, and then an environmental map of the target grazing area can be constructed based on the remote sensing inversion result of the remote sensing image.

[0132] The parameters of the optimized ant colony algorithm are initialized. Based on the location information of the grazing starting point and the grazing ending point, the starting node and the ending node are determined in the environmental map. Based on the location information of each grazing access point, each node is determined in the environmental map. Based on the location information of the drinking water point, the drinking water node is determined in the environmental map. Based on the location information of the grazing prohibition area, the grazing prohibition area and the grazing prohibition node are determined in the environmental map. The parameters include the number of ants, the number of nodes on the grazing path, the maximum number of iterations and various weight coefficients.

[0133] Specifically, in an embodiment of the present invention, based on the mapping relationship between the environmental map of the target grazing area and the target grazing area, according to the position information of the grazing starting point of the livestock to be grazed in the target grazing area, the corresponding point of the above-mentioned grazing starting point in the above-mentioned environmental map can be determined as the starting node in the above-mentioned environmental map; according to the position information of the grazing ending point of the livestock to be grazed in the target grazing area, the corresponding point of the above-mentioned grazing starting point in the above-mentioned environmental map can be determined as the ending node in the above-mentioned environmental map; according to the position information of each grazing visit point of the livestock to be grazed in the target grazing area, the corresponding point of each grazing visit point in the above-mentioned environmental map can be determined as each node in the above-mentioned environmental map.

[0134] In the embodiment of the present invention, based on the location information of the drinking water points of the livestock to be grazed in the target grazing area, the corresponding points of the drinking water points in the environmental map may be determined as drinking water nodes in the environmental map.

[0135] In the embodiment of the present invention, based on the location information of the prohibited grazing area for livestock to be grazed in the target grazing area, the geometric center point of the corresponding area of ​​the prohibited grazing area in the environmental map can be determined as the prohibited grazing node in the environmental map.

[0136] In the embodiment of the present invention, Indicates the number of ants, using Indicates the number of nodes on the grazing path, and Indicates the maximum number of iterations, using 、 、 and Respectively represent the weight coefficients. In the embodiment of the present invention, Indicates the starting node in the above environment map, and Represents the terminal node in the above environment map.

[0137] It should be noted that the parameters of the optimized ant colony algorithm in the embodiment of the present invention may also include a global pheromone constant and a global pheromone volatility coefficient.

[0138] In this iterative calculation, after all ants are placed at the starting node, if any ant has not reached the ending node, the target heuristic factor corresponding to the node where any ant is currently located is determined based on the distance between the node where any ant is currently located and the grazing-prohibited node closest to the node where any ant is currently located, and the minimum radius of the livestock to be grazed starting from the node where any ant is currently located and bypassing the grazing-prohibited area closest to the node where any ant is currently located. Based on the target heuristic factor corresponding to the node where any ant is currently located, the transition probability of any ant from the current node to each optional node is calculated. Based on the transition probability of any ant from the current node to each optional node, the next node that any ant will go to is determined. The pheromone concentration on the path from the node where any ant is currently located to the next node that any ant will go to is updated. If it is determined that each ant has reached the ending node, the candidate grazing path obtained by this iterative calculation is obtained, and the function value of the grazing path planning objective function corresponding to the candidate grazing path obtained by this iterative calculation is obtained.

[0139] Specifically, in the After the first iteration calculation begins, you can Ants are placed at the starting node Among them, .

[0140] In the In the iterative calculation, for The first of the ants An ant, in the Ants have not reached the terminal node In the case of , if the current time is Moment, Only ants in The node at the moment is the first node in the above environment map nodes, then we can Nodes and distances The distance between the nearest grazing prohibition node and the distance between the livestock to be grazed and the nearest grazing prohibition node Starting from the node, bypassing the distance The minimum radius of the grazing ban area closest to each node is calculated by conditional judgment and numerical calculation. Only ants in The moment The target heuristic factor corresponding to each node.

[0141] It is understandable that the distance The nearest grazing prohibition node is the node The geometric center of the grazing ban area nearest to each node.

[0142] As an optional embodiment, a target heuristic factor corresponding to the node where any ant is currently located is determined based on the distance between the node where any ant is currently located and the forbidden grazing node closest to the node where any ant is currently located and the minimum radius of livestock to be grazed that circumvents the forbidden grazing area closest to the node where any ant is currently located, including: when the distance between the node where any ant is currently located and the forbidden grazing node closest to the node where any ant is currently located is greater than a first safety distance threshold, the target heuristic factor corresponding to the node where any ant is currently located is determined to be 1; when the distance between the node where any ant is currently located and the forbidden grazing node closest to the node where any ant is currently located is less than a second safety distance threshold, the target heuristic factor corresponding to the node where any ant is currently located is determined to be 0; when the distance between the node where any ant is currently located and the forbidden grazing node closest to the node where any ant is currently located is not greater than the first safety distance threshold and not less than the second safety distance threshold, half of the ratio of the distance between the node where any ant is currently located and the forbidden grazing node closest to the node where any ant is currently located to the minimum radius of livestock to be grazed that circumvents the forbidden grazing area closest to the node where any ant is currently located is determined as the target heuristic factor corresponding to the node where any ant is currently located.

[0143] The second safety distance threshold is smaller than the first safety distance threshold, and the second safety distance threshold and the first safety distance threshold are determined based on the minimum radius of the grazing ban area closest to the node where any ant is currently located, starting from the node where any ant is currently located.

[0144] Specifically, no. Only ants in The moment The target heuristic factor corresponding to each node can be calculated by the following formula:

[0145] (14)

[0146] in, Indicates the Only ants in The moment The target heuristic factor corresponding to each node; Indicates the distance The nearest grazing prohibition node; Indicates that from Node to grazing ban node The minimum distance; Indicates that the livestock to be grazed starts from Starting from the node, bypassing the distance The minimum radius of the grazing ban area closest to a node.

[0147] It should be noted that, in the embodiment of the present invention, the livestock to be grazed are Starting from the node, bypassing the distance The minimum radius of the grazing ban area closest to the node , can be calculated based on the distance The area of ​​the grazing ban area closest to each node and the data of livestock to be grazed are determined.

[0148] Optionally, the first safety distance threshold in the embodiment of the present invention is the distance between the livestock to be grazed and the first Starting from the node, bypassing the distance The minimum radius of the grazing ban area closest to the node The second safety distance threshold is the distance between the livestock to be grazed and the Starting from the node, bypassing the distance The minimum radius of the grazing ban area closest to the node .

[0149] From formula (14), we can see that in the Node to grazing ban node The minimum distance Larger than the livestock to be grazed from the Starting from the node, bypassing the distance The minimum radius of the grazing ban area closest to the node In the case of 2 times Only ants in The moment The target heuristic factor corresponding to each node Assigned a value of 1, indicating that Only ants in The moment The target heuristic factor corresponding to each node There is no effect on the transition probability.

[0150] In the Node to grazing ban node The minimum distance Smaller than the livestock to be grazed from the Starting from the node, bypassing the distance The minimum radius of the grazing ban area closest to the node In the case of Only ants in The moment The target heuristic factor corresponding to each node A value of 0 indicates that the path to a certain node is excluded from the optional paths.

[0151] In the Node to grazing ban node The minimum distance No less than the livestock to be grazed from the Starting from the node, bypassing the distance The minimum radius of the grazing ban area closest to the node , and the first Node to grazing ban node The minimum distance No more than the livestock to be grazed from the Starting from the node, bypassing the distance The minimum radius of the grazing ban area closest to the node In the case of 2 times Only ants in The moment The target heuristic factor corresponding to each node In the range of [0.5,1], Node to grazing ban node The minimum distance There is a linear relationship and it is monotonically increasing.

[0152] Specifically, in the embodiment of the present invention, the first The node that the ants have not walked through is determined as the The optional node of the ant. In the embodiment of the present invention, Indicates the A collection of optional nodes for ants.

[0153] If the above environment map The node is There are only ants with optional nodes, then Ants The moment Nodes go to The transition probability of a node can be calculated by the following formula:

[0154] (15)

[0155] in, Indicates the Ants The moment Nodes go to The transition probability of each node; and Represent each weight coefficient respectively; Indicates time No. Node to The pheromone concentration on the path of each node; Indicates time From Node to Heuristic information on the paths between nodes.

[0156] (16)

[0157] in, Indicates that from Node to The Euclidean distance of the nodes.

[0158] Get the Ants The moment After the transition probability of each node to each optional node is calculated, the Ants The moment The transfer probability of a node to each optional node is determined by the roulette wheel selection mechanism. Ants The moment The next node that the node will go to.

[0159] In the ant colony algorithm, each ant's movement can be based on a roulette wheel algorithm. The ant colony algorithm must strike a balance between exploring new paths and leveraging existing good paths. The roulette wheel algorithm randomly selects paths based on the probability of selection of different paths. This can lead to either a high-probability path (leveraging existing information) or a low-probability path (exploring new paths). This balance is crucial to the algorithm's global search capabilities and helps avoid being trapped in local optimal solutions.

[0160] It should be noted that, for the convenience of description, the embodiment of the present invention will be Ants The moment The node determines the next node to go to as the first node in the above environment map. nodes.

[0161] In determining the Ants The moment The next node that the node will go to is the node in the above environment map. After the node, you can also update the Node to The pheromone concentration on the path of nodes.

[0162] In the In the iterative calculation, after ensuring that each ant reaches the terminal node In this case, you can get the The corresponding candidate grazing path is calculated in the first iteration. The candidate grazing path corresponding to the first iteration can be calculated by numerical calculation based on formula (11) to formula (13) to obtain the The function value of the corresponding grazing path planning objective function is calculated by iteration .

[0163] When the cumulative number of iterations has not reached the maximum number of iterations, the comprehensive performance index corresponding to this iterative calculation is obtained based on the function value of the grazing path planning objective function corresponding to this iterative calculation, and the global pheromone concentration increment is updated based on the comprehensive performance index corresponding to this iterative calculation. Then, the next iterative calculation is performed based on the updated global pheromone concentration increment until the cumulative number of iterations reaches the maximum number of iterations.

[0164] Specifically, in In the case of The function value of the first sub-objective function corresponding to the iteration calculation Hedi The function value of the second sub-objective function corresponding to the iteration calculation , we can calculate the first The comprehensive performance index corresponding to the iteration calculation is calculated.

[0165] As an optional embodiment, based on the function value of the grazing path planning objective function corresponding to this iterative calculation, the comprehensive performance index corresponding to this iterative calculation is obtained, including: calculating the product of the function value of the first sub-objective function corresponding to this iterative calculation and the first weight coefficient among each weight coefficient, as the first intermediate result of the comprehensive performance index corresponding to this iterative calculation; calculating the product of the function value of the second sub-objective function corresponding to this iterative calculation and the second weight coefficient among each weight coefficient, as the second intermediate result of the comprehensive performance index corresponding to this iterative calculation.

[0166] After calculating the first intermediate result and the second intermediate result of the comprehensive performance index corresponding to this iterative calculation, they are used as the comprehensive performance index corresponding to this iterative calculation.

[0167] Specifically, based on the The function value of the first sub-objective function corresponding to the iteration calculation Hedi The function value of the second sub-objective function corresponding to the iteration calculation , can be calculated by the following formula The comprehensive performance index corresponding to the iteration calculation is calculated.

[0168] (17)

[0169] in, Indicates the The comprehensive performance index corresponding to the iteration calculation; Represents the weight coefficient corresponding to the first sub-objective function; Represents the weight coefficient corresponding to the second sub-objective function.

[0170] As an optional embodiment, updating the global pheromone concentration increment based on the comprehensive performance index corresponding to this iterative calculation includes: obtaining an updated global pheromone concentration increment based on the pheromone concentration left by each ant on all candidate grazing paths obtained by this iterative calculation.

[0171] Get the The comprehensive performance index corresponding to the iterative calculation Afterwards, based on The comprehensive performance index corresponding to the iterative calculation , through numerical calculation and conditional judgment, the global pheromone concentration increment is updated to obtain the updated global pheromone concentration increment. The specific calculation formula is as follows:

[0172] (18)

[0173] in, Indicates the The updated global pheromone concentration increment after the iteration calculation; represents the global pheromone volatility coefficient, Represents the pheromone residual factor, the global pheromone volatility coefficient is predefined; Indicates time No. Node to The pheromone concentration on the path of each node; represents the total number of ants; Represents ants In from Node to The pheromone concentration left on the path of each node.

[0174] Ant In the Node to The pheromone concentration left on the path of the nodes It can be calculated by the following formula:

[0175] (19)

[0176] in, represents the global pheromone constant, the global pheromone constant is predefined; Indicates the The comprehensive performance index corresponding to the iteration calculation is calculated.

[0177] It should be noted that in In the first iteration, the pheromone concentration on the path between any two nodes in the above environment map needs to be updated every time an ant advances a node. The update of the global pheromone concentration increment is based on the The candidate grazing paths calculated by the iterations are updated.

[0178] For the For any ant in the iteration calculation, no matter which nodes the path passed by the ant passes through, the total number of nodes passed by the ant is The only difference is the length of the path covered and the distance from the water point.

[0179] Therefore, in the embodiment of the present invention, all ants are used in the first The sum of the pheromone concentrations left on all subsequent aspect paths calculated by the iteration is taken as the The updated global pheromone concentration increment after the iterative calculation .

[0180] When the cumulative number of iterations reaches the maximum number of iterations, the optimal grazing path for the livestock to be grazed in the target grazing area is determined among the candidate grazing paths calculated in each iteration based on the function value of the grazing path planning objective function corresponding to the candidate grazing path calculated in each iteration.

[0181] Specifically, when the cumulative number of iterations reaches the maximum number of iterations, the candidate grazing path with the smallest corresponding function value among the function values ​​of the grazing path planning objective function corresponding to the candidate grazing paths calculated in each iteration can be determined as the optimal grazing path for the livestock to be grazed in the target grazing area.

[0182] It should be noted that, in the embodiment of the present invention, only the parts of the optimized ant colony algorithm that are improved compared with the traditional ant colony algorithm are described in detail. In addition to the above-mentioned improved parts, the other calculation processes for grazing path planning based on the optimized ant colony algorithm in the embodiment of the present invention are the same as those of the traditional ant colony algorithm, and will not be repeated in the embodiment of the present invention.

[0183] In the embodiment of the present invention, after establishing a grazing path planning objective function with the goal of minimizing the total length of the grazing path and minimizing the distance between the grazing path and the drinking water point, the optimized ant colony algorithm is used to solve the grazing path planning objective function based on the location information of the drinking water points, grazing prohibition areas, grazing starting points and grazing ending points in the target grazing area and the location information of each grazing access point, so as to obtain the optimal grazing path for the livestock to be grazed in the target grazing area. The optimized ant colony algorithm introduces a target heuristic factor to calculate the transfer probability of ants from any node to another node. The optimized ant colony algorithm introduces a comprehensive performance index to update the global pheromone concentration increment after each iterative calculation. The target heuristic factor is based on the distance between any node and any other node. The distance between a node and the nearest prohibited grazing area and the minimum radius of the livestock to be grazed starting from any node and bypassing the nearest prohibited grazing area to any node are determined. The comprehensive performance index is determined based on the function value of the grazing path planning objective function. By improving the heuristic factor, introducing multi-objective optimization and optimizing the global pheromone concentration update method, the traditional ant colony algorithm is optimized. The optimized ant colony algorithm can effectively solve technical problems such as low grazing path planning efficiency and disordered planned grazing paths, effectively improve the planning efficiency of grazing paths, more efficiently obtain the optimal grazing path planning in complex scenarios, better solve the problems of overgrazing and targetless grazing, and provide technical support for environmental protection and sustainable utilization of grassland resources.

[0184] The livestock grazing path planning method provided by the present invention introduces a target heuristic factor based on obstacle avoidance to realize the path obstacle avoidance function, ensure that livestock avoid grazing prohibited areas during grazing, and improve the safety and search efficiency of grazing path planning.

[0185] The livestock grazing path planning method proposed in this paper transforms the grazing path planning problem into a multi-objective optimization problem, comprehensively considering path length and watering frequency. By combining weights, it balances and optimizes different performance indicators, ensuring that the grazing path meets the shortest path requirements while ensuring that livestock can replenish water in a timely manner.

[0186] The livestock grazing path planning method provided by the present invention updates the global pheromone concentration increment according to the comprehensive performance index of multiple objectives, improves the updating rule of the global pheromone concentration increment, realizes multi-objective optimization, avoids ants getting stuck in the path selection process, and thus improves the global optimization capability of grazing path planning.

[0187] As an optional embodiment, each grazing access point is determined based on the following steps: obtaining remote sensing images of the target grazing area, characteristic information of each livestock to be grazed, and each grazing route planning target, wherein the characteristic information includes growth period information and health information.

[0188] In the embodiment of the present invention, characteristic information of each livestock to be grazed can be obtained based on user input or by querying existing data in a database.

[0189] In the embodiment of the present invention, multiple grazing path planning targets may be based on user input or received from other electronic devices.

[0190] It should be noted that the grazing path planning objectives in the embodiments of the present invention can be determined by the manager of the livestock to be grazed based on actual conditions. The embodiments of the present invention do not limit the grazing path planning objectives. These objectives can include: minimizing grazing path length, minimizing the total number of turning angles along the grazing path, ensuring that the duration of a single grazing trip for the livestock does not exceed a threshold, and avoiding overloaded areas within each grass grade within the target grazing area.

[0191] It should be noted that the carrying capacity refers to the number of livestock that can be accommodated per unit area or within each grazing area during grazing. The carrying capacity includes three factors: the number of livestock, the area of ​​grassland, and the grazing time. Its size is affected by many factors such as the type of livestock, grazing system, climate, soil, etc. In the embodiment of the present invention, the state of the block can be based on the carrying capacity of the block. After dividing the target grazing area into blocks of different forage grades, for any block, the grassland carrying capacity of the above block can be calculated using the following formula:

[0192] Grassland carrying capacity = (grass yield per unit area × grassland utilization rate) / (daily food intake of livestock × number of grazing days)

[0193] After the grassland carrying capacity of the block is calculated, it can be determined whether the block is in a state of overload, balanced or insufficient carrying capacity based on the grassland carrying capacity of the block.

[0194] Furthermore, based on the status of the block, a label indicating that the livestock carrying capacity is overloaded, a label indicating that the livestock carrying capacity is balanced, or a label indicating that the livestock carrying capacity is insufficient may be added to the block.

[0195] Based on remote sensing images, the target grazing area is divided into blocks of different forage grades. Based on the characteristic information of each livestock to be grazed, the livestock to be grazed are grouped to obtain the livestock groups to be grazed corresponding to each forage grade. There are multiple blocks of any forage grade in the target grazing area.

[0196] Specifically, after obtaining the remote sensing image of the target grazing area, the target grazing area can be divided into blocks with excellent grass grade, blocks with good grass grade, and blocks with poor grass grade based on the remote sensing image of the target grazing area through numerical calculation, deep learning technology, etc.

[0197] It should be noted that in the embodiment of the present invention, the grass yield in the block with excellent grass grade is the highest, the nutrient index value is the highest, and the grass quality in the block with excellent grass grade is the best; the grass yield in the block with good grass grade is the second highest, the nutrient index value is the second highest, and the grass quality in the block with good grass grade is the second best; the grass yield in the block with poor grass grade is the lowest, the nutrient index value is the lowest, and the grass quality in the block with poor grass grade is the worst.

[0198] As an optional embodiment, based on remote sensing images, the target grazing area is divided into blocks of different forage grades, including: based on remote sensing images, obtaining the target vegetation index value of the target grazing area, the target vegetation index includes the normalized difference vegetation index, the enhanced vegetation index, the normalized difference red edge index, the normalized difference moisture index and the blue light normalized difference vegetation index.

[0199] It should be noted that the Normalized Difference Vegetation Index (NDVI), Enhanced Vegetation Index (EVI), Normalized Difference Red Edge Index (NDRE), Normalized Differential Water Index (NDWI), and Blue-normalized Difference Vegetation Index (BNDVI) cover spectral information in multiple bands, such as blue, red, red-edge, near-infrared, and short-wave infrared, and can comprehensively reflect vegetation growth, moisture content, health, and biomass.

[0200] The reasons for selecting the target vegetation index in the embodiments of the present invention are as follows: NDVI is a classic and widely used vegetation index. It utilizes data from the red and near-infrared wavelengths, effectively distinguishing between vegetated and non-vegetated areas and reflecting vegetation growth and density. NDVI's simple calculation method and high sensitivity to vegetation make it a preferred indicator for monitoring changes in vegetation cover and growth. EVI improves upon NDVI by incorporating corrections for atmospheric and soil background, particularly by using the blue wavelength band to correct for the effects of atmospheric aerosols. EVI is more sensitive to densely vegetated areas and can more accurately reflect the health and growth trends of high-biomass areas, making it superior for vegetation monitoring in complex environments. NDRE utilizes the red-edge wavelength band (between red and near-infrared) for calculation and can sensitively detect vegetation chlorophyll content and health. The red-edge wavelength band is highly effective for monitoring early-stage vegetation growth and health changes, making NDRE a crucial tool, particularly in refined vegetation health assessments. NDWI, by combining near-infrared and shortwave infrared bands, is specifically designed to reflect vegetation moisture content. Moisture is a crucial factor in vegetation growth and health. NDWI effectively monitors plant moisture status and drought severity, providing critical moisture information for grassland management and grazing planning. BNDVI, utilizing blue and near-infrared bands, can provide stable vegetation monitoring results even against highly reflective backgrounds, such as water or soil. The blue band is sensitive to short-term vegetation changes and early growth stages, capturing early signs of vegetation growth and providing a valuable supplement to dynamic monitoring.

[0201] Based on the target vegetation index value of the target grazing area, the grass yield and nutrient index values ​​of the target grazing area are obtained.

[0202] Specifically, after obtaining the target vegetation index value of the target grazing area, the grass yield and nutrient index values ​​of the target grazing area can be obtained through numerical calculation, mathematical statistics, conditional judgment, and deep learning technology.

[0203] It should be noted that nutrient indicators in grazing areas are important parameters for assessing the nutrient status of soil and vegetation in grazing areas. These indicators may include, but are not limited to, soil pH, soil organic matter content, vegetation nutrient content, trace element content, total nitrogen content, available phosphorus content, and available potassium content.

[0204] As an optional embodiment, based on the target vegetation index value of the target grazing area, the grass yield and nutrient index value of the target grazing area is obtained, including: inputting the target vegetation index value of the target grazing area into a grass yield estimation model, and obtaining the grass yield and nutrient index value of the target grazing area output by the grass yield estimation model.

[0205] Among them, the grass yield estimation model is constructed based on the random forest machine learning model, which is trained based on the target vegetation index value of the sample grazing area and the grass yield and nutrient index values ​​of the sample grazing area.

[0206] It's important to note that the Random Forest (RF) machine learning model is an ensemble learning model primarily used for classification and regression tasks. It's a powerful machine learning model that delivers excellent performance across a wide range of classification and regression tasks. By integrating multiple decision trees and introducing randomness, the RF improves model accuracy while reducing the risk of overfitting.

[0207] After constructing the initial model based on the random forest machine learning model in the embodiment of the present invention, the target vegetation index value of the sample grazing area can be used as a training sample, and the grass yield and nutrient index values ​​of the sample grazing area can be used as sample labels to train the above initial model to obtain a grass yield estimation model.

[0208] After obtaining the grass product estimation model, the target vegetation index value of the target grazing area can be input into the above grass yield estimation model.

[0209] The above-mentioned grass yield estimation model can estimate the grass yield and nutrient index value of the target grazing area based on the target vegetation index value of the target grazing area, and then obtain the grass yield and nutrient index value of the target grazing area output by the above-mentioned grass yield estimation model.

[0210] It should be noted that in the embodiment of the present invention, Python 3.9 can be used as the development environment, and the third-party data science library scikit-learn can be used to call the model.

[0211] Based on the grass yield and nutrient index values ​​of the target grazing area, the target grazing area is divided into blocks with different forage grades.

[0212] Specifically, after obtaining the grass yield and nutrient index values ​​of the target grazing area, the spatial distribution of grass yield and the spatial distribution of nutrient index values ​​in the target grazing area can be analyzed based on the grass yield and nutrient index values ​​in the target grazing area. Then, based on the spatial distribution of grass yield and the spatial distribution of nutrient index values ​​in the target grazing area, the spatial distribution of grass yield and the spatial distribution of nutrient index values ​​can be normalized using the ArcGIS PRO data analysis tool, and the regional grouping method can be used to determine the blocks with excellent grass grades and the blocks with poor grass grades in the target grazing area.

[0213] After determining the blocks with excellent and poor grass grades within the target grazing area, the remaining area within the target grazing area can be determined as the area with good grass grades. Based on the average area of ​​the blocks with excellent and poor grass grades within the target grazing area, the area with good grass grades within the target grazing area can be segmented. The area with good grass grades within the target grazing area can be segmented into multiple blocks with the average area, thereby obtaining blocks with good grass grades within the target grazing area.

[0214] Figure 4 This is a schematic diagram of the area of ​​each forage grade in the target grazing area in the livestock grazing path planning method provided by the present invention. The distribution of blocks of each forage grade in the target grazing area is as follows: Figure 4 shown.

[0215] It should be noted that, in the embodiment of the present invention, blocks of different levels are divided in equal proportion within the confidence interval. Figure 4 Each grass grade block is shown as a whole block. In the actual application of the invention, the blocks of different grass grades often show more complex and overlapping distributions, which reflects the importance of path planning.

[0216] In the embodiment of the present invention, based on the characteristic information of each livestock to be grazed, the livestock to be grazed can be grouped by conditional judgment.

[0217] According to the reproductive period information of the livestock to be grazed, reproductive period labels can be added for the livestock to be grazed. The above reproductive period labels include: young age, lactation, pregnancy, reproductive period and non-reproductive period.

[0218] According to the health information of the livestock to be grazed, health condition labels can be added to the livestock to be grazed, and the health condition labels include: healthy, sick.

[0219] After adding a growth period label and a health condition label for each livestock to be grazed, the grass grade corresponding to each livestock to be grazed can be determined based on the growth period label and the health condition label added for each livestock to be grazed.

[0220] Specifically, when the reproductive period label of any livestock to be grazed is non-reproductive period and the health condition label is healthy, it can be determined that the forage grade corresponding to the livestock to be grazed is poor.

[0221] When the reproductive period label of any livestock to be grazed is reproductive period and the health status label is healthy, or when the reproductive period label of any livestock to be grazed is non-reproductive period and the health status label is sick, it can be determined that the grass grade corresponding to the above livestock to be grazed is good.

[0222] When the reproductive period label of any livestock to be grazed is reproductive period and the health condition label is sick, or when the reproductive period label of any livestock to be grazed is young, lactating or pregnant, the forage grade corresponding to the livestock to be grazed can be determined to be excellent.

[0223] Construct an objective function corresponding to each grazing path planning goal. For each forage grade, based on the multi-objective dynamic programming algorithm and the objective function corresponding to each grazing path planning goal, obtain the cruising order of the livestock herd to be grazed for each forage grade block.

[0224] Specifically, in an embodiment of the present invention, an objective function corresponding to each grazing path planning objective can be constructed according to each grazing path planning objective. Then, based on a multi-objective dynamic programming algorithm and the objective function corresponding to each grazing path planning objective, the cruising order of the livestock group to be grazed for each forage grade block corresponding to each forage grade can be obtained through numerical calculation.

[0225] As an optional embodiment, based on a multi-objective dynamic programming algorithm and an objective function corresponding to each grazing path planning objective, the cruising order of the livestock herd to be grazed corresponding to each grass level for the block of each grass level is obtained, including: taking the geometric center point of each block of each grass level in the target grazing area and determining each node corresponding to each grass level.

[0226] The predefined grazing starting point is determined as the starting node, and the predefined grazing ending point is determined as the ending node. Based on the multi-objective dynamic programming algorithm and the position information of the starting node, the ending node, each node corresponding to each forage grade, and the objective function corresponding to each grazing path planning target, the cruising order of the livestock group to be grazed corresponding to each forage grade for the block of each forage grade is solved to obtain candidate solutions for the cruising order of each block corresponding to each forage grade.

[0227] The block cruising order candidate solution corresponding to each forage grade and having the smallest corresponding objective function value is determined as the optimal block cruising order solution corresponding to each forage grade.

[0228] Based on the optimal solution of the block cruising sequence corresponding to each forage grade, the cruising sequence of the livestock group to be grazed corresponding to each forage grade for the blocks of each forage grade is determined.

[0229] Specifically, after the target grazing area is divided into blocks of different forage grades, the boundary position information of each block can be obtained in a variety of ways. For example, the boundary position information of each block can be obtained based on the mapping relationship between the remote sensing image of the target grazing area and the target grazing area; or, if the boundary position information of each block has been stored in a CSV file, the boundary position information of each block can be obtained by reading the above CSV file.

[0230] It should be noted that, in the embodiment of the present invention, the boundary position information of the block can be expressed in longitude and latitude.

[0231] It should be noted that in order to facilitate the understanding of the objective function corresponding to the multi-objective dynamic programming algorithm and each grazing path planning objective in the path planning method provided by the present invention, and to obtain the cruising order of the livestock group to be grazed corresponding to each forage grade for the blocks of each forage grade, the following takes the grazing path planning objectives including: the shortest grazing path length, the minimum total turning angles on the grazing path, and avoidance of grazing prohibited areas as an example to specifically illustrate the embodiments of the present invention.

[0232] For forage grade k , define the set S Includes forage grade in target grazing areas k The corresponding nodes are based on the grass grade in the target grazing area. k The boundary position information of each block is used to calculate the pasture grade. k The distance between any two blocks is constructed to obtain the distance matrix D .

[0233] Define the state Indicates starting from the starting node and passing through the set S Node in, reaching node The shortest path length and the sum of the turning angles are expressed as a two-tuple:

[0234] (20)

[0235] The initialization state is represented as: .

[0236] Based on the boundary location information of the grazing prohibition area, a taboo table containing all grazing points and grazing prohibition areas is generated. The value of the grazing point that has not been visited is assigned to 0, and the value of the grazing point that has been visited is assigned to 1. Before the traversal begins, the value of the grazing prohibition area is initialized to 1, so that the path visit node avoids the area. The state is represented as

[0237] For each state , by Nodes in Transfer to node , the path length and the total turning angle can be updated:

[0238] (twenty one)

[0239] The turning angle is obtained by calculating the vector angle:

[0240] (twenty two)

[0241] The final state is starting from the starting node and passing through the set Some or all nodes in the The optimal solution:

[0242] (twenty three)

[0243] As an optional embodiment, based on a multi-objective dynamic programming algorithm and the position information of the starting node, the ending node, and each node corresponding to each forage grade, and the objective function corresponding to each grazing path planning objective, the cruising order of the livestock group to be grazed corresponding to each forage grade for the blocks of each forage grade is solved to obtain candidate solutions for the cruising order of each block corresponding to each forage grade, including: based on the multi-objective dynamic programming algorithm and the position information of the starting node, the ending node, and each node, and the objective function corresponding to each grazing path planning objective, the cruising order of the livestock group to be grazed corresponding to each forage grade for the blocks of each forage grade is solved for each forage grade, and after obtaining candidate solutions for the cruising order of the blocks corresponding to each forage grade in this iteration, it is determined whether the objective function value corresponding to the candidate solutions for the cruising order of the blocks corresponding to each forage grade in this iteration is less than the objective function value corresponding to the target candidate solutions for the cruising order of the blocks corresponding to each forage grade, the target candidate solutions for the cruising order of the blocks corresponding to each forage grade being the candidate solutions for the cruising order of the blocks corresponding to each forage grade obtained before this iteration having the smallest corresponding objective function value.

[0244] When the objective function value corresponding to the block cruising order candidate solution corresponding to each forage level in this iteration is less than the objective function value corresponding to the block cruising order target candidate solution corresponding to each forage level, the block cruising order target candidate solution corresponding to each forage level is updated to the block cruising order candidate solution corresponding to each forage level in this iteration. When the objective function value corresponding to the block cruising order candidate solution corresponding to each forage level in this iteration is not less than the objective function value corresponding to the block cruising order target candidate solution corresponding to each forage level, the block cruising order candidate solution corresponding to each forage level in this iteration is deleted.

[0245] It should be noted that, in order to save computing resources and improve computing efficiency, in the embodiment of the present invention, based on the multi-objective dynamic programming algorithm and the position information of the starting node, the ending node, each node corresponding to each forage grade, and the objective function corresponding to each grazing path planning target, in the process of solving the cruising order of the livestock group to be grazed corresponding to each forage grade for the block of each forage grade, the pruning rule can be used to terminate unnecessary calculations in advance and reduce the search space. The specific implementation can be expressed by the following formula:

[0246] (twenty four)

[0247] Based on the cruising sequence of the blocks of each forage grade, the grazing path of the livestock group to be grazed corresponding to each forage grade is determined.

[0248] Specifically, based on the cruising order of the blocks of each forage grade, the grazing path of the livestock group to be grazed corresponding to each forage grade is determined, including: according to the cruising order of the livestock group to be grazed corresponding to each forage grade for the blocks of each forage grade, the geometric center of the blocks of each forage grade is connected in sequence starting from the grazing starting point, and the connected path is used as the grazing path of the livestock group to be grazed corresponding to each forage grade.

[0249] The embodiment of the present invention divides the target grazing area into blocks of different forage grades based on remote sensing images of the target grazing area, groups the livestock to be grazed based on characteristic information of each livestock to be grazed, obtains the livestock groups to be grazed corresponding to each forage grade, and then constructs an objective function corresponding to each grazing path planning target. For each forage grade, based on a multi-objective dynamic programming algorithm and the objective function corresponding to each grazing path planning target, the cruising order of the livestock groups to be grazed corresponding to each forage grade in the blocks of each forage grade is obtained. Then, based on the cruising order of the blocks of each forage grade, The grazing paths for livestock herds to be grazed corresponding to each forage grade are determined. Factors such as grassland carrying capacity and differences in herd structure are taken into consideration when planning the grazing paths. The grazing path planning process under multiple grazing path planning objectives is optimized, and the optimal grazing path planning can be obtained more efficiently in complex scenarios. The problems of overgrazing and targetless grazing can be better solved, and the automatic selection and autonomous planning of the optimal route for intelligent grazing can be realized. Multi-path intelligent grazing control strategies are formulated based on the differences in grassland carrying capacity and herd structure, which can provide technical support for environmental protection and sustainable use of grassland resources.

[0250] Figure 5 This is a schematic diagram of the structure of the livestock grazing path planning device provided by the present invention. Figure 5The livestock grazing path planning device provided by the present invention is described. The livestock grazing path planning device described below and the livestock grazing path planning method described above can be referred to each other. Figure 5 As shown, the device includes: a function construction module 501 and a path planning module 502.

[0251] The function construction module 501 is used to establish a grazing path planning objective function with the goal of minimizing the total length of the grazing path and minimizing the distance between the grazing path and the drinking point.

[0252] The path planning module 502 is used to calculate the grazing path planning objective function based on the location information of drinking water points, grazing prohibited areas, grazing starting points, and grazing ending points in the target grazing area, as well as the location information of each grazing access point, using the optimized ant colony algorithm to obtain the optimal grazing path for the livestock to be grazed in the target grazing area.

[0253] Among them, the target heuristic factor is introduced into the optimized ant colony algorithm to calculate the transfer probability of ants from any node to another node. The optimized ant colony algorithm introduces a comprehensive performance index to update the global pheromone concentration increment after each iterative calculation. The target heuristic factor is determined based on the distance between any node and the nearest grazing prohibited area from any node and the minimum radius of the livestock to be grazed starting from any node to bypass the nearest grazing prohibited area from any node. The comprehensive performance index is determined based on the function value of the grazing path planning objective function.

[0254] Specifically, the function construction module 501 and the path planning module 502 are electrically connected.

[0255] The livestock grazing path planning device in the embodiment of the present invention establishes a grazing path planning objective function with the goal of minimizing the total length of the grazing path and minimizing the distance between the grazing path and the drinking water point. Based on the location information of the drinking water points, grazing prohibited areas, grazing starting points, and grazing ending points in the target grazing area, as well as the location information of each grazing access point, the grazing path planning objective function is solved by an optimized ant colony algorithm to obtain the optimal grazing path for the livestock to be grazed in the target grazing area. The optimized ant colony algorithm introduces a target heuristic factor to calculate the transfer probability of ants from any node to another node. The optimized ant colony algorithm introduces a comprehensive performance index to update the global pheromone concentration increment after each iterative calculation. The target heuristic factor is based on any The distance between a node and the nearest prohibited grazing area from any node and the minimum radius of the livestock to be grazed starting from any node and bypassing the nearest prohibited grazing area from any node are determined. The comprehensive performance index is determined based on the function value of the grazing path planning objective function. By improving the heuristic factor, introducing multi-objective optimization and optimizing the global pheromone concentration update method, the traditional ant colony algorithm is optimized. The optimized ant colony algorithm can effectively solve technical problems such as low efficiency of grazing path planning and disordered grazing paths, effectively improve the planning efficiency of grazing paths, more efficiently obtain the optimal grazing path planning in complex scenarios, better solve the problems of overgrazing and targetless grazing, and provide technical support for environmental protection and sustainable utilization of grassland resources.

[0256] Figure 6 An example of a physical structure diagram of an electronic device is shown below. Figure 6As shown, the electronic device may include: a processor 610 , a communications interface 620 , a memory 630 and a communication bus 640 , wherein the processor 610 , the communications interface 620 and the memory 630 communicate with each other via the communication bus 640 . The processor 610 can call logic instructions in the memory 630 to execute a livestock grazing path planning method, which includes: establishing a grazing path planning objective function with the goal of minimizing the total length of the grazing path and minimizing the distance between the grazing path and the drinking water point; based on the location information of the drinking water point, the prohibited grazing area, the grazing starting point and the grazing ending point in the target grazing area, and the location information of each grazing access point, solving the grazing path planning objective function through an optimized ant colony algorithm to obtain the optimal grazing path for the livestock to be grazed in the target grazing area; wherein, the optimized ant colony algorithm introduces a target heuristic factor to calculate the transition probability of ants transferring from any node to another node, and the optimized ant colony algorithm introduces a comprehensive performance index to update the global pheromone concentration increment after each iterative calculation; the target heuristic factor is determined based on the distance between any node and the prohibited grazing area closest to any node and the minimum radius of the livestock to be grazed starting from any node and bypassing the prohibited grazing area closest to any node; and the comprehensive performance index is determined based on the function value of the grazing path planning objective function.

[0257] Furthermore, the logic instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0258] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the livestock grazing path planning method provided by the above methods, which includes: establishing a grazing path planning objective function with the goal of minimizing the total length of the grazing path and minimizing the distance between the grazing path and the drinking point; based on the location information of the drinking point, the grazing prohibition area, the grazing starting point and the grazing ending point in the target grazing area and the location information of each grazing access point, through the optimized ant colony algorithm The method solves the objective function of grazing path planning and obtains the optimal grazing path for livestock to be grazed in the target grazing area; the target heuristic factor is introduced into the optimized ant colony algorithm to calculate the transfer probability of ants from any node to another node, and the optimized ant colony algorithm introduces a comprehensive performance index to update the global pheromone concentration increment after each iterative calculation; the target heuristic factor is determined based on the distance between any node and the nearest prohibited grazing area to any node and the minimum radius of the livestock to be grazed starting from any node to bypass the nearest prohibited grazing area to any node; the comprehensive performance index is determined based on the function value of the grazing path planning objective function.

[0259] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the livestock grazing path planning method provided by the above-mentioned methods, the method comprising: establishing a grazing path planning objective function with the goal of minimizing the total length of the grazing path and minimizing the distance between the grazing path and the drinking water point; solving the grazing path planning objective function using an optimized ant colony algorithm based on the location information of the drinking water points, grazing prohibition areas, grazing starting points, and grazing ending points in the target grazing area, as well as the location information of each grazing access point, to obtain the optimal grazing path for the livestock to be grazed in the target grazing area; wherein, a target heuristic factor is introduced into the optimized ant colony algorithm to calculate the transition probability of ants transferring from any node to another node, and the optimized ant colony algorithm introduces a comprehensive performance index to update the global pheromone concentration increment after each iterative calculation; the target heuristic factor is determined based on the distance between any node and the prohibition area closest to any node and the minimum radius of the livestock to be grazed starting from any node and bypassing the prohibition area closest to any node; and the comprehensive performance index is determined based on the function value of the grazing path planning objective function.

[0260] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0261] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.

[0262] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A livestock grazing path planning method, characterized in that: include: The objective function of grazing path planning is established with the goal of minimizing the total length of the grazing path and the distance between the grazing path and the drinking point. Based on the location information of drinking water points, grazing prohibited areas, grazing starting points, and grazing ending points in the target grazing area, as well as the location information of each grazing access point, the optimized ant colony algorithm is used to solve the grazing path planning objective function to obtain the optimal grazing path for the livestock to be grazed in the target grazing area; The optimized ant colony algorithm introduces a target heuristic factor to calculate the transfer probability of ants from any node to another node, and the optimized ant colony algorithm introduces a comprehensive performance index to update the global pheromone concentration increment after each iterative calculation. The target heuristic factor is determined based on the distance between any node and the nearest grazing prohibited area to any node and the minimum radius of the livestock to be grazed starting from any node and bypassing the nearest grazing prohibited area to any node. The comprehensive performance index is determined based on the function value of the grazing path planning objective function. The method solves the grazing path planning objective function using an optimized ant colony algorithm based on the location information of drinking water points, grazing prohibited areas, grazing starting points, and grazing ending points in the target grazing area, as well as the location information of each grazing access point, to obtain the optimal grazing path for the livestock to be grazed in the target grazing area, including: acquiring an environmental map of the target grazing area based on a remote sensing image of the target grazing area; Initializing parameters of the optimized ant colony algorithm, determining a starting node and an ending node in the environmental map based on the location information of the grazing starting point and the grazing ending point, determining each node in the environmental map based on the location information of each grazing access point, determining a drinking water node in the environmental map based on the location information of the drinking water point, and determining a prohibited grazing area and a prohibited grazing node in the environmental map based on the location information of the prohibited grazing area, wherein the parameters include the number of ants, the number of nodes on the grazing path, the maximum number of iterations, and various weight coefficients; In this iterative calculation, after all ants are placed at the starting node, if any ant has not reached the ending node, a target heuristic factor corresponding to the node where any ant is currently located is determined based on the distance between the node where any ant is currently located and the prohibited grazing node closest to the node where any ant is currently located, and the minimum radius of the livestock to be grazed starting from the node where any ant is currently located and circumventing the prohibited grazing area closest to the node where any ant is currently located is determined; based on the target heuristic factor corresponding to the node where any ant is currently located, a transition probability of any ant from the node where any ant is currently located to each optional node is calculated; based on the transition probability of any ant from the node where any ant is currently located to each optional node, a next node to which any ant is to go is determined; the pheromone concentration on the path from the node where any ant is currently located to the next node to which any ant is to go is updated; and if it is determined that each ant has reached the ending node, a candidate grazing path obtained by this iterative calculation is obtained, and a function value of the grazing path planning objective function corresponding to the candidate grazing path obtained by this iterative calculation is obtained; When the cumulative number of iterations has not reached the maximum number of iterations, based on the function value of the grazing path planning objective function corresponding to this iterative calculation, the comprehensive performance index corresponding to this iterative calculation is obtained, and the global pheromone concentration increment is updated based on the comprehensive performance index corresponding to this iterative calculation, and then the next iterative calculation is performed based on the updated global pheromone concentration increment until the cumulative number of iterations reaches the maximum number of iterations.

2. The livestock grazing path planning method according to claim 1, characterized in that: The determining of a target heuristic factor corresponding to the node currently located by any ant based on the distance between the node currently located by any ant and the grazing-forbidden node closest to the node currently located by any ant and the minimum radius of the livestock to be grazed that circumvents the grazing-forbidden zone closest to the node currently located by any ant from the node currently located by any ant includes: When the distance between the node where any ant is currently located and the forbidden grazing node closest to the node where any ant is currently located is greater than a first safety distance threshold, the target heuristic factor corresponding to the node where any ant is currently located is determined to be 1; when the distance between the node where any ant is currently located and the forbidden grazing node closest to the node where any ant is currently located is less than a second safety distance threshold, the target heuristic factor corresponding to the node where any ant is currently located is determined to be 0; when the distance between the node where any ant is currently located and the forbidden grazing node closest to the node where any ant is currently located is not greater than the first safety distance threshold and not less than the second safety distance threshold, half of the ratio of the distance between the node where any ant is currently located and the forbidden grazing node closest to the node where any ant is currently located to the minimum radius of the livestock to be grazed starting from the node where any ant is currently located and bypassing the forbidden grazing area closest to the node where any ant is currently located is determined as the target heuristic factor corresponding to the node where any ant is currently located; The second safety distance threshold is smaller than the first safety distance threshold, and the second safety distance threshold and the first safety distance threshold are determined based on the minimum radius of the grazing ban area closest to the node where any ant is currently located, starting from the node where any ant is currently located.

3. The livestock grazing path planning method according to claim 1, characterized in that: The method of establishing a grazing path planning objective function with the goal of minimizing the total length of the grazing path and minimizing the distance between the grazing path and the drinking point comprises: constructing a first sub-objective function in the grazing path planning objective function with the shortest total length of the grazing path as the planning objective, and constructing a second sub-objective function in the grazing path planning objective function with the minimum distance between the grazing path and the drinking point as the planning objective; The formula of the first sub-objective function is expressed as: Where n represents the total number of nodes on the grazing path; p represents the number of iterative calculations; p i Indicates the i-th node on the candidate grazing path corresponding to the p-th iteration calculation; (x i ,y i ) indicates p i The coordinate value of p i+1 Indicates the i+1th node on the candidate grazing path corresponding to the pth iteration calculation; (x i+1 ,y i+1 ) indicates p i+1 Coordinate value of d(p i ,p i+1 ) represents the slave node p i To node p i+1 The Euclidean distance of ; L(p) represents the function value of the first sub-objective function corresponding to the candidate grazing path calculated at the p-th iteration; The formula of the second sub-objective function is expressed as: Among them, D io Represents node p i and distance node p i The distance to the nearest drinking water point; R water Indicates that the livestock to be grazed is from node p i Start by bypassing the distance node p i The minimum radius of the nearest grazing ban area; (x o ,y o ) represents the distance from node p i The coordinates of the nearest drinking water point; W(p) represents the function value of the second sub-objective function corresponding to the candidate grazing path calculated at the pth iteration; The formula of the grazing path planning objective function is expressed as: G(p)=L(p)+W(p) Wherein, G(p) represents the function value of the grazing path planning objective function corresponding to the candidate grazing path obtained by the p-th iteration calculation.

4. The livestock grazing path planning method according to claim 3, characterized in that: The function value of the grazing path planning objective function corresponding to the iterative calculation is obtained based on the function value of the grazing path planning objective function corresponding to the iterative calculation, including: Calculate the product of the function value of the first sub-objective function corresponding to the current iterative calculation and the first weight coefficient among the weight coefficients as the first intermediate result of the comprehensive performance index corresponding to the current iterative calculation; calculate the product of the function value of the second sub-objective function corresponding to the current iterative calculation and the second weight coefficient among the weight coefficients as the second intermediate result of the comprehensive performance index corresponding to the current iterative calculation; After calculating the first intermediate result and the second intermediate result of the comprehensive performance index corresponding to this iterative calculation, they are used as the comprehensive performance index corresponding to this iterative calculation.

5. The livestock grazing path planning method according to claim 4, characterized in that: The updating of the global pheromone concentration increment based on the comprehensive performance index corresponding to the current iterative calculation includes: Based on the pheromone concentrations left by each ant on all candidate grazing paths calculated in this iteration, the updated global pheromone concentration increment is obtained.

6. The livestock grazing path planning method according to any one of claims 1 to 5, characterized in that: Each grazing access point is determined based on the following steps: Acquire remote sensing images of the target grazing area, characteristic information of each livestock to be grazed, and planning targets for each grazing route, wherein the characteristic information includes growth period information and health information; Based on the remote sensing image, the target grazing area is divided into blocks of different forage grades, and based on characteristic information of each of the livestock to be grazed, the livestock to be grazed are grouped to obtain a group of livestock to be grazed corresponding to each forage grade, wherein the number of blocks of any one of the forage grades in the target grazing area is multiple; Constructing an objective function corresponding to each grazing path planning objective, and for each forage grade, obtaining a cruising order of the livestock group to be grazed corresponding to each forage grade in the blocks of each forage grade based on a multi-objective dynamic programming algorithm and the objective function corresponding to each grazing path planning objective; Based on the cruising sequence of the blocks of each forage grade, a grazing path for the livestock group to be grazed corresponding to each forage grade is determined.

7. A livestock grazing path planning device, characterized in that: include: A function building module is used to establish a grazing path planning objective function with the goal of minimizing the total length of the grazing path and minimizing the distance between the grazing path and the drinking point; a path planning module for solving the grazing path planning objective function using an optimized ant colony algorithm based on the location information of drinking water points, grazing prohibited areas, grazing starting points, and grazing ending points in the target grazing area, as well as the location information of each grazing access point, to obtain an optimal grazing path for the livestock to be grazed within the target grazing area; The optimized ant colony algorithm introduces a target heuristic factor to calculate the transfer probability of ants from any node to another node, and the optimized ant colony algorithm introduces a comprehensive performance index to update the global pheromone concentration increment after each iterative calculation. The target heuristic factor is determined based on the distance between any node and the nearest grazing prohibited area to any node and the minimum radius of the livestock to be grazed starting from any node and bypassing the nearest grazing prohibited area to any node. The comprehensive performance index is determined based on the function value of the grazing path planning objective function. The path planning module solves the grazing path planning objective function using an optimized ant colony algorithm based on the location information of drinking water points, grazing prohibited areas, grazing starting points, and grazing ending points in the target grazing area, as well as the location information of each grazing access point, to obtain the optimal grazing path for the livestock to be grazed in the target grazing area, including: acquiring an environmental map of the target grazing area based on a remote sensing image of the target grazing area; Initializing parameters of the optimized ant colony algorithm, determining a starting node and an ending node in the environmental map based on the location information of the grazing starting point and the grazing ending point, determining each node in the environmental map based on the location information of each grazing access point, determining a drinking water node in the environmental map based on the location information of the drinking water point, and determining a prohibited grazing area and a prohibited grazing node in the environmental map based on the location information of the prohibited grazing area, wherein the parameters include the number of ants, the number of nodes on the grazing path, the maximum number of iterations, and various weight coefficients; In this iterative calculation, after all ants are placed at the starting node, if any ant has not reached the ending node, a target heuristic factor corresponding to the node where any ant is currently located is determined based on the distance between the node where any ant is currently located and the prohibited grazing node closest to the node where any ant is currently located, and the minimum radius of the livestock to be grazed starting from the node where any ant is currently located and circumventing the prohibited grazing area closest to the node where any ant is currently located is determined; based on the target heuristic factor corresponding to the node where any ant is currently located, a transition probability of any ant from the node where any ant is currently located to each optional node is calculated; based on the transition probability of any ant from the node where any ant is currently located to each optional node, a next node to which any ant is to go is determined; the pheromone concentration on the path from the node where any ant is currently located to the next node to which any ant is to go is updated; and if it is determined that each ant has reached the ending node, a candidate grazing path obtained by this iterative calculation is obtained, and a function value of the grazing path planning objective function corresponding to the candidate grazing path obtained by this iterative calculation is obtained; When the cumulative number of iterations has not reached the maximum number of iterations, based on the function value of the grazing path planning objective function corresponding to this iterative calculation, the comprehensive performance index corresponding to this iterative calculation is obtained, and the global pheromone concentration increment is updated based on the comprehensive performance index corresponding to this iterative calculation, and then the next iterative calculation is performed based on the updated global pheromone concentration increment until the cumulative number of iterations reaches the maximum number of iterations.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the livestock grazing path planning method according to any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the livestock grazing path planning method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Mobile robot path planning method based on motion constraint improved ant colony algorithm

    CN116540738A