A method, system and device for electric quantity constrained distribution path planning

CN122596790APending Publication Date: 2026-08-18GUANGDONG UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610727940.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-25
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0004]本发明的目的是提供一种带电量约束的配送路径规划方法、系统及设备,通过对配送点的空间分布与区域边界进行几何特征分析,结合两阶段蚁群优化算法与电量可行性判断机制,解决传统路径规划方法在电量约束下适应性差、充电策略单一及收敛性能不佳等问题,使得电动物流车能够根据配送点分布、充电桩位置及剩余电量自动调整行驶路径,优化配送时间与能源消耗,同时适应复杂多变的城市配送环境,提高配送效率与安全性

Benefits of technology

[0062] Beneficial Effects: Compared to existing technologies, this invention discloses a delivery route planning method with power constraints, primarily addressing the route planning problem of electric logistics vehicles in complex urban delivery environments. It represents delivery points as coordinate sets and constructs a distance matrix to simulate the actual driving path of the vehicle. Based on the distribution of delivery points and the configuration of charging piles, a two-stage ant colony optimization method is employed. The first stage uses a greedy seed and biased exploration strategy to quickly locate the high-quality solution space. The second stage uses biased utilization and lightweight optimization to finely solve for the optimal path. A power incentive factor is introduced to dynamically guide vehicles to charging piles when the remaining power is insufficient. A comprehensive cost function is designed to comprehensively consider driving time, charging time, and power violation penalties to fully evaluate the path's merits. An enhanced pheromone update mechanism is constructed, providing double rewards for historical best solutions and assigning decreasing weights to elite solutions according to their ranking, accelerating algorithm convergence while maintaining population diversity. A phased local optimization strategy combining strong 2-opt and lightweight 2-opt is adopted to balance optimization effects and computational overhead. Based on the planning model, the optimal delivery path is output, generating a power change curve and power depletion warning information, with color-coded road segments indicating different power states. In urban delivery tasks using electric logistics vehicles, the aforementioned invention improves delivery efficiency, effectively reduces the risk of breakdowns en route due to insufficient battery power and the time cost of additional recharge trips, and provides an efficient and reliable solution to the delivery route planning problem under irregular regional distribution and limited battery power constraints. Furthermore, this invention supports optional charging pile configuration, regional boundary restrictions, and dynamic distance calculation using third-party map APIs, exhibiting broad business applicability and good system robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122596790A_ABST
    Figure CN122596790A_ABST
Patent Text Reader

Abstract

The application discloses a kind of electric quantity restraint's distribution path planning method, system and equipment, comprising: obtaining distribution point and area boundary information etc., construct distance matrix and initialize parameter;According to parameter setting and distribution task, construct the path planning model based on two-stage ant colony optimization, first stage is with greedy seed and bias exploration to construct path, introduce electric quantity incentive factor, by strong 2-opt improves the rapidity of path search;Second stage is with standard probability and bias to utilize fine search, by light 2-opt improves the stability of path search;According to the path planning model, carry out global search training, while real-time calculation comprehensive cost, obtain global optimal distribution path solution;Finally output optimal distribution path and electric quantity depletion early warning information, mark depletion position and generate charging pile setting suggestion.The application solves the problem that path planning under electric quantity constraint is poor in adaptability, charging strategy is single and convergence performance is poor, effectively improves distribution efficiency and task reliability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent logistics and route optimization technology, specifically relating to a delivery route planning method, system and equipment that combines charging pile settings and regional restrictions under vehicle battery constraints. It is applicable to route optimization for new energy vehicles in scenarios with multiple delivery points, charging piles and regional restrictions. Background Technology

[0002] Traditional logistics and distribution primarily rely on fuel-powered trucks and manual driving for goods transportation. However, manual delivery is labor-intensive and inefficient, especially in urban areas with complex terrain or scattered delivery points, making it difficult to guarantee timely and economical delivery. While mechanical delivery is more efficient than manual, it is limited by road networks and vehicle range, leading to issues such as route redundancy and high empty-running rates, resulting in energy waste and increased delivery costs. With the development of new energy technologies, electric logistics vehicles, with their advantages of being environmentally friendly, low-noise, and low-operating-cost, are gradually becoming an important force in urban delivery. This not only reduces carbon emissions but also provides a sustainable development solution for the logistics industry.

[0003] However, existing delivery route planning methods suffer from low planning efficiency, poor adaptability, and insufficient power management when faced with power constraints and irregular delivery areas. For example, in scenarios requiring multiple round trips or passing through charging stations, traditional methods struggle to adapt to dynamic power changes, leading to vehicle breakdowns or additional recharges, increasing delivery time and energy consumption. Furthermore, irregular distribution of delivery points and complex regional boundaries are prevalent in reality, but existing research largely focuses on regular areas or ignores charging station configurations, failing to meet actual business needs. In addition, existing methods often employ simple maximum distance limits or forced charging strategies when dealing with power constraints, lacking dynamic modeling of power consumption and intelligent decision-making regarding charging timing. The failure to consider charging stations as an incentive factor during node selection results in ineffective guidance for vehicle recharging when power is low. Simultaneously, existing technologies lack proactive detection and early warning of power depletion points and cannot visually display sections with insufficient power, leading to higher risks in actual route planning. Therefore, a delivery route planning method with power constraints is needed to address these issues, enhance the adaptability of electric vehicles in complex environments, and improve delivery operation efficiency and safety. Summary of the Invention

