Sanitation vehicle path planning method and system based on ant colony algorithm
By using the ant colony algorithm to perform process control verification on the sanitation vehicle route, generating candidate segments and calculating costs, and eliminating road segments that cannot be fully operated, the problem of sanitation vehicles getting stuck and leaving in complex road networks is solved, and continuous operation and forward departure of the route are realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGDONG JIANLI SMART CITY SERVICE CO LTD
- Filing Date
- 2026-03-26
- Publication Date
- 2026-05-29
AI Technical Summary
When faced with a complex sanitation vehicle route planning scenario involving residential side streets, roads in front of shops, and back alleys, existing sanitation vehicle route planning technology often results in vehicles getting stuck in the middle and unable to leave smoothly. This leads to problems such as vehicles having completed collection in the previous section but remaining uncollected in the next, excessively long periods of road occupation in certain areas, and disruption of the subsequent work sequence.
Based on the ant colony algorithm, the process control verification of the entire process of entering, working along, and leaving the road segment to be cleared is carried out to generate candidate segments, calculate the entry cost, along-segment cost, and leaving cost, eliminate road segments that cannot be fully operated and cannot be successfully evacuated, generate a transfer table, and perform ant colony search to determine the target path.
This effectively reduces the chances of being blocked or forced to retreat, improves the feasibility and overall coordination of route planning, ensures that sanitation vehicles can operate continuously and exit in the same direction, and reduces route deviation and resource waste.
Smart Images

