A sanitation vehicle networking and concurrent scheduling method and system based on geographical affinity
By preprocessing sanitation vehicle operation data and stably generating geographic area identifiers, combined with hash modulo mapping and continuous sequence number gating, the problems of task instability and load imbalance caused by geographic area switching in the sanitation vehicle network system are solved, achieving efficient controlled concurrent scheduling and data time sequence consistency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHENGDU YIWEI NEW ENERGY VEHICLE CO LTD
- Filing Date
- 2026-03-26
- Publication Date
- 2026-06-09
AI Technical Summary
In high-concurrency scenarios, existing sanitation vehicle networking systems experience frequent changes in area identifiers when vehicles switch geographical regions, leading to unstable task allocation, unbalanced load scheduling, and impacting the time-series consistency of data processing and system efficiency.
By periodically collecting sanitation vehicle operation data, performing time synchronization correction, sampling jitter suppression, and numerical normalization, stable geographical area identifiers are generated. A boundary buffer threshold and cross-regional dual threshold confirmation mechanism are adopted, combined with hash modulo mapping and continuous sequence number gating, to achieve controlled concurrent scheduling and dynamically adjust geographical grid division parameters to ensure load balancing.
It effectively suppressed the frequent changes in area identifiers caused by vehicle positioning jitter, improved data timing consistency and load stability, reduced task interleaving and repeated reordering of execution links, alleviated local load jitter, and improved the scheduling efficiency and stability of the system.
Smart Images

Figure CN122179758A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of concurrent task scheduling technology, specifically to a geographically affinity-based concurrent scheduling method and system for sanitation vehicle networks. Background Technology
[0002] With the development of smart sanitation and vehicle-to-everything (V2X) technologies, sanitation vehicles typically rely on onboard positioning modules, operational status acquisition units, and wireless communication units for continuous data reporting and task coordination during operations. These systems often run on onboard terminal platforms with real-time data acquisition and communication capabilities. These platforms are usually based on sensor network operating systems to manage access to multi-source sensor data, synchronize time, and schedule network transmission. In practical applications, due to the large number of sanitation vehicles, the dynamic changes in operational areas, and the periodic and concurrent nature of data reporting, existing V2X task processing and scheduling methods are prone to problems in high-concurrency scenarios, such as frequent task switching across regions due to regional boundary jitter, task queue backlog, and uneven load distribution. This affects the timing consistency of task processing and the overall system scheduling efficiency.
[0003] For example, application CN117435318A relates to a multi-concurrent task scheduling system and method for a vehicle intelligent driving system. The system includes: an upper-layer application platform and an lower-layer hardware platform; an environment and resource sensor, used to construct a current application set based on the current application data of the upper-layer application platform, and obtain the current application load of the vehicle based on the current application set, while acquiring the current environment data of the vehicle and the current hardware resource data of the lower-layer hardware platform; and a scheduler, used to prioritize the current applications and current tasks in the current application set based on the current application load, current environment data, and current hardware resource data, obtain a priority queue, and generate a corresponding optimal scheduling strategy based on the priority queue.
[0004] For example, the invention with publication number CN120704861A discloses a method and apparatus for handling concurrent task conflicts in a vehicle. It detects whether there are resource conflicts or emergency priority update events in the vehicle. If there are resource conflicts or emergency priority update events, the priority of each target task in the concurrent task list is updated to obtain an updated concurrent task list. Based on the priority of each target task in the updated concurrent task list and the resource occupancy rate of each target resource, resource allocation is performed on each target task.
[0005] However, the aforementioned existing technologies are more geared towards a scheduling paradigm of "task priority sorting - resource allocation - conflict handling," which typically uses application load or resource consumption as the core decision-making basis. They are difficult to directly address the regional affinity and temporal consistency issues when the vehicle network platform performs deterministic segmented concurrent processing based on geographical regions. In high-frequency location reporting scenarios such as sanitation vehicle network, when a vehicle is near the boundary of a geographical grid and its location fluctuates, latitude and longitude perturbations can cause frequent jumps in geographical region identifiers between adjacent grids. This results in the same vehicle data being mapped to different processing segments in adjacent sampling periods, thereby disrupting the sequential / controlled concurrent execution link within the segment and causing temporal continuity of regional data to be cut off. This makes it difficult to guarantee the temporal consistency of data processing within the region and causes significant fluctuations in the load of local processing segments.
[0006] Therefore, in order to address the above problems, there is an urgent need for a geographically affinity-based method and system for concurrent scheduling of sanitation vehicles in the Internet of Things. Summary of the Invention
[0007] Technical problems to be solved
[0008] To address the shortcomings of existing technologies, this invention provides a geographically affinity-based concurrent scheduling method and system for sanitation vehicle networks, which solves the problems of unstable task allocation and unbalanced load scheduling caused by frequent changes in area identifiers due to geographical area switching and boundary jitter in existing sanitation vehicle operation data.
[0009] Technical solution
[0010] To achieve the above objectives, the present invention provides the following technical solution: a concurrent scheduling method for sanitation vehicle networks based on geographic affinity, comprising: S1, periodically collecting sanitation vehicle operation data, and performing time synchronization correction, sampling jitter suppression, outlier removal, and numerical normalization on the sanitation vehicle operation data, and outputting preprocessed sanitation vehicle operation data; S2, generating candidate geographic region identifiers based on the preprocessed sanitation vehicle operation data and geographic grid division parameters, and generating and updating stable geographic region identifiers using a boundary buffer threshold and cross-regional dual threshold confirmation mechanism, and outputting regional affinity tasks. Dataset; S3, perform hash modulo mapping on stable geographic region identifiers to generate processing fragment identifiers, and build regional task sub-queues within fragments according to stable geographic region identifiers. Perform controlled concurrent scheduling based on continuous sequence number gating and regional token gating, and output fragment execution result data; S4, read fragment execution result data to calculate fragment load value. When the fragment load value exceeds the load threshold, perform regional splitting to generate adjusted geographic grid division parameters, and regenerate stable geographic region identifiers and processing fragment identifiers based on the adjusted geographic grid division parameters, and update the concurrent scheduling mapping relationship of sanitation vehicles.
[0011] Furthermore, the specific steps for periodically collecting sanitation vehicle operation data and performing time synchronization correction, sampling jitter suppression, outlier removal, and numerical normalization on the sanitation vehicle operation data to output the preprocessed sanitation vehicle operation data are as follows: A fixed-width sliding time window is set as one sampling period, and sanitation vehicle operation data is periodically collected. The sanitation vehicle operation data includes a sampling period identifier, vehicle identifier, and vehicle location, with the vehicle location including latitude and longitude values. For the collected sanitation vehicle operation data, a network time protocol synchronization algorithm is used to perform time synchronization correction on the sanitation vehicle operation data. A Kalman filter algorithm is used to suppress sampling jitter on the latitude and longitude values. A quartile anomaly detection algorithm is used to identify and remove outliers on the latitude and longitude values. A min-max normalization algorithm is used to perform numerical normalization on the latitude and longitude values, outputting the preprocessed sanitation vehicle operation data.
[0012] Further, the specific steps for generating candidate geographic region identifiers based on preprocessed sanitation vehicle operation data and geographic grid division parameters are as follows: Read the preprocessed sanitation vehicle operation data to obtain the vehicle location of each sanitation vehicle within the current sampling period; read the geographic grid division parameters from the system configuration parameter table, which include latitude grid scale, longitude grid scale, and the maximum value of the longitude grid number; circumulate the latitude value of the sanitation vehicle according to the latitude grid scale to obtain the latitude grid number; circumulate the longitude value of the sanitation vehicle according to the longitude grid scale to obtain the longitude grid number; combine and encode the latitude grid number as the high-order digit and the longitude grid number as the low-order digit, wherein the combination encoding method is: multiply the latitude grid number by the maximum value of the longitude grid number plus one, and then add this to the longitude grid number to generate a unique corresponding candidate geographic region identifier.
[0013] Furthermore, the specific steps for generating and updating stable geographic region identifiers using a boundary buffer threshold and cross-regional dual threshold confirmation mechanism, and outputting the regional affinity task dataset, are as follows: For each sanitation vehicle, within the current sampling period, calculate the boundary distance from the vehicle's location to the nearest latitude grid boundary line and the boundary distance to the nearest longitude grid boundary line according to the geographic distance conversion rules, and take the smaller of the two as the boundary determination distance; when the boundary determination distance is not less than the boundary buffer threshold, mark the candidate geographic region identifier as a stable geographic region identifier; when the boundary determination distance is less than the boundary buffer threshold, mark the candidate geographic region identifier as a stable geographic region identifier. A stable candidate geographic region is identified, and the stable geographic region identifier from the previous sampling period is used as the stable geographic region identifier for the current sampling period. For the same sanitation vehicle, the cumulative number of times the candidate geographic region identifier and the stable geographic region identifier are inconsistent within N consecutive sampling periods is counted, and the duration of inconsistency is also accumulated. When the cumulative number of times reaches the cross-regional confirmation count threshold and the cumulative duration reaches the cross-regional confirmation duration threshold, the stable geographic region identifier is updated to the candidate geographic region identifier. For each sanitation vehicle, the vehicle identifier and the stable geographic region identifier are written into the vehicle data processing task header information of the current sampling period, and the regional affinity task dataset is output.
[0014] Further, the specific steps for generating processing fragment identifiers by performing hash modulo mapping on stable geographic region identifiers are as follows: Read the regional affinity task dataset, extract stable geographic region identifiers, vehicle identifiers, and sampling period identifiers, construct vehicle data processing tasks, and generate task sequence numbers for each vehicle data processing task by sorting them in ascending order of task arrival timestamps within the sampling period and incrementing them. When task arrival timestamps are the same, the order is determined by ascending vehicle identifier order. Read the number of processing fragments and hash calculation rules from the system configuration parameter table, convert the stable geographic region identifiers into byte sequences according to the hash calculation rules, and execute the SHA-256 hash algorithm to obtain a 256-bit hash digest. Take the lower 64 bits of the hash digest and convert them into non-negative integers as modulo inputs. Take the modulo of the modulo inputs according to the number of processing fragments to obtain the processing fragment identifiers.
[0015] Furthermore, the specific steps for constructing regional task sub-queues based on stable geographic region identifiers within each shard are as follows: Vehicle data processing tasks are written into the task queue of the corresponding processing shard according to the processing shard identifier; each stable geographic region identifier corresponds to a unique processing shard. Within each processing shard, the task queue is grouped by region according to the stable geographic region identifier to generate regional task sub-queues. Each regional task sub-queue is sorted by task sequence number, and a regional completed sequence number and a regional concurrent token count are maintained for each stable geographic region identifier.
[0016] Furthermore, the specific steps for executing controlled concurrent scheduling based on continuous sequence number gating and regional token gating, and outputting the sharded execution result data, are as follows: Within each processing shard, controlled concurrent scheduling is performed on the regional task sub-queues: When the number of tasks being executed within a processing shard is less than the maximum concurrency threshold and the regional concurrent token count is less than the regional concurrent token limit, a vehicle data processing task with a task sequence number equal to the regional completed sequence number plus one is selected from the head of the corresponding regional task sub-queue, marked as being in the execution state, and the regional concurrent token count is incremented by one; when the number of tasks being executed within a shard is not less than the maximum concurrency threshold or the regional concurrent token count is not less than the regional concurrent token limit, the tasks to be executed are kept in the regional task sub-queue awaiting scheduling; for vehicle data processing tasks entering the execution state, execution sequence identifiers are generated according to the order of the regional task sub-queues. When a task is completed, the regional completed sequence number is updated to the task sequence number, and the regional concurrent token count is decremented by one. Simultaneously, the task completion flag and the sharded execution sequence identifier are written back to the sharded task status table, and the sharded execution result data is output.
[0017] Further, the specific steps for reading the shard execution result data and calculating the shard load value are as follows: Set the duration of K consecutive sampling periods as a load monitoring period, and count the number of vehicle data processing tasks entering the task queue within the load monitoring period according to the processing shard identifier; read the shard execution result data, and count the number of vehicle data processing tasks completed within the load monitoring period according to the processing shard identifier; divide the number of vehicle data processing tasks entering the task queue and the number of completed vehicle data processing tasks by the duration of the load monitoring period to obtain the shard arrival load value and the shard completion load value; calculate the difference between the shard arrival load value and the shard completion load value, taking a non-negative value, to obtain the shard load value.
[0018] Furthermore, when the segment load value exceeds the load threshold, the specific steps for performing region splitting to generate adjusted geographic grid partitioning parameters, and regenerating stable geographic region identifiers and processing segment identifiers based on the adjusted geographic grid partitioning parameters, and updating the concurrent scheduling mapping relationship of sanitation vehicles are as follows: When the segment load value does not exceed the load threshold, the current geographic grid partitioning parameters remain unchanged; when the segment load value exceeds the load threshold, the target stable geographic region identifier set associated with the current processing segment identifier is determined, and a regional scale adjustment model is constructed using a proportional segmented mapping algorithm. The segment load value is input into the regional scale adjustment model, and the corresponding regional splitting scale is output; based on the regional splitting scale, the target stable geographic region identifier set is split to generate adjusted geographic grid partitioning parameters, and the adjusted geographic grid partitioning parameters are written into the system configuration parameter table; based on the adjusted geographic grid partitioning parameters, stable geographic region identifiers are regenerated for sanitation vehicle operation data in subsequent sampling periods, and hash modulo mapping is performed on the stable geographic region identifiers to obtain processing segment identifiers; vehicle data processing tasks are written into the corresponding task queues according to the processing segment identifiers.
[0019] The second aspect of this invention provides a geographically affinity-based concurrent scheduling system for sanitation vehicles, comprising: a data acquisition and preprocessing module, a stability identifier generation module, a sharded concurrent scheduling module, and a load area adjustment module. The data acquisition and preprocessing module periodically acquires sanitation vehicle operation data and performs time synchronization correction, sampling jitter suppression, outlier removal, and numerical normalization on the data, outputting preprocessed sanitation vehicle operation data. The stability identifier generation module generates candidate geographical area identifiers based on the preprocessed sanitation vehicle operation data and geographical grid division parameters, and generates and updates stable identifiers using a boundary buffer threshold and cross-regional dual threshold confirmation mechanism. The system consists of a stable geographic region identifier and an output region-affinity task dataset. A sharding concurrent scheduling module performs hash-modulo mapping on stable geographic region identifiers to generate processing shard identifiers. Within each shard, it constructs a sub-queue of regional tasks based on the stable geographic region identifier. Controlled concurrent scheduling is performed based on consecutive sequence number gating and region token gating, and the sharding execution result data is output. A load region adjustment module reads the sharding execution result data, calculates the sharding load value, and when the sharding load value exceeds the load threshold, performs region splitting to generate adjusted geographic grid partitioning parameters. Based on the adjusted geographic grid partitioning parameters, it regenerates the stable geographic region identifier and the processing shard identifier, and updates the concurrent scheduling mapping relationship for sanitation vehicles.
[0020] Beneficial effects
[0021] The present invention has the following beneficial effects:
[0022] (1) A concurrent scheduling method and system for sanitation vehicle network based on geographic affinity, which generates and updates stable geographic area identifiers by adopting a joint confirmation mechanism of boundary buffer threshold, cross-regional confirmation count threshold, and cross-regional confirmation duration threshold, suppresses frequent changes in candidate geographic area identifiers caused by positioning jitter near the geographic grid boundary, and reduces the probability of cross-segment mapping of the same vehicle data in adjacent sampling periods.
[0023] (2) A concurrent scheduling method and system for sanitation vehicle network based on geographic affinity, which uses stable geographic region identifiers as deterministic segment inputs and constructs regional task sub-queues according to stable geographic region identifiers in the processing segment. Combined with continuous sequence number gating, the sequential connection of tasks in the region is realized, reducing the time continuity of regional related data in the segment and improving the controllability of data temporal consistency in the regional dimension.
[0024] (3) A concurrent scheduling method and system for sanitation vehicle network based on geographic affinity, by introducing regional token gating and maximum concurrency threshold joint constraints on the basis of continuous sequence number gating, while ensuring that the sequential link in the region is not interrupted, the controlled concurrent advancement in the segment is achieved, avoiding the task overlap and repeated reordering of execution links in the region caused by unconstrained concurrency.
[0025] (4) A concurrent scheduling method and system for sanitation vehicle network based on geographic affinity, which generates a segmented load value based on the segmented execution result data and triggers regional splitting to generate adjusted geographic grid division parameters, drives the adaptive update of the mapping relationship between stable geographic area identifier and processing segment identifier, alleviates the local processing segment load jitter and backlog diffusion caused by the concentration of hot spots, and improves the stability of concurrent scheduling under load change conditions. Attached Figure Description
[0026] Figure 1 A flowchart of a concurrent scheduling method for sanitation vehicle networking based on geographic affinity;
[0027] Figure 2 This is a diagram illustrating the architecture of a geographically affinity-based concurrent dispatching system for sanitation vehicles.
[0028] Figure 3 Adjustment judgment map for geographic grid partitioning based on piecewise load values;
[0029] Figure 4 A flowchart for the dynamic adjustment of concurrent dispatching areas for sanitation vehicles. Detailed Implementation
[0030] 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.
[0031] Please see Figures 1-4 This invention provides a technical solution: a concurrent scheduling method for sanitation vehicle networks based on geographic affinity, comprising: S1, periodically collecting sanitation vehicle operation data, and performing time synchronization correction, sampling jitter suppression, outlier removal and numerical normalization processing on the sanitation vehicle operation data, and outputting preprocessed sanitation vehicle operation data; S2, generating candidate geographic region identifiers based on the preprocessed sanitation vehicle operation data and geographic grid division parameters, and generating and updating stable geographic region identifiers using a boundary buffer threshold and cross-region dual threshold confirmation mechanism, and outputting a regional affinity task dataset; S3, perform hash modulo mapping on the stable geographic region identifier to generate processing fragment identifiers, and build regional task sub-queues within the fragments according to the stable geographic region identifiers. Perform controlled concurrent scheduling based on continuous sequence number gating and regional token gating, and output fragment execution result data; S4, read the fragment execution result data to calculate the fragment load value. When the fragment load value exceeds the load threshold, perform regional splitting to generate adjusted geographic grid division parameters, and regenerate the stable geographic region identifier and processing fragment identifier based on the adjusted geographic grid division parameters, and update the concurrent scheduling mapping relationship of sanitation vehicles.
[0032] Specifically, the following steps are taken to periodically collect sanitation vehicle operation data and perform time synchronization correction, sampling jitter suppression, outlier removal, and numerical normalization on the data, outputting the preprocessed sanitation vehicle operation data: A fixed-width sliding time window is set as one sampling period. At the start of the sampling period, the real-time clock of the vehicle gateway generates a sampling period start timestamp and writes it into the sampling period identifier. The sampling period identifier is used to merge vehicle positions within the same sampling period and serves as the time reference for subsequent stable geographic area identifier generation; Operation data from each sanitation vehicle is periodically collected. The vehicle identifier is read from the device number of the vehicle communication terminal and written into the vehicle identifier field. The vehicle identifier is used for... A vehicle index is created to distinguish different sanitation vehicles and is used for subsequent task construction. Vehicle locations are collected by the onboard satellite positioning terminal and written into the vehicle location field. The onboard satellite positioning terminal outputs latitude and longitude values and writes them into the latitude and longitude fields, respectively. These latitude and longitude values are used for subsequent candidate geographic area identification calculation and boundary determination distance calculation. For the collected sanitation vehicle operation data, a network time protocol synchronization algorithm is used to perform time synchronization correction on the sampling period identifier. The network time protocol synchronization algorithm involves the onboard gateway initiating a time synchronization request to the time server and calculating the clock offset. The clock offset is then superimposed on the sampling period start timestamp to obtain the corrected sampling period identifier, which is then written back. For vehicle locations... Perform integrity checks, detecting and removing vehicle location records with empty latitude and longitude fields. For each vehicle identifier, extract the latitude and longitude sequences within the sampling period and sort them by sampling period identifier. Use a Kalman filter algorithm to perform state prediction and measurement updates on the latitude sequence to obtain a filtered latitude sequence. Use the same algorithm on the longitude sequence to obtain a filtered longitude sequence. Write the filtered latitude and longitude values back to the vehicle location. Use an interquartile range (IQAR) anomaly detection algorithm to calculate the first and third quartiles and the interquartile range (IQAR) of the filtered latitude sequence. The first and third quartiles of the filtered longitude sequence are calculated using an interquartile range (IQR) anomaly detection algorithm. The first quartile is subtracted from the IQR by 1.5, and the IQR is added to the third quartile, which is then used as the upper bound of the longitude. Filtered longitude values less than the lower bound and greater than the upper bound are identified as outliers and removed.The min-max normalization algorithm is used to perform numerical normalization on the latitude values after outlier removal. The minimum latitude value within the sampling period is extracted and recorded as the minimum latitude value, and the maximum latitude value within the sampling period is extracted and recorded as the maximum latitude value. A normalized latitude value is calculated for each latitude value. The normalized latitude value is calculated as the latitude value minus the minimum latitude value, divided by the maximum latitude value minus the minimum latitude value. When the difference between the maximum and minimum latitude values is zero, the normalized latitude value is set to zero. The min-max normalization algorithm is used to normalize the latitude values after outlier removal. After constant point, the longitude values are numerically normalized. The minimum longitude value within the sampling period is extracted and recorded as the minimum longitude value, and the maximum longitude value within the sampling period is extracted and recorded as the maximum longitude value. A normalized longitude value is calculated for each longitude value. The normalized longitude value is calculated as the longitude value minus the minimum longitude value, divided by the maximum longitude value minus the minimum longitude value. When the maximum longitude value minus the minimum longitude value is zero, the normalized longitude value is set to zero. The normalized latitude and longitude values are then written into the preprocessed sanitation vehicle operation data and output.
[0033] In this implementation plan, by establishing a unified data alignment benchmark and consistent numerical expression method during the collection and processing of sampling period identifiers, vehicle identifiers, and vehicle locations, the preprocessed sanitation vehicle operation data forms a stable input in terms of time scale, spatial coordinate scale, and data quality scale. This ensures that latitude and longitude values remain comparable and reusable in subsequent candidate geographic region identifier calculations, boundary determination distance calculations, and stable geographic region identifier updates. This reduces the sensitivity of region identifier jumps caused by sampling clock drift and positioning jitter, and improves the stability of the region affinity task dataset generation.
[0034] Specifically, the steps for generating candidate geographic region identifiers based on preprocessed sanitation vehicle operation data and geographic grid division parameters are as follows: Read the preprocessed sanitation vehicle operation data; locate the current sampling period record according to the sampling period identifier; obtain the vehicle location of each sanitation vehicle within the current sampling period and extract the latitude and longitude values from the vehicle location. The vehicle location is used to characterize the spatial landing point of the sanitation vehicle within the current sampling period and provides input for the calculation of candidate geographic region identifiers; read the system configuration parameter table. The system configuration parameter table is a configuration data table storing parameters for the concurrent scheduling process. The system configuration parameter table uses parameter key fields and parameter value fields to form key-value records and includes a parameter version identifier field. The configuration parameter table is written by the operation and maintenance configuration interface and loaded into the memory configuration cache by the task processing process at the beginning of the sampling period according to the parameter version identifier field. The geographic grid division parameters are retrieved from the memory configuration cache of the system configuration parameter table by the parameter key field, and the corresponding parameter value field is obtained. The geographic grid division parameters include latitude grid scale, longitude grid scale, and maximum longitude grid number. The latitude grid scale defines the grid step size in the latitudinal direction to map continuous latitude values to discrete latitude grid numbers. The longitude grid scale defines the grid step size in the longitude direction to map continuous longitude values to discrete longitude grid numbers. The maximum longitude grid number corresponds to the system service area in the longitude direction according to the stated longitude grid scale. The maximum grid number after gridding is used to calculate the longitude grid base, which is defined as the maximum longitude grid number plus one. The longitude grid base is used to determine the low-order carry base of the combined code. The latitude value of the sanitation vehicle is gridded and rounded according to the latitude grid scale. The grid rounding adopts the rounding down rule. The latitude value is divided by the latitude grid scale to obtain the latitude quotient, and the latitude quotient is rounded down to obtain the latitude grid number. The latitude grid number is used to represent the grid row where the latitude direction is located and to provide a high-order index for the combined code. The longitude value of the sanitation vehicle is gridded and rounded according to the longitude grid scale. The grid rounding adopts the rounding down rule. The longitude value is divided by the longitude grid scale. The longitude quotient is obtained and rounded down to obtain the longitude grid number. The longitude grid number is used to represent the grid column where the longitude direction is located and to provide a low-order index for the combined encoding. The latitude grid number is used as the high-order number and the longitude grid number is used as the low-order number for combined encoding. The combined encoding method is as follows: the latitude grid number is multiplied by the longitude grid base to obtain the high-order offset, and the high-order offset is added to the longitude grid number to obtain the combined encoding value and written into the candidate geographic region identifier. The candidate geographic region identifier is used to uniquely number the spatial grid unit under the same geographic grid division parameter constraints and to provide a consistent regional key value for subsequent stable geographic region identifier generation and deterministic piecewise mapping.
[0035] In this implementation scheme, the vehicle locations in the preprocessed sanitation vehicle operation data are uniformly discretized and encoded under the constraints of geographic grid partitioning parameters. The candidate geographic region identifiers maintain a reproducible deterministic mapping relationship in the sampling period identifier dimension. This ensures that the conversion process from vehicle location to candidate geographic region identifiers has a consistent spatial resolution benchmark and a consistent numbering benchmark. This provides a stable region key input for stable geographic region identifier generation and processing of fragment identifier calculation, reducing the risk of region key inconsistency caused by parameter drift in different task processing processes.
[0036] Specifically, the steps for generating and updating stable geographic region identifiers and outputting the regional affinity task dataset using a boundary buffer threshold and cross-regional dual threshold confirmation mechanism are as follows: For each sanitation vehicle, within the current sampling period, calculate the boundary distance from the vehicle's location to the nearest latitude grid boundary and the nearest longitude grid boundary according to the geographic distance conversion rules. The geographic distance conversion rules include latitude and longitude information collected by the vehicle's GPS module, combined with the spherical distance calculation formula on the Earth's surface, to calculate the distance from each sanitation vehicle's current location to the nearest latitude grid boundary and the nearest longitude grid boundary. Based on the physical meaning of latitude and longitude and the grid scale, the geographic distance conversion rules convert latitude differences into latitudinal distances and longitude differences into meridional distances, calculating the distance value of the vehicle's location relative to the grid boundary. The smaller of the two values is taken as the boundary determination distance. The boundary determination distance is used to determine the proximity of the vehicle's location to the grid boundary, serving as a key factor in determining whether it has entered a stable geographic region. When the boundary determination distance is not less than the boundary buffer threshold, the candidate geographic region identifier is marked as a stable geographic region identifier. The boundary buffer threshold is set based on historical data analysis, geographic grid scale, and the actual operating mode of sanitation vehicles. It aims to ensure that when a vehicle is located within the grid boundary area, its area identifier does not change unnecessarily due to small positional fluctuations, thereby improving system stability. When the boundary determination distance is less than the boundary buffer threshold, the candidate geographic area identifier is marked as a boundary instability candidate, and the stable geographic area identifier from the previous sampling period is read as the stable geographic area identifier for the current sampling period. This processing step takes into account that frequent changes in area identifiers may occur when sanitation vehicles frequently enter and exit the grid boundary. Maintaining consistency by reading the stable area identifier from the previous period avoids excessively frequent identifier updates due to small fluctuations. For the same sanitation vehicle, the cumulative number of times the candidate geographic area identifier and the stable geographic area identifier are inconsistent within N consecutive sampling periods is counted, and the duration of inconsistency is also accumulated. N is an integer ranging from 3 to 20, representing the monitoring of area identifier instability over multiple consecutive sampling periods, allowing for the determination of identifier change trends based on historical data. The cumulative number of occurrences reflects whether sanitation vehicles frequently change regions, while the cumulative duration assesses the length of time inconsistencies in identification, ensuring that only prolonged inconsistencies trigger region identification updates. When the cumulative number of occurrences reaches the cross-regional confirmation count threshold and the cumulative duration reaches the cross-regional confirmation duration threshold, the stable geographic region identification is updated to a candidate geographic region identification. The cross-regional confirmation count threshold is an integer ranging from 1 to N, and the cross-regional confirmation duration threshold is a time threshold measured in seconds. This mechanism ensures that region identification is only updated when inconsistencies persist for a sufficiently long time, avoiding misjudgments and unnecessary identification updates.For each sanitation vehicle, the vehicle identifier and stable geographic area identifier are written into the vehicle data processing task header information of the current sampling period. The vehicle identifier is used to uniquely identify each sanitation vehicle, and the stable geographic area identifier is the stable geographic area of each sanitation vehicle within the current sampling period. These are written into the vehicle data processing task header information for subsequent task scheduling and data processing. A region affinity task dataset is output to provide a basis for subsequent task allocation and scheduling, ensuring that sanitation vehicle operations are performed within the correct area, thus improving the efficiency and accuracy of task scheduling.
[0037] This implementation scheme, by introducing a boundary buffer threshold and a cross-regional dual threshold confirmation mechanism, combined with geographical distance conversion rules to calculate the boundary determination distance, can effectively suppress frequent area switching caused by positioning errors or jitter near the geographical grid boundary of sanitation vehicles, thereby enhancing the stability of geographical area identification. This mechanism ensures that when the vehicle position is stable, the update of geographical area identification is consistent and reliable, reducing erroneous updates and frequent switching of area identification, and thus improving the data consistency and processing efficiency of concurrent scheduling tasks.
[0038] Specifically, the steps for generating processing shard identifiers by performing hash modulo mapping on stable geographic region identifiers are as follows: Read the region affinity task dataset, extract stable geographic region identifiers, vehicle identifiers, and sampling period identifiers, construct vehicle data processing tasks, and generate task sequence numbers for each vehicle data processing task by sorting them in ascending order of task arrival timestamps within the sampling period. When task arrival timestamps are the same, ascending order of vehicle identifiers is used as the order rule. The task sequence number is used to ensure the deterministic sequential relationship of tasks within the same processing shard, avoiding timing errors during concurrent execution. Each task sequence number corresponds to a specific vehicle data processing task, and the task is associated with the vehicle identifier and sampling period identifier to ensure that data is continuous in time and not lost. The number of processing shards and hash calculation rules are read from the system configuration parameter table, which stores the system operation configuration including the number of shards and hash rules. By reading the number of shards field in the system configuration parameter table, the currently available number of processing shards is obtained. This number determines the parallelism and load balancing of data processing. Simultaneously, the hash calculation rules are obtained from the configuration parameter table. These rules employ the SHA-256 hash algorithm and specify the encoding method for stable geographic region identifiers and the truncation method for hash digests. This algorithm converts the string value of a stable geographic region identifier into a 256-bit hash digest, ensuring high efficiency and a low collision probability, making it suitable for region identifier sharding mapping in high-concurrency environments. The SHA-256 hash calculation is performed on the stable geographic region identifier to obtain a hash digest. The hash calculation is performed based on the string representation of the stable geographic region identifier, converting the region identifier into a byte sequence as hash input according to the hash calculation rules, and outputting a fixed-length 256-bit hash digest. This hash digest is generated based on the unique string of the stable geographic region identifier, effectively reducing mapping conflicts caused by an excessive number of geographic regions, thereby maintaining a uniform distribution of data among shards. The least significant 64 bits of the 256-bit hash digest are taken and converted into a non-negative integer as the modulo input. Next, the modulo input is moduloed according to the number of processing shards. The purpose of the modulo operation is to uniformly map the calculated modulo input to the number of processing shards, ensuring that each processing shard undertakes approximately an equal workload. The number of processing shards ranges from 1 to 100, ensuring that tasks can be reasonably allocated based on the number of shards during large-scale task scheduling, thereby improving system concurrency. The processing shard identifier obtained after modulo operation ensures that each vehicle data processing task is assigned to an appropriate processing shard. The shard identifier is used for subsequent task allocation and data concurrency scheduling, ensuring that tasks are allocated and executed according to rules within different shards, while avoiding performance bottlenecks caused by uneven load.
[0039] In this implementation scheme, the SHA-256 hash algorithm is introduced to map stable geographic region identifiers, and modulo operations are combined for processing partitioning allocation, ensuring uniform distribution and load balancing of sanitation vehicle operation data in large-scale partitioned scheduling. This method reduces collision problems caused by the increasing number of regions by converting stable geographic region identifiers into unique and fixed-length hash values, ensuring that each processing partition receives tasks evenly, thereby improving data processing efficiency and concurrency, and effectively avoiding performance bottlenecks caused by uneven load.
[0040] Specifically, the steps for constructing regional task sub-queues based on stable geographic region identifiers within a processing segment are as follows: Vehicle data processing tasks are written into the task queue of the corresponding processing segment according to the processing segment identifier. Each vehicle data processing task is uniquely identified by its vehicle identifier and sampling period identifier. The processing segment identifier is generated and uniquely determined by the stable geographic region identifier through a hash modulo mapping. The processing segment task queue to which the vehicle data processing task is written is determined by the processing segment identifier. Within each processing segment, the task queue is grouped by region according to the stable geographic region identifier, generating regional task sub-queues. These regional task sub-queues are allocated according to the stable geographic region identifier, ensuring that tasks within the same region are assigned to the same sub-queue. This guarantees that tasks within the same region are executed sequentially and avoids regional conflicts. Tasks are executed concurrently across regions. Each regional task sub-queue is sorted by task number, which is generated by ascending order of arrival timestamps within the sampling period. When task arrival timestamps are the same, ascending order by vehicle identifier is used as the ordering rule to ensure a reasonable execution order when tasks are executed within the same region, avoiding data conflicts caused by concurrent execution. Within this processing slice, a completed region sequence number and a concurrent token count are maintained for each stable geographical region. The completed region sequence number tracks the completion progress of tasks within the region, while the concurrent token count controls the number of concurrent tasks within the region, ensuring that task execution does not exceed the maximum processing capacity of the region under concurrency control, avoiding task execution blocking or resource contention issues.
[0041] In this implementation scheme, vehicle data processing tasks are grouped according to stable geographical region identifiers, and regional task sub-queues are constructed within each processing segment. This ensures that tasks within the same region are executed sequentially, reducing the risk of data conflicts and timing discrepancies caused by overlapping task execution. An incremental task sequence number and a concurrency token counting mechanism are introduced to maintain task order while limiting the number of concurrent executions within a region through concurrency tokens, thereby improving the stability and efficiency of task processing. This method helps improve the accuracy and reliability of task scheduling, reduces resource contention and processing congestion caused by excessive concurrency, and thus improves the processing performance of sanitation vehicle operation data in high-concurrency environments.
[0042] Specifically, the steps for controlling concurrent scheduling based on consecutive sequence number gating and regional token gating to output the sharded execution results are as follows: Controlled concurrent scheduling is performed on the regional task sub-queue within each processing shard. First, the number of tasks currently being executed within the processing shard is calculated and compared with the maximum concurrency threshold. If the number of tasks being executed is less than the maximum concurrency threshold and the regional concurrency token count is less than the regional concurrency token limit, then a vehicle data processing task with a task sequence number equal to the regional completed sequence number plus one is selected from the head of the corresponding regional task sub-queue. The task sequence number is generated incrementally based on the task's sorting order within the region. The selected task is marked as running, and the regional concurrency token count is incremented. The regional concurrency token count controls the maximum number of concurrent tasks within the current region, preventing resource contention caused by too many tasks executing simultaneously. When the number of tasks being executed within the processing shard is not less than the maximum concurrency threshold or the regional concurrency token count is not less than the regional concurrency token limit, the tasks to be executed are kept in the regional task sub-queue, awaiting a suitable scheduling opportunity. The scheduling strategy is based on the regional concurrent token count and the maximum concurrency threshold. Gating logic ensures that the number of concurrent tasks within a region remains within a controllable range, preventing exceeding concurrency capabilities and causing task scheduling failures or excessive system load. For vehicle data processing tasks entering the execution state, during task execution, execution sequence identifiers are generated according to the regional task sub-queue order. These identifiers uniquely identify the execution order of each task, ensuring that tasks are executed in a predetermined order without conflicts. Upon task completion, the regional completion number is updated to the task number. The regional completion number indicates the execution progress of tasks in that region and controls the continuity of tasks within that region. Simultaneously, the regional concurrent token count is decremented, indicating that one concurrent token has been released within the region. Finally, the task completion flag and the segmented execution sequence identifier are written back to the segmented task status table. This table records the task execution status and its sequence information, and outputs the segmented execution result data.
[0043] This implementation scheme effectively achieves controlled concurrent scheduling of sanitation vehicle operation data within processing segments by introducing consecutive sequence number gating and regional token gating mechanisms. This ensures that tasks are executed in a predetermined order within each region, avoiding conflicts in task execution sequence. The method controls the number of concurrent tasks within a region using concurrent tokens, preventing resource contention and excessive system load due to excessive concurrency, thereby improving task execution efficiency and stability. Simultaneously, by updating the completed sequence number and token count within each region, the execution progress of tasks is maintained, ensuring the continuity and traceability of task scheduling, further improving the system's scheduling accuracy and reliability.
[0044] Specifically, the steps for reading the shard execution result data and calculating the shard load value are as follows: A load monitoring period is defined as the duration of K consecutive sampling periods, where K is a positive integer and 5 ≤ K ≤ 20. The load monitoring period is a duration segment used to periodically calculate and monitor the load of shard tasks. The starting point of each load monitoring period is uniquely determined by the starting sampling period identifier. Within this load monitoring period, load statistics are performed on each processing shard identifier. During this period, the number of vehicle data processing tasks entering the task queue is counted according to the processing shard identifier. The number of vehicle data processing tasks refers to the total number of vehicle data processing tasks entering the task queue. These tasks are assigned to the corresponding processing shards for processing within the load monitoring period. The principle for setting the load monitoring period is to balance monitoring accuracy and computational burden based on the task scheduling frequency, ensuring that the changing trend of task load can be captured. Next, the shard execution result data is read, and the number of vehicle data processing tasks completed within the load monitoring period is counted according to the processing shard identifier. The number of completed tasks refers to the number of tasks assigned to the corresponding processing shards and successfully executed within the load monitoring period. By statistically analyzing completed tasks, the relationship between the actual workload executed within a shard and the allocated task volume can be obtained, helping to evaluate the processing efficiency of a shard within a certain time period. Dividing the number of vehicle data processing tasks entering the task queue and the number of completed vehicle data processing tasks by the load monitoring period duration yields the shard arrival load value and the shard completion load value. The shard arrival load value represents the rate at which tasks enter the queue within the load monitoring period, while the shard completion load value represents the rate at which tasks are executed within the shard. The purpose of calculating these two load values is to quantify the task reception and completion capacity of a processing shard within a given time. By comparing the two, we can understand the task backlog of a shard and whether its processing capacity is sufficient. The difference between the shard arrival load value and the shard completion load value is calculated, and set to 0 when the difference is less than 0, to obtain the shard load value. The shard load value reflects the difference between task entry and completion. By calculating the difference and setting it to 0 when the difference is less than 0, the degree of load imbalance can be clearly quantified, thus providing data support for subsequent load balancing decisions. Furthermore, the shard load value is used to characterize the backlog trend of the shard task queue and serves as the control target input for the region split scale mapping, corresponding to the control target in the region split scale adjustment process. The purpose of this step is to monitor the load of each shard in real time, ensuring the real-time nature of task scheduling and the efficiency of the system, preventing overload or resource waste, and improving the resource utilization and task execution efficiency of the entire scheduling system.
[0045] The specific formula for calculating the fragment load value is as follows:
[0046] ;
[0047] In the formula, Indicates the fragment load value. This indicates the number of vehicle data processing tasks that have entered the task queue during the current load monitoring period. This indicates the number of vehicle data processing tasks completed within the current load monitoring period. This indicates the duration of the load monitoring cycle.
[0048] In this embodiment, Table 1 shows the fragmented load values for five load monitoring cycles, including the number of vehicle data processing tasks entering the task queue, the number of completed vehicle data processing tasks, the load monitoring cycle duration, and the calculated fragmented load value. Specifically: Load monitoring cycle 1: 97 vehicle data processing tasks entered the task queue, 89 tasks were completed, the load monitoring cycle duration was 300 seconds, and the calculated fragmented load value was 0.0267. Load monitoring cycle 2: 126 vehicle data processing tasks entered the task queue, 120 tasks were completed, the load monitoring cycle duration was 300 seconds, and the calculated fragmented load value was 0.0200. Load monitoring cycle 3: 110 vehicle data processing tasks entered the task queue, 105 tasks were completed, the load monitoring cycle duration was 300 seconds, and the calculated fragmented load value was 0.0167. Load monitoring cycle 4: 95 vehicle data processing tasks entered the task queue, 85 tasks were completed, the load monitoring cycle duration was 300 seconds, and the calculated shard load value was 0.0333. Load monitoring cycle 5: 135 vehicle data processing tasks entered the task queue, 130 tasks were completed, the load monitoring cycle duration was 300 seconds, and the calculated shard load value was 0.0167. These data provide a foundation for subsequent system scheduling and optimization based on load values from the load monitoring cycles, and provide an operational basis for subsequent task scheduling and adjustments triggered by load values.
[0049] Table 1. Fragment Load Value Data Table
[0050]
[0051] like Figure 3 The chart shows the shard load values for five load monitoring periods. Red bars in the bar chart indicate shard load values exceeding the load threshold, while blue bars indicate shard load values not exceeding the load threshold. The horizontal axis represents the load monitoring period, and the vertical axis represents the shard load value. A black dashed line represents the load threshold line. Specifically, the shard load values in load monitoring periods 1 and 4 both exceeded the load threshold, indicating excessive load requiring load balancing adjustments. The shard load values in load monitoring periods 2, 3, and 5 all did not exceed the load threshold, indicating the load was within the normal range and no sharding was needed. Figure 3 The bar chart visualization allows for intuitive identification of which periods have excessive load values, helping to adjust the load strategy for sharding in a timely manner.
[0052] In this implementation scheme, by introducing a load monitoring cycle and calculating the load values upon arrival and completion of shards, the task reception and execution capabilities of processing shards within a specific time period can be effectively measured. This method can capture the imbalance of shard load in real time and provide clear indicators of task backlog and execution differences by calculating shard load values, thereby providing accurate data support for subsequent load balancing and resource scheduling. By quantifying the task entry and completion rates, performance bottlenecks caused by excessive backlog or insufficient task execution in shards are avoided, ensuring the efficiency of task scheduling and the optimization of resource utilization, and improving the stability and flexibility of the entire concurrent scheduling process.
[0053] Specifically, when the segment load value exceeds the load threshold, region splitting is performed to generate adjusted geographic grid partitioning parameters. Based on the adjusted geographic grid partitioning parameters, stable geographic region identifiers and processing segment identifiers are regenerated, and the concurrent scheduling mapping relationship of sanitation vehicles is updated. The specific steps are as follows: When the segment load value does not exceed the load threshold, the current geographic grid partitioning parameters are kept unchanged to ensure that the geographic partitioning of the segment remains within the current load range, thereby avoiding unnecessary adjustments. When the segment load value exceeds the load threshold, firstly, the set of target stable geographic region identifiers associated with the current processing segment identifier is determined through the processing segment identifier. The set of target stable geographic region identifiers includes all stable geographic region identifiers belonging to the processing segment within the current sampling period. These region identifiers correspond to specific geographic regions, and regions with excessive load can be identified based on these region identifiers. Next, a proportional segmented mapping algorithm is used to construct a regional scale adjustment model. The proportional segmented mapping algorithm analyzes the relationship between the current load and the regional boundary, and dynamically adjusts the regional scale according to the changes in the load value, ensuring that when the load value is too high, the tasks can be reasonably distributed to more regions, thereby improving scheduling efficiency. To ensure an executable defined relationship between the proportional segmentation mapping algorithm, the regional scale adjustment model, and the regional splitting scale, the regional scale adjustment model takes the piecewise load value and load threshold as input and outputs the regional splitting scale. The load ratio ρ is defined as the ratio of the piecewise load value to the load threshold, and the load ratio ρ is divided into multiple load levels according to a preset segmentation interval. A corresponding splitting ratio r is configured for each load level, where the splitting ratio r is a positive integer and is constrained by a maximum splitting ratio r_max, which is given by the system configuration parameter table. When ρ≤1, r=1 indicates no regional splitting; when 1<ρ≤2, r=2; when 2<ρ≤4, r=4; and when ρ>4, r=r_max. The regional splitting scale is characterized by the splitting ratio r and is used to refine and update the geographic grid division parameters corresponding to the target stable geographic region identifier set. The refinement update includes dividing the latitude grid scale and longitude grid scale by the splitting ratio r respectively to obtain the adjusted latitude grid scale and adjusted longitude grid scale, thereby generating the adjusted geographic grid division parameters. The process of constructing the regional scale adjustment model includes collecting data such as current load value, number of tasks, and concurrency within shards as input. This data, combined with historical load data, is used to calibrate the preset segmentation interval boundaries and the maximum splitting ratio r_max. The model is then verified and adjusted using runtime logs to ensure it outputs a reasonable regional splitting scale when the load is too high. After inputting the shard load value into the regional scale adjustment model, the corresponding regional splitting scale is output. This scale determines the proportion and range of regional splitting, used for fine-grained splitting of the target region when the load is too high. Based on the regional splitting scale, regional splitting is performed on the target stable geographic region identifier set. The split regions will be more spatially refined, capable of distributing more tasks and reducing the risk of load concentration.Adjusted geographic grid partitioning parameters are generated. These new parameters redefine and update the boundaries of the split regions to adapt to new load conditions and ensure that task scheduling remains reasonable and efficient under the new geographic partitioning. The adjusted geographic grid partitioning parameters are written to the configuration parameter table to ensure that subsequent operations use the updated partitioning information. Based on the adjusted geographic grid partitioning parameters, stable geographic region identifiers are regenerated for sanitation vehicle operation data in subsequent sampling periods. The mapping relationship between the new stable geographic region identifiers and processing fragment identifiers is updated based on the new geographic grid partitioning information. A hash modulo mapping is performed on the stable geographic region identifiers to obtain the processing fragment identifiers. Hash calculations ensure that data is evenly distributed across different fragments. Finally, vehicle data processing tasks are written to the corresponding task queues according to the new processing fragment identifiers, ensuring that tasks are scheduled according to the new geographic partitioning, avoiding task backlog and uneven resource distribution, thereby improving concurrent scheduling efficiency.
[0054] In this implementation, by introducing a proportional segmentation mapping algorithm and a regional scale adjustment model, the geographic grid partitioning can be dynamically adjusted when the partition load exceeds the load threshold, refining the regional splitting and reducing resource concentration and imbalance caused by excessive load. This method combines load monitoring data with historical task allocation for model training, enabling accurate prediction and timely adjustment of the partitioning scale for each region, avoiding bottlenecks in task processing and optimizing load allocation. Simultaneously, by updating the geographic grid partitioning parameters, it ensures that task scheduling in subsequent sampling periods can be efficiently processed based on the new geographic regional partitioning, improving the system's flexibility and processing capacity in complex scheduling environments.
[0055] like Figure 2 and Figure 4As shown, the second aspect of the present invention provides a geographically affinity-based concurrent scheduling system for sanitation vehicles, comprising: a data acquisition and preprocessing module, a stability identifier generation module, a sharded concurrent scheduling module, and a load area adjustment module. The data acquisition and preprocessing module is used to periodically acquire sanitation vehicle operation data and perform time synchronization correction, sampling jitter suppression, outlier removal, and numerical normalization on the sanitation vehicle operation data, outputting preprocessed sanitation vehicle operation data. The stability identifier generation module is used to generate candidate geographical area identifiers based on the preprocessed sanitation vehicle operation data and geographical grid division parameters, and uses a boundary buffer threshold and cross-regional dual threshold confirmation mechanism to generate and update stable identifiers. The system comprises several modules: a geographic region identifier (outputting a region-affinity task dataset), a sharding concurrent scheduling module (performing hash modulo mapping on stable geographic region identifiers to generate processing shard identifiers, constructing regional task sub-queues within each shard based on stable geographic region identifiers, performing controlled concurrent scheduling based on consecutive sequence number gating and regional token gating, and outputting sharding execution result data), and a load region adjustment module (reading sharding execution result data to calculate sharding load values, performing region splitting to generate adjusted geographic grid partitioning parameters when the sharding load value exceeds the load threshold, regenerating stable geographic region identifiers and processing shard identifiers based on the adjusted geographic grid partitioning parameters, and updating the sanitation vehicle concurrent scheduling mapping relationship).
[0056] This implementation plan effectively improves the processing efficiency and scheduling accuracy of sanitation vehicle operation data by comprehensively utilizing data acquisition, stable identifier generation, segmented scheduling, and load adjustment mechanisms. First, periodic collection and preprocessing of sanitation vehicle operation data ensures high data quality and consistency, providing a reliable foundation for subsequent area identifier generation. The data acquisition and reporting process on the sanitation vehicle end can be managed by the sensor network operating system running on the vehicle terminal, handling access management, time synchronization, and communication scheduling of multi-source data such as positioning and operation status. Second, the adoption of boundary buffer thresholds and cross-regional dual threshold confirmation mechanisms ensures the accuracy and stability of stable geographic area identifiers, reducing the frequency of area jumps. Third, based on hash modulo mapping and controlled concurrent scheduling, task load is rationally allocated, optimizing concurrent processing performance. Finally, the load area adjustment mechanism dynamically adjusts the geographic grid division based on real-time monitoring data, ensuring load balance, effectively preventing resource overload, and improving the system's processing capacity in high-concurrency task scheduling.
[0057] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof 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 process, method, article, or apparatus.
[0058] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.
Claims
1. A concurrent scheduling method for sanitation vehicle networks based on geographical affinity, characterized in that, Includes the following steps: S1 periodically collects sanitation vehicle operation data and performs time synchronization correction, sampling jitter suppression, outlier removal and numerical normalization on the sanitation vehicle operation data, and outputs the preprocessed sanitation vehicle operation data. S2 generates candidate geographic region identifiers based on preprocessed sanitation vehicle operation data and geographic grid division parameters, and generates and updates stable geographic region identifiers using a boundary buffer threshold and cross-regional dual threshold confirmation mechanism, outputting the regional affinity task dataset. S3 performs hash modulo mapping on stable geographic region identifiers to generate processing fragment identifiers, and constructs regional task sub-queues within fragments according to stable geographic region identifiers. It performs controlled concurrent scheduling based on continuous sequence number gating and regional token gating, and outputs fragment execution result data. S4 reads the sharding execution result data and calculates the sharding load value. When the sharding load value exceeds the load threshold, it performs regional splitting to generate adjusted geographic grid division parameters. Based on the adjusted geographic grid division parameters, it regenerates stable geographic region identifiers and processing shard identifiers and updates the concurrent scheduling mapping relationship of sanitation vehicles.
2. The concurrent scheduling method for sanitation vehicle networks based on geographical affinity according to claim 1, characterized in that: The specific steps for periodically collecting sanitation vehicle operation data, performing time synchronization correction, sampling jitter suppression, outlier removal, and numerical normalization on the sanitation vehicle operation data, and outputting the preprocessed sanitation vehicle operation data are as follows: Set a fixed-width sliding time window as a sampling period to periodically collect the operation data of each sanitation vehicle. The sanitation vehicle operation data includes the sampling period identifier, vehicle identifier, and vehicle location. The vehicle location includes latitude and longitude values. For the collected sanitation vehicle operation data, the Network Time Protocol (NTP) time synchronization algorithm is used to perform time synchronization correction on the sanitation vehicle operation data; the Kalman filter algorithm is used to suppress sampling jitter of latitude and longitude values; the interquartile range (ICM) anomaly detection algorithm is used to identify and remove outliers of latitude and longitude values; and the min-max normalization algorithm is used to perform numerical normalization processing on latitude and longitude values, outputting the preprocessed sanitation vehicle operation data.
3. The concurrent scheduling method for sanitation vehicle networks based on geographical affinity according to claim 1, characterized in that: The specific steps for generating candidate geographic region identifiers based on preprocessed sanitation vehicle operation data and geographic grid division parameters are as follows: Read the preprocessed sanitation vehicle operation data to obtain the vehicle location of each sanitation vehicle in the current sampling period; read the geographic grid division parameters from the system configuration parameter table, which include the latitude grid scale, longitude grid scale, and the maximum value of the longitude grid number; The latitude value of the sanitation vehicle is rounded down according to the latitude grid scale to obtain the latitude grid number; the longitude value of the sanitation vehicle is rounded down according to the longitude grid scale to obtain the longitude grid number; the latitude grid number is used as the high-order number and the longitude grid number is used as the low-order number for combined encoding, wherein the combined encoding method is: multiply the latitude grid number by the maximum value of the longitude grid number plus one, and then add it to the longitude grid number to generate a unique corresponding candidate geographic area identifier.
4. The concurrent scheduling method for sanitation vehicle networks based on geographical affinity according to claim 1, characterized in that: The specific steps for generating and updating stable geographic region identifiers using a boundary buffer threshold and cross-regional dual threshold confirmation mechanism, and outputting the regional affinity task dataset, are as follows: For each sanitation vehicle, within the current sampling period, the boundary distance from the vehicle's location to the nearest latitude grid boundary line and the boundary distance to the nearest longitude grid boundary line are calculated according to the geographical distance conversion rules, and the smaller of the two values is taken as the boundary determination distance. When the boundary determination distance is not less than the boundary buffer threshold, the candidate geographical region identifier is marked as a stable geographical region identifier. When the boundary determination distance is less than the boundary buffer threshold, the candidate geographical region identifier is marked as an unstable boundary candidate, and the stable geographical region identifier of the previous sampling period is read as the stable geographical region identifier of the current sampling period. For the same sanitation vehicle, the cumulative number of times the candidate geographic region identifier is inconsistent with the stable geographic region identifier is counted within N consecutive sampling periods, and the duration of inconsistency is also counted. When the cumulative number of cross-regional confirmations reaches the cross-regional confirmation duration threshold and the cumulative duration reaches the cross-regional confirmation duration threshold, the stable geographic region identifier will be updated to the candidate geographic region identifier. For each sanitation vehicle, the vehicle identifier and stable geographic area identifier are written into the vehicle data processing task header information of the current sampling period, and the regional affinity task dataset is output.
5. The concurrent scheduling method for sanitation vehicle networks based on geographical affinity according to claim 1, characterized in that: The specific steps for generating fragment identifiers by performing hash modulo mapping on stable geographic region identifiers are as follows: Read the regional affinity task dataset, extract stable geographic region identifiers, vehicle identifiers, and sampling period identifiers, construct vehicle data processing tasks, and generate task sequence numbers for each vehicle data processing task by sorting the task arrival timestamps in ascending order within the sampling period and incrementing them. When task arrival timestamps are the same, the order is determined by ascending vehicle identifiers. The system configuration parameter table is used to read the number of processing shards and the hash calculation rules. The stable geographic region identifier is converted into a byte sequence according to the hash calculation rules and the SHA-256 hash algorithm is executed to obtain a 256-bit hash digest. The lower 64 bits of the hash digest are taken and converted into a non-negative integer as the modulo input. The modulo input is then taken according to the number of processing shards to obtain the processing shard identifier.
6. The concurrent scheduling method for sanitation vehicle networks based on geographical affinity according to claim 1, characterized in that: The specific steps for constructing regional task sub-queues based on stable geographical region identifiers within a shard are as follows: Vehicle data processing tasks are written to the task queue of the corresponding processing segment according to the processing segment identifier. The same stable geographic region identifier corresponds to a unique processing segment. Within each processing segment, the task queue is grouped by region according to the stable geographic region identifier to generate a regional task sub-queue. Each regional task sub-queue is sorted by task sequence number, and the completed sequence number and concurrent token count of the region are maintained for each stable geographic region identifier.
7. The concurrent scheduling method for sanitation vehicle networks based on geographical affinity according to claim 1, characterized in that: The specific steps for implementing controlled concurrent scheduling based on consecutive sequence number gating and region token gating, and outputting the fragmented execution result data, are as follows: Within each processing segment, controlled concurrent scheduling is performed on the regional task sub-queue: when the number of tasks being executed within the processing segment is less than the maximum concurrency threshold and the regional concurrency token count is less than the regional concurrency token limit, the vehicle data processing task with a task sequence number equal to the regional completed sequence number plus one is selected from the head of the corresponding regional task sub-queue, marked as running, and the regional concurrency token count is incremented by one. When the number of tasks being executed within a shard is not less than the maximum concurrency threshold or the number of regional concurrency tokens is not less than the regional concurrency token limit, the tasks to be executed will be kept in the regional task sub-queue for scheduling. For vehicle data processing tasks that have entered the execution state, execution sequence identifiers are generated according to the order of the regional task sub-queues. When the task is completed, the completed sequence number of the region is updated to the task sequence number, and the concurrent token count of the region is decremented by one. At the same time, the task completion flag and the shard execution sequence identifier are written back to the shard task status table, and the shard execution result data is output.
8. The concurrent scheduling method for sanitation vehicle networks based on geographical affinity according to claim 1, characterized in that: The specific steps for reading the sharding execution result data and calculating the sharding load value are as follows: The duration of K consecutive sampling periods is defined as a load monitoring period. The number of vehicle data processing tasks entering the task queue within the load monitoring period is counted according to the processing segment identifier. The segment execution result data is read, and the number of vehicle data processing tasks completed within the load monitoring period is counted according to the processing segment identifier. The number of vehicle data processing tasks entering the task queue and the number of vehicle data processing tasks completed are divided by the duration of the load monitoring period to obtain the segment load value and the segment completion load value. The non-negative difference between the load value reached by the fragment and the load value completed by the fragment is used to obtain the fragment load value.
9. A concurrent scheduling method for sanitation vehicle networks based on geographical affinity according to claim 1, characterized in that: The specific steps for performing region splitting to generate adjusted geographic grid partitioning parameters when the partition load value exceeds the load threshold, and regenerating stable geographic region identifiers and processing partition identifiers based on the adjusted geographic grid partitioning parameters, and updating the concurrent scheduling mapping relationship of sanitation vehicles are as follows: When the piece load value does not exceed the load threshold, the current geographic grid division parameters remain unchanged; when the piece load value exceeds the load threshold, the set of target stable geographic region identifiers associated with the current processing piece identifier is determined, and a regional scale adjustment model is constructed using a proportional segmentation mapping algorithm. The piece load value is input into the regional scale adjustment model, and the corresponding regional splitting scale is output. Based on the regional splitting scale, the target stable geographic region identifier set is split into regions, and the adjusted geographic grid partitioning parameters are generated and written into the system configuration parameter table. Based on the adjusted geographic grid division parameters, stable geographic area identifiers are regenerated for sanitation vehicle operation data in subsequent sampling periods, and hash modulo mapping is performed on the stable geographic area identifiers to obtain processing fragment identifiers; vehicle data processing tasks are written into the corresponding task queues according to the processing fragment identifiers.
10. A geographically affinity-based concurrent dispatching system for sanitation vehicles, characterized in that, include: The module includes a data acquisition and preprocessing module, a stability identifier generation module, a sharding and concurrent scheduling module, and a load area adjustment module, among which: The data acquisition and preprocessing module is used to periodically collect sanitation vehicle operation data, and perform time synchronization correction, sampling jitter suppression, outlier removal and numerical normalization on the sanitation vehicle operation data, and output the preprocessed sanitation vehicle operation data. The stable identifier generation module is used to generate candidate geographic region identifiers based on preprocessed sanitation vehicle operation data and geographic grid division parameters, and to generate and update stable geographic region identifiers using a boundary buffer threshold and cross-regional dual threshold confirmation mechanism, and output regional affinity task dataset. The sharding concurrent scheduling module is used to perform hash modulo mapping on stable geographic region identifiers to generate sharding identifiers, and to build regional task sub-queues within each shard according to the stable geographic region identifiers. It performs controlled concurrent scheduling based on continuous sequence number gating and regional token gating, and outputs sharding execution result data. The load area adjustment module is used to read the sharding execution result data to calculate the sharding load value. When the sharding load value exceeds the load threshold, it performs area splitting to generate adjusted geographic grid division parameters, and regenerates stable geographic area identifiers and processing shard identifiers based on the adjusted geographic grid division parameters, and updates the concurrent scheduling mapping relationship of sanitation vehicles.