Cargo flow direction analysis method and system based on trajectory big data

CN122453302APending Publication Date: 2026-07-24XUESHEN CLOUD CHONGQING BIG DATA TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XUESHEN CLOUD CHONGQING BIG DATA TECHNOLOGY CO LTD
Filing Date
2026-04-30
Publication Date
2026-07-24

Smart Images

  • Figure CN122453302A_ABST
    Figure CN122453302A_ABST
Patent Text Reader

Abstract

The application discloses a cargo flow direction analysis method and system based on track big data. The method comprises the following steps: performing multi-dimensional quality evaluation and hierarchical cleaning on multi-source heterogeneous freight track data to generate an effective track data set; performing multi-type identification and classification on the stay events in the effective track data set, extracting the start and end points of the freight course, and generating a start and end point pair sequence with a stay event type label; performing cargo category inference on the start and end point pair sequence to generate a start and end point pair sequence with a cargo category label; performing multi-dimensional aggregation statistics on the start and end point pair sequence with the cargo category label to construct a flow direction analysis result; and performing time series anomaly detection and hierarchical early warning on the flow direction analysis result. The application also discloses a system for implementing the above method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traffic big data analysis technology, specifically to a method and system for analyzing freight flow direction based on trajectory big data. Background Technology

[0002] Cargo flow direction analysis refers to the technical method of collecting location trajectory data of freight vehicles to statistically analyze the flow patterns, volume, and direction distribution of goods between different regions. It is an important data foundation for transportation planning, logistics hub site selection, and freight corridor assessment.

[0003] In the prior art, such as Chinese patent CN113945958B, a method for identifying vehicles in a passenger-seeking state on road segments based on taxi GPS data is disclosed. This method uses taxi GPS data and map road data to filter out vehicles with passenger-seeking behavior and vehicles driving normally by calculating speed thresholds.

[0004] However, this method can only identify whether a vehicle is stationary, but it cannot distinguish the semantic types of stationary events (loading, unloading, refueling, resting, etc.), resulting in systematic errors in the origin and destination of freight trips extracted from trajectory data. This leads to distortion of the statistical results of freight flow and makes it impossible to distinguish the flow patterns of different types of goods in the flow analysis results.

[0005] To address the aforementioned issues, it is necessary to propose a method and system for analyzing cargo flow direction based on trajectory big data. Summary of the Invention

[0006] The purpose of this invention is to solve the problems existing in the background technology, and to propose a method and system for analyzing cargo flow direction based on trajectory big data.

[0007] The objective of this invention can be achieved through the following technical solutions: In a first aspect, the present invention provides a method for analyzing cargo flow direction based on trajectory big data, comprising the following steps: Step S1: The data acquisition module aggregates raw trajectory data from multiple heterogeneous data sources through a unified data access interface, completes coordinate system unification and field standardization, and converts all raw trajectory data into a unified internal storage format.

[0008] The data quality assessment submodule evaluates each trajectory sequence from four dimensions: positioning accuracy, speed rationality, road segment connectivity, and sampling integrity. Based on the weighted summation of the evaluation results for each dimension, a comprehensive quality score is obtained for each trajectory.

[0009] Preferably, the adaptive cleaning submodule performs hierarchical processing on the trajectory data based on the comprehensive quality score. Trajectories with a comprehensive quality score higher than the excellent threshold are directly included in the valid trajectory dataset. Trajectories with a comprehensive quality score between the repair threshold and the excellent threshold undergo repair processing. Trajectories with a comprehensive quality score lower than the repair threshold are discarded entirely. The repair processing includes: Preferably, the Kalman filter algorithm is used to smooth and correct the drift coordinate points; the trajectory completion algorithm based on road network topology is used to complete the signal interruption segments; and the jump anomaly points are removed and the local trajectory segments are refitted. The valid trajectory dataset and the quality assessment results corresponding to each trajectory are used as the output of step S1 and passed to steps S2 and S3; Step S2: The dwell event recognition submodule scans each trajectory sequence in the effective trajectory dataset using a sliding time window. When the radius of the spatial enclosing circle of all trajectory points within the time window is less than the preset dwell radius threshold, the trajectory points within the time window are identified as preliminary dwell event candidates. Candidate stay events whose duration is less than the preset minimum stay duration threshold are filtered out, and the stay events retained after filtering are considered valid stay events.

[0010] Preferably, the stop event type classification submodule classifies each valid stop event based on three types of features: semantic features of the stop location, speed and load change features before and after the stop, and stop duration distribution features. It calls a Bayesian classifier to determine the posterior probability of each valid stop event type based on the observation values ​​of the three types of features. The type with the highest posterior probability is taken as the type label of the stop event. The type labels include five types: loading stop, unloading stop, refueling stop, driver rest stop, and other stops.

[0011] Preferably, the semantic features of the stopping location are obtained by spatially associating and matching the coordinates of the stopping location with the point of interest database; the speed and load change features before and after the stopping are obtained by reading the trajectory speed sequence and vehicle load change within 3 minutes before and after the stopping event; and the stopping duration distribution features are obtained by calculating the duration of the effective stopping event and matching it with the prior distribution of each type of duration.

[0012] Preferably, the origin-end point extraction submodule extracts the origin and end point of the freight trip from each complete trip trajectory based on the type tags of the valid stop events. The location of the valid stop event with the type tag of loading stop is identified as the origin of the corresponding trip, and the location of the valid stop event with the type tag of unloading stop is identified as the end point of the corresponding trip, thus forming origin-end point pairs. The origin coordinates, end point coordinates, trip time, trip distance, and stop event type tag fields are recorded. The trajectory segment where no loading stop or unloading stop type tag is matched at either end of the continuous travel segment is marked as a transit travel segment. The sequence of origin-end point pairs with stop event type tags is the output of step S2 and passed to step S3. Step S3: The cargo category inference module infers the cargo category for each pair of origin and destination pairs in the origin-destination pair sequence output in step S2 from three feature levels: origin-destination semantic chain features, driving behavior pattern features, and historical trip association features. Preferably, the origin-endpoint semantic chain feature is constructed by matching the origin coordinates and the endpoint coordinates with the point of interest database, and in the form of a combination of origin stop location function type labels and endpoint stop location function type labels; Preferably, the driving behavior pattern features are obtained by extracting the average driving speed, speed fluctuation coefficient, path tortuosity, night driving segment markers, and departure time markers of the trip, and the confidence weight of the driving behavior pattern features is corrected according to the quality assessment results transmitted in step S1. Preferably, the historical trip association features are obtained by querying the historical trip record database with the vehicle's unique identifier as the key, extracting the historical weights of each cargo category from the vehicle's confirmed cargo-carrying historical trips in the past 30 days, and weighting them in an exponential decay manner, with the half-life set to 7 days; Preferably, the cargo category inference module obtains the initial confidence vector, behavioral confidence vector, and historical weight vector of each candidate cargo category from three feature levels. The dimension of each of the three vectors is 8, corresponding to eight first-level cargo categories.

[0013] Preferably, a comprehensive confidence vector is obtained by weighted summation of the three vectors. The fusion weights corresponding to the three feature levels are 0.5, 0.35, and 0.15, respectively. The historical weight vector is normalized before participating in the summation. When the input data of a certain feature level is missing, the fusion weight of that feature level is reset to zero, and its original weight is redistributed to the other feature levels proportionally.

[0014] Preferably, the category of goods corresponding to the maximum value in the comprehensive confidence vector is taken as the category label of the origin-end point pair; the category label and its corresponding posterior probability value, together with the origin-end point coordinates, travel time, and travel distance fields, together constitute the origin-end point pair sequence with category label, which is passed to step S4 as the output of step S3. Step S4: The traffic flow statistics module performs multi-dimensional aggregation statistics on the start and end point sequences with cargo category tags output in step S3 according to spatial partition granularity, time window granularity, and cargo category dimension. For each combination of start point partition, end point partition, time window, and cargo category, a flow record is generated. The flow record includes fields such as vehicle traffic, estimated freight volume, average travel time, and average travel distance.

