A training method and device of a waybill track verification model, and a verification method and device
By using a waybill trajectory verification model, which combines the trajectory vector angle and the difference of auxiliary parameters with a multilayer perceptron neural network, the problem of automating and reducing the cost of consistency judgment between waybill and truck trajectory data is solved, and fast and accurate matching verification is achieved.
Patent Information
- Application Number
- CN202410849311.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2044-06-27
AI Technical Summary
Existing technologies cannot quickly, automatically, and cost-effectively determine the consistency between waybill data and actual highway travel trajectory data of trucks, resulting in problems such as different trajectory directions, reversals, and unreasonable durations.
A waybill trajectory verification model is adopted. By calculating the angle between trajectory vectors and the difference of auxiliary parameters, the local and global features of trajectory index data are extracted using a multilayer perceptron neural network with residuals, so as to realize the automatic matching and verification of waybill data and actual highway trajectory data of trucks.
It achieves automated matching and verification of waybill data and actual highway trajectory data of trucks, reduces computing costs, can quickly and accurately determine consistency in the case of large amounts of data, and has a fast analysis speed with results obtained within milliseconds.
Smart Images

Figure CN118982304B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of freight data management technology, and in particular to a training method, verification method and device for a waybill trajectory verification model. Background Technology
[0002] With the development of the company's online freight credit business, we are seeking to explore ways to support the construction of a freight credit system by verifying a large amount of highway-related waybill data. Existing technology has limitations in automatically determining the consistency between the origin and destination addresses of the waybill planned by the map provider and the actual highway travel trajectory. Issues such as different directions, reversals, and unreasonable durations exist between the two trajectories.
[0003] Traditional trajectory analysis methods include manual observation and comparing the attributes of segmented trajectory data to analyze the consistency of multiple trajectories. Manual observation has the following drawbacks: First, it has a limited analytical scope, especially with multiple or large numbers of trajectories. Second, it is slow, requiring significant manpower to observe the trajectory data; processing speed varies from person to person, but is never as fast as machine processing. Analyzing trajectory consistency by comparing the attributes of segmented trajectory data has the following drawbacks: First, determining thresholds is complex; comparing data attributes requires considering multiple attribute thresholds, and with large datasets, a fixed and limited set of thresholds cannot accurately determine the results. Second, it has high computational costs; this method requires calculating and comparing the attributes of a large number of trajectory points, leading to a massive computational burden when the trajectories are long or numerous.
[0004] Therefore, there is an urgent need for an efficient and automated scheme to match and verify waybill data with the corresponding truck's actual highway travel trajectory data. Summary of the Invention
[0005] In view of this, embodiments of the present invention provide a training method, verification method and apparatus for a waybill trajectory verification model, so as to eliminate or improve one or more defects existing in the prior art, and solve the problem that the prior art cannot quickly, automatically and cost-effectively verify the consistency between waybill data and actual high-speed trajectory data of trucks.
[0006] One aspect of the present invention provides a training method for a waybill trajectory verification model, the method comprising the following steps:
[0007] A training sample set is obtained, comprising multiple samples. Each sample contains waybill data provided by a freight company and actual highway travel trajectory data of the truck provided by the corresponding highway trading platform. The waybill data includes the waybill start position, waybill end position, and a first auxiliary parameter including the waybill start time and waybill end time. The actual highway travel trajectory data of the truck includes the location of the toll station at the entrance / exit, the location of the gantry, and a second auxiliary parameter including the time spent at the toll station at the entrance / exit and the time spent at the gantry. A label is added to indicate whether the waybill data and the actual highway travel trajectory data of the truck match. Both the first and second auxiliary parameters include cargo information, vehicle information, and toll information.
[0008] Calculate the first trajectory vector corresponding to the waybill data, calculate the second trajectory vector corresponding to the actual highway travel trajectory data of the truck, and calculate the angle between the trajectory vectors corresponding to the first trajectory vector and the second trajectory vector for each sample; subtract the first auxiliary parameter and the second auxiliary parameter, and establish the attribute feature difference vector between each trajectory point; connect the trajectory vector angle corresponding to each sample and the attribute feature difference vector to obtain trajectory tensor data;
[0009] An initial neural network model is obtained, comprising a batch normalization input module, a residual-based multilayer perceptron feature extraction module, and a classification output module. The multilayer perceptron feature extraction module comprises multiple serial multilayer perceptron networks with residuals, with the input and output ends of each multilayer perceptron network being skip-connected. The initial neural network model takes the trajectory tensor data corresponding to each sample as input and outputs a predicted value that determines whether the waybill data and the actual highway trajectory data of the truck match.
[0010] The initial neural network model is trained using the trajectory tensor data corresponding to each sample in the training sample set. A loss function is constructed using the predicted value and the label of each sample. The parameters of the initial neural network model are updated based on the loss function to obtain the waybill trajectory verification model.
[0011] In some embodiments, a first trajectory vector of the waybill data is calculated, and a second trajectory vector of the actual highway travel trajectory data of the truck is calculated, using the following formula:
[0012] ;
[0013] Among them, T iX represents the longitude of a single trajectory vector, Y represents the latitude of a trajectory point, i represents the sequence number of the trajectory point, and n represents the total number of trajectory points in a trajectory. When calculating the first trajectory vector, the trajectory points only include the start position and end position of the waybill. When calculating the second trajectory vector, the trajectory points include the exit toll station position and the transit gantry position.
[0014] In some embodiments, the angle between the trajectory vectors corresponding to the first trajectory vector and the second trajectory vector for each sample is calculated, and the expression is:
[0015] ;
[0016] Where angle represents the angle between the trajectory vectors, t1 represents the first trajectory vector, and t2 represents the second trajectory vector.
[0017] In some embodiments, the data processing expression of the batch normalization input module is:
[0018] ;
[0019] Where fb represents the output result, x represents the input feature vector, E[x] represents the mean of each input feature vector, and Var[x] represents the variance of each input feature vector. γ is a constant, and β are hyperparameters.
[0020] In some embodiments, the multilayer perceptron network includes: an input layer, at least one hidden layer, and an output layer, wherein each hidden layer uses ReLU as the activation function; a residual connection is established between the front end of the output layer and the back end of the output layer;
[0021] The hidden layer of the multilayer perceptron network introduces a batch normalization layer for regularization.
[0022] In some embodiments, the loss function is the cross-entropy loss, calculated as follows:
[0023] ;
[0024] Where k represents the number of samples, y i p represents the actual label of the i-th sample. i This represents the predicted probability of the i-th sample for the label;
[0025] Training the initial neural network model using trajectory tensor data corresponding to each sample in the training sample set further includes: dividing the training sample set into a training set, a validation set, and a test set according to a set ratio; the training set is used to train and adjust the parameters of the initial neural network model; the validation set is used to evaluate the performance of the waybill trajectory verification model during the training process to select the optimal model and hyperparameters; and the test set is used to finally evaluate the generalization ability of the waybill trajectory verification model.
[0026] The method of updating the parameters of the initial neural network model based on the loss function further includes: updating the parameters using the adaptive momentum optimization algorithm Adam; and updating the parameters according to a set number of iterations, setting the initial learning rate to 0.0001 and the weight decay to 0.0005.
[0027] On the other hand, the present invention also provides a method for verifying waybill trajectories, the method comprising the following steps:
[0028] The system acquires the waybill data to be analyzed for the target task provided by the freight company and the actual highway trajectory data of the corresponding trucks to be analyzed for the target task provided by the highway trading platform. The waybill data to be analyzed includes the start and end positions of the waybill for the target task, as well as a first auxiliary parameter to be analyzed, which includes the start and end times of the waybill. The actual highway trajectory data of the trucks to be analyzed includes the locations of the toll stations at the entrance and exit, the gantries passed through, and a second auxiliary parameter to be analyzed, which includes the time spent passing through the toll stations at the entrance and exit and the time spent passing through the gantries. Both the first and second auxiliary parameters to be analyzed include cargo information, vehicle information, and toll information.
[0029] Calculate the first trajectory vector corresponding to the waybill data to be analyzed, calculate the second trajectory vector corresponding to the actual highway travel trajectory data of the truck to be analyzed, and calculate the angle between the first and second trajectory vectors for each sample; subtract the first and second auxiliary parameters to be analyzed, and establish the attribute feature difference vector between each trajectory point; connect the angle between the trajectory vectors to be analyzed and the attribute feature difference vector to obtain the trajectory tensor data to be analyzed.
[0030] The tensor data of the trajectory to be analyzed is input into the waybill trajectory verification model in the training method of the waybill trajectory verification model, and the judgment result of whether the waybill data to be analyzed and the actual highway trajectory data of the truck to be analyzed match is output.
[0031] In some implementations, the method further includes:
[0032] Create a log file to store the judgment results of multiple target tasks regarding whether the data of the waybill to be analyzed and the actual highway trajectory data of the truck to be analyzed match, and create an index for backtracking query;
[0033] Additionally, a pre-loaded alarm rules module is used to generate an alarm prompt and send it to a designated port according to a preset link when it is determined that the data of the waybill to be analyzed and the actual highway trajectory data of the truck to be analyzed do not match.
[0034] On the other hand, the present invention also provides a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implement the steps of the above-described method.
[0035] On the other hand, the present invention also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the above-described method.
[0036] The beneficial effects of the present invention are at least as follows:
[0037] The training method, verification method, and apparatus for the waybill trajectory verification model described in this invention vectorize the waybill data provided by freight companies and the actual highway travel trajectory data of trucks provided by a highway trading platform. The angle between the trajectory vectors is calculated, and the difference between the auxiliary parameters is calculated. The trajectory tensor data is then obtained by concatenating the trajectory vector angle and the difference between the auxiliary parameters. A neural network model is trained, employing a multilayer perceptron neural network with residuals, which has strong local feature extraction capabilities, to extract local features from the trajectory indicator data. Finally, a fully connected layer with global perception capabilities is used to extract global features from the trajectory indicator data to obtain verification results, achieving automated matching and verification of waybill data and actual highway travel trajectory data of trucks. The model input data does not require comparing and calculating a large amount of trajectory point data; only the vector angle between the start and end trajectory points and some travel transaction trajectory points needs to be calculated, reducing computational costs. Even with large amounts of data, it can still accurately extract data features, maintaining analysis speed and providing results within milliseconds.
[0038] Additional advantages, objects, and features of the invention will be set forth in part in the description which follows, and will also become apparent in part to those skilled in the art upon studying the description, or may be learned by practice of the invention. The objects and other advantages of the invention can be realized and obtained by means of the structures specifically pointed out in the description and drawings.
[0039] Those skilled in the art will understand that the objectives and advantages achievable with the present invention are not limited to those specifically described above, and that the above and other objectives achievable with the present invention will become clearer from the following detailed description. Attached Figure Description
[0040] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, are not intended to limit the scope of the invention. In the drawings:
[0041] Figure 1 This is a model structure diagram of the training method for the waybill trajectory verification model according to an embodiment of the present invention.
[0042] Figure 2 for Figure 1 A schematic diagram of the residual connection-based multilayer perceptron network structure within the feature extraction module of a multilayer perceptron. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the embodiments and accompanying drawings. Here, the illustrative embodiments and descriptions of this invention are used to explain the invention, but are not intended to limit the invention.
[0044] It should also be noted that, in order to avoid obscuring the invention with unnecessary details, only the structures and / or processing steps closely related to the solution according to the invention are shown in the accompanying drawings, while other details that are not closely related to the invention are omitted.
[0045] It should be emphasized that the term "including / comprises" as used herein refers to the presence of a feature, element, step, or component, but does not exclude the presence or addition of one or more other features, elements, steps, or components.
[0046] It should also be noted that, unless otherwise specified, the term "connection" in this article can refer not only to a direct connection, but also to an indirect connection involving an intermediary.
[0047] In operational scenarios, freight companies need to formulate waybills based on target tasks and combine this with the actual highway route trajectories of trucks for transaction settlement, violation verification, route planning, and credit evaluation. Waybill data can be defined as orders generated by freight companies based on customer task requirements, used to mark reachable trajectories planned for transportation needs. The actual highway route trajectories of trucks are the trajectories formed by transport vehicles during actual transportation, mainly provided by highway transaction platforms. For example, during a truck's journey on a highway, roadside units at entrance toll stations, ETC transaction gantry systems, and exit toll stations interact with onboard units to record travel time, forming the actual highway route trajectory data of the truck. Existing technologies have limitations in automatically determining the consistency between the reachable trajectories of the waybills planned by map providers and the actual highway route trajectories. Issues such as different directions, reversals, and unreasonable durations exist between the two trajectories.
[0048] This application presents an algorithm based on residuals and a multilayer perceptron neural network to verify the consistency between the planned origin and destination trajectories of freight trucks and their actual highway travel trajectories. First, relevant indicators between the planned freight truck trajectories and highway travel trajectories are calculated using methods such as vector and distance difference. Then, a multilayer perceptron neural network with residuals, which has strong local feature extraction capabilities, is used to extract local features from the trajectory indicator data. Finally, a fully connected layer with global perception capabilities is used to extract global features from the trajectory indicator data to obtain the verification results.
[0049] Specifically, the present invention provides a training method for a waybill trajectory verification model, the method comprising the following steps S101~S104:
[0050] Step S101: Obtain the training sample set, which includes multiple samples. Each sample contains waybill data provided by a freight company and actual highway travel trajectory data of the truck provided by the corresponding highway trading platform. The waybill data includes the waybill start position, waybill end position, and a first auxiliary parameter including the waybill start time and waybill end time. The actual highway travel trajectory data of the truck includes the location of the entrance and exit toll stations, the location of the gantries, and a second auxiliary parameter including the time of passage through the entrance and exit toll stations and the time of passage through the gantries. Add a label to indicate whether the waybill data and the actual highway travel trajectory data of the truck match. Both the first and second auxiliary parameters include cargo information, vehicle information, and toll information.
[0051] Step S102: Calculate the first trajectory vector corresponding to the waybill data, calculate the second trajectory vector corresponding to the actual highway travel trajectory data of the truck, and calculate the angle between the first and second trajectory vectors for each sample; subtract the first and second auxiliary parameters and establish the attribute feature difference vector between each trajectory point; connect the trajectory vector angle and the attribute feature difference vector corresponding to each sample to obtain the trajectory tensor data.
[0052] Step S103: Obtain the initial neural network model, which includes a batch normalization input module, a residual-based multilayer perceptron feature extraction module, and a classification output module. The multilayer perceptron feature extraction module includes multiple serial multilayer perceptron networks with residuals, and the input and output ends of each multilayer perceptron network are skipped. The initial neural network model takes the trajectory tensor data corresponding to each sample as input and outputs a predicted value that determines whether the waybill data and the actual highway trajectory data of the truck match.
[0053] Step S104: Train the initial neural network model using the trajectory tensor data corresponding to each sample in the training sample set, construct a loss function using the predicted value and label of each sample, update the parameters of the initial neural network model based on the loss function, and obtain the waybill trajectory verification model.
[0054] In step S101, the training sample set is generated based on historical data. The waybill start position, waybill end position, exit toll station position, and gantry position are all marked using latitude and longitude coordinates. Alternatively, a separate coordinate system can be established to mark the positions of each trajectory point within the spatial range. Waybill data primarily records freight demand, typically only recording the waybill start and end positions. However, the actual highway trajectory data of trucks records the trajectory based on gantry systems set up along the route, in addition to the toll stations at highway entrances and exits. Besides the location information and arrival time of the corresponding trajectory points, the waybill data and the actual highway trajectory data of trucks also record other freight-related information, including a first auxiliary parameter and a second auxiliary parameter for recording other freight information. These two parts should be consistent, including items such as cargo information, vehicle information, and toll information. This part of the data is calculated by freight companies based on waybill demand, using existing rules and planned routes.
[0055] The cargo information may include cargo name (description or name of the cargo), cargo type (such as general cargo, dangerous goods, refrigerated cargo, etc.), cargo weight (total weight of the cargo), cargo volume (total volume of the cargo), cargo quantity (unit quantity of the cargo), packaging type (packaging method of the cargo, such as boxed, bulk, etc.), cargo value (market value of the cargo, used for insurance premium calculation, etc.), place of shipment (origin of the cargo), destination (final delivery location of the cargo), cargo identification (such as barcode, used to identify the cargo), mode of transport (mode of transport of the cargo, such as road, rail, waterway, etc.), and special handling requirements (such as special requirements such as refrigeration, reinforcement, etc.).
[0056] Vehicle information includes license plate number (vehicle registration number), vehicle type (e.g., light truck, large truck, container truck, etc.), number of axles (the number of axles on the vehicle, affecting the toll standard), cargo box type (e.g., flatbed truck, van, refrigerated truck, etc.), total vehicle weight (the total weight of the vehicle, including empty weight and load), axle load (the load capacity of each axle), vehicle dimensions (length, width, height, etc., affecting tolls and bridge passability), owner information (the name and contact information of the vehicle owner, etc.), vehicle identification number (VIN, the unique identifier of the vehicle), operating documents (the vehicle's operating permits and other document information), and environmental labels (e.g., green label vehicles, yellow label vehicles, affecting the passage area and tolls).
[0057] The toll information includes toll rate (toll standard, calculated based on kilometers, vehicle type, number of axles, etc.), travel distance (distance traveled by the vehicle), total toll cost (total cost calculated based on the toll rate and distance), toll discount (e.g., whether there are discounts for membership cards, discount cards, etc.), surcharges (e.g., oversized transport fees, large cargo transport fees, etc.), toll period (the time period for which the fee applies, which may differ between peak and off-peak periods), toll section (specific toll section information), payment method (e.g., cash, credit card, electronic payment, etc.), invoice information (invoice or receipt number, date, etc.), passage record (passage time, toll station number, lane number, etc.), and settlement information (billing number, payment status, etc.).
[0058] All of the above information constitutes the complete data required for truck transaction billing, credit evaluation, and operation management. It can meet the reference and comparison requirements when evaluating the authenticity of the match between waybill data and actual highway travel trajectory data of trucks.
[0059] In step S102, the waybill data and the actual highway trajectory data of the trucks in step S101 are converted into a different format to meet the requirements of subsequent processing.
[0060] In some embodiments, a first trajectory vector of the waybill data is calculated, and a second trajectory vector of the actual highway travel trajectory data of the truck is calculated, using the following formula:
[0061] ;
[0062] Among them, T i X represents the longitude of a single trajectory vector, Y represents the latitude of a trajectory point, i represents the sequence number of the trajectory point, and n represents the total number of trajectory points in a trajectory. When calculating the first trajectory vector, the trajectory points only include the start and end positions of the waybill. When calculating the second trajectory vector, the trajectory points include the exit toll station position and the passing gantry position.
[0063] In some embodiments, the angle between the trajectory vectors corresponding to the first trajectory vector and the second trajectory vector for each sample is calculated, and the expression is:
[0064] ;
[0065] Where angle represents the angle between the trajectory vectors, t1 represents the first trajectory vector, and t2 represents the second trajectory vector.
[0066] In some embodiments, the difference between the first and second auxiliary parameters is calculated, and an attribute feature difference vector is established between each trajectory point, expressed as:
[0067] ;
[0068] in, This represents the difference corresponding to the i-th type of auxiliary parameter. This represents the value of the i-th type of auxiliary parameter in the first auxiliary parameter set. This represents the value of the i-th type of auxiliary parameter in the second auxiliary parameter set.
[0069] The trajectory tensor data is obtained by concatenating the angle between the trajectory vectors corresponding to each sample and the attribute feature difference vector, which can be expressed as follows: .
[0070] In step S103, the main function of the initial neural network model is to standardize the input trajectory tensor data to improve training efficiency and stability. Batch Normalization (BN) enables the model to maintain a consistent distribution across different training batches, thereby accelerating convergence and improving the model's generalization ability.
[0071] The steps of batch normalization include: calculating the mean for each batch of data, calculating the variance for each batch of data, subtracting the mean from the data and then dividing by the standard deviation, and applying learnable scaling and offset parameters.
[0072] In some embodiments, the data processing expression of the batch normalization input module is:
[0073] ;
[0074] Where fb represents the output result, x represents the input feature vector, E[x] represents the mean of each input feature vector, and Var[x] represents the variance of each input feature vector. γ is a constant, and β are hyperparameters.
[0075] The residual-based multilayer perceptron (MLP) feature extraction module extracts features from the input trajectory tensor through a series of MLP networks with residual connections. Residual connections effectively alleviate the vanishing gradient problem and facilitate the training of deeper networks. This module consists of multiple sequential MLP networks with residual connections. Each MLP network contains one or more fully connected layers, activation functions, and residual skip connections. The structure is as follows: the input layer receives the output of the previous network module or the original input data; the fully connected layers perform linear transformations; the activation function layers apply nonlinear transformations (such as ReLU or Leaky ReLU); and the residual connections add the input and output.
[0076] In some embodiments, the multilayer perceptron network includes: an input layer, at least one hidden layer, and an output layer, wherein each hidden layer uses ReLU as the activation function; and a residual connection is established between the front end of the output layer and the back end of the output layer.
[0077] The hidden layers of the multilayer perceptron network are normalized by the batching normalization layer;
[0078] The classification output module maps the output of the feature extraction module to predicted values for classification (match, non-match, or suspected). This module includes a fully connected layer and an activation function (such as softmax) to map the extracted features to the classification probability output.
[0079] In the neural network employed in this invention, batch normalization improves training stability and convergence speed while reducing internal covariate bias. Residual connections effectively alleviate the vanishing gradient problem in deep networks, allowing the model to learn deeper features. The hierarchical feature extraction MLP network can extract features at different levels layer by layer, adapting to complex trajectory data.
[0080] In step S104, the loss function is the cross-entropy loss, calculated as follows:
[0081] ;
[0082] Where k represents the number of samples, y i p represents the actual label of the i-th sample. i This represents the predicted probability of the i-th sample for the label;
[0083] Furthermore, training the initial neural network model using trajectory tensor data corresponding to each sample in the training sample set also includes: dividing the training sample set into a training set, a validation set, and a test set according to a set ratio; the training set is used to train and adjust the parameters of the initial neural network model; the validation set is used to evaluate the performance of the waybill trajectory verification model during the training process in order to select the optimal model and hyperparameters; and the test set is used to finally evaluate the generalization ability of the waybill trajectory verification model.
[0084] The method for updating the parameters of the initial neural network model based on the loss function also includes: updating the parameters using the adaptive momentum optimization algorithm Adam; and updating the parameters according to a set number of iterations, setting the initial learning rate to 0.0001 and the weight decay to 0.0005.
[0085] On the other hand, the present invention also provides a method for verifying waybill trajectories, the method comprising the following steps S201~S203:
[0086] Step S201: Obtain the waybill data to be analyzed for the target task provided by the freight company and the actual highway trajectory data of the trucks corresponding to the target task provided by the highway trading platform; the waybill data to be analyzed includes the start position and end position of the waybill for the target task, as well as the first auxiliary parameter to be analyzed, which includes the start time and end time of the waybill; the actual highway trajectory data of the trucks to be analyzed includes the location of the entrance and exit toll stations, the location of the gantries, as well as the second auxiliary parameter to be analyzed, which includes the time spent at the entrance and exit toll stations and the time spent at the gantries; both the first and second auxiliary parameters to be analyzed include cargo information, vehicle information, and toll information.
[0087] Step S202: Calculate the first trajectory vector to be analyzed corresponding to the waybill data to be analyzed, calculate the second trajectory vector to be analyzed corresponding to the actual highway trajectory data of the truck to be analyzed, and calculate the angle between the first and second trajectory vectors to be analyzed for each sample; subtract the first and second auxiliary parameters to be analyzed, and establish the difference vector of the attribute features to be analyzed between each trajectory point; connect the angle between the trajectory vectors to be analyzed and the difference vector of the attribute features to be analyzed to obtain the trajectory tensor data to be analyzed.
[0088] Step S203: Input the tensor data of the trajectory to be analyzed into the waybill trajectory verification model in the training method of the waybill trajectory verification model described in steps S101 to S104, and output the judgment result of whether the waybill data to be analyzed and the actual highway trajectory data of the truck to be analyzed match.
[0089] In some implementations, the method further includes step S204: establishing a log file to store the judgment results of multiple target tasks regarding whether the data of the waybill to be analyzed and the actual highway trajectory data of the truck to be analyzed match, and establishing an index for backtracking query;
[0090] And step S205: preload alarm rules module, which is used to generate alarm prompts and send them to the designated port according to the preset link when it is determined that the data of the waybill to be analyzed and the actual highway trajectory data of the truck to be analyzed do not match.
[0091] On the other hand, the present invention also provides a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implement the steps of the above-described method.
[0092] On the other hand, the present invention also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the above-described method.
[0093] The present invention will now be described with reference to a specific embodiment:
[0094] This embodiment proposes a method for verifying the trajectory of freight truck waybills, including the following steps:
[0095] (1) Obtain waybill trajectory and truck highway passage transaction trajectory data, perform preprocessing, and construct waybill trajectory dataset: Obtain waybill and truck highway passage transaction data from the waybill uploaded by the freight company and the toll road passage transaction platform respectively. The waybill data includes the waybill start address, end address, cargo transportation start time, cargo arrival end time, etc. The truck highway passage data includes attributes such as the toll station name and the time of entering and exiting the highway. Based on the highway passage transaction data, remove the truck waybill data that has not undergone highway transactions. Convert the waybill start address, end address, and toll station name into latitude and longitude trajectory point data through the map merchant interface. Calculate the vector angle between the two trajectories based on the latitude and longitude trajectory data.
[0096] 1.1 Calculate the vector for each individual trajectory:
[0097] ;
[0098] Among them, T i X represents a single trajectory vector, Y represents the latitude of a trajectory point, i represents the index of the trajectory point, and n represents the total number of trajectory points in a trajectory.
[0099] 1.2 Calculate the angle between the vectors formed by the two trajectories:
[0100] ;
[0101] Where angle represents the angle between the trajectory vectors, t1 represents the trajectory vector corresponding to the waybill data, and t2 represents the trajectory vector corresponding to the truck passage highway transaction data.
[0102] The interpolation operation is performed on the auxiliary parameters other than the trajectory, and the calculation formula is as follows:
[0103] ;
[0104] in, This represents the difference corresponding to the i-th type of auxiliary parameter. This represents the value of the i-th type of auxiliary parameter in the waybill data. This represents the value of the i-th type of auxiliary parameter in the highway toll transaction data for trucks.
[0105] The trajectory tensor data is obtained by concatenating the angle between the trajectory vectors corresponding to each sample and the attribute feature difference vector, which can be expressed as follows: 'n' represents the total number of attribute parameters of a trajectory. Of the trajectory tensor data corresponding to all samples, 70% is used as the training set, 10% as the validation set, and 20% as the test set.
[0106] (2) Construct a waybill trajectory verification model:
[0107] The model includes a batch normalization input module and a residual-based multilayer perceptron feature extraction module, wherein:
[0108] The batch normalization input module includes a normalization feature processing network;
[0109] The residual-based multilayer perceptron feature extraction module consists of 10 serial multilayer perceptron networks with residuals.
[0110] The output of the batch normalization input module is connected to the input of the residual-based multilayer perceptron feature extraction module. Each multilayer perceptron network has a residual jump connection at both its input and output.
[0111] (3) Use the waybill trajectory dataset constructed in step (1) to perform multiple rounds of iterative training on the trajectory verification model constructed in step (2).
[0112] (3.1) Set the number of iterations to t (t>=100), initialize the learning rate to 0.0001, control the weight decay to 0.0005, and initialize the parameters of the network model.
[0113] (3.2) The training dataset train is used as the input of the normalization input module to obtain the normalized feature D1 of the waybill trajectory dataset.
[0114] (3.3) Input the normalized feature D1 of the waybill trajectory dataset into the feature extraction module of the residual-based multilayer perceptron to obtain the residual perception feature D2 of the waybill trajectory.
[0115] (3.4) Input the residual perception feature D2 of the waybill trajectory into the classifier to obtain the classification prediction label y of each waybill in the training sample dataset train.
[0116] (3.5) Employing the cross-entropy loss function Calculate the difference between the predicted label y and the true label y'.
[0117] (3.6) The adaptive momentum optimization algorithm adam is used to update the network model parameters to obtain a trained network model N.
[0118] (3.7) Input the validation dataset into the network N and determine whether the recognition accuracy is greater than the previous recognition accuracy A. If it is greater, save the network model N; otherwise, discard it.
[0119] (3.8) Repeat steps (3.2) to (3.7) to obtain the final trained network model N.
[0120] (3.9) Use the trajectory verification model trained in step (3) to identify the authenticity of the waybill.
[0121] The test sample dataset 'test' is input into the trained waybill verification model N for forward inference, and the authenticity of the waybills in the 'test' dataset (credible waybill, untrustworthy waybill, suspected waybill) is output.
[0122] (4) The specific structure of the batch normalization input module in step (2) is as follows:
[0123] The input module has 6 input units and 16 output units. The network update process is represented as follows:
[0124] ;
[0125] Where fb represents the output result, x represents the input feature vector, E[x] represents the mean of each input feature vector, and Var[x] represents the variance of each input feature vector. ϵ is a constant, and it is a very small value, such as 10. -5 , is used to ensure that the distribution is not zero; γ and β are hyperparameters used to scale and translate the normalized data.
[0126] The residual-based multilayer perceptron feature extraction module consists of 10 serial multilayer perceptron networks with residuals.
[0127] The multilayer perceptron network described above uses 96 hidden units as filters for feature extraction and ReLU as the activation function to pass the acquired features to subsequent networks.
[0128] The residuals, connected by straight lines, directly pass the input features of the previous layer to the output of the residual block, achieved through addition operations, as shown below:
[0129] ;
[0130] Among them, f c This represents the output of a multilayer perceptron network with residuals, where x is the input feature vector and seq(x) is the residual.
[0131] In step (3.4), the residual sensing feature D2 of the waybill trajectory is first fed into a linear fully connected layer for computation, resulting in the final output vector R of the network model:
[0132] ;
[0133] Among them, W rLet R be the parameter matrix of the linear fully connected layer. Then, input the output vector R into the softmax function to calculate the probability value P for each condition.
[0134] ;
[0135] Among them, R i This represents the vector value when the category is i; finally, the maximum value of the probability vector P is obtained by taking the first dimension, which contains the recognition result y for each category. i :
[0136] ;
[0137] Here, dim represents the dimension or axis, and is used to define the shape of the tensor.
[0138] Corresponding to the above method, the present invention also provides an apparatus / system including a computer device, the computer device including a processor and a memory, the memory storing computer instructions, the processor executing the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the apparatus / system performs the steps of the method as described above.
[0139] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the aforementioned edge computing server deployment method. The computer-readable storage medium can be a tangible storage medium, such as random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, floppy disks, hard disks, removable storage disks, CD-ROMs, or any other form of storage medium known in the art.
[0140] In summary, the training method, verification method, and apparatus for the waybill trajectory verification model of this invention vectorize the waybill data provided by freight companies and the actual highway travel trajectory data of trucks provided by highway trading platforms, calculate the angle between the trajectory vectors, calculate the difference between the auxiliary parameters, and then connect the trajectory vector angle and the difference between the auxiliary parameters to obtain trajectory tensor data. By training a neural network model, a multilayer perceptron neural network with residuals, which has strong local feature extraction capabilities, is used to extract local features from the trajectory index data. Finally, a fully connected layer with global perception capabilities is used to extract global features from the trajectory index data to obtain verification results, achieving automated matching and verification judgment of waybill data and actual highway travel trajectory data of trucks. The model input data does not require comparison and calculation of a large amount of trajectory point data; only the vector angle between the start and end trajectory points and some travel transaction trajectory points needs to be calculated, reducing computational costs. Even with large amounts of data, it can still accurately extract data features, maintain analysis speed, and obtain results within milliseconds.
[0141] Those skilled in the art will understand that the exemplary components, systems, and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Whether implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention. When implemented in hardware, it can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this invention are programs or code segments used to perform the desired tasks. The programs or code segments can be stored in a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried in a carrier wave.
[0142] It should be clarified that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of the present invention.
[0143] In this invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or in place of features of other embodiments.
[0144] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations of the embodiments of the present invention are possible. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A training method for a waybill trajectory verification model, characterized in that, The method includes the following steps: A training sample set is obtained, comprising multiple samples. Each sample contains waybill data provided by a freight company and actual highway travel trajectory data of the truck provided by the corresponding highway trading platform. The waybill data includes the waybill start position, waybill end position, and a first auxiliary parameter including the waybill start time and waybill end time. The actual highway travel trajectory data of the truck includes the location of the toll station at the entrance / exit, the location of the gantry, and a second auxiliary parameter including the time spent at the toll station at the entrance / exit and the time spent at the gantry. A label is added to indicate whether the waybill data and the actual highway travel trajectory data of the truck match. Both the first and second auxiliary parameters include cargo information, vehicle information, and toll information. Calculate the first trajectory vector corresponding to the waybill data, calculate the second trajectory vector corresponding to the actual highway travel trajectory data of the truck, and calculate the angle between the trajectory vectors corresponding to the first trajectory vector and the second trajectory vector for each sample; subtract the first auxiliary parameter and the second auxiliary parameter, and establish the attribute feature difference vector between each trajectory point; connect the trajectory vector angle corresponding to each sample and the attribute feature difference vector to obtain trajectory tensor data; An initial neural network model is obtained, comprising a batch normalization input module, a residual-based multilayer perceptron feature extraction module, and a classification output module. The multilayer perceptron feature extraction module comprises multiple serial multilayer perceptron networks with residuals, with the input and output ends of each multilayer perceptron network being skip-connected. The initial neural network model takes the trajectory tensor data corresponding to each sample as input and outputs a predicted value that determines whether the waybill data and the actual highway trajectory data of the truck match. The initial neural network model is trained using the trajectory tensor data corresponding to each sample in the training sample set. The predicted value and the label value of each sample are input into the loss function. The parameters of the initial neural network model are updated based on the loss function to obtain the waybill trajectory verification model.
2. The training method for the waybill trajectory verification model according to claim 1, characterized in that, The first trajectory vector of the waybill data is calculated, and the second trajectory vector of the actual highway travel trajectory data of the truck is calculated using the following formula: ; Among them, T i X represents the longitude of a single trajectory vector, Y represents the latitude of a trajectory point, i represents the sequence number of the trajectory point, and n represents the total number of trajectory points in a trajectory. When calculating the first trajectory vector, the trajectory points only include the start position and end position of the waybill. When calculating the second trajectory vector, the trajectory points include the exit toll station position and the transit gantry position.
3. The training method for the waybill trajectory verification model according to claim 1, characterized in that, Calculate the angle between the trajectory vectors corresponding to the first trajectory vector and the second trajectory vector for each sample, expressed as: ; Where angle represents the angle between the trajectory vectors, t1 represents the first trajectory vector, and t2 represents the second trajectory vector.
4. The training method for the waybill trajectory verification model according to claim 1, characterized in that, The data processing procedure expression for the batch normalization input module is as follows: ; Where fb represents the output result, x represents the input feature vector, E[x] represents the mean of each input feature vector, and Var[x] represents the variance of each input feature vector. is a constant, and γ and β are hyperparameters.
5. The training method for the waybill trajectory verification model according to claim 1, characterized in that, The multilayer perceptron network includes: an input layer, at least one hidden layer, and an output layer, wherein each hidden layer uses ReLU as the activation function; a residual connection is established between the front end of the output layer and the back end of the output layer. The hidden layer of the multilayer perceptron network is regularized by the batch normalization layer.
6. The training method for the waybill trajectory verification model according to claim 1, characterized in that, The loss function is the cross-entropy loss, calculated as follows: Where k represents the number of samples, y i p represents the actual label of the i-th sample. i This represents the predicted probability of the i-th sample for the label; Training the initial neural network model using trajectory tensor data corresponding to each sample in the training sample set further includes: dividing the training sample set into a training set, a validation set, and a test set according to a set ratio; the training set is used to train and adjust the parameters of the initial neural network model; the validation set is used to evaluate the performance of the waybill trajectory verification model during the training process to select the optimal model and hyperparameters; and the test set is used to finally evaluate the generalization ability of the waybill trajectory verification model. The method of updating the parameters of the initial neural network model based on the loss function further includes: updating the parameters using the adaptive momentum optimization algorithm Adam; and updating the parameters according to a set number of iterations, setting the initial learning rate to 0.0001 and the weight decay to 0.0005.
7. A method for verifying waybill trajectories, characterized in that, The method includes the following steps: The system acquires the waybill data to be analyzed for the target task provided by the freight company and the actual highway trajectory data of the corresponding trucks to be analyzed for the target task provided by the highway trading platform. The waybill data to be analyzed includes the start and end positions of the waybill for the target task, as well as a first auxiliary parameter to be analyzed, which includes the start and end times of the waybill. The actual highway trajectory data of the trucks to be analyzed includes the locations of the toll stations at the entrance and exit, the gantries passed through, and a second auxiliary parameter to be analyzed, which includes the time spent passing through the toll stations at the entrance and exit and the time spent passing through the gantries. Both the first and second auxiliary parameters to be analyzed include cargo information, vehicle information, and toll information. Calculate the first trajectory vector corresponding to the waybill data to be analyzed, calculate the second trajectory vector corresponding to the actual highway travel trajectory data of the truck to be analyzed, and calculate the angle between the first and second trajectory vectors for each sample; subtract the first and second auxiliary parameters to be analyzed, and establish the attribute feature difference vector between each trajectory point; connect the angle between the trajectory vectors to be analyzed and the attribute feature difference vector to obtain the trajectory tensor data to be analyzed. The tensor data of the trajectory to be analyzed is input into the waybill trajectory verification model in the training method of the waybill trajectory verification model according to any one of claims 1 to 6, and the judgment result of whether the waybill data to be analyzed and the actual highway trajectory data of the truck to be analyzed match is output.
8. The method for verifying waybill trajectories according to claim 7, characterized in that, The method further includes: Create a log file to store the judgment results of multiple target tasks regarding whether the data of the waybill to be analyzed and the actual highway trajectory data of the truck to be analyzed match, and create an index for backtracking query; Additionally, a pre-loaded alarm rules module is used to generate an alarm prompt and send it to a designated port according to a preset link when it is determined that the data of the waybill to be analyzed and the actual highway trajectory data of the truck to be analyzed do not match.
9. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method as described in any one of claims 1 to 8.
10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Target trajectory recognition method based on residual network and attention mechanism
CN115048870A
Drosophila melanogaster flight path classification method based on spatial features and structural features
CN118070118A