[0004] The purpose of this invention is to provide a delivery route planning method, system, and device with power constraints. By analyzing the geometric features of the spatial distribution and regional boundaries of delivery points, and combining a two-stage ant colony optimization algorithm with a power feasibility judgment mechanism, this invention solves the problems of poor adaptability, single charging strategy, and poor convergence performance of traditional route planning methods under power constraints. This enables electric logistics vehicles to automatically adjust their driving routes based on the distribution of delivery points, the location of charging piles, and the remaining power, thereby optimizing delivery time and energy consumption. At the same time, it adapts to the complex and ever-changing urban delivery environment, improving delivery efficiency and safety.

[0005] To achieve the above objectives, this invention provides a delivery route planning method with power constraints. It works by establishing an intelligent planning model that combines two-stage ant colony optimization with power feasibility assessment. Specifically, the method includes: acquiring delivery point and area boundary information, constructing a distance matrix, and initializing parameters; based on the parameter settings and delivery task, constructing a path planning model based on two-stage ant colony optimization. In the first stage, a greedy seed and biased exploration are used to construct the path, introducing a power incentive factor and improving the speed of path search through strong 2-opt; in the second stage, standard probability and biased fine-grained search are used, and lightweight 2-opt is used to improve the stability of path search; based on the path planning model, global search training is performed, and the comprehensive cost is calculated in real time to obtain the globally optimal delivery route solution; finally, the optimal delivery route and power depletion warning information are output, the depletion location is marked, and charging pile setting suggestions are generated. This method solves the problems of poor adaptability of path planning under power constraints, single charging strategy, and poor convergence performance, effectively improving delivery efficiency and task reliability.

[0006] This invention provides a delivery route planning method with power constraints, comprising:

[0007] Preferably, a delivery environment model is constructed and its parameters are initialized, specifically as follows:

[0008] The system approximates the actual urban delivery area into a set of delivery point coordinates and an index of available charging stations, while also supporting area boundary constraints. Specifically, users input the latitude and longitude coordinates of delivery points via map clicks or place name searches. The system then automatically calls the Amap API to retrieve the POI names and detailed addresses of each delivery point, forming a set of delivery points. Each delivery point includes a name, latitude and longitude coordinates, and address attributes; it also accepts optional charging pile nodes marked by users, forming a charging pile index set. Users define the set of vertices for the boundary of a polygonal region by clicking on the map. This is used to define the effective delivery range.

[0009] Construct a distance matrix between delivery points. First, use the Gaode Maps driving route planning API to obtain the actual road distances between each delivery point. If the API call fails or the network is unavailable, use the Haversine formula to calculate the great circle distance between two points as an alternative. The Haversine formula is:

[0010]

[0011] R is the Earth's radius (taken as 6,371,000 meters). , The latitude in radians is the value of the two points. , Let λ be the latitude and longitude in radians between two points, and Δϕ and Δλ be the difference between latitude and longitude, respectively; traverse all delivery point pairs to construct a distance matrix. .

[0012] Initialize ant colony algorithm parameters: Set the number of ants Number of iterations pheromone weight coefficient Heuristic weighting coefficients pheromone volatilization rate Pheromones intensity Q; Initialize vehicle electrical constraint parameters: Set battery capacity (Unit: kWh), Initial Energy Ratio ∈(0,1] (Initial charge) Energy consumption per unit distance (Unit: kWh / km) Charging power (Unit: kW) Average driving speed (Unit: km / h) Set charging strategies, including "Full Charge Strategy" (charge to full capacity each time) or "Sufficient Ratio Strategy" (charge to a preset ratio). (Then stop); complete the construction of the environment model and the initialization of all parameters.

[0013] Preferably, the first stage of optimization is performed to achieve exploration and rapid convergence, specifically as follows:

[0014] A greedy algorithm is used to construct multiple initial solutions as seed sources to guide subsequent searches. The specific process is as follows: starting from the delivery origin, each time a node is not visited, the nearest feasible candidate node is selected and visited. This process is repeated until all nodes have been visited, and finally, the path returns to the origin, forming a complete path. The criteria for determining a feasible candidate node are: sufficient remaining battery power to reach the node and at least return to the origin, or the node is a charging station node. The above process is repeated. Next, generate A greedy initial solution is selected and added as the initial seed to the solution set for the first stage. The number of greedy initial solutions... Set the number of ants to one-third of the total ant population to ensure a sufficient seed population that does not dominate subsequent searches. Ants select the next node with the following probabilities:

[0015]

[0016] in: = .

[0017] The pheromone concentration represents the path. The degree of pheromone accumulation on the body; For heuristic information; and Increase pheromone weights and decrease heuristic weights respectively to improve the algorithm's early exploration capabilities.

[0018] As the energy excitation factor, :

[0019]

[0020] otherwise .

[0021] Each ant selects the next node sequentially according to the above probability formula, and updates its remaining power in real time: if the current node is a charging station and meets the charging conditions, it charges according to the preset charging strategy (the "fully charged strategy" restores the power to the preset level). The "sufficient proportion strategy" restores the battery level to [a certain percentage]. Then deduct the energy consumed in traveling to the next node. Update the remaining battery level. Repeat the above process until all nodes have been visited, and finally return to the starting point to form a complete path.