[0015] Preferably, the estimated freight volume is calculated in ton-kilometers. The estimated freight weight is obtained by multiplying the vehicle's rated load capacity and the estimated load rate. The estimated freight volume is then obtained by multiplying the estimated freight weight and the actual travel distance. Preferably, the vehicle's approved load capacity is obtained from the vehicle file information of the Ministry of Transport's Road Freight Vehicle Public Supervision Platform, using the vehicle's unique identifier as an index. When the vehicle file information is missing, it is replaced by the default reference value of the approved load capacity of each cargo category corresponding to the cargo category label output in step S3.

[0016] Preferably, when load sensor data is available, the estimated load rate is directly calculated based on the ratio of the actual load weight collected by the sensor to the vehicle's approved load weight. When load sensor data is unavailable, the load rate is assigned a value based on the dwell event type label at both ends of the origin and destination confirmed in step S2. Based on the statistical calculation of the total inflow, outflow, and transit volume of freight vehicles in each zone, the freight attraction intensity and generation intensity of each zone are obtained. The multidimensional flow direction statistical results are used as the output of step S4, written into the analysis result repository, and passed to step S5. Step S5: The anomaly detection module performs time series analysis on the multidimensional flow direction statistics output in step S4. Based on the data of 52 natural weeks in the same period of history, the STL decomposition algorithm is called to decompose the historical flow sequence into trend component, periodic component and residual component according to the period window parameter 13 and trend window parameter 25. Based on the calculation of the mean and standard deviation of the residual component sequence, the upper and lower bounds of the normal fluctuation range are determined by the mean plus or minus 3 times the standard deviation.

[0017] Preferably, when the residual component sequence does not satisfy the normal distribution assumption, the 5th percentile to the 95th percentile of the residual component sequence is used as the upper and lower bounds of the normal fluctuation range.

[0018] Preferably, the actual flow rate of the current statistical period is subtracted from the predicted values ​​of the trend component and the periodic component extrapolated by the STL model to obtain the residual estimate of the current period; when the residual estimate exceeds the upper or lower bound of the normal fluctuation range, it is determined to be a flow abnormality event and an abnormal event record is generated.

[0019] Preferably, based on the deviation of the actual traffic from the historical benchmark value, traffic anomalies are divided into three warning levels: a Level 1 warning signal is generated when the deviation exceeds the benchmark value by 30%, a Level 2 warning signal is generated when it exceeds 60%, and a Level 3 warning signal is generated when it exceeds 100%. The warning signals are output to an external monitoring platform or decision support system through a standardized data interface, and the anomaly event records are written into the analysis results repository.

[0020] Secondly, the present invention also provides a cargo flow direction analysis system based on trajectory big data, including a data quality processing module, a dwell event identification module, a cargo type inference module, and a flow direction statistics and early warning module; The data quality processing module is used to collect multi-source heterogeneous freight trajectory data, perform format standardization processing, multi-dimensional quality assessment and hierarchical cleaning, and generate a valid trajectory dataset and the quality assessment result corresponding to each trajectory; the output of the data quality processing module is transmitted to the dwell event recognition module and the cargo type inference module. The Dwelling Event Recognition module is used to detect dwelling events, classify dwelling event types, and extract the origin and destination of freight trips from the valid trajectory dataset output by the data quality processing module, generating a sequence of origin and destination pairs labeled with dwelling event types; the output of the Dwelling Event Recognition module is passed to the cargo type inference module; The cargo category inference module receives the origin-end point pair sequence with dwell event type labels from the dwell event identification module and the quality assessment results from the data quality processing module. It infers the cargo category for each origin-end point pair from three feature levels: origin-end point semantic chain features, driving behavior pattern features, and historical trip association features, generating an origin-end point pair sequence with cargo category labels and corresponding posterior probability values. The output of the cargo category inference module is transmitted to the flow statistics and early warning module. The flow statistics and early warning module is used to perform multi-dimensional aggregation statistics on the start and end point sequences of the product category labels output by the product category inference module, generate flow direction analysis results, and perform time series anomaly detection on the flow direction analysis results to generate abnormal event records and hierarchical early warning signals. The early warning signals are output to external systems through a standardized data interface.

[0021] Compared with the prior art, the beneficial effects of the present invention are: This invention achieves accurate extraction of the origin and destination of freight journeys by performing multi-type semantic classification of stop events, solving the problem of flow direction statistical distortion caused by confusion in stop types in existing technologies. This invention introduces a cargo category dimension into trajectory data through a multi-layer feature fusion cargo category inference mechanism, supporting the classification and statistical analysis of flow patterns for different cargo categories. This invention elevates freight flow analysis from post-event statistics to a near real-time dynamic perception level through STL time series decomposition and hierarchical early warning mechanisms. Attached Figure Description

[0022] To facilitate understanding by those skilled in the art, the present invention will be further described below with reference to the accompanying drawings: Figure 1 This is a flowchart of the cargo flow direction analysis method based on trajectory big data proposed in the embodiments of the present invention.

[0023] Figure 2 This is a system block diagram of the cargo flow direction analysis system based on trajectory big data proposed in the embodiments of the present invention; Figure 3 This is a flowchart illustrating the freight trajectory completion method based on road network topology proposed in an embodiment of the present invention. Detailed Implementation

[0024] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. 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.

[0025] First embodiment: This invention provides a method and system for analyzing freight flow direction based on trajectory big data. It systematically assesses and adaptively cleans massive amounts of freight vehicle trajectory data from a multi-source heterogeneous data access layer. Based on the cleaned trajectory data, it performs refined identification of freight stop events and extracts origin and destination points. Then, combining the semantic features of the stop locations, vehicle operation behavior characteristics, and time distribution characteristics, it automatically infers the cargo category and finally outputs statistical results of freight flow direction with cargo category tags. This supports government and enterprise decision-making scenarios such as freight corridor planning and logistics hub site selection. Detailed explanations follow.

[0026] Please see Figure 1 , Figure 1 This is a flowchart illustrating the cargo flow direction analysis method based on trajectory big data disclosed in an embodiment of the present invention. Figure 1 The analysis method shown is applicable to processing BeiDou / GPS trajectory data of road freight vehicles, enabling refined statistics and analysis of freight flow direction. For example... Figure 1 As shown, the method may include the following steps: Step S1: Collect and assess the quality of multi-source heterogeneous freight trajectory data, and generate a valid trajectory dataset and quality assessment results for each trajectory.

[0027] In this embodiment of the invention, the data acquisition module aggregates raw trajectory data from multiple heterogeneous data sources, including the Beidou vehicle networking platform, GPS positioning devices, and the Ministry of Transport's public supervision and service platform for road freight vehicles, through a unified data access interface. The reporting formats, sampling frequencies, and coordinate system standards of each data source differ; some devices report trajectory points at a frequency of once per second, while others report only once every 30 seconds. Regarding coordinate systems, both WGS-84 and the National 2000 coordinate system coexist. After receiving the raw data, the data acquisition module first performs coordinate system unification and field standardization, converting all trajectory data into a unified internal storage format. Each trajectory record includes basic fields such as a unique vehicle identifier, timestamp sequence, latitude and longitude sequence, speed sequence, and satellite signal quality sequence, serving as input for subsequent quality assessment.

