Inspection route planning method based on interpolation algorithm
Through the inspection route planning method based on the interpolation algorithm, the existing technology problems of reduced processing performance of a large number of way points and mandatory endpoint restrictions are solved, and efficient and flexible route planning is achieved, improving accuracy and efficiency, and adapting to complex Scenarios and various inspection needs.
Patent Information
- Application Number
- CN202411124494.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-09-13
AI Technical Summary
The existing technology's route planning performance decreases when processing a large number of way points, the operation is complex, and the end point must be filled in, resulting in insufficient flexibility, and cannot effectively solve the problems of efficiency and flexibility in inspection route planning.
An inspection route planning method based on the interpolation algorithm is adopted. By determining the latitude and longitude coordinates of the starting point and waypoints, the batch route calculation API of the map service is called in batches to generate a distance matrix and time cost matrix, and the interpolation algorithm is used to gradually insert the waypoints for calculation. Optimal routes, allowing route planning without a fixed endpoint.
It improves the accuracy and efficiency of route planning, enhances adaptability to complex scenarios, reduces repeated calculations, optimizes resource utilization, provides a more flexible end-point processing method, and adapts to a variety of inspection needs.
Smart Images

Figure CN118640924A
Abstract
Description
Technical Field
[0001] The present invention relates to a technical field of indicating the operation of a machine, and in particular to a technical field of indicating the operation of a vehicle, and specifically to a method for planning an inspection route based on an interpolation algorithm. Background Art
[0002] Inspection route planning is widely used in many industries, such as logistics distribution, merchant inspection, urban management, etc. As business needs continue to grow, the requirements for route planning technology are also getting higher and higher. Especially when multiple locations need to be visited, how to efficiently and accurately plan the optimal route has become an urgent problem to be solved.
[0003] Traditional route planning methods often rely on existing map services and algorithms, such as Dijkstra algorithm, Algorithms, etc. These methods perform well when processing small-scale data, but as the amount of data increases and the complexity increases, their performance and accuracy may be affected to a certain extent. Especially when a large number of waypoints need to be processed, the limitations of traditional methods become more and more obvious.
[0004] The existing technology, driving route planning service, has strict restrictions on the number of waypoints. In actual business scenarios, especially when a large number of businesses or locations need to be inspected, it is obviously not enough. This limitation leads to the need to plan multiple times when planning the inspection route, which increases the complexity and time cost of the operation. In the existing route planning technology, the end point is a required item. However, in the planning of the inspection route, the end point is often uncertain or does not need to be specially specified. The restriction that the end point must be filled in makes the existing technology appear to be not flexible and adaptable when dealing with inspection route planning.
[0005] Therefore, it is necessary to improve the inspection route planning method in the prior art to solve the above problems. Summary of the invention
[0006] The present invention overcomes the shortcomings of the prior art and provides an inspection route planning method based on an interpolation algorithm, aiming to solve the problems of performance degradation, complex operation and insufficient flexibility caused by the required endpoint when processing a large number of waypoints in the prior art.
[0007] To achieve the above object, the technical solution adopted by the present invention is: a patrol route planning method based on an interpolation algorithm, comprising: S1. Determine the starting point and all passing points of the inspection task, and obtain the longitude and latitude coordinates of each starting point and passing point; S2, determine the means of transportation, call the batch route calculation API of the map service in batches, and pass in the coordinates of the starting point and the passing point in S1; S3, processing the results returned by the batch route calculation API, including: the relative distance between the starting point and the passing point in S1 and the time consumed by the vehicle inspection; and outputting the results as a distance matrix and a time cost matrix; S4, simulate the interpolation algorithm based on the starting point and the passing point in S1, and plan the inspection route in combination with the distance matrix and the time cost matrix in S3; S5. Output the optimal route plan.
[0008] In a preferred embodiment of the present invention, in step S1, the data of the starting point and all the waypoints are obtained by manual input, importing from a database or by GPS positioning; assuming that the starting point is , the waypoint is , is the number of waypoints.
[0009] In a preferred embodiment of the present invention, in step S2, the means of transportation are determined, including: driving, motorcycle, electric vehicle or bicycle, walking; and the batch route calculation API provided by the map service is used to calculate the relative distance between locations and the time consumed by the means of transportation inspection.
[0010] In a preferred embodiment of the present invention, the method of batch calling includes: Will and As a starting point, As the end point, the distance matrix and time cost matrix are calculated; and As a starting point, As the end point, calculate the distance matrix and time cost matrix; and so on, until and As a starting point, As the end point, the distance matrix and the time cost matrix are calculated.
[0011] In a preferred embodiment of the present invention, in step S3, a Distance Matrix for: ,in, Indicate location To the location The distance; the results returned by the API fill the matrix ; Create one Time Cost Matrix for: ,in, Indicate location To the location The time overhead of the API is to fill the matrix with the results returned. .
[0012] In a preferred embodiment of the present invention, step S4 includes the following sub-steps: S41. Set up two sets Record the points on the interpolation simulation route and the points not on the interpolation simulation route. Used to record points on the interpolation simulation route. Used to record points that are not on the interpolation simulation route; Initially, Only starting point , Including all waypoints: , ; S42, selecting points that are not on the interpolation simulation route to perform simulation interpolation on points on the route; S43, repeat step S42 until All points in are moved to In this case, all the waypoints are added to the interpolation simulation route; S44, The points in are arranged in the order of insertion to form an inspection route.
[0013] In a preferred embodiment of the present invention, in step S42, the specific simulation interpolation includes: a.From Select a waypoint and place it in middle; b. For One of the remaining points in Different positions in the form of multiple solutions; c. Calculate the distance and time values of each route plan based on the distance matrix and time cost matrix; d. Select the route with the smallest distance or time value as the preferred option; e. Update collection and , and move the remaining selected points from Move to .
[0014] In a preferred embodiment of the present invention, before step S42, All waypoints , and put it as the first waypoint In the subsequent step S42, the interpolation operation is performed until All points in are moved to In the process of optimizing the inspection route, the total distance or total time cost of each route plan is calculated according to the distance matrix and the time cost matrix, and the plan with the shortest total distance or the least total time is selected as the optimal plan; the optimal plans of different route points are compared, and finally the global optimal inspection route is selected.
[0015] In a preferred embodiment of the present invention, when there is a fixed end point, initially, Only starting point and end point , Including all waypoints: , ; When selecting points that are not on the interpolation simulation route to simulate interpolation of points on the route, the end point is not inserted each time the interpolation is performed. In the following scheme, step S43 is executed to obtain the optimal path with a fixed end point.
[0016] The present invention provides an inspection route planning system based on an interpolation algorithm, comprising: The data input module is used to obtain the latitude and longitude coordinates of the starting point of the inspection task and all the passing points; The data preprocessing module is used to preprocess the latitude and longitude coordinate data of the starting point and all passing points of the inspection task; The map service API calling module is used to select the means of transportation according to the input starting point and all the waypoints coordinates, and call the batch route calculation API of the map service in batches; Map service API result processing module, used to calculate the relative distance and time consumption between the starting point and all the passing points, and output the distance matrix and time cost matrix; A simulation interpolation algorithm module, used for gradually inserting waypoints into the interpolation simulation route through a simulation interpolation algorithm; A route planning module is used to calculate the total distance or total time cost of each interpolation simulation route according to the starting point, the passing points, the distance matrix and the time cost matrix, and compare them; The optimal route output module selects the optimal solution and outputs the planned optimal route in an appropriate form for users to view and use.
[0017] The present invention solves the defects existing in the background technology and has the following beneficial effects: (1) The present invention realizes an efficient and flexible inspection route planning method by combining the acquisition of longitude and latitude coordinates of the starting point and the passing points, the batch calling of the map service API, the generation of the distance matrix and the time cost matrix, the route planning of the simulation interpolation algorithm and the output of the optimal route. Compared with the prior art, the present invention not only improves the accuracy and efficiency of route planning, but also enhances the adaptability to complex scenarios, and further achieves the effect of optimizing resource allocation and improving inspection efficiency.
[0018] (2) The present invention selects a suitable means of transportation in step S2, and calls the batch route calculation API of the map service in batches to calculate the relative distance and time between locations. All points include: ; For each batch of starting points ,in From 1 to , are any two adjacent points among all points; As the starting point, select the starting point as ,Will As an end point, this batch calling method effectively solves the problem of API call number limit and improves the utilization of computing resources. Compared with the existing technology, this method not only reduces repeated calculations, but also optimizes the calculation process, making the generation of distance matrix and time cost matrix more efficient and accurate.
[0019] (3) The simulation interpolation algorithm in step S4 of the present invention gradually inserts waypoints into the route and calculates the total distance or total time cost of each possible route, thereby reducing the amount of calculation and improving the calculation efficiency when processing a large number of waypoints. Without considering the end point, the simulation interpolation algorithm can explore a variety of possible path combinations instead of being limited to planning the inspection route with a specific end point. In view of the fact that there are various factors in the prior art that cause the original end point to be no longer applicable or need to be changed, the present invention allows route planning without a fixed end point, so that inspection personnel can respond to these changes more flexibly.
[0020] (4) In step S4, the present invention searches for a local optimal solution by using a simulated interpolation algorithm. In the second embodiment, a double-layer traversal is performed to treat all waypoints as the first waypoints for simulated interpolation operations to obtain a global optimal solution. The combination of the two enables route planning to obtain a local optimum and search for an optimal solution in a global scope. Compared with the prior art, the accuracy and efficiency of route planning are further improved.
[0021] (5) The present invention combines the situation where there is a fixed endpoint, includes the endpoint at the beginning, and does not insert the solution after the endpoint during the interpolation process, so as to plan the optimal path under the situation where there is a fixed endpoint. Compared with the restriction that the endpoint must be filled in in the prior art, the present invention provides a more flexible endpoint processing method and adapts to the planning requirements of more inspection routes. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. Figure 1 is a flow chart of a preferred embodiment of the present invention; DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0024] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below. Embodiment 1
[0025] A patrol route planning method based on an interpolation algorithm, comprising: S1. Determine the starting point and all passing points of the inspection task, and obtain the longitude and latitude coordinates of each starting point and passing point; S2, determine the means of transportation, call the batch route calculation API of the map service in batches, and pass in the coordinates of the starting point and the passing point in S1; S3, processing the results returned by the batch route calculation API, including: the relative distance between the starting point and the passing point in S1 and the time consumed by the vehicle inspection; and outputting the results as a distance matrix and a time cost matrix; S4, simulate the interpolation algorithm based on the starting point and the passing point in S1, and plan the inspection route in combination with the distance matrix and the time cost matrix in S3; S5. Output the optimal route plan.
[0026] The present invention does not consider the existence of a specific end point. In the inspection task, the end point is not necessarily predetermined or is not as important as the waypoint. The present invention allows planning without a specific end point as a prerequisite, thereby improving the adaptability and flexibility of the planning method. Traditional route planning services usually require the specification of an end point, which increases the complexity of the operation in some cases. The interpolation algorithm can explore multiple possible path combinations, thereby making it possible to find a global optimal solution, rather than being limited to a local optimal solution based on a specific end point.
[0027] Interpolation algorithm is a mathematical method used to estimate or predict the value of unknown data points between given discrete data points. Inspection route planning based on interpolation algorithm is a technical method that uses interpolation algorithm to solve the inspection path optimization problem. In the inspection task, it is necessary to determine the optimal path from the starting point to each waypoint to ensure the efficiency and accuracy of the inspection work. However, in actual scenarios, the number of waypoints is very large and the distribution is complex. Direct path planning faces problems such as large amount of calculation and unsatisfactory results. Therefore, the present invention implements inspection route planning based on interpolation algorithm.
[0028] Steps S1-S3 obtain the latitude and longitude coordinates of the starting point and all the passing points of the inspection task, use the batch route calculation API of the map service to calculate and process the distance between each pair of locations, and finally output a distance matrix and time cost matrix to provide basic data for subsequent route planning.
[0029] In step S1, the data of the departure point and all the waypoints are obtained by manual input, importing from a database, or by GPS positioning; Set the starting point to , the waypoint is , is the number of waypoints; In step S2, a means of transportation is selected, including driving, motorcycle, electric vehicle or bicycle, or walking; and a batch route calculation API provided by the map service is used to calculate the relative distance between locations and the time required for inspection using the means of transportation; When calling the batch route calculation API at one time, there is a limit on the number of routes calculated and the product of the number of starting and ending points. In this case, the batch calling method is adopted.
[0030] Specifically, and As a starting point, As the end point, the distance matrix and time cost matrix are calculated; and As a starting point, As the end point, calculate the distance matrix and time cost matrix; and so on, until and As a starting point, The distance matrix and time cost matrix are calculated as the end points; the generated distance matrix covers the distance information from more starting points to all end points, and can provide more comprehensive and accurate distance and time information, thereby supporting more efficient route planning and decision making.
[0031] All points include: ; For each batch of starting points ,in From 1 to , are any two adjacent points among all points; As the starting point, select the starting point as ,Will As an end point.
[0032] The batch calling method is not limited to fixed start and end point combinations, but flexibly selects start point pairs based on actual conditions, thereby more comprehensively covering all possible route combinations; each call targets a relatively concentrated set of locations, reducing unnecessary repeated calculations and making more efficient use of the API's computing resources.
[0033] In step S3, create a Distance Matrix for: ,in, Indicate location To the location The distance; the results returned by the API fill the matrix ; Create one Time Cost Matrix for: ,in, Indicate location To the location The time overhead of the API is to fill the matrix with the results returned. ; Step S4, through the simulation interpolation algorithm, gradually insert the waypoints into the route, and calculate the total distance or total time cost of each possible route, select the optimal solution, and finally obtain the optimal route for the inspection task.
[0034] In step S4, the steps of simulating the interpolation algorithm to plan the route include: S41. Set up two sets Record the points on the interpolation simulation route and the points not on the interpolation simulation route. Used to record points on the interpolation simulation route. Used to record points that are not on the interpolation simulation route; Initially, Only starting point , Including all waypoints: , ; S42, selecting points that are not on the interpolation simulation route to perform simulation interpolation on points on the route; a.From Select a waypoint and place it in middle; Specifically, Put in At this time, , ; b. For One of the remaining points in Different positions in the form of multiple solutions; Specifically, Put in At this time, there are two insertion schemes: (1) , ; (2) , ; c. Calculate the distance and time values of each route plan based on the distance matrix and time cost matrix; Through the distance matrix , calculate the distance value of the two insertion schemes; The distance is ; The distance is ; Through the time cost matrix , calculate the time value of the insertion plan; The distance is ; The distance is ; d. Select the route with the smallest distance or time value as the preferred option; Compare and , the route plan with the minimum distance value is Shortest distance route planning for three points; comparison and , the route plan with the minimum time value is Shortest time route planning for three points; e. Update collection and , and move the remaining selected points from Move to ; S43, repeat step S42 until All points in are moved to In this case, all the waypoints are added to the interpolation simulation route; S44, The points in the are arranged in the order of insertion to form the optimal inspection route. Embodiment 2
[0035] In the first embodiment, each time a new point is inserted, The order of other points in the set is fixed, and the final set is The order in is the local optimal solution; In order to obtain the global optimal solution, before step S42, All waypoints , and put it as the first waypoint In the subsequent step S42, the interpolation operation is performed until All points in are moved to In; implement double-layer traversal to ensure that all paths are obtained; According to the distance matrix and time cost matrix, the total distance or total time cost of each route plan is calculated, and the plan with the shortest total distance or the least total time is selected as the optimal plan; the optimal plans of different route points are compared, and finally the optimal inspection route is selected. Embodiment 3
[0036] In the first and second embodiments, there is no endpoint. When there is a fixed endpoint: Initially, Only starting point and end point , Including all waypoints: , ; When selecting points that are not on the interpolation simulation route to simulate interpolation of points on the route, the end point is not inserted each time the interpolation is performed. In the following scheme, step S43 is executed to obtain the optimal path with a fixed end point. Embodiment 4
[0037] An inspection route planning system based on an interpolation algorithm comprises: The data input module is used to obtain the latitude and longitude coordinates of the starting point of the inspection task and all the passing points; The data preprocessing module is used to preprocess the latitude and longitude coordinate data of the starting point and all passing points of the inspection task; The map service API calling module is used to select the means of transportation according to the input starting point and all the waypoints coordinates, and call the batch route calculation API of the map service in batches; Map service API result processing module, used to calculate the relative distance and time consumption between the starting point and all the passing points, and output the distance matrix and time cost matrix; A simulation interpolation algorithm module, used for gradually inserting waypoints into the interpolation simulation route through a simulation interpolation algorithm; A route planning module is used to calculate the total distance or total time cost of each interpolation simulation route according to the starting point, the passing points, the distance matrix and the time cost matrix, and compare them; The optimal route output module is used to select the optimal solution and output the planned optimal route in an appropriate form for users to view and use.
[0038] The above is based on the ideal embodiment of the present invention. Through the above description, relevant personnel can make various changes and modifications without departing from the technical concept of the present invention. The technical scope of the present invention is not limited to the content in the specification, and the technical scope must be determined according to the scope of the claims.
Claims
1. A patrol route planning method based on an interpolation algorithm, characterized in that: The following steps are involved: S1. Determine the starting point and all passing points of the inspection task, and obtain the longitude and latitude coordinates of each starting point and passing point; S2, determine the means of transportation, call the batch route calculation API of the map service in batches, and pass in the coordinates of the starting point and the passing point in S1; S3, processing the results returned by the batch route calculation API, including: the relative distance between the starting point and the passing point in S1 and the time consumed by the vehicle inspection; and outputting the results as a distance matrix and a time cost matrix; S4, simulate the interpolation algorithm based on the starting point and the waypoints in S1, and plan the inspection route in combination with the distance matrix and the time cost matrix in S3; S5. Output the optimal route plan.
2. The inspection route planning method based on interpolation algorithm according to claim 1, characterized in that: In step S1, the data of the starting point and all the waypoints are obtained by manual input, importing from a database or by GPS positioning; assuming that the starting point is , the waypoint is , is the number of waypoints.
3. The inspection route planning method based on interpolation algorithm according to claim 1, characterized in that: In step S2, the means of transportation are determined, including driving, motorcycle, electric vehicle or bicycle, and walking; and the batch route calculation API provided by the map service is used to calculate the relative distance between locations and the time consumed by the means of transportation for inspection.
4. The inspection route planning method based on interpolation algorithm according to claim 2 is characterized in that: The batch calling methods include: Will and As a starting point, As the end point, the distance matrix and time cost matrix are calculated; and As a starting point, As the end point, calculate the distance matrix and time cost matrix; and so on, until and As a starting point, As the end point, the distance matrix and the time cost matrix are calculated.
5. The inspection route planning method based on interpolation algorithm according to claim 2 is characterized in that: In step S3, create a Distance Matrix for: ,in, Indicate location To the location The distance; the results returned by the API fill the matrix ; Create one Time Cost Matrix for: ,in, Indicate location To the location The time overhead of the API is to fill the matrix with the results returned. .
6. The inspection route planning method based on interpolation algorithm according to claim 5 is characterized in that: Step S4 includes the following sub-steps: S41. Set up two sets Record the points on the interpolation simulation route and the points not on the interpolation simulation route. Used to record points on the interpolation simulation route. Used to record points that are not on the interpolation simulation route; Initially, Only starting point , Including all waypoints: , ; S42, selecting points that are not on the interpolation simulation route to perform simulation interpolation on points on the route; S43, repeat step S42 until All points in are moved to In this case, all the waypoints are added to the interpolation simulation route; S44, The points in are arranged in the order of insertion to form an inspection route.
7. The inspection route planning method based on interpolation algorithm according to claim 6 is characterized in that: In step S42, the specific simulation interpolation includes: a.From Select a waypoint and place it in middle; b. For One of the remaining points in Different positions in the form of multiple solutions; c. Calculate the distance and time values of each route plan based on the distance matrix and time cost matrix; d. Select the route with the smallest distance or time value as the preferred option; e. Update collection and , and move the remaining selected points from Move to .
8. The inspection route planning method based on interpolation algorithm according to claim 7 is characterized in that: Before step S42, All waypoints , and put it as the first waypoint In the subsequent step S42, the interpolation operation is performed until All points in are moved to In the process of optimizing the inspection route, the total distance or total time cost of each route plan is calculated according to the distance matrix and the time cost matrix, and the plan with the shortest total distance or the least total time is selected as the optimal plan; the optimal plans of different route points are compared, and finally the global optimal inspection route is selected.
9. The inspection route planning method based on interpolation algorithm according to claim 7, characterized in that: When there is a fixed endpoint, initially, Only starting point and end point , Including all waypoints: , ; When selecting points that are not on the interpolation simulation route to simulate interpolation of points on the route, the end point is not inserted each time the interpolation is performed. In the following scheme, step S43 is executed to obtain the optimal path with a fixed end point.
10. A patrol route planning system based on an interpolation algorithm, based on the patrol route planning method based on an interpolation algorithm according to any one of claims 1 to 9, characterized in that: include: The data input module is used to obtain the latitude and longitude coordinates of the starting point of the inspection task and all the passing points; The data preprocessing module is used to preprocess the latitude and longitude coordinate data of the starting point and all passing points of the inspection task; The map service API calling module is used to select the means of transportation according to the input starting point and all the waypoints coordinates, and call the batch route calculation API of the map service in batches; Map service API result processing module, used to calculate the relative distance and time consumption between the starting point and all the passing points, and output the distance matrix and time cost matrix; A simulation interpolation algorithm module, used for gradually inserting waypoints into the interpolation simulation route through a simulation interpolation algorithm; A route planning module is used to calculate the total distance or total time cost of each interpolation simulation route according to the starting point, the passing points, the distance matrix and the time cost matrix, and compare them; The optimal route output module is used to select the optimal solution and output the planned optimal route for users to view and use.
Citation Information
Patent Citations
A dynamic logistics scheduling method
CN108985597A
Intelligent path planning method and system and electronic equipment
CN113159457A
Logistics path planning method and system based on industrial internet identifier analysis
CN117010581A
Application method of improved queue jumping algorithm in path planning
CN117848366A