[0022] Execution of elite solutions Round 2-opt optimization reverses path segments to find a better solution. Pheromones are updated according to the following formula:

[0023]

[0024] in:

[0025]

[0026]

[0027] For pheromone evaporation rate, For the current path The pheromone concentration on the surface, where Q is the pheromone intensity constant. This is the globally optimal path found by the algorithm so far. For ants The overall cost of the constructed path, The incremental pheromone left by the ants in this iteration, 2.0 Contributes to enhancing the historical optimal solution. For the front The weighted contribution of each elite solution is calculated, with higher-ranked solutions receiving greater weight. Through this mechanism, the first phase rapidly converges to the high-quality solution space.

[0028] Preferably, the second stage of optimization is performed to achieve utilization and fine-grained search, specifically as follows:

[0029] In the second phase, the ant selects the next node according to the standard probability formula:

[0030]

[0031] Among them, standard weighting coefficients are used. and The candidate list size is increased to twice the normal size to balance search efficiency with solution quality; power excitation factor. The value selection rules are the same as in the first stage. Lightweight 2-opt optimization is performed only on the top 20% of the better solutions in the current generation, with the number of optimization rounds being [number missing]. The remaining solutions are directly retained to reduce computational overhead. The standard pheromone is updated according to the following formula:

[0032]

[0033] in, The contribution of all ants in this iteration The contribution of historically optimal solutions is reduced to a weight of 1.5; elite solutions are no longer additionally weighted to maintain population diversity and prevent premature convergence. Through the above mechanisms, the second stage performs a fine-grained search within the high-quality solution space, steadily converging to the optimal solution.

[0034] Preferably, the comprehensive cost of the path is calculated to obtain the globally optimal delivery path solution, specifically as follows:

[0035] During route planning, the merits of each route are quantitatively evaluated using a comprehensive cost function. This comprehensive cost function takes into account driving time cost, charging time cost, and penalty cost for exceeding battery capacity limits. The calculation formula is as follows:

[0036]

[0037] The travel time is the sum of the travel times of the vehicle on each road segment. The calculation formula is:

[0038]

[0039] The actual road distance between two adjacent nodes (in meters) is divided by 1000 to convert it to kilometers. The average speed of the vehicle; Travel time (in minutes).

[0040] Charging time is the time consumed by the vehicle while it is at a charging station. Charging is triggered when the vehicle arrives at a charging station and its remaining battery level is below the charging threshold. The charging time is calculated using the following formula:

[0041]

[0042] The charging strategy is "fully charged". If the charging strategy is a "sufficient proportion strategy": .in, Battery capacity (kWh). The remaining power (kWh) upon arrival at the charging station. The preset minimum charging ratio (e.g., 0.8). This refers to the charging power (kW). If the vehicle does not pass a charging station or does not require recharging, then... = 0.

[0043] The battery depletion penalty is used to quantify the degree of battery shortage along the path. The system simulates the battery level changes as the vehicle travels along the path, updating the remaining battery level segment by segment:

[0044]

[0045] in, The remaining energy (kWh) after reaching the t-th node. Energy consumption per unit distance (kWh / km). If the current node is a charging station, charging will be performed before deducting energy consumption. When the remaining battery level becomes negative after driving a certain section of road, it indicates that the battery is depleted. Cumulative battery violation amount. The sum of the absolute values ​​of the power deficit of all nodes:

[0046]

[0047] λ represents the penalty weight for power consumption violations, used to balance time cost and power consumption feasibility. A larger value for λ indicates a lower tolerance for power consumption violations, and a greater tendency to choose power-feasible paths. Depending on actual business needs, the value of λ ranges from 100 to 10000, with a default setting of 1000.

[0048] During the path construction process, the system continuously assesses whether the remaining battery power is sufficient to reach the next node. < If the power consumption is 1.2 (low battery), the charging station incentive mechanism will be triggered, adjusting the node selection probability. Factors guide ants to prioritize charging station nodes. Through the aforementioned comprehensive cost calculation mechanism, the system can comprehensively evaluate the time efficiency and energy feasibility of a path, ensuring the safety and economy of the output path in actual execution.

[0049] Preferably, the optimal path is output and a low battery warning is generated, with a visual display provided, specifically as follows:

[0050] After the algorithm has iterated, the path with the minimum overall cost is output as the optimal delivery path. The output includes: Path sequence: a list of delivery point names arranged in the order of visit, in the format: Start → Point A → Point B → ... → Start; Overall cost: the f(path*) value of the optimal path; Total travel distance: = Unit: kilometers; Total travel time: Unit: minutes; Total charging time: Unit: minutes; Number of charging times: the number of times charging actually occurs during the path.

[0051] When the user has not configured a charging station (i.e., a charging station set) When the vehicle is traveling along the optimal path, the system performs a battery depletion detection. The specific process involves simulating battery level changes along the optimal path and updating the remaining battery level segment by segment. If the battery level is depleted on a certain segment... After driving If the value is less than 0, the road segment is determined to be a power depletion segment, and the following information is recorded: Depletion location: node Coordinates; Exhausted road section: Remaining battery power: The remaining battery power before driving. Power consumption required: Energy consumption required for this section of road. .