[0028] In this embodiment of the invention, to address the common noise issues in raw trajectory data, such as positioning drift, signal interruption, coordinate jumps, and abnormal speeds, the data quality assessment submodule evaluates each trajectory sequence from the following four dimensions: First, the positioning accuracy dimension, using the horizontal accuracy factor value and the number of effective satellites as evaluation criteria. When the accuracy factor exceeds a preset accuracy threshold or the number of effective satellites is lower than a preset minimum, the trajectory point is marked as a low-accuracy point. Second, the speed reasonableness dimension, calculating the instantaneous speed between adjacent trajectory points. When the instantaneous speed exceeds the physical reasonableness of the freight vehicle... When the maximum speed is reached (set to 150 km / h in this embodiment), the point pair is identified as an abrupt change pair; the third dimension is road segment connectivity, which verifies the topological reachability of continuous trajectory points on the road network by projecting the trajectory point sequence onto the road network topology map. When there is no reasonable connecting path between adjacent trajectory points on the road network, the location is recorded as an abnormal road network breakpoint; the fourth dimension is sampling integrity, which calculates the duration of each signal interruption segment in the trajectory time series. When the interruption duration exceeds a preset interruption threshold, the trajectory is cut into two independent sub-trajectories at this point and processed separately. The data quality assessment submodule weights and summarizes the assessment results of the above four dimensions to generate a comprehensive quality score for each trajectory. The weight coefficients of each dimension of the comprehensive quality score can be adaptively adjusted according to the overall quality of the actual accessed data.

[0029] In this embodiment of the invention, after the quality assessment is completed, the adaptive cleaning submodule performs hierarchical processing on the trajectory data based on the comprehensive quality score. When the comprehensive quality score is higher than the excellent threshold, the trajectory is directly included in the effective trajectory dataset; when the comprehensive quality score is between the repair threshold and the excellent threshold, the trajectory undergoes repair processing, including smoothing and correcting drift coordinate points using the Kalman filter algorithm, completing short-term signal interruption segments using a trajectory completion algorithm based on road network topology, and removing jump anomalies and refitting local trajectory segments; when the comprehensive quality score is lower than the repair threshold, the trajectory is discarded entirely and does not enter the subsequent processing flow. The cleaned effective trajectory dataset and the quality assessment result corresponding to each trajectory are jointly used as the output of step S1 and passed to step S2.

[0030] It should be noted that in this embodiment of the invention, the quality assessment results of each trajectory are not discarded after step S1, but are passed to subsequent steps as intermediate parameters along with the valid trajectory data. In the cargo inference stage of step S3, the sampling frequency information and positioning accuracy information recorded in the quality assessment results will be used to correct the confidence weight of the behavioral feature extraction, thereby avoiding interference from low-quality trajectory segments on the accuracy of cargo identification. This cross-step reuse mechanism of quality information enables the entire analysis process to maintain high robustness even in real-world scenarios with uneven data quality.

[0031] Step S2: Perform multi-type identification and classification on freight stop events in the effective trajectory dataset, extract the start and end points of each trip, and generate start and end point pair sequences with stop event type labels.

[0032] In this embodiment of the invention, the dwell event recognition submodule processes the valid trajectory dataset output in step S1 line by line to identify dwell segments in the trajectory. The initial detection of dwell segments is based on an improved spatiotemporal density method: a sliding time window is used to scan the trajectory sequence, with a default window width of 10 minutes. When the radius of the spatial enclosing circle of all trajectory points within the window is less than a preset dwell radius threshold (default set to 200 meters), the trajectory points within that window are identified as a preliminary dwell event candidate. After the initial detection is completed, the dwell event recognition submodule further verifies the duration of the candidate dwell events. Short pauses lasting less than 5 minutes (such as waiting at a red light, brief yielding, etc.) are filtered out and not processed as valid dwell events, thereby eliminating interference from objective factors such as traffic signals on dwell recognition.

[0033] In this embodiment of the invention, valid stop events confirmed through the preliminary detection are further sent to the stop event type classification submodule for refined classification. This is the core innovation of the invention. In existing technologies, the processing of stop events typically only distinguishes between "stop" and "driving" states, failing to differentiate the semantic differences between different events such as loading, unloading, refueling, and resting at the same stop location, leading to systematic errors in origin and destination extraction. In this embodiment of the invention, the stop event type classification submodule comprehensively utilizes the following three types of features to classify each valid stop event.

[0034] The first category is the semantic features of the stop location. The stop event type classification submodule performs spatial association matching between the stop location coordinates and the Point of Interest (POI) database, extracting the distribution of POI types within a 500-meter radius of the stop location. POI types include, but are not limited to, freight logistics parks, factory warehouses, agricultural wholesale markets, e-commerce distribution centers, gas stations, freight service areas, and port terminals. When the stop location highly overlaps spatially with a gas station POI (matching distance less than 50 meters), the semantic label for this stop event tends to be "gas station stop"; when the stop location matches a freight logistics park or warehouse POI, it tends to be "loading / unloading stop".

[0035] The second category is the speed and load change characteristics before and after the stop. The stop event type classification submodule reads the trajectory speed sequence within 3 minutes before and after the stop event, and synchronously reads the change in vehicle load before and after the stop when load sensor data is available. When the vehicle load after the stop is significantly increased relative to before the stop (the increase exceeds the preset loading recognition threshold), the stop event is initially identified as "loading stop"; when the vehicle load after the stop is significantly decreased relative to before the stop (the decrease exceeds the preset unloading recognition threshold), the stop event is initially identified as "unloading stop". In the absence of load sensor data, the stop event type classification submodule will use the change in vehicle driving speed pattern before and after the stop as a substitute feature for inference: there are statistical differences between empty driving and heavy driving in terms of acceleration response, uphill speed, etc., which can be used to indirectly judge the loading and unloading status.

[0036] The third category is the distribution characteristics of dwell time. Different types of dwell events exhibit their own stable statistical distribution patterns in terms of dwell time: refueling dwell times typically last 15 to 30 minutes, rest dwell times typically last 1 to 8 hours, while the duration of loading or unloading dwell times varies greatly depending on the type and quantity of goods, usually ranging from 20 minutes to 4 hours. The dwell event type classification submodule uses the above statistical distribution as prior knowledge, combines the first and second category features, and outputs the posterior probability of the type for each valid dwell event through a Bayesian classifier. The type with the highest posterior probability is taken as the final type label for that dwell event. The identifiable dwell event types include: loading dwell times, unloading dwell times, refueling dwell times, driver rest dwell times, and other dwell times, totaling five types.

[0037] In this embodiment of the invention, after classifying all stop events by type, the origin-end point extraction submodule extracts the origin and end point of the freight trip from each complete trip trajectory based on the stop event type tags. The specific extraction rule is as follows: Stop events at both ends of a continuous travel segment are considered candidate origin and end points. If the type tag of the stop event at the beginning of the travel segment is "loading stop," then that stop location is confirmed as the origin of this freight trip; if the type tag of the stop event at the end of the travel segment is "unloading stop," then that stop location is confirmed as the end of this freight trip. Thus, a valid origin-end point pair is extracted, and attribute fields such as origin coordinates, end coordinates, travel time, travel distance, and stop event type tags are recorded. When no loading or unloading stop events are matched at either end of a continuous travel segment (e.g., both ends are refueling or rest stops), this segment is marked as a transit travel segment and is not processed as an independent freight trip. The above origin-end point pair sequence and the corresponding stop event type tag sequence are collectively used as the output of step S2 and passed to step S3.

[0038] It should be noted that in this embodiment of the invention, the classification of stop event types is used as a pre-filtering step for origin-endpoint extraction, rather than directly pairing all stop points with origins and ends. The core significance of this design is that the origin and end of a freight journey semantically correspond to the physical events of "departure after loading" and "arrival after unloading," respectively. If refueling or rest stops are incorrectly identified as the end of the journey, a complete freight journey will be incorrectly segmented into multiple short segments, directly causing a systematic shift in origin-endpoint pairs in flow analysis. Existing technologies typically rely on manually set simple duration thresholds to address this problem. This invention solves this problem semantically through a multi-feature fusion classification mechanism, significantly improving the accuracy of origin-endpoint extraction.

[0039] Step S3: Perform goods category inference on the start-end point pair sequence output in step S2 to generate a start-end point pair sequence with goods category labels.

[0040] In this embodiment of the invention, the cargo inference module receives the origin-destination pair sequence output in step S2. For each origin-destination pair, it comprehensively utilizes the semantic information of the point of interest at the origin stop, the semantic information of the point of interest at the destination stop, the time distribution characteristics of the freight journey, the driving speed pattern characteristics, and the trajectory quality assessment results transmitted in step S1 to automatically infer the cargo category carried in this freight journey.

