Distributed road weight training method

By employing a distributed computing architecture and gradient arbitration mechanism, the performance bottleneck and local congestion problems of path planning algorithms in large-scale urban road networks are resolved. This enables efficient and accurate road weight training and road network load balancing, thereby improving the overall efficiency of the transportation system.

CN122114081APending Publication Date: 2026-05-29YUNTU ZHIXING (BEIJING) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
YUNTU ZHIXING (BEIJING) TECHNOLOGY CO LTD
Filing Date
2026-02-09
Publication Date
2026-05-29

Smart Images

  • Figure CN122114081A_ABST
    Figure CN122114081A_ABST
Patent Text Reader

Abstract

The application discloses a kind of distributed road weight training methods.The method is first obtained target area motor vehicle travel trajectory and is converted into learning target section sequence using map matching algorithm;Subsequently, the road section characteristic vector containing multi-dimensional objective attributes such as road grade, type and real-time traffic speed is constructed, and the training set containing positive and negative samples is constructed in combination with temporarily generated temporary coefficient;The training set is hashed into fragments using distributed computing architecture, the local update result of each training node is summarized by parameter server, and the global road weighting coefficient is generated based on road network topology constraint to perform gradient arbitration;Before outputting the final coefficient, construct virtual traffic to perform road network load balancing deduction, and use the penalty mask fed back to correct the feature dimension that causes abnormal aggregation by weighting reduction.The application realizes the accurate inversion of large-scale road network traffic cost by deep ordering learning and distributed parallel computing, effectively improves the rationality of path planning and the balance of road network flow.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of intelligent transportation and big data processing technology, and in particular to a distributed road weight training method. Background Technology

[0002] With the acceleration of urbanization and the popularization of intelligent transportation systems, electronic map navigation and route planning services have become important auxiliary tools for people's daily travel. In the existing technical system, the core of route planning algorithms lies in the setting of road traffic weights, which usually mainly rely on basic physical attributes such as road length, design grade, or historical average speed.

[0003] When faced with massive urban road networks and large-scale real-time trajectory data, traditional single-machine memory-based computing models suffer from performance bottlenecks in processing large datasets. Data throughput and rapid model iteration lead to lag in weight updates. Furthermore, actual driving behavior is influenced by multiple nonlinear factors, including road geometry, road condition stability, and driver psychological preferences. Simple empirical rules or statistical models alone cannot accurately depict complex travel costs. Moreover, existing methods often focus on finding the shortest or fastest individual paths, leaving room for improvement in predicting overall road network traffic distribution. Overly concentrated algorithm recommendations can easily trigger localized congestion caused by the planning itself. Summary of the Invention

[0004] The purpose of this invention is to provide a distributed road weight training method to solve the problems pointed out in the background art.

[0005] This invention provides a distributed road weight training method, characterized by the following steps:

[0006] Obtain the travel trajectories of motor vehicles in the target area, and use a map matching algorithm to convert the motor vehicle travel trajectories into a sequence of target road segments for learning;

[0007] Construct a road segment feature vector based on the objective attributes of the road, and combine it with randomly generated temporary road weighting coefficients and the learning target road segment sequence to construct a training sample set;

[0008] Iterative training is performed using a distributed computing architecture. The route travel cost and loss function are calculated based on the training sample set, and the road weighting coefficients are updated according to the gradient until the preset convergence condition is met.

[0009] The final road weighting coefficient is output, and the final cost of each road segment in the road network is calculated based on this coefficient. The Dixtra algorithm is then embedded to generate the planned route.

[0010] Optionally, the iterative training using a distributed computing architecture specifically includes:

[0011] The training sample set is hash-sharded according to region and user ID and distributed to different training nodes;

[0012] Each training node performs local training based on the fragmented samples and calculates the local road weight update results;

[0013] The parameter server aggregates the local road weight update results of each training node, uses a weighted average method to fuse them to generate global road weight coefficients, and distributes them back to each training node for the next round of training.

[0014] Optionally, the constructed road segment feature vector is a 17-dimensional vector, specifically including: 6-dimensional road level features, 6-dimensional road type features, 4-dimensional real-time traffic speed level features, and 1-dimensional presence / absence of traffic control features; the objective road attributes also include road condition stability features.

[0015] Optionally, the step of constructing the training sample set includes:

[0016] For each of the aforementioned target road segment sequences, N temporary road weighting coefficients are randomly generated;

[0017] For each of the temporary road weighting coefficients, calculate its weighted sum with the road segment feature vector to obtain a set of road weights, and generate the corresponding predicted road segment sequence based on the set of road weights;

[0018] The learning target road segment sequence is combined with N predicted result road segment sequences to form the i-th training sample.

[0019] Optionally, the step of calculating the route travel cost specifically includes:

[0020] For each learning target road segment sequence and each predicted result road segment sequence, obtain the set of road segments it contains;

[0021] For each road segment element in the road segment set, calculate the vector dot product between the current road weighting coefficient and the road segment feature vector of that road segment element;

[0022] The vector dot product results of all road segment elements in the road segment set are summed to obtain the route travel cost of the corresponding sequence.

[0023] Optionally, the step of calculating the loss function adopts a list-level Top-1 loss function, specifically including:

[0024] The negative value of the route travel cost of the learning target road segment sequence is determined as the positive sample score, and the negative value of the route travel cost of each predicted result road segment sequence is determined as the negative sample score.

[0025] Calculate the natural exponential function value of the positive sample score as the probability numerator;

[0026] The sum of the natural exponential function values ​​of the positive sample scores and all the negative sample scores is used as the probability denominator.

[0027] The ratio of the probability numerator to the probability denominator is calculated, and the negative value of the natural logarithm of the ratio is taken to obtain the loss function.