[0052] Plot a curve showing the change in remaining battery power as a function of cumulative driving distance, including: Horizontal axis: Cumulative driving distance (unit: km); Vertical axis: Remaining battery power (unit: kWh); Curve: Solid blue line represents the trajectory of battery power change; Reference line: Dashed red line represents the full charge line, solid red line represents the depleted battery line (0 kWh); Charging marker: Add a green vertical line marker at the location where charging occurs; Depleted battery marker: If a depleted battery point exists, add a red X mark and text annotation at the corresponding location.

[0053] Node marking rules: Start / End Point: Red star; Charging Station: Green lightning bolt; Regular Delivery Point: Blue circle; Battery Depletion Point: Red battery marker with warning pop-up. Add a numbered circular label to each delivery point, indicating the order in which the point was visited (Station 1, Station 2, etc.), making it easier for users to intuitively understand the path sequence. Add a legend box to the lower right corner of the map to explain the meaning of various markers and road segments, helping users quickly understand the visualization results. Plot the algorithm convergence curve, with the horizontal axis representing the number of iterations and the vertical axis representing the current optimal cost, showing the optimization progress of the algorithm during the iteration process, facilitating user evaluation of algorithm performance. Through the above output and warning mechanisms, users can intuitively obtain the optimal delivery route, battery change trends, and potential risk information, effectively assisting delivery decisions.

[0054] To address the aforementioned technical problems, the present invention also provides a delivery route planning device with power constraints, comprising:

[0055] The data acquisition module receives the latitude and longitude coordinates of the delivery point input by the user through the map interaction interface, supporting two input methods: map click to add and place name search; it receives the optional charging pile index and polygon area boundary vertex set marked by the user; it receives the delivery point POI name, detailed address and road distance data returned by the third-party map API; and it receives ant colony algorithm parameters and vehicle power constraint parameters to provide a data foundation for subsequent route planning.

[0056] The calculation module constructs a distance matrix between delivery points, prioritizing the use of the Gaode Map driving route planning API to obtain actual road distances. If the API call fails, it automatically switches to the Haversine formula to calculate the great circle distance. The first stage of optimization employs a greedy seed initialization and biased exploration node selection strategy to construct paths, introduces a power incentive factor to guide low-power charging, performs strong 2-opt optimization on elite solutions, and rapidly converges to the high-quality solution space through an enhanced pheromone update mechanism. The second stage of optimization uses a standard probability and biased exploitation strategy for fine-grained search, performs lightweight 2-opt optimization on preferred solutions, and stably converges to the optimal solution through a standard pheromone update mechanism. The module calculates the comprehensive cost of each path, including travel time, charging time, and power violation penalties, and outputs the optimal path sequence and various performance indicators.

[0057] The output module is responsible for outputting the route planning results generated by the calculation module to the user or vehicle dispatch system, including the optimal delivery route sequence, total driving distance, total driving time, total charging time, and number of charging times; generating a power change curve to show the trend of remaining power as driving distance changes; and using color to distinguish road segments with different power states on the map (red for low power segments, green for segments after charging, and blue for normal power segments).

[0058] The algorithm identifies road segments where the battery is depleted and generates charging station placement suggestions; it outputs an algorithm convergence process graph and a detailed road segment information table to evaluate the effectiveness of optimizing the current path planning strategy.

[0059] To address the aforementioned technical problems, the present invention also provides a delivery route planning device with power constraints, comprising:

[0060] The memory is used to store computer programs, delivery point coordinate data, distance matrix, ant colony algorithm parameters, vehicle power constraint parameters, and charging pile configuration information.

[0061] When the processor executes the computer program stored in the memory, it implements the steps of the power-constrained delivery route planning method described in any of the preceding claims.

[0062] Beneficial Effects: Compared to existing technologies, this invention discloses a delivery route planning method with power constraints, primarily addressing the route planning problem of electric logistics vehicles in complex urban delivery environments. It represents delivery points as coordinate sets and constructs a distance matrix to simulate the actual driving path of the vehicle. Based on the distribution of delivery points and the configuration of charging piles, a two-stage ant colony optimization method is employed. The first stage uses a greedy seed and biased exploration strategy to quickly locate the high-quality solution space. The second stage uses biased utilization and lightweight optimization to finely solve for the optimal path. A power incentive factor is introduced to dynamically guide vehicles to charging piles when the remaining power is insufficient. A comprehensive cost function is designed to comprehensively consider driving time, charging time, and power violation penalties to fully evaluate the path's merits. An enhanced pheromone update mechanism is constructed, providing double rewards for historical best solutions and assigning decreasing weights to elite solutions according to their ranking, accelerating algorithm convergence while maintaining population diversity. A phased local optimization strategy combining strong 2-opt and lightweight 2-opt is adopted to balance optimization effects and computational overhead. Based on the planning model, the optimal delivery path is output, generating a power change curve and power depletion warning information, with color-coded road segments indicating different power states. In urban delivery tasks using electric logistics vehicles, the aforementioned invention improves delivery efficiency, effectively reduces the risk of breakdowns en route due to insufficient battery power and the time cost of additional recharge trips, and provides an efficient and reliable solution to the delivery route planning problem under irregular regional distribution and limited battery power constraints. Furthermore, this invention supports optional charging pile configuration, regional boundary restrictions, and dynamic distance calculation using third-party map APIs, exhibiting broad business applicability and good system robustness.

[0063] The present invention also provides a delivery route planning device or equipment with power constraints, which has the same beneficial effects as the above method. Attached Figure Description