[0041] In this embodiment of the invention, the goods inference module constructs a goods identification system based on multi-layer feature fusion, which specifically includes the following three feature levels.

[0042] The first feature level is the origin-destination semantic chain feature. The cargo category inference module matches the origin and destination coordinates with the point of interest database to obtain the functional type labels of the origin and destination locations, and constructs a semantic chain in the form of "origin type - destination type". Different cargo categories show significant regularities in the combination of origin and destination functional types: the origin of agricultural product freight is usually an agricultural wholesale market or agricultural production base, and the destination is usually a supermarket distribution center or agricultural retail market; the origin of e-commerce freight is usually an e-commerce warehousing and distribution center, and the destination is usually a courier sorting site; the origin of bulk building material freight is usually a building material factory or stone quarry, and the destination is usually a construction site or building material market; the origin of hazardous chemical freight is usually a chemical plant or hazardous chemical warehouse, and the destination is usually a hazardous chemical storage and transportation station or user enterprise. The cargo category inference module uses the above semantic chain patterns as a prior knowledge base for classification, matches the semantic chain of each pair of origin and destination, and outputs a preliminary cargo category candidate list and corresponding confidence scores.

[0043] The second feature level is driving behavior pattern features. Different types of goods have different requirements for the transportation process, and the driving behavior patterns of vehicles transporting different types of goods also show statistical differences. The cargo inference module extracts the following behavioral features from the freight journey trajectory confirmed in step S2: the average driving speed of the journey, the speed fluctuation coefficient during the journey, the ratio of the total journey time to the straight-line distance (i.e., the path detour), whether there are obvious night driving segments in the journey, and the distribution of the journey departure time (early shift, day shift, and evening shift). For example, fresh and cold chain goods usually require quick delivery, and their corresponding journeys have higher average speeds and lower path detours; while the transportation of hazardous chemicals is subject to speed restrictions and route control requirements, and their corresponding journeys have relatively lower average speeds and usually avoid morning and evening peak hours; the journeys of bulk cargo such as building materials are usually accompanied by large speed fluctuations. After quantifying the above behavioral features, the cargo inference module performs joint matching with the cargo candidate list output by the first feature level to update the confidence of each candidate cargo category.

[0044] The third feature level is the historical trip association feature. The cargo type inference module maintains a historical trip record database with the vehicle's unique identifier as the key. When the same vehicle has a historical trip with a cargo type tag confirmed in step S3 within the past 30 days, the cargo type that appears most frequently in the historical trip is used as the auxiliary weight for inferring the cargo type of the current trip, correcting the fusion confidence of the first and second feature levels. This mechanism is based on the fact that dedicated line freight vehicles usually carry relatively fixed types of goods over a long period of time, and the cargo type distribution of historical trips has strong predictive reference value for the current trip. When there is no matching vehicle record in the historical record database, the weight of this feature level automatically drops to zero, without affecting the inference results of the first two feature levels.

[0045] In this embodiment of the invention, the fusion calculation of the three feature levels is specifically implemented as follows. For each pair of origin and destination, the cargo inference module obtains the initial confidence vector of each candidate cargo based on semantic chain matching of origin and destination from the first feature level, the behavioral confidence vector of each candidate cargo based on driving behavior pattern matching from the second feature level, and the historical weight vector of each candidate cargo based on historical trip records from the third feature level. The dimensions of the three vectors are consistent with the number of cargo types supporting inference (eight first-level categories in this embodiment of the invention, i.e., the vector dimension is 8).

[0046] In this embodiment of the invention, the fusion of the three vectors adopts a weighted linear fusion method. The fusion weights of each feature level are set as follows: the weight of the first feature level (origin-end semantic chain) is set to 0.5, the weight of the second feature level (driving behavior pattern) is set to 0.35, and the weight of the third feature level (historical trip association) is set to 0.15. The basis for the above weight allocation is that the origin-end semantic chain feature has the strongest discriminative power when data is available, the driving behavior pattern feature, as intrinsic trajectory information, has strong independent verification value, and the historical trip association feature is only used as an auxiliary correction and has the lowest weight. The fused comprehensive confidence vector is obtained by weighting and summing the three vectors according to the above weights. The historical weight vector, which is affected by the weight of the third feature level, participates in the summation after normalization to ensure the comparability of the three vectors on a numerical scale. The value of each dimension in the comprehensive confidence vector is the final posterior probability estimate of the corresponding cargo class, and the cargo class corresponding to the maximum value is taken as the cargo class label of the origin-end pair.

[0047] In this embodiment of the invention, when input data for a certain feature level is missing, the system dynamically adjusts the fusion weights according to the following degradation rules. When there is no corresponding vehicle record in the historical trip record database of the third feature level (i.e., the vehicle is appearing for the first time or the historical record is less than 30 days), the weight of the third feature level is automatically reset to zero, and its original weight of 0.15 is proportionally allocated to the first and second feature levels. After adjustment, the weight of the first feature level is approximately 0.59, and the weight of the second feature level is approximately 0.41. When there are no valid points of interest matching results within 500 meters of the stop location, resulting in the first feature level being unable to generate a valid confidence score, the weight of the first feature level is reset to zero, and its original weight is proportionally allocated to the second and third feature levels. After adjustment, the weight of the second feature level is approximately 0.70, and the weight of the third feature level is approximately 0.30. When both of the above data missing situations occur simultaneously, the cargo inference module only relies on the driving behavior pattern features of the second feature level to output the inference result. At this time, the system also marks the confidence field as low confidence in the output record of the origin-destination pair to prompt the downstream statistical analysis step to assign a lower statistical weight to the inference result of this record.

[0048] In this embodiment of the invention, after completing the fusion calculation of three feature levels, the cargo category inference module outputs the posterior probability distribution of cargo categories for each pair of origin and destination points, and takes the cargo category with the highest posterior probability as the cargo category label for that origin-destination pair. The cargo categories supported for inference in this embodiment include, but are not limited to: agricultural products and food, e-commerce express delivery, building materials and sand and gravel, hazardous chemicals, bulk energy (coal / oil), industrial raw materials and semi-finished products, consumer goods, and other categories, totaling eight primary categories. A secondary category label system can be expanded according to actual business scenarios. The cargo category label and its corresponding posterior probability value, together with attribute fields such as origin-destination coordinates and travel time, constitute the origin-destination pair sequence with cargo category labels, which is passed to step S4 as the output of step S3.

[0049] It should be noted that, in the three feature levels relied upon for cargo classification inference in this embodiment of the invention, the first level (origin-destination semantic chain) provides strong prior discriminative ability, the second level (driving behavior pattern) provides endogenous behavioral features based on the trajectory itself, and the third level (historical trip association) uses the time-series accumulated information of individual vehicles to correct the inference results. The feature sources of the three levels are independent of each other and complementary. This multi-layer feature fusion mechanism enables cargo classification inference to maintain an acceptable recognition accuracy in areas where point-of-interest data is sparse or missing, rather than relying entirely on the coverage quality of the point-of-interest database.

[0050] Step S4: Perform spatiotemporal aggregation statistics on the start and end point sequences of the product category tags to construct a multidimensional dynamic cargo flow direction analysis result.

[0051] In this embodiment of the invention, the traffic flow statistics module receives the origin-end point pair sequence of the product category tags output in step S3, and performs multi-dimensional aggregation statistics on the origin-end point pair sequence according to preset spatial partition granularity, time window granularity, and product category dimension. Regarding spatial partition granularity, the system supports multiple levels such as provincial, municipal, district / county, and custom freight partitions, with the origin and end point coordinates mapped to the corresponding partition codes through spatial association operations. Regarding time window granularity, the system supports aggregation by day, week, month, and custom time period, and also supports further decomposition of the aggregation results by dimensions such as morning / evening peak hours, weekdays, and holidays. Regarding product category dimension, the system supports segmenting traffic flow data by product category tag to facilitate analysis of the spatial flow patterns of specific product categories.

