Route planning method and device, storage medium and electronic equipment
1. A method of route planning, comprising:
dividing the target point into at least two subregions according to the distance between the target points and the region division rule;
performing iterative training on the simulated path between the at least two sub-regions according to at least one path evaluation parameter, and determining a first path between the at least two sub-regions which meets the at least one path evaluation parameter;
and generating a target path between the target points according to the second path of each target point in any sub-area and the first path between the at least two sub-areas.
2. The method according to claim 1, wherein the dividing the target point into at least two sub-areas according to the distance between the target points and an area division rule comprises:
acquiring first seed target points, and dividing target points, the distance between which and the first seed target points is smaller than a distance threshold value in the region division rule, in each target point to a first sub-region corresponding to the first seed target point;
and determining a second seed target point according to the first seed target point in the target points outside the first sub-area, and determining a target point belonging to a second sub-area based on the second seed target point, wherein the target points in the first sub-area and the second sub-area are not overlapped.
3. The method of claim 1, wherein iteratively training the simulated path between the at least two sub-regions according to at least one path-evaluation parameter, determining a first path between the at least two sub-regions that satisfies the at least one path-evaluation parameter, comprises:
determining at least one simulation path between the at least two sub-areas, and calculating a path evaluation value of each simulation path according to at least one path evaluation parameter;
and performing iterative optimization on the simulation path between the at least two sub-regions according to the path evaluation value to generate a first path between the at least two sub-regions which meets the at least one path evaluation parameter.
4. A method according to claim 1 or 3, wherein the path evaluation parameters include path length and access priority, wherein the path evaluation value for each simulated path is calculated from at least one path evaluation parameter;
respectively calculating the path length and the access priority evaluation value of the simulation path;
and according to the weight information of the path length and the access priority, carrying out weighted calculation on the path length and the access priority evaluation value to generate the path evaluation value.
5. The method of claim 4, wherein the access priority evaluation value of the simulated path is determined according to the deviation value of the actual access sequence and the standard access sequence of each sub-area in the simulated path, wherein the standard access sequence of any sub-area is determined according to the access priority of each target point in the sub-area.
6. The method of claim 3, wherein said determining at least one simulated path between said at least two sub-regions comprises:
for the current sub-region, determining the probability of each feasible sub-region according to the distance between the feasible sub-region of the current sub-region and the pheromone;
and determining the next subregion of the current subregion according to the probability of each feasible subregion, and generating the simulation path.
7. The method of claim 6, wherein iteratively optimizing the simulated path between the at least two sub-regions according to the path metric comprises:
updating pheromones among the sub-regions according to the optimal path evaluation value in the current iteration or the optimal path evaluation value in the historical iteration;
and determining at least one new simulation path according to the updated pheromone, and iterating to carry out path optimization based on the at least one new simulation path.
8. The method of claim 1, wherein generating the target path between the target points according to the second path of the target points in any sub-area and the first path between the at least two sub-areas comprises:
and connecting a last target point in a second path of a first subregion in the first path with a first target point in a second path of a next subregion in the first path to generate the target path, wherein the second path of each target point in any subregion is determined according to the access priority of each target point or a shortest path rule.
9. A route planning apparatus, comprising:
the subarea determining module is used for dividing the target point into at least two subareas according to the distance between the target points and the area dividing rule;
the first path determining module is used for performing iterative training on the simulated path between the at least two sub-regions according to at least one path evaluation parameter, and determining a first path between the at least two sub-regions which meets the at least one path evaluation parameter;
and the target path determining module is used for generating a target path between the target points according to the second path of each target point in any sub-area and the first path between the at least two sub-areas.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor, when executing the program, implements a route planning method according to any one of claims 1-8.
11. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out a method of route planning according to any one of claims 1-8.
Background
With the rapid development of computer technology, the e-commerce industry and the logistics industry are accepted by the wide range of users, and correspondingly, the requirements of the users on the logistics industry are higher and higher.
The path planning is a key problem in the field of logistics and is widely applied to scenes such as commodity distribution, warehouse picking, customer visiting, robot mobile navigation and the like. Path planning generally refers to determining an optimal path from a start position to an end position in a workspace under certain constraints according to certain criteria, and essentially belongs to the category of combinatorial optimization. Through the optimization decision of the combination problem, the reasonable allocation of related resources can be realized, thereby fully saving various expenses (energy consumption, time and the like) and achieving the purposes of cost reduction and efficiency improvement.
The solution of the path planning problem mainly comprises two types of methods, namely an accurate solution algorithm and a heuristic algorithm. The exact solution algorithm is generally based on strict mathematical principles and theoretically can ensure that the optimal solution is obtained within a limited time. However, the amount of calculation is generally large, and increases sharply as the scale of the problem becomes larger. Heuristic algorithms construct solutions based on some empirical rules and continuously improve the solutions during the solution process. The method has high solving efficiency and can ensure the quality of the solution to a certain degree. However, the current heuristic algorithm is only suitable for a small-scale path planning problem, and when the problem scale increases, the search quantity of the solution space is exponentially improved, so that the calculation time for obtaining a feasible solution becomes very long, and the calculation time does not meet the timeliness requirement.
Disclosure of Invention
The embodiment of the invention provides a route planning method, a route planning device, a storage medium and electronic equipment, which are used for realizing efficient large-scale path planning.
In a first aspect, an embodiment of the present invention provides a route planning method, including:
dividing the target point into at least two subregions according to the distance between the target points and the region division rule;
performing iterative training on the simulated path between the at least two sub-regions according to at least one path evaluation parameter, and determining a first path between the at least two sub-regions which meets the at least one path evaluation parameter;
and generating a target path between the target points according to the second path of each target point in any sub-area and the first path between the at least two sub-areas.
In a second aspect, an embodiment of the present invention further provides a route planning apparatus, including:
the subarea determining module is used for dividing the target point into at least two subareas according to the distance between the target points and the area dividing rule;
the first path determining module is used for performing iterative training on the simulated path between the at least two sub-regions according to at least one path evaluation parameter, and determining a first path between the at least two sub-regions which meets the at least one path evaluation parameter;
and the target path determining module is used for generating a target path between the target points according to the second path of each target point in any sub-area and the first path between the at least two sub-areas.
In a third aspect, an embodiment of the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the route planning method according to any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a route planning method according to any embodiment of the present invention.
According to the technical scheme, at least two sub-areas are obtained according to the distance between the target points and the area division rule, the simulation path between the at least two sub-areas is subjected to iterative training according to at least one path evaluation parameter, the first path between the at least two sub-areas meeting the at least one path evaluation parameter is determined, and the target path between the target points is generated according to the second path of each target point in any sub-area and the first path between the at least two sub-areas. By dividing a large number of target points into regions, a small number of sub-regions are obtained, path planning among the sub-regions and path planning of the target points in each sub-region are formed, the path planning scale is simplified, and the path planning of each part can be processed in parallel, so that the path planning efficiency is improved. Meanwhile, in the path planning process, the target path meeting at least one path evaluation parameter is obtained by taking at least one path evaluation parameter as an optimization target, and multi-target path planning can be realized.
Drawings
Fig. 1 is a schematic flow chart of a route planning method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a seed target point according to an embodiment of the present invention;
fig. 3 is a schematic flow chart of a route planning method according to a second embodiment of the present invention;
fig. 4 is a graph showing changes in the evaluation values in the iterative process according to the second embodiment of the present invention;
fig. 5 is a schematic structural diagram of a route planning device according to a third embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a schematic flow chart of a route planning method according to an embodiment of the present invention, which is applicable to reasonably planning a transportation route of an order to reduce transportation time cost, and the method can be implemented by a route planning device according to an embodiment of the present invention, the route planning device can be implemented by software and/or hardware, and the route planning device can be integrated in an electronic device such as a computer or a server. The method specifically comprises the following steps:
s110, dividing the target point into at least two sub-areas according to the distance between the target points and the area division rule.
S120, performing iterative training on the simulated path between the at least two sub-regions according to at least one path evaluation parameter, and determining a first path between the at least two sub-regions which meets the at least one path evaluation parameter.
S130, generating a target path between the target points according to the second path of each target point in any sub-area and the first path between the at least two sub-areas.
In this embodiment, the destination point is a location point to be visited, and in the field of logistics, the destination point may be a location to be distributed in an area (e.g., a city, an administrative district, or the like). And planning paths among all the target points to form a target path, wherein the formed target path can realize single access to each target point and meets the requirement of at least one path evaluation parameter. When the number of the target points is large, the traditional planning method for each target point has large calculation amount and poor planning efficiency.
The path planning scale is simplified by performing region division on a large number of target points based on a region division rule to form a plurality of sub-regions and form path planning between the sub-regions and path planning of the target points in each sub-region, and the path planning between the sub-regions and the path planning of the target points in each sub-region can be processed in parallel to improve the path planning efficiency.
Optionally, the dividing the target point into at least two sub-areas according to the distance between the target points and the area division rule includes: acquiring first seed target points, and dividing target points, the distance between which and the first seed target points is smaller than a distance threshold value in the region division rule, in each target point to a first sub-region corresponding to the first seed target point; and determining a second seed target point according to the first seed target point in the target points outside the first sub-area, and determining a target point belonging to a second sub-area based on the second seed target point, wherein the target points in the first sub-area and the second sub-area are not overlapped.
The first seed target point of the target points may be determined randomly or according to a starting point of the path, for example, the first seed target point may be a starting point or a target point randomly selected from target points within a preset distance from the starting point.
For example, the first seed target point is labeled as S0Determining each target point and the first seed target point S0A target point Pi whose distance is less than a distance threshold d is determined as belonging to a first seed target point S0Corresponding first sub-region R0Thus, R0=S0+T(S0) Wherein, in the step (A),on the basis of determining the first sub-region, the first sub-target point S may be determined by comparing the first sub-region with the first seed-target point S0And determining the target point with the closest distance as a second seed target point, determining a second sub-area based on the area division rule, and repeating the steps until all the target points are divided.
For example, referring to fig. 2, fig. 2 is a schematic diagram of a seed target point according to an embodiment of the present invention, where the area corresponding to fig. 2 includes 1843 target points, various sub-target points are obtained 198 according to the sub-area division method, each position point in fig. 2 is a seed target point, and each seed target point corresponds to a sub-area.
In the embodiment, a large number of target points are classified into a small number of sub-areas according to the distance division rule, so that the planning requirement of the shortest path is met on the basis of reducing the path planning scale, and the shortest target path is favorably obtained.
It should be noted that the distance in the present embodiment may be a straight-line distance between the target points, or may be a travel distance before the target point.
After the target point is divided into sub-regions, the sub-regions are taken as a whole, and path planning between the sub-regions is performed, wherein the position of the seed target point may be taken as the position of the corresponding sub-region. Optionally, path planning may be performed on each sub-area based on MMMAS (Max-Min Ant System, maximum minimum Ant algorithm). In the iterative planning of the sub-area, at least one path evaluation parameter is used as an evaluation criterion of the planned path, for example, the path evaluation parameter includes, but is not limited to, a path length, an access priority and an access total time. The planned path is evaluated according to the path length, namely, the path planning is carried out based on the shortest path principle, so as to determine the target path with the shortest length. The access priority may be pre-set, for example in the logistics industry, the access priority may be determined according to the order amount and/or delivery time of the target point. And evaluating the planned path according to the access priority to determine the path which is most fit with the access priority. The present embodiment performs path planning based on a plurality of path evaluation parameters, and may generate a first path satisfying the at least one path evaluation parameter.
The first path is a path between the sub-regions. For the target points in each subregion, the second path may be determined according to the access priority of each target point or a path shortest rule. Illustratively, the second path may be generated by connecting the target points in the sub-area according to their range priorities; or combining the paths according to the distance between the target points to generate a second path with the shortest length.
Optionally, the generating a target path between the target points according to the second path of each target point in any sub-region and the first path between the at least two sub-regions includes: and connecting the last target point in the second path of the first sub-area in the first path with the first target point of the second path of the next sub-area in the first path to generate the target path.
According to the technical scheme in the embodiment, at least two sub-areas are obtained according to the distance between the target points and the area division rule, the simulation path between the at least two sub-areas is subjected to iterative training according to at least one path evaluation parameter, a first path between the at least two sub-areas which meets the at least one path evaluation parameter is determined, and the target path between the target points is generated according to a second path of each target point in any sub-area and the first path between the at least two sub-areas. By dividing a large number of target points into regions, a small number of sub-regions are obtained, path planning among the sub-regions and path planning of the target points in each sub-region are formed, the path planning scale is simplified, and the path planning of each part can be processed in parallel, so that the path planning efficiency is improved. Meanwhile, in the path planning process, the target path meeting at least one path evaluation parameter is obtained by taking at least one path evaluation parameter as an optimization target, and multi-target path planning can be realized.
Example two
Fig. 3 is a schematic flow chart of a route planning method provided in an embodiment of the present invention, which is optimized based on the above embodiment, and the method specifically includes:
s210, dividing the target point into at least two subregions according to the distance between the target points and the region division rule.
S220, determining at least one simulation path between the at least two sub-areas, and calculating a path evaluation value of each simulation path according to at least one path evaluation parameter.
And S230, performing iterative optimization on the simulation path between the at least two sub-regions according to the path evaluation value, and generating a first path between the at least two sub-regions which meets the at least one path evaluation parameter.
S240, generating a target path between the target points according to the second path of each target point in any sub-area and the first path between the at least two sub-areas.
In this embodiment, an iterative model of each sub-region is established, where the iterative model includes a path starting point, an pheromone matrix and a distance matrix, where the distance matrix includes a distance between any two sub-regions, and the pheromone matrix includes pheromones between any two sub-regions, where when a simulation path includes a local path from one sub-region to another sub-region, the pheromone of the local path is increased, and the more times the local path is used, the higher the pheromone is, which may be used to assist a subsequent simulation path. It should be noted that the initial pheromone matrix may be preset.
Wherein at least one simulated path from the starting point is determined based on the distance between the sub-regions and the pheromone. Optionally, determining at least one simulation path between the at least two sub-regions includes: for the current sub-region, determining the probability of each feasible sub-region according to the distance between the feasible sub-region of the current sub-region and the pheromone; and determining the next subregion of the current subregion according to the probability of each feasible subregion, and generating the simulation path.
In this embodiment, the feasibility region of the current sub-region is a sub-region outside the determined path, which illustratively includes A, B, C, D, E, F six sub-regions, the determined path is a-B, and the current sub-region is B, then the feasibility region of the current sub-region B is a sub-region outside a and B included in the determined path, that is, the sub-region C, D, E, F not traversed by the determined path.
Determining the probability that the current subregion i moves to the feasible subregion j according to the following formula:
where τ (i, j) is the pheromone between sub-regions i and j, η (i, j) is heuristic information between sub-regions i and j, the heuristic information is the inverse of the distance between sub-regions i and j, α and β are the weight parameters of the pheromone and heuristic information, respectively, and for example, α may be 1, β may be 2, and u is any unverified sub-region.
According to the above probabilities, determining the next sub-region of the current sub-region in each simulation path, exemplarily, for the current sub-region B, the probabilities of moving to the sub-regions C, D, E, and F are P respectivelyBC、PBD、PBE、PBF. . To ensure that the algorithm does not fall into the locally optimal solution, a roulette algorithm is used when determining the next sub-region. The mode of determining the next area is as follows: first a random number η between 0 and 1 is generated,selecting a subregion with a smaller sequence number from subregions to be accessed, determining the subregion to be accessed as a next subregion when the probability of the subregion to be accessed is greater than a random number eta, determining the next subregion to be accessed according to the principle of the smaller sequence number when the probability of the subregion to be accessed is less than the random number eta, accumulating the probability values of the subregions to be accessed, and determining the last accumulated subregion to be accessed as the next subregion when the accumulated probability value is greater than the random number eta; and if the accumulated probability value is larger than the random number and still smaller than the random number eta, continuously determining the next sub-region to be accessed until the accumulated probability value is larger than the random number eta, and determining the next sub-region. Exemplary, when PBCIf the random number is greater than eta, the sub-region C is determined as the next sub-region of the sub-region B, and if not, the judgment P can be carried outBC+PBDIf yes, then sub-region D is determined to be the next sub-region of sub-region B.
In the accumulation process, the next sub-region to be accessed may be determined based on a preset accumulation order, each sub-region may be preset with a sequence number identifier, and the sequence number identifiers of the sub-regions are randomly determined and are not repeated, for example, the sequence number identifiers of the sub-regions A, B, C, D, E, F may be 0, 1, 2, 3, 4, and 5, and in the comparison process of the probability value and the random number η, the sequence of the sequence number identifiers of the sub-regions may be used as the accumulation order of the sub-regions, where the sequence may be from small to large or from large to small. For example, the sequence numbers of the sub-regions to be accessed are 2, 3, 4, and 5, and the sequence may be based on the order from small to large, the probability value of the sub-region with the sequence number of 2 is compared with the random number, and when the probability value is smaller than the random number, the sub-region with the sequence number of 3 is used as the next accumulated sub-region to be accessed, and so on.
It should be noted that the random number η varies at each iteration and each time the next sub-region is selected, so as to increase the randomness of the simulation path, thereby facilitating the finding of the global optimal solution.
In each iteration, a large number of ants are set to search feasible paths simultaneously based on the method, and each ant determines a simulation path. And evaluating the obtained plurality of simulation paths through at least one path evaluation parameter so as to select the optimal simulation path. Optionally, the access priority evaluation value of the simulated path is determined according to the deviation value of the actual access sequence and the standard access sequence of each sub-region in the simulated path, and specifically, the access priority evaluation value of the simulated path may be calculated according to the following formula:
OBJ1=∑kq×|k-seq[Ck]|
where k is the actual access order of the current sub-region, seq [ Ck]And the standard access sequence of the current sub-area is shown, and q is the access priority index of the current sub-area.
In this embodiment, the access priority index of the current sub-area is determined according to the access priority index of each target point in the current sub-area, where the access priority index of the target point is a numerical value of 0 to 1, and optionally, the access priority index of the current sub-area is a mean value of the access priority indexes of each target point in the current sub-area. Correspondingly, the standard access sequence of the current sub-region is determined according to the access priority index of the current sub-region, wherein the access priority is positively correlated with the access priority index, and the higher the access priority index is, the higher the access priority is. The sub-regions may be sorted from large to small according to the access priority index, and the sorting result is the recommended access order of the sub-regions. Illustratively, the sub-regions are sorted according to the access priority indexes to obtain a sorting result of A, B, C, D, E, F, and the recommended access order of the sub-region A, B, C, D, E, F is 0, 1, 2, 3, 4, and 5. When the simulated path is a-C-B-D-E-F, it is known that the actual access sequence of the sub-regions A, B, C, D, E, F is 0, 2, 1, 3, 4, 5, and the access priority evaluation value of the simulated path is obtained according to the deviation between the actual access sequence and the recommended access sequence of each sub-region, where the deviation of the access sequence is the absolute value of the difference between the actual access sequence and the recommended access sequence, for example, the sequence deviation of the sub-region A, D, E, F is 0, and the deviations of the sub-regions B and C are 1, respectively. Note that the smaller the access priority evaluation value is, the higher the degree of similarity between the actual access order and the recommended access order is.
Optionally, the path length of the simulation path may be obtained according to the distance between any two adjacent sub-regions in the simulation path, specifically, the path length of the simulation path is OBJ2=∑i,jdis[i][j]Wherein, sigmai,jdis[i][j]The distance between connected sub-regions i and j in the simulated path.
In this embodiment, the simulated path may be evaluated based on any path evaluation parameter, or may be evaluated based on two or more path evaluation parameters. Illustratively, taking the path length and the access priority as an example, the path evaluation value of the simulated path is generated by performing weighted calculation on the path length and the access priority evaluation value according to the path length and the access priority weight information of the simulated path.
Illustratively, the path evaluation value of the simulated path may be OBJsum=OBJ1+ε×OBJ2Where epsilon is a weight parameter of the second path evaluation parameter (e.g., path length) relative to the first path evaluation parameter (e.g., access priority). Wherein, epsilon is sigma multiplied epsilon0,ε0May be an OBJ1And OBJ2For example:
and m is the number of the subregions, sigma is determined according to the weight bias of the first path evaluation parameter and the second path evaluation parameter, if the first path evaluation parameter is preferentially met, the sigma value is less than 1, if the second path evaluation parameter is preferentially met, the sigma value is greater than 1, and if the first path evaluation parameter and the second path evaluation parameter are in the same status, the sigma value is 1.
In this embodiment, the simulation paths are evaluated by one or more path evaluation parameters to obtain path evaluation values of the respective simulation paths, and the optimal simulation path in the current iteration is determined based on the path evaluation values. Wherein, the smaller the path evaluation value, the better the simulation path. The path evaluation value with the smallest path evaluation value may be determined as the optimal path evaluation value, and accordingly, the simulated path corresponding to the optimal path evaluation value is the optimal simulated path in the current iteration. And updating the pheromone matrix according to the optimal simulation path so as to carry out iterative optimization of the next path.
Optionally, performing iterative optimization on the simulation path between the at least two sub-regions according to the path evaluation value, including: updating pheromones among the sub-regions according to the optimal path evaluation value in the current iteration or the optimal path evaluation value in the historical iteration; and determining at least one new simulation path according to the updated pheromone, and iterating to carry out path optimization based on the at least one new simulation path. The updated value of the pheromone may be determined according to the optimal path evaluation value in the current iteration, or may be determined according to the optimal path evaluation value in the historical iteration. For example, when the number of current iterations is 10, the optimal path evaluation value obtained in the 10 th iteration is the optimal path evaluation (OBJ) in the current iterationsum)iterThe optimal path evaluation values in the 1 st to 10 th iterations are the optimal path evaluation values (OBJ) in the history iterationsum)global。
Correspondingly, the corresponding element in the pheromone matrix is updated according to the local path between the connected sub-regions experienced in the optimal simulation path, for example, when the optimal simulation path is a-B-C-D, the local paths experienced in the optimal simulation path are determined to be a-B, B-C and C-D, and the corresponding element in the pheromone matrix is τA,B,τB,CAnd τC,D。
Wherein, the updating of the elements in the pheromone matrix can beOrWhere τ is the pheromone before updating and τ' is the pheromone after updating.
In this embodiment, in the iteration process of the path planning, the current iteration optimal path is used for the first preset number of iterations in the early stage of the iteration to update the pheromone, and the current iteration optimal path and the historical iteration optimal path are alternately used for the second preset number of iterations in the middle and later stages to update the pheromone. And the sum of the first preset times and the second preset times is the total iteration times. Illustratively, pheromone is updated in the q-th iteration in the middle and later iteration processes based on the optimal path evaluation value in the current iteration, and pheromone is updated in the q + 1-th iteration process based on the optimal path evaluation value in the historical iteration, so that the situation of local optimal solution in the iteration process is avoided, and the optimization precision of path iteration is improved.
Optionally, the updating of the pheromone matrix further includes volatilizing the pheromone, wherein the volatilization coefficient may be 0.02, that is, subtracting 0.02 times of the original pheromone on the basis of the original pheromone.
Optionally, after the pheromone matrix is updated, the updated pheromone is corrected according to the maximum pheromone and the minimum pheromone, when the updated pheromone is larger than the maximum pheromone, the updated pheromone is modified into the maximum pheromone, and when the updated pheromone is smaller than the minimum pheromone, the updated pheromone is modified into the minimum pheromone, so that the possibility of finding the global optimal solution is improved.
Wherein the content of the first and second substances,τmin=l×τmaxand c and l are constants.
And determining at least one new simulation path according to the updated pheromone matrix and the distance matrix, and repeating the steps to evaluate the at least one new simulation path to realize iterative optimization of the path until the iteration times are reached.
For example, referring to fig. 4, fig. 4 is a graph of change of an evaluation value in an iterative process according to a second embodiment of the present invention, where a first target may be an access priority evaluation value, a second target may be a path length, and a total target is a path evaluation value of a path. In fig. 4, the total target value is rapidly and monotonically decreased with the increase of the number of iterations, that is, the path evaluation value of the path is decreased with the increase of the number of iterations, so that the path is continuously optimized.
According to the technical scheme provided by the embodiment, a plurality of simulation paths are created in each iteration, and the simulation paths are evaluated according to at least one path evaluation parameter to determine an optimal evaluation value and an optimal simulation path, so that the next iteration is optimized until a first path meeting at least one path evaluation parameter is obtained. The first path and the second path of each sub-area are used for obtaining a target path traversing each target point, the problem of long path planning time when the number of the target points is large is solved, the path planning efficiency is improved, meanwhile, the generated target path meets a plurality of path evaluation parameters, and the path planning of multiple evaluation targets is realized.
EXAMPLE III
Fig. 5 is a schematic structural diagram of a route planning apparatus provided in the third embodiment of the present invention, the apparatus includes a sub-area determining module 310, a first path determining module 320, and a target path determining module 330, where:
a sub-region determining module 310, configured to divide the target point into at least two sub-regions according to a distance between the target points and a region division rule;
a first path determining module 320, configured to perform iterative training on a simulated path between the at least two sub-regions according to at least one path evaluation parameter, and determine a first path between the at least two sub-regions that meets the at least one path evaluation parameter;
the target path determining module 330 is configured to generate a target path between the target points according to the second path of each target point in any sub-area and the first path between the at least two sub-areas.
Optionally, the sub-region determining module 310 is configured to:
acquiring first seed target points, and dividing target points, the distance between which and the first seed target points is smaller than a distance threshold value in the region division rule, in each target point to a first sub-region corresponding to the first seed target point;
and determining a second seed target point according to the first seed target point in the target points outside the first sub-area, and determining a target point belonging to a second sub-area based on the second seed target point, wherein the target points in the first sub-area and the second sub-area are not overlapped.
Optionally, the first path determining module 320 includes:
a simulated path determination unit for determining at least one simulated path between the at least two sub-regions;
a path evaluation value determination unit for calculating a path evaluation value of each of the simulated paths based on at least one path evaluation parameter;
and the first path determining unit is used for performing iterative optimization on the simulation path between the at least two sub-regions according to the path evaluation value to generate a first path between the at least two sub-regions which meets the at least one path evaluation parameter.
Optionally, the path evaluation parameter includes a path length and an access priority;
optionally, the path evaluation value determining unit is configured to:
respectively calculating the path length and the access priority evaluation value of the simulation path;
and according to the weight information of the path length and the access priority, carrying out weighted calculation on the path length and the access priority evaluation value to generate the path evaluation value.
Optionally, the access priority evaluation value of the simulated path is determined according to the actual access sequence of each sub-area in the simulated path and the deviation value of the standard access sequence, where the standard access sequence of any sub-area is determined according to the access priority of each target point in the sub-area.
Optionally, the analog path determining unit is configured to:
for the current sub-region, determining the probability of each feasible sub-region according to the distance between the feasible sub-region of the current sub-region and the pheromone;
and determining the next subregion of the current subregion according to the probability of each feasible subregion, and generating the simulation path.
Optionally, the first path determining unit is configured to:
updating pheromones among the sub-regions according to the optimal path evaluation value in the current iteration or the optimal path evaluation value in the historical iteration;
and determining at least one new simulation path according to the updated pheromone, and iterating to carry out path optimization based on the at least one new simulation path.
Optionally, the target path determining module 330 is configured to:
and connecting a last target point in a second path of a first subregion in the first path with a first target point in a second path of a next subregion in the first path to generate the target path, wherein the second path of each target point in any subregion is determined according to the access priority of each target point or a shortest path rule.
The route planning device provided by the embodiment of the invention can execute the route planning method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects for executing the route planning method.
Example four
Fig. 6 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. FIG. 6 illustrates a block diagram of an electronic device 412 that is suitable for use in implementing embodiments of the present invention. The electronic device 412 shown in fig. 6 is only an example and should not bring any limitations to the functionality and scope of use of the embodiments of the present invention. The device 412 is typically an electronic device that undertakes image classification functions.
As shown in fig. 6, the electronic device 412 is in the form of a general purpose computing device. The components of the electronic device 412 may include, but are not limited to: one or more processors 416, a storage device 428, and a bus 418 that couples the various system components including the storage device 428 and the processors 416.
Bus 418 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
Electronic device 412 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 412 and includes both volatile and nonvolatile media, removable and non-removable media.
Storage 428 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 430 and/or cache Memory 432. The electronic device 412 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 434 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard drive"). Although not shown in FIG. 6, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk-Read Only Memory (CD-ROM), a Digital Video disk (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 418 by one or more data media interfaces. Storage 428 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
Program 436 having a set (at least one) of program modules 426 may be stored, for example, in storage 428, such program modules 426 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination may comprise an implementation of a network environment. Program modules 426 generally perform the functions and/or methodologies of embodiments of the invention as described herein.
The electronic device 412 may also communicate with one or more external devices 414 (e.g., keyboard, pointing device, camera, display 424, etc.), with one or more devices that enable a user to interact with the electronic device 412, and/or with any devices (e.g., network card, modem, etc.) that enable the electronic device 412 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 422. Also, the electronic device 412 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public Network, such as the internet) via the Network adapter 420. As shown, network adapter 420 communicates with the other modules of electronic device 412 over bus 418. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 412, including but not limited to: microcode, device drivers, Redundant processing units, external disk drive Arrays, disk array (RAID) systems, tape drives, and data backup storage systems, to name a few.
The processor 416 executes programs stored in the storage device 428 to perform various functional applications and data processing, such as implementing the route planning method provided by the above-described embodiments of the present invention.
EXAMPLE five
Fifth embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the route planning method provided in the fifth embodiment of the present invention.
Of course, the computer program stored on the computer-readable storage medium provided by the embodiments of the present invention is not limited to the method operations described above, and may also execute the route planning method provided by any embodiment of the present invention.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable source code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Source code embodied on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer source code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The source code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.