Rule-based logistics sorting decision method and system
By constructing a logistics order allocation decision system based on a rule base, dynamically updating rule weights using decision trees and Bayesian inference algorithms, and combining this with attention neural networks to resolve rule conflicts, the problem of reliance on human experience in the logistics order allocation system is solved, achieving efficient and accurate order allocation decisions and execution.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HONGYUN HONGHE TOBACCO (GRP) CO LTD
- Filing Date
- 2026-04-21
- Publication Date
- 2026-07-21
AI Technical Summary
Existing logistics order allocation systems rely on human subjective experience, resulting in slow response times and long update cycles. This makes it difficult to guarantee the optimality of rule weight parameters globally. Static rule bases cannot be dynamically corrected based on real-time capacity status and fulfillment feedback, leading to discrepancies between order allocation schemes and actual execution conditions.
A rule-based logistics order allocation decision-making method is adopted. A three-layer rule base is constructed through the decision tree algorithm. Combined with Bayesian inference algorithm and attention neural network, the rule weights are dynamically updated to realize real-time adjustment of the rule base and output of the optimal rule sequence. Combined with multi-system linkage execution, a closed loop of "decision-execution-feedback-iteration" is formed, which solves the technical problem.
This has enabled a shift from manual design to data-driven decision-making in logistics order allocation, improving the real-time responsiveness and accuracy of order allocation schemes, and ensuring the dynamic optimization of the rule base and the precision of execution.
Smart Images

Figure CN122434429A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of logistics technology, and in particular to a logistics order allocation decision-making method and system based on a rule base. Background Technology
[0002] In the order allocation process of tobacco "integrated industrial and commercial logistics", the order allocation decision is a key step connecting "commercial order demand" and "logistics capacity resources", which directly affects transportation efficiency, cost and service quality.
[0003] With the expansion of the tobacco logistics network and the increasing complexity of order structures, the number of orders processed daily can reach several thousand, making it difficult for the traditional manual order processing model to meet the demand for real-time response.
[0004] Existing logistics order allocation systems are mostly based on static rule bases. The construction of rule bases relies on the experience and knowledge of domain experts, and the definition of rules, priority sorting of rules, and configuration of weight parameters are completed manually.
[0005] When order structure or transportation resources change significantly, manual adjustment of rule inventory suffers from problems such as slow response and long update cycle. Moreover, the adjustment effect depends on the accuracy of expert experience, making it difficult to guarantee the optimality of rule weight parameters in the global scope.
[0006] Furthermore, the static rule base cannot dynamically adjust the weights based on real-time capacity status and fulfillment feedback, resulting in a matching deviation between the order allocation plan and the actual execution conditions, which affects the overall scheduling efficiency. Summary of the Invention
[0007] The main purpose of this application is to provide a logistics order allocation decision-making method and system based on a rule base, so as to solve the problems of existing logistics order allocation systems that rely on human subjective experience, resulting in slow response, long update cycle and poor accuracy.
[0008] To achieve the above objectives, this application provides the following technical solution: A rule-based logistics order allocation decision method, the logistics order allocation decision method comprising: Step S1: Obtain order data, transportation capacity data, historical order splitting records, and multi-source environmental data as a logistics association dataset. Based on the logistics association dataset, construct a three-layer rule base structure and train it offline using a decision tree algorithm to obtain a three-layer rule base sorted by decision tree priority. Step S2: Obtain performance data and real-time capacity status, and input them into the Bayesian inference algorithm to calculate the weight parameters of each rule in the three-layer rule base, so as to obtain the three-layer rule base after weight update. Step S3: Extract the trigger conditions, constraint types, and matching degrees of the candidate rules in the three-layer rule base after weight update to construct a rule feature vector, and input the rule feature vector into the attention neural network to calculate the decision scores of each candidate rule, so as to obtain the optimal rule sequence after DNN conflict resolution; Step S4: Obtain the order data and the real-time transport capacity status, and calculate the optimal order assignment plan for the order data, the real-time transport capacity status, and the optimal rule sequence after DNN conflict resolution through comprehensive decision scoring; Step S5: Push the optimal order assignment plan to the external logistics scheduling systems of different dimensions to trigger the multi-system linkage execution and obtain the multi-system linkage execution result; Step S6: Calculate the rule matching degree and the fulfillment on-time rate between the multi-system linkage execution result and the preset verification threshold. If the matching degree requirement or the on-time rate requirement is not met, trigger Bayesian inference to update the weights of the three-layer rule base, output the three-layer rule base after weight iteration for the next round of order assignment decision, and output the optimal order assignment plan as the final order assignment plan for the current round.
[0009] Beneficial effects of Steps S1 to S6: This method performs offline training on the three-layer rule base through the decision tree algorithm, establishes a hierarchical structure and initial priority ranking of the basic general layer, the industry tobacco layer, and the dynamic adaptation layer, so that the rule base has a structured knowledge framework at the initialization stage; calculates the posterior probability distribution by fusing the fulfillment data and the real-time transport capacity status through the Bayesian inference algorithm, and dynamically updates the rule weight parameters of each layer, enabling the rule base to continuously adjust the decision preference according to the actual business data; extracts the features and makes decision scores for the candidate rules through the attention neural network, resolves rule conflicts under the guidance of attention weights, and outputs the optimal rule sequence; performs weighted fusion on the order specifications, real-time transport capacity, and optimal rule sequence through comprehensive decision scoring, combines multi-system linkage execution and quantitative verification to trigger weight iteration, forms a complete closed loop of "decision - execution - feedback - iteration", and realizes the transformation of order assignment decision-making from manual design to data-driven.
[0010] Step S1 involves offline training of the three-layer rule base using a decision tree algorithm to establish a hierarchical structure and initial priority ranking of the basic general layer, the industry tobacco layer, and the dynamic adaptation layer, providing a structured knowledge foundation for order allocation decisions. Step S2 uses a Bayesian inference algorithm to fuse performance data and real-time capacity status, mapping the observed dataset to a prior probability distribution and calculating the posterior probability, enabling real-time dynamic updates of the rule weight parameters at each layer, allowing the rule base to continuously adjust decision preferences in accordance with actual business data. Step S3 uses an attention neural network to extract features from candidate rules, weighting and aggregating them with attention weights and extracting high-level interaction features through a feedforward network layer, based on... Step S4 resolves rule conflicts by sorting decision scores in descending order and outputs the optimal rule sequence after DNN conflict resolution. Step S5 uses comprehensive decision scores to weight and fuse order specifications, real-time transportation capacity, and the optimal rule sequence, selecting the optimal order allocation scheme in descending order of scores to achieve optimal matching under multiple factors. Step S6 pushes the optimal order allocation scheme to the Beidou transportation capacity resource pool, logistics scheduling system, electronic fence system, and historical trajectory analysis system to achieve precise connection between the order allocation scheme and the logistics execution system. Step S7 establishes a quantitative verification mechanism for rule matching degree and on-time performance rate. When the verification result does not meet the preset threshold, Bayesian weight iteration is triggered to achieve a self-evolutionary closed loop of rule base weights.
[0011] As a further improvement to this application, in step S1, order data, transportation capacity data, historical order splitting records, and multi-source environmental data are acquired as a logistics-related dataset. A three-layer rule base structure is constructed based on this logistics-related dataset and trained offline using a decision tree algorithm to obtain a three-layer rule base sorted by decision tree priority, including: Step S1.1: Obtain the original order data and the original transportation capacity data. The original order data includes product specifications, priority, and unloading window. The original transportation capacity data includes vehicle type, current location, and fuel status. Step S1.2: Perform data processing on the original order data and the original transportation capacity data to output standardized order data and standardized transportation capacity data; Step S1.3: Obtain historical order records and perform data preprocessing on the historical order records. After associating the allocation result labels, obtain the historical order dataset with associated allocation result labels. Step S1.4: Obtain weather data, road condition data, storage capacity data, and carbon emission index data to obtain multi-source environmental data, and perform format standardization processing on the multi-source environmental data to obtain standardized multi-source environmental data; Step S1.5: Initialize the three-layer rule base storage structure, where the basic general layer stores qualification compliance rules and cargo volume matching rules, the industry tobacco layer stores product specification priority rules, order response rules, and slim cigarette anti-compression rules, and the dynamic adaptation layer stores real-time weight update rules; Step S1.6: Using the three-layer rule base storage structure as the training framework, the historical single dataset and the standardized multi-source environmental data are trained offline using the decision tree classification algorithm to obtain the decision tree classification model; Step S1.7: Extract the classification priority results of each rule from the decision tree classification model to obtain a three-layer rule base classified by decision tree priority. Step S1.8: Sort the three-layer rule base classified by decision tree priority according to priority to obtain the three-layer rule base sorted by decision tree priority.
[0012] Beneficial effects of steps S1.1 to S1.8: This series of steps uses a decision tree classification algorithm to train historical order allocation datasets and standardized multi-source environmental data offline, establishing a hierarchical structure and priority ranking of a three-layer rule base, providing a structured knowledge foundation for order allocation decisions.
[0013] The process includes the following steps: Step S1.1: Obtaining raw order data and raw capacity data. The raw order data includes product specifications, priority, and unloading window. The raw capacity data includes vehicle type, current location, and fuel status, establishing multi-dimensional initial data coverage. Step S1.2: Processing the raw order data and raw capacity data to output standardized data and eliminate dimensional differences. Step S1.3: Preprocessing historical order allocation records and associating them with allocation result labels to establish a mapping relationship between the historical order allocation dataset and the allocation results. Step S1.4: Processing weather data, road condition data, and warehouse capacity data. The carbon emission index data is standardized to establish a unified representation of multi-source environmental data; Step S1.5 Initializes a three-layer rule base storage structure, establishing a hierarchical framework of a basic general layer, an industry tobacco layer, and a dynamic adaptation layer; Step S1.6 Trains the historical single dataset and standardized multi-source environmental data offline using a decision tree classification algorithm, and outputs a decision tree classification model; Step S1.7 Extracts the classification priority results of each rule from the decision tree classification model and establishes a mapping relationship between rules and priorities; Step S1.8 Sorts the three-layer rule base according to priority to establish an ordered rule knowledge structure.
[0014] As a further improvement to this application, step S2 involves acquiring performance data and real-time capacity status, and inputting them into a Bayesian inference algorithm to calculate the weight parameters of each layer of rules in the three-layer rule base, resulting in a weight-updated three-layer rule base, including: Step S2.1: Obtain the carrier's on-time rate and fulfillment rate as raw fulfillment data, and obtain standardized fulfillment data after data preprocessing; Step S2.2: Obtain the real-time location of vehicles, vehicle availability status, and number of new energy vehicles as the raw data for real-time transportation capacity. After data preprocessing, a standardized real-time transportation capacity status is obtained. Step S2.3: The standardized performance data and the standardized real-time transportation capacity status are concatenated to form a Bayesian inference observation dataset; Step S2.4: Read the current weight of each rule in the three-layer rule base sorted by decision tree priority, and map it to a prior probability distribution; Step S2.5: Calculate the likelihood of the Bayesian inference observation dataset under each rule prior probability distribution; Step S2.6: Substitute the prior probability distribution and likelihood of each rule into Bayes' formula to calculate the posterior probability distribution of each rule. Step S2.7: Normalize the posterior probability distribution of each rule into weight parameters and update them to the three-layer rule base to obtain the weight-updated three-layer rule base.
[0015] Beneficial effects of steps S2.1 to S2.7: This series of steps uses a Bayesian inference algorithm to fuse performance data with real-time capacity status, calculates the posterior probability distribution and normalizes it into weight parameters, thereby enabling real-time dynamic updates of the weight parameters of each layer of rules.
[0016] The process includes the following steps: Step S2.1: Obtain the carrier's on-time performance rate and fulfillment rate to establish a quantitative representation of fulfillment capability; Step S2.2: Obtain the real-time location, availability, and number of new energy vehicles to establish a quantitative representation of transport capacity status; Step S2.3: Concatenate standardized fulfillment data with standardized real-time transport capacity status to form a Bayesian inference observation dataset; Step S2.4: Read the current weights of each rule in the three-layer rule base and map them to prior probability distributions to establish a mapping relationship between rule weights and probabilities; Step S2.5: Calculate the likelihood of the Bayesian inference observation dataset under the prior probability distributions of each rule; Step S2.6: Substitute the prior probability distributions and likelihoods into the Bayesian formula to calculate the posterior probability distributions of each rule; Step S2.7: Normalize the posterior probability distributions into weight parameters and update them to the three-layer rule base to complete real-time dynamic weight adjustment.
[0017] As a further improvement to this application, step S3 involves extracting the triggering conditions, constraint types, and matching degrees of candidate rules from the three-layer rule base after weight update to construct rule feature vectors. These feature vectors are then input into an attention neural network to calculate the decision score for each candidate rule, resulting in the optimal rule sequence after DNN conflict resolution, including: Step S3.1: Load the three-layer rule base after weight update and extract candidate rules to obtain a candidate rule list; Step S3.2: Extract the triggering condition, constraint type, and matching degree of each rule in the candidate rule list to construct a rule feature set; Step S3.3: Input the set of rule features into the attention neural network, calculate the attention weight of each rule with other rules and perform weighted aggregation to obtain attention weighted features; Step S3.4: The attention-weighted features are processed by activation function, and high-level interaction features are extracted through the feedforward network layer to obtain the enhanced feature vector; Step S3.5: Input the enhanced feature vector into the decision layer to calculate the comprehensive decision score and obtain the decision score of each rule; Step S3.6: Sort the decision scores of each rule in descending order, and eliminate candidate rules that violate high-priority rules in turn to obtain the optimal rule sequence after DNN conflict resolution.
[0018] Beneficial effects of steps S3.1 to S3.6: This series of steps uses an attention neural network to extract features and score candidate rules, resolves rule conflicts under the guidance of attention weights, and outputs the optimal rule sequence after DNN conflict resolution.
[0019] The process includes the following steps: Step S3.1: Load the updated three-layer rule base and extract candidate rules to establish a candidate rule set; Step S3.2: Extract the triggering conditions, constraint types, and matching degrees of the candidate rules to construct a rule feature set; Step S3.3: Calculate attention weights using an attention neural network and perform weighted aggregation to establish rule relationships; Step S3.4: Process the attention-weighted features using activation functions and enhance them with a feedforward network to extract high-level interaction features; Step S3.5: Input the enhanced feature vectors into the decision layer to calculate a comprehensive decision score and establish a rule priority order; Step S3.6: Sort the decision scores in descending order and exclude candidate rules that violate high-priority rules, outputting the optimal rule sequence after DNN conflict resolution.
[0020] As a further improvement to this application, step S4 involves acquiring the order data and the real-time capacity status, and calculating the optimal order allocation scheme based on the order data, the real-time capacity status, and the optimal rule sequence after DNN conflict resolution through a comprehensive decision scoring method, including: Step S4.1: Obtain the product specifications, priority, and unloading window of the order data to obtain the order dataset; Step S4.2: Obtain the vehicle location, availability, and fuel level of the real-time transportation capacity status to obtain a real-time transportation capacity status set; Step S4.3: Merge the order dataset, the real-time capacity status set, and the optimal rule sequence after DNN conflict resolution into a candidate order dataset; Step S4.4: Calculate the rule matching degree between each candidate record in the candidate single dataset and the optimal rule sequence after DNN conflict resolution, and obtain the rule matching degree score set; Step S4.5: Weightedly fuse the rule matching degree scoring set and the candidate order-splitting data set to calculate a comprehensive decision-making score, and obtain a comprehensive decision-making score set; Step S4.6: Arrange the comprehensive decision-making score set in descending order, and select the candidate order-splitting record with the highest score as the optimal order-splitting plan.
[0021] Beneficial effects of Steps S4.1 to S4.6: This series of steps selects the candidate order-splitting records in descending order through comprehensive decision-making scoring, and outputs the order-splitting plan with the highest score, realizing the optimal matching of orders and transport capacities.
[0022] Among them, in Step S4.1, the product specifications, priorities, and unloading windows of the order data are obtained to establish an order feature representation; in Step S4.2, the vehicle positions, available statuses, and fuel quantities of the real-time transport capacity status are obtained to establish a transport capacity feature representation; in Step S4.3, the order data set, the real-time transport capacity status set, and the optimal rule sequence are merged into a candidate order-splitting data set; in Step S4.4, the rule matching degree between the candidate records and the optimal rule sequence is calculated; in Step S4.5, the rule matching degree scoring set and the candidate order-splitting data set are weightedly fused to calculate a comprehensive decision-making score; in Step S4.6, the comprehensive decision-making score set is arranged in descending order and the candidate record with the highest score is selected to output the optimal order-splitting plan.
[0023] As a further improvement of this application, in Step S5, the optimal order-splitting plan is pushed to external logistics scheduling systems in different dimensions to trigger multi-system linkage execution, and a multi-system linkage execution result is obtained, including: Step S5.1: Extract the vehicle number, task route, and order-splitting timestamp of the optimal order-splitting plan to obtain order-splitting plan vehicle allocation data; Step S5.2: Push the order-splitting plan vehicle allocation data to the Beidou transport capacity resource pool, lock the allocated vehicles and update the status to pending loading to obtain a transport capacity lock confirmation result; Step S5.3: Merge the transport capacity lock confirmation result and the order-splitting plan vehicle allocation data, and push them to the logistics scheduling system to generate a transport task order to obtain transport task order data; Step S5.4: Extract the loading route and destination coordinates from the transport task order data, and push them to the electronic fence system to set a driving monitoring area to obtain fence monitoring configuration data; Step S5.5: Merge and write the fence monitoring configuration data, the transport task order data, and the transport capacity lock confirmation result into the historical trajectory analysis system to obtain historical trajectory writing confirmation data; Step S5.6: Aggregate the capacity locking confirmation result, the transportation task order data, the fence monitoring configuration data, and the historical trajectory writing confirmation data into a multi-system linkage execution result.
[0024] Beneficial effects of steps S5.1 to S5.6: This series of steps pushes the optimal order allocation plan to the Beidou transportation capacity resource pool, logistics scheduling system, electronic fence system, and historical trajectory analysis system, achieving precise linkage between the order allocation plan and the logistics execution system.
[0025] The process includes the following steps: Step S5.1: Extract the vehicle number, task route, and order timestamp of the optimal order allocation scheme to establish an order allocation scheme execution data package; Step S5.2: Push the vehicle allocation data of the order allocation scheme to the Beidou transportation capacity resource pool, lock the allocated vehicles, and update their status to "pending loading"; Step S5.3: Merge and push the transportation capacity locking confirmation results to the logistics scheduling system to generate a transportation task order; Step S5.4: Push the route and coordinates in the transportation task order to the electronic fence system to set the driving monitoring area; Step S5.5: Write the fence monitoring configuration data, transportation task order, and transportation capacity locking confirmation results into the historical trajectory analysis system; Step S5.6: Aggregate the execution results of multiple systems into multi-system linkage execution results to establish a complete execution chain.
[0026] As a further improvement to this application, step S6 calculates the rule matching degree and on-time performance rate between the multi-system linkage execution result and the preset verification threshold. If the matching degree requirement or the on-time performance rate requirement is not met, the Bayesian inference weight is triggered to update the three-layer rule base, and the three-layer rule base after weight iteration is output for the next round of order allocation decision. The optimal order allocation scheme is output as the final order allocation scheme for the current round, including: Step S6.1: Extract the actual execution path, vehicle status changes, and task completion time of the multi-system linkage execution results to obtain the actual execution dataset; Step S6.2: Compare the actual execution dataset with the optimal rule sequence after DNN conflict resolution one by one to calculate the rule matching degree, and calculate the on-time performance rate of the task completion time and the scheduled unloading window. Step S6.3: Compare the rule matching degree and the on-time performance rate with the preset matching degree threshold and the preset on-time performance rate threshold, respectively, to obtain the threshold comparison result; Step S6.4: If the threshold comparison result does not meet the matching degree requirement or the on-time rate requirement, then the rule matching degree and the on-time performance rate are input into the Bayesian inference algorithm to calculate the update parameters of each rule weight, and the update parameters of each rule weight are obtained. Step S6.5: Write the weight update parameters of each rule into the three-layer rule base after weight update to replace the prior weight parameters of the corresponding rule, and obtain the three-layer rule base after weight iteration. Step S6.6: Output the three-layer rule base after weight iteration and the optimal order allocation scheme. The optimal order allocation scheme is used as the final order allocation scheme for the current round, and the three-layer rule base after weight iteration is used for the order allocation decision in the next round.
[0027] Beneficial effects of steps S6.1 to S6.6: This series of steps uses rule matching degree and on-time performance rate as dual benchmarks for quantitative verification. When the preset threshold is not met, Bayesian weight iteration is triggered to provide an optimized data basis for the next round of order allocation decision.
[0028] The process includes the following steps: Step S6.1: Extract the actual execution path, vehicle status changes, and task completion time from the multi-system linkage execution results to establish an actual execution dataset; Step S6.2: Compare the actual execution data with the optimal rule sequence line by line to calculate the rule matching degree, and calculate the on-time performance rate of the task completion time and the scheduled unloading window; Step S6.3: Compare the rule matching degree and on-time performance rate with preset thresholds respectively, and output the threshold comparison results; Step S6.4: When the threshold comparison results are not met, calculate the weight update parameters for each rule; Step S6.5: Write the weight update parameters into the three-layer rule base after weight update, replacing the prior weight parameters of the corresponding rules; Step S6.6: Output the three-layer rule base after weight iteration and the optimal order allocation scheme to provide an optimized data foundation for the next round of order allocation decisions.
[0029] To achieve the above objectives, this application also provides the following technical solutions: A rule-based logistics order allocation decision system, wherein the logistics order allocation decision system is applied to the logistics order allocation decision method described above, and the logistics order allocation decision system includes: The three-layer rule base construction module is used to acquire order data, transportation capacity data, historical order splitting records, and multi-source environmental data as a logistics association dataset. Based on the logistics association dataset, a three-layer rule base structure is constructed and trained offline using a decision tree algorithm to obtain a three-layer rule base sorted by decision tree priority. The three-layer rule base update module is used to obtain performance data and real-time capacity status and input them into the Bayesian inference algorithm to calculate the weight parameters of each layer of the rule base, so as to obtain the three-layer rule base after weight update. The rule sequence conflict resolution module is used to extract the triggering conditions, constraint types, and matching degrees of candidate rules in the three-layer rule base after weight update to construct rule feature vectors, and input the rule feature vectors into the attention neural network to calculate the decision score of each candidate rule, so as to obtain the optimal rule sequence after DNN conflict resolution; The optimal order allocation scheme calculation module is used to acquire the order data and the real-time transportation status, and calculate the optimal order allocation scheme of the order data, the real-time transportation status and the optimal rule sequence after DNN conflict resolution through comprehensive decision scoring; The optimal order allocation scheme execution module is used to push the optimal order allocation scheme to external logistics scheduling systems of different dimensions, trigger multi-system linkage execution, and obtain multi-system linkage execution results; The three-layer rule base iteration module is used to calculate the rule matching degree and on-time performance rate of the multi-system linkage execution results and preset verification thresholds. If the matching degree requirement or on-time performance rate requirement is not met, the Bayesian inference weight is triggered to update the three-layer rule base. The three-layer rule base after weight iteration is output for the next round of order allocation decision, and the optimal order allocation scheme is output as the final order allocation scheme for the current round.
[0030] To achieve the above objectives, this application also provides the following technical solutions: An electronic device includes a processor and a memory coupled to the processor, the memory storing program instructions that can be executed by the processor; when the processor executes the program instructions stored in the memory, it implements the rule-based logistics order allocation decision method described above.
[0031] To achieve the above objectives, this application also provides the following technical solutions: A computer-readable storage medium storing program instructions, which, when executed by a processor, enable the implementation of the rule-based logistics order allocation decision-making method described above. Attached Figure Description
[0032] Figure 1 This is a schematic flowchart illustrating the steps of an embodiment of a rule-based logistics order allocation decision method according to this application. Figure 2 This is a schematic diagram of the functional modules of an embodiment of a rule-based logistics order allocation decision system according to this application; Figure 3 This is a schematic diagram of the structure of an embodiment of the electronic device of this application; Figure 4 This is a schematic diagram of the structure of one embodiment of the storage medium of this application. Detailed Implementation
[0033] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0034] The terms "first," "second," and "third" in this application are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. All directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of this application are only used to explain the relative positional relationships and movements between components in a specific orientation (e.g., as shown in the figures). If the specific orientation changes, the directional indications also change accordingly. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.
[0035] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0036] It should be noted that, due to the limited types and number of symbols or letters that can represent specific meanings, for embodiments with many formulas or codes, there may be situations where symbols or letters cannot meet the usage requirements. Therefore, the interpretation of formula symbols in the steps or sub-steps of the embodiments is only valid for the current step or sub-step.
[0037] If the same symbol has different interpretations in different steps or sub-steps, the interpretation in the current step or sub-step shall prevail; if the same symbol appears in different steps or sub-steps, but no interpretation is given in subsequent steps or sub-steps after its first appearance, the interpretation in the first step or sub-step shall be used.
[0038] like Figure 1 As shown, this embodiment provides an example of a logistics order allocation decision-making method based on a rule base. In this embodiment, the logistics order allocation decision-making method includes the following steps: Step S1: Obtain order data, transportation capacity data, historical order splitting records, and multi-source environmental data as a logistics association dataset. Based on the logistics association dataset, construct a three-layer rule base structure and train it offline using a decision tree algorithm to obtain a three-layer rule base sorted by decision tree priority.
[0039] Furthermore, step S1 specifically includes the following steps: Step S1.1: Obtain the original order data and the original transportation capacity data. The original order data includes product specifications, priority, and unloading window. The original transportation capacity data includes vehicle type, current location, and fuel status.
[0040] Preferably, the core of this step is to achieve unified coverage of multi-dimensional raw data. This is achieved by parallel access to different data sources and a unified timestamp format, enabling independent collection and coverage of order information and transportation capacity information. Product categories are divided into two levels: slim cigarettes and regular cigarettes; priorities are divided into two levels: urgent orders and high-priority orders; unloading windows are accurate to the minute, for example, 8:00 to 12:00 on a certain day in a certain month of a certain year at XX Logistics Park; vehicle types are divided into three categories: large vans, medium vans, and small vans; the current location uses standard geocoding, accurate to the prefecture-level city; and in terms of fuel status, new energy vehicles are mapped to a battery percentage of 0 to 100%, and gasoline vehicles are mapped to a fuel percentage of 0 to 100%.
[0041] For example, at 8:15 on a certain day in a certain month of a certain year, a tobacco retailer in XX City, XX Province, submitted an urgent order for slim cigarettes, with the priority being urgent. The unloading window was before 14:00 on the same day, and the vehicle to be dispatched was a large van located in XX District, XX City, with 80% battery power.
[0042] Step S1.2: Perform data processing on the original order data and the original transportation capacity data to output standardized order data and standardized transportation capacity data.
[0043] Preferably, the core of this step is to clean and standardize the format of the raw data. Data cleaning removes missing and outlier values, and standardization mapping eliminates dimensional differences, transforming raw data of different dimensions into calculable standardized values. Order specifications are categorized as follows: slim cigarettes are mapped to 0, and regular cigarettes are mapped to 1; the unloading window is converted to the remaining hours relative to the current time; the vehicle's current location is converted to a standard geocoding sequence; fuel level is uniformly mapped to a dimensionless value between 0 and 1, with new energy vehicles represented by the percentage of battery charge divided by 100, and fuel vehicles represented by the percentage of fuel charge divided by 100.
[0044] For example, an order priority of 'emergency' is mapped to 1, the vehicle's current location is converted to a geocoded sequence in XX city XX district, and 80% fuel level is mapped to 0.80.
[0045] Step S1.3: Obtain historical order records and perform data preprocessing on the historical order records. After associating the allocation result labels, obtain the historical order dataset with associated allocation result labels.
[0046] Preferably, the core of this step is to standardize the historical order allocation data. Through data cleaning, timestamp unification, and assignment result label association, a historical order allocation dataset with decision result annotations is established, providing effective samples for subsequent offline training of decision trees. Historical order allocation records retain data from the most recent thirty-six months; in data preprocessing, the timestamp format is unified to YYYY-MM-DDHH:MM:SS; in missing value handling, records with more than three missing fields are removed; the assignment result label is a completion marker or a rejection marker, with a completion marker recorded as 1 and a rejection marker as 0; the carrier's on-time rate is calculated within 48 hours from the order allocation time to the estimated completion time; the fulfillment rate is calculated within 72 hours from the order allocation time to the actual completion time.
[0047] Step S1.4: Obtain multi-source environmental data by acquiring weather data, road condition data, storage capacity data, and carbon emission index data, and perform format standardization processing on the multi-source environmental data to obtain standardized multi-source environmental data.
[0048] Preferably, the core of this step is to complete the unified collection and format standardization of multi-source environmental data. Through standardized mapping, environmental data from different sources and with different dimensions are transformed into a unified numerical representation, which serves as the external feature input for offline training of the decision tree. Weather data is updated at least once per hour, the congestion index is scored on eleven levels from very smooth (0) to very congested (10), the storage capacity is calculated by dividing the current inventory by the maximum storage capacity and accurate to two decimal places, the carbon emission index is updated at least once per day, and data standardization uses Min-Max normalization to map the data of each dimension to the range of 0 to 1.
[0049] For example, on a certain day and at a certain time, the weather data for XX Logistics Park showed a congestion index of 3, corresponding to light traffic congestion, a storage capacity of 0.78, and a carbon emission index of 0.12 kg per ton-kilometer.
[0050] Step S1.5: Initialize the three-layer rule base storage structure. The basic general layer stores qualification compliance rules and cargo volume matching rules, the industry tobacco layer stores product specification priority rules, order response rules, and slim cigarette anti-pressure rules, and the dynamic adaptation layer stores real-time weight update rules.
[0051] Preferably, this step primarily completes the initialization of the three-layer rule base framework, establishes a hierarchical storage structure, and predefines the storage space for each layer's rule types. The initialization configuration provides the classification storage location for the rules output by the subsequent decision tree classification model. The maximum number of rules in the basic general layer is set to two hundred, the maximum number of rules in the industry tobacco layer is set to five hundred, and the maximum number of rules in the dynamic adaptation layer is set to one hundred. The priority weight range for each layer's rules is set to 0 to 1, with higher priority weights indicating higher rule applicability.
[0052] Step S1.6: Using the three-layer rule base storage structure as the training framework, the historical single dataset and the standardized multi-source environmental data are trained offline using the decision tree classification algorithm to obtain the decision tree classification model.
[0053] Preferably, the core of this step is to complete the offline training of the decision tree classification model. Historical single-sample data and standardized multi-source environmental features are input into the decision tree classification algorithm to generate a classification model capable of outputting rule-based classification priority results. The structural parameters of the classification model are then aligned with the three-layer rule base storage structure. The maximum depth of the decision tree is set to five to fifteen layers, the minimum number of samples for node splitting is set to twenty, the minimum number of samples for leaf nodes is set to ten, the splitting criterion is the Gini coefficient, the training set to validation set ratio is seven to three, the cross-validation folds are set to five, and multi-threaded parallel computation is employed, with four threads.
[0054] Step S1.7: Extract the classification priority results of each rule from the decision tree classification model to obtain a three-layer rule base classified by decision tree priority.
[0055] Preferably, the core of this step is to complete the rule mapping extraction from the decision tree classification model to the three-layer rule base. This involves traversing the decision tree node structure to extract the classification path of the leaf nodes corresponding to each rule, and assigning a corresponding layer label and priority weight to each rule based on the classification path, establishing a one-to-one mapping relationship between rules and the three-layer rule base storage structure. The priority weight is calculated by multiplying the percentage of sample categories in the leaf nodes of the decision tree by a node depth correction coefficient, where the node depth correction coefficient is set to one-tenth of the depth. The priority weight of each rule is accurate to three decimal places.
[0056] Step S1.8: Sort the three-layer rule base classified by decision tree priority according to priority to obtain the three-layer rule base sorted by decision tree priority.
[0057] Preferably, the core of this step is to complete the final sorting output of the three-layer rule base. The rule base is globally sorted from highest to lowest priority weight. If priority weights are the same, they are sorted in ascending order by rule number. Within the same layer, the rule base is also sorted from highest to lowest priority weight. Finally, the sorted three-layer rule base is written to persistent storage and marked with a version number. The sorting key is the priority weight, the sorting direction is descending, and the sorting stability is guaranteed by the priority weights being accurate to three decimal places. The average time complexity of the sorting algorithm is O(NlogN), and the version number format is 14 digits: year, month, day, hour, minute, second.
[0058] Beneficial effects of steps S1.1 to S1.8: This series of steps uses a decision tree classification algorithm to train historical order allocation datasets and standardized multi-source environmental data offline, establishing a hierarchical structure and priority ranking of a three-layer rule base, providing a structured knowledge foundation for order allocation decisions.
[0059] The process includes the following steps: Step S1.1: Obtain raw order data and raw capacity data to establish multi-dimensional initial data coverage; Step S1.2: Process the raw order data and raw capacity data to output standardized data and eliminate dimensional differences; Step S1.3: Preprocess historical order allocation records and associate them with allocation result labels to establish a mapping relationship between the historical order allocation dataset and the allocation results; Step S1.4: Standardize the format of weather data, road condition data, warehouse capacity data, and carbon emission index data to establish a unified representation of multi-source environmental data; Step S1.5: Initialize a three-layer rule base storage structure and establish a hierarchical framework consisting of a basic general layer, an industry tobacco layer, and a dynamic adaptation layer; Step S1.6: Train the historical order allocation dataset and standardized multi-source environmental data offline using a decision tree classification algorithm to output a decision tree classification model; Step S1.7: Extract the classification priority results of each rule from the decision tree classification model and establish a mapping relationship between rules and priorities; Step S1.8: Sort the three-layer rule base according to priority to establish an ordered rule knowledge structure.
[0060] Step S2: Obtain performance data and real-time capacity status, and input them into the Bayesian inference algorithm to calculate the weight parameters of each rule in the three-layer rule base, and obtain the three-layer rule base after weight update.
[0061] Furthermore, step S2 specifically includes the following steps: Step S2.1: Obtain the carrier's on-time rate and fulfillment rate as raw fulfillment data, and obtain standardized fulfillment data after data preprocessing.
[0062] Preferably, the core of this step is to collect and standardize the original performance data. By obtaining the carrier's on-time rate and performance completion rate and performing missing value filling and normalization processing, the standardized quantitative representation of performance capability is achieved.
[0063] Specifically, the carrier's on-time delivery rate is the ratio of the number of on-time delivered orders to the total number of orders in the statistical window; the fulfillment rate is the ratio of the number of orders actually completed by the carrier to the number of allocated orders in the statistical window.
[0064] Preferably, the statistical window is the most recent 30 days; missing values for on-time rate and completion rate are filled with the historical average for the same period; standardization uses Min-Max normalization to map each indicator to the 0 to 1 interval; outlier filtering uses the 3σ criterion, and values exceeding three times the standard deviation of the mean are truncated to the upper and lower limits.
[0065] For example, carrier A's on-time performance rate was 0.92 and its performance completion rate was 0.88 in the most recent 30 days of a certain month and year. After standardization, these figures are 0.92 and 0.88, respectively.
[0066] Step S2.2: Obtain the real-time location of vehicles, vehicle availability status, and number of new energy vehicles as the raw data for real-time transportation capacity. After data preprocessing, a standardized real-time transportation capacity status is obtained.
[0067] Preferably, the core of this step is to collect and standardize the real-time raw data of transportation capacity. By acquiring the real-time location, availability status and number of new energy vehicles and performing format unification and normalization processing, the standardized and quantitative representation of transportation capacity status is achieved.
[0068] Specifically, for the real-time location of vehicles, the current latitude and longitude coordinates returned by the BeiDou positioning system are collected; for the availability status of vehicles, the status labels marked as idle, in transit, or under maintenance in the vehicle dispatch system are collected; and for the number of new energy vehicles, the count of currently available new energy vehicles is collected.
[0069] Preferably, the real-time vehicle location update frequency is no less than once every sixty seconds; the vehicle availability status is marked as 1 for idle, 0.5 for in transit, and 0 for under maintenance; the number of new energy vehicles is normalized to the number of currently available new energy vehicles divided by the total number of vehicles in the fleet; standardization uses Min-Max normalization to map each indicator to the range of 0 to 1.
[0070] For example, the current fleet has a total of fifty vehicles, of which twenty are new energy vehicles, thirty are idle, fifteen are in transit, and five are under maintenance. The proportion of new energy vehicles is normalized to 0.40, and the availability is normalized to 0.60.
[0071] Step S2.3: The standardized performance data and the standardized real-time transportation capacity status are concatenated to form a Bayesian inference observation dataset.
[0072] Preferably, the core of this step is to complete the data fusion of performance data and capacity status. By aligning and splicing the two sets of standardized data according to carrier identifier and timestamp, a unified observation dataset is constructed as the input for Bayesian inference.
[0073] For the splicing operation, the carrier identifier is used as the primary key. The on-time rate and completion rate fields in the standardized performance data and the location, availability and new energy vehicle ratio fields in the standardized real-time capacity status are spliced horizontally. The timestamp is taken as the latest common time point in the two sets of data.
[0074] Preferably, each observation record after splicing contains five dimensions: standardized on-time rate, standardized completion rate, standardized location, standardized availability status, and standardized proportion of new energy vehicles; missing dimensions are filled by forward padding; the observation dataset is arranged in reverse chronological order by timestamp, with the latest record at the top.
[0075] For example, the observation dataset of carrier A at time T is [0.92, 0.88, 0.65, 0.60, 0.40].
[0076] Step S2.4: Read the current weight of each rule in the three-layer rule base sorted by decision tree priority, and map it to a prior probability distribution.
[0077] Preferably, the core of this step is to complete the mapping transformation from rule weights to prior probabilities. By reading the current weight value of each rule in the three-layer rule base and normalizing it into a probability distribution form, prior input is provided for Bayesian inference.
[0078] Specifically, for weight reading, all rules in the three-layer rule base are traversed and the current weight value is extracted to form a weight vector; for prior probability mapping, the weight vector is normalized to a probability distribution through the Softmax function so that the sum of the probability values of all rules is 1.
[0079] Preferably, the initial weight value is determined by the priority ranking result of the decision tree, and the higher the priority, the greater the initial weight; the temperature parameter of the Softmax function is set to 1.0; the probability value of each rule in the prior probability distribution is accurate to four decimal places; the total number of rules in the three-layer rule base is denoted as N, and the dimension of the prior probability vector is N.
[0080] For example, the three-layer rule base has a total of 150 rules, including 30 basic general rules, 90 industry tobacco rules, and 30 dynamic adaptation rules. After Softmax normalization, the prior probabilities of each rule differ according to the initial weight values.
[0081] Step S2.5: Calculate the likelihood of the Bayesian inference observation dataset under each rule prior probability distribution.
[0082] Preferably, the core of this step is to quantify the degree of support of the observation data for each rule. By assuming that each rule corresponds to a Gaussian distribution model, the probability density value of the observation dataset under each distribution is calculated as the likelihood, thereby quantifying the degree of matching between the current capacity status and each rule.
[0083] For the Gaussian distribution assumption, each rule corresponds to a multidimensional Gaussian distribution, and its mean vector and covariance matrix are obtained by statistical analysis of the observation data when the rule is triggered in the historical data. For the likelihood calculation, the current observation dataset is substituted into the Gaussian distribution probability density function corresponding to each rule, and the likelihood value corresponding to each rule is output.
[0084] Preferably, the Gaussian distribution mean vector is estimated from the sample mean of the observed data when the rule was triggered in historical data; the covariance matrix is a diagonal covariance matrix, with the diagonal elements being the variances of each dimension and the off-diagonal elements being zero; the variance estimation is smoothed by adding a small constant to the sample variance of historical data, with the small constant set to 0.01; the likelihood value is accurate to six decimal places.
[0085] For the Gaussian distribution assumption, each rule corresponds to a d-dimensional Gaussian distribution, and its mean vector and covariance matrix are obtained from the historical observation data when the rule was triggered. For the likelihood calculation, the current observation dataset is substituted into the Gaussian distribution probability density function corresponding to each rule, and the calculation formula is as follows:
[0086] Where D is the observed data vector, and d is the data dimension. For rules The corresponding Gaussian distribution mean vector, Let covariance matrix be the variance matrix. Given the determinant of the covariance matrix; output the likelihood value for each rule.
[0087] Preferably, the Gaussian distribution mean vector is estimated from the sample mean of the observed data when the rule was triggered in historical data; the covariance matrix is a diagonal covariance matrix, with the diagonal elements being the variances of each dimension and the off-diagonal elements being zero; the variance estimation is smoothed by adding a small constant to the sample variance of historical data, with the small constant set to 0.01; the likelihood value is accurate to six decimal places.
[0088] For example, the mean of the five-dimensional Gaussian distribution corresponding to rule R1 Current observation dataset After substitution, the likelihood is .
[0089] Step S2.6: Substitute the prior probability distribution and likelihood of each rule into Bayes' formula to calculate the posterior probability distribution of each rule.
[0090] Preferably, this step completes the core calculation of Bayesian inference. By substituting the prior probability and likelihood into the Bayesian formula, the posterior probability distribution is obtained by fusing prior knowledge and observational evidence, thereby realizing data-driven updates of rule weights.
[0091] For Bayes' theorem, the posterior probability is calculated as follows:
[0092] in, Let be the i-th rule, and D be the observation dataset. For prior probability, The likelihood is given by the denominator, where N is the total number of rules. For numerical stability, logarithmic space calculation is used to avoid product underflow.
[0093] Preferably, the denominator of the total probability is calculated using logarithmic space, with the base of the logarithmic transformation being the natural logarithm; the posterior probability value is accurate to six decimal places; and the numerical stability threshold is [value missing]. Likelihood values below this threshold are truncated to this threshold.
[0094] For example, the prior probability of rule R1 is 0.0067, and the likelihood is... The posterior probability calculated using Bayes' theorem is 0.0158.
[0095] Step S2.7: Normalize the posterior probability distribution of each rule into weight parameters and update them to the three-layer rule base to obtain the weight-updated three-layer rule base.
[0096] Preferably, the core of this step is the conversion and writing of posterior probability to rule weight. By normalizing the posterior probability distribution and mapping it back to the weight space, the current weight value of each rule in the three-layer rule base is replaced, thereby realizing the real-time dynamic update of the rule base weight.
[0097] Specifically, for the normalization operation, the posterior probability vector is divided by the maximum posterior probability value so that the weight values are distributed in the range of 0 to 1 with a maximum value of 1; for the weight update, all rules in the three-layer rule base are traversed, and the normalized weight values are written into the weight field of the corresponding rule to replace the original prior weights.
[0098] Preferably, the normalization method is maximum value normalization, and the weight value is equal to the posterior probability divided by the maximum posterior probability; the weight update adopts the overwrite method and does not retain historical weight values; after the weight is updated, the rule base version number is incremented by one; after the three-layer rule base is written, the rule base cache is refreshed.
[0099] For example, the maximum posterior probability is 0.0158, the normalized weight of rule R1 is 1.000, the posterior probability of rule R2 is 0.0079, and the normalized weight is 0.500.
[0100] Beneficial effects of steps S2.1 to S2.7: This series of steps uses a Bayesian inference algorithm to fuse performance data with real-time capacity status, calculates the posterior probability distribution and normalizes it into weight parameters, thereby enabling real-time dynamic updates of the weight parameters of each layer of rules.
[0101] The process includes the following steps: Step S2.1: Obtain the carrier's on-time performance rate and fulfillment rate to establish a quantitative representation of fulfillment capability; Step S2.2: Obtain the real-time location, availability, and number of new energy vehicles to establish a quantitative representation of transport capacity status; Step S2.3: Concatenate standardized fulfillment data with standardized real-time transport capacity status to form a Bayesian inference observation dataset; Step S2.4: Read the current weights of each rule in the three-layer rule base and map them to prior probability distributions to establish a mapping relationship between rule weights and probabilities; Step S2.5: Calculate the likelihood of the Bayesian inference observation dataset under the prior probability distributions of each rule; Step S2.6: Substitute the prior probability distributions and likelihoods into the Bayesian formula to calculate the posterior probability distributions of each rule; Step S2.7: Normalize the posterior probability distributions into weight parameters and update them to the three-layer rule base to complete real-time dynamic weight adjustment.
[0102] Step S3: Extract the triggering conditions, constraint types, and matching degrees of candidate rules from the three-layer rule base after weight update to construct rule feature vectors. Input the rule feature vectors into the attention neural network to calculate the decision score of each candidate rule and obtain the optimal rule sequence after DNN conflict resolution.
[0103] Furthermore, step S3 specifically includes the following steps: Step S3.1: Load the three-layer rule base after weight update and extract candidate rules to obtain a candidate rule list.
[0104] Preferably, the core of this step is to load and extract the candidate rule base. By reading the persistent file of the three-layer rule base after weight update and extracting it by layer and priority, a list of candidate rules to be processed is obtained, which serves as the raw data for the subsequent attention neural network input.
[0105] Specifically, for rule base loading, the rule base storage file is read and the current version of the three-layer rule base is parsed. After verifying the consistency between the version number and the memory cache, the rule is loaded into memory. For candidate rule extraction, the basic general layer, the industry tobacco layer, and the dynamic adaptation layer are traversed, and the rules of each layer are extracted in descending order of priority weight. For each rule, six fields are extracted: number, layer, trigger condition, constraint type, matching degree, and current weight.
[0106] Preferably, the rule base loading timeout threshold is five seconds. If the timeout occurs, a fallback loading strategy is triggered, loading only the basic general layer and the industry tobacco layer. The maximum capacity of the candidate rule list is set to two hundred rules. If the number exceeds two hundred, it is truncated according to priority weight. The data type of each field is string or floating-point number, and the value is accurate to four decimal places. The version number adopts an optimistic locking mechanism to verify the consistency of the version number during loading.
[0107] Step S3.2: Extract the triggering condition, constraint type, and matching degree of each rule in the candidate rule list to construct a candidate rule feature set.
[0108] Preferably, the core of this step is to extract the structured features of the candidate rules. By parsing the three dimensions of each rule—triggering condition, constraint type, and matching degree—these are mapped to a fixed-dimensional numerical feature vector, thus constructing a set of candidate rule features, which serves as the input tensor for the attention neural network.
[0109] Specifically, for trigger condition parsing, three sub-fields are extracted: product type, priority lower limit, and capacity type lower limit. For constraint type parsing, three sub-fields are extracted: time window constraint, load constraint, and route constraint. For matching degree parsing, three sub-fields are extracted: current matching degree of the rule, historical trigger frequency, and historical successful order allocation rate. The above nine numerical fields are concatenated into a nine-dimensional feature vector and normalized.
[0110] Preferably, in the product type, slim cigarettes are mapped to type 1, and regular cigarettes are mapped to type 2; in the priority lower limit, emergency is mapped to type 1, and high priority is mapped to type 2; in the capacity type lower limit, large vans are mapped to type 1, medium vans to type 2, and small vans to type 3; the time window constraint is marked as 1 for a valid time window and 0 for an invalid time window; the load constraint is the ratio of the total order weight to the vehicle's maximum load capacity; the route constraint is the ratio of the predicted mileage to the straight-line mileage; the matching degree, historical trigger frequency, and historical successful order allocation rate are all mapped to the 0 to 1 range using Min-Max normalization; the normalization uses global normalization parameters, and the mapping range is determined by historical statistical data.
[0111] For example, the triggering condition of rule R1 is the type of slim cigarette, the lower priority limit is emergency, the lower limit of the transport type is large van, the constraint type is time window constraint is valid and the load constraint is 0.75, the matching degree is 0.82, and the normalized nine-dimensional feature vector is [1.0,1.0,1.0,1.0,0.75,1.0,0.82,0.65,0.78].
[0112] Step S3.3: Input the set of rule features into the attention neural network, calculate the attention weight of each rule and other rules, and perform weighted aggregation to obtain attention-weighted features.
[0113] Preferably, the core of this step is to perform feature weighting aggregation of the attention mechanism. By inputting the set of candidate rule features into the attention neural network, calculating the attention weight of each rule relative to other rules and performing weighted summation, an attention weighted feature vector is obtained, which enhances the ability to model the correlation between rules.
[0114] Specifically, the attention mechanism employs a scaled dot product attention mechanism, which maps the nine-dimensional feature vector into a query vector, a key vector, and a value vector, each with a 64-dimensional dimension, using a pre-defined linear mapping matrix. For attention weight calculation, the transpose of the query vector and the key vector is multiplied as a matrix, and the result is divided by a scaling factor. ,in The value is 64, and then normalized using the Softmax function, as shown in the following formula:
[0115] Where Q is the query vector matrix, K is the key vector matrix, and V is the value vector matrix. is the scaling factor; for weighted aggregation, the attention weight matrix is multiplied by the value vector matrix to obtain the attention weighted feature vector of each rule, which has a dimension of 64.
[0116] Preferably, the query vector, key vector, and value vector are all 64-dimensional, with a scaling factor. The softmax function has the same dimension as the batch size of the rules, and after normalization, the sum of each attention weight is 1; the attention weight matrix has the same dimension. , where N is the number of candidate rules, and the matrix memory usage is controllable when N does not exceed 200; the attention-weighted feature dimension is 64-dimensional, consistent with the value vector dimension.
[0117] For example, the candidate rule list contains 150 rules, and the query vector is generated by linearly mapping the nine-dimensional feature vector of rule R1. Key vector Value vector , Key vectors of all rules Calculate the scaled dot product, normalize it with Softmax to obtain a 150-dimensional attention weight vector, and then aggregate it to output a 64-dimensional attention weight feature vector.
[0118] Step S3.4: The attention-weighted features are processed by activation function, and high-level interaction features are extracted through the feedforward network layer to obtain the enhanced feature vector.
[0119] Preferably, the core of this step is to complete the feature enhancement and nonlinear transformation of the feedforward network. By processing the attention-weighted features through activation functions and extracting them through feedforward network layers, higher-dimensional and more expressive high-level interactive features are obtained, thereby enhancing the representational ability of the rule features.
[0120] For the activation function, the ReLU activation function is used to set the negative values in the 64-dimensional attention-weighted features to zero. For the feedforward network layer, a two-layer fully connected network is used. The first layer maps the 64-dimensional input to 128 dimensions and activates it with ReLU. The second layer maps the 128-dimensional input to the 64-dimensional output. The calculation formula for the feedforward network is as follows:
[0121] Where x is a 64-dimensional attention-weighted feature. for Weight matrix, It is a 128-dimensional bias vector. for Weight matrix, It is a 64-dimensional bias vector.
[0122] Preferably, the negative output of the ReLU activation function is truncated to zero; the output dimension of the first layer of the feedforward network is set to 128 dimensions; the output dimension of the second layer is set to 64 dimensions, aligned with the dimension of the attention-weighted features; Dropout regularization is used between layers of the feedforward network, and the dropout rate is set to 0.1; the dimension of the enhanced feature vector is 64 dimensions.
[0123] Step S3.5: Input the enhanced feature vector into the decision layer to calculate the comprehensive decision score and obtain the decision score for each rule.
[0124] Preferably, the core of this step is to complete the final calculation of the rule decision score. By inputting the enhanced feature vector into the decision layer and performing a linear transformation, the comprehensive decision score of each candidate rule is output, which serves as the basis for rule priority ranking and conflict resolution.
[0125] Specifically, for the linear transformation of the decision layer, the 64-dimensional enhanced feature vector is input into the linear output layer and mapped to a one-dimensional decision score value.
[0126] Preferably, the dimension of the decision-making layer weight matrix is: The decision score is not normalized and the original score is output. The range of the decision score is affected by the output range of the feedforward network and is usually in the real number domain. The larger the positive value of the decision score, the higher the priority of the rule, and the negative value indicates that the rule is less applicable.
[0127] Step S3.6: Sort the decision scores of each rule in descending order, and eliminate candidate rules that violate high-priority rules in turn to obtain the optimal rule sequence after DNN conflict resolution.
[0128] Preferably, the core of this step is to intelligently resolve rule conflicts and output the optimal sequence. By arranging all candidate rules in descending order of decision score, we check whether high-priority rules conflict with candidate rules in turn. If there is a conflict, we remove low-priority candidate rules and finally output the optimal rule sequence after DNN conflict resolution.
[0129] In the case of conflict determination, a conflict is determined when a high-priority rule and a candidate rule have completely overlapping triggering conditions and mutually exclusive constraint types. Overlapping triggering conditions mean that the product type and the lower priority limit are exactly the same, and mutually exclusive constraint types mean that one rule requires a time window constraint while the other rule does not.
[0130] For example, the trigger condition for high-priority rule R1 is a slim cigarette plus an emergency priority. The trigger condition for low-priority candidate rule R50 is also a slim cigarette plus an emergency priority, but R50 has no time window constraint while R1 has a time window constraint. In this case, R50 is determined to conflict with R1 and is eliminated.
[0131] Preferably, the overlapping trigger conditions in the conflict determination adopt a full matching strategy, and the product type and priority lower limit are considered to be overlapping when they are the same; the constraint type exclusion determination adopts XOR logic, and the constraint labels are considered to be exclusion when they are inconsistent; the rule sequence is output in descending order of decision score, and a maximum of one hundred final rules are retained.
[0132] Beneficial effects of steps S3.1 to S3.6: This series of steps uses an attention neural network to extract features and score candidate rules, resolves rule conflicts under the guidance of attention weights, and outputs the optimal rule sequence after DNN conflict resolution.
[0133] The process includes the following steps: Step S3.1: Load the updated three-layer rule base and extract candidate rules to establish a candidate rule set; Step S3.2: Extract the triggering conditions, constraint types, and matching degrees of the candidate rules to construct a rule feature set; Step S3.3: Calculate attention weights using an attention neural network and perform weighted aggregation to establish rule relationships; Step S3.4: Extract high-level interaction features using a feedforward network layer to enhance the representational ability of rule features; Step S3.5: Calculate the decision score for each rule and establish a rule priority order; Step S3.6: Sort the decision scores in descending order and exclude candidate rules that violate high-priority rules, outputting the optimal rule sequence after DNN conflict resolution.
[0134] Step S4: Obtain order data and real-time capacity status, and calculate the optimal order allocation scheme based on the optimal rule sequence after DNN conflict resolution using comprehensive decision scoring.
[0135] Furthermore, step S4 specifically includes the following steps: Step S4.1: Obtain the product specifications, priority, and unloading window of the order data to obtain the order dataset.
[0136] Preferably, the core of this step is to extract and structure the order feature data. By reading three key fields—product specifications, priority, and unloading window—from the order master data, the original data foundation of the order dataset is constructed, providing order-side input for subsequent order matching.
[0137] Specifically, for product specifications, the extraction order includes the types of tobacco products; for priority, the extraction order is marked with its urgency level; and for unloading window, the extraction order is set within the required delivery time range.
[0138] Preferably, the product specifications are classified into two levels: slim cigarettes and regular cigarettes; the priority is classified into two levels: urgent orders and high priority orders; and the unloading window is stored in the form of timestamps, accurate to the minute.
[0139] For example, if the order number indicates a product type of slim cigarette, the priority is urgent, and the unloading window is YYYY-MM-DD-HH:MM:SS.
[0140] Step S4.2: Obtain the vehicle location, availability, and fuel level of the real-time transport capacity status to obtain the real-time transport capacity status set.
[0141] Preferably, the core of this step is to extract and structure the capacity feature data. By reading three key fields—vehicle location, availability, and fuel level—from the capacity scheduling system, the original data foundation for the real-time capacity status set is constructed, providing capacity-side input for subsequent order matching.
[0142] Specifically, for vehicle location, the current BeiDou positioning coordinates of the vehicle are obtained; for availability status, the current dispatch status marker of the vehicle is obtained; and for fuel level, the current fuel or battery level of the vehicle is obtained.
[0143] Preferably, the vehicle location is stored in latitude and longitude coordinates; the available status is divided into three states: idle, in transit, and under maintenance; the fuel level is a percentage value, accurate to an integer.
[0144] For example, the current location of a vehicle with license plate number A is the latitude and longitude coordinates of a certain district in a certain city, its available status is idle, and its fuel level is 80%.
[0145] Step S4.3: Merge the order dataset, the real-time capacity status set, and the optimal rule sequence after DNN conflict resolution into a candidate order dataset.
[0146] Preferably, the core of this step is to complete the horizontal fusion of multi-source data. By horizontally splicing the order dataset, real-time capacity status set and the optimal rule sequence after DNN conflict resolution according to the rule matching conditions, a complete record of the candidate score dataset is constructed, providing basic data for subsequent score calculation.
[0147] For data merging, the order record is traversed using the order record as the primary key. Each order record is concatenated with the capacity record that meets the rule triggering conditions using a Cartesian product. During the concatenation, it is verified whether the rule triggering conditions are met simultaneously.
[0148] Preferably, each record in the candidate split dataset contains five key fields: order ID, vehicle ID, rule sequence matching flag, time window matching flag, and load matching flag; the maximum number of records to be merged in a single batch is set to 10,000.
[0149] For example, order YYYY-MM-DD-HH:MM:SS-001 and vehicle “A-XXX-001” meet the triggering condition of rule R1, generating one candidate record, with the rule sequence matching mark set to one, the time window matching mark set to one, and the load matching mark set to one.
[0150] Step S4.4: Calculate the rule matching degree between each candidate record in the candidate single dataset and the optimal rule sequence after DNN conflict resolution, and obtain the rule matching degree score set.
[0151] Preferably, the core of this step is to complete the metric calculation of the matching between candidate records and rule sequences. By traversing each record in the candidate single dataset, the matching of trigger conditions between each record and each rule in the optimal rule sequence after DNN conflict resolution is verified one by one, and the weighted matching degree score is calculated to obtain the rule matching degree score set.
[0152] For the matching degree calculation, the rules in the optimal rule sequence are traversed one by one to verify whether the order attributes and capacity attributes of the candidate records meet the triggering conditions of the rules. If they do, the decision score weight of the rule is accumulated and finally normalized to a matching degree value in the range of 0 to 1.
[0153] Preferably, when calculating the matching degree, the rule weight is taken as the proportion of each rule's decision score to the total score; normalization is performed by dividing by the highest matching degree; and the matching degree value is accurate to four decimal places.
[0154] For example, a candidate record is matched with three rules R1, R2, and R3 in the optimal rule sequence, with R1 accounting for 40% of the decision score, R2 accounting for 35%, and R3 accounting for 25%.
[0155] Step S4.5: The rule matching score set and the candidate score set are weighted and fused to calculate the comprehensive decision score, thus obtaining the comprehensive decision score set.
[0156] Preferably, the core of this step is to calculate the comprehensive score of multiple factors. By weighting and integrating the rule matching degree with factors such as order priority and capacity adaptability in the candidate order dataset, the comprehensive decision score of each candidate record is calculated, and the comprehensive decision score set is output as the basis for order sorting.
[0157] For weighted fusion, the comprehensive decision score is equal to the rule matching degree multiplied by the rule matching degree weight, plus the order priority score multiplied by the order priority weight, plus the capacity suitability score multiplied by the capacity suitability weight, where the sum of the weights of each dimension is 1.
[0158] Preferably, the rule matching degree weight is set to 0.5; the order priority weight is set to 0.3; the capacity matching degree weight is set to 0.2; and the comprehensive decision score is accurate to four decimal places.
[0159] For example, if a candidate record has a rule matching degree of 1, an order priority score of 0.9, and a capacity suitability score of 0.85, the comprehensive decision score is equal to 0.5×1+0.3×0.9+0.25×0.85=0.9625.
[0160] Step S4.6: Sort the comprehensive decision score set in descending order and select the candidate score record with the highest score as the optimal score scheme.
[0161] Preferably, the core of this step is to determine the optimal allocation scheme. By sorting the comprehensive decision score set in descending order of score, the candidate allocation record ranked first is selected as the optimal allocation scheme for the current round, and the vehicle allocation results and execution parameters are output.
[0162] Specifically, for the sorting selection, the order is sorted from high to low based on the comprehensive decision score. If the scores are the same, the order is sorted in descending order based on the order priority. If the priorities are still the same, the order is sorted in descending order based on the rule matching degree. The candidate record ranked first is selected as the optimal order allocation scheme.
[0163] Preferably, the sorting uses the quicksort algorithm, with an average time complexity of O(NlogN); the output of the optimal order splitting scheme includes three fields: order ID, vehicle ID, and order splitting timestamp; the order splitting timestamp is accurate to the second.
[0164] For example, the candidate record with the order ID YYYY-MM-DD-HH:MM:SS-001 ranked first after the comprehensive decision score set is sorted in descending order, and the vehicle "A-XXX-001" and the order timestamp of a certain year, month and day at 12:30:45 (de-identified), this record is selected as the optimal order allocation scheme.
[0165] Beneficial effects of steps S4.1 to S4.6: This series of steps selects candidate order records in descending order through comprehensive decision scoring, and outputs the order scheme with the highest score, thus achieving the optimal match between orders and transportation capacity.
[0166] The process involves the following steps: Step S4.1: Obtain the product specifications, priorities, and unloading windows of the order data to establish order feature representation; Step S4.2: Obtain the vehicle location, availability, and fuel level of the real-time transportation capacity to establish transportation capacity feature representation; Step S4.3: Merge the order dataset, the real-time transportation capacity status set, and the optimal rule sequence into a candidate order allocation dataset; Step S4.4: Calculate the rule matching degree between the candidate records and the optimal rule sequence; Step S4.5: Perform weighted fusion calculation of the rule matching degree score set and the candidate order allocation dataset to calculate the comprehensive decision score; Step S4.6: Sort the comprehensive decision score set in descending order, select the candidate record with the highest score, and output the optimal order allocation scheme.
[0167] Step S5: Push the optimal order splitting plan to external logistics scheduling systems of different dimensions to trigger multi-system linkage execution and obtain the multi-system linkage execution result.
[0168] Furthermore, step S5 specifically includes the following steps: Step S5.1: Extract the vehicle number, task route, and order timestamp of the optimal order allocation scheme to obtain the order allocation scheme execution data packet.
[0169] Preferably, the core of this step is to extract the core fields of the optimal order allocation scheme. By reading the three key fields of vehicle number, task route and order allocation timestamp from the optimal order allocation scheme, an execution data package for the order allocation scheme is constructed as input data for subsequent multi-system linkage execution.
[0170] Specifically, for vehicle number, the license plate identifier of the assigned vehicle is extracted; for task route, the transportation path from loading point to unloading point is extracted; and for order timestamp, the system order time is extracted.
[0171] Preferably, the vehicle number format is "X-XXX-AAA", where the letters represent the location, the numbers represent the serial number, and the letters represent the fleet number; the mission route is stored in the form of start and end coordinate pairs; and the order timestamp format is "YYYY-MM-DD-HH:MM:SS".
[0172] For example, the optimal order splitting scheme has vehicle number "A-XXX-001", task route from "loading point in XX city XX district" to "unloading point in XX city XX district", and order splitting timestamp "YYYY-MM-DD-HH:MM:SS".
[0173] Step S5.2: Push the vehicle allocation data of the order splitting scheme to the Beidou transportation capacity resource pool, lock the allocated vehicles and update the vehicle status to the waiting-to-load status.
[0174] Preferably, the core of this step is to complete the system locking of vehicle capacity. By calling the Beidou capacity resource pool interface, a vehicle allocation request is sent and the corresponding vehicle is marked as waiting to be loaded in the system, thereby realizing the pre-locking of capacity resources and providing capacity guarantee for the subsequent issuance of transportation tasks.
[0175] Specifically, for the BeiDou transportation capacity resource pool, the transportation capacity resource pool locking interface is called via HTTP POST request. The request body includes the vehicle number, order timestamp, and target status. For status updates, the system internally marks the vehicle status as pending loading and records the status change timestamp.
[0176] Preferably, the timeout threshold for the BeiDou transportation capacity resource pool interface is three seconds; the status update adopts an optimistic locking mechanism, and the update is overwritten when the version number is consistent; the pending loading status is marked as "TOBE_LOADED".
[0177] For example, after the vehicle number "A-XXX-001" is pushed to the Beidou transportation capacity resource pool, the system successfully locks it, and the vehicle status is updated to "ready to load".
[0178] Step S5.3: Merge the capacity lock confirmation result with other data from the order splitting scheme, generate a transportation task order, and push it to the logistics scheduling system.
[0179] Preferably, the core of this step is to generate and issue transportation task orders. By merging the capacity lock confirmation result with the order information and task routes in the order allocation plan, a standardized transportation task order is generated and pushed to the logistics scheduling system, so that the task can be issued to the execution system.
[0180] Specifically, for task order generation, the vehicle information, order information, and task route information in the capacity lock confirmation result are integrated into a structured task order; for logistics dispatch system push, the task issuance interface of the dispatch system is called in the form of an HTTP POST request, and the request body contains the complete content of the task order.
[0181] Preferably, the transportation task order includes seven fields: task order number, vehicle number, order ID list, loading point coordinates, unloading point coordinates, estimated departure time, and estimated arrival time; the logistics dispatch system interface timeout threshold is five seconds.
[0182] For example, after the transportation task order number "TSK-YYYY-0001" is generated, it is pushed to the logistics scheduling system. The system receives it successfully and returns a task order confirmation.
[0183] Step S5.4: Push the task route coordinates in the transportation task order to the electronic fence system and set the driving monitoring area.
[0184] Preferably, the core of this step is to configure the electronic fence monitoring area. By pushing the loading point coordinates and unloading point coordinates in the transportation task order to the electronic fence system, the allowable range of vehicle travel and alarm rules are set to achieve full monitoring of the transportation process.
[0185] Specifically, for the electronic fence configuration, a rectangular or polygonal monitoring area is generated based on the coordinates of the loading and unloading points, with the fence edge extending 500 meters beyond the actual path; for alarm rules, out-of-area alarm thresholds and dwell timeout thresholds are set.
[0186] Preferably, the edge extension distance of the electronic fence is set to 500 meters; the out-of-area threshold in the alarm rules is set to 100 meters, the dwell timeout threshold is set to 30 minutes, and the electronic fence system interface timeout threshold is 3 seconds.
[0187] For example, after the coordinates of the loading point "No. X, X Road, XX District, XX City" and the coordinates of the unloading point "No. X, X Road, XX District, XX City" are pushed to the electronic fence system, the monitoring area is successfully set up.
[0188] Step S5.5: Write the electronic fence monitoring configuration data, transportation task order and capacity lock confirmation results into the historical trajectory analysis system to establish an execution traceability record.
[0189] Preferably, the core of this step is to persistently store the execution data. By writing the electronic fence monitoring configuration data, transportation task order and capacity lock confirmation results into the historical trajectory analysis system, a complete execution traceability chain is constructed, providing a data foundation for subsequent verification analysis and trajectory playback.
[0190] Specifically, for data writing, the historical trajectory analysis system is written in the form of structured data, and the storage medium is a distributed file system; for tracing records, each record is associated with a unique tracing ID and marked with a timestamp.
[0191] Preferably, the historical trajectory analysis system adopts an append-only writing method; each record is stored and retained for 180 days; the traceability ID format is “TRACE-YYYYMMDD-XXXXXX”.
[0192] For example, the record with traceability record ID "TRACE-2026MMDD-000001" was successfully written, and the associated transport task order TSK-2026-0001 and capacity lock confirmation result were linked.
[0193] Step S5.6: Aggregate the execution results of each external system into multi-system linkage execution results to establish a complete execution chain.
[0194] Preferably, the core of this step is to complete the final aggregation of the results of multi-system linkage execution. By summarizing the locking results of the Beidou transportation capacity resource pool, the task order confirmation results of the logistics scheduling system, the configuration results of the electronic fence system, and the writing results of the historical trajectory analysis system, the results are aggregated into a unified multi-system linkage execution result, marking that the current sub-order has entered the execution stage.
[0195] Specifically, for result aggregation, the status flags and execution parameters returned by each system are integrated into a structured result object; for execution chain, a time sequence table from order splitting to execution is established.
[0196] Preferably, the multi-system linkage execution result includes four status fields: Beidou locking status, logistics scheduling status, electronic fence status, and historical trajectory status; the status is marked as "SUCCESS" or "FAILED"; and the execution chain time series table is accurate to the second.
[0197] For example, the execution result of each system is SUCCESS, the execution results of multiple systems are successfully aggregated, and the time interval between the order splitting time and the execution start time is five minutes.
[0198] Beneficial effects of steps S5.1 to S5.6: This series of steps pushes the optimal order allocation plan to the Beidou transportation capacity resource pool, logistics scheduling system, electronic fence system, and historical trajectory analysis system, achieving precise connection between the order allocation plan and the logistics execution system.
[0199] The process includes the following steps: Step S5.1: Extract the vehicle number, task route, and order timestamp of the optimal order allocation scheme to establish an execution data package for the order allocation scheme; Step S5.2: Push the vehicle allocation data of the order allocation scheme to the Beidou transportation capacity resource pool, lock the allocated vehicles, and update their status to "pending loading"; Step S5.3: Merge and push the transportation capacity locking confirmation results to the logistics scheduling system to generate a transportation task order; Step S5.4: Push the route and coordinates in the transportation task order to the electronic fence system to set up the driving monitoring area; Step S5.5: Write the fence monitoring configuration data, transportation task order, and transportation capacity locking confirmation results into the historical trajectory analysis system to establish an execution traceability record; Step S5.6: Aggregate the execution results of multiple systems into multi-system linkage execution results to establish a complete execution chain.
[0200] Furthermore, step S6 specifically includes the following steps: Step S6.1: Extract the actual execution path, vehicle status changes, and task completion time from the multi-system linkage execution results to obtain the actual execution dataset.
[0201] Preferably, the core of this step is to extract the actual execution data. By reading the actual driving path, vehicle status change records and task completion timestamps from the multi-system linkage execution results, an actual execution dataset is constructed to provide a comparison benchmark for subsequent verification and analysis.
[0202] Specifically, for the actual execution path, the vehicle driving coordinate sequence is extracted from the historical trajectory analysis system; for vehicle status changes, the status change time sequence is extracted; and for task completion time, the timestamp of actual arrival at the unloading point and completion of unloading is extracted.
[0203] Preferably, the actual execution path is stored in the form of a coordinate array, with a sampling interval of one minute; the vehicle status change record includes the status name and timestamp; and the task completion time is accurate to the second.
[0204] For example, the actual execution path is the coordinate sequence [coordinate_001,coordinate_002,…], the vehicle state change sequence is [TOBE_LOADED→IN_TRANSIT→ARRIVED], and the task completion time is “YYYY-MM-DD-HH:MM:SS”.
[0205] Step S6.2: Compare the actual execution data with the optimal rule sequence obtained by DNN conflict resolution one by one, calculate the rule matching degree, and calculate the on-time performance rate of the task completion time and the scheduled unloading window.
[0206] Preferably, this step involves the dual calculation of rule matching degree and on-time performance rate. By comparing the actual execution data with the triggering conditions and constraints in the optimal rule sequence one by one, the rule matching degree score is calculated. At the same time, the actual task completion time is compared with the scheduled unloading window to calculate the on-time performance rate.
[0207] Specifically, for the rule matching degree calculation, it verifies whether the actual execution path is within the range allowed by the electronic fence and whether the vehicle status change meets the rule execution requirements; for the on-time performance rate calculation, it compares the task completion time with the scheduled unloading window time, and the calculation formula is: On-time performance rate = min(1, scheduled window time / actual completion time).
[0208] Preferably, the rule matching degree output range is 0 to 1; the on-time performance rate output range is 0 to 1; and the value is accurate to four decimal places.
[0209] For example, the triggering condition of rule R1 is fully met, and the rule matching degree is 1.0000; the scheduled unloading window is "2026-04-19-14:00:00", the actual completion time is "YYYY-MM-DD-HH:MM:SS+30min", and the on-time performance rate = min(HH:MM:SS / HH:MM:SS+30min) = 0.9787.
[0210] Step S6.3: Compare the rule matching degree and the on-time performance rate with the preset matching degree threshold and the preset on-time performance rate threshold, respectively, and output the threshold comparison results.
[0211] Preferably, the core of this step is to determine and output the verification results. By comparing the calculated rule matching degree and on-time performance rate with preset thresholds, it is determined whether the current order execution meets the expected requirements, and the threshold comparison result is output as the triggering basis for subsequent weight iterations.
[0212] Specifically, for threshold comparison, the rule matching degree is compared with the preset matching degree threshold, and the on-time delivery rate is compared with the preset on-time delivery rate threshold. If both are satisfied, "PASS" is output; otherwise, "FAIL" is output.
[0213] Preferably, the preset matching threshold is set to 0.8; the preset on-time rate threshold is set to 0.85; and the threshold comparison result is marked as "PASS" or "FAIL".
[0214] For example, if the rule matching degree is 1.0000 and the on-time performance rate is 0.9787, which are higher than the thresholds of 0.8 and 0.85 respectively, the threshold comparison result is "PASS".
[0215] Step S6.4: When the threshold comparison result is not met, the rule matching degree and the on-time performance rate are input into the Bayesian inference algorithm to calculate the update parameters of each rule weight.
[0216] Preferably, the core of this step is to perform iterative update calculation of rule weights. This step is triggered when the threshold comparison result is "FAIL". By inputting the rule matching degree and the on-time performance rate as new observation data into the Bayesian inference algorithm, the weight update parameters of each rule are calculated, providing an optimized data basis for the next round of order allocation decision.
[0217] Specifically, for the weight update calculation, the Bayesian inference process in step S2 is followed, and the prior weights of each rule are updated using the rule matching degree and the on-time performance rate as observation evidence; for the weight adjustment, the calculated weight update parameters are marked as the state to be applied.
[0218] Preferably, the parameters of the Bayesian inference algorithm are the same as in step S2; the weight update parameters are recorded in the form of differences, and the update parameter = new posterior weight - current weight.
[0219] For example, if the threshold comparison result is "FAIL", the Bayesian inference algorithm is triggered, and the weight update parameters are calculated: the weight update parameter for rule R1 is -0.05, and the weight update parameter for rule R2 is +0.03.
[0220] Step S6.5: Write the weight update parameters into the three-layer rule base after weight update and replace the prior weight parameters of the corresponding rules.
[0221] Preferably, the core of this step is to complete the final update and writing of the rule weights. By applying the calculated weight update parameters to the current three-layer rule base, the weight values of each corresponding rule are replaced, thereby realizing the knowledge iteration of the rule base.
[0222] Specifically, for weight writing, each rule in the three-layer rule base is traversed, the weight update parameter is added to the current weight value, a new weight value is generated and written over it; for version management, the rule base version number is incremented and the update time is marked as the current time.
[0223] Preferably, the weight update adopts an incremental update method; after writing, a full refresh of the rule base cache is triggered; the version number format is "YYYYMMDDHHMMSS" with a total of fourteen digits.
[0224] For example, rule R1 originally had a weight of 1.0000, the weight update parameter was -0.05, and the new weight was 0.9500. Rule R2 originally had a weight of 0.9500, the weight update parameter was +0.03, and the new weight was 0.9800. The rule base version number was updated to "YYYYMMDDHHMMSS".
[0225] Step S6.6 outputs the three-layer rule base and the optimal order allocation scheme after weight iteration, providing an optimized data foundation for the next round of order allocation decisions.
[0226] Preferably, the core of this step is to complete the final output of the order allocation decision for this round. By outputting the updated rule base version and the optimal order allocation scheme determined in the current round, the last link of the "decision-execution-feedback-iteration" closed loop is completed, providing the latest optimized data foundation for the next round of order allocation decision.
[0227] The output includes the complete content of the three-layer rule base after weight iteration, including the rules of each layer and their updated weight values; it also outputs the execution parameters of the optimal order splitting scheme.
[0228] Preferably, the rule base output format is a JSON file; the optimal order splitting scheme output includes three fields: order ID, vehicle ID, and order splitting timestamp; the output is marked as "DONE".
[0229] For example, after the output weight iteration, the version number of the three-layer rule base is "YYYYMMDDHHMMSS", the optimal order ID for order allocation is "Order-2026-0001", the vehicle ID is "A-XXX-001", and the order allocation timestamp is "YYYY-MM-DD-HH:MM:SS".
[0230] Beneficial effects of steps S6.1 to S6.6: This series of steps conducts quantitative verification with the rule matching degree and the on-time fulfillment rate as double benchmarks, triggers Bayesian weight iteration when the preset threshold is not met, and provides an optimized data basis for the next round of order allocation decisions.
[0231] Among them, step S6.1 extracts the actual execution path, vehicle status changes, and task completion time from the multi-system linkage execution results to establish an actual execution data set; step S6.2 compares the actual execution data with each item in the optimal rule sequence to calculate the rule matching degree, and calculates the on-time fulfillment rate of the task completion time and the scheduled unloading window; step S6.3 compares the rule matching degree and the on-time fulfillment rate with the preset threshold respectively, and outputs the threshold comparison result; step S6.4 calculates the weight update parameters for each rule when the threshold comparison result is not met; step S6.5 writes the weight update parameters into the three-layer rule base after weight update, replacing the prior weight parameters of the corresponding rules; step S6.6 outputs the three-layer rule base after weight iteration and the optimal order allocation plan, providing an optimized data basis for the next round of order allocation decisions.
[0232] In summary, the overall beneficial effects of steps S1 to S6 in this embodiment are as follows: This method conducts offline training on the three-layer rule base through the decision tree algorithm, establishes a hierarchical structure and initial priority ranking of the basic general layer, the industry tobacco layer, and the dynamic adaptation layer, enabling the rule base to have a structured knowledge framework at the initialization stage; calculates the posterior probability distribution by fusing fulfillment data and real-time transport capacity status through the Bayesian inference algorithm, and dynamically updates the rule weight parameters of each layer, enabling the rule base to continuously adjust decision preferences according to actual business data; extracts features and makes decision scores for candidate rules through the attention neural network, resolves rule conflicts under the guidance of attention weights, and outputs the optimal rule sequence; conducts weighted fusion of order specifications, real-time transport capacity, and the optimal rule sequence through comprehensive decision scores, combines multi-system linkage execution and quantitative verification to trigger weight iteration, forming a complete closed loop of "decision - execution - feedback - iteration", and realizing the transformation of order allocation decisions from manual design to data-driven.
[0233] Step S1 involves offline training of the three-layer rule base using a decision tree algorithm to establish a hierarchical structure and initial priority ranking of the basic general layer, the industry tobacco layer, and the dynamic adaptation layer, providing a structured knowledge foundation for order allocation decisions. Step S2 uses a Bayesian inference algorithm to fuse performance data and real-time capacity status, mapping the observed dataset to a prior probability distribution and calculating the posterior probability, enabling real-time dynamic updates of the rule weight parameters at each layer, allowing the rule base to continuously adjust decision preferences in accordance with actual business data. Step S3 uses an attention neural network to extract features from candidate rules, weighting and aggregating them with attention weights and extracting high-level interaction features through a feedforward network layer, based on... Step S4 resolves rule conflicts by sorting decision scores in descending order and outputs the optimal rule sequence after DNN conflict resolution. Step S5 uses comprehensive decision scores to weight and fuse order specifications, real-time transportation capacity, and the optimal rule sequence, selecting the optimal order allocation scheme in descending order of scores to achieve optimal matching under multiple factors. Step S6 pushes the optimal order allocation scheme to the Beidou transportation capacity resource pool, logistics scheduling system, electronic fence system, and historical trajectory analysis system to achieve precise connection between the order allocation scheme and the logistics execution system. Step S7 establishes a quantitative verification mechanism for rule matching degree and on-time performance rate. When the verification result does not meet the preset threshold, Bayesian weight iteration is triggered to achieve a self-evolutionary closed loop of rule base weights.
[0234] like Figure 2 As shown, this embodiment provides an example of a logistics order allocation decision system based on a rule base. In this embodiment, the logistics order allocation decision system is applied to the logistics order allocation decision method as described in the above embodiment.
[0235] Specifically, the logistics order allocation decision system includes a three-layer rule base construction module 1, a three-layer rule base update module 2, a rule sequence conflict resolution module 3, an optimal order allocation scheme calculation module 4, an optimal order allocation scheme execution module 5, and a three-layer rule base iteration module 6, which are connected electrically or through communication in sequence.
[0236] The three-layer rule base construction module 1 acquires order data, transportation capacity data, historical order splitting records, and multi-source environmental data as a logistics-related dataset. Based on this dataset, a three-layer rule base structure is constructed and trained offline using a decision tree algorithm to obtain a three-layer rule base sorted by decision tree priority. The three-layer rule base update module 2 acquires performance data and real-time transportation capacity status and inputs them into a Bayesian inference algorithm to calculate the weight parameters of each layer of the three-layer rule base, resulting in a weight-updated three-layer rule base. The rule sequence conflict resolution module 3 extracts the triggering conditions, constraint types, and matching degrees of candidate rules from the weight-updated three-layer rule base to construct rule feature vectors. These feature vectors are then input into an attention neural network to calculate the decision score for each candidate rule, resulting in a DNN conflict resolution algorithm. The optimal rule sequence after resolution; the optimal order allocation scheme calculation module 4 is used to obtain order data and real-time transportation capacity status, and calculate the optimal order allocation scheme of the optimal rule sequence after conflict resolution of order data, real-time transportation capacity status and DNN through comprehensive decision scoring; the optimal order allocation scheme execution module 5 is used to push the optimal order allocation scheme to external logistics scheduling systems of different dimensions, trigger multi-system linkage execution, and obtain the multi-system linkage execution result; the three-layer rule base iteration module 6 is used to calculate the rule matching degree and on-time performance rate of the multi-system linkage execution result and the preset verification threshold. If the matching degree requirement or the on-time performance rate requirement is not met, the Bayesian inference weight update of the three-layer rule base is triggered, and the weighted iterated three-layer rule base is output for the next round of order allocation decision, and the optimal order allocation scheme is output as the final order allocation scheme of the current round.
[0237] like Figure 3 As shown, the electronic device 7 includes a processor 71 and a memory 72 coupled to the processor 71.
[0238] The memory 72 stores program instructions for implementing the rule-based logistics order allocation decision method of any of the above embodiments.
[0239] The processor 71 is used to execute program instructions stored in the memory 72 to make rule-based logistics order allocation decisions.
[0240] The processor 71 can also be referred to as a CPU (Central Processing Unit). The processor 71 may be an integrated circuit chip with signal processing capabilities. The processor 71 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor.
[0241] Furthermore, Figure 4This is a schematic diagram of the structure of a storage medium according to an embodiment of this application. See also: Figure 4 The storage medium 8 in this embodiment stores program instructions 81 capable of implementing all the above methods. These program instructions 81 can be stored in the storage medium as a software product and include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to perform all or part of the steps of the methods in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, or terminal devices such as computers, servers, mobile phones, and tablets.
[0242] In the several embodiments provided in this application, it should be understood that the disclosed systems, methods, and approaches can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For instance, the logistics order allocation decision of a unit is only a logical function of logistics order allocation decision-making. In actual implementation, there may be other logistics order allocation decision-making methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not performed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces. The indirect coupling or communication connection of the system or unit may be electrical, mechanical, signal, or other forms.
[0243] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units. The above are merely embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made based on the description and drawings of this application, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A logistics order allocation decision-making method based on a rule base, characterized in that, The logistics order allocation decision-making method includes: Step S1: Obtain order data, transportation capacity data, historical order splitting records, and multi-source environmental data as a logistics association dataset. Based on the logistics association dataset, construct a three-layer rule base structure and train it offline using a decision tree algorithm to obtain a three-layer rule base sorted by decision tree priority. Step S2: Obtain performance data and real-time capacity status, and input them into the Bayesian inference algorithm to calculate the weight parameters of each rule in the three-layer rule base, so as to obtain the three-layer rule base after weight update. Step S3: Extract the triggering conditions, constraint types, and matching degrees of the candidate rules in the three-layer rule base after the weight update to construct rule feature vectors, and input the rule feature vectors into the attention neural network to calculate the decision score of each candidate rule, so as to obtain the optimal rule sequence after DNN conflict resolution; Step S4: Obtain the order data and the real-time transportation capacity status, and calculate the optimal order allocation scheme of the order data, the real-time transportation capacity status and the optimal rule sequence after DNN conflict resolution through comprehensive decision scoring; Step S5: Push the optimal order allocation scheme to external logistics scheduling systems of different dimensions to trigger multi-system linkage execution and obtain the multi-system linkage execution result; Step S6: Calculate the rule matching degree and on-time performance rate of the multi-system linkage execution result and the preset verification threshold. If the matching degree requirement or the on-time performance rate requirement is not met, trigger the Bayesian inference weight update of the three-layer rule base, output the three-layer rule base after weight iteration for the next round of order allocation decision, and output the optimal order allocation scheme as the final order allocation scheme for the current round.
2. The logistics order allocation decision-making method according to claim 1, characterized in that, Step S1: Obtain order data, transportation capacity data, historical order splitting records, and multi-source environmental data as a logistics association dataset. Based on the logistics association dataset, construct a three-layer rule base structure and train it offline using a decision tree algorithm to obtain a three-layer rule base sorted by decision tree priority, including: Step S1.1: Obtain the original order data and the original transportation capacity data. The original order data includes product specifications, priority, and unloading window. The original transportation capacity data includes vehicle type, current location, and fuel status. Step S1.2: Perform data processing on the original order data and the original transportation capacity data to output standardized order data and standardized transportation capacity data; Step S1.3: Obtain historical order records and perform data preprocessing on the historical order records. After associating the allocation result labels, obtain the historical order dataset with associated allocation result labels. Step S1.4: Obtain weather data, road condition data, storage capacity data, and carbon emission index data to obtain multi-source environmental data, and perform format standardization processing on the multi-source environmental data to obtain standardized multi-source environmental data; Step S1.5: Initialize the three-layer rule base storage structure, where the basic general layer stores qualification compliance rules and cargo volume matching rules, the industry tobacco layer stores product specification priority rules, order response rules, and slim cigarette anti-compression rules, and the dynamic adaptation layer stores real-time weight update rules; Step S1.6: Using the three-layer rule base storage structure as the training framework, the historical single dataset and the standardized multi-source environmental data are trained offline using the decision tree classification algorithm to obtain the decision tree classification model; Step S1.7: Extract the classification priority results of each rule from the decision tree classification model to obtain a three-layer rule base classified by decision tree priority. Step S1.8: Sort the three-layer rule base classified by decision tree priority according to priority to obtain the three-layer rule base sorted by decision tree priority.
3. The logistics order allocation decision-making method according to claim 1, characterized in that, Step S2: Obtain performance data and real-time capacity status, and input them into a Bayesian inference algorithm to calculate the weight parameters of each layer of rules in the three-layer rule base, resulting in the weight-updated three-layer rule base, including: Step S2.1: Obtain the carrier's on-time rate and fulfillment rate as raw fulfillment data, and obtain standardized fulfillment data after data preprocessing; Step S2.2: Obtain the real-time location of vehicles, vehicle availability status, and number of new energy vehicles as the raw data for real-time transportation capacity. After data preprocessing, a standardized real-time transportation capacity status is obtained. Step S2.3: The standardized performance data and the standardized real-time transportation capacity status are concatenated to form a Bayesian inference observation dataset; Step S2.4: Read the current weight of each rule in the three-layer rule base sorted by decision tree priority, and map it to a prior probability distribution; Step S2.5: Calculate the likelihood of the Bayesian inference observation dataset under each rule prior probability distribution; Step S2.6: Substitute the prior probability distribution and likelihood of each rule into Bayes' formula to calculate the posterior probability distribution of each rule. Step S2.7: Normalize the posterior probability distribution of each rule into weight parameters and update them to the three-layer rule base to obtain the weight-updated three-layer rule base.
4. The logistics order allocation decision-making method according to claim 1, characterized in that, Step S3: Extract the triggering conditions, constraint types, and matching degrees of candidate rules from the three-layer rule base after weight update to construct rule feature vectors. Input these feature vectors into an attention neural network to calculate the decision score for each candidate rule, obtaining the optimal rule sequence after DNN conflict resolution, including: Step S3.1: Load the three-layer rule base after weight update and extract candidate rules to obtain a candidate rule list; Step S3.2: Extract the triggering condition, constraint type, and matching degree of each rule in the candidate rule list to construct a rule feature set; Step S3.3: Input the set of rule features into the attention neural network, calculate the attention weight of each rule with other rules and perform weighted aggregation to obtain attention weighted features; Step S3.4: The attention-weighted features are processed by activation function, and high-level interaction features are extracted through the feedforward network layer to obtain the enhanced feature vector; Step S3.5: Input the enhanced feature vector into the decision layer to calculate the comprehensive decision score and obtain the decision score of each rule; Step S3.6: Sort the decision scores of each rule in descending order, and eliminate candidate rules that violate high-priority rules in turn to obtain the optimal rule sequence after DNN conflict resolution.
5. The logistics order allocation decision-making method according to claim 1, characterized in that, Step S4, obtain the order data and the real-time transport capacity status, and calculate the optimal order assignment plan of the order data, the real-time transport capacity status and the optimal rule sequence after DNN conflict resolution through comprehensive decision-making scoring, including: Step S4.1, obtain the product specifications, priorities, and unloading windows of the order data to obtain an order data set; Step S4.2, obtain the vehicle positions, available statuses, and fuel levels of the real-time transport capacity status to obtain a real-time transport capacity status set; Step S4.3, merge the order data set, the real-time transport capacity status set, and the optimal rule sequence after DNN conflict resolution into a candidate order assignment data set; Step S4.4, calculate the rule matching degree between each candidate record in the candidate order assignment data set and the optimal rule sequence after DNN conflict resolution to obtain a rule matching degree scoring set; Step S4.5, perform weighted fusion on the rule matching degree scoring set and the candidate order assignment data set to calculate the comprehensive decision-making score, and obtain a comprehensive decision-making score set; Step S4.6, sort the comprehensive decision-making score set in descending order, and select the candidate order assignment record with the highest score as the optimal order assignment plan.
6. The logistics order allocation decision method according to claim 1, characterized in that, Step S5, push the optimal order assignment plan to external logistics scheduling systems in different dimensions, trigger multi-system linkage execution, and obtain the multi-system linkage execution result, including: Step S5.1, extract the vehicle number, task route, and order assignment timestamp of the optimal order assignment plan to obtain order assignment plan vehicle allocation data; Step S5.2, push the order assignment plan vehicle allocation data to the Beidou transport capacity resource pool, lock the allocated vehicle and update the status to pending loading to obtain a transport capacity lock confirmation result; Step S5.3, merge the transport capacity lock confirmation result and the order assignment plan vehicle allocation data, and push them to the logistics scheduling system to generate a transportation task order to obtain transportation task order data; Step S5.4, extract the loading route and destination coordinates from the transportation task order data, and push them to the electronic fence system to set a driving monitoring area to obtain fence monitoring configuration data; Step S5.5, merge and write the fence monitoring configuration data, the transportation task order data, and the transport capacity lock confirmation result into the historical trajectory analysis system to obtain historical trajectory writing confirmation data; Step S5.6, aggregate the transport capacity lock confirmation result, the transportation task order data, the fence monitoring configuration data, and the historical trajectory writing confirmation data into a multi-system linkage execution result.
7. The logistics order allocation decision method according to claim 1, characterized in that, Step S6, calculate the rule matching degree and compliance on-time rate between the multi-system linkage execution result and the preset verification threshold. If the matching degree requirement or on-time rate requirement is not met, trigger Bayesian inference to update the three-layer rule base, output the three-layer rule base after weight iteration for the next round of order assignment decision-making, and output the optimal order assignment plan as the final order assignment plan for the current round, including: Step S6.1, extract the actual execution path, vehicle status changes, and task completion time of the multi-system linkage execution result to obtain an actual execution data set; Step S6.2: Compare the actual execution dataset with the optimal rule sequence after DNN conflict resolution one by one to calculate the rule matching degree, and calculate the on-time performance rate of the task completion time and the scheduled unloading window. Step S6.3: Compare the rule matching degree and the on-time performance rate with the preset matching degree threshold and the preset on-time performance rate threshold, respectively, to obtain the threshold comparison result; Step S6.4: If the threshold comparison result does not meet the matching degree requirement or the on-time rate requirement, then the rule matching degree and the on-time performance rate are input into the Bayesian inference algorithm to calculate the update parameters of each rule weight, and the update parameters of each rule weight are obtained. Step S6.5: Write the weight update parameters of each rule into the three-layer rule base after weight update to replace the prior weight parameters of the corresponding rule, and obtain the three-layer rule base after weight iteration. Step S6.6: Output the three-layer rule base after weight iteration and the optimal order allocation scheme. The optimal order allocation scheme is used as the final order allocation scheme for the current round, and the three-layer rule base after weight iteration is used for the order allocation decision in the next round.
8. A rule-based logistics order allocation decision system, wherein the logistics order allocation decision system is applied to the logistics order allocation decision method as described in any one of claims 1 to 7, characterized in that, The logistics order allocation decision system includes: The three-layer rule base construction module is used to acquire order data, transportation capacity data, historical order splitting records, and multi-source environmental data as a logistics association dataset. Based on the logistics association dataset, a three-layer rule base structure is constructed and trained offline using a decision tree algorithm to obtain a three-layer rule base sorted by decision tree priority. The three-layer rule base update module is used to obtain performance data and real-time capacity status and input them into the Bayesian inference algorithm to calculate the weight parameters of each layer of the rule base, so as to obtain the three-layer rule base after weight update. The rule sequence conflict resolution module is used to extract the triggering conditions, constraint types, and matching degrees of candidate rules in the three-layer rule base after weight update to construct rule feature vectors, and input the rule feature vectors into the attention neural network to calculate the decision score of each candidate rule, so as to obtain the optimal rule sequence after DNN conflict resolution; The optimal order allocation scheme calculation module is used to acquire the order data and the real-time transportation status, and calculate the optimal order allocation scheme of the order data, the real-time transportation status and the optimal rule sequence after DNN conflict resolution through comprehensive decision scoring; The optimal order allocation scheme execution module is used to push the optimal order allocation scheme to external logistics scheduling systems of different dimensions, trigger multi-system linkage execution, and obtain multi-system linkage execution results; The three-layer rule base iteration module is used to calculate the rule matching degree and on-time performance rate of the multi-system linkage execution results and preset verification thresholds. If the matching degree requirement or on-time performance rate requirement is not met, the Bayesian inference weight is triggered to update the three-layer rule base. The three-layer rule base after weight iteration is output for the next round of order allocation decision, and the optimal order allocation scheme is output as the final order allocation scheme for the current round.
9. An electronic device, characterized in that, The system includes a processor and a memory coupled to the processor, the memory storing program instructions that can be executed by the processor; when the processor executes the program instructions stored in the memory, it implements the logistics order allocation decision method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program instructions that, when executed by a processor, enable the logistics order allocation decision method as described in any one of claims 1 to 7.