Training method, verification method and device of waybill track verification model
By calculating the angle and attribute difference of waybill and truck trajectory vectors, and using a multi-layer perceptron neural network model, the automation and high cost of judgment of matching consistency of waybill and truck trajectory data in the existing technology is solved, and fast and accurate verified judgment.
Patent Information
- Application Number
- CN202410849311.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2044-06-27
AI Technical Summary
The prior art cannot quickly and automatically and at low cost to judge the consistency between waybill data and truck actual traffic high-speed trajectory data, resulting in high calculation costs and slow processing speed.
By obtaining the training sample set, calculating the angles and attribute characteristics difference between the waybill and truck trajectory vectors, using a multi-layer perceptron neural network model with residuals for training, outputting whether the matching predicted value is matched, and automatic verification judgment is achieved.
It reduces the calculation cost, improves the processing speed, and can accurately extract features when the data volume is large. The results are derived in milliseconds, realizing the automatic matching and truth-testing judgment of waybills and truck trajectory data.
Smart Images

Figure CN118982304A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of freight data management, and in particular to a training method, a verification method and a device for a waybill track verification model. Background Art
[0002] With the development of the company's online freight credit business, we seek to explore the construction of a freight credit system by verifying a large amount of highway-related waybill data. The existing technology cannot automatically determine the consistency between the reachable trajectory of the waybill start and end addresses of the truck planned by the map vendor and the actual highway trajectory. The two trajectories have problems such as different directions, return, and unreasonable duration.
[0003] Traditional trajectory analysis methods include analyzing the consistency of multiple trajectories by manual viewing and by comparing the attributes of segmented trajectory data. Analyzing trajectory consistency by manual viewing has the following disadvantages: First, the analysis range is small. When there are multiple trajectories or a large number of trajectories, the analysis range is small. Second, the processing speed is slow, and a lot of manpower is needed to view the trajectory data. The processing speed varies from person to person, but none of them is as fast as the machine processing speed. The disadvantages of analyzing trajectory consistency by comparing the attributes of segmented trajectory data include: First, it is complicated to determine the threshold. When comparing data attributes, it is necessary to compare based on multiple attribute thresholds of the data. When the amount of data is large, a fixed and small number of thresholds cannot accurately judge the result. Second, the computational cost is high. This method needs to calculate and compare a large number of trajectory point attributes, which will result in a huge amount of calculation when the trajectory is long or the number of trajectories is large.
[0004] Therefore, there is an urgent need for an efficient and automated solution to match and verify waybill data with the actual high-speed trajectory data of the corresponding trucks. Summary of the invention
[0005] In view of this, the embodiments of the present invention provide a training method, a verification method and a device for a waybill trajectory verification model to eliminate or improve one or more defects existing in the prior art, so as to solve the problem that the prior art cannot quickly, automatically and cost-effectively verify the consistency of the matching between waybill data and the actual high-speed trajectory data of trucks.
[0006] One aspect of the present invention provides a method for training a waybill track verification model, the method comprising the following steps:
[0007] A training sample set is obtained, wherein the training sample set includes a plurality of samples, each sample includes waybill data provided by a freight enterprise and actual high-speed track data of a truck provided by a corresponding high-speed trading platform; the waybill data includes a waybill start position, a waybill end position, and a first subsidiary parameter including the waybill start time and the waybill end time; the actual high-speed track data of the truck includes an import and export toll station position, a gantry position, and a second subsidiary parameter including the import and export toll station pass time and the gantry pass time, and a label is added to mark whether the waybill data and the actual high-speed track data of the truck match each other; the first subsidiary parameter and the second subsidiary parameter both include cargo information, vehicle information, and fee information;
[0008] Calculate the first trajectory vector corresponding to the waybill data, calculate the second trajectory vector corresponding to the actual high-speed trajectory data of the truck, and calculate the trajectory vector angle between the first trajectory vector and the second trajectory vector corresponding to each sample; subtract the first auxiliary parameter from 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] Acquire an initial neural network model, the initial neural network model 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 a plurality of serial multilayer perceptron networks with residuals, and the input and output ends of each multilayer perceptron network are jump-connected; the initial neural network model takes the trajectory tensor data corresponding to each sample as input, and outputs a prediction value for judging whether the waybill data and the actual high-speed trajectory data of the truck match each other;
[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, and the parameters of the initial neural network model are updated based on the loss function to obtain a waybill trajectory verification model.
[0011] In some embodiments, the first trajectory vector of the waybill data is calculated, and the second trajectory vector of the actual high-speed trajectory data of the truck is calculated, and the calculation formula is:
[0012]
[0013] Among them, T irepresents a single trajectory vector, X represents the longitude of the trajectory point, Y represents the latitude of the 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 single starting position and the waybill ending position; when calculating the second trajectory vector, the trajectory points include the exit toll station position and the passing gantry position.
[0014] In some embodiments, the trajectory vector angle between the first trajectory vector and the second trajectory vector corresponding to each sample is calculated, and the expression is:
[0015]
[0016] Wherein, angle represents the trajectory vector angle, t1 represents the first trajectory vector, and t2 represents the second trajectory vector.
[0017] In some embodiments, the data processing process of the batch normalization input module is expressed as:
[0018]
[0019] Among them, fb represents the output result, x represents the input eigenvector, E[x] represents the mean of each input eigenvector, Var[x] represents the variance of each input eigenvector, ∈ is a constant, and γ and β are hyperparameters.
[0020] In some embodiments, the multi-layer perceptron network includes: an input layer, at least one hidden layer and an output layer, each hidden layer uses relu as an activation function; a front end of the output layer establishes a residual connection with a back end of the output layer;
[0021] The hidden layer of the multi-layer perceptron network is regularized by introducing a batch normalization layer;
[0022] In some embodiments, the loss function is a cross entropy loss, calculated as:
[0023]
[0024] Among them, k represents the number of samples, y i represents the actual label of the i-th sample, p i Represents the predicted probability of the i-th sample for the label;
[0025] The initial neural network model is trained using the trajectory tensor data corresponding to each sample in the training sample set, and further includes: dividing the training sample set into a training set, a validation set and a test set according to a set ratio, wherein 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] Updating the parameters of the initial neural network model based on the loss function also includes: using an adaptive momentum optimization algorithm adam to update the parameters; and updating the parameters according to a set number of iterations, setting the initialization learning rate to 0.0001, and setting the weight decay to 0.0005.
[0027] On the other hand, the present invention also provides a waybill track verification method, the method comprising the following steps:
[0028] Obtain the waybill data to be analyzed of the target task provided by the freight enterprise and the actual high-speed track data of the truck to be analyzed corresponding to the target task provided by the high-speed trading platform; the waybill data to be analyzed includes the waybill start position and the waybill end position of the target task, and the first subsidiary parameter to be analyzed including the waybill start time and the waybill end time; the actual high-speed track data of the truck to be analyzed includes the import and export toll station position, the gantry position, and the second subsidiary parameter to be analyzed including the import and export toll station passing time and the gantry passing time; the first subsidiary parameter to be analyzed and the second subsidiary parameter to be analyzed both include cargo information, vehicle information, and fee information;
[0029] 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 high-speed trajectory data of the truck to be analyzed, and calculate the trajectory vector angle to be analyzed corresponding to the first trajectory vector to be analyzed and the second trajectory vector to be analyzed for each sample; subtract the first subsidiary parameter to be analyzed from the second subsidiary parameter to be analyzed, and establish the attribute feature difference vector to be analyzed between each trajectory point; connect the trajectory vector angle to be analyzed and the attribute feature difference vector to be analyzed to obtain the trajectory tensor data to be analyzed;
[0030] The trajectory tensor data to be analyzed is input into the waybill trajectory verification model in the training method of the waybill trajectory verification model, and a judgment result of whether the waybill data to be analyzed and the actual high-speed trajectory data of the truck to be analyzed match each other is output.
[0031] In some implementations, the method further comprises:
[0032] Establishing a log file to store the judgment results of the target tasks on whether the waybill data to be analyzed and the actual high-speed trajectory data of the truck to be analyzed match each other, and establishing an index for backtracking query;
[0033] And, a preloaded alarm rule module is used to generate an alarm prompt and send it to the designated port according to the preset link when it is determined that the waybill data to be analyzed and the actual high-speed trajectory data of the truck to be analyzed do not match each other.
[0034] On the other hand, the present invention further provides a computer-readable storage medium having a computer program / instruction stored thereon, which implements the steps of the above method when the computer program / instruction is executed by a processor.
[0035] On the other hand, the present invention also provides a computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the above method.
[0036] The beneficial effects of the present invention are at least:
[0037] The training method, verification method and device of the waybill trajectory verification model of the present invention vectorize the waybill data provided by the freight company and the actual high-speed trajectory data of the truck provided by the high-speed transaction platform, calculate the trajectory vector angle, and after calculating the difference of the auxiliary parameters, connect the trajectory vector angle and the auxiliary parameter difference to obtain the trajectory tensor data. By training the neural network model, a multi-layer perceptron neural network with residuals with strong local feature extraction capabilities is used to extract local features in the trajectory index data; finally, a fully connected layer with global perception capabilities is used to extract global features in the trajectory index data to obtain verification results, so as to realize automatic matching and verification judgment of the waybill data and the actual high-speed trajectory data of the truck. The data input to the model does not need to compare and calculate a large amount of trajectory point data, but only needs to calculate the vector angles of the start and end trajectory points and some of the passing transaction trajectory points, which reduces the calculation cost. In the case of large data volume, data features can still be accurately extracted, the analysis speed is maintained, and the results can be obtained within milliseconds.
[0038] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically indicated in the specification and the accompanying drawings.
[0039] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of the present application, and do not constitute a limitation of the present invention. In the drawings:
[0041] Figure 1 This is a model structure diagram used in the training method of the waybill track verification model described in one embodiment of the present invention.
[0042] Figure 2 for Figure 1 Schematic diagram of the multilayer perceptron network structure based on residual connections in the multilayer perceptron feature extraction module. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0044] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.
[0045] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, 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” herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.
[0047] In the operation scenario, freight companies need to prepare waybills based on target tasks, and conduct transaction settlement, violation verification, route planning, credit evaluation and other tasks in combination with the actual high-speed path trajectory of trucks. Waybill data can be defined as orders generated by freight companies based on customer task requirements, which are used to mark the reachable trajectory planned for transportation needs. The actual high-speed trajectory of trucks is the trajectory formed by the transport vehicle during the actual transportation process, which is mainly provided by the high-speed transaction platform. For example, when a truck is driving on the highway, the roadside unit set up at the entrance toll station, ETC transaction gantry system and exit toll station interacts with the on-board unit to record the travel time and form the actual high-speed trajectory data of the truck. The existing technology cannot automatically determine the consistency between the reachable trajectory of the starting and ending addresses of the waybill planned by the map vendor and the actual high-speed trajectory of the truck. The two trajectories have problems such as different directions, return, and unreasonable duration.
[0048] This application designs an algorithm based on residuals and multi-layer perceptron neural networks, aiming to verify the consistency between the reachable trajectory of the truck's waybill start and end addresses after being planned by the map vendor and the actual high-speed trajectory. First, the relevant indicators of the planned trajectory of the truck waybill and the high-speed trajectory are calculated by vector, distance difference and other methods; then, a multi-layer perceptron neural network with residuals with strong local feature extraction capabilities is used to extract local features in the trajectory indicator data; finally, a fully connected layer with global perception capabilities is used to extract global features in the trajectory indicator data to obtain verification results.
[0049] Specifically, the present invention provides a method for training a waybill track verification model, the method comprising the following steps S101 to S104:
[0050] Step S101: Obtain a training sample set, the training sample set includes multiple samples, each sample includes waybill data provided by a freight company and actual high-speed track data of the truck provided by the corresponding high-speed trading platform; the waybill data includes the waybill starting position, the waybill ending position, and the first subsidiary parameter including the waybill starting time and the waybill ending time, the truck's actual high-speed track data includes the import and export toll station position, the gantry position and the second subsidiary parameter including the import and export toll station passing time and the gantry passing time, and a label is added to mark whether the waybill data and the truck's actual high-speed track data match each other; the first subsidiary parameter and the second subsidiary parameter both include cargo information, vehicle information, and fee information.
[0051] Step S102: Calculate the first trajectory vector corresponding to the waybill data, calculate the second trajectory vector corresponding to the actual high-speed trajectory data of the truck, and calculate the trajectory vector angle between the first trajectory vector and the second trajectory vector corresponding to each sample; subtract the first auxiliary parameter from the second auxiliary parameter, 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 an 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 a plurality of serial multilayer perceptron networks with residuals, and the input and output ends of each multilayer perceptron network are jump-connected; the initial neural network model takes the trajectory tensor data corresponding to each sample as input, and outputs a prediction value for judging whether the waybill data and the actual high-speed trajectory data of the truck match each other.
[0053] Step S104: Use the trajectory tensor data corresponding to each sample in the training sample set to train the initial neural network model, construct a loss function with the predicted value and label of each sample, update the parameters of the initial neural network model based on the loss function, and obtain a waybill trajectory verification model.
[0054] In step S101, the training sample set is generated based on historical existing data, wherein the waybill starting position, waybill ending position, exit toll station position, and gantry position are all marked with longitude and latitude coordinates, and a position coordinate system can also be established separately to mark the position of each track point within the spatial range. Waybill data is mainly used to record freight demand, and usually only records the waybill starting position and waybill ending position, while the actual high-speed trajectory data of trucks, in addition to the import and export toll stations during the high-speed passage, also records the trajectory based on the gantry system set up in the middle section of the path. In addition to the location information and arrival time of the corresponding trajectory points, the waybill data and the actual high-speed trajectory data of trucks also record other freight-related information, and also include a first subsidiary parameter and a second subsidiary parameter for recording other freight information. These two parts of the content items should be consistent, such as cargo information, vehicle information, and fee information. This part of the data is calculated by freight companies based on waybill demand using existing rules and planned routes.
[0055] Among them, cargo information may include cargo name (description or name of the cargo), cargo type (such as ordinary 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 box packaging, bulk packaging, etc.), cargo value (market value of the cargo, used for premium calculation, etc.), shipping place (the origin of the cargo), destination (the final delivery place of the cargo), cargo identification (such as barcode, used to identify the cargo), transportation method (transportation method of the cargo, such as road, rail, water transportation, etc.), special handling requirements (such as special requirements such as refrigeration and reinforcement).
[0056] Vehicle information includes license plate number (vehicle registration number), vehicle model (such as small truck, large truck, container truck, etc.), number of axles (the number of axles of the vehicle, which affects the charging standards), vehicle body type (such as flatbed trucks, vans, refrigerated trucks, etc.), gross vehicle weight (total weight of the vehicle, including empty weight and loaded weight), axle load (load capacity of each axle), vehicle dimensions (length, width, height, etc., which affect tolls and bridge passability), owner information (name, contact information, etc. of the vehicle owner), vehicle identification number (VIN, the vehicle's unique identification code), operating documents (document information such as the vehicle's operating license), and environmental protection signs (such as green-label vehicles and yellow-label vehicles, which affect the passage area and fees).
[0057] The fee information includes toll rate (charging standard, calculated based on mileage, vehicle type, number of axles, etc.), travel distance (distance traveled by the vehicle), total toll (total toll calculated based on rate and distance), rate discount (such as whether there is a membership card, discount card, etc.), surcharges (such as overload transportation fees, large-item transportation fees, etc.), charging time (the time period when the fees are applicable, which may differ between peak and non-peak periods), toll section (specific toll section information), payment method (such as cash, credit card, electronic payment, etc.), ticket information (invoice or receipt number, date, etc.), travel record (passing time, toll station number, lane number, etc.), settlement information (bill 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 comparison requirements when evaluating the authenticity of whether the waybill data and the actual high-speed trajectory data of the truck match each other.
[0059] In step S102, the waybill data in step S101 and the actual high-speed track data of the truck are converted into a certain format to meet the requirements of subsequent processing.
[0060] In some embodiments, the first trajectory vector of the waybill data is calculated, and the second trajectory vector of the actual high-speed trajectory data of the truck is calculated, and the calculation formula is:
[0061]
[0062] Among them, T i Represents a single trajectory vector, X represents the longitude of the trajectory point, Y represents the latitude of the 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 single starting position and the waybill ending position; 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 trajectory vector angle between the first trajectory vector and the second trajectory vector corresponding to each sample is calculated, and the expression is:
[0064]
[0065] Wherein, angle represents the trajectory vector angle, t1 represents the first trajectory vector, and t2 represents the second trajectory vector.
[0066] In some embodiments, the first auxiliary parameter is subtracted from the second auxiliary parameter, and an attribute feature difference vector between each trajectory point is established, and the expression is:
[0067] X i =C1 i -C2i ;
[0068] Among them, X i represents the difference corresponding to the i-th type of subsidiary parameters, C1 i represents the value of the i-th type of auxiliary parameter in the first auxiliary parameter, C2 i Represents the value of the i-th type of subsidiary parameter in the second subsidiary parameter.
[0069] The trajectory vector angle and attribute feature difference vector corresponding to each sample are connected to obtain the trajectory tensor data, which can be expressed as [angle,X1,X2,...Xn].
[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) can keep the model consistent in distribution across different training batches, thereby accelerating convergence and improving the generalization ability of the model.
[0071] The steps of batch normalization include: calculating the mean of each batch of data, calculating the variance of each batch of data, subtracting the mean from the data and dividing it by the standard deviation, and applying learnable scaling and offset parameters.
[0072] In some embodiments, the data processing process of the batch normalization input module is expressed as:
[0073]
[0074] Among them, fb represents the output result, x represents the input eigenvector, E[x] represents the mean of each input eigenvector, Var[x] represents the variance of each input eigenvector, ∈ is a constant, and γ and β are hyperparameters.
[0075] The residual-based multi-layer perceptron (MLP) feature extraction module extracts the features of the input trajectory tensor through a series of multi-layer perceptron (MLP) networks with residual connections. Residual connections can effectively alleviate the gradient vanishing problem and promote the training of deeper networks. This module consists of multiple serial MLP networks with residuals. Each MLP network contains one or more fully connected layers, activation functions, and residual jump connections. The structure is as follows: the input layer receives the output or original input data of the previous network module, the fully connected layer performs linear transformation, the activation function layer applies nonlinear transformation (such as ReLU, Leaky ReLU), and the residual connection adds the input to the output.
[0076] In some embodiments, the multilayer perceptron network includes: an input layer, at least one hidden layer and an output layer, each hidden layer uses relu as an activation function; a front end of the output layer establishes a residual connection with a back end of the output layer;
[0077] The hidden layers of the multi-layer perceptron network are regularized using a batch normalization layer;
[0078] The classification output module maps the output of the feature extraction module to a predicted value for classification (match, mismatch, or suspected). This module includes a fully connected layer and an activation function (such as softmax) to map the extracted features to the probability output of the classification.
[0079] In the neural network adopted by the present invention, batch normalization improves the stability and convergence speed of training and reduces the internal covariate shift. The residual connection effectively alleviates the gradient vanishing problem in the deep network, allowing the model to learn deeper features. The MLP network of hierarchical feature extraction can extract features of different levels layer by layer and adapt to complex trajectory data.
[0080] In step S104, the loss function is the cross entropy loss, and the calculation formula is:
[0081]
[0082] Among them, k represents the number of samples, y i represents the actual label of the i-th sample, p i Represents the predicted probability of the i-th sample for the label;
[0083] Furthermore, the initial neural network model is trained using trajectory tensor data corresponding to each sample in the training sample set, which 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, so as to select the optimal model and hyperparameters; the test set is used to finally evaluate the generalization ability of the waybill trajectory verification model.
[0084] Updating the parameters of the initial neural network model based on the loss function also includes: using an adaptive momentum optimization algorithm adam to update the parameters; and updating the parameters according to a set number of iterations, setting the initialization learning rate to 0.0001, and setting the weight decay to 0.0005.
[0085] On the other hand, the present invention also provides a waybill track verification method, which includes the following steps S201-S203:
[0086] Step S201: Obtain the waybill data to be analyzed of the target task provided by the freight company and the actual high-speed trajectory data of the truck to be analyzed corresponding to the target task provided by the high-speed transaction platform; the waybill data to be analyzed include the waybill starting position and the waybill ending position of the target task, and the first subsidiary parameter to be analyzed including the waybill starting time and the waybill ending time; the actual high-speed trajectory data of the truck to be analyzed include the import and export toll station position, the gantry position and the second subsidiary parameter to be analyzed including the import and export toll station passing time and the gantry passing time; the first subsidiary parameter to be analyzed and the second subsidiary parameter to be analyzed both include cargo information, vehicle information, and fee 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 high-speed trajectory data of the truck to be analyzed, and calculate the trajectory vector angle to be analyzed corresponding to the first trajectory vector to be analyzed and the second trajectory vector to be analyzed for each sample; subtract the first subsidiary parameter to be analyzed from the second subsidiary parameter to be analyzed, and establish the attribute feature difference vector to be analyzed between each trajectory point; connect the trajectory vector angle to be analyzed and the attribute feature difference vector to be analyzed to obtain the trajectory tensor data to be analyzed.
[0088] Step S203: input the trajectory tensor data 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 a judgment result on whether the waybill data to be analyzed and the actual high-speed trajectory data of the truck to be analyzed match each other.
[0089] In some implementations, the method further includes step S204: creating a log file to store the judgment results of multiple target tasks on whether the waybill data to be analyzed and the actual high-speed trajectory data of the truck to be analyzed match each other, and creating an index for backtracking query;
[0090] And, step S205: pre-load an alarm rule module, which 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 waybill data to be analyzed and the actual high-speed trajectory data of the truck to be analyzed do not match each other.
[0091] On the other hand, the present invention further provides a computer-readable storage medium having a computer program / instruction stored thereon, which implements the steps of the above method when the computer program / instruction is executed by a processor.
[0092] On the other hand, the present invention also provides a computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the above method.
[0093] The present invention is described below in conjunction with a specific embodiment:
[0094] This embodiment proposes a method for verifying a truck waybill track, including the following steps:
[0095] (1) Obtain the waybill trajectory and truck high-speed transaction trajectory data, perform preprocessing, and construct the waybill trajectory data set: Obtain the waybill and truck high-speed transaction data from the waybill uploaded by the freight company and the toll road transaction platform. The waybill data includes the waybill starting address, end address, cargo transportation start time, cargo arrival end time, etc. The truck high-speed data includes attribute features such as the toll station name, the time of getting on and off the highway, etc. Based on the high-speed transaction data, the truck waybill data without high-speed transactions are eliminated. The waybill starting address, end address, and toll station name are converted into longitude and latitude trajectory point data through the map provider interface. The vector angle between the two trajectories is calculated based on the longitude and latitude trajectory data.
[0096] 1.1 Calculate the vector of each trajectory separately:
[0097]
[0098] Among them, T i Represents a single trajectory vector, X represents the longitude of the trajectory point, Y represents the latitude of the trajectory point, i represents the sequence number of the trajectory point, and n represents the total number of trajectory points in a trajectory;
[0099] 1.2 Calculate the vector angle formed by the two trajectories:
[0100]
[0101] Among them, angle represents the trajectory vector angle, t1 represents the trajectory vector corresponding to the waybill data, and t2 represents the trajectory vector corresponding to the high-speed transaction data of trucks.
[0102] Perform difference operation on other auxiliary parameters except the trajectory, and the calculation formula is:
[0103] X i =C1 i -C2 i ;
[0104] Among them, X i represents the difference corresponding to the i-th type of subsidiary parameters, C1 i Indicates the value of the i-th type of auxiliary parameter in the waybill data, C2 i It represents the value of the i-th auxiliary parameter in the truck high-speed transaction data.
[0105] The trajectory tensor data corresponding to each sample is obtained by connecting the trajectory vector angle and the attribute feature difference vector, which can be expressed as [angle,X1,X2,...Xn]. n represents the total number of attribute parameters of a trajectory. Of the trajectory tensor data corresponding to all samples, 70% is used as a training set, 10% as a validation set, and 20% as a test set.
[0106] (2) Constructing a waybill track verification model:
[0107] The model includes a batch normalization input module and a residual-based multi-layer perceptron feature extraction module, where:
[0108] The batch normalization input module includes a normalized feature processing network;
[0109] The residual-based multi-layer perceptron feature extraction module includes 10 serial multi-layer perceptron networks with residuals;
[0110] The output of the batch normalization input module is connected to the input of the residual-based multi-layer perceptron feature extraction module, and the input and output of each multi-layer perceptron network are accompanied by a residual jump connection.
[0111] (3) Using the waybill trajectory dataset constructed in step (1), 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 normalized input module to obtain the normalized features D1 of the waybill trajectory dataset.
[0114] (3.3) The normalized feature D1 of the waybill trajectory dataset is input into the residual-based multi-layer perceptron feature extraction module to obtain the residual perceptual 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) Using cross entropy loss function Calculate the loss 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 and obtain a trained network model N.
[0118] (3.7) Input the verification data set 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 data set test is input into the trained waybill verification model N for forward reasoning, and the authenticity of the waybill in the test data set is output (trusted waybill, untrusted waybill, suspected waybill).
[0122] (4) The specific composition of the batch normalization input module in step (2) is as follows:
[0123] The number of input units in the input module is set to 6, and the number of output units is set to 16. The network update process is expressed as:
[0124]
[0125] Where fb represents the output result, x represents the input feature vector, E[x] represents the mean of each input feature vector, Var[x] represents the variance of each input feature vector, ∈ is a constant, and ∈ is a very small value, such as 10 -5 , used to ensure that the distribution is not zero; γ and β are hyperparameters used to scale and translate the normalized data.
[0126] The residual-based multi-layer perceptron feature extraction module includes 10 serial multi-layer perceptron networks with residuals;
[0127] The multi-layer perceptron network uses 96 hidden units as filters for feature extraction and uses relu as an activation function to pass the acquired features to the subsequent network;
[0128] The residual is connected by a straight line, and the input features of the previous layer of the network are directly passed to the output of the residual block, which is realized by the addition operation, as shown below:
[0129] f c =x+seq(x);
[0130] Among them, f c Represents the output of the multilayer perceptron network with residual, x is the input feature vector, and seq(x) is the residual.
[0131] In (3.4), the residual perception feature D2 of the waybill trajectory is first sent to the linear fully connected layer for operation to obtain the final output vector R of the network model:
[0132] R=W r ×D2;
[0133] Among them, W r is the parameter matrix of the linear fully connected layer, and then the output vector R is input into the softmax function for probability calculation to find the probability value P for :
[0134]
[0135] Among them, R i Indicates the vector value when the category is i; finally, the maximum value of the probability vector P is calculated according to the first dimension to obtain the final recognition result, which includes the recognition result y of each category i :
[0136] Y = max(P, dim = 1);
[0137] Here, dim represents the dimension or axis, which is used to define the shape of the tensor.
[0138] Corresponding to the above method, the present invention also provides an apparatus / system, which includes a computer device, the computer device includes a processor and a memory, the memory stores computer instructions, the processor is used to execute the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the apparatus / system implements the steps of the method described above.
[0139] The embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the aforementioned edge computing server deployment method are implemented. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.
[0140] In summary, the training method, verification method and device of the waybill trajectory verification model of the present invention vectorize the waybill data provided by the freight company and the actual high-speed trajectory data of the truck provided by the high-speed transaction platform, calculate the trajectory vector angle, and after calculating the difference of the auxiliary parameters, connect the trajectory vector angle and the auxiliary parameter difference to obtain the trajectory tensor data. By training the neural network model, a multi-layer perceptron neural network with residuals with strong local feature extraction capabilities is used to extract local features in the trajectory index data; finally, a fully connected layer with global perception capabilities is used to extract global features in the trajectory index data to obtain verification results, so as to realize automatic matching and verification judgment of the waybill data and the actual high-speed trajectory data of the truck. The data input to the model does not need to compare and calculate a large amount of trajectory point data, but only needs to calculate the vector angles of the start and end trajectory points and some of the passing transaction trajectory points, which reduces the calculation cost. In the case of large amounts of data, data features can still be accurately extracted, the analysis speed can be maintained, and the results can be obtained within milliseconds.
[0141] It should be understood by those skilled in the art 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 the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.
[0142] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is 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, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.
[0143] In the present 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 features of other embodiments or replace features of other embodiments.
[0144] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A training method for a waybill track verification model, characterized in that: The method comprises the following steps: A training sample set is obtained, wherein the training sample set includes a plurality of samples, each sample includes waybill data provided by a freight enterprise and actual high-speed track data of a truck provided by a corresponding high-speed trading platform; the waybill data includes a waybill start position, a waybill end position, and a first subsidiary parameter including the waybill start time and the waybill end time; the actual high-speed track data of the truck includes an import and export toll station position, a gantry position, and a second subsidiary parameter including the import and export toll station pass time and the gantry pass time, and a label is added to mark whether the waybill data and the actual high-speed track data of the truck match each other; the first subsidiary parameter and the second subsidiary parameter both include cargo information, vehicle information, and fee information; Calculate the first trajectory vector corresponding to the waybill data, calculate the second trajectory vector corresponding to the actual high-speed trajectory data of the truck, and calculate the trajectory vector angle between the first trajectory vector and the second trajectory vector corresponding to each sample; subtract the first auxiliary parameter from 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; Acquire an initial neural network model, the initial neural network model 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 a plurality of serial multilayer perceptron networks with residuals, and the input and output ends of each multilayer perceptron network are jump-connected; the initial neural network model takes the trajectory tensor data corresponding to each sample as input, and outputs a prediction value for judging whether the waybill data and the actual high-speed trajectory data of the truck match each other; 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, and a waybill trajectory verification model is obtained.
2. The training method of the waybill track verification model according to claim 1 is characterized in that: The first trajectory vector of the waybill data is calculated, and the second trajectory vector of the actual high-speed trajectory data of the truck is calculated. The calculation formula is: Among them, T i represents a single trajectory vector, X represents the longitude of the trajectory point, Y represents the latitude of the 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 single starting position and the waybill ending position; when calculating the second trajectory vector, the trajectory points include the exit toll station position and the passing gantry position.
3. The training method of the waybill track verification model according to claim 1 is characterized in that: The trajectory vector angle between the first trajectory vector and the second trajectory vector corresponding to each sample is calculated, and the expression is: Wherein, angle represents the trajectory vector angle, t1 represents the first trajectory vector, and t2 represents the second trajectory vector.
4. The training method of the waybill track verification model according to claim 1 is characterized in that: The data processing process expression of the batch normalization input module is: Among them, fb represents the output result, x represents the input eigenvector, E[x] represents the mean of each input eigenvector, Var[x] represents the variance of each input eigenvector, ∈ is a constant, and γ and β are hyperparameters.
5. The training method of the waybill track verification model according to claim 1 is characterized in that: The multi-layer perceptron network includes: an input layer, at least one hidden layer and an output layer, each hidden layer uses relu as an 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 multi-layer perceptron network is regularized by a batch normalization layer.
6. The training method of the waybill track verification model according to claim 1 is characterized in that: The loss function is the cross entropy loss, and the calculation formula is: Among them, k represents the number of samples, y i represents the actual label of the i-th sample, p i Represents the predicted probability of the i-th sample for the label; The initial neural network model is trained using the trajectory tensor data corresponding to each sample in the training sample set, and further includes: dividing the training sample set into a training set, a validation set and a test set according to a set ratio, wherein 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; Updating the parameters of the initial neural network model based on the loss function also includes: using an adaptive momentum optimization algorithm adam to update the parameters; and updating the parameters according to a set number of iterations, setting the initialization learning rate to 0.0001, and setting the weight decay to 0.0005.
7. A waybill track verification method, characterized in that: The method comprises the following steps: Obtain the waybill data to be analyzed of the target task provided by the freight enterprise and the actual high-speed track data of the truck to be analyzed corresponding to the target task provided by the high-speed trading platform; the waybill data to be analyzed includes the waybill start position and the waybill end position of the target task, and the first subsidiary parameter to be analyzed including the waybill start time and the waybill end time; the actual high-speed track data of the truck to be analyzed includes the import and export toll station position, the gantry position, and the second subsidiary parameter to be analyzed including the import and export toll station passing time and the gantry passing time; the first subsidiary parameter to be analyzed and the second subsidiary parameter to be analyzed both include cargo information, vehicle information, and fee information; 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 high-speed trajectory data of the truck to be analyzed, and calculate the trajectory vector angle to be analyzed corresponding to the first trajectory vector to be analyzed and the second trajectory vector to be analyzed for each sample; subtract the first subsidiary parameter to be analyzed from the second subsidiary parameter to be analyzed, and establish the attribute feature difference vector to be analyzed between each trajectory point; connect the trajectory vector angle to be analyzed and the attribute feature difference vector to be analyzed to obtain the trajectory tensor data to be analyzed; The trajectory tensor data to be analyzed is input into the waybill trajectory verification model in the training method of the waybill trajectory verification model described in any one of claims 1 to 6, and a judgment result of whether the waybill data to be analyzed and the actual high-speed trajectory data of the truck to be analyzed match each other is output.
8. The waybill track verification method according to claim 7, characterized in that: The method further comprises: Establishing a log file to store the judgment results of the target tasks on whether the waybill data to be analyzed and the actual high-speed trajectory data of the truck to be analyzed match each other, and establishing an index for backtracking query; And, a preloaded alarm rule module is used to generate an alarm prompt and send it to the designated port according to a preset link when it is determined that the waybill data to be analyzed and the actual high-speed trajectory data of the truck to be analyzed do not match each other.
9. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Trajectory data sorting method based on generative adversarial network
CN108564129A
Complex dynamic gesture recognition method based on Leap Motion
CN109993073A
Target trajectory recognition method based on residual network and attention mechanism
CN115048870A
Data processing method and device, electronic equipment and storage medium
CN116222591A
Drosophila melanogaster flight path classification method based on spatial features and structural features
CN118070118A
Cited By
Flight track identification method based on deep residual neural network
CN119903417A