[0028] Optionally, the step of updating the road weighting coefficients according to the gradient specifically includes:

[0029] Based on the loss function, the negative gradient direction or parameter update step vector for the road weighting coefficient is calculated using the backpropagation algorithm.

[0030] The negative gradient direction or parameter update step size vector is multiplied by the preset learning rate to obtain the weight update amount;

[0031] The updated weights are added to the current road weighting coefficients to obtain the updated road weighting coefficients, which are then used for the next round of iterative training.

[0032] Optionally, the preset convergence conditions include:

[0033] The loss function no longer decreases; or,

[0034] The preference matching error rate between the recommended route and the learning target road segment sequence The time or distance loss of the recommended route does not exceed a preset first convergence threshold, and the time or distance loss of the recommended route does not exceed a preset second convergence threshold of the optimal objective route; the formula for calculating the preference matching error rate is: , in, The weighted impedance overhead of the target road segment sequence being studied. This is the weighted impedance cost of the recommended route planned based on the current road weighting coefficients.

[0035] Optionally, before the step of aggregating the local right-of-way update results of each training node through the parameter server, a gradient arbitration step based on road network topology constraints is further included:

[0036] The parameter server identifies the boundary road segments located at the intersection of different regional segments and obtains at least two local right-of-way update results for the boundary road segments.

[0037] Determine whether there is a conflict in the gradient update direction corresponding to the at least two local road right update results; if there is a conflict, analyze the weight change trend of the boundary road segment in the upstream and downstream adjacent road segments, and calculate the consistency score between each local road right update result and the weight change trend.

[0038] The local right-of-way update result with the highest consistency score is selected as the effective update value, and other local right-of-way update results are suppressed using a preset decay factor. Finally, the aggregation and fusion are performed.

[0039] Optionally, before the step of outputting the final road weighting coefficients, a road network load balancing deduction step is also included:

[0040] Using the road weighting coefficients that currently meet the preset convergence conditions, a virtual traffic flow is constructed and a path planning simulation of the entire road network is performed to generate a simulated road network heat map;

[0041] Detect whether there are abnormal clusters of heat values ​​exceeding the congestion threshold in the simulated road network heat map;

[0042] If the abnormal clustering area exists, a penalty mask is generated for the feature vector of the road segment within the abnormal clustering area. The penalty mask is fed back into the iterative training process. The penalty mask is used to reduce the weight of a specific dimension of the road weighting coefficient and trigger a new round of iterative training until the abnormal clustering area no longer exists in the simulated road network heat map.

[0043] The present invention has achieved the following beneficial effects:

[0044] This invention utilizes a distributed computing architecture and a parameter server working collaboratively. Through a hash sharding strategy, it distributes large-scale road network training tasks across multiple computing nodes, overcoming the physical bottlenecks of storage and computing power in a single-machine environment and ensuring the timeliness of city-level road network weight calculation. By constructing high-dimensional feature vectors encompassing static road attributes and dynamic flow velocity, and combining them with a ranking learning loss function, this method can mine and quantify various objective and subjective factors influencing driving choices from historical trajectories, making the calculated toll costs closer to the real driving experience. The introduced gradient arbitration mechanism effectively solves the boundary gradient conflict problem caused by spatial segmentation in distributed training, ensuring the logical continuity of cross-regional right-of-way updates. Furthermore, this invention adds a road network load balancing simulation step before outputting weights. By simulating heat distribution, it actively identifies and corrects weight parameters that may cause congestion, achieving a spatially balanced distribution of macro-level road network traffic while meeting individual travel needs, thus improving the overall utilization efficiency of road resources.

[0045] The features and advantages of the present invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings.

[0046] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0047] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0048] Figure 1 This is a flowchart illustrating the distributed road weight training method in an embodiment of the present invention.

[0049] Figure 2 This is a flowchart of the distributed road weight training process, which includes a road network load balancing deduction and penalty mask feedback mechanism, in an embodiment of the present invention. Detailed Implementation

[0050] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0051] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

[0052] It should be noted that the distributed road weight training method provided in this embodiment relies on a physical system consisting of large-scale road network data storage nodes, high-performance distributed computing clusters, parameter servers, and multi-source traffic data acquisition terminals. In actual urban-level intelligent transportation application scenarios, facing millions of road segments and hundreds of millions of daily average travel trajectory points, simply relying on expert experience rules or simple historical average speeds to set road impedance can no longer accurately reflect the complex and ever-changing real-time road conditions and drivers' true psychological preferences. Especially in ultra-large-scale road networks, the cost of road travel is nonlinearly affected by multi-dimensional objective factors such as geometric attributes, management attributes, real-time flow velocity, and road condition stability, and the data volume exceeds the processing limit of a single machine's memory. Therefore, this embodiment constructs a deep ranking learning model and utilizes the parallel computing and gradient synchronization capabilities of the distributed architecture to achieve accurate inversion and dynamic updating of the cost of travel for each road segment in the road network, thereby providing underlying data support that conforms to physical objective laws and human driving habits for electronic map navigation, autonomous driving path planning, and intelligent logistics scheduling.

[0053] like Figure 1 and Figure 2 As shown in the figure, this invention discloses a distributed road weight training method, which is logically divided into four core steps, wherein steps S1 to S3 constitute the core training closed loop.

[0054] Step S1: Obtain the travel trajectory of motor vehicles in the target area, and use a map matching algorithm to convert the motor vehicle travel trajectory into a sequence of target road segments for learning.

