Path planning method and device, computer device and storage medium
By converting the target location coordinates of a small-scale map to coordinates of a large-scale map and combining this with genetic algorithm optimization, the problem of decreased path planning ability of small-scale models in large-scale maps is solved, achieving stable migration of the model in different scale environments and improving the quality of path planning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- MINZU UNIVERSITY OF CHINA
- Filing Date
- 2026-04-10
- Publication Date
- 2026-05-29
Smart Images

Figure CN122108153A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of path planning technology, specifically to a path planning method, apparatus, computer equipment, and storage medium. Background Technology
[0002] The Traveling Salesman Problem (TSP) describes a scenario where a traveling salesman needs to visit a series of cities, each visited only once, and finally return to the starting city. The goal is to find a closed loop with the shortest total path length. As a classic NP-hard combinatorial optimization problem, this problem has wide applications in logistics, electrical wiring, and other fields. In recent years, end-to-end TSP solvers based on deep reinforcement learning have shown great potential.
[0003] However, those skilled in the art have found that when applying the above model to real-world scenarios, its performance is heavily dependent on the scale consistency between training and testing data. Specifically, if the model is trained on a small-scale map and then directly applied to solve TSP on a large-scale map, its path planning ability will decrease significantly.
[0004] Therefore, there is an urgent need for a method that can stably transfer small-scale trained models to large-scale application environments without changing the parameters of the trained models. Summary of the Invention
[0005] In view of this, this application proposes a path planning method, apparatus, computer device and storage medium to solve the problem that applying a path planning model trained on a small-scale map to a large-scale map in related technologies can easily lead to a decrease in path planning capability.
[0006] A first aspect of this application provides a path planning method, the method comprising: In response to a path planning instruction, the first coordinates of multiple target locations within a target area are obtained; the first coordinates of the multiple target locations are located in a first-scale map of the target area. For any target location, the first coordinates are converted into corresponding second coordinates; the second coordinates are located in a second-scale map, and the scale of the second-scale map is smaller than that of the first-scale map; The second coordinates of the multiple target locations are input into the path planning model to obtain the access sequence of the multiple target locations; the path planning model is trained based on the second-scale map; Based on the access sequence and the first coordinates of the plurality of target locations, a final planned path for accessing the plurality of target locations is generated.
[0007] This application's embodiments transform the coordinates of each target location from first coordinates on a first-scale map to second coordinates on a second-scale map. The second coordinates of multiple target locations are then input into the path planning model to obtain a visit sequence for multiple target locations. Based on the visit sequence and the first coordinates of the multiple target locations, a final planned path for visiting these multiple target locations is generated. This method enables stable migration of a small-scale trained model to a large-scale application environment without changing the parameters of the trained model. It allows the model to demonstrate excellent solution capabilities for TSPs of different scales, ensuring its versatility.
[0008] In this embodiment of the application, converting the first coordinates into the corresponding second coordinates includes: The maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the maximum value of the vertical coordinate, and the minimum value of the vertical coordinate are determined from the first coordinates of the plurality of target locations; The first calculation value of the horizontal coordinate is obtained by subtracting the minimum value of the horizontal coordinate from the horizontal coordinate of the first coordinate, and the first calculation value of the vertical coordinate is obtained by subtracting the minimum value of the vertical coordinate from the vertical coordinate of the first coordinate. The second calculation amount of the horizontal coordinate is calculated based on the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, and the preset value; and the second calculation amount of the vertical coordinate is calculated based on the maximum value of the vertical coordinate, the minimum value of the vertical coordinate, and the preset value. The first horizontal coordinate is obtained by dividing the first calculation amount of the horizontal coordinate by the second calculation amount of the horizontal coordinate, and the first vertical coordinate is obtained by dividing the first calculation amount of the vertical coordinate by the second calculation amount of the vertical coordinate. The second coordinate is generated based on the first x-coordinate and the first y-coordinate.
[0009] In this embodiment of the application, the method further includes: The preset value is 10 when the first difference between the maximum and minimum values of the horizontal coordinate is zero, or the second difference between the maximum and minimum values of the vertical coordinate is zero. -9 Positive numbers of the order of magnitude; When both the first difference and the second difference are not zero, the preset value is zero.
[0010] In this embodiment of the application, converting the first coordinates into the corresponding second coordinates includes: Determine the maximum values of the horizontal and vertical coordinates in the first-scale map; Divide the x-coordinate in the first coordinate system by the maximum value of the x-coordinate to obtain the second x-coordinate, and divide the y-coordinate in the first coordinate system by the maximum value of the y-coordinate to obtain the second y-coordinate; The second coordinate is generated based on the second x-coordinate and the second y-coordinate.
[0011] In this embodiment of the application, the second coordinates of the plurality of target locations are input into the path planning model to obtain the access sequence of the plurality of target locations, including: For any one of the plurality of target locations, the target location is taken as the start point and the end point; The second coordinates of the multiple target locations and the second coordinates of the starting point and the ending point are input into the path planning model to obtain a first access sequence with the target locations as the starting point and the ending point. The path lengths of multiple first access sequences that correspond one-to-one with the multiple target locations are compared, and the few second access sequences with the shortest path lengths are selected. The target access sequence for the multiple target locations is generated based on the multiple second access sequences.
[0012] In this embodiment of the application, generating a target access sequence for the plurality of target locations based on the plurality of second access sequences includes: The aforementioned second access sequences are used as the initial population for the genetic algorithm; In the coordinate space of the second-scale map, a preset number of genetic operations are performed on the initial population, the genetic operations including at least crossover, mutation and selection operations; The optimal access sequence is obtained through iterative optimization of the genetic operation and is used as the target access sequence; the fitness is determined based on the actual total path length of the corresponding access sequence.
[0013] This application's embodiments use several second visit sequences output by the model as the initial population of the genetic algorithm, which makes up for the defect that the genetic algorithm needs to spend a lot of time removing useless solutions when no effective initial population is provided, resulting in low quality of the final output planning path; in addition, this application can greatly improve the quality of the final output planning path through iterative optimization of genetic operations.
[0014] In this embodiment of the application, the scale of the second scale map is 1*1, and the scale of the first scale map is 100*100.
[0015] An embodiment of the second aspect of this application provides a path planning apparatus, characterized in that the apparatus comprises: The first coordinate acquisition module is used to acquire the first coordinates of multiple target locations within a target area in response to a path planning instruction; the first coordinates of the multiple target locations are located in a first-scale map of the target area; The coordinate transformation module is used to convert the first coordinate of any target location into a corresponding second coordinate; the second coordinate is located in a second-scale map, and the scale of the second-scale map is smaller than the scale of the first-scale map; The access sequence generation module is used to input the second coordinates of the multiple target locations into the path planning model to obtain the access sequence of the multiple target locations; the path planning model is trained based on the second-scale map; The final planned path generation module is used to generate a final planned path for visiting the multiple target locations based on the access sequence and the first coordinates of the multiple target locations.
[0016] An embodiment of the third aspect of this application provides a computer device including a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the path planning method described in the first aspect by executing the computer instructions.
[0017] An embodiment of the fourth aspect of this application provides a computer-readable storage medium storing computer instructions for causing a computer to perform the path planning method described in the first aspect above.
[0018] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0019] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 A flowchart illustrating a path planning method provided in an embodiment of this application is shown. Figure 2 This illustration shows a schematic diagram of a first access sequence output by a path planning model provided in an embodiment of this application, with the target location as the starting and ending point; Figure 3 This illustration shows a schematic diagram of the structure of a path planning device provided in one embodiment of this application; Figure 4 This illustration shows a schematic diagram of the structure of a computer device according to an embodiment of this application; Figure 5 A schematic diagram of a storage medium provided in one embodiment of this application is shown. Detailed Implementation
[0020] Exemplary embodiments of this application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of this application and to fully convey the scope of this application to those skilled in the art.
[0021] It should be noted that, unless otherwise stated, the technical or scientific terms used in this application shall have the ordinary meaning as understood by one of ordinary skill in the art to which this application pertains.
[0022] According to an embodiment of this application, a path planning method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0023] This embodiment provides a path planning method. Figure 1 This is a flowchart of a path planning method according to an embodiment of this application, such as... Figure 1 As shown, the process includes the following steps: Step S101: In response to the path planning instruction, obtain the first coordinates of multiple target locations within the target area.
[0024] Specifically, the first coordinates of the plurality of target locations are located in a first-scale map of the target area, wherein the scale of the first-scale map includes, but is not limited to, 100*100.
[0025] In some specific embodiments, multiple target locations within the target area are determined based on path planning instructions sent by the user. For example, when a user wants to travel to multiple scenic spots a1, a2, and a3 in Province A, they will send a path planning instruction containing the coordinates of a1, a2, and a3 to the server.
[0026] In some specific embodiments, the application scenarios of the path planning method provided in this application are not specifically limited. In addition to the above-mentioned tourism scenarios, it can also be applied to scenarios such as logistics distribution and circuit wiring.
[0027] Step S102: For any target location, convert the first coordinate into the corresponding second coordinate.
[0028] Specifically, the second coordinate is located in a second-scale map, the scale of which is smaller than that of the first-scale map, and the scale of the second-scale map includes, but is not limited to, 1*1.
[0029] In some specific embodiments, step S102 above includes steps a1-a5: Step a1: Determine the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the maximum value of the vertical coordinate, and the minimum value of the vertical coordinate from the first coordinates of the plurality of target locations.
[0030] Specifically, for example: when there are 3 city coordinates: A (100, 250), B (400, 600) and C (700, 800), where x_min=100, x_max=700, y_min=250, y_max=800.
[0031] Step a2: Subtract the minimum value of the horizontal coordinate from the horizontal coordinate of the first coordinate to obtain the first calculated value of the horizontal coordinate, and subtract the minimum value of the vertical coordinate from the vertical coordinate of the first coordinate to obtain the first calculated value of the vertical coordinate.
[0032] Specifically, for example: the first calculated value of the x-axis of A is 100-100=0, the first calculated value of the x-axis of B is 400-100=300, and the first calculated value of the x-axis of C is 700-100=600; the first calculated value of the y-axis of A is 250-250=0, the first calculated value of the y-axis of B is 600-250=350, and the first calculated value of the y-axis of C is 800-250=550.
[0033] Step a3: Calculate the second calculation amount of the horizontal coordinate based on the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, and the preset value; and calculate the second calculation amount of the vertical coordinate based on the maximum value of the vertical coordinate, the minimum value of the vertical coordinate, and the preset value.
[0034] Specifically, for example: the second calculation of the horizontal coordinates of A, B, and C is 700-100=600; the second calculation of the vertical coordinates of A, B, and C is 800-250=550.
[0035] In some specific embodiments, step a3 above includes steps a31-a32: Step a31: When the first difference between the maximum and minimum values of the horizontal coordinate is zero, or the second difference between the maximum and minimum values of the vertical coordinate is zero, the preset value is 10. -9 A positive number of magnitude.
[0036] Specifically, for example: the second calculation of the x-coordinates of A, B, and C is 700 - 100 + 10. -9The second calculation for the ordinates of A, B, and C is 800 - 250 + 10. -9 .
[0037] Step a32: When both the first difference and the second difference are not zero, the preset value is zero.
[0038] In this embodiment, to prevent a base of 0 due to the maximum and minimum values being the same (which would mean the cities are all on a line, and should not occur in practical applications), a preset value of 10 is added to the difference between the maximum and minimum values. -9 This is to avoid problems such as program crashes or the generation of infinite values due to division by zero.
[0039] Step a4: Divide the first calculated value of the horizontal coordinate by the second calculated value of the horizontal coordinate to obtain the first horizontal coordinate, and divide the first calculated value of the vertical coordinate by the second calculated value of the vertical coordinate to obtain the first vertical coordinate.
[0040] Specifically, for example: the first x-coordinate of point A: x'=(100-100) / 600=0, the first y-coordinate of point A: y'=(250-250) / 550=0; the first x-coordinate of point B: x'=(400-100) / 600=0.5, the first y-coordinate of point B: y'=(600-250) / 550≈0.64; the first x-coordinate of point C: x'=(700-100) / 600=1, the first y-coordinate of point C: y'=(800-250) / 550=1.
[0041] Step a5: Generate the second coordinate based on the first horizontal coordinate and the first vertical coordinate.
[0042] Specifically, for example: Point A: x'=(100-100) / 600=0, y'=(250-250) / 550=0 → (0, 0); Point B: x'=(400-100) / 600=0.5, y'=(600-250) / 550≈0.64 → (0.5, 0.64) Point C: x'=(700-100) / 600=1, y'=(800-250) / 550=1 → (1, 1) The second coordinates are obtained as follows: point A → (0, 0), point B → (0.5, 0.64), point C → (1, 1).
[0043] In this embodiment of the application, in order to distribute multiple target locations as evenly as possible in the second-scale map, it is necessary to find the maximum and minimum values of the x and y coordinates, and then subtract the corresponding minimum value from the x and y coordinates of each city and divide by the difference between the maximum and minimum values.
[0044] In some specific embodiments, step S102 above includes steps b1-b3: Step b1: Determine the maximum value of the horizontal coordinate and the maximum value of the vertical coordinate in the first-scale map.
[0045] Step b2: Divide the x-coordinate in the first coordinate system by the maximum value of the x-coordinate to obtain the second x-coordinate, and divide the y-coordinate in the first coordinate system by the maximum value of the y-coordinate to obtain the second y-coordinate.
[0046] Step b3: Generate the second coordinate based on the second horizontal coordinate and the second vertical coordinate.
[0047] In this embodiment of the application, scaling can be achieved by finding the maximum values of x and y and then dividing all city coordinates by the corresponding maximum values.
[0048] Step S103: Input the second coordinates of the multiple target locations into the path planning model to obtain the access sequence of the multiple target locations.
[0049] Specifically, the path planning model is trained based on the second-scale map.
[0050] In some specific embodiments, step S103 above includes steps S1031-S1034: Step S1031: For any one of the plurality of target locations, take the target location as the start point and the end point.
[0051] Step S1032: Input the second coordinate positions of the multiple target locations and the second coordinate positions of the starting point and the ending point into the path planning model to obtain a first access sequence with the target locations as the starting point and the ending point.
[0052] Specifically, the first access sequence output by the path planning model, with the target location as the starting and ending point, is as follows: Figure 2 As shown, this is a closed-loop structure with the same starting and ending point.
[0053] More specifically, for example: if there are 5 cities A / B / C / D / E, then the following will be generated respectively: Multiple first-visit sequences with point A as the starting and ending point, for example: starting point A → ... → ending point A; Multiple first-visit sequences with point B as the starting and ending point, for example: starting point B → ... → ending point B; Its purpose is to ensure that the final path can form a closed loop and return to the starting point (such as logistics delivery returning to the warehouse).
[0054] Step S1033: Compare the path lengths of the multiple first access sequences that correspond one-to-one with the multiple target locations, and select the several second access sequences with the shortest path lengths.
[0055] Specifically, path length refers to the sum of the distances between adjacent points in the sequence plus the closed distance to return to the starting point.
[0056] More specifically, the path lengths of all first-visit sequences are compared, and the first-visit sequences with the shortest path lengths among the Top-K sequences are retained as second-visit sequences to reduce subsequent computation. The value of K is not specifically limited; for example, when the total number is 100, 10 is retained.
[0057] Step S1034: Generate target access sequences for the multiple target locations based on the multiple second access sequences.
[0058] Specifically, the second access sequence with the shortest path length among the K sequences can be selected as the final output target access sequence. Alternatively, a crossover operation (such as PMX crossover in a genetic algorithm) can be performed on the K sequences to obtain the target access sequence.
[0059] In some specific embodiments, step S1034 above includes steps c1-c3: Step c1: Use the plurality of second access sequences as the initial population for the genetic algorithm; Step c2: Perform a preset number of genetic operations on the initial population in the coordinate space of the second-scale map.
[0060] Specifically, the genetic operations include at least crossover, mutation, and selection operations; In some specific embodiments, the crossover operation includes, but is not limited to, PMX (partial mapping crossover) and OX (sequential crossover), for example: Parent generation 1: [A→B→C→D→E]; Parent generation 2: [A→D→B→E→C]; Swap intermediate segments to generate offspring: [A→D→C→B→E].
[0061] In some specific embodiments, mutation operations include, but are not limited to, exchange mutation, inversion mutation, and insertion mutation, for example: Swap Mutation: Randomly swap the locations of two cities [A,B,C,D] → [A,D,C,B] Reverse mutation: Reverse the subsequence [A,B,C,D] → [A,C,B,D] Insertion mutation: Moving a city to a new location.
[0062] In some specific embodiments, the selection operation includes, but is not limited to, elite retention and preset rounds, for example: Elite retention: The best individuals from each generation are directly replicated into the next generation; Preset number of rounds: usually 50-200 generations, or "termination if there is no improvement for 10 consecutive generations".
[0063] Step c3: The optimal access sequence is obtained through iterative optimization of the genetic operation and is used as the target access sequence.
[0064] Specifically, the fitness is determined based on the total actual path length of the corresponding access sequence; the shorter the total actual path length, the higher the corresponding fitness.
[0065] In some specific embodiments, the iterative optimization process is as follows: Generation 0: Initial population (K elite sequences); Generation 1: Crossover / mutation → Generate offspring → Selection → Retain the best; Generation n: The population gradually converges to the global optimum or near-optimal; Termination output: Target access sequence, the individual with the highest fitness in the last generation.
[0066] In this embodiment of the application, the iterative optimization method achieves a higher accuracy in planning the optimal path compared to a single candidate solution.
[0067] In this embodiment, multiple solutions from the vector-scaled model (i.e., several second-visit sequences output by the path planning model mentioned above, where the model uses POMO to generate solutions starting from different origins, and can select the N shortest paths as needed) are fed into the GA for population initialization, instead of letting the GA randomly generate solutions for iteration. Making the best solutions provided by the model the parents of the GA helps the algorithm iterate faster. Finally, using the GA for 500 or 1000 iterations on the scaled graph yields even better results.
[0068] The advantage of this approach is that it overcomes the drawback of GA (Generalized Aspect-Oriented Solutions), which requires a significant amount of time to remove useless solutions when no valid initial solution is provided, resulting in lower solution quality. Combining the advantages of both approaches allows for closer approximation of the optimal solution while maintaining general applicability. In practice, the number of iterations in GA can be adjusted to obtain a better solution with maximum efficiency; for example, instead of 1000 iterations, only 500 or even fewer iterations may be needed.
[0069] Step S104: Generate a final planned path for visiting the multiple target locations based on the access sequence and the first coordinates of the multiple target locations.
[0070] Specifically, based on the sequential order of all target locations in the access sequence, the corresponding first coordinate of each target location can be extracted from the first coordinate list, thereby obtaining the first coordinate of each target location in the access sequence, and then forming the final planned path through the first coordinates of all target locations in the access sequence.
[0071] The embodiments of this application have the following technical effects: Reinforcement learning models based on preference optimization have shown significant breakthroughs in solving problems such as TSP and CVRP compared to previous models. However, they have not yet considered the model's general applicability across different scales. To improve its ability to solve TSPs on large-scale maps, the vector scaling proposed in this application (i.e., converting the first coordinate to the corresponding second coordinate) allows the model to demonstrate its excellent solution capabilities even when facing TSPs at different scales, ensuring its general applicability. Furthermore, to improve the quality of the planned paths output by the model, several second-visit sequences output by the model can be further iterated using a heuristic algorithm (such as the aforementioned GA). This leverages the advantages of both methods to obtain the best possible path planning.
[0072] Corresponding to the above implementation methods of path planning, this application also provides a path planning apparatus for executing the path planning method described in any of the above embodiments. For example... Figure 3 As shown, the path planning device includes: The first coordinate acquisition module is used to acquire the first coordinates of multiple target locations within a target area in response to a path planning instruction; the first coordinates of the multiple target locations are located in a first-scale map of the target area; The coordinate transformation module is used to convert the first coordinate of any target location into a corresponding second coordinate; the second coordinate is located in a second-scale map, and the scale of the second-scale map is smaller than the scale of the first-scale map; The access sequence generation module is used to input the second coordinates of the multiple target locations into the path planning model to obtain the access sequence of the multiple target locations; the path planning model is trained based on the second-scale map; The final planned path generation module is used to generate a final planned path for visiting the multiple target locations based on the access sequence and the first coordinates of the multiple target locations.
[0073] Optionally, the coordinate transformation module is further configured to determine the maximum and minimum values of the horizontal coordinate, the maximum and minimum values of the vertical coordinate, and the minimum value of the vertical coordinate from the first coordinates of the plurality of target locations; to obtain a first calculated value of the horizontal coordinate by subtracting the minimum value of the horizontal coordinate from the first coordinate, and to obtain a first calculated value of the vertical coordinate by subtracting the minimum value of the vertical coordinate from the first coordinate; to calculate a second calculated value of the horizontal coordinate based on the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, and a preset value, and to calculate a second calculated value of the vertical coordinate based on the maximum value of the vertical coordinate, the minimum value of the vertical coordinate, and the preset value; to obtain a first horizontal coordinate by dividing the first calculated value of the horizontal coordinate by the second calculated value of the horizontal coordinate, and to obtain a first vertical coordinate by dividing the first calculated value of the vertical coordinate by the second calculated value of the vertical coordinate; and to generate the second coordinate based on the first horizontal coordinate and the first vertical coordinate.
[0074] Optionally, the coordinate transformation module is further configured to set the preset value to 10 when the first difference between the maximum and minimum values of the horizontal coordinate is zero, or the second difference between the maximum and minimum values of the vertical coordinate is zero. -9 A positive number of magnitude; when both the first difference and the second difference are not zero, the preset value is zero.
[0075] Optionally, the coordinate transformation module is further configured to determine the maximum value of the horizontal coordinate and the maximum value of the vertical coordinate in the first-scale map; divide the horizontal coordinate in the first coordinate by the maximum value of the horizontal coordinate to obtain the second horizontal coordinate, and divide the vertical coordinate in the first coordinate by the maximum value of the vertical coordinate to obtain the second vertical coordinate; and generate the second coordinate based on the second horizontal coordinate and the second vertical coordinate.
[0076] Optionally, the access sequence generation module is further configured to: for any one of the plurality of target locations, take the target location as the start and end point; input the second coordinate positions of the plurality of target locations and the second coordinate positions of the start and end points into the path planning model to obtain a first access sequence with the target location as the start and end point; compare the path lengths of the plurality of first access sequences that correspond one-to-one with the plurality of target locations, and select several second access sequences with the shortest path lengths; and generate a target access sequence for the plurality of target locations based on the several second access sequences.
[0077] Optionally, the access sequence generation module is further configured to use the plurality of second access sequences as the initial population of the genetic algorithm; perform a preset number of genetic operations on the initial population in the coordinate space of the second-scale map, the genetic operations including at least crossover, mutation and selection operations; and obtain the access sequence with optimal fitness through the iterative optimization of the genetic operations as the target access sequence; the fitness is determined according to the actual total path length of the corresponding access sequence.
[0078] The path planning device and the path planning method provided in the above embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the applications stored therein.
[0079] This application also provides a computer device for executing the above-described path planning method. Please refer to... Figure 4 This illustrates a schematic diagram of a computer device provided by some embodiments of this application. For example... Figure 4 As shown, the computer device 4 includes: a processor 400, a memory 401, a bus 402, and a communication interface 403. The processor 400, the communication interface 403, and the memory 401 are connected via the bus 402. The memory 401 stores a computer program that can run on the processor 400. When the processor 400 runs the computer program, it executes the path planning method provided in any of the foregoing embodiments of this application.
[0080] The memory 401 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 403 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network.
[0081] Bus 402 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. Memory 401 is used to store programs. After receiving an execution instruction, processor 400 executes the program. The path planning method disclosed in any of the foregoing embodiments can be applied to processor 400, or implemented by processor 400.
[0082] The processor 400 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 400 or by instructions in software form. The processor 400 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 401. The processor 400 reads the information in memory 401 and, in conjunction with its hardware, completes the steps of the above method.
[0083] The computer device and the path planning method provided in this application are based on the same inventive concept and have the same beneficial effects as the methods they employ, operate, or implement.
[0084] This application also provides a computer-readable storage medium corresponding to the path planning method provided in the foregoing embodiments. Please refer to... Figure 5 The computer-readable storage medium shown is an optical disc 30, on which a computer program (i.e., a program product) is stored. When the computer program is run by a processor, it executes the path planning method provided in any of the foregoing embodiments.
[0085] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical and magnetic storage media, which will not be elaborated here.
[0086] The computer-readable storage medium provided in the above embodiments of this application and the path planning method provided in the embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the applications stored therein.
[0087] It should be noted that: Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of this application may be practiced without these specific details. In some instances, well-known structures and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0088] Similarly, it should be understood that, for the sake of brevity and to aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of this application, various features of this application are sometimes grouped together in a single embodiment, figure, or description thereof. However, this disclosure should not be construed as reflecting a schematic diagram in which the claimed application requires more features than expressly recited in each claim. Rather, as reflected in the following claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of this application.
[0089] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features but not others included in other embodiments, combinations of features from different embodiments are intended to be within the scope of this application and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.
[0090] The above description is merely a preferred embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A path planning method, characterized in that, The method includes: In response to a path planning instruction, the first coordinates of multiple target locations within a target area are obtained; the first coordinates of the multiple target locations are located in a first-scale map of the target area. For any target location, the first coordinates are converted into corresponding second coordinates; the second coordinates are located in a second-scale map, and the scale of the second-scale map is smaller than that of the first-scale map; The second coordinates of the multiple target locations are input into the path planning model to obtain the access sequence of the multiple target locations; the path planning model is trained based on the second-scale map; Based on the access sequence and the first coordinates of the plurality of target locations, a final planned path for accessing the plurality of target locations is generated.
2. The method according to claim 1, characterized in that, Converting the first coordinate to the corresponding second coordinate includes: The maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the maximum value of the vertical coordinate, and the minimum value of the vertical coordinate are determined from the first coordinates of the plurality of target locations; The first calculation value of the horizontal coordinate is obtained by subtracting the minimum value of the horizontal coordinate from the horizontal coordinate of the first coordinate, and the first calculation value of the vertical coordinate is obtained by subtracting the minimum value of the vertical coordinate from the vertical coordinate of the first coordinate. The second calculation amount of the horizontal coordinate is calculated based on the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, and the preset value; and the second calculation amount of the vertical coordinate is calculated based on the maximum value of the vertical coordinate, the minimum value of the vertical coordinate, and the preset value. The first horizontal coordinate is obtained by dividing the first calculation amount of the horizontal coordinate by the second calculation amount of the horizontal coordinate, and the first vertical coordinate is obtained by dividing the first calculation amount of the vertical coordinate by the second calculation amount of the vertical coordinate. The second coordinate is generated based on the first x-coordinate and the first y-coordinate.
3. The method according to claim 2, characterized in that, The method further includes: The preset value is 10 when the first difference between the maximum and minimum values of the horizontal coordinate is zero, or the second difference between the maximum and minimum values of the vertical coordinate is zero. -9 Positive numbers of the order of magnitude; When both the first difference and the second difference are not zero, the preset value is zero.
4. The method according to claim 1 or 2, characterized in that, Converting the first coordinate to the corresponding second coordinate includes: Determine the maximum values of the horizontal and vertical coordinates in the first-scale map; Divide the x-coordinate in the first coordinate system by the maximum value of the x-coordinate to obtain the second x-coordinate, and divide the y-coordinate in the first coordinate system by the maximum value of the y-coordinate to obtain the second y-coordinate; The second coordinate is generated based on the second x-coordinate and the second y-coordinate.
5. The method according to claim 1 or 2, characterized in that, The second coordinates of the multiple target locations are input into the path planning model to obtain the access sequence of the multiple target locations, including: For any one of the plurality of target locations, the target location is taken as the start point and the end point; The second coordinates of the multiple target locations and the second coordinates of the starting point and the ending point are input into the path planning model to obtain a first access sequence with the target locations as the starting point and the ending point. The path lengths of multiple first access sequences that correspond one-to-one with the multiple target locations are compared, and the few second access sequences with the shortest path lengths are selected. The target access sequence for the multiple target locations is generated based on the multiple second access sequences.
6. The method according to claim 5, characterized in that, Generating target access sequences for the plurality of target locations based on the plurality of second access sequences includes: The aforementioned second access sequences are used as the initial population for the genetic algorithm; In the coordinate space of the second-scale map, a preset number of genetic operations are performed on the initial population, the genetic operations including at least crossover, mutation and selection operations; The optimal access sequence is obtained through iterative optimization of the genetic operation and is used as the target access sequence; the fitness is determined based on the actual total path length of the corresponding access sequence.
7. The method according to claim 1 or 2, characterized in that, The second-scale map has a scale of 1*1, while the first-scale map has a scale of 100*100.
8. A path planning device, characterized in that, The device includes: The first coordinate acquisition module is used to acquire the first coordinates of multiple target locations within a target area in response to a path planning instruction; the first coordinates of the multiple target locations are located in a first-scale map of the target area; The coordinate transformation module is used to convert the first coordinate of any target location into a corresponding second coordinate; the second coordinate is located in a second-scale map, and the scale of the second-scale map is smaller than the scale of the first-scale map; The access sequence generation module is used to input the second coordinates of the multiple target locations into the path planning model to obtain the access sequence of the multiple target locations; the path planning model is trained based on the second-scale map; The final planned path generation module is used to generate a final planned path for visiting the multiple target locations based on the access sequence and the first coordinates of the multiple target locations.
9. A computer device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the path planning method of any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the path planning method according to any one of claims 1 to 7.