Figure CN122108186A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of sanitation vehicle route planning technology, and more specifically, to a sanitation vehicle route planning method and system based on ant colony algorithm. Background Technology
[0002] In the process of urban road sanitation and transportation, existing technologies mainly focus on how to generate a driving and operation route for sanitation vehicles that covers the road sections to be cleaned within a given operation area. The usual approach is to combine the road network topology, the distribution of road sections to be cleaned, the current location of the vehicle, the shift time, road traffic restrictions, and the estimated amount of garbage to calculate the access order and passage path of each road section to be cleaned, and then use constrained path planning methods or ant colony algorithms to find the best path. Taking the collection and transportation scenario in the early morning, where residential side roads, roads in front of shops along the street, and back streets and alleys are interspersed, vehicles need to complete continuous collection within a limited number of shifts. At the same time, they are also constrained by conditions such as insufficient alley width, random temporary parking of vehicles occupying the road, stalls setting up outside, non-motorized vehicles mixing with each other, and lack of effective U-turn space at the end. In this type of scenario, the route execution of sanitation vehicles is not a simple traffic problem, but a process control problem involving vehicle entry, operation along the section, operation maintenance, and smooth departure. However, according to the route generated by the entrance being passable or the road section being reachable, it is easy for vehicles to be blocked in the middle after entering the target side road, unable to continue forward and difficult to leave in the same direction. They can only retreat and exit, resulting in the previous section being completed but the later section being left uncollected, the local road occupation time being too long, and the subsequent operation sequence being forced to be disrupted. The reason is that the existing route generation process focuses on judging whether the vehicle can enter the target road section, but does not include whether the vehicle can continuously complete the operation of the road section and leave smoothly after entering into a unified process control constraint. Therefore, the technical problem to be solved by this application is: how to establish a corresponding process control mechanism for the entire process of vehicle entry, operation along the route and departure during the route planning of sanitation vehicles, so as to identify and exclude the road sections to be cleaned in advance that cannot be fully operated after entry and cannot be smoothly departed. Summary of the Invention
[0003] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide a sanitation vehicle route planning method and system based on ant colony algorithm. This method first performs process control verification of the entire process of entering, operating along the route, and leaving the road segment to be cleaned, and then performs ant colony transfer search based on the verification results and corresponding costs, thereby solving the problems mentioned in the background art.
[0004] To achieve the above objectives, the present invention provides the following technical solution: a sanitation vehicle route planning method based on ant colony algorithm, comprising: S1. Based on the road section to be cleared, road network relationship, vehicle position, vehicle direction, as well as the road width, lane occupation position and end turning conditions of the road section to be cleared, determine the entry end, operation direction and departure end of each road section to be cleared, and generate candidate sections. S2. For each candidate segment, extract the road width, lane occupation position and end turning condition position by position along the direction from the entry end to the departure end, and perform entry verification, segment verification and departure verification in sequence. Record the first verification failure position, determine the candidate segment without the first verification failure position as the valid segment, and calculate the corresponding entry cost, segment cost and departure cost. S3. Using effective segments as the ant colony transfer objects, calculate the transfer value of the vehicle entering each effective segment based on the vehicle position, vehicle direction, entry cost, segment cost, and departure cost, and record the transfer value of the candidate segment with the first failed verification position as zero, and generate a transfer table. S4. Perform ant colony search based on the transfer table. For each valid segment selected, update the departure end of the valid segment to the vehicle position, update the operation direction of the valid segment to the vehicle direction, and re-perform entry verification, segment verification, and departure verification for the remaining candidate segments, recalculate the corresponding transfer values, and generate candidate paths. S5. Based on the total entry cost, total segment cost, total departure cost, and effective segment coverage of each candidate path, determine the target path and output the effective segment sequence corresponding to the target path, as well as the entry end, working direction, and departure end corresponding to each effective segment, as the path planning result.
[0005] In a preferred embodiment, S1 includes: S1-1. Based on the road network relationship, vehicle location and vehicle direction, extract the two-end nodes that connect each road segment to be cleared to the current location of the vehicle, calculate the arrival direction from the vehicle location to the two-end nodes, and generate the candidate entry point corresponding to each road segment to be cleared. S1-2. For each candidate entry point, extract the road width, lane occupation position and end turning conditions position by position along the extension direction of the corresponding road section to be cleared, determine the continuous passage direction from the candidate entry point to the other end node, and generate the operation direction and candidate departure point corresponding to each road section to be cleared. S1-3. Based on the candidate entry end, working direction and candidate departure end, compare the forward access result after the vehicle turns into the candidate entry end from the current position and the forward departure result after driving out of the candidate departure end. Determine the endpoints corresponding to the forward access result and the forward departure result as the entry end and departure end respectively, and generate candidate segments.
[0006] In a preferred embodiment, S2 includes: S2-1. For each candidate segment, establish a position sequence from the entry end to the departure end, and extract the road width, lane occupation position and end turning conditions corresponding to each position according to the position sequence to generate a position table. S2-2. According to the position table, calculate the entry margin and entry length of the vehicle from the entry end to the corresponding position for each position, and write the positions where the entry margin is not less than the vehicle width and the entry length is not less than the vehicle length into the entry mark. S2-3. For the position to be marked, calculate the remaining margin and blocking length of the vehicle along the working direction for each adjacent position in the position sequence, and write the position with a remaining margin of not less than the vehicle width and a blocking length of zero into the position mark.
[0007] In a preferred embodiment, S2 further includes: S2-4. For the position marked along the segment, combine the end turning conditions corresponding to the departure end and the connecting road segment outside the departure end to calculate the departure margin and departure connection result of the vehicle leaving the candidate segment from the corresponding position. Write the position where the departure margin is not less than the vehicle width and the departure connection result is valid into the closed mark. S2-5. Check the entry mark, along-segment mark and closing mark of each position in sequence according to the position sequence. The first position that is missing the corresponding mark is determined as the first failed position. The candidate segment that does not have a first failed position is determined as a valid segment. S2-6. Based on the entry margin, along-segment margin, and departure margin corresponding to each position in the effective segment, accumulate and generate the entry cost, along-segment cost, and departure cost respectively.
[0008] In a preferred embodiment, S3 includes: S3-1. Based on the vehicle position, vehicle direction, and the entry point, working direction, entry cost, along-segment cost, and departure cost corresponding to each effective segment, calculate the access distance from the vehicle position to each entry point, the direction difference between the vehicle direction and each working direction, and the cost sum of the entry cost, along-segment cost, and departure cost, and generate a segment table. S3-2. Based on the segment table, generate distance numbers in ascending order of access distance, generate direction numbers in ascending order of direction difference, and generate cost numbers in ascending order of cost sum. Then, add the distance numbers and direction numbers together to generate the access number.
[0009] In a preferred embodiment, S3 further includes: S3-3. Based on the access sequence number and cost sequence number corresponding to each valid segment, sort them first by access sequence number from smallest to largest, then sort them by cost sequence number from smallest to largest, generate transfer sequence number, and record the transfer sequence number corresponding to the candidate segment with the first verification failure position as zero. S3-4. Based on the transfer sequence number corresponding to each valid segment, generate the original transfer value by subtracting the transfer sequence number from the total number of candidate segments and then adding one. Then, normalize the original transfer values according to the sum of the original transfer values. Record the transfer value corresponding to the candidate segment with the first failed verification position as zero, and generate the transfer table.
[0010] In a preferred embodiment, S4 includes: S4-1. Based on the transfer table, generate a transfer interval by accumulating the transfer values corresponding to each candidate segment, and write the vehicle position, vehicle direction, set of unselected candidate segments and sequence of selected valid segments into the path status table. S4-2. Based on the set of unselected candidate segments and the transition interval in the path status table, extract the valid segment that currently falls into the transition interval as the current segment, and write the current segment into the sequence of selected valid segments.
[0011] In a preferred embodiment, S4 further includes: S4-3. Based on the departure end and operation direction corresponding to the current segment, update the vehicle position and vehicle direction respectively, delete the current segment from the set of unselected candidate segments, and record the transition value of the candidate segment that overlaps with the current segment and the candidate segment with the first verification failure position as zero. S4-4. Based on the updated vehicle position, vehicle direction, and unselected candidate segment set, re-execute entry verification, segment verification, and departure verification for the remaining candidate segments, recalculate the corresponding transfer values, and update the transfer interval. Repeat the current segment extraction, vehicle position update, and transfer value recalculation until the unselected candidate segment set is empty or all transfer values of the remaining candidate segments are zero, and generate candidate paths.
[0012] In a preferred embodiment, S5 includes: S5-1. Based on the total entry cost, total along-segment cost, total departure cost, and effective segment coverage corresponding to each candidate path, calculate the effective segment coverage divided by the total entry cost to obtain the entry coverage value, the effective segment coverage divided by the total along-segment cost to obtain the along-segment coverage value, and the effective segment coverage divided by the total departure cost to obtain the departure coverage value. Record the first value among the entry coverage value, along-segment coverage value, and departure coverage value as the path value. S5-2. Sort the candidate paths in descending order according to their path values. Sort the candidate paths with the same path value in ascending order according to the sum of total entry cost, total segment cost, and total departure cost. Determine the candidate path with the highest ranking as the target path. Output the effective segment sequence corresponding to the target path, as well as the entry end, working direction, and departure end of each effective segment, as the path planning result.
[0013] In a preferred embodiment, the sanitation vehicle route planning system based on the ant colony algorithm includes: The route determination module is used to determine the entry point, operation direction and departure point of each road segment to be cleared based on the road segment to be cleared, road network relationship, vehicle location, vehicle direction, as well as the road width, lane occupation position and end turning conditions of the road segment to be cleared, and generate candidate segments. The path verification module extracts the road width, lane occupation position and end turning conditions for each candidate segment along the direction from the entry end to the departure end, and performs entry verification, segment verification and departure verification in sequence. It records the first verification failure position, determines the candidate segment without the first verification failure position as the valid segment, and calculates the corresponding entry cost, segment cost and departure cost. The transfer calculation module is used to take effective segments as the ant colony transfer objects, calculate the transfer value of the vehicle entering each effective segment based on the vehicle position, vehicle direction, entry cost, segment cost, and departure cost, and record the transfer value of the candidate segment with the first failed verification position as zero, and generate a transfer table. The path search module is used to perform ant colony search based on the transfer table. For each valid segment selected, the departure end of the valid segment is updated to the vehicle position, the operation direction of the valid segment is updated to the vehicle direction, and the entry verification, segment verification and departure verification are re-executed for the remaining candidate segments, the corresponding transfer values are recalculated, and candidate paths are generated. The results output module is used to determine the target path based on the total entry cost, total segment cost, total departure cost, and effective segment coverage of each candidate path, and output the effective segment sequence corresponding to the target path, as well as the entry end, working direction, and departure end corresponding to each effective segment, as the path planning result.
[0014] The technical effects and advantages of this invention are as follows: By first determining the entry point, work direction, and departure point, and then performing entry verification, section verification, and departure verification at each location, sections of road that cannot be completely operated and cannot be detached in the forward direction during the entire process control can be eliminated before the path is generated, thereby relatively reducing the situation of being blocked in the middle, retreating, and being left uncollected in the later section. By establishing a position sequence from the entry end to the departure end, and continuously writing entry markers, segment markers, and closure markers on the same position sequence, road width, lane occupancy position, and end turning conditions can be uniformly incorporated into the same process control verification chain, thereby improving the consistency of the determination of the executability of candidate segments. By recording the first verification failure position and only identifying the candidate segment without the first verification failure position as the valid segment, the candidate segment that does not meet the process control requirements can be eliminated before the transfer calculation, thereby relatively suppressing the path offset caused by invalid candidate segments participating in subsequent searches. By generating entry cost, segment cost, and departure cost for each effective segment, and combining the access distance and direction difference to generate a transfer value, the ant colony transfer can simultaneously reflect the process control difficulty of entry, operation, and departure, thereby relatively improving the matching degree between the transfer object and the current state of the vehicle. By updating the vehicle position and direction for each selected valid segment and re-verifying and recalculating the transfer values for the remaining candidate segments, the system can continuously reflect the impact of vehicle status changes on the process control conditions of subsequent road segments during the search process, thereby reducing the possibility of the initial path failing during execution. By evaluating candidate paths based on the correspondence between effective segment coverage and total entry cost, total along-segment cost, and total departure cost, and determining the target path, a unified comparison basis can be formed between coverage and overall process control cost, thereby enabling the output path to have better overall coordination in continuous operation and forward departure. Attached Figure Description
[0015] Fig. 1 This is a flowchart of the method steps of the present invention.
[0016] Fig. 2 This is a schematic diagram of the system modules of the present invention. Detailed Implementation
[0017] 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 embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] Refer to the instruction manual appendix Figs. 1-2 The ant colony algorithm-based sanitation vehicle route planning method of the present invention includes: S1. Based on the road section to be cleared, road network relationship, vehicle position, vehicle direction, as well as the road width, lane occupation position and end turning conditions of the road section to be cleared, determine the entry end, operation direction and departure end of each road section to be cleared, and generate candidate sections. In this implementation, the direction of the road segment to be cleared is first expanded and the endpoints are determined, transforming the original road segment object into a candidate segment that can be directly used for verification and search. Specifically, instead of directly assigning a fixed direction to the road segment to be cleared, the accessible endpoint is first determined based on the node connection relationships in the road network and the current vehicle status. Then, continuous passage results are expanded along the road segment direction corresponding to that endpoint. Subsequently, the driving connection after access and the road network connectivity at the time of departure are considered to determine whether the other endpoint can be retained as a departure endpoint. Only when the starting endpoint can access in the forward direction and the ending endpoint can detach in the forward direction is the expanded result of that direction determined as a candidate segment. After this processing, the candidate segment has a clear entry endpoint, operating direction, and departure endpoint. Subsequent position verification, transfer value calculation, and candidate path generation are all performed using this candidate segment as the object. The implementation process includes the following: First, candidate entry points for each road segment to be cleared are determined based on road network relationships, vehicle positions, and vehicle directions. The road network relationship records at least the segment number, the corresponding end node numbers, and the connection directions between nodes. Vehicle positions use the positioning results at the current planning time, and vehicle directions use the heading results at the same time. During processing, the first and second end nodes corresponding to each road segment to be cleared are read first, and the node where the vehicle is currently located is used as the starting point. When the vehicle position falls on a connecting edge, the node on the side the vehicle's forward direction points to is determined as the current position node. Subsequently, from the current position node, the connection direction is searched to the first and second end nodes to obtain the corresponding access paths. If an end node does not have an access path that meets the connection direction requirements, that end node is not considered for subsequent entry. For end nodes with access paths, the driving direction pointing to that end node at the end of the corresponding access path is extracted, and the end node and the driving direction are combined and recorded as candidate entry points for that road segment to be cleared. This allows each road segment to be cleared to form one or two candidate entry points for subsequent processing. After the candidate entry point is determined, the road segment deployment results are established from the candidate entry point towards the other end node, and the operation direction and candidate departure point are determined. Specifically, the end node where the candidate entry point is located is used as the starting point, and the other end node is used as the ending point. The road segment to be cleared between the two ends is discretized into a sequentially arranged position sequence. The position sequence can be divided by a fixed length, or by points of road width change, lane occupation boundary change, and end condition change, but the same division method is used within the same candidate segment, and they are numbered consecutively from the starting point to the ending point. Subsequently, the corresponding road width value and lane occupation position are written to each position. The width value is the distance between the lateral passable boundaries at this location, and the road occupation position is the projection range of the road occupation area at this location in the lateral and longitudinal directions of the road segment. For positions near the end node, end turning conditions are added to indicate the turning direction and turning space corresponding to the vehicle turning out from the end node. If the position sequence from the candidate entry point to the other end node is continuous, the unfolding direction is determined as the working direction, and the other end node is determined as the candidate departure point. If the road segment is broken in the middle, the candidate entry point will no longer participate in the subsequent generation. After this processing, each candidate entry point corresponds to a working direction and a candidate departure point. Based on this, the access and departure results are compared to determine the entry and departure ends and generate candidate segments. Specifically, the access result corresponding to the candidate entry end is calculated first: on one hand, it is checked whether the direction of the last segment of the access path is consistent with the working direction after the candidate entry end when the vehicle arrives at the candidate entry end from its current position along the access path; on the other hand, it is checked whether there is a continuous position sequence in the first segment position after the candidate entry end. If both of the above conditions are met, the candidate entry end is determined as an accessible end. Then, the departure result corresponding to the candidate departure end is calculated: on one hand, it is checked whether the end turning condition corresponding to the candidate departure end is met. Vehicles are allowed to arrive in the working direction and then turn out from this end; on the other hand, it is checked whether there is a connecting road segment outside the candidate departure end that is consistent with the turning direction; when both of the above two conditions are met, the candidate departure end is determined as a drivable end; for direction expansion results that simultaneously have an access end and a drivable end, the starting end node is determined as the entry end, the ending end node is determined as the departure end, and the entry end, working direction, and departure end are written together into the candidate segment record; for direction expansion results that do not simultaneously meet the above two conditions, no candidate segment is generated; the candidate segments obtained in this way have completed the closure of direction and endpoints and can directly enter the subsequent processing; Through the above processing, the road section to be cleared is first converted into a candidate section with a clear direction and clear endpoint, and has the basis for access and departure, so as to avoid the problems of unclear entry point, uncertain operation direction and suspended departure endpoint when directly verifying the original road section to be cleared in the future. In practical applications: When a sanitation vehicle is located on the entrance road of a residential area and is driving towards the interior of the community, for a narrow alley connecting residential buildings, the system first determines whether there is an access path at the end closest to the entrance based on the vehicle's current position and the node connection direction. Although the far end is topologically reachable, the direction of the last segment of its access path is not continuous with the vehicle's current direction, so only the near end is retained as a candidate entry end. Then, the position sequence is expanded from the near end to the far end. If the intermediate positions are continuous and the connecting road outside the far end allows the vehicle to turn out, the near end is determined as the entry end and the far end is determined as the departure end, forming corresponding candidate segments for subsequent position verification and path search.
[0019] S2. For each candidate segment, extract the road width, lane occupation position and end turning condition position by position along the direction from the entry end to the departure end, and perform entry verification, segment verification and departure verification in sequence. Record the first verification failure position, determine the candidate segment without the first verification failure position as the valid segment, and calculate the corresponding entry cost, segment cost and departure cost. In this embodiment, candidate segments are processed by position expansion, position-by-position verification, and cost generation to determine whether a candidate segment can continuously pass from the entry point to the departure point. Based on this, the valid segments, the first failed position, and the entry cost, segment cost, and departure cost required for subsequent transfer calculations are formed. During processing, the candidate segments between the entry point and the departure point are first discretized into a sequence of consecutively numbered positions. Then, the road width, lane occupancy position, and end turning conditions are written into the position table corresponding to the same position sequence. Subsequently, the entry margin and entry length, segment margin and blocking length, and departure margin and departure connectivity result are calculated sequentially along the position sequence and written into the entry mark, segment mark, and closure mark, respectively. Then, the continuity of the three types of marks is checked according to the position number order to determine the first failed position or valid segment. Finally, only the corresponding positions in the valid segments are accumulated to form the entry cost, segment cost, and departure cost. The implementation process includes the following: First, a position sequence is established along the corresponding operating direction of the candidate segment, starting from the entry end and ending at the departure end. During establishment, the points of road width change, lane occupation boundary change, and end turning condition change are used as boundary positions. When the distance between adjacent boundary positions is greater than the predetermined sampling interval, intermediate positions are added between them at the same sampling interval, so that the entire candidate segment forms a continuously increasing position number from the entry end to the departure end. Then, for each position, the position number, position coordinates, road width value, lane occupation position, and end turning condition are written. Among them, the road width value is the distance between the lateral passable boundaries of the position, the lane occupation position is the projection range of the lane occupation interval on the candidate segment in the lateral and longitudinal directions, and the end turning condition is only written for the position near the departure end, which is used to indicate the turning direction and turning space corresponding to the vehicle turning out from the departure end. The end turning condition of non-end positions is recorded as a null value. After completion, a position table corresponding to the candidate segment is obtained. Subsequently, based on the location table, the entry margin and entry length of the vehicle when entering the corresponding position from the entry point are calculated position by position. During the calculation, the corresponding road width value is read for each position, and the vehicle width is subtracted from the road width value to obtain the entry margin for that position. If the entry margin is less than zero, the position does not meet the entry conditions. Then, starting from the first position corresponding to the entry point, the position number is checked incrementally. When the entry margin of the current position and all previous positions are not less than zero, the cumulative value of the distance between adjacent positions from the entry point to the current position is recorded as the entry length of that position. When the entry margin of a certain position is less than zero, the previous entry length accumulation is no longer continued for that position and subsequent positions. For positions with an entry margin not less than zero and an entry length not less than the vehicle length, an entry mark is written in the position record. For positions that do not meet either of the above two conditions, no entry mark is written. After writing the entry marker, the clearance and blocking length of the vehicle when passing through adjacent positions along the working direction are calculated. During processing, the current position and the next position are used to form an adjacent position pair, and the road width value and lane occupation position corresponding to the two positions are read respectively. The smaller road width value of the two positions is subtracted from the vehicle width to obtain the clearance of the adjacent position pair. Then, based on the projection range of the lane occupation position between the two positions, it is checked whether the transverse passable strip exists continuously in the longitudinal transition interval. If the transverse passable strip exists continuously in the entire transition interval, the blocking length is recorded as zero. If the transverse passable strip is completely cut off by the lane occupation area in a certain longitudinal interval, the longitudinal length of the cut interval is recorded as the blocking length. For a position that has been marked with an entry marker, a clearance marker is written at the next position only if the clearance of the next position is not less than zero and the blocking length is zero. Once an adjacent position pair does not meet this condition, clearance markers will not be written from that next position onwards. For positions already marked with a segment marker, the departure margin and departure connectivity result are calculated by combining the end turning conditions corresponding to the departure end and the connecting road segment outside the departure end. Specifically, the end turning conditions written near the departure end are read first to obtain the turning direction and turning space when the vehicle turns out from the departure end. Then, the connecting road segment outside the departure end connected to the turning direction is extracted from the road network relationship. The existence of the connecting road segment is checked, and whether its entry direction is consistent with the turning direction is checked. Then, the departure margin is obtained by subtracting the vehicle width from the turning space at the departure end. When the departure margin is not less than zero and there is a connecting road segment with the same direction outside the departure end, the departure connectivity result is recorded as valid, and a closing mark is written at the corresponding position. When either of the above two conditions is not met, no closing mark is written. To maintain the consistency of the preceding and following verification chains, the closing mark is only retained in the continuous position interval where the segment marker has been written, and the closing mark is not written at the position where the segment marker has not been written. After the three types of markers are written, the entry marker, the segment marker, and the closure marker are checked one by one in order of position number. During the check, starting from the first position corresponding to the entry end, it is first determined whether the entry marker has been written at the current position. If not, the position is determined as the first failed position. If the entry marker has been written, it is then determined whether the segment marker has been written at the current position. If not, the position is determined as the first failed position. If both the entry marker and the segment marker have been written, it is then determined whether the closure marker has been written at the current position. If not, the position is determined as the first failed position. After the first failed position is determined, the subsequent positions are no longer checked, and the first failed position is written in the candidate segment record. If, when checking to the position corresponding to the departure end in the above order, the entry marker, the segment marker, and the closure marker have been written in sequence at each position, the candidate segment is determined as a valid segment, and a valid segment marker is written in the candidate segment record. After a candidate segment is determined to be a valid segment, the entry cost, along-segment cost, and departure cost are generated from the entry margin, along-segment cost, and departure cost corresponding to each position in the valid segment. During processing, cost calculation is only performed on candidate segments that have been marked as valid segments. For positions marked with an entry flag, the difference between the vehicle width and the entry margin is taken for each position and accumulated in order of position number to obtain the entry cost. For positions marked with an along-segment flag, the difference between the vehicle width and the along-segment cost is taken for each position and accumulated in order of position number to obtain the along-segment cost. For positions marked with a closure flag, the difference between the vehicle width and the departure cost is taken for each position and accumulated in order of position number to obtain the departure cost. When the entry margin, along-segment cost, or departure cost at a certain position is greater than the vehicle width, the corresponding difference at that position is recorded as zero to avoid negative values. After completion, the entry cost, along-segment cost, and departure cost corresponding to the valid segment are written into the segment result record for direct use in subsequent transfer value calculations. Through the above processing, the same candidate segment is first expanded into a position table arranged from the entry end to the departure end, and then the entry mark, the segment edge mark, and the closure mark are obtained sequentially on the same position sequence. When a position in the position sequence is missing a corresponding mark for the first time, the position is directly written as the first failed position into the candidate segment record. When each position in the position sequence has the entry mark, the segment edge mark, and the closure mark in sequence, the candidate segment is determined as a valid segment, and the entry cost, the segment edge cost, and the departure cost are generated by accumulating the entry margin, the segment edge cost, and the departure cost of the corresponding position in the valid segment, respectively, thus providing a unified input for the subsequent transfer value calculation. In practical applications: For a candidate segment within a cell with a determined entry and exit point, a position sequence is first established based on the location of road width changes and the location of roadside lane occupancy boundaries. The road width value, lane occupancy interval, and turn-out conditions near the exit point for each location are written into the position table. Then, starting from the entry point, the entry margin and entry length for each location are calculated sequentially, and entry markers are written for locations that meet the complete vehicle entry conditions. Next, the continuity of the passable zone between adjacent locations is checked, and along-segment markers are written for locations that meet the continuous passage conditions. Then, the turn-out space and the connectivity of the outer road segment at the exit point are checked, and closure markers are written for locations that meet the exit conditions. If a corresponding marker is missing for the first time at a certain location during the position sequence check, that location is recorded as the first failed location, and the candidate segment does not enter the subsequent set of valid segments. If the position sequence of the entire candidate segment has all three types of markers consecutively, it is determined as a valid segment, and the entry margin, along-segment margin, and exit margin of the corresponding locations in the valid segment are accumulated to generate the entry cost, along-segment cost, and exit cost, respectively.
[0020] S3. Using effective segments as the ant colony transfer objects, calculate the transfer value of the vehicle entering each effective segment based on the vehicle position, vehicle direction, entry cost, segment cost, and departure cost, and record the transfer value of the candidate segment with the first failed verification position as zero, and generate a transfer table. In this embodiment, the determined valid segments are processed by calculating transfer values to convert the entry conditions, directional connection status, and intra-segment costs into a transfer table that can be directly accessed by the subsequent ant colony search. During processing, instead of directly assigning fixed priorities to valid segments, the system first calculates the access distance from the vehicle to the entry point of each valid segment, the directional difference between the vehicle's direction and the operating direction of each valid segment, and the sum of the entry cost, segment cost, and departure cost for each valid segment, based on the vehicle's current position and direction. Then, the access distance, directional difference, and cost sum are sorted to obtain distance sequence number, direction sequence number, and cost sequence number, and an access sequence number is formed from the distance sequence number and direction sequence number. Subsequently, a transfer sequence number is generated based on the access sequence number and cost sequence number. Finally, the original transfer value is converted from the transfer sequence number and normalized to obtain the transfer table corresponding to each candidate segment. The implementation process includes the following: First, a segment table is generated based on the vehicle's location, direction, and the entry point, working direction, entry cost, segment cost, and exit cost corresponding to each valid segment. During processing, the vehicle's location and direction for the current planning round are read, along with the entry point, working direction, entry cost, segment cost, and exit cost written in the previous processing for each valid segment. For each valid segment, the path from the vehicle's location to the entry point is searched along the road network to obtain the passable path. The cumulative length of this passable path is recorded as the access distance. If the vehicle's location is exactly at the entry point, the access distance is recorded as zero. Subsequently, the vehicle direction and the working direction of the effective segment are converted to the same coordinate system, and the absolute value of the angle between them is taken as the direction difference. When the angle is greater than 180 degrees, the result after subtracting the angle from 360 degrees is taken as the direction difference. Then, the entry cost, along-segment cost, and departure cost corresponding to the effective segment are directly added together to obtain the cost sum. After completion, the effective segment number, entry end, working direction, access distance, direction difference, and cost sum are written into the segment table. For candidate segments with a first verification failure position, the above calculation results are not written, only the candidate segment number and failure flag are retained for subsequent zeroing processing. After the segment table is formed, distance sequence number, direction sequence number, cost sequence number, and access sequence number are generated respectively. In specific processing, the valid segments in the segment table are first sorted by access distance from smallest to largest, with the distance sequence number corresponding to the first segment being recorded as 1, and subsequent segments incrementing sequentially. When two valid segments have the same access distance, their corresponding direction differences are compared, with the segment with the smaller direction difference having a higher sequence number. If the direction differences are still the same, the valid segment numbers are compared, with the segment with the smaller number having a higher sequence number. Subsequently, the valid segments are sorted by direction difference from smallest to largest, and direction sequence numbers are generated. When the direction differences are the same, the segment is sorted by... Sort the segments by access distance from smallest to largest; if the access distances are still the same, sort them by valid segment number from smallest to largest; then, sort each valid segment by cost sum from smallest to largest to generate a cost sequence number; when the cost sums are the same, first compare the sum of the entry cost and the cost along the segment, and the smaller one has the first number; if they are still the same, sort them by valid segment number from smallest to largest; after completing the three types of sequence numbers, add the distance sequence number and the direction sequence number directly to each valid segment to obtain the access sequence number corresponding to the valid segment, and write the distance sequence number, direction sequence number, cost sequence number and access sequence number back to the segment table; Next, a transfer number is generated based on the access sequence number and cost sequence number corresponding to each valid segment, and zero sequence number processing is performed on failed candidate segments. In specific processing, the valid segments are first reordered according to the access sequence number in ascending order; when the access sequence numbers are the same, they are then sorted according to the cost sequence number in ascending order; if the cost sequence numbers are still the same, they are sorted according to the valid segment number in ascending order; after sorting, values are assigned sequentially according to the sorting order, with the transfer number of the first valid segment in the sorting order recorded as one, and subsequent segments incrementing sequentially; for candidate segments that have already been written to the first verification failure position in the previous processing, they are not included in the above sorting, and their transfer number is directly recorded as zero; after completion, each valid segment corresponds to a unique transfer number, and each failed candidate segment corresponds to a zero-value transfer number, and the relevant results are written into the sorting result record. Finally, the original transfer value is calculated based on the transfer sequence number, and normalization is performed to generate a transfer table. Specifically, the total number of candidate segments in the current round is first counted, including the number of valid segments and the number of candidate segments with the first failed verification position. For each valid segment, the original transfer value is obtained by subtracting the transfer sequence number of the valid segment from the total number of candidate segments and then adding one. For failed candidate segments with a transfer sequence number of zero, the original transfer value is directly recorded as zero. Subsequently, the original transfer values of all valid segments are summed to obtain the total original transfer value. When the total original transfer value is not zero, the original transfer value of each valid segment is divided by the total original transfer value to obtain the transfer value of that valid segment. When the total original transfer value is zero, the transfer values of all candidate segments are recorded as zero. After normalization, the candidate segment number, transfer sequence number, and transfer value of each candidate segment are written into the transfer table, where the transfer value corresponding to a valid segment is the normalized result, and the transfer value corresponding to a failed candidate segment remains zero. Through the above processing, each valid segment first generates a unified segment table based on vehicle position, vehicle direction, and three types of costs. Then, the access distance, direction difference, and cost sum are used to form a sorting result, and the access sequence number, cost sequence number, and transfer sequence number are obtained under a fixed parallel decision rule. Subsequently, the original transfer value is converted from the transfer sequence number, and the normalized transfer value is obtained based on the sum of the original transfer values. For candidate segments with a first failed verification position, the zero value state is always retained. In practical applications: When a vehicle is currently located at a main road intersection and its current direction is towards the interior of the community, if there are three valid segments corresponding to three different branch road entrances, the access distance from the vehicle to the three entrances is first calculated along the road network. Then, the direction difference is obtained by comparing the vehicle's current direction with the operating direction of the three valid segments. The entry cost, segment cost, and departure cost of each valid segment are added together to obtain the cost sum. Subsequently, the distance sequence number, direction sequence number, and cost sequence number are generated separately. The access sequence number is obtained by adding the distance sequence number and direction sequence number. Then, the transfer sequence number is determined according to the access sequence number and cost sequence number, and the candidate segments that fail the pre-check are directly recorded as zero sequence number. Finally, the original transfer value is generated by subtracting the transfer sequence number from the total number of candidate segments and adding one. The transfer value of each candidate segment is obtained by summing the original transfer values, so that the effective segments that are more smoothly connected to the vehicle's current state, have shorter access paths, and lower intra-segment costs correspond to higher transfer values in the transfer table.
[0021] S4. Perform ant colony search based on the transfer table. For each valid segment selected, update the departure end of the valid segment to the vehicle position, update the operation direction of the valid segment to the vehicle direction, and re-perform entry verification, segment verification, and departure verification for the remaining candidate segments, recalculate the corresponding transfer values, and generate candidate paths. In this embodiment, candidate segments are searched round by round based on the transfer table to form candidate paths. During processing, the transfer values of all unselected candidate segments in the current round are first converted into a continuously arranged transfer interval, and the vehicle position, vehicle direction, set of unselected candidate segments, and sequence of selected valid segments are uniformly written into the path status table. Then, the current segment is determined in the transfer interval based on the extracted value of the current round. The vehicle status is then updated with the departure end and working direction of the current segment, and the selected segments and candidate segments that overlap with the selected segments are eliminated simultaneously. After that, the verification and transfer value calculation are re-performed on the remaining candidate segments with the updated vehicle status to form the next round of transfer intervals. This process is repeated until there are no more candidate segments that can be selected, resulting in a candidate path. The implementation process includes the following: First, the transfer interval for the current round is generated based on the transfer table, and a path status table is established. During processing, the transfer values corresponding to each candidate segment in the current round are read and accumulated in order of candidate segment number. Using zero as the starting boundary, the transfer interval for the first candidate segment is recorded as zero to its transfer value, and the transfer interval for the second candidate segment is recorded as the accumulated value of the previous candidate segment to the current accumulated value. Subsequent candidate segments are processed in the same manner until all candidate segments are processed. If the transfer value of a candidate segment is zero, no transfer interval with a length greater than zero is generated for that candidate segment; only the candidate segment number and the zero-value identifier are retained in the transfer interval record. After completion, the vehicle's current position, vehicle's current direction, the set of candidate segment numbers that are currently unselected and not deleted, and the sequence of currently selected valid segments are all written into the path status table. Initially, the set of unselected candidate segments consists of all candidate segments participating in the search in this round, and the sequence of selected valid segments is initially empty. This ensures that the vehicle status, candidate segment status, and transfer interval status are recorded uniformly for the same round of search. After the path status table is established, the current segment is determined based on the set of unselected candidate segments and the transfer interval. Specifically, the extraction value for the current round is first generated, with the extraction value ranging from zero to one. In one implementation, the ant number and search round can be written into a fixed mapping formula to generate the extraction value, ensuring that the same ant corresponds to a unique extraction value in the same round. Subsequently, the transfer interval record is searched for the transfer interval containing the extraction value in the order of the candidate segment numbers. When the extraction value satisfies the condition that the starting boundary of a candidate segment's transfer interval is less than or equal to the extraction value and the extraction value is less than the ending boundary, the valid segment corresponding to that candidate segment is determined as the current segment. If the extraction value does not fall into any transfer interval with a length greater than zero, it indicates that there is no selectable valid segment in the current round, and the search stops for this round. After the current segment is determined, the valid segment number corresponding to the current segment is appended to the end of the selected valid segment sequence, and the selected valid segment sequence record is synchronously updated in the path status table, so that subsequent vehicle status updates and recalculation of remaining candidate segments are based on this current segment. After the current segment is determined, the vehicle status is updated based on the current segment, and the candidate segment set is processed. Specifically, the departure end and working direction corresponding to the current segment are read. The coordinates of the end node or end position corresponding to the departure end are written into the vehicle position field, and the working direction is written into the vehicle direction field, which serve as the vehicle position and vehicle direction for the next round of search. Then, the current segment is first deleted from the unselected candidate segment set, and then it is checked whether there are any candidate segments that overlap with the current segment among the remaining candidate segments. Among them, overlap is determined by whether there is a common position number interval in the position sequence corresponding to the candidate segment. When the intersection of the position sequences corresponding to two candidate segments is not empty, the candidate segment is determined as an overlapping candidate segment. For overlapping candidate segments, their transition value is directly recorded as zero, and the candidate segment number is retained for status record retrieval. For candidate segments that have been written to the first failed verification position in the previous processing, their transition value is also kept as zero and they do not participate in subsequent selection. After this processing, the unselected candidate segment set only retains candidate segments that have not been selected and do not overlap with the current segment, and the vehicle position and vehicle direction are synchronously switched to the state after the current segment is executed. After updating the vehicle status and candidate segment set, the remaining candidate segments are re-verified and their transition values are recalculated, and the search continues accordingly. Specifically, the updated vehicle position and direction are used as the new input state to re-verify entry, segment-along, and departure checks for each candidate segment in the unselected candidate segment set. This is because after the vehicle position moves from the original starting point to the departure point of the current segment, the access path, access distance, and direction difference of each candidate segment have changed, and the original verification results and transition values are no longer directly applicable. For a candidate segment with a first verification failure position after re-verification, its transition value is recorded as... Zero; For candidate segments that still meet the valid segment conditions after re-verification, recalculate the entry cost, segment cost, and departure cost, and generate new transfer values according to the aforementioned transfer value calculation process; then, re-accumulate and generate the next round of transfer intervals based on the updated transfer values, and execute the current segment extraction, vehicle position update, and candidate segment set update again; the above process continues to loop until the unselected candidate segment set is empty, or the transfer values of all candidate segments in the unselected candidate segment set are zero; when either of the above situations occurs, stop the current round of search, and output the selected valid segment sequence as a candidate path in the order of writing; Through the above processing, each round of search determines the current segment based on the transfer interval corresponding to the current vehicle state, and then updates the vehicle position, vehicle direction and the state of the remaining candidate segments in reverse order of the current segment, so that the formation process of the candidate path is always consistent with the actual operation and advancement direction of the vehicle; at the same time, the deletion of overlapping candidate segments, the retention of zero values of failed candidate segments and the recalculation of remaining candidate segments are all completed in the same loop, so that the candidate segments retained in the future always correspond to the search objects that can be accessed in the current vehicle state; In practical applications: When a search round begins, there are multiple unselected candidate segments in the transition table. Some of these candidate segments have large transition values, while others have zero transition values. First, a continuous transition interval between zero and one is generated based on the accumulated transition values. Then, the transition interval to which the current ant falls is determined based on the extraction value corresponding to the current ant, thus selecting the current segment. Subsequently, the departure end of the current segment is written to the vehicle position, the working direction of the current segment is written to the vehicle direction, and the transition values of candidate segments that intersect with the current segment's position sequence are recorded as zero. Then, the entry verification results and transition values of the remaining candidate segments are recalculated using the updated vehicle position and vehicle direction to form the next round of transition intervals. When the loop reaches a certain round, if the transition values of all candidate segments in the unselected candidate segment set are zero, the selection process stops, and the sequence of valid segments that have been written in sequence is taken as the candidate path obtained in this round of search.
[0022] S5. Based on the total entry cost, total segment cost, total departure cost, and effective segment coverage of each candidate path, determine the target path and output the effective segment sequence corresponding to the target path, as well as the entry end, working direction, and departure end corresponding to each effective segment, as the path planning result. In this embodiment, a unified evaluation and target path determination process is performed on candidate paths to select the subsequent output path planning result from multiple candidate paths. During the process, the total entry cost, total along-segment cost, total departure cost, and effective segment coverage of each candidate path are first read, and entry coverage value, along-segment coverage value, and departure coverage value are formed respectively. Then, the three coverage values are arranged according to the same sorting criterion, and the coverage value at the top of the sort is recorded as the path value of the candidate path. Then, the path values of each candidate path and the sum of the three types of total costs are compared sequentially to determine the candidate path at the top of the sort as the target path, and the effective segment sequence corresponding to the target path, as well as the entry end, working direction, and departure end of each effective segment are output. The implementation process includes the following: First, calculate the path value based on the total entry cost, total along-segment cost, total departure cost, and effective segment coverage for each candidate path. In specific processing, read the total entry cost, total along-segment cost, total departure cost, and effective segment coverage for each candidate path one by one. The total entry cost is the sum of the entry costs of all effective segments in the candidate path; the total along-segment cost is the sum of the along-segment costs of all effective segments in the candidate path; the total departure cost is the sum of the departure costs of all effective segments in the candidate path; and the effective segment coverage is the number of effective segments in the candidate path. Then, divide the effective segment coverage by the total entry cost, along-segment cost, and effective segment coverage for each candidate path. The entry cost, total siding cost, and total departure cost are used to obtain the entry coverage value, siding coverage value, and departure coverage value. When there is a zero value in the total entry cost, total siding cost, or total departure cost, the corresponding coverage value is directly recorded as zero to avoid undefined results. After the three coverage values are generated, they are arranged in descending order of value, and the coverage value at the top of the list is recorded as the path value of the candidate path. The entry coverage value, siding coverage value, departure coverage value, and path value are all written into the path evaluation table. After this processing, each candidate path corresponds to a unique path value, and this path value is obtained from the three types of coverage values of the same path using a unified standard. After the path values are formed, the target path is determined based on the path values of each candidate path, and the path planning results are output. Specifically, all candidate paths in the path evaluation table are first sorted from largest to smallest by path value, with the first path indicating the highest priority under the current evaluation criteria. When two or more candidate paths have the same path value, the total entry cost, total segment cost, and total departure cost corresponding to these candidate paths are read separately, and these three are added together to obtain the total value. The total value is then sorted from smallest to largest, with candidate paths having smaller total values listed first. If the total values are still the same, the candidate paths are sorted from smallest to largest by their path numbers to ensure the uniqueness of the target path. After sorting, the candidate path at the top of the list is determined as the target path. Then, the effective segment sequence corresponding to the target path is read, and the entry point, working direction, and departure point of each effective segment are output sequentially according to their order in the sequence, forming a path planning result record. The path planning result record includes at least the target path number, the effective segment sequence, and the entry point, working direction, and departure point corresponding to each effective segment in the sequence, for subsequent scheduling and use. Through the above processing, each candidate path first forms three coverage values from the effective segment coverage and the total cost of the three types, and then obtains the path value from the three coverage values according to a unified sorting caliber; then all candidate paths are sorted in two levels according to the path value and the total cost value, so that the process of determining the target path is consistent with the entry cost, segment cost, departure cost and effective segment coverage formed in the previous order, and the output results directly correspond to the effective segment sequence and its endpoint and direction information. In practical applications: When three candidate paths are obtained in the same round of search, the number of valid segments of the three candidate paths is counted first, and the total entry cost, total along-segment cost, and total departure cost of each path are accumulated. Then, the entry coverage value, along-segment coverage value, and departure coverage value are calculated for each candidate path, and the three coverage values are sorted from largest to smallest, with the first value being taken as the path value. Subsequently, the three candidate paths are sorted from largest to smallest path value. If two candidate paths have the same path value, the sum of the total entry cost, total along-segment cost, and total departure cost of these two candidate paths is compared, and the candidate path with the smaller sum of cost values is retained first. Finally, the candidate path with the largest value is determined as the target path, and the entry end, working direction, and departure end corresponding to each valid segment are output according to the order of the valid segments in the path, as the result of this round of path planning.
[0023] Furthermore, it also includes a sanitation vehicle route planning system based on ant colony optimization, including: The route determination module is used to determine the entry point, operation direction and departure point of each road segment to be cleared based on the road segment to be cleared, road network relationship, vehicle location, vehicle direction, as well as the road width, lane occupation position and end turning conditions of the road segment to be cleared, and generate candidate segments. The path verification module extracts the road width, lane occupation position and end turning conditions for each candidate segment along the direction from the entry end to the departure end, and performs entry verification, segment verification and departure verification in sequence. It records the first verification failure position, determines the candidate segment without the first verification failure position as the valid segment, and calculates the corresponding entry cost, segment cost and departure cost. The transfer calculation module is used to take effective segments as the ant colony transfer objects, calculate the transfer value of the vehicle entering each effective segment based on the vehicle position, vehicle direction, entry cost, segment cost, and departure cost, and record the transfer value of the candidate segment with the first failed verification position as zero, and generate a transfer table. The path search module is used to perform ant colony search based on the transfer table. For each valid segment selected, the departure end of the valid segment is updated to the vehicle position, the operation direction of the valid segment is updated to the vehicle direction, and the entry verification, segment verification and departure verification are re-executed for the remaining candidate segments, the corresponding transfer values are recalculated, and candidate paths are generated. The results output module is used to determine the target path based on the total entry cost, total segment cost, total departure cost, and effective segment coverage of each candidate path, and outputs the effective segment sequence corresponding to the target path, as well as the entry end, working direction, and departure end corresponding to each effective segment, as the path planning result. Working Principle: This scheme first determines the entry point, working direction, and departure point of the road segment to be cleared by combining road network relationships, vehicle current position, and vehicle direction, thus obtaining candidate segments. Then, it performs entry verification, segment verification, and departure verification at each position along the candidate segments, identifying the candidate segments that can complete the entire process of entry, continuous passage, and forward departure as valid segments, and generating entry cost, segment cost, and departure cost. Subsequently, based on the access distance of the vehicle to each valid segment, the difference between the vehicle direction and the working direction, and the three types of costs, it calculates the transfer value of each valid segment, forming a transfer table. Then, it selects the current segment round by round according to the transfer table, updating the departure point to the new vehicle position and the working direction to the new vehicle direction after each segment selection, and re-performing verification and transfer value calculation for the remaining candidate segments, thereby realizing dynamic process control in the path search process. Finally, it evaluates the generated candidate paths, selects the target path, and outputs the entry point, working direction, and departure point of each valid segment as the path planning result. For example, in a sanitation scenario where residential side streets, back alleys, and roadside shops are interspersed, after a sanitation vehicle enters from the community entrance, the system first determines which end of each road segment to be cleaned can be accessed in the forward direction. Then, it checks whether the vehicle will be blocked by temporarily parked vehicles or road occupants along the way, and whether it can leave from the end of the road to the next connecting road after the work is completed. Only road segments that meet this continuous operation process control requirement are retained as valid segments. Afterward, the system compares the access distance, direction difference, and three types of costs of each valid segment based on the current vehicle position and direction to determine the road segment that should be entered first in this round. When the vehicle completes the road segment, the system immediately switches the vehicle status to the departure end of the road segment and re-checks whether the remaining road segments still meet the process control conditions for entry, passage, and departure in the new state, thereby forming a sanitation route that can be continuously operated, does not become unstable midway, and can be detached in the forward direction.
[0024] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. 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 sanitation vehicle route planning method based on ant colony algorithm, characterized in that, include: S1. Based on the road section to be cleared, road network relationship, vehicle position, vehicle direction, as well as the road width, lane occupation position and end turning conditions of the road section to be cleared, determine the entry end, operation direction and departure end of each road section to be cleared, and generate candidate sections. S2. For each candidate segment, extract the road width, lane occupation position and end turning condition position by position along the direction from the entry end to the departure end, and perform entry verification, segment verification and departure verification in sequence. Record the first verification failure position, determine the candidate segment without the first verification failure position as the valid segment, and calculate the corresponding entry cost, segment cost and departure cost. S3. Using effective segments as the ant colony transfer objects, calculate the transfer value of the vehicle entering each effective segment based on the vehicle position, vehicle direction, entry cost, segment cost, and departure cost, and record the transfer value of the candidate segment with the first failed verification position as zero, and generate a transfer table. S4. Perform ant colony search based on the transfer table. For each valid segment selected, update the departure end of the valid segment to the vehicle position, update the operation direction of the valid segment to the vehicle direction, and re-perform entry verification, segment verification, and departure verification for the remaining candidate segments, recalculate the corresponding transfer values, and generate candidate paths. S5. Based on the total entry cost, total segment cost, total departure cost, and effective segment coverage of each candidate path, determine the target path and output the effective segment sequence corresponding to the target path, as well as the entry end, working direction, and departure end corresponding to each effective segment, as the path planning result.
2. The sanitation vehicle route planning method based on ant colony algorithm according to claim 1, characterized in that: S1 includes: S1-1. Based on the road network relationship, vehicle location and vehicle direction, extract the two-end nodes that connect each road segment to be cleared to the current location of the vehicle, calculate the arrival direction from the vehicle location to the two-end nodes, and generate the candidate entry point corresponding to each road segment to be cleared. S1-2. For each candidate entry point, extract the road width, lane occupation position and end turning conditions position by position along the extension direction of the corresponding road section to be cleared, determine the continuous passage direction from the candidate entry point to the other end node, and generate the operation direction and candidate departure point corresponding to each road section to be cleared. S1-3. Based on the candidate entry end, working direction and candidate departure end, compare the forward access result after the vehicle turns into the candidate entry end from the current position and the forward departure result after driving out of the candidate departure end. Determine the endpoints corresponding to the forward access result and the forward departure result as the entry end and departure end respectively, and generate candidate segments.
3. The sanitation vehicle route planning method based on ant colony algorithm according to claim 2, characterized in that: S2 includes: S2-1. For each candidate segment, establish a position sequence from the entry end to the departure end, and extract the road width, lane occupation position and end turning conditions corresponding to each position according to the position sequence to generate a position table. S2-2. According to the position table, calculate the entry margin and entry length of the vehicle from the entry end to the corresponding position for each position, and write the positions where the entry margin is not less than the vehicle width and the entry length is not less than the vehicle length into the entry mark. S2-3. For the position to be marked, calculate the remaining margin and blocking length of the vehicle along the working direction for each adjacent position in the position sequence, and write the position with a remaining margin of not less than the vehicle width and a blocking length of zero into the position mark.
4. The sanitation vehicle route planning method based on ant colony algorithm according to claim 3, characterized in that: S2 further includes: S2-4. For the position marked along the segment, combine the end turning conditions corresponding to the departure end and the connecting road segment outside the departure end to calculate the departure margin and departure connection result of the vehicle leaving the candidate segment from the corresponding position. Write the position where the departure margin is not less than the vehicle width and the departure connection result is valid into the closed mark. S2-5. Check the entry mark, along-segment mark and closing mark of each position in sequence according to the position sequence. The first position that is missing the corresponding mark is determined as the first failed position. The candidate segment that does not have a first failed position is determined as a valid segment. S2-6. Based on the entry margin, along-segment margin, and departure margin corresponding to each position in the effective segment, accumulate and generate the entry cost, along-segment cost, and departure cost respectively.
5. The sanitation vehicle route planning method based on ant colony algorithm according to claim 4, characterized in that: S3 includes: S3-1. Based on the vehicle position, vehicle direction, and the entry point, working direction, entry cost, along-segment cost, and departure cost corresponding to each effective segment, calculate the access distance from the vehicle position to each entry point, the direction difference between the vehicle direction and each working direction, and the cost sum of the entry cost, along-segment cost, and departure cost, and generate a segment table. S3-2. Based on the segment table, generate distance numbers in ascending order of access distance, generate direction numbers in ascending order of direction difference, and generate cost numbers in ascending order of cost sum. Then, add the distance numbers and direction numbers together to generate the access number.
6. The sanitation vehicle route planning method based on ant colony algorithm according to claim 5, characterized in that: S3 further includes: S3-3. Based on the access sequence number and cost sequence number corresponding to each valid segment, sort them first by access sequence number from smallest to largest, then sort them by cost sequence number from smallest to largest, generate transfer sequence number, and record the transfer sequence number corresponding to the candidate segment with the first verification failure position as zero. S3-4. Based on the transfer sequence number corresponding to each valid segment, generate the original transfer value by subtracting the transfer sequence number from the total number of candidate segments and then adding one. Then, normalize the original transfer values according to the sum of the original transfer values. Record the transfer value corresponding to the candidate segment with the first failed verification position as zero, and generate the transfer table.
7. The sanitation vehicle route planning method based on ant colony algorithm according to claim 6, characterized in that: S4 includes: S4-1. Based on the transfer table, generate a transfer interval by accumulating the transfer values corresponding to each candidate segment, and write the vehicle position, vehicle direction, set of unselected candidate segments and sequence of selected valid segments into the path status table. S4-2. Based on the set of unselected candidate segments and the transition interval in the path status table, extract the valid segment that currently falls into the transition interval as the current segment, and write the current segment into the sequence of selected valid segments.
8. The sanitation vehicle route planning method based on ant colony algorithm according to claim 7, characterized in that: S4 further includes: S4-3. Based on the departure end and operation direction corresponding to the current segment, update the vehicle position and vehicle direction respectively, delete the current segment from the set of unselected candidate segments, and record the transition value of the candidate segment that overlaps with the current segment and the candidate segment with the first verification failure position as zero. S4-4. Based on the updated vehicle position, vehicle direction, and unselected candidate segment set, re-execute entry verification, segment verification, and departure verification for the remaining candidate segments, recalculate the corresponding transfer values, and update the transfer interval. Repeat the current segment extraction, vehicle position update, and transfer value recalculation until the unselected candidate segment set is empty or all transfer values of the remaining candidate segments are zero, and generate candidate paths.
9. The sanitation vehicle route planning method based on ant colony algorithm according to claim 8, characterized in that: S5 includes: S5-1. Based on the total entry cost, total along-segment cost, total departure cost, and effective segment coverage corresponding to each candidate path, calculate the effective segment coverage divided by the total entry cost to obtain the entry coverage value, the effective segment coverage divided by the total along-segment cost to obtain the along-segment coverage value, and the effective segment coverage divided by the total departure cost to obtain the departure coverage value. Record the first value among the entry coverage value, along-segment coverage value, and departure coverage value as the path value. S5-2. Sort the candidate paths in descending order according to their path values. Sort the candidate paths with the same path value in ascending order according to the sum of total entry cost, total segment cost, and total departure cost. Determine the candidate path with the highest ranking as the target path. Output the effective segment sequence corresponding to the target path, as well as the entry end, working direction, and departure end of each effective segment, as the path planning result.
10. A sanitation vehicle route planning system based on ant colony algorithm, characterized in that, include: The route determination module is used to determine the entry point, operation direction and departure point of each road segment to be cleared based on the road segment to be cleared, road network relationship, vehicle location, vehicle direction, as well as the road width, lane occupation position and end turning conditions of the road segment to be cleared, and generate candidate segments. The path verification module extracts the road width, lane occupation position and end turning conditions for each candidate segment along the direction from the entry end to the departure end, and performs entry verification, segment verification and departure verification in sequence. It records the first verification failure position, determines the candidate segment without the first verification failure position as the valid segment, and calculates the corresponding entry cost, segment cost and departure cost. The transfer calculation module is used to take effective segments as the ant colony transfer objects, calculate the transfer value of the vehicle entering each effective segment based on the vehicle position, vehicle direction, entry cost, segment cost, and departure cost, and record the transfer value of the candidate segment with the first failed verification position as zero, and generate a transfer table. The path search module is used to perform ant colony search based on the transfer table. For each valid segment selected, the departure end of the valid segment is updated to the vehicle position, the operation direction of the valid segment is updated to the vehicle direction, and the entry verification, segment verification and departure verification are re-executed for the remaining candidate segments, the corresponding transfer values are recalculated, and candidate paths are generated. The results output module is used to determine the target path based on the total entry cost, total segment cost, total departure cost, and effective segment coverage of each candidate path, and output the effective segment sequence corresponding to the target path, as well as the entry end, working direction, and departure end corresponding to each effective segment, as the path planning result.