[0055] In this embodiment, the process of acquiring the travel trajectory of motor vehicles in the target area is essentially a process of establishing a digital spatial mapping of traffic flow in the physical world. The target area can be a city area with clearly defined administrative divisions, or an intercity urban cluster or a custom geofenced area. The system receives raw location data packets reported in real time from various traffic data collection terminals through a high-concurrency message queue interface. These terminals include, but are not limited to, vehicle-mounted positioning terminals (T-Boxes) installed in taxis, ride-hailing vehicles, long-distance passenger vehicles, and logistics freight vehicles, as well as data returned by navigation software development kits (SDKs) of smart mobile devices. Each raw location data packet typically contains a unique vehicle identifier, latitude and longitude coordinates of the Global Positioning System (GPS) or BeiDou Navigation Satellite System (BDS), a data acquisition timestamp, instantaneous driving speed, vehicle heading angle, and positioning accuracy factor (HDOP).

[0056] Specifically, due to the "urban canyon" effect caused by towering buildings, signal blind spots under overpasses, multipath effects, and interference from the atmospheric ionosphere, raw vehicle trajectory data often contains a large amount of noise and outliers. Directly using this unprocessed raw data for subsequent model training can lead to algorithm convergence difficulties or even the learning of incorrect weight logic. Therefore, before performing map matching, the system must invoke a preprocessing module to perform a rigorous data cleaning process. This preprocessing process first involves noise reduction, where the system filters out low-precision drift points with a positioning accuracy factor greater than a preset threshold (e.g., 5.0). Further, the system uses a speed threshold filtering method to calculate the average speed between two adjacent trajectory points. If this calculated speed exceeds the physical speed limit of the vehicle (e.g., 180 km / h), or the calculated acceleration exceeds the range allowed by the vehicle's mechanical performance (e.g., 0.8g), the current point is determined to be an abnormal jump point and is removed. Furthermore, to eliminate interference from random Gaussian white noise, the system preferably employs a Kalman filter algorithm or a bidirectional smoothing filter algorithm. Based on the vehicle's kinematic model, the position of trajectory points is predicted and corrected, resulting in a smooth, continuous, and corrected trajectory sequence that conforms to the vehicle's driving logic. For vehicles that remain stationary for extended periods (e.g., at 0 speed for more than 10 minutes), the system will segment the continuous positioning stream into several independent travel trajectory segments based on the ignition status signal, ensuring that each trajectory corresponds to a complete travel task.

[0057] Furthermore, although the cleaned trajectory data is smoother in geometric space, it is still essentially a series of discrete latitude and longitude coordinates, and computers cannot directly understand their correspondence with the road network topology. Therefore, this embodiment uses a map matching algorithm to match and set the physical coordinates to the logical road segments of the digital road network. Preferably, this embodiment uses an advanced map matching algorithm based on a Hidden Markov Model (HMM). In this model, the actual vehicle driving path is regarded as a hidden state chain, while the observed GPS trajectory point sequence is regarded as an observed state chain. In specific implementation, for each sampling point in the trajectory, the algorithm first searches the road network database for all candidate road segments within a certain radius (e.g., 50 meters). Then, the transmission probability and transition probability are calculated. The emission probability is calculated based on the assumption that the geometric projection distance from the sampling point to the candidate road segment follows a Gaussian distribution. The shorter the projection distance, the greater the emission probability. The transition probability is based on the road network topology. It calculates the shortest path distance from the candidate road segment at the previous time step to the candidate road segment at the current time step and compares it with the Euclidean distance between the two sampling points. The smaller the difference between the two, the more consistent it is with the vehicle's driving logic, and the greater the transition probability.

[0058] Specifically, in this embodiment, the emission probability The calculation formula is: , in, The geometric projection distance from the sampling point to the candidate road segment is... This represents the standard deviation of GPS positioning error (e.g., a value of 10-20 meters). is the base of the natural logarithm. Pi is the mathematical constant of a circle.

[0059] The transition probability The calculation formula is: , in, This represents the shortest path distance for a vehicle to move from a candidate road segment at the previous time step to a candidate road segment at the current time step within the road network. The Euclidean distance between the two sampling points. The probability decay coefficient is determined by the average speed of the vehicle.

[0060] Finally, the Viterbi algorithm is used to search for the optimal path sequence with the highest global cumulative probability in the grid graph constructed from all candidate road segments.

[0061] Ultimately, this optimal path sequence is transformed into a list of ordered road segment IDs, i.e., the learning target road segment sequence. This sequence not only records which road segments the vehicle traversed but also implicitly includes the driver's choices at road network forks. For example, if there are two paths from starting point A to ending point B: a short but congested downtown road and a long but unobstructed ring road, and the driver chooses the latter, the generated learning target road segment sequence objectively records this preference. This is precisely the ground truth or positive sample that the subsequent training model needs to learn.

[0062] Step S2: Construct road segment feature vectors based on objective road attributes, and combine them with randomly generated temporary road weighting coefficients and learning target road segment sequences to construct a training sample set.

[0063] In this embodiment, to enable the computer algorithm to deeply understand the physical characteristics and traffic status of each road, it is necessary to digitize and vectorize the road segment attributes. Traditional navigation algorithms often only use single-dimensional features such as road length or design level, which is insufficient to depict complex real-world road conditions. This embodiment of the invention constructs a high-dimensional, comprehensive road segment feature representation system. According to the technical solution of the present invention, the road segment feature vector constructed in step S2 is a 17-dimensional vector. These 17 dimensions cover static attributes, dynamic attributes, and management attributes, specifically including: 6-dimensional road level features, 6-dimensional road type features, 4-dimensional real-time traffic speed level features, and 1-dimensional presence / absence of traffic control features.

[0064] Regarding the 6-dimensional road classification features, this embodiment uses one-hot encoding. Urban roads are divided into: expressways, urban expressways, national highways, provincial highways, county / arterial roads, and other roads (including secondary arterial roads and branch roads). These 6 classifications correspond to 6 feature bits. For example, if a road segment is an urban expressway, then the first 6 bits of the feature vector are [0,1,0,0,0,0]. This encoding method allows the model to clearly distinguish the differences in basic right-of-way between roads of different administrative classifications. Generally, higher-class roads have lower initial impedance weights, and the model should learn that higher-class roads usually mean faster expected speeds and less traffic light interference.