[0064] Figure 1A flowchart illustrating a delivery route planning method with power constraints provided by the present invention;

[0065] Figure 2 This is a schematic diagram of the delivery environment model provided by the present invention, showing the distribution of delivery points, charging pile markings, and area boundary polygons.

[0066] Figure 3 This is a schematic diagram of the two-stage ant colony algorithm model framework provided by the present invention;

[0067] Figure 4 A schematic diagram illustrating the optimal delivery route planning results with charging pile configuration provided by the present invention;

[0068] Figure 5 This is a schematic diagram of the power depletion warning and path visualization results under the configuration without charging piles provided by the present invention.

[0069] Figure 6 The power change curve provided for this invention;

[0070] Figure 7 A schematic diagram of a delivery route planning device with power constraints provided by the present invention;

[0071] Figure 8 A schematic diagram of a delivery route planning device with power constraints provided by the present invention. Detailed Implementation

[0072] To better illustrate the objectives and advantages of the present invention, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0073] Example:

[0074] Please refer to Figure 1 , Figure 1 A flowchart illustrating a delivery route planning method with power constraints provided by the present invention specifically includes:

[0075] Step 1: Obtain information such as delivery points and regional boundaries, construct a distance matrix, and initialize parameters.

[0076] Specifically, users input the latitude and longitude coordinates of delivery points via map clicks or place name search. The system then automatically calls the Gaode Maps API to retrieve the POI names and detailed addresses of each delivery point, forming a set of delivery points. Delivery points include regular delivery points and optional charging station nodes, which are marked by the user on the map. Simultaneously, users can define a set of polygonal region boundary vertices via map clicks to limit the effective delivery area, such as... Figure 2 As shown.

[0077] Specifically, a distance matrix between delivery points is constructed. The Gaode Maps driving route planning API is called first to obtain the actual road distances between each delivery point; if the API call fails or the network is unavailable, the Haversine formula is used to calculate the great circle distance between two points as an alternative. All delivery point pairs are traversed to construct the distance matrix. .

[0078] Specifically, the ant colony algorithm parameters are set as follows:

[0079] Ant count Set to 25, total number of iterations Set to 200, pheromone weight coefficient Set to 1, heuristic weight coefficient The pheromone evaporation rate is 3. Set to 0.4, and pheromone intensity Q to 150.

[0080] Specifically, the power constraint parameters are set as follows:

[0081] Battery capacity Set to 20 kWh, initial power ratio Set to 0.3, initial battery level Set to 10kWh, energy consumption per unit distance Set at 0.2 kWh / km, with a full-charge range of 100 km, charging power Set to 15kW, average driving speed The speed is set to 20km / h, and the default charging strategy is "Full Charge Strategy". An optional "Sufficient Charge Strategy" (minimum charging percentage) is available. (Set to 0.8), power consumption violation penalty weight Set it to 1000.

[0082] Step 2: Based on the parameter settings and delivery tasks, construct a path planning model based on two-stage ant colony optimization. In the first stage, a path is constructed using greedy seeds and biased exploration, and an energy incentive factor is introduced to improve the speed of path search through strong 2-opt.

[0083] Specifically, in the ant colony algorithm structure for delivery route planning with power constraints, the normalized remaining power percentage serves as a key feature for state monitoring, reflecting the vehicle's range. Simultaneously, the geometric distribution characteristics of delivery points are also used as heuristic information, including the current node's location coordinates and the set of unvisited nodes.

[0084] Specifically, based on the driving characteristics of electric logistics vehicles in urban delivery environments, the node selection strategy is set as a two-stage mode: the first stage adopts a biased exploration strategy, increasing the pheromone weight ( ), reduce heuristic weights ( The first stage enhances the algorithm's exploration ability in the early stages of the solution space; the second stage employs a biased exploitation strategy to restore the standard weights. The candidate list size is increased to twice the normal size, enabling finer-grained searching.

[0085] Specifically, a path planning model based on two-stage ant colony optimization is constructed:

[0086] Phase 1: A greedy seed initialization and biased exploration node selection strategy is used to construct the path. Strong 2-opt local optimization is applied to the elite solution, and the solution quickly converges to the high-quality solution space through an enhanced pheromone update mechanism. Phase 2: A standard probability and biased exploitation strategy is used for fine-tuning the search. Lightweight 2-opt optimization is applied to the preferred solution, and the solution steadily converges to the optimal solution through a standard pheromone update mechanism.

[0087] The pheromone matrix is ​​initialized as follows:

[0088]

[0089] in = 3.0 is the initial pheromone enhancement coefficient. A pre-computed neighbor sorted list is used for fast candidate list retrieval; the candidate list size `candidate_size` is set to 10.

[0090] Specifically, based on the aforementioned settings, iterative optimization begins. At the start of each iteration, the ant path set is reset, and all ants are placed at the starting point. Then, according to the current stage, the corresponding node selection strategy is used, and the ants execute the selected action, move to the next node, update the current remaining battery power and access status, and accumulate the path cost. At the same time, it is determined whether the path construction of this round is completed based on whether all nodes have been traversed. The data generated by each node movement is recorded in the current ant's path sequence.

[0091] Specifically, based on the current node status, remaining power, and the set of unvisited nodes, discrete candidate nodes are set as a set of selectable actions, including all unvisited delivery points that meet the basic reachability conditions, representing the next target node that the ant can choose each time. Combining pheromone concentration, heuristic information, and power incentive factors, the node selection probability takes the form:

[0092]

[0093] Combining the current remaining power and the candidate node type, the power incentive factor takes the following form:

[0094]

[0095] During the pheromone renewal process, pheromone evaporation occurs first:

[0096]

[0097] Then the first stage (number of iterations) Increase pheromones in the following ways:

[0098] Contributions of all ants in this iteration: ,in Enhancement contribution of historical optimal solution: Weighted contribution of elite solutions: ,in The pheromone update formula is as follows:

[0099]

[0100] Step 3: In the second stage, a fine-grained search is used with standard probability and bias, and the stability of the path search is improved by a lightweight 2-opt.

[0101] Specifically, after completing the first phase After the first iteration, the algorithm enters the second stage. This stage focuses on a fine-grained search of the neighborhood of the discovered high-quality solutions to improve the convergence accuracy and stability of the final solution. Unlike the first stage, the second stage restores the node transition probability formula to its standard form:

[0102]

[0103] Specifically, among them Restore the initial settings and cease further exponential adjustments to the exploration bias. Appropriately expand the candidate node set to 2 × candidate_size to introduce some diversity while maintaining search efficiency.

[0104] Specifically, after generating m paths in each iteration, the system no longer performs deep local optimization on all paths. Instead, it selects only the top 20% of the best solutions with the lowest overall cost and performs a lightweight 2-opt local search. The maximum number of optimization rounds is set to... The value is typically between 3 and 5, significantly lower than that of the first stage. The value of is taken as follows. The remaining paths remain unchanged and directly participate in pheromone updates to reduce computational overhead and maintain population diversity.

[0105] Specifically, the pheromone update strategy reverts to the standard pattern. Second phase (iteration count > Contributions of all ants in this iteration: Standard contribution of historical optimal solution: Elite solutions will no longer be subject to additional weighting; the pheromone update formula is as follows:

[0106]

[0107] Step Four: Please refer to Figure 3 , Figure 3 This is a schematic diagram of the model framework provided by the present invention. Based on the path planning model, global search training is performed, and the comprehensive cost is calculated in real time to obtain the globally optimal delivery path solution.

[0108] Specifically, based on the current state and environmental information, a hierarchical judgment and dynamic weighting method is adopted, with minimizing the overall cost as the core objective. This involves integrating driving time cost, charging time cost, and electricity feasibility factors to design an overall cost function, the specific form of which is as follows:

[0109] Each time an ant moves from the current node i to the next node j, the cumulative travel time cost is calculated in the form of:

[0110]

[0111] When the vehicle arrives at the charging station and meets the charging conditions, the charging time cost is calculated in the following form:

[0112] If the charging strategy is "fully charged": .

[0113] If the charging strategy is a "sufficient proportion strategy": ,

[0114]

[0115] Based on a comparison between the remaining power and the power required for the road segment, the penalty for power violation is calculated in the following form:

[0116]

[0117]

[0118] Taking into account all the above costs, the final comprehensive cost function takes the form of:

[0119]

[0120] Specifically, during path optimization, after each iteration, the optimal cost of the current iteration and the global optimal cost are calculated, and the convergence curve data is recorded. According to this optimization process, if the optimal cost of the current iteration is better than the historical optimal cost, the global optimal path record is updated, and the current optimal path sequence is saved; if the current iteration count reaches the preset maximum iteration count, the current round of optimization is completed. This process is repeated during iterative optimization until the total number of iterations exceeds the total number of iterations. .

[0121] Step 5: Finally, output the optimal delivery route and power depletion warning information, mark the depletion location, and generate charging station setting suggestions.

[0122] Specifically, the delivery environment information is initialized, including the set of delivery point coordinates, the starting point location, the charging pile configuration, and the vehicle's initial battery level, to obtain initial state information. Based on the current state information, an optimal path sequence is obtained after optimization using a two-stage ant colony algorithm. The vehicle then visits each delivery point sequentially according to this sequence, charging at charging piles according to a preset strategy. Simultaneously, the environment records the driving distance, charging time, and changes in remaining battery level. This process is repeated until all delivery points are visited and the vehicle returns to the starting point, yielding the optimal delivery path under the battery constraint.

[0123] For a better explanation of the embodiments of the present invention, please refer to Figure 4 , Figure 4 This diagram illustrates the optimal delivery route planning result with charging pile configuration provided by the present invention. As can be seen from the diagram, this route effectively plans the access sequence even when delivery points are irregularly distributed, improving delivery efficiency. Furthermore, it completes delivery tasks in a shorter time and with lower energy consumption, thus obtaining an optimal delivery route suitable for power constraints.

[0124] For a better explanation of the embodiments of the present invention, please refer to Figure 5 , Figure 5 This invention provides a schematic diagram of a battery depletion warning and route visualization result under a configuration without charging stations. As can be seen from the result diagram, when no charging stations are configured, the system can automatically detect locations where the battery is depleted and highlight these sections in red. Simultaneously, it generates charging station placement suggestions, effectively warning of potential risks.

[0125] For a better explanation of the embodiments of the present invention, please refer to Figure 6 , Figure 6 The battery level change curve provided by this invention shows the trend of remaining battery power as the driving distance changes, and marks the charging location and the point where the battery is depleted.

[0126] For a better explanation of the embodiments of the present invention, please refer to Figure 7 , Figure 7 A schematic diagram of a delivery route planning device with power constraints provided by the present invention includes:

[0127] The data acquisition module receives the latitude and longitude coordinates of the delivery point input by the user through the map interaction interface, supporting two input methods: map click to add and place name search; it receives the optional charging pile index and polygon area boundary vertex set marked by the user; it receives the delivery point POI name, detailed address and road distance data returned by the third-party map API; and it receives ant colony algorithm parameters and vehicle power constraint parameters to provide a data foundation for subsequent route planning.

[0128] The calculation module constructs a distance matrix between delivery points, prioritizing the use of the Gaode Map driving route planning API to obtain actual road distances. If the API call fails, it automatically switches to the Haversine formula to calculate the great circle distance. The first stage of optimization employs a greedy seed initialization and biased exploration node selection strategy to construct paths, introduces a power incentive factor to guide low-power charging, performs strong 2-opt optimization on elite solutions, and rapidly converges to the high-quality solution space through an enhanced pheromone update mechanism. The second stage of optimization uses a standard probability and biased exploitation strategy for fine-grained search, performs lightweight 2-opt optimization on preferred solutions, and stably converges to the optimal solution through a standard pheromone update mechanism. The module calculates the comprehensive cost of each path, including travel time, charging time, and power violation penalties, and outputs the optimal path sequence and various performance indicators.

[0129] The output module is responsible for outputting the route planning results generated by the calculation module to the user or vehicle dispatch system, including the optimal delivery route sequence, total driving distance, total driving time, total charging time, and number of charging times; generating a power change curve to show the trend of remaining power as driving distance changes; distinguishing road segments with different power states on the map by color (red for low power segments, green for charged segments, and blue for normal segments), marking the locations where the power is exhausted and generating charging pile placement suggestions; and outputting an algorithm convergence process graph and a detailed road segment information table to evaluate the effectiveness of optimizing the current route planning strategy.

[0130] For a description of the delivery route planning device with power constraints provided in the embodiments of the present invention, please refer to the delivery route planning method embodiment with power constraints in the foregoing embodiments. The embodiments of the present invention will not be described again here.

[0131] For a better explanation of the embodiments of the present invention, please refer to Figure 8 , Figure 8 A schematic diagram of a delivery route planning device with power constraints provided by the present invention includes:

[0132] The memory is used to store computer programs, delivery point coordinate data, distance matrix, ant colony algorithm parameters, vehicle power constraint parameters, and charging pile configuration information.

[0133] When the processor executes the computer program stored in the memory, it implements the steps of the power-constrained delivery route planning method described in any of the preceding claims.

[0134] For a description of the delivery route planning device with power constraints provided in the embodiments of the present invention, please refer to the delivery route planning method embodiment with power constraints in the foregoing embodiments. The embodiments of the present invention will not be repeated here.

[0135] It should be noted that, in this specification, the terms "comprising," "including," or any other variations are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0136] The above description is merely a preferred embodiment of the present invention and is used only to explain the present invention. It is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method of electric charge amount-constrained delivery route planning, characterized by, Includes the following steps: (1) Obtain information such as delivery points and regional boundaries, construct a distance matrix and initialize parameters; (2) Based on the parameter settings and delivery tasks, a path planning model based on two-stage ant colony optimization is constructed. In the first stage, a path is constructed using greedy seeds and biased exploration. An energy incentive factor is introduced, and the path search speed is improved by strong 2-opt. (3) In the second stage, the stability of the path search is improved by using standard probability and bias to enhance the stability of the path search through lightweight 2-opt; (4) Based on the path planning model, perform global search training and calculate the comprehensive cost in real time to obtain the global optimal delivery path solution; (5) Output the optimal delivery route and power depletion warning information, mark the depletion location and generate charging pile setting suggestions.

2. The delivery route planning method with power constraints according to claim 1, characterized in that, Step 1, which involves obtaining the set of delivery points, constructing the distance matrix, and initializing parameters, specifically includes: Delivery point collection acquisition: Users can input the latitude and longitude coordinates of delivery points by clicking on the map or searching by place name. , The system automatically obtains the POI name and detailed address of each delivery point, including regular delivery points and optional charging station nodes. Charging station nodes provide charging functionality, while regular delivery points serve only as delivery destinations. Distance matrix construction: A third-party map API is used to obtain the actual road distances between each delivery point, and a distance matrix is ​​constructed. When an API call fails or the network is unavailable, the Haversine formula is used to calculate the great circle distance between two points as an alternative. The Haversine formula is: R is the Earth's radius. , The latitude in radians is the value of the two points. , Let φ be the latitude and longitude in radians between two points, and Δϕ and Δλ be the difference between latitude and longitude, respectively; construct a distance matrix based on the given distance. This provides foundational data for subsequent route planning. Initialize ant colony algorithm parameters: Set the number of ants Number of iterations pheromone weight coefficient Heuristic weighting coefficients pheromone volatilization rate Pheromones intensity Q; Initialize vehicle battery capacity constraints: Set battery capacity (Unit: kWh), Initial Energy Ratio ∈(0,1], energy consumption per unit distance (Unit: kWh / km) Charging power (Unit: kW) Average driving speed (Unit: km / h) Set charging strategies, including "Full Charge Strategy" (charge to full capacity each time) or "Sufficient Ratio Strategy" (charge to a preset ratio). (Then stop); complete the construction of the environment model and the initialization of all parameters.

3. The delivery route planning method with power constraints according to claim 1, characterized in that, The first stage of path search in step 2 is specifically implemented as follows: Several greedy seed paths are generated using a combination of greedy nearest neighbor and random top k-optimal selection. Each time, the nearest node is selected from feasible candidate nodes. These feasible candidate nodes are those with sufficient power or are the target charging station. The remaining ant paths are constructed using a biased exploration probability formula that considers power incentives. The probability of being selected is: in, The pheromone concentration represents the path. The degree of pheromone accumulation on the body; For heuristic information, the reciprocal of the distance is usually taken. ; These are the standard weighting coefficients. In calculating the node transition probability, an additional incentive factor is applied to the charging pile node when the remaining power is... Lower than the candidate node Required power At 1.2 times, the electric excitation factor for: otherwise C represents the set of charging stations. For all paths generated in each iteration of the first stage, the top few optimal solutions are selected for high-iteration 2-opt local path optimization. Better solutions are found by reversing path segments, and the optimized paths are used to update the current generation of pheromones. This increases the basic pheromone increment, increases the weight of elite solutions, and provides additional pheromone enhancement to the top k elite solutions. The pheromone update formula is: For pheromone evaporation rate, The incremental pheromone left by the ants in this iteration The pheromone increment for the current optimal solution has a weight of 2.

0. The pheromone increment for the r-th elite solution. The corresponding weight coefficients are as follows: the higher the ranking, the greater the weight.

4. The delivery route planning method with power constraints according to claim 1, characterized in that, The second stage of path search in step 3 is specifically implemented as follows: After the initial number of local iterations is completed, the second stage of the search begins, primarily using the standard ant colony probabilistic selection formula. At this point, the nodes... The probability of being selected is: Among them, the range of the candidate node set is appropriately expanded to 2× The pheromone importance factor and heuristic importance factor in the node transition probability are regressed to preset values; only the top 20% of optimal solutions in the current generation are considered. Round 2-opt optimization is performed, while the remaining paths remain unchanged and participate in pheromone updates. Pheromones are updated using a standard evaporation and incremental approach; the standard pheromone update formula is:

5. The delivery route planning method with power constraints according to claim 1, characterized in that, Step 4 involves real-time calculation of the comprehensive cost to obtain the globally optimal delivery route solution. The specific implementation includes: During the construction and local optimization of each path, the simulation process of a vehicle starting from the origin, visiting each node sequentially, and returning to the origin is performed, accumulating the distance of each road segment and the corresponding driving energy consumption. When the visited node is a charging station, the charging time and replenished energy are calculated according to a preset charging strategy. The charging strategy supports two modes: "fully charged" and "charged to a specified percentage". The current remaining energy is updated in real time. If the remaining energy is less than zero, the energy violation value is accumulated. The comprehensive cost is defined as the sum of the total driving time and the total charging time, plus the energy violation value multiplied by a preset penalty term. The algorithm optimizes the path by minimizing this comprehensive cost. The formula for calculating the comprehensive cost is: in: Total travel time Let λ be the total charging time, and λ be the penalty weight for exceeding the energy limit. This represents the cumulative amount of electricity consumption violations.

6. The delivery route planning method with power constraints according to claim 1, characterized in that, Step 5 outputs the optimal delivery route and a battery depletion warning message, specifically including: When the user has not configured a charging station, the system simulates the battery level change process along the optimal route, calculating the remaining battery level segment by segment after the journey, starting from the starting point. The formula for updating the remaining battery level is: in, The remaining power after reaching the t-th node. Let be the distance from the (t-1)th node to the tth node; when the remaining power of a certain road segment is detected to be less than zero, i.e. The system determines that the road segment is a power depletion segment and records the previous node as the power depletion location. Visualization: Locations where the battery is depleted are marked in red on the map, and road sections with insufficient battery are highlighted in red. The road sections that have been charged are shown in green, and the ordinary road sections are shown in blue.

7. A delivery route planning system with power constraints, characterized in that, For performing the method according to any one of claims 1 to 6, comprising: Map interaction module: Receives the latitude and longitude coordinates of the delivery point input by the user. Configure charging pile location information C and delivery area boundaries. Distance matrix calculation module: Used to construct the distance matrix between delivery points based on the input delivery point coordinates. . The two-stage ant colony optimization module performs the first and second stage optimizations and outputs the optimal path. and optimal cost . Power consumption calculation module: calculates power consumption for each road segment. Charging time Remaining battery power Detect the point where the battery is depleted. Visualization module: Uses color to distinguish road sections with different battery levels, marks locations where the battery is depleted, and plots battery level change curves. With driving distance The changing relationship.

8. A delivery route planning system with power constraints according to claim 7, characterized in that, The two-stage ant colony algorithm module also includes: The stage control unit, based on the iteration number k and The relationship determines the stage to which it belongs. The elite solution management unit maintains the set of elite solutions generated in phase one, providing the initial pheromone distribution basis for phase two.

9. A delivery route planning device with power constraints, characterized in that, Including processor and memory: The memory stores the computer program, delivery point coordinates, distance matrix, algorithm parameters, and power constraint parameters. When the processor executes the program, it implements the steps of the method described in any one of claims 1 to 6.