[0052] In this embodiment of the invention, after completing multi-dimensional aggregation, the flow direction statistics module generates flow direction records for each "originating zone - destination zone - time window - cargo type" combination. Each flow direction record includes statistical fields such as train traffic volume, estimated freight volume (in ton-kilometers), average travel time, and average travel distance for that combination. Simultaneously, based on the total inflow, outflow, and transit volume of freight trains in each zone, the flow direction statistics module calculates the freight attraction and generation intensity of each zone, thereby identifying important freight origins, destinations, and transit nodes in the regional freight network. The above multi-dimensional flow direction statistics results are output from step S4, written to the analysis result repository, and output to the downstream decision support module.

[0053] In this embodiment of the invention, the estimated freight volume is based on the estimated vehicle's certified load capacity and loading rate corresponding to the travel trajectory. The vehicle's certified load capacity data comes from the vehicle file information of the Ministry of Transport's Road Freight Vehicle Public Supervision Platform, and is associated with the trajectory data using the vehicle's unique identifier as an index. When vehicle file information is missing, the system uses the median of the vehicle type distribution statistics corresponding to the cargo type label output in step S3 as a substitute value. The specific substitute reference values ​​are set according to the cargo type as follows: the certified load capacity of vehicles corresponding to agricultural products and food trips is 10 tons by default, 8 tons for e-commerce express delivery trips, 25 tons for building materials and sand and gravel trips, 20 tons for hazardous chemicals trips, 30 tons for bulk energy trips, 18 tons for industrial raw materials and semi-finished products trips, 10 tons for consumer goods trips, and 12 tons for other trips. The above default values ​​can be adjusted in the system configuration file according to the vehicle type structure statistics of the actual operating area.

[0054] In this embodiment of the invention, the estimated loading rate reflects the proportion of actual cargo load to the vehicle's rated load capacity during a freight trip. When load sensor data is available, the loading rate is directly calculated as the ratio of the actual load weight collected by the sensor to the vehicle's rated load capacity. When load sensor data is unavailable, the system sets reference loading rates based on cargo type and trip direction, with the following specific reference values: For a complete freight trip identified in step S2 as having a loading stop event at the starting point and an unloading stop event at the destination, the loading rate is uniformly set to 0.85; for trips with a clearly defined stop event type at only one end, the loading rate is set to 0.70; for trips where the stop event types at both ends cannot be confirmed (i.e., those processed as transit segments in step S2 and then re-included in the statistics), the loading rate is set to 0.60. All of the above reference loading rate values ​​can be configured and adjusted. The estimated cargo weight for each freight trip is obtained by multiplying the vehicle's rated load capacity by the estimated load rate. The estimated freight volume (ton-kilometers) is obtained by multiplying the estimated cargo weight by the actual travel distance. The actual travel distance is taken from the travel distance field value of the origin-end point alignment record output in step S2.

[0055] It should be noted that in this embodiment of the invention, the multidimensional aggregation statistics in step S4 use the cargo category tags output in step S3 as an important subdivision dimension. This means that the flow direction analysis results are no longer a simple count summary of freight trips, but a systematic answer to the complete question of "which type of goods flows from where to where, during what time period, and how large the flow is". This flow direction statistical capability with cargo category tags is the core incremental value of this invention compared to existing freight flow direction analysis methods based solely on train number statistics. It can directly support high-value application scenarios such as regional industrial chain freight flow direction analysis and identification of key material transportation channels.

[0056] Step S5: Perform anomaly detection and early warning on the flow direction analysis results output in step S4, generate anomaly flow direction event records and early warning signals, and output the early warning signals to external monitoring or decision-making systems.

[0057] In this embodiment of the invention, the anomaly detection module performs time series analysis on the multidimensional traffic flow statistics output in step S4 to identify abnormal traffic events. The anomaly detection module first uses historical data from the same period (by default, data from the past 12 natural weeks) as a benchmark, and decomposes the historical traffic sequence into trend components, periodic components, and residual components using a time series decomposition algorithm, and establishes a normal fluctuation range of traffic based on the statistical distribution of the residual components.

[0058] In this embodiment of the invention, the time series decomposition adopts a seasonal decomposition method based on local weighted regression (STL decomposition). The historical traffic series uses the natural week as the basic statistical unit, that is, each statistical node corresponds to a summary value of the traffic flow of a "starting point zone - ending point zone - cargo type" combination within a specific natural week. The length of the historical series is taken from the data of the past 52 natural weeks (i.e., the past whole year). When the historical data accumulation is less than 52 weeks, the actual number of available historical weeks shall be used, but it shall not be less than 12 weeks. Otherwise, the flow combination shall not participate in the anomaly detection, only output the statistical results, and no warning signal shall be generated.

[0059] In this embodiment of the invention, the periodic window parameter in the STL decomposition is set to 13 (corresponding to a quarterly cycle, i.e., a seasonal cycle of 13 weeks), and the trend window parameter is set to 25 (i.e., the trend component is estimated by weighted local regression of 25 statistical units). The basis for setting these two parameters is that freight traffic usually has a seasonal business cycle of peak and off-peak periods on a quarterly basis, and a trend window of 25 weeks is sufficient to capture annual trend changes while avoiding overfitting to short-term fluctuations. After the STL decomposition is completed, the trend component and periodic component are subtracted from the original traffic sequence to obtain the residual component sequence.

[0060] In this embodiment of the invention, the anomaly detection module establishes a normal fluctuation range based on the residual component sequence. The specific method is as follows: the mean and standard deviation of the residual component sequence are calculated, and the mean plus or minus three times the standard deviation is used as the upper and lower bounds of the normal fluctuation range (i.e., the 3-sigma criterion). In actual judgment, the anomaly detection module subtracts the predicted values ​​of the trend and periodic components extrapolated from the STL model from the actual flow rate of the current statistical period to obtain the residual estimate for the current period. When the residual estimate exceeds the upper bound of the normal fluctuation range, it is judged as a positive flow anomaly (sudden increase in flow); when the residual estimate is below the lower bound, it is judged as a negative flow anomaly (sudden drop in flow). When the length of the historical sequence is insufficient to satisfy the normal distribution assumption of the residual component sequence (which can be verified by the Shapiro-Wilk test with a significance level of 0.05), the system automatically switches to a non-parametric method, using the 5th to 95th percentiles of the residual component sequence as alternative upper and lower bounds of the normal fluctuation range to ensure that anomaly detection still has statistical significance for irregular flow direction combinations.

[0061] When the actual flow of a certain "starting zone - ending zone - cargo type" combination exceeds the upper or lower limit of the normal fluctuation range within the current statistical period, this situation is judged as a flow abnormal event. The abnormality detection module generates an abnormal event record for it. The record includes fields such as the time window of the abnormality, the starting and ending zones involved, the cargo types involved, the actual flow value, the historical benchmark value, and the degree of abnormal deviation.

[0062] In this embodiment of the invention, after generating anomaly event records, the anomaly detection module further classifies the severity of the anomaly events. When the actual traffic flow deviates from the historical baseline by more than a preset Level 1 warning threshold (default set to 30% of the baseline value), a Level 1 warning signal is generated, indicating that the flow direction has experienced a moderate degree of abnormal fluctuation, and relevant management departments are advised to pay attention. When the deviation exceeds a preset Level 2 warning threshold (default set to 60% of the baseline value), a Level 2 warning signal is generated, indicating that the flow direction has experienced a significant anomaly, and an investigation mechanism is recommended. When the deviation exceeds a preset Level 3 warning threshold (default set to 100% of the baseline value), a Level 3 warning signal is generated, indicating that the flow direction may experience a major interruption or a sudden large-scale shift, and an emergency response is recommended to be initiated immediately. The above-mentioned warning signals at all levels are output to an external regulatory platform or decision support system through a standardized data interface, while a complete anomaly event record is retained in the analysis result repository for subsequent source tracing analysis.

[0063] It should be noted that in this embodiment of the invention, anomaly detection and early warning are embedded as independent steps in the entire analysis process, rather than as optional post-processing steps. The significance of this is that abnormal fluctuations in cargo flow are often early signals of major events such as natural disasters, infrastructure failures, policy adjustments, or regional supply-demand imbalances. Timely perception of flow changes through trajectory big data in the early stages of an event can buy valuable response time for emergency material dispatching and transportation corridor emergency support. This step, through continuous time-series monitoring of the flow statistics output from step S4, elevates cargo flow analysis capabilities from post-event statistical analysis to near real-time dynamic perception and early warning.

[0064] Please see Figure 2 , Figure 2 This is a schematic diagram of the structure of the cargo flow direction analysis system based on trajectory big data disclosed in an embodiment of the present invention. Figure 2 As shown, the system may include a data quality processing module, a dwell event identification module, a cargo type inference module, and a flow direction statistics and early warning module, wherein: The data quality processing module is used to collect, standardize, perform multi-dimensional quality assessment, and adaptively clean multi-source heterogeneous freight trajectory data, generating a valid trajectory dataset and quality assessment results for each trajectory, corresponding to the function in step S1 above. The data quality processing module includes a data acquisition submodule, a quality assessment submodule, and an adaptive cleaning submodule. These three submodules work sequentially to transform the raw multi-source heterogeneous trajectory data into a standardized, valid trajectory dataset that has undergone quality assurance. The valid trajectory dataset and quality assessment results output by the data quality processing module are simultaneously transmitted to the dwell event identification module and the cargo type inference module for use in subsequent steps.

[0065] The stop event identification module is used to detect stop events, classify multiple types of stop events, and extract the origin and destination of freight trips from the valid trajectory dataset output by the data quality processing module. It generates a sequence of origin and destination pairs labeled with stop event types, corresponding to the function in step S2 above. The stop event identification module includes a stop event detection submodule, a stop event type classification submodule, and an origin and destination extraction submodule. The stop event type classification submodule integrates semantic features of the stop location, load and speed changes before and after the stop, and stop duration distribution features. It outputs a type label for each valid stop event through a multi-feature Bayesian classification mechanism, identifying five types: loading stop, unloading stop, refueling stop, driver rest stop, and other stops. The origin and destination pair sequence with stop event type labels output by the stop event identification module is then passed to the cargo type inference module.

[0066] The cargo category inference module infers the cargo category from the origin-endpoint pair sequence output by the dwell event recognition module, generating an origin-endpoint pair sequence with cargo category labels and corresponding posterior probability values, thus performing the function described in step S3 above. Internally, the cargo category inference module comprises an origin-endpoint semantic chain feature extraction submodule, a driving behavior pattern feature extraction submodule, and a historical trip association submodule. The feature outputs from these three submodules are fused and calculated, and a classifier outputs the posterior probability distribution of each candidate cargo category. The cargo category with the highest posterior probability is used as the final cargo category label. The cargo category inference module also receives the quality assessment results from the data quality processing module, which are used to correct the confidence level of the extracted behavioral features. The origin-endpoint pair sequence with cargo category labels output by the cargo category inference module is then transmitted to the flow statistics and early warning module.

[0067] The flow statistics and early warning module is used to perform multi-dimensional aggregation statistics on the origin-end point sequences of the goods category tags output by the goods category inference module, generate flow direction analysis results, and continuously perform time series anomaly detection and hierarchical early warning, corresponding to the functions of steps S4 and S5 mentioned above. The flow statistics and early warning module includes a multi-dimensional aggregation statistics submodule and an anomaly detection submodule. The multi-dimensional aggregation statistics submodule supports flexible aggregation by combination of spatial partition granularity, time window granularity, and goods category dimension. The anomaly detection submodule establishes normal fluctuation ranges based on historical data from the same period and uses a three-level early warning signal mechanism to respond hierarchically to flow anomaly events. The early warning signal is output to an external regulatory platform or decision support system through a standardized data interface.

[0068] In this embodiment of the invention, the data flow between the modules of the above system is as follows: the output of the data quality processing module flows simultaneously to the dwell event identification module (effective trajectory dataset) and the cargo category inference module (quality assessment results); the output of the dwell event identification module flows to the cargo category inference module; the output of the cargo category inference module flows to the statistics and early warning module; the final output of the statistics and early warning module is written to the analysis result repository and made available to external systems through the data interface. The data flow relationship between the above modules constitutes an end-to-end closed processing link. While executing the core function of its own module, each module passes intermediate calculation results as parameters to subsequent modules, ensuring that the entire system can fully utilize the information accumulated in the preceding steps at every stage of data processing.

[0069] The steps in the method of this invention can be adjusted, combined, or deleted according to actual needs.

[0070] The modules or sub-modules in the device of this invention can be merged, divided, or deleted according to actual needs.

[0071] The modules or sub-modules described in the embodiments of the present invention can be implemented by general-purpose integrated circuits, such as central processing units, or by application-specific integrated circuits.

[0072] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory, or random access memory, etc.

[0073] The above provides a detailed description of the cargo flow direction analysis method and system based on trajectory big data provided by the embodiments of the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

[0074] Second embodiment: The trajectory completion algorithm based on road network topology involved in step S1 of Embodiment 1 will be described in detail.

[0075] Please see Figure 3 , Figure 3This is a flowchart illustrating the freight trajectory completion method based on road network topology disclosed in an embodiment of the present invention. Embodiment two of the present invention provides a detailed description of the "trajectory completion algorithm based on road network topology" described in step S1 of embodiment one. For example... Figure 3 As shown, the trajectory completion method may include the following steps: Figure 3 The demonstration shows the complete processing flow of the trajectory completion method, including four core steps: interruption detection, road network candidate path generation, optimal path selection, and completion point insertion.

[0076] In this embodiment of the invention, when the adaptive cleaning submodule in step S1 performs corrective processing on the trajectory data, it employs a trajectory completion algorithm based on road network topology for signal interruption noise. The triggering condition for this algorithm is: after evaluation based on the sampling integrity dimension, there is a signal interruption segment in the trajectory time series, and the duration of the interruption is greater than the minimum effective interruption duration threshold (set to 30 seconds in this embodiment) and less than the maximum completeable interruption duration threshold (set to 15 minutes in this embodiment). When the interruption duration is less than 30 seconds, the interruption is considered a brief signal jitter of the device, and linear interpolation is directly used to uniformly insert completion trajectory points between the interruption start and end points, without executing the road network topology matching process; when the interruption duration exceeds 15 minutes, because it is impossible to reasonably infer the vehicle's actual driving path during the interruption, the trajectory is cut into two independent sub-trajectories at the interruption point, which enter the subsequent processing flow separately, without performing a completion operation. Both threshold parameters (30 seconds and 15 minutes) can be adjusted in the system configuration file according to the actual data scenario.

[0077] In this embodiment of the invention, for signal interruption segments with an interruption duration between 30 seconds and 15 minutes, the trajectory completion algorithm based on road network topology is executed according to the following steps.

[0078] First, the algorithm takes the interruption start point (i.e., the last valid trajectory point before the interruption, denoted as interruption point A) and the interruption end point (i.e., the first valid trajectory point after the interruption, denoted as interruption point B) as inputs. It then performs map matching between the latitude and longitude coordinates of interruption point A and interruption point B and the road network data, respectively, to obtain the nearest matching road segment node (denoted as node a) for interruption point A and the nearest matching road segment node (denoted as node b) for interruption point B on the road network. During map matching, the matching search radius is set to 50 meters. When multiple road segments exist within the search radius, the road segment with the smallest angle to the preceding driving direction of the interruption is selected for matching first, to ensure the consistency between the road network matching result and the actual driving direction of the vehicle.

[0079] Secondly, starting from node a and ending at node b, the improved Dijkstra algorithm is used to calculate the top K shortest paths from node a to node b on the road network topology map (K is set to 5 by default in this embodiment). Each candidate path consists of several road segment sequences. Regarding the setting of road segment weights, this embodiment does not simply use road segment length as the weight, but rather a weighted combination of road segment length and estimated travel time. The estimated travel time is obtained by dividing the road segment length by the reference speed corresponding to that road segment type. Specific reference speeds are set according to road grade: 90 km / h for highways, 60 km / h for national and provincial highways, 40 km / h for urban arterial roads, and 30 km / h for other roads. All of the above reference speeds can be adjusted by system configuration. Freight vehicle trajectories have a natural preference for high-grade roads; this weight design makes the candidate paths generated by the algorithm statistically closer to the actual path selection patterns of freight vehicles.

[0080] Next, the top K candidate paths are comprehensively scored to select the optimal completion path. The comprehensive score is constrained and verified from the following two dimensions: The first dimension is speed reasonableness constraint: the estimated average speed of each candidate path is obtained by dividing the total length of the road segment by the duration of the interruption. If the estimated average speed exceeds the maximum achievable speed of freight vehicles (150 km / h) or is lower than the reasonable minimum driving speed (5 km / h), the candidate path is directly excluded and does not participate in subsequent scoring. The second dimension is driving direction continuity constraint: the angle between the direction vector of the starting segment of the candidate path and the preceding driving direction vector of the breakpoint A, and the angle between the direction vector of the ending segment of the candidate path and the subsequent driving direction vector of the breakpoint B are calculated. If either angle exceeds 90 degrees, the candidate path is considered a path with a sudden change in direction and is excluded. Among the candidate paths filtered through these two constraints, the one with the smallest sum of road segment weights is selected as the optimal completion path. When all K candidate paths fail to pass the double constraints, the algorithm degrades to direct cutting, which means cutting the trajectory into two independent sub-trajectories at the break point, without performing the completion operation, and recording the degraded event in the trajectory metadata for verification.

[0081] Finally, complete trajectory points are inserted sequentially along the optimal completion path. The spatial coordinates of the complete trajectory points are taken from the latitude and longitude coordinates of each node of the optimal completion path. The timestamps of the complete trajectory points are calculated as follows: based on the interruption start timestamp, the time for vehicles to pass through each node is estimated proportionally according to the length of each segment and the reference speed of the corresponding road type. The timestamps of each complete point are accumulated segment by segment to ensure that the sequence of timestamps of complete points monotonically increases between the timestamps of breakpoint A and breakpoint B. Complete trajectory points are distinguished by a completion marker field in the trajectory data structure to ensure that subsequent analysis steps can identify the source differences between the original collection points and the completed generation points.

[0082] Third embodiment: The adaptive weight coefficient adjustment mechanism involved in step S1 of Embodiment 1 will be explained in detail.

[0083] In this embodiment of the invention, when the quality assessment submodule in step S1 performs multi-dimensional quality assessment on trajectory data, the weight coefficients of each assessment dimension are not fixed, but are adaptively adjusted by the system based on the overall quality of the current batch of data. The specific adjustment mechanism is as follows: After the initial sampling and statistical analysis of trajectory data in each batch is completed, the system calculates the average score of each of the four assessment dimensions in the current batch. When the average score of a certain dimension is lower than 70% of the historical benchmark average for that dimension, the system determines that there is a systematic quality decline in that dimension in the current batch (e.g., a collective decrease in positioning accuracy after a firmware upgrade of a data access device). At this time, the weight coefficient of that dimension is automatically increased to more sensitively identify such quality problems in the comprehensive quality score. Conversely, when the average score of a certain dimension is consistently higher than 95% of the historical benchmark average, the system appropriately decreases the weight coefficient of that dimension, tilting the scoring discrimination towards other dimensions. The adjustment range of the above weight coefficients is limited to 0.5 to 2 times the initial value to prevent excessive expansion of the weight of a single dimension from distorting the comprehensive score. The historical adjustment records of the weight coefficients are stored in the system log, supporting manual review and intervention.

[0084] It should be noted that the adaptive weighting coefficient adjustment mechanism was designed to address the data quality instability inherent in the access of multi-source heterogeneous data during actual operation. While the fixed weighting coefficient scheme performs adequately in scenarios with a single data source and stable data quality, significant differences arise when accessing data from multiple brands and versions of in-vehicle devices. These differences in firmware status, installation location deviations, and signal obstruction mean that the main manifestations of quality issues change with device batches and usage cycles. The adaptive weighting mechanism enables the quality assessment system to self-awareness of data quality drift, maintaining the effectiveness of the scoring system without frequent manual intervention.

[0085] Fourth embodiment: The parameters and training mechanism of the Bayesian classifier involved in the dwell event type classification submodule in step S2 of Example 1 are explained in detail.

[0086] In this embodiment of the invention, the Bayesian classifier used in the dwell event type classification submodule uses the historical statistical distribution of each dwell event type as the prior probability, and the observed values ​​of three types of features (semantic features of dwell location, features of load and speed changes, and features of dwell duration distribution) as the input of the likelihood function, outputting the posterior probability of each type. The initial values ​​of the classifier's prior probabilities are set based on the statistical results of a large-scale freight trajectory labeled sample set. The initial reference values ​​of the prior probabilities for each type are as follows: loading dwell accounts for approximately 28% of all valid dwell events, unloading dwell accounts for approximately 26%, refueling dwell accounts for approximately 18%, driver rest dwell accounts for approximately 20%, and other dwells account for approximately 8%. The above initial values ​​of prior probabilities can be adjusted according to specific regions or specific transportation business scenarios during system deployment. For example, in a business scenario mainly based on long-distance trunk transportation, the prior probability of driver rest dwell should be appropriately increased.

[0087] In this embodiment of the invention, the duration distribution parameters for each type of stopover event are set as follows, based on the characteristics of the stopover duration: the typical duration distribution of refueling stopovers is concentrated in the range of 15 to 30 minutes, with a distribution pattern approximating a normal distribution, a mean of 22 minutes, and a standard deviation of 8 minutes; the typical duration distribution of driver rest stopovers covers the range of 30 minutes to 8 hours, and because it includes both short rests and overnight parking, the distribution pattern exhibits a bimodal structure, with the two peak centers set at 45 minutes and 6.5 hours, respectively; the duration distribution of loading and unloading stopovers varies greatly due to differences in cargo type and quantity, with a coverage range of 20 minutes to 4 hours, and a distribution pattern approximating an exponential distribution, with a mean of 75 minutes. All of the above distribution parameters support automatic updates through an online learning mechanism after the system accumulates a sufficient amount of locally labeled data, to adapt to the actual stopover duration patterns in specific regions or specific transportation scenarios.

[0088] It should be noted that the embodiments of this invention employ different probability distribution models (normal distribution, bimodal distribution, and exponential distribution) for the duration distribution of each type of stopover event, rather than applying the same distribution form to all types. This distinction is based on actual statistical observations of large-scale freight trajectory data. Refueling stops are determined by the physical process of refueling operations, and their duration is relatively concentrated; a normal distribution is a reasonable approximation. Driver rest stops in practice are clearly divided into two modes: "short rests" and "long-term parking rests," and a bimodal structure faithfully describes this phenomenon. Loading and unloading stops are affected by multiple factors such as cargo type, cargo volume, and the degree of mechanization in loading and unloading; the duration distribution has a longer right tail, and an exponential distribution provides a better fit in this case. Selecting a probability model that conforms to the actual distribution pattern of each type is an important prerequisite for ensuring the accuracy of the likelihood function estimation of the Bayesian classifier.

[0089] It should be understood that the terms “comprising” and “including” used in this disclosure and claims indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0090] It should also be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the disclosure. As used in this disclosure and claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this disclosure and claims means any combination and all possible combinations of one or more of the associated listed items, and includes such combinations; 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 any specific implementation. 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 method for analyzing cargo flow direction based on trajectory big data, characterized in that, Includes the following steps: Collect and assess the quality of multi-source heterogeneous freight trajectory data, classify the trajectory data according to the quality assessment results, and generate a valid trajectory dataset and the quality assessment results for each trajectory. The system detects and classifies dwell events in the valid trajectory dataset, extracts the start and end points of freight trips based on the classification results, and generates a sequence of start and end point pairs with dwell event type labels. For each pair of origin and destination in the origin-destination pair sequence, infer the product category and generate a sequence of origin-destination pairs with product category labels; The origin and destination pairs of product-related tags are aggregated and statistically analyzed in multiple dimensions according to spatial partitioning granularity, time window granularity, and product category dimension to generate traffic flow analysis results. Time series anomaly detection is performed on the flow direction analysis results, and graded early warning signals are generated and output to external systems.

2. The method for analyzing cargo flow direction based on trajectory big data according to claim 1, characterized in that, The hierarchical processing includes: Trajectories with an overall quality score higher than the excellent threshold are directly included in the valid trajectory dataset; trajectories with an overall quality score between the repair threshold and the excellent threshold undergo repair processing, which includes smoothing drift coordinate points, completing signal interruption segments, and removing abrupt change points and refitting local trajectory segments; trajectories with an overall quality score lower than the repair threshold are discarded entirely.

3. The method for analyzing cargo flow direction based on trajectory big data according to claim 2, characterized in that, The signal interruption segment completion uses a trajectory completion algorithm based on road network topology. The algorithm is executed when the signal interruption duration is greater than 30 seconds and less than 15 minutes. For interruption segments with a signal interruption duration of less than 30 seconds, linear interpolation is used to insert completion trajectory points. For signal interruptions lasting more than 15 minutes, the trajectory is cut into two independent sub-trajectories at the point of interruption. For signal interruption segments that meet the execution conditions, the last valid trajectory point before the interruption and the first valid trajectory point after the interruption are matched to road network nodes respectively. The improved Dijkstra algorithm is called to calculate the first K candidate paths. The candidate paths are subject to dual screening of speed rationality constraints and driving direction continuity constraints. The candidate path with the smallest sum of road segment weights among the screened candidate paths is taken as the optimal completion path. The completion trajectory points are inserted along the optimal completion path and the timestamp of each completion point is calculated.

4. The method for analyzing cargo flow direction based on trajectory big data according to claim 1, characterized in that, The quality assessment is conducted from four dimensions: positioning accuracy, speed rationality, road segment connectivity, and sampling integrity. The comprehensive quality score of each trajectory is obtained by weighted summation of the assessment results of the four dimensions. The weight coefficients of each dimension are adaptively adjusted based on the comparison between the average score of each dimension in the current batch of data and the historical benchmark mean, with the adjustment range limited to 0.5 to 2 times the initial value. The quality assessment results are transmitted to the cargo category inference step along with the effective trajectory dataset to correct the confidence weight of the driving behavior pattern features.

5. The method for analyzing cargo flow direction based on trajectory big data according to claim 1, characterized in that, The type classification of the stop events uses a Bayesian classifier. Based on the semantic features of the stop location, the speed and load changes before and after the stop, and the distribution features of the stop duration, the posterior probability of each valid stop event is determined. The type with the highest posterior probability is taken as the type label of the stop event. The type labels include five types: loading stop, unloading stop, refueling stop, driver rest stop, and other stops. The location of a valid stop event with the type label of loading stop is identified as the start point of the corresponding trip, and the location of a valid stop event with the type label of unloading stop is identified as the end point of the corresponding trip. Trajectory segments that do not match the type labels of loading stop or unloading stop at either end are marked as transit segments.

6. The method for analyzing cargo flow direction based on trajectory big data according to claim 5, characterized in that, The initial values ​​of the prior probabilities for each dwell event type in the Bayesian classifier are set as follows: Loading stops accounted for 28%, unloading stops for 26%, refueling stops for 18%, driver rest stops for 20%, and other stops for 8%. Regarding the duration of these stops, the refueling stop duration distribution approximates a normal distribution, with a mean of 22 minutes and a standard deviation of 8 minutes. The driver rest stop duration distribution exhibits a bimodal structure, with the two peak centers set at 45 minutes and 6.5 hours, respectively. The loading and unloading stop duration distributions approximate an exponential distribution, with a mean of 75 minutes. These distribution parameters can be automatically updated through an online learning mechanism.

7. The method for analyzing cargo flow direction based on trajectory big data according to claim 1, characterized in that, The cargo category inference obtains the confidence vector of each candidate cargo category from three feature levels: origin-destination semantic chain features, driving behavior pattern features, and historical itinerary association features. The comprehensive confidence vector is obtained by weighted summation of the three confidence vectors. The fusion weights corresponding to the three feature levels are 0.5, 0.35, and 0.15, respectively. Historical trip association features are obtained by querying the historical trip record database with the vehicle's unique identifier as the key. The query time range is the past 30 days. The records of each type of cargo in the historical trip are weighted in an exponential decay manner, and the half-life is set to 7 days. When the input data of a certain feature level is missing, the fusion weight of that feature level is reset to zero and redistributed to the other feature levels proportionally.

8. The method for analyzing cargo flow direction based on trajectory big data according to claim 1, characterized in that, The estimated freight volume in the flow direction analysis results is obtained through the following method: The vehicle's rated load capacity is obtained using its unique identifier as an index. When vehicle file information is missing, the default reference value of the rated load capacity corresponding to the cargo category label is used instead. When load sensor data is available, the loading rate is estimated based on the ratio of the actual load weight collected by the sensor to the vehicle's rated load capacity. When load sensor data is unavailable, the loading rate is assigned based on the event type labels at both the origin and destination ends. The estimated cargo weight is obtained by multiplying the vehicle's rated load capacity and the estimated loading rate. The estimated freight volume is obtained by multiplying the estimated cargo weight and the actual travel distance.

9. The method for analyzing cargo flow direction based on trajectory big data according to claim 1, characterized in that, The time series anomaly detection uses the STL decomposition algorithm, which uses data from 52 natural weeks of the same historical period as a benchmark to decompose the historical flow series into trend components, periodic components and residual components. The periodic window parameter is set to 13 and the trend window parameter is set to 25. Based on the calculation of the mean and standard deviation of the residual component series, the normal fluctuation range is determined by adding or subtracting 3 times the standard deviation from the mean. When the residual component sequence does not satisfy the normal distribution assumption, the 5th percentile to the 95th percentile of the residual component sequence is taken as the normal fluctuation range; The tiered early warning signals include: a Level 1 early warning signal is generated when the actual flow rate deviates from the historical baseline value by more than 30%, a Level 2 early warning signal is generated when it exceeds 60%, and a Level 3 early warning signal is generated when it exceeds 100%.

10. A cargo flow direction analysis system based on trajectory big data, characterized in that, include: The data quality processing module is used to collect, assess and classify multi-source heterogeneous freight trajectory data, generate a valid trajectory dataset and a quality assessment result for each trajectory, and transmit the valid trajectory dataset and quality assessment result to the dwell event recognition module and the cargo type inference module, respectively. The dwell event recognition module is used to detect dwell events, classify types, and extract origin and destination points from the valid trajectory dataset, generate a sequence of origin and destination pairs with dwell event type labels, and pass the origin and destination pair sequence to the cargo category inference module; The cargo category inference module is used to receive the origin-end point pair sequence with dwell event type labels and quality assessment results, perform cargo category inference, generate the origin-end point pair sequence with cargo category labels and corresponding posterior probability values, and transmit the origin-end point pair sequence with cargo category labels to the flow statistics and early warning module. The flow statistics and early warning module is used to perform multi-dimensional aggregation statistics on the start and end point sequences of product-related tags, generate flow direction analysis results, perform time series anomaly detection on the flow direction analysis results, and generate hierarchical early warning signals to output to external systems.

Citation Information

Patent Citations

  • CN113945958B