[0065] Regarding the 6-dimensional road type features, a one-hot encoding method is also used. Road type reflects the physical form and functional structure of a road, specifically divided into: ordinary road sections, bridges, tunnels, intersection sections, roundabout sections, and special road sections (such as ramps and service area access roads). Different physical forms have a significant impact on drivers' psychological stress and driving behavior. For example, tunnels are dimly lit and lane changes are usually prohibited, so drivers tend to reduce speed and maintain high concentration, which increases the psychological cost of travel; while roundabout sections involve complex lane changes, and their traffic efficiency is usually lower than that of straight-ahead sections. Through these 6-dimensional features, the model can learn the correction coefficients of these subtle physical forms on right-of-way, thereby rationally avoiding or utilizing specific types of road sections during planning.

[0066] Regarding the 4D real-time traffic speed level feature, this is a key dimension for introducing dynamic traffic information. The system does not directly use continuous speed values ​​(because these values ​​fluctuate greatly and are easily affected by individual vehicles), but instead discretizes the current average traffic speed of a road segment into four levels: smooth flow, slow flow, congested, and severely congested. The system calculates the ratio of the average speed to the free-flow speed of the road segment in real time, or directly divides the segment based on speed ranges (e.g., 0-10 km / h for severely congested). For example, if a road segment is currently congested, the corresponding 4D vector might be [0,0,1,0]. This feature allows the trained weights to change dynamically over time, accurately reflecting the traffic differences between morning rush hour and evening off-peak hours, achieving adaptive adjustment of the dynamic weights.

[0067] Regarding the presence of regulatory features in the 1D dimension, this is a Boolean feature (0 or 1). It indicates whether there are currently traffic controls, construction closures, accident blockades, or traffic restrictions on the road segment. When this bit is 1, the model should learn to assign a very high penalty weight to the road segment, thereby forcibly avoiding the area during planning. This dimension exists to handle the disruptive impact of infrequent, unexpected events on road network traffic.

[0068] In addition, road objective attributes also include road condition stability features. Although this feature is not included in the basic 17-dimensional vector, in the preferred embodiment, it exists as the 18th dimension feature or as an adjustment factor for sample weights. Road condition stability features are obtained by calculating the variance or standard deviation of the travel speed of the road segment over a past time window (e.g., 30 minutes). A larger variance indicates more unstable road conditions (potentially frequent lane cutting, interference from non-motorized vehicles, or unreasonable traffic light timings), a worse driving experience, and a greater risk of uncontrollable time. Introducing this feature helps train a weighting system that aligns with drivers' desire for stability, resulting in a planned route that is not only fast but also reliable.

[0069] After constructing the detailed road segment feature vectors, they need to be assembled into a sample set that can be used for machine learning training. Since path planning is essentially a ranking problem—that is, among countless possible paths, the true path should be ranked first—this embodiment uses a list method to construct the samples, aiming to train the model to accurately identify the optimal solution from a set of candidate paths. Specifically, step S2, which involves constructing the training sample set, includes:

[0070] First, for each learning target road segment sequence (i.e., the actual path traveled by the driver, serving as a positive sample), the system generates N temporary road weighting coefficients using a random generation algorithm. These temporary road weighting coefficients are vectors with the same dimension as the road segment feature vector (e.g., 17 dimensions), and their initial values ​​are randomly sampled within a certain range (e.g., 0.1 to 10.0) based on a uniform or Gaussian distribution. The purpose of this random generation is to explore within the parameter space, generating multiple possible road right-of-way values, most of which are erroneous or inaccurate.

[0071] Secondly, for each temporary road weighting coefficient, its weighted sum with the road segment feature vector is calculated to obtain a set of road weights. This weighted sum is essentially a dot product of vectors. For each road segment in the network, its 17-dimensional feature vector is multiplied by the current temporary coefficient vector and summed to obtain the segment's cost under the current assumptions. Based on this set of network-wide costs, a new path is replanned using standard path planning algorithms (such as A* or Dijkstra's algorithm), with the origin and destination of the actual trajectory as endpoints. This path, calculated based on random weights, may differ from the actual path; it is called the predicted road segment sequence and serves as a negative sample.

[0072] Finally, the target road segment sequence (positive sample) is combined with N predicted road segment sequences (negative samples) to form the i-th training sample. In this way, a training sample actually contains one standard answer and N distractor answers. The goal of training is to adjust the weight coefficients so that, when calculating the total cost, the cost of the standard answer is always less than that of the distractor answers. This positive and negative sample construction strategy effectively solves the data sparsity problem in the path planning field, where only positive samples (true trajectories) are available and negative samples (unselected paths) are lacking.

[0073] Step S3: Utilize a distributed computing architecture to perform iterative training, calculate the route travel cost and loss function based on the training sample set, and update the road weighting coefficients according to the gradient until the preset convergence condition is met.

[0074] In this embodiment, given the massive road network scale (containing millions of road segments) and exponential growth in trajectory data in the target area (such as a megacity or urban agglomeration), single-machine computing cannot meet the timeliness requirements. Therefore, this step constructs a distributed computing cluster based on a parameter server model. This cluster consists of multiple high-performance computing nodes and parameter server nodes, interconnected by a high-speed internal network (such as InfiniBand).

[0075] Step S3, which utilizes a distributed computing architecture to perform iterative training, specifically includes:

[0076] First, data sharding and distribution are performed. The training sample set is hash-sharded according to region and user ID, and distributed to different training nodes. Specifically, to ensure computational locality and load balancing, the system employs a consistent hashing algorithm. On one hand, spatial attributes of the trajectory (such as the GeoHash encoding of the starting point) are used to allocate geographically adjacent samples to the same computing node, thus reusing road network topology data and reducing cross-node memory consumption and data read latency. On the other hand, hashing is performed using the user ID to schedule historical behavior data of the same user to the same node in order to capture drivers' personalized preferences. This dual hashing strategy effectively solves the data skew problem in large-scale distributed training.

[0077] Secondly, each training node performs local training based on the fragmented samples and calculates the local path weight update results. Within each training node, forward propagation computation is performed.

[0078] The formula for calculating the route travel cost in step S3 is: , in, The route travel cost is a scalar value that represents the generalized impedance of the path. Its physical unit can be understood as weighted time or overall cost. For the set of road segments Any road segment element in the data, This is the set of road segments in the route, that is, a list of all road segment IDs that make up the path; The current road weighting coefficients (17-dimensional vector) are the core parameters that the model needs to learn; This is a road segment feature vector (17-dimensional vector). Symbols This represents the dot product operation of vectors.

[0079] To ensure the stability of graph search algorithms (such as Dijkstra's) when calculating route travel costs, this method introduces a non-negative activation function outside the dot product operation of the feature vector and weight vector. Specifically, the formula is modified as follows: , in The ReLU function can be selected (i.e. ) or exponential function ( ), ensuring that the physical overhead is always positive; here Represents road weighting coefficient road segment feature vector The dot product result (i.e. ).

[0080] During iterative training, each node needs to calculate the cost of learning the target road segment sequence (positive sample) for each sample. And the cost of each predicted road segment sequence (negative sample). The system's desired model state is: with the correct weights. Below, the cost of the actual path It should be as small as possible, and less than the cost of all negative samples.

[0081] To quantify prediction bias and guide model optimization, a loss function needs to be constructed. In step S3, the ListwiseTop-1 loss function is used, and its formula is as follows: , in, For ListwiseTop-1 loss function, This corresponds to the score-related items of the target road segment sequence. In this embodiment, the score is inversely proportional to the cost. To adapt to the characteristics of the exponential function, the negative of the cost is taken as the score, i.e. . The score-related term corresponding to the j-th predicted road segment sequence, i.e. , here For the first The route travel cost of a predicted road segment sequence. The total number of samples (including 1 positive sample and N negative samples). is the base of the natural logarithm.

[0082] The physical meaning of this formula is to maximize the probability distribution of the true path among all candidate paths. The denominator is the exponential summation of the scores of all paths, acting as a normalization factor. By minimizing this loss function, the model is forced to adjust its weights. This reduces the cost of the actual path. The loss function is significantly smaller in cost than all predicted paths, thus revealing the true paths in the ranking. Compared to traditional pairwise or pointwise methods, this listwise loss function better captures the global relative relationships in the candidate list, improving the model's ranking accuracy.

[0083] Based on the loss function, the weight update direction is calculated using the backpropagation algorithm. The formula for updating the road weighting coefficients in step S3 is: , in, The updated road weighting coefficients. The current road weighting coefficient, Let be the learning rate, where The step size vector is updated based on the negative gradient direction or parameters calculated from the loss function. In practical engineering implementations, to address the sparsity of road network features (e.g., control features are rarely seen), it is preferable to use an adaptive learning rate optimization algorithm (such as Adam or AdaGrad) to dynamically adjust the learning rate for each feature dimension, ensuring that sparse features can also be effectively updated.

[0084] Finally, parameter synchronization and fusion are performed. The parameter server aggregates the local road weight update results from each training node, uses a weighted average method to fuse them into global road weight coefficients, and distributes them back to each training node for the next round of training. The parameter server maintains a globally unique weight vector. When each training node uploads its calculated local gradient or update, the parameter server performs a weighted average based on indicators such as the number of samples processed by each node and sample confidence, fuses the new global parameters, and broadcasts or pushes them to all nodes to begin the next iteration. This process can be synchronous or asynchronous, depending on the system's communication bandwidth and real-time requirements.

[0085] Of particular note is the introduction of a gradient arbitration mechanism in this embodiment to address the boundary effect caused by data space partitioning in distributed training. After the road network is hash-sharded, there will inevitably be boundary road segments located at the intersections of different regional shards. These road segments are simultaneously monitored by two or more training nodes (e.g., node A and node B). Node A, based on traffic flow data within its jurisdiction, may believe that the weight of this boundary road segment should be increased (positive gradient); while node B, based on data within its jurisdiction, may believe that it should be decreased (negative gradient). Directly averaging such gradient conflicts can lead to model oscillations.

[0086] Before the step of aggregating the local right-of-way update results of each training node through the parameter server, a gradient arbitration step based on road network topology constraints is also included.

[0087] Specifically, the parameter server first identifies all boundary road segments. When it receives at least two local road weight update results for a boundary road segment, it determines whether their gradient update directions conflict (e.g., opposite directions, i.e., the cosine similarity of the gradients is less than 0).

[0088] If a conflict occurs, the parameter server does not blindly take an average, but instead analyzes the weight change trends of the boundary road segment in its upstream and downstream adjacent road segments. For example, if the overall weight of the upstream road segment is increasing (congestion spreads), then the request to increase the weight proposed by node A is more in line with the continuity of traffic flow.

[0089] The system calculates a consistency score between the local right-of-way update results and the weight change trend. Specifically, the consistency score... The cosine similarity of vectors is used for calculation, and the formula is as follows: , in, Update the gradient vector for the local path weights calculated for the current training node. This is the average weight change trend vector (i.e., the mean of adjacent gradients) of the boundary road segment in the upstream and downstream adjacent road segments. This represents the vector dot product operation. If If the direction is consistent, it will be retained; otherwise, it will be considered a conflict and suppressed. L2 norm (or Euclidean norm) represents the L2 norm of a vector, which is the square root of the sum of the squares of the vector's components.

[0090] The local right-of-way update result with the highest consistency score is selected as the valid update value, and a preset decay factor (e.g., 0.1) is used to suppress conflicting local right-of-way updates in other directions. Finally, the aggregated fusion is performed based on the arbitrated gradient. This mechanism ensures the continuity and accuracy of the distributed model when handling long-distance travel across regions, avoiding logical breaks caused by distributed segmentation.

[0091] After the model parameters distributed across various computing nodes have undergone multiple rounds of gradient synchronization and weight updates via the parameter server, the system faces a crucial decision point: how to scientifically, accurately, and practically determine whether the training has reached its endpoint. This not only relates to the rational allocation of computing resources but also directly determines whether the final generated road weight coefficients possess excellent generalization ability and practical application value.

[0092] In a preferred embodiment of the present invention, the system does not simply set a fixed number of iterations, but designs a set of rigorous preset convergence conditions that include multi-dimensional verification logic. Specifically, the preset convergence conditions include two levels of strict judgment criteria. The system monitors the status of these two criteria in real time, and only when they satisfy a specific logical relationship will a training termination instruction be triggered. The first level is the stability judgment of the loss function based on mathematical optimization theory. In the monitoring background of distributed training, the system maintains a time sliding window that records the trend of the global average loss function value. This window is implemented in memory using a circular queue data structure and can store the loss values ​​of the most recent N iterations (e.g., 50 iterations). The system calculates the variance and the rate of change of the first derivative of the data within this window in real time. When the decrease in the global loss function value is less than a very small threshold (e.g., 1e-6) within several consecutive training epochs (e.g., 5 consecutive epochs), or when the change curve of the loss function value shows a small oscillation around a certain constant value without a significant downward trend, the system initially determines that the model has found a local optimum or a global optimum in the probability distribution space. At this point, if forced training continues, it will not only fail to significantly improve the model's ranking and prediction capabilities, but may also cause the model to start learning random noise in the training samples, thereby destroying the universality of the weights.

[0093] However, mathematical convergence alone is insufficient for industrial-grade navigation systems. Therefore, this embodiment introduces a second layer: objective constraint judgment based on business physical meaning. This judgment criterion requires that the preference matching error rate between the recommended route calculated based on the current weights and the learning target road segment sequence (as positive samples) must be controlled within 5%. This preference matching error rate is a core indicator quantifying whether the model understands the driver's intent. Its calculation logic involves subtracting the weighted impedance of the recommended route from the weighted impedance of the actual trajectory, and then dividing by the weighted impedance of the actual trajectory. The threshold is strictly set at 5% based on conclusions drawn from numerous human factors engineering experiments and Weber's Law. When the difference in the overall travel cost between two paths is less than 5%, most human drivers cannot subjectively distinguish which is better, reaching the psychological indifference threshold. As long as the error is controlled within this range, the route planned by the algorithm can be considered equivalent in utility to the driver's perceived optimal route, thus ensuring the user's trust in the navigation results.

[0094] Meanwhile, to prevent the model from being trained with distorted weighting coefficients simply to cater to potential irrational preferences of drivers (such as a driver habitually taking a longer route to refuel or pick someone up, or a novice driver taking the wrong turn), this embodiment also sets a constraint: the time or distance loss of the recommended route must not exceed 10% of the optimal objective route. Here, the optimal objective route refers to the theoretically shortest path calculated solely by dividing the physical length of the road by the design speed, without considering any subjective psychological factors (such as road stability, congestion aversion, etc.). This strong constraint ensures that no matter how the model learns the user's personalized preferences, its recommendation results are always limited to a reasonable range allowed by physical laws, and it will not plan a detour route that significantly deviates from the optimal path to cater to psychological needs such as waiting less at a red light.

[0095] Once the model successfully passes the aforementioned stringent convergence criteria, conventional technical solutions often directly output the results and deploy them online. However, in the technical concept of this invention, while the weights at this point may satisfy the individual optimality for each driver on a micro level, they could potentially cause problems on a macro level: if all vehicles choose the same seemingly most cost-effective route based on these optimal weights, that route will instantly become severely congested due to traffic overload, leading to a significant decrease in the travel efficiency for everyone. To address this deep-seated traffic game problem, this embodiment forcibly embeds a macro-level road network load balancing deduction step before outputting the final result.

[0096] When performing the road network load balancing simulation, the system first uses the weighting coefficients of roads that currently meet the convergence criteria to construct a virtual traffic flow in memory and perform a route planning simulation of the entire road network. This virtual traffic flow is not randomly generated jumbled data, but rather a large number of virtual travel agents generated by the system using a Poisson distribution sampling method based on the actual origin-destination demand matrix of the target city over the past month. The system then uses the current weighting coefficients to concurrently plan an optimal route for each of these virtual vehicles. To support this large-scale concurrent computation, the system calls a GPU-accelerated parallel graph search algorithm to directly manipulate the road network graph in GPU memory.

[0097] Next, the system collects the planned trajectories of all virtual vehicles and maps them onto the topology of the digital road network. Specifically, the system maintains a counter in memory for each road segment, incrementing the counter each time a virtual trajectory passes through that segment. Finally, through normalization processing, a high-resolution simulated road network heat map is generated. This heat map can intuitively and dynamically display the traffic pressure distribution of the entire road network. The system scans this heat map using built-in image recognition algorithms or threshold detection logic to detect any abnormal clusters where the heat values ​​significantly exceed the physical capacity of the road segments. For example, if it is found that the planned traffic flow of a secondary arterial road has reached 200% of its design capacity, while the parallel arterial road is underutilized, this indicates that the current weighting coefficient is not penalizing the secondary arterial road sufficiently, leading to irrational traffic clustering.

[0098] Once such anomaly clustering areas are detected, the system will immediately initiate a feedback correction mechanism. Specifically, the system will generate a penalty mask for the feature vectors of road segments within this anomaly clustering area. This penalty mask is a weighted matrix or tensor perfectly aligned with the feature vector dimension (17 dimensions), which can accurately identify the key feature dimension causing congestion in the area (e.g., whether the short distance feature is over-rewarded, or the lack of traffic lights is over-amplified). The system feeds this penalty mask back into the iterative training process via an internal RPC interface, using it to perform weight reduction correction on specific dimensions of the road weighting coefficients. This correction adds a regularization penalty term for a specific area and specific features to the loss function. The specific correction logic is as follows:

[0099] First, calculate the congestion exceedance coefficient of the abnormally clustered areas. ,in To simulate thermal values, Design the traffic capacity of the road section; Indicates taking and The larger of the two values ​​is used here to ensure that the calculated congestion exceedance coefficient is not less than 0 (i.e., when the flow does not exceed the capacity, the coefficient is 0, and no penalty is incurred). Subsequently, a penalty mask is generated for the key feature dimensions that cause congestion. and will Assign the value to the corresponding bit of the mask.

[0100] Next, the correction calculation is performed, using the following formula: , in, This is the corrected road weighting coefficient vector; This is the current road weighting coefficient vector before correction; The penalty mask vector (dimension and dimension) generated for abnormal clustering regions Consistent); This represents the Hadamard product (the element-wise multiplication of vectors). To adjust the step size; It represents a scalar or all-1 vector with a value of 1, used to add with the penalty term to form a growth coefficient.

[0101] It is important to note that, in business terms, the "weight reduction correction" here refers to lowering the recommended priority of the road segment. Mathematically, this is achieved by increasing the impedance weight value using the formula described above (i.e., the weight value). Increased size leads to increased path overhead. This increases the likelihood of the path planning algorithm automatically avoiding the area in the next iteration.

[0102] Subsequently, the system triggers a new round of iterative training. In this new training, to reduce the total loss, the model automatically attempts to find alternative paths, thereby redirecting over-concentrated traffic to other relatively idle roads. This process may repeat multiple times until there are no longer any obvious abnormal clustering areas in the simulated road network heat map, thus achieving a balanced spatial distribution of road network traffic.

[0103] Step S4: Output the final road weighting coefficient, calculate the final cost of each road segment in the road network based on the coefficient, and embed the Dixtra algorithm to generate the planned route.

[0104] After repeated deductions and refinements, the system finally enters the output stage. At this point, the system outputs the final road weighting coefficients. These coefficient vectors cannot be directly recognized by the navigation engine and must undergo instantiation. The system traverses every road segment in the road network database, reading its inherent static attributes (such as road grade, number of lanes, and physical length) and real-time dynamic attributes (such as congestion level and weather conditions) to construct a real-time feature vector. Then, based on the final road weighting coefficients, the system calculates the final cost of each road segment in the road network. This cost value is a scalar obtained by the dot product of the coefficient vector and the feature vector, representing the comprehensive generalized impedance required for a vehicle to pass through that road segment.

[0105] Finally, the system writes the calculated final cost of each road segment into the edge attributes of the graph database and embeds it into the Dijkstra algorithm or the A* (A-Star) algorithm to generate planned routes. In the traditional Dijkstra algorithm, the priority queue is usually sorted based on the physical length of the edges. However, in this embodiment, when the algorithm performs the core relaxation operation, it reads the final cost from the edge attributes as the weight. Specifically, when the algorithm explores node u and prepares to expand its adjacent node v, it calculates the cumulative cost from the starting point to u plus the final cost from u to v. If the sum is less than the currently recorded shortest cost from the starting point to v, it updates the parent node pointer and the cumulative cost value of node v. Since this final cost has been deeply integrated with 17-dimensional features and load balancing strategies, the algorithm will actively avoid those branches that are close but have unstable road conditions during the search process, and will also decisively abandon those expressways that are usually smooth but are currently in a period of high congestion prediction.

[0106] Furthermore, the method in this embodiment is preferably run on a distributed high-performance computing cluster. This cluster is physically interconnected at the data access node, feature engineering node, model training node, and parameter server node via a high-speed fiber optic network (such as InfiniBand).

[0107] The data access nodes are equipped with high-throughput network interface cards (NICs) and in-memory databases (such as Redis Cluster) to handle tens of thousands of vehicle trajectory data streams per second in real time, ensuring low latency for storage and retrieval. The feature engineering nodes utilize streaming computing frameworks (such as Apache Flink) to map raw GPS coordinates onto the road network topology in real time and perform 17-dimensional feature vector extraction and one-hot encoding. The model training nodes are equipped with large-scale GPU (Graphics Processing Unit) or TPU (Tensor Processing Unit) arrays, leveraging their powerful parallel floating-point computing capabilities to accelerate complex matrix multiplication and gradient backpropagation calculations. The parameter server nodes are configured with terabytes of ECC memory to store globally unique copies of weight vectors and handle gradient aggregation requests from hundreds or thousands of training nodes. Especially during road network load balancing simulations, the system invokes a dedicated simulation server cluster, utilizing the concurrent processing capabilities of multi-core CPUs to complete the city-wide vehicle path simulation within milliseconds.

[0108] It is worth noting that the feature vector dimensions, convergence threshold settings, and specific network topology mentioned in the embodiments of this invention are merely preferred examples to achieve the best technical effect, and are not the only limitations on the scope of protection. In practical engineering applications, those skilled in the art can easily add or subtract feature dimensions (e.g., add slope features or toll price features) or fine-tune convergence parameters according to the specific geographical characteristics of the target city (such as mountainous cities or plain cities) and traffic management needs. Any obvious improvements and modifications made based on the core distributed feature inversion and load balancing deduction concept of this invention should be considered as included within the scope of protection of the technical solution of this invention.

[0109] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A distributed road weight training method, characterized in that, Includes the following steps: Obtain the travel trajectories of motor vehicles in the target area, and use a map matching algorithm to convert the motor vehicle travel trajectories into a sequence of target road segments for learning; Construct a road segment feature vector based on the objective attributes of the road, and combine it with randomly generated temporary road weighting coefficients and the learning target road segment sequence to construct a training sample set; Iterative training is performed using a distributed computing architecture. The route travel cost and loss function are calculated based on the training sample set, and the road weighting coefficients are updated according to the gradient until the preset convergence condition is met. The final road weighting coefficient is output, and the final cost of each road segment in the road network is calculated based on this coefficient. The Dixtra algorithm is then embedded to generate the planned route.

2. The distributed road weight training method according to claim 1, characterized in that, The iterative training using a distributed computing architecture specifically includes: The training sample set is hash-sharded according to region and user ID and distributed to different training nodes; Each training node performs local training based on the fragmented samples and calculates the local road weight update results; The parameter server aggregates the local road weight update results of each training node, uses a weighted average method to fuse them to generate global road weight coefficients, and distributes them back to each training node for the next round of training.

3. The distributed road weight training method according to claim 1, characterized in that, The constructed road segment feature vector is a 17-dimensional vector, specifically including: 6-dimensional road level features, 6-dimensional road type features, 4-dimensional real-time traffic speed level features, and 1-dimensional presence / absence of traffic control features; the objective road attributes also include road condition stability features.

4. The distributed road weight training method according to claim 3, characterized in that, The steps for constructing the training sample set include: For each of the aforementioned target road segment sequences, N temporary road weighting coefficients are randomly generated; For each of the temporary road weighting coefficients, calculate its weighted sum with the road segment feature vector to obtain a set of road weights, and generate the corresponding predicted road segment sequence based on the set of road weights; The learning target road segment sequence is combined with N predicted result road segment sequences to form the i-th training sample.

5. The distributed road weight training method according to claim 4, characterized in that, The steps for calculating the travel cost of the route specifically include: For each learning target road segment sequence and each predicted result road segment sequence, obtain the set of road segments it contains; For each road segment element in the road segment set, calculate the vector dot product between the current road weighting coefficient and the road segment feature vector of that road segment element; The vector dot product results of all road segment elements in the road segment set are summed to obtain the route travel cost of the corresponding sequence.

6. The distributed road weight training method according to claim 5, characterized in that, The steps for calculating the loss function employ a list-level Top-1 loss function, specifically including: The negative value of the route travel cost of the learning target road segment sequence is determined as the positive sample score, and the negative value of the route travel cost of each predicted result road segment sequence is determined as the negative sample score. Calculate the natural exponential function value of the positive sample score as the probability numerator; The sum of the natural exponential function values ​​of the positive sample scores and all the negative sample scores is used as the probability denominator. The ratio of the probability numerator to the probability denominator is calculated, and the negative value of the natural logarithm of the ratio is taken to obtain the loss function.

7. The distributed road weight training method according to claim 6, characterized in that, The step of updating the road weighting coefficients according to the gradient specifically includes: Based on the loss function, the negative gradient direction or parameter update step vector for the road weighting coefficient is calculated using the backpropagation algorithm. The negative gradient direction or parameter update step size vector is multiplied by the preset learning rate to obtain the weight update amount; The updated weights are added to the current road weighting coefficients to obtain the updated road weighting coefficients, which are then used for the next round of iterative training.

8. The distributed road weight training method according to claim 1, characterized in that, The preset convergence conditions include: The loss function no longer decreases; or, The preference matching error rate between the recommended route and the learning target road segment sequence The time or distance loss of the recommended route does not exceed a preset first convergence threshold, and the time or distance loss of the recommended route does not exceed a preset second convergence threshold of the optimal objective route; the formula for calculating the preference matching error rate is: , in, The weighted impedance overhead of the target road segment sequence being studied. This is the weighted impedance cost of the recommended route planned based on the current road weighting coefficients.

9. The distributed road weight training method according to claim 2, characterized in that, Before the step of aggregating the local right-of-way update results of each training node through the parameter server, a gradient arbitration step based on road network topology constraints is also included: The parameter server identifies the boundary road segments located at the intersection of different regional segments and obtains at least two local right-of-way update results for the boundary road segments. Determine whether the gradient update directions corresponding to the at least two local path weight update results conflict; If a conflict occurs, the weight change trend of the boundary road segment in the upstream and downstream adjacent road segments is analyzed, and the consistency score between each local right-of-way update result and the weight change trend is calculated. The local right-of-way update result with the highest consistency score is selected as the effective update value, and other local right-of-way update results are suppressed using a preset decay factor. Finally, the aggregation and fusion are performed.

10. The distributed road weight training method according to claim 1, characterized in that, Before the step of outputting the final road weighting coefficients, a road network load balancing deduction step is also included: Using the road weighting coefficients that currently meet the preset convergence conditions, a virtual traffic flow is constructed and a path planning simulation of the entire road network is performed to generate a simulated road network heat map; Detect whether there are abnormal clusters of heat values ​​exceeding the congestion threshold in the simulated road network heat map; If the abnormal clustering area exists, a penalty mask is generated for the feature vector of the road segment within the abnormal clustering area. The penalty mask is fed back into the iterative training process. The penalty mask is used to reduce the weight of a specific dimension of the road weighting coefficient and trigger a new round of iterative training until the abnormal clustering area no longer exists in the simulated road network heat map.