A cold chain logistics temperature monitoring and path optimization method, system, terminal and medium
By using edge computing nodes and reinforcement learning algorithms, the real-time performance and multi-source data collaboration issues of the cold chain logistics system were solved, enabling second-level real-time control and multi-objective optimization of cold chain logistics, thereby improving transportation timeliness and reliability.
Patent Information
- Application Number
- CN202511308201.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-15
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2045-09-15
AI Technical Summary
Existing cold chain logistics systems are inadequate in terms of real-time performance, multi-source data collaboration, and dynamic decision-making capabilities, resulting in low transportation efficiency, high damage rates, and the inability of route optimization algorithms to dynamically adjust according to real-time transportation scenarios. Furthermore, emergency response strategies lack multi-dimensional risk prediction.
By deploying edge computing nodes for lightweight machine learning and anomaly detection, combined with a dynamic schema registration mechanism and reinforcement learning algorithms, real-time correlation and fusion of multi-source data can be achieved, the optimal transportation path can be dynamically calculated, and emergency control instructions can be generated.
It enables real-time control of cold chain logistics transportation at the second level, improves transportation timeliness, reliability and economy, reduces the risk of cargo damage, and achieves intelligent balance and optimization of multiple objectives.
Smart Images

Figure CN120806318B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of logistics and transportation, specifically to a method, system, terminal, and medium for temperature monitoring and route optimization in cold chain logistics. Background Technology
[0002] As a core link in ensuring the quality of temperature-sensitive goods such as food and pharmaceuticals, cold chain logistics has long faced key challenges in its technological development, including insufficient real-time performance, difficulties in multi-source data collaboration, and weak dynamic decision-making capabilities. Traditional cold chain monitoring systems mostly adopt a centralized architecture, relying on offline batch processing and manual intervention, which is difficult to adapt to the high-efficiency and high-concurrency demands of modern logistics.
[0003] The relevant systems generally adopt a centralized data processing model, where all sensor data must be transmitted to a cloud server for centralized processing. This architecture results in high transmission latency, which can reach minutes in areas with unstable network signals. This prevents the system from responding promptly to sudden temperature control anomalies during transit, leading to increased cargo damage rates. Furthermore, the edge computing side lacks computing power, making localized real-time analysis and decision-making impossible. All logic must be decided in the cloud, resulting in low system response efficiency.
[0004] The fusion of multi-source heterogeneous data is challenging. Cold chain logistics involves data streams from various sources, including vehicle sensors, traffic management systems, meteorological service APIs, and enterprise ERP systems. These data come in different formats and use different protocols. Traditional solutions generally rely on periodic ETL (Extract-Transform-Load) operations for data integration, resulting in low data update frequency and the formation of "data silos" between systems. For example, when a traffic accident causes congestion on a certain road segment, vehicles cannot obtain this information in time and replan their routes, often having to wait for the next ETL cycle to update their routes, leading to a significant extension of transportation time.
[0005] The path optimization algorithms of related systems are mostly based on historical experience data and fixed rules. The cost models usually use linear weighted functions with fixed preset weights, which cannot be dynamically adjusted according to real-time transportation scenarios (such as in-vehicle temperature control status and sudden weather changes). At the same time, emergency response strategies are usually just simple threshold alarms (such as triggering an alarm when the temperature exceeds 8°C), lacking a hierarchical and layered response mechanism based on multi-dimensional risk prediction, and the level of decision-making intelligence is insufficient. Summary of the Invention
[0006] To address the aforementioned issues, this invention provides a method, system, terminal, and medium for temperature monitoring and route optimization in cold chain logistics. This enables intelligent, second-level real-time control across the entire cold chain logistics transportation chain, from anomaly detection and route optimization to emergency response, thereby improving transportation timeliness, reliability, and economy.
[0007] In a first aspect, the technical solution of the present invention provides a method for temperature monitoring and path optimization in cold chain logistics, comprising the following steps:
[0008] Raw temperature data streams from temperature sensors are collected by edge computing nodes deployed on cold chain transport vehicles. The raw temperature data streams are preprocessed to generate a first-level data stream containing anomaly identifiers. The preprocessing includes filtering invalid data and anomaly detection based on a predefined machine learning model.
[0009] Acquire traffic condition data streams and weather forecast data streams, and use a dynamic schema registration mechanism to uniformly convert the first-level data stream, traffic condition data stream, and weather forecast data stream into a predefined standardized format to generate a second-level standardized data stream;
[0010] Based on the second-level standardized data stream, the stability score of temperature data is calculated through a sliding window model. The stability level is divided according to the stability score. Based on geographic location information, the first-level data stream and traffic condition data stream are correlated and fused to generate a third-level enhanced data stream containing stability level and context information.
[0011] Based on the third-level enhanced data stream, the optimal transportation path is dynamically calculated using a reinforcement learning algorithm. The path cost function in the process of calculating the optimal transportation path dynamically adjusts the weights of each cost factor according to the real-time temperature control status. At the same time, based on a predefined hierarchical response rule base, corresponding emergency control instructions are generated according to the stability level.
[0012] The generated optimal transportation route and emergency control commands are sent to the vehicle-mounted execution equipment.
[0013] In one optional implementation, anomaly detection is performed based on a predefined machine learning model, specifically including:
[0014] The raw temperature data stream, after filtering out invalid data, is standardized and a fixed-length sliding window sequence is constructed in chronological order.
[0015] The sliding window sequence is input into a predefined machine learning model, which outputs a scalar value representing the probability of an anomaly in the current sequence. ;
[0016] scalar value The anomaly identifier is generated by logically combining the rule-based instantaneous change threshold with the anomaly identifier. , is represented as ,
[0017]
[0018] in, This indicates an anomaly. This indicates that it is normal. This is the model probability threshold. This is a threshold for the temperature change amplitude between adjacent sampling points. , They are respectively , Temperature sampling value at any given time.
[0019] In one optional implementation, the predefined machine learning model is based on a long short-term memory network model deployed on the TensorFlow Lite engine. That is, a standard long short-term memory network model is first trained using historical temperature data, and then the trained long short-term memory network model is converted into TensorFlow Lite format using model compression and conversion tools.
[0020] In an optional implementation, the stability score of the temperature data is calculated using a sliding window model, specifically including:
[0021] Temperature data is extracted from the second-level standardized data stream and partitioned according to the data source. A sliding window is then used to divide the temperature data stream within each partition.
[0022] Calculate the average value for the set of temperature values within each sliding window. and standard deviation ;
[0023] The stability score of the current sliding window is calculated using the following formula. ,
[0024] .
[0025] In one optional implementation, the path cost function is expressed as follows:
[0026]
[0027] in, To estimate travel time, To estimate fuel consumption, For the probability of congestion, To control temperature risks, These are the weighting coefficients. ;
[0028] Weighting coefficient The adjustment formula is as follows:
[0029]
[0030] in, The policy network for the reinforcement learning algorithm is the first... Adjusted scores generated by each cost factor This is a scaling constant.
[0031] In one optional implementation, the optimal transportation path is dynamically calculated based on a reinforcement learning algorithm, specifically including:
[0032] Real-time environmental status information is extracted from the third-level enhanced data stream. Based on the real-time environmental status information, the state space vector of the reinforcement learning model is constructed, including the vehicle's current location, destination location, current temperature stability score, current interior temperature of the vehicle, remaining refrigeration shelf life, real-time traffic congestion status, and future weather forecast.
[0033] Define the set of executable actions for the reinforcement learning model, including maintaining the current path, switching to a predefined alternative path, and requesting emergency support; the paths in the action set are candidate paths generated based on the current state of the vehicle using the K-shortest path algorithm or a constrained path search algorithm.
[0034] Define the immediate reward function for the reinforcement learning model;
[0035] The state space vector is input into the policy network, and the weight coefficients of each cost factor in the path cost function are output.
[0036] The current state is input into the trained reinforcement learning model, which selects the action with the highest value as the optimal transportation path according to the decision rules. This action is a transportation path generated by the K-shortest path algorithm or a constrained path search algorithm.
[0037] Record the weight coefficients of each cost factor output during the decision-making process to the log.
[0038] In one optional implementation, the formula for calculating the immediate reward function of the reinforcement learning model is:
[0039]
[0040] in, For path cost function, This is the estimated amount of cargo damage based on the current temperature, remaining time, and cargo characteristics. , This is the balance coefficient.
[0041] Secondly, the technical solution of the present invention provides a cold chain logistics temperature monitoring and route optimization system, comprising:
[0042] The temperature data collection and processing module is used to collect raw temperature data streams from temperature sensors through edge computing nodes deployed on cold chain transport vehicles, and preprocess the raw temperature data streams to generate a first-level data stream containing anomaly identifiers. The preprocessing includes filtering invalid data and performing anomaly detection based on a predefined machine learning model.
[0043] The data unification module is used to acquire traffic condition data streams and weather forecast data streams. It uses a dynamic schema registration mechanism to convert the first-level data stream, traffic condition data stream, and weather forecast data stream into a predefined standardized format, generating a second-level standardized data stream.
[0044] The data fusion module is used to calculate the stability score of temperature data based on the second-level standardized data stream using a sliding window model, classify the stability level according to the stability score, and associate and fuse the first-level data stream and traffic condition data stream based on geographic location information to generate a third-level enhanced data stream containing stability level and context information.
[0045] The transportation route and control command generation module is used to dynamically calculate the optimal transportation route based on the third-level enhanced data stream and reinforcement learning algorithm. The path cost function in the process of calculating the optimal transportation route dynamically adjusts the weight of each cost factor according to the real-time temperature control status. At the same time, based on the predefined hierarchical response rule base, it generates corresponding emergency control commands according to the stability level.
[0046] The result distribution module is used to distribute the generated optimal transportation route and emergency control instructions to the vehicle-mounted execution equipment.
[0047] Thirdly, the technical solution of the present invention provides a terminal, comprising:
[0048] Memory, used to store cold chain logistics temperature monitoring and route optimization programs;
[0049] A processor is configured to implement the steps of the cold chain logistics temperature monitoring and route optimization method as described above when executing the cold chain logistics temperature monitoring and route optimization program.
[0050] Fourthly, the present invention provides a computer-readable storage medium storing a cold chain logistics temperature monitoring and path optimization program, wherein the cold chain logistics temperature monitoring and path optimization program, when executed by a processor, implements the steps of the cold chain logistics temperature monitoring and path optimization method as described in any of the above claims.
[0051] As can be seen from the above technical solutions, this application has the following advantages:
[0052] 1. This application introduces edge computing nodes to perform lightweight machine learning inference and anomaly detection near the data source, reducing the latency of temperature anomaly identification from minutes in traditional solutions to seconds or even milliseconds, significantly shortening the anomaly response time. Simultaneously, based on distributed stream processing technology, real-time correlation and computation of multi-source data streams enable dynamic path optimization frequency to be increased from hours to minutes or even seconds, efficiently handling dynamic scenarios such as sudden traffic congestion and severe weather, significantly reducing the risk of cargo damage during transportation.
[0053] 2. This application uses a dynamic schema registration mechanism to automatically convert and unify data from different sources and formats into a standardized format, achieving seamless integration and real-time correlation of multi-source heterogeneous data such as vehicle sensor data, traffic data, and meteorological data. This breaks down data silos and enables the decision-making system to obtain a global, context-rich enhanced data stream, laying a data foundation for subsequent accurate decision-making.
[0054] 3. This application introduces a dynamic decision-making mechanism based on reinforcement learning. The weight coefficients of its path cost function can be dynamically adjusted according to the real-time temperature control status, enabling the path planning strategy to adaptively switch from cost-first or time-first to quality assurance-first, achieving intelligent balancing and optimization of multiple objectives. Combined with a hierarchical response rule base, the system can execute differentiated emergency actions, from driver alarms to route switching and emergency assistance, based on different risk levels. Attached Figure Description
[0055] To more clearly illustrate the technical solution of this application, the accompanying drawings used in the description will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0056] Figure 1 This is a schematic diagram of a cold chain logistics temperature monitoring and route optimization method provided in an embodiment of the present invention.
[0057] Figure 2 This is a schematic block diagram of a cold chain logistics temperature monitoring and route optimization system provided in an embodiment of the present invention.
[0058] Figure 3 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present invention. Detailed Implementation
[0059] To make the purpose, features, and advantages of this application more apparent and understandable, specific embodiments and accompanying drawings will be used to clearly and completely describe the technical solution protected by this application. Obviously, the embodiments described below are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0060] Unless otherwise defined, all technical and scientific terms used in this application have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this application and in the specification of this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
[0061] Figure 1 This is a schematic flowchart illustrating a cold chain logistics temperature monitoring and route optimization method according to an embodiment of the present invention. Figure 1 The executing entity can be a cold chain logistics temperature monitoring and route optimization system. The cold chain logistics temperature monitoring and route optimization method provided in this embodiment of the invention is executed by computer equipment; correspondingly, the cold chain logistics temperature monitoring and route optimization system runs on the computer equipment. Depending on different needs, the order of the steps in this flowchart can be changed, and some steps can be omitted.
[0062] like Figure 1 As shown, the method includes the following steps.
[0063] S1 collects raw temperature data streams from temperature sensors through edge computing nodes deployed on cold chain transport vehicles, and preprocesses the raw temperature data streams to generate a first-level data stream containing anomaly identifiers. The preprocessing includes filtering invalid data and performing anomaly detection based on a predefined machine learning model.
[0064] S2 acquires traffic condition data streams and weather forecast data streams, and uses a dynamic schema registration mechanism to uniformly convert the first-level data stream, traffic condition data stream, and weather forecast data stream into a predefined standardized format to generate a second-level standardized data stream.
[0065] S3, based on the second-level standardized data stream, calculates the stability score of temperature data through a sliding window model, classifies the stability level according to the stability score, and associates and merges the first-level data stream and traffic condition data stream based on geographic location information to generate a third-level enhanced data stream containing stability level and context information.
[0066] S4, based on the third-level enhanced data stream, dynamically calculates the optimal transportation path using a reinforcement learning algorithm. During the calculation of the optimal transportation path, the path cost function dynamically adjusts the weights of each cost factor according to the real-time temperature control status. Simultaneously, based on a predefined hierarchical response rule base, corresponding emergency control instructions are generated according to the stability level.
[0067] S5 will send the generated optimal transportation route and emergency control instructions to the on-board execution equipment.
[0068] Furthermore, as a refinement and extension of the specific implementation methods described above, to fully illustrate the specific implementation process in this embodiment, another method for cold chain logistics temperature monitoring and path optimization is provided. This method is based on a system implementation using an edge-cloud collaborative architecture, building a real-time monitoring and dynamic optimization platform for cold chain logistics with Apache Kafka as the core, realizing a complete closed loop from data collection, real-time analysis to decision execution. The architecture includes Kafka Edge nodes, Kafka Central Cluster, a stream processing engine, a decision engine, and an execution terminal. The Kafka Edge nodes use Kafka Connect + TensorFlow Lite to achieve edge data preprocessing and lightweight anomaly detection. The Kafka Central Cluster adopts a multi-broker partitioning strategy to achieve high-throughput data storage and distribution. The stream processing engine uses Flink + Kafka Streams to achieve real-time calculation of temperature fluctuations and correlation of multi-source data. The decision engine uses a Python reinforcement learning model + Drools rule engine to achieve dynamic path optimization and emergency command generation.
[0069] The method includes the following steps.
[0070] S101 generates a first-level data stream based on the original temperature data stream.
[0071] Raw temperature data streams from temperature sensors are collected by edge computing nodes deployed on cold chain transport vehicles. These raw temperature data streams are then preprocessed to generate a first-level data stream containing anomaly identifiers. Specifically, sensor data is accessed through onboard sensors (such as the DS18B20 temperature sensor), which collect temperature data. This data is then processed by the edge control layer (Kafka Edge nodes) to perform data filtering and lightweight anomaly detection on the source data.
[0072] Preprocessing includes first filtering invalid data; data with temperatures exceeding -30℃ to 50℃ is considered invalid. Then, the temperature data stream after removing invalid data undergoes anomaly detection based on a predefined machine learning model. This predefined machine learning model is based on a Long Short-Term Memory (LSTM) network deployed on the TensorFlow Lite engine. Specifically, a standard LTM network model is first trained using historical temperature data, and then a model compression and conversion tool is used to convert the trained LTM network model into TensorFlow Lite format.
[0073] Anomaly detection is performed based on a predefined machine learning model. The input can be the temperature sequence of the most recent 60 seconds, and the output is the probability of anomaly. If the probability is greater than a certain value, it is considered normal; otherwise, it is considered abnormal data. The specific steps include the following steps.
[0074] S101.1, standardize the raw temperature data stream after filtering out invalid data, and construct a fixed-length sliding window sequence in chronological order.
[0075] The standardization process uses the Z-Score normalization method, and the calculation formula is as follows:
[0076]
[0077] in, This represents the standardized temperature value. This represents the original temperature sample value. This represents the average temperature data obtained during the training phase. This represents the standard deviation of the temperature data obtained during the training phase.
[0078] The length of the sliding window corresponds to the number of sampling points within 60 seconds, and the normalization parameter... and The data is statistically obtained from the training dataset during the model training phase and then embedded in the edge computing nodes.
[0079] S101.2, Input the sliding window sequence into a predefined machine learning model, and output a scalar value representing the probability of an anomaly in the current sequence. .
[0080] S101.3, scalar value The anomaly identifier is generated by logically combining the rule-based instantaneous change threshold with the anomaly identifier. , is represented as ,
[0081]
[0082] in, This indicates an anomaly. This indicates that it is normal. This is the model probability threshold. This is a threshold for the temperature change amplitude between adjacent sampling points. , They are respectively , Temperature sampling value at any given time.
[0083] Among them, the model probability threshold The value range is 0.7 to 0.9, and the threshold value range for the temperature change amplitude between adjacent sampling points is 1.5℃ to 3℃.
[0084] exception identifier Original temperature value timestamp The data, along with the device identifier ID, is encapsulated into a new data record and output as the first-level data stream. This step combines rule filtering with model inference to balance real-time performance and accuracy. The lightweight LSTM-based model effectively captures temporal dependencies and complex fluctuation patterns in temperature sequences, thus identifying potential anomalies that single-point threshold rules struggle to detect. Simple instantaneous change rules, as a supplement, quickly capture drastic anomalies that the model might miss, creating a complementary advantage. Ultimately, only valid data with anomaly markers is uploaded to the central cluster, achieving a highly efficient balance between edge intelligence and cloud collaboration.
[0085] S102, Generate a second-level standardized data stream from multi-source data in a unified format.
[0086] The system acquires traffic condition data streams and weather forecast data streams, and uses a dynamic schema registration mechanism to convert the first-level data stream, traffic condition data stream, and weather forecast data stream into a predefined standardized format to generate a second-level standardized data stream.
[0087] Data streams from multiple independent sources can be accessed in parallel using different connectors:
[0088] First-level data stream: Data from the Kafka Edge node on the edge side, which already includes anomaly alerts, and its initial format may be lightweight JSON or Protobuf;
[0089] Traffic condition data stream: Acquired in real-time from third-party traffic data service APIs via configured HTTP / HTTPS connectors or message queue connectors. The data format is typically JSON returned by the RESTful API.
[0090] Weather forecast data stream: Through a similar mechanism, weather forecast data for a specific time period and a specific geographical area is obtained from the weather service API. The format is also mostly JSON.
[0091] Apache Avro is used as the unified data serialization format, and a Schema Registry is used to provide services. At the initial stage of system deployment, strict Avro Schemas are predefined for all data types that need to be integrated. A corresponding Kafka Connect converter is configured for each data source. When raw traffic data in JSON format arrives, the converter queries the Schema Registry for the corresponding Avro Schema based on the configured Schema name. The converter then validates and transforms the JSON data according to this Schema, converting it into binary Avro format. During this process, the converter automatically performs field mapping and type conversion; for example, it converts the latitude and longitude in the JSON string format into the `geo_fence` field of the string type defined in the Avro Schema. Finally, this data, along with the corresponding Schema ID, is serialized into Avro binary format and sent to the corresponding Topic in the Kafka central cluster.
[0092] All data from diverse sources is transformed and serialized into binary data streams conforming to the predefined Avro Schema, and stored in different topics of the Kafka Central Cluster. These data streams together constitute the second-level standardized data stream.
[0093] S103, Temperature Stability Evaluation.
[0094] Based on the second-level standardized data stream, the stability score of the temperature data is calculated using a sliding window model, and the stability level is divided according to the stability score. The specific steps include the following steps.
[0095] S103.1 Extract temperature data from the second-level standardized data stream, partition it according to the data source, and divide the temperature data stream within each partition into sliding windows.
[0096] The data source can be vehicle ID or sensor ID.
[0097] S103.2, Calculate the average value for the set of temperature values within each sliding window. and standard deviation .
[0098] S103.3, calculate the stability score of the current sliding window using the following formula. ,
[0099] .
[0100] It should be noted that this calculation formula is applicable to The scene, The absolute value is used for calculation to ensure the mathematical validity of the score calculation.
[0101] Standard deviation It measures the absolute fluctuation of temperature values within a time window. The larger the value, the more drastic the temperature fluctuation and the worse the stability.
[0102] average value This represents the average temperature level within that time window. It is used to normalize the fluctuation range. This is because the same absolute fluctuation (e.g., ±2℃) has different relative effects on different reference temperatures (e.g., -18℃ vs 5℃), and normalization makes the scores comparable across different temperature ranges.
[0103] The coefficient of variation is a statistic that measures the relative volatility of data, which aligns with the definition of stability.
[0104] The coefficient of variation is converted into an intuitive scoring form. When the relative volatility is small, the score approaches 1, indicating very stable performance; when the relative volatility is large, the score approaches 0, indicating extremely unstable performance.
[0105] S103.4, Stability Level Mapping.
[0106] The calculated continuity stability score Mapped to a discrete stability level Its mapping rules are as follows:
[0107] like If ∈ [0.9, 1.0], then = “Excellent”;
[0108] like If ∈ [0.7, 0.9), then = "good";
[0109] like If ∈ [0, 0.7), then = "poor".
[0110] The stability level defined in this step will serve as a core input condition for the hierarchical response rule base in step S4, and will be directly used to trigger emergency control commands at different levels.
[0111] The stability score, stability level, window start time, window end time, and device identifier ID are combined and encapsulated into a new data record, which is output as the third-level enhanced data stream.
[0112] S104, Data fusion generates a third-level enhanced data stream.
[0113] Based on geographic location information, the first-level data stream and traffic condition data stream are correlated and fused to generate a third-level enhanced data stream that includes stability level and context information.
[0114] This step is executed by the system's stream processing engine, which consumes the second-level normalized data stream from the Kafka cluster and extracts the temperature data sequence. For each data source (such as each vehicle or each refrigerated container), the system maintains a sliding time window, and for the set of temperature values within each window, it calculates the average and standard deviation of the temperature within the window, a stability score, and a mapped stability level.
[0115] To break down data silos, the stream processing engine needs to correlate the calculated stability data with external data (such as traffic) in real time. This is achieved through key-based join operations, including temperature event streams and traffic event streams. Each record in the temperature event stream contains the device ID, timestamp, latitude and longitude coordinates, etc. , The traffic event stream originates from a standardized data stream from an external traffic API. Each record contains fields such as event type, geographic location severity, and estimated duration. This stream is registered as KafkaTopicsensor_enriched.
[0116] Geographic location and time are used as the keys to link the two data streams. Spatial linking involves calculating the spatial relationship between the GPS coordinates of each latest temperature event and the geofence of a traffic event to determine whether the vehicle is currently in or about to enter the influence area of a traffic event. Temporal linking, since the data streams are infinite, involves performing the linking operation within a configurable time window.
[0117] The stream processing engine executes the spatiotemporal condition-based join query described above. For successfully matched records, the system concatenates the traffic event details with temperature stability data into a new record.
[0118] S105, generates the optimal transportation path based on reinforcement learning.
[0119] Based on the third-level enhanced data stream, the optimal transportation path is dynamically calculated using a reinforcement learning algorithm. The path cost function in the process of calculating the optimal transportation path dynamically adjusts the weights of each cost factor according to the real-time temperature control status.
[0120] First, based on the real-time state, the path planning algorithm generates N feasible candidate paths. Then, the reinforcement learning model dynamically adjusts the weights of each cost factor in the cost function according to the current state (including temperature control status) and uses this adjustment to calculate the comprehensive cost of each candidate path. Finally, the path with the lowest comprehensive cost is selected as the "action" A for this decision. t This path is the "optimal transportation path." Let's consider this "action" A. t (At its core is the path ID or path coordinate sequence) which is issued as a "driving instruction" to the in-vehicle navigation system or driver's app for execution. Simultaneously, the weights of each cost factor used in this calculation are recorded for analysis of decision-making reasons and model optimization.
[0121] Specifically, the path cost function is expressed as follows:
[0122]
[0123] in, To estimate travel time, To estimate fuel consumption, For the probability of congestion, for the risk of temperature control, These are the weighting coefficients. .
[0124] Estimated travel time This represents the timeliness cost of the route. Its value is obtained through an integrated real-time traffic data API. The system sends the coordinate sequence of the vehicle's current location, destination location, and candidate routes to the traffic data API to obtain the predicted travel time based on real-time traffic conditions (such as congestion and accidents). This factor is directly related to the timeliness of the transportation task.
[0125] Estimated fuel consumption This represents the economic cost of the route. Its value is obtained through a fuel consumption estimation algorithm based on a physics model, and the calculation formula can be expressed as follows:
[0126] = (Road mileage / 100) * Vehicle's base fuel consumption per 100 kilometers * f(Average vehicle speed, Road gradient)
[0127] In this context, the route mileage represents the total length of the path, the vehicle's baseline fuel consumption per 100 kilometers is an inherent parameter specific to the vehicle model, and f(average speed, road gradient) is a correction coefficient function used to fine-tune fuel consumption based on real-time predicted average driving speed and road gradient information. This factor directly determines the fuel cost of transportation.
[0128] Congestion probability This represents the reliability and risk cost of a route. Its value is derived from historical traffic flow data mining and real-time event prediction. For example, the probability of congestion on a road segment during a specific time period can be obtained by analyzing historical data, and then adjusted by overlaying the impact of real-time traffic accidents and weather events. This value is a scalar between 0 (absolutely free flow) and 1 (complete congestion). A high probability of congestion not only increases travel time but also exacerbates the load on refrigeration equipment and the risk of temperature fluctuations.
[0129] Temperature control risks This is a core cost item for ensuring cargo quality; it quantifies the risk of cargo damage due to temperature changes while traveling along a specific route. Its calculation formula is as follows:
[0130]
[0131] in, This is the temperature stability score calculated for the current time window. The formula indicates that the more unstable the current temperature control state (…), the lower the temperature stability score. The lower, (1- The higher the value, and the longer the exposure time in that state ( The longer the duration, the greater the risk of temperature control issues. The larger the value, the better. This allows the cost function to sensitively capture the real-time risks faced by goods and quantify these risks into a value that can be compared with other costs such as time and fuel consumption.
[0132] Weighting coefficient The adjustment formula is as follows:
[0133]
[0134] in, The policy network for the reinforcement learning algorithm is the first... Adjusted scores generated by each cost factor This is a scaling constant.
[0135] Weighting coefficient The adjustment formula is a variant of the Softmax function, which modifies the raw score output by the reinforcement learning policy network. It is transformed into a probability distribution in which the sum of all weights is 1.
[0136] Scaling constant Used to control the "sharpness" of the weight distribution. The larger the value, the more obvious the weight advantage of the cost factor with the highest score, and the stronger the bias of the system's decision-making. The smaller the value, the more evenly the weights are distributed. This parameter is usually determined through tuning during the system training phase.
[0137] score It is generated by a reinforcement learning policy network. This network learns by continuously interacting with the environment and based on feedback from the reward function R, ultimately mastering an optimal policy: that is, how to determine the optimal policy based on the current state S. t (Especially the temperature stability score), assign appropriate scores to each cost factor. This allows for dynamic adjustment of the cost function. The network's focus is on balancing factors to maximize long-term cumulative rewards. For example, when temperature stability is good, the network will reduce... The scoring system prioritizes time and economic costs; it also significantly improves performance when stability deteriorates. The scoring forces path planning to prioritize the path that can get out of the risk state the fastest, at which point cargo protection becomes the highest priority.
[0138] The optimal transportation route is dynamically calculated based on reinforcement learning algorithms, specifically including the following steps.
[0139] S105.1 Extract real-time environmental state information from the third-level enhanced data stream, and construct the state space vector of the reinforcement learning model based on the real-time environmental state information, including the vehicle's current location, destination location, current temperature stability score, current interior temperature of the vehicle compartment, remaining refrigeration shelf life, real-time traffic congestion status, and future weather forecast.
[0140] S105.2 defines the set of executable actions for the reinforcement learning model, including maintaining the current path, switching to a predefined alternative path, and requesting emergency support.
[0141] It should be noted that the paths in the action set are generated based on the current state of the vehicle, using the K-shortest path algorithm or a constrained path search algorithm to generate candidate paths.
[0142] S105.3 defines the immediate reward function for reinforcement learning models.
[0143] The formula for calculating the immediate reward function of a reinforcement learning model is as follows:
[0144]
[0145] in, For path cost function, This is the estimated amount of cargo damage based on the current temperature, remaining time, and cargo characteristics. , This is the balance coefficient.
[0146] Forecast of cargo damage The calculation is based on a simplified model of the Arrhenius formula, which is positively correlated with temperature T and time t, specifically expressed as:
[0147]
[0148] in, and This is the rate of deterioration coefficient related to the type of goods.
[0149] S105.4 inputs the state space vector into the policy network and outputs the weight coefficients of each cost factor in the path cost function.
[0150] The policy network is implemented using a deep neural network. Its input layer dimension matches the dimension of the state space vector, and its output layer dimension matches the number of cost factors. The current state space vector is input into the policy network, and through nonlinear transformations in the hidden layers, a set of initial adjustment scores {s1, s2, s3, s4} is generated at the output layer. These scores {s1, s2, s3, s4} are then normalized using a Softmax function to obtain the final dynamic weight coefficients, which sum to 1. .
[0151] When the score is high (good stability), the policy network will allocate more weights to it. (Time) and (Fuel consumption) The system tends to select the economical or fast route.
[0152] When the score is low (poor stability), the policy network will automatically increase. The weight of (temperature control risk) makes the cost function The increased proportion of the ΔT term forces the reinforcement learning model to choose a path that minimizes travel time and reaches the destination as quickly as possible, with the ultimate goal of preserving the quality of the goods.
[0153] S105.5 Input the current state into the trained reinforcement learning model. The model selects the action with the highest value as the optimal transportation path according to the decision rules. This action is a transportation path generated by the K-shortest path algorithm or a constrained path search algorithm.
[0154] The decision-making process of a reinforcement learning model involves a two-level decision-making process. The first-level decision (macro-policy selection) involves the agent selecting the highest-value macro-action A from the action space A based on its policy π. t For example: a_routeA means "selecting the set of alternative paths A"; Secondary decision (micro-path calculation): once the macro-action A... t Once selected, the system invokes the corresponding path planning algorithm to calculate the specific optimal path corresponding to the macro-action based on the latest real-time status information (such as traffic congestion and weather).
[0155] As another implementation, the action space A is directly defined as the set of the top K optimal candidate paths generated in real time by the path planning algorithm, i.e., A = {Path1, Path2, ..., Path...} K The reinforcement learning model's policy π directly selects the path with the lowest overall cost from these K candidate paths as the final action A. t .
[0156] The path planning algorithm acts as an option generator, quickly and efficiently narrowing down the decision-making scope. From a near-infinite network of possible paths, it generates a short list of K high-quality candidate paths based on fundamental constraints (such as road class, length, and prohibited road sections). This addresses the challenge of reinforcement learning's large action space and difficulty in directly handling continuous or high-dimensional decision-making problems. The reinforcement learning module acts as an intelligent decision-maker, making the globally optimal decision from this high-quality candidate path set provided by the path planning algorithm. It no longer considers only path length or time but comprehensively considers multiple and dynamic cost factors such as real-time temperature control risk, cargo damage risk, fuel consumption, and congestion probability. This is equivalent to introducing learning and applicability; through the reward function R, it learns that when temperature stability is poor, a slightly longer but unobstructed path may be more valuable than a short but congested path because it minimizes the higher-priority cost of cargo damage.
[0157] S105.6 Records the weight coefficients of each cost factor output during the decision-making process to the log.
[0158] S106 generates emergency control commands based on temperature stability.
[0159] Based on a predefined hierarchical response rule base, corresponding emergency control instructions are generated according to the stability level.
[0160] The rules engine maintains a hierarchical response rule base, which defines different stability levels, their corresponding triggering conditions, and the mapping relationship between response actions. The rules engine monitors the third-level enhanced data stream from the stream processing engine in real time, and once it detects [a certain condition] in the data record... When a field is updated, it is immediately matched against the conditions in the rule base, and the corresponding set of actions is executed.
[0161] Level 1 Response (Red Alert): When Triggered when the temperature is "Poor" or exceeds the safety threshold for 3 consecutive minutes. This level indicates a serious risk to the temperature control system and a substantial threat of damage to the goods. The triggered response is the highest priority integrated handling plan, including:
[0162] Emergency route switching: Immediately invoke the route planning algorithm to calculate and switch to the shortest or fastest path currently available, with the sole objective of minimizing the remaining transportation time;
[0163] Emergency equipment start-up: Send a command to the vehicle controller to automatically start the backup refrigeration unit or force the main refrigeration unit to run at maximum power to attempt to restore the temperature in the compartment to a safe range;
[0164] Personnel Collaboration Early Warning: Simultaneously sends the highest level of alarm information to the driver's terminal and the back-end monitoring center, and automatically notifies the recipient to prepare for emergency delivery and inspection.
[0165] Level 2 Response (Yellow Alert): When This level is triggered when the temperature is rated "Good" or when a temperature fluctuation exceeding ΔT_threshold (e.g., 2°C) is detected between adjacent sampling points. This level indicates an unstable trend in temperature control, posing a potential risk. The triggered response is an interventional control measure, including:
[0166] Driver intervention prompt: A prominent alarm message pops up on the driver's terminal (such as an APP or in-vehicle display screen) to prompt the driver to pay attention to abnormal temperature and check the equipment status;
[0167] Driving strategy recommendation: It is recommended that drivers reduce their speed to below 80km / h to reduce temperature fluctuations caused by vehicle bumps and frequent starts and stops.
[0168] Level 3 Response (Blue Alert): Triggered when the system predicts severe weather (such as heavy rain or high temperatures) during the next 30 minutes based on meteorological data analysis. This level is predictive protection, designed to mitigate potential risks. The triggered response actions are preventative measures, including:
[0169] Preventative route adjustments: Replan routes to avoid dangerous areas susceptible to weather conditions, such as mountainous areas and flooded sections of road;
[0170] Vehicle self-check command: Issues a command to prompt the driver or automatically triggers a check of the vehicle compartment's sealing and refrigeration equipment's condition, preparing for any eventuality.
[0171] S107, the results are issued.
[0172] The generated optimal transportation route and emergency control commands are sent to the vehicle-mounted execution equipment.
[0173] The system receives the optimal transportation route from the decision engine and emergency control instructions from the rules engine, and encapsulates them into standard data packets conforming to vehicle communication protocols (such as MQTT, HTTP / HTTPS). Subsequently, the instruction data packets are pushed to the message cluster via a designated topic through a message middleware (such as Kafka).
[0174] Kafka Edge nodes or dedicated protocol gateways on the edge side subscribe to the aforementioned topics. Once they receive a new instruction message, they immediately convert it into an instruction format that can be parsed by the vehicle controller or driver's app, and then distribute it to the vehicle's onboard execution device via the wireless network.
[0175] After receiving an instruction, the on-board execution device will directly import the optimal transportation route into the on-board navigation system or intelligent driving system and execute it automatically as a new driving route; emergency control instructions will be executed by the on-board controller or displayed on the driver's interactive interface and executed after confirmation by the driver.
[0176] The foregoing has described in detail an embodiment of a cold chain logistics temperature monitoring and route optimization method. Based on the cold chain logistics temperature monitoring and route optimization method described in the above embodiment, this invention also provides a cold chain logistics temperature monitoring and route optimization system corresponding to the method.
[0177] Figure 2 This is a schematic block diagram of a cold chain logistics temperature monitoring and route optimization system provided in an embodiment of the present invention. In this embodiment, the cold chain logistics temperature monitoring and route optimization system 200 can be divided into multiple functional modules according to the functions it performs. A module, as referred to in this invention, is a series of computer program segments that can be executed by at least one processor and perform a fixed function, and is stored in memory.
[0178] The temperature data collection and processing module 210 is used to collect raw temperature data streams from temperature sensors through edge computing nodes deployed on cold chain transport vehicles, and preprocess the raw temperature data streams to generate a first-level data stream containing anomaly identifiers. The preprocessing includes filtering invalid data and performing anomaly detection based on a predefined machine learning model.
[0179] The data unification module 220 is used to acquire traffic condition data streams and weather forecast data streams. It uses a dynamic schema registration mechanism to convert the first-level data stream, traffic condition data stream, and weather forecast data stream into a predefined standardized format, generating a second-level standardized data stream.
[0180] The data fusion module 230 is used to calculate the stability score of temperature data based on the second-level standardized data stream using a sliding window model, classify the stability level according to the stability score, and associate and fuse the first-level data stream and traffic condition data stream based on geographical location information to generate a third-level enhanced data stream containing stability level and context information.
[0181] The transportation route and control instruction generation module 240 is used to dynamically calculate the optimal transportation route based on the third-level enhanced data stream and a reinforcement learning algorithm. During the calculation of the optimal transportation route, the path cost function dynamically adjusts the weights of each cost factor according to the real-time temperature control status. At the same time, based on a predefined hierarchical response rule base, it generates corresponding emergency control instructions according to the stability level.
[0182] The result distribution module 250 is used to distribute the generated optimal transportation route and emergency control instructions to the vehicle-mounted execution equipment.
[0183] The cold chain logistics temperature monitoring and route optimization system of this embodiment is used to implement the aforementioned cold chain logistics temperature monitoring and route optimization method. Therefore, the specific implementation of this system can be found in the embodiment section of the cold chain logistics temperature monitoring and route optimization method above. Thus, the specific implementation can be referred to the description of the corresponding embodiments, and will not be elaborated here.
[0184] Furthermore, since the cold chain logistics temperature monitoring and path optimization system in this embodiment is used to implement the aforementioned cold chain logistics temperature monitoring and path optimization method, its function corresponds to the function of the above method, and will not be repeated here.
[0185] Figure 3 This is a schematic diagram of a terminal 300 provided in an embodiment of the present invention, including: a processor 310, a memory 320, and a communication unit 330. The processor 310 is used to implement the process steps of the above-described embodiment of the cold chain logistics temperature monitoring and route optimization method when implementing the cold chain logistics temperature monitoring and route optimization program stored in the memory 320.
[0186] This invention also provides a computer storage medium, which may be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc. The computer storage medium stores a cold chain logistics temperature monitoring and path optimization program. When executed by a processor, the cold chain logistics temperature monitoring and path optimization program implements the process steps of the above-described cold chain logistics temperature monitoring and path optimization method embodiments.
[0187] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for temperature monitoring and route optimization in cold chain logistics, characterized in that, Includes the following steps: Raw temperature data streams from temperature sensors are collected by edge computing nodes deployed on cold chain transport vehicles. The raw temperature data streams are preprocessed to generate a first-level data stream containing anomaly identifiers. The preprocessing includes filtering invalid data and anomaly detection based on a predefined machine learning model. Acquire traffic condition data streams and weather forecast data streams, and use a dynamic schema registration mechanism to uniformly convert the first-level data stream, traffic condition data stream, and weather forecast data stream into a predefined standardized format to generate a second-level standardized data stream; Based on the second-level standardized data stream, a stability score for temperature data is calculated using a sliding window model. Stability levels are then assigned based on these scores. Furthermore, the first-level data stream and traffic condition data stream are correlated and fused based on geographic location information to generate a third-level enhanced data stream containing stability levels and contextual information. Specifically, calculating the stability score for temperature data using the sliding window model involves: extracting temperature data from the second-level standardized data stream and partitioning it according to the data source; dividing the temperature data stream within each partition into sliding windows; and calculating the average value for the temperature value set within each sliding window. and standard deviation Calculate the stability score of the current sliding window. ; Based on the third-level enhanced data stream, the optimal transportation path is dynamically calculated using a reinforcement learning algorithm. The path cost function in the process of calculating the optimal transportation path dynamically adjusts the weights of each cost factor according to the real-time temperature control status. At the same time, based on a predefined hierarchical response rule base, corresponding emergency control instructions are generated according to the stability level. The generated optimal transportation route and emergency control commands are sent to the vehicle-mounted execution equipment. The path cost function is expressed as follows: in, ; in, To estimate travel time, To estimate fuel consumption, For the probability of congestion, To control temperature risks, These are the weighting coefficients. ; Weighting coefficient The adjustment formula is as follows: in, The policy network for the reinforcement learning algorithm is the first... Adjusted scores generated by each cost factor It is a scaling constant; The dynamic calculation of the optimal transportation route based on reinforcement learning algorithms specifically includes: Real-time environmental status information is extracted from the third-level enhanced data stream. Based on the real-time environmental status information, the state space vector of the reinforcement learning model is constructed, including the vehicle's current location, destination location, current temperature stability score, current interior temperature of the vehicle, remaining refrigeration shelf life, real-time traffic congestion status, and future weather forecast. Define the set of executable actions for the reinforcement learning model, including maintaining the current path, switching to a predefined alternative path, and requesting emergency support; the paths in the action set are candidate paths generated based on the current state of the vehicle using the K-shortest path algorithm or a constrained path search algorithm. Define the immediate reward function for the reinforcement learning model; The state space vector is input into the policy network, and the weight coefficients of each cost factor in the path cost function are output. The current state is input into the trained reinforcement learning model, which selects the action with the highest value as the optimal transportation path according to the decision rules. This action is a transportation path generated by the K-shortest path algorithm or a constrained path search algorithm. Record the weight coefficients of each cost factor output during the decision-making process to the log.
2. The method according to claim 1, characterized in that, Anomaly detection based on predefined machine learning models specifically includes: The raw temperature data stream, after filtering out invalid data, is standardized and a fixed-length sliding window sequence is constructed in chronological order. The sliding window sequence is input into a predefined machine learning model, which outputs a scalar value representing the probability of an anomaly in the current sequence. ; scalar value The anomaly identifier is generated by logically combining the rule-based instantaneous change threshold with the anomaly identifier. , is represented as , in, This indicates an anomaly. This indicates that it is normal. This is the model probability threshold. This is a threshold for the temperature change amplitude between adjacent sampling points. , They are respectively , Temperature sampling value at any given time.
3. The method according to claim 2, characterized in that, The predefined machine learning model is based on a long short-term memory network model deployed with the TensorFlowLite engine. That is, a standard long short-term memory network model is first trained using historical temperature data, and then the trained long short-term memory network model is converted into TensorFlowLite format using model compression and conversion tools.
4. The method according to claim 1, characterized in that, The formula for calculating the immediate reward function of a reinforcement learning model is as follows: in, For path cost function, This is the estimated amount of cargo damage based on the current temperature, remaining time, and cargo characteristics. , This is the balance coefficient.
5. A cold chain logistics temperature monitoring and route optimization system, characterized in that, The system is used to perform the method according to any one of claims 1 to 4, the system comprising: The temperature data collection and processing module is used to collect raw temperature data streams from temperature sensors through edge computing nodes deployed on cold chain transport vehicles, and preprocess the raw temperature data streams to generate a first-level data stream containing anomaly identifiers. The preprocessing includes filtering invalid data and performing anomaly detection based on a predefined machine learning model. The data unification module is used to acquire traffic condition data streams and weather forecast data streams. It uses a dynamic schema registration mechanism to convert the first-level data stream, traffic condition data stream, and weather forecast data stream into a predefined standardized format, generating a second-level standardized data stream. The data fusion module is used to calculate the stability score of temperature data based on the second-level standardized data stream using a sliding window model, classify the stability level according to the stability score, and associate and fuse the first-level data stream and traffic condition data stream based on geographic location information to generate a third-level enhanced data stream containing stability level and context information. The transportation route and control command generation module is used to dynamically calculate the optimal transportation route based on the third-level enhanced data stream and reinforcement learning algorithm. The path cost function in the process of calculating the optimal transportation route dynamically adjusts the weight of each cost factor according to the real-time temperature control status. At the same time, based on the predefined hierarchical response rule base, it generates corresponding emergency control commands according to the stability level. The result distribution module is used to distribute the generated optimal transportation route and emergency control instructions to the vehicle-mounted execution equipment.
6. A terminal, characterized in that, include: Memory, used to store cold chain logistics temperature monitoring and route optimization programs; The processor is configured to implement the steps of the cold chain logistics temperature monitoring and route optimization method as described in any one of claims 1 to 4 when executing the cold chain logistics temperature monitoring and route optimization program.
7. A computer-readable storage medium, characterized in that, The readable storage medium stores a cold chain logistics temperature monitoring and route optimization program, which, when executed by a processor, implements the steps of the cold chain logistics temperature monitoring and route optimization method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Cold chain transportation path optimization method and system based on AI prediction
CN120013403A
Intelligent logistics scheduling method and device based on dynamic weight and medium
CN120506948A