Cold-chain logistics temperature monitoring and path optimization method and system, terminal and medium
Through edge computing and reinforcement learning algorithms, the real-time and data fusion problems of the cold chain logistics system have been solved, abnormal response and dynamic path optimization in seconds have been achieved, and the transportation timeliness and reliability of cold chain logistics have been improved.
Patent Information
- Application Number
- CN202511308201.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-15
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-09-15
AI Technical Summary
Traditional cold chain logistics systems have shortcomings in real-time performance, data collaboration, and dynamic decision-making capabilities, resulting in low transportation efficiency, high cargo damage rates, difficulty in integrating multi-source heterogeneous data, inability to dynamically adjust path optimization algorithms, and insufficient intelligence in emergency response mechanisms.
By deploying edge computing nodes for lightweight machine learning and anomaly detection, combined with a dynamic schema registration mechanism and reinforcement learning algorithm, real-time association and fusion of multi-source data can be achieved, the optimal transportation path can be dynamically calculated, and the cost factor weights can be adjusted based on the real-time temperature control status to generate emergency control instructions.
It achieves an exception response time of seconds, improves transportation timeliness and reliability, reduces the risk of cargo damage, and realizes intelligent balance and optimization of multiple objectives.
Smart Images

Figure CN120806318A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of logistics transportation, in particular to a cold chain logistics temperature monitoring and path optimization method, system, terminal and medium. BACKGROUND
[0002] As the core link of guaranteeing the quality of temperature-sensitive goods such as food and medicine, the technology development of cold chain logistics has long been facing key challenges such as lack of real-time performance, difficulty in coordinating multi-source data, and weak dynamic decision-making ability. Traditional cold chain monitoring systems mostly use centralized architecture, relying on offline batch processing and manual intervention, which is difficult to adapt to the modern logistics demand of high timeliness and high concurrency.
[0003] Related systems generally use a centralized data processing mode, and all sensor data needs to be transmitted to a cloud server for centralized processing. Such architecture has high transmission delay, which can reach minutes in areas with unstable network signals, resulting in the system being unable to respond immediately to sudden temperature control abnormalities during transportation, leading to an increase in cargo loss rate; the edge side lacks computing power and cannot perform localized real-time analysis and decision-making, and all logic needs to be decided by the cloud, resulting in low system response efficiency.
[0004] Multi-source heterogeneous data fusion is difficult, and cold chain logistics involves vehicle-mounted sensors, traffic management systems, weather service APIs, and enterprise ERP systems, among other multi-source data streams. These data formats are different and protocols are different. Traditional solutions generally rely on periodic ETL (Extract-Transform-Load) jobs for data integration, with low data update frequency, resulting in "data silos" between systems. For example, when a traffic accident causes congestion on a certain section of road, the vehicle cannot obtain this information in time and replan the path, and often has to wait for the next ETL period to update the route, resulting in a significant extension of transportation timeliness.
[0005] The path optimization algorithm of related systems is mostly based on historical experience data and fixed rules, and the cost model usually uses a linear weighted function with fixed 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, the emergency response strategy is usually a simple threshold alarm (such as triggering an alarm when the temperature exceeds 8℃), lacking a hierarchical response mechanism based on multi-dimensional risk prediction, and the decision-making intelligence level is insufficient. SUMMARY
[0006] To solve the above problems, the present application provides a cold chain logistics temperature monitoring and path optimization method, system, terminal and medium, which realizes the intelligentization and second-level real-time regulation of the whole link from abnormal perception, path optimization to emergency response of cold chain logistics transportation, and improves the timeliness, reliability and economy of transportation.
[0007] In a first aspect, the technical solution of the present application provides a cold chain logistics temperature monitoring and path optimization method, comprising the following steps: Collecting raw temperature data stream from temperature sensors through edge computing nodes deployed on cold chain transportation vehicles, and pre-processing the raw temperature data stream to generate a first-level data stream containing anomaly identification, the pre-processing including filtering invalid data and performing anomaly detection based on a predefined machine learning model; Obtaining a traffic condition data stream and a weather forecast data stream, and uniformly converting the first-level data stream, the traffic condition data stream and the weather forecast data stream into a predefined standardized format using a dynamic Schema registration mechanism to generate a second-level standardized data stream; Based on the second-level standardized data stream, calculating a stability score of the temperature data through a sliding window model, dividing the stability score into stability levels, and associating and fusing the first-level data stream with the traffic condition data stream based on geographical location information to generate a third-level enhanced data stream containing stability levels and context information; According to the third-level enhanced data stream, dynamically calculating an optimal transportation path based on a reinforcement learning algorithm, and dynamically adjusting the weight of each cost factor in the path cost function during the calculation of the optimal transportation path according to the real-time temperature control state; at the same time, generating corresponding emergency control instructions according to the stability level based on a predefined hierarchical response rule library; Downlinking the generated optimal transportation path and emergency control instructions to the vehicle-mounted execution equipment.
[0008] In an optional embodiment, the anomaly detection based on the predefined machine learning model specifically includes: Standardizing the raw temperature data stream after filtering invalid data, and constructing a fixed-length sliding window sequence in time sequence; Inputting the sliding window sequence into the predefined machine learning model to output a scalar value representing the anomaly probability of the current sequence ; Logical synthesis of the scalar value and the instantaneous change threshold value determined based on rules to generate a final anomaly identifier , represented as
[0009] Wherein, represents an anomaly, represents normal, is a model probability threshold, is a threshold value of the temperature change amplitude of adjacent sampling points, , are , temperature sampling values at
[0010] In an optional embodiment, the predefined machine learning model is based on a long short-term memory network model deployed by TensorFlow Lite engine, i.e., 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 a model compression and conversion tool.
[0011] In an optional embodiment, the stability score of the temperature data is calculated by a sliding window model, specifically including: The temperature data is extracted from the second-level standardized data stream and partitioned according to data sources, and a sliding window is divided for the temperature data stream in each partition; The average value of the temperature value set in each sliding window is calculated and the standard deviation ; The stability score of the current sliding window is calculated by the following formula , .
[0012] In an optional embodiment, the path cost function is represented as,
[0013] wherein, is the estimated travel time, is the estimated fuel consumption, is the congestion probability, is the temperature control risk, is the weight coefficient, ; The adjustment formula of the weight coefficient is,
[0014] wherein, is the adjustment score generated by the policy network of the reinforcement learning algorithm for the first cost factor, is a scaling constant.
[0015] In an optional embodiment, the optimal transportation path is dynamically calculated based on the reinforcement learning algorithm, specifically including: The real-time environmental state information is extracted from the third-level enhanced data stream, and the state space vector of the reinforcement learning model is constructed according to the real-time environmental state information, including the current position of the vehicle, the destination position, the current temperature stability score, the current temperature inside the vehicle cabin, the remaining cold storage shelf life, the real-time traffic congestion state, and the future weather forecast; An executable action set of the reinforcement learning model is defined, including keeping the current path, switching to a predefined backup path, and requesting emergency assistance; the paths in the action set are generated based on the current state of the vehicle using the K-shortest path algorithm or the path search algorithm with constraints; An immediate reward function of the reinforcement learning model is defined; 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 rule, and the action is a transportation path generated by the K-shortest path algorithm or the path search algorithm with constraints; The weight coefficients of each cost factor output in the decision process are recorded in the log.
[0016] In an optional embodiment, the calculation formula of the immediate reward function of the reinforcement learning model is,
[0017] wherein, is the path cost function, is the estimated damage amount based on the current temperature, the remaining time, and the characteristics of the goods, 、 is a balance coefficient.
[0018] In a second aspect, the technical scheme of the present application provides a cold chain logistics temperature monitoring and path optimization system, comprising: A temperature data collection and processing module is configured to collect raw temperature data streams from temperature sensors through edge computing nodes deployed on cold chain transportation vehicles, and to preprocess the raw temperature data streams to generate first-level data streams containing abnormality identifiers, the preprocessing including filtering invalid data and performing abnormality detection based on a predefined machine learning model; A data unification module is configured to obtain traffic condition data streams and weather forecast data streams, and to convert the first-level data streams, the traffic condition data streams, and the weather forecast data streams into a predefined standardized format using a dynamic Schema registration mechanism, to generate second-level standardized data streams; A data fusion module is configured to calculate stability scores of the temperature data based on the second-level standardized data streams using a sliding window model, to divide stability levels according to the stability scores, and to associate and fuse the first-level data streams with the traffic condition data streams based on geographic location information, to generate third-level enhanced data streams containing stability levels and context information; The transport path and control instruction generation module is configured to dynamically calculate an optimal transport path based on a reinforcement learning algorithm according to the third-level enhanced data stream, and a path cost function in the process of calculating the optimal transport path is dynamically adjusted according to real-time temperature control states to adjust weights of various cost factors; meanwhile, the corresponding emergency control instruction is generated according to the stability level based on a pre-defined hierarchical response rule library. The result issuing module is configured to issue the generated optimal transport path and emergency control instruction to a vehicle-mounted execution device.
[0019] In a third aspect, the technical solution of the present application provides a terminal, which comprises: A memory configured to store a cold-chain logistics temperature monitoring and path optimization program. A processor configured to implement the steps of the cold-chain logistics temperature monitoring and path optimization method according to any one of the above aspects when executing the cold-chain logistics temperature monitoring and path optimization program.
[0020] In a fourth aspect, the technical solution of the present application provides a computer-readable storage medium, wherein the readable storage medium stores a cold-chain logistics temperature monitoring and path optimization program, and the cold-chain logistics temperature monitoring and path optimization program is configured to implement the steps of the cold-chain logistics temperature monitoring and path optimization method according to any one of the above aspects when executed by a processor.
[0021] As can be seen from the above technical solutions, the present application has the following advantages: 1. The present application introduces an edge computing node to perform lightweight machine learning inference and anomaly detection close to the data source, reduces the temperature anomaly recognition delay from the minute level in the traditional scheme to the second level or even the millisecond level, greatly shortens the anomaly response time, and simultaneously performs real-time association and calculation on multi-source data streams based on a distributed stream processing technology, so that the dynamic path optimization frequency can be improved from the hour level to the minute level or even the second level, which can efficiently cope with dynamic scenes such as sudden traffic congestion and severe weather, and significantly reduces the risk of goods damage during transportation; 2. The present application automatically converts data from different sources and in different formats into a standardized format through a dynamic Schema registration mechanism, realizes seamless fusion and real-time association of multi-source heterogeneous data such as vehicle-mounted sensing data, traffic data and meteorological data, breaks the data island, and enables the decision system to obtain global and context-rich enhanced data streams, thereby laying a data foundation for subsequent accurate decision-making; 3、The application introduces a dynamic decision mechanism based on reinforcement learning, the weight coefficient of the path cost function of which can be dynamically adjusted according to the real-time temperature control state, so that the path planning strategy can be adaptively switched from cost priority or time efficiency priority to quality guarantee priority, realizing intelligent balance and optimization of multiple objectives. Combined with the hierarchical response rule base, the system can execute differentiated emergency actions such as driver warning, path switching, emergency help, etc. according to different risk levels. BRIEF DESCRIPTION OF DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the present application, the drawings required to be used in the description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0023] Figure 1 A cold chain logistics temperature monitoring and path optimization method process schematic diagram provided for an embodiment of the present application.
[0024] Figure 2 A cold chain logistics temperature monitoring and path optimization system structure schematic diagram provided for an embodiment of the present application.
[0025] Figure 3 A terminal structure schematic diagram provided for an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to make the application purposes, features and advantages of the present application more obvious and easy to understand, the technical solutions protected by the present application will be described in detail below with specific embodiments and drawings. Obviously, the following described embodiments are only some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0027] Unless otherwise defined, all technical and scientific terms used in the present application have the same meaning as understood by those skilled in the art to which the present application belongs. The terms used in the specification of the present application are only for the purpose of describing the specific embodiments and are not intended to limit the present application.
[0028] Figure 1 A cold chain logistics temperature monitoring and path optimization method process schematic diagram provided for an embodiment of the present application. Among them, Figure 1The execution subject can be a cold chain logistics temperature monitoring and path optimization system. The cold chain logistics temperature monitoring and path optimization method provided by the embodiment of the present application is executed by a computer device, and accordingly, the cold chain logistics temperature monitoring and path optimization system runs in the computer device. According to different needs, the order of steps in the flowchart can be changed, and some can be omitted.
[0029] As shown in the method includes the following steps. Figure 1
[0030] S1, collecting raw temperature data streams from temperature sensors through edge computing nodes deployed on cold chain transport vehicles, and generating first-level data streams containing abnormality identification by preprocessing the raw temperature data streams, the preprocessing including filtering invalid data and performing abnormality detection based on a predefined machine learning model.
[0031] S2, obtaining traffic condition data streams and weather forecast data streams, and converting the first-level data streams, the traffic condition data streams and the weather forecast data streams into a predefined standardized format by using a dynamic Schema registration mechanism to generate second-level standardized data streams.
[0032] S3, based on the second-level standardized data streams, calculating stability scores of the temperature data by using a sliding window model, dividing stability levels according to the stability scores, and associating and fusing the first-level data streams with the traffic condition data streams based on geographic location information to generate third-level enhanced data streams containing stability levels and context information.
[0033] S4, according to the third-level enhanced data streams, dynamically calculating an optimal transport path based on a reinforcement learning algorithm, the path cost function in the process of calculating the optimal transport path dynamically adjusting the weight of each cost factor according to the real-time temperature control state; and at the same time, generating corresponding emergency control instructions according to the stability levels based on a predefined hierarchical response rule library.
[0034] S5, issuing the generated optimal transport path and emergency control instructions to the on-board execution device.
[0035] Further, as a refinement and expansion of the above embodiment, in order to fully describe the specific implementation process in this embodiment, another cold chain logistics temperature monitoring and path optimization method is provided, which is realized based on a system using edge-cloud collaborative architecture, a cold chain logistics real-time monitoring and dynamic optimization platform is built with Apache Kafka as the core, and a complete closed loop from data collection, real-time analysis to decision execution is realized. The architecture includes Kafka Edge node, Kafka Central Cluster, stream processing engine, decision engine, and execution terminal. The Kafka Edge node uses Kafka Connect+TensorFlow Lite to realize edge data preprocessing and lightweight anomaly detection. The Kafka Central Cluster uses a multi-Broker partitioning strategy to realize high-throughput data storage and distribution. The stream processing engine uses Flink+Kafka Streams to realize 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 realize dynamic path optimization and emergency instruction generation.
[0036] The method comprises the following steps.
[0037] S101, generating a first-level data stream according to an original temperature data stream.
[0038] The original temperature data stream from the temperature sensor is collected by the edge computing node deployed on the cold chain transportation vehicle, and the original temperature data stream is preprocessed to generate a first-level data stream containing an abnormality identifier. Specifically, the sensor data is accessed, the temperature data is collected by the vehicle-mounted sensor (such as a DS18B20 temperature sensor), and then the source data is filtered and lightweight anomaly detection is realized through the edge control layer (Kafka Edge node processing).
[0039] The preprocessing includes first filtering invalid data, and considering temperature exceeding the range of-30℃~50℃ as invalid data, and then based on a predefined machine learning model, performing anomaly detection on the temperature data stream after removing invalid data. The predefined machine learning model is based on a long short-term memory network model deployed by a TensorFlow Lite engine, that is, a standard long short-term memory network model is first trained using historical temperature data, and then a model compression and conversion tool is used to convert the trained long short-term memory network model into a TensorFlow Lite format.
[0040] Based on the predefined machine learning model, anomaly detection can be performed by inputting the temperature sequence in the last 60 seconds and outputting the abnormal probability. A probability greater than a certain value is considered normal, otherwise it is abnormal data, which includes the following steps.
[0041] S101.1, normalize the original temperature data stream after filtering out invalid data, and construct a fixed-length sliding window sequence in chronological order.
[0042] The standardization process uses the Z-Score normalization method, and the calculation formula is:
[0043] in, represents the normalized temperature value, Indicates the original temperature sampling value, represents the mean value of temperature data obtained during the training phase, Represents the standard deviation of temperature data obtained during the training phase.
[0044] The length of the sliding window corresponds to the number of sampling points in 60 seconds, and the normalization parameter and It is obtained from the training data set during the model training phase and solidified in the edge computing node.
[0045] S101.2, input the sliding window sequence into a predefined machine learning model and output a scalar value representing the probability of anomaly of the current sequence .
[0046] S101.3, scalar value Perform logical synthesis with the instantaneous change threshold based on rule judgment to generate the final anomaly identifier , expressed as,
[0047] in, Represents an exception, Represents normal, is the model probability threshold, is the threshold of the temperature change amplitude of adjacent sampling points, 、 They are 、 The temperature sampling value at the moment.
[0048] Among them, the model probability threshold The value range of is 0.7 to 0.9, and the value range of the threshold of the temperature change amplitude of adjacent sampling points is 1.5℃ to 3℃.
[0049] The exception identifier , original temperature value , timestamp and device identifier ID combination into a new data record, output as the first level data stream. This step combines rule filtering and model inference, taking into account the real-time and accuracy of detection. Among them, the lightweight model based on LSTM can effectively capture the time sequence dependence and complex fluctuation pattern in the temperature sequence, so as to identify the potential anomalies that single-point threshold rule is difficult to find; And the simple instantaneous change rule as a supplement, can quickly capture the sudden change type anomaly that the model may miss, form complementary advantages. Finally, only the effective data with abnormal identifier is uploaded to the central cluster, realizing the efficient balance of edge intelligence and cloud cooperation.
[0050] S102, multi-source data unified format generates second level standardized data stream.
[0051] Traffic condition data stream and weather forecast data stream are obtained, and dynamic Schema registration mechanism is used to convert the first level data stream, traffic condition data stream and weather forecast data stream into a pre-defined standardized format, to generate the second level standardized data stream.
[0052] Through different connectors (Connector), the data streams from multiple independent sources are accessed in parallel: The first level data stream: the data from the edge side Kafka Edge node, which has contained the abnormal identifier Alert, and its initial format may be lightweight JSON or Protobuf; Traffic condition data stream: through the configuration of HTTP / HTTPS connector or message queue connector, real-time acquisition is made from third-party traffic data service API. The data format is usually JSON format returned by RESTful API; Weather forecast data stream: through similar mechanism, weather forecast data of specific time period and specific geographical area in the future is obtained from weather service API, and the format is also mostly JSON.
[0053] Apache Avro is used as a unified data serialization format, and Schema Registry is used to provide services: at the initial stage of system deployment, a strict AvroSchema is predefined for all data types that need to be integrated; for each data source, a corresponding Kafka Connect converter is configured, when a raw traffic data in JSON format arrives, the converter queries the Schema Registry for the corresponding Avro Schema according to the configured Schema name, and the converter verifies and converts the JSON data according to the Schema, converts it into binary Avro format, in this process, the converter automatically performs field mapping and type conversion, for example, converts the latitude and longitude in string form in JSON to the string type geo_fence field defined in the Avro Schema; finally, the data is serialized into Avro binary format together with the corresponding Schema ID, and sent to the corresponding Topic in the Kafka central cluster.
[0054] All data from different sources are converted and serialized into binary data streams conforming to the predefined Avro Schema, and stored in different Topics in the Kafka Central Cluster, and these data streams collectively constitute the second-level standardized data stream.
[0055] S103, temperature stability evaluation.
[0056] Based on the second-level standardized data stream, the stability score of the temperature data is calculated through a sliding window model, and the stability level is divided according to the stability score, which specifically includes the following steps.
[0057] S103.1, extract temperature data from the second-level standardized data stream, and partition according to the data source, and divide the sliding window for the temperature data stream in each partition.
[0058] The data source can be a vehicle ID, a sensor ID.
[0059] S103.2, calculate the average value of the temperature value set in each sliding window and the standard deviation .
[0060] S103.3, calculate the stability score of the current sliding window by the following formula , .
[0061] It should be noted that the calculation formula is applicable to scenario, The absolute value is used to ensure the mathematical validity of the score calculation.
[0062] Standard Deviation Measures the absolute fluctuation amplitude of temperature values within a time window. The larger, the more intense the temperature fluctuation, the worse the stability.
[0063] Mean Value Represents the average temperature level within the time window. It is used to normalize the fluctuation amplitude. This is because the same absolute fluctuation (such as ±2℃) has different relative impacts on different baseline temperatures (such as -18℃ vs 5℃), and normalization makes the score comparable at different temperature intervals.
[0064] That is, the coefficient of variation, a statistical measure that measures the relative fluctuation degree of data, which is consistent with the definition of stability.
[0065] Convert the coefficient of variation into a direct score form. When the relative fluctuation is very small, the score tends to 1, indicating very stable; when the relative fluctuation is very large, the score tends to 0, indicating extremely unstable.
[0066] S103.4, Stability Level Mapping.
[0067] Map the calculated continuity stability score to a discrete stability level , the mapping rules are as follows: If ∈ [0.9, 1.0], then = “Excellent”; If ∈ [0.7, 0.9), then = “Good”; If ∈ [0, 0.7), then = “Poor”.
[0068] The stability level defined in this step will be a core input condition for the grading response rule base in step S4, directly used to trigger emergency control instructions of different levels.
[0069] Combine the stability score, stability level, window start time, window end time, and device identifier ID into a new data record, and output as the third-level enhanced data stream.
[0070] S104, Data Fusion to Generate Third-Level Enhanced Data Stream.
[0071] The first level data stream is associated and fused with the traffic condition data stream based on the geographical location information to generate a third level enhanced data stream containing stability level and context information.
[0072] This step is performed by a stream processing engine in the system, which consumes the second level standardized data stream from the Kafka cluster, extracts the temperature data sequence from it. For each data source (e.g. each vehicle, each refrigerated container), the system maintains a sliding time window for it, and calculates the average and standard deviation of the temperature in the window, the stability score, and the mapped stability level for the temperature value set in each window.
[0073] To break the data silos, the stream processing engine needs to associate the calculated stability data with external data (e.g. traffic) in real time, which is achieved through key-based join operations, including the temperature event stream and the traffic event stream. Each record in the temperature event stream contains device ID, timestamp, latitude and longitude coordinates, 、 , etc. fields. This stream is registered as Kafka Topic sensor_enriched. The traffic event stream comes from the standardized data stream of the external traffic API, and each record contains event type, geographical location severity, expected duration, etc. fields. This stream is registered as Kafka Topic traffic_events.
[0074] Geographical location and time are used as the keys to associate the two data streams. Spatial association means that for each latest temperature event data, its GPS coordinates are calculated with the traffic event geofence to determine whether the vehicle is currently in or about to enter the influence range of a certain traffic event. Time association means that since the data stream is infinite, the association operation is performed within a configurable time window.
[0075] The stream processing engine performs the above spatio-temporal condition-based join query. For successfully matched records, the system splices the detailed information of the traffic event with the temperature stability data into a new record.
[0076] S105, generating the optimal transportation path based on reinforcement learning.
[0077] Based on the third level enhanced data stream, the optimal transportation path is dynamically calculated based on the reinforcement learning algorithm. The path cost function in the process of calculating the optimal transportation path dynamically adjusts the weight of each cost factor according to the real-time temperature control state.
[0078] Firstly, the path planning algorithm generates N feasible candidate paths based on real-time state. Then, the reinforcement learning model dynamically adjusts the weight of each cost factor of the cost function according to the current state (including temperature control state), and uses it to calculate the comprehensive cost of each candidate path. After that, the path with the lowest comprehensive cost is selected as the "action" A t This path is the "optimal transportation path". This "action" A t (its core is path ID or path coordinate sequence) is issued as "driving instructions" to the vehicle navigation system or driver APP for execution. At the same time, the weight of each cost factor used in this calculation is recorded for analyzing the decision-making reason and optimizing the model.
[0079] Specifically, the path cost function is represented as,
[0080] where, is the estimated travel time, is the estimated fuel consumption, is the congestion probability, and is the temperature control risk,
[0081] Estimated travel time represents the timeliness cost of the path. Its value is obtained by integrating real-time traffic data API. The system sends the vehicle's current position, destination position, and coordinate sequence of the candidate path to the traffic data API, and obtains the predicted travel time based on real-time traffic conditions (such as congestion and accidents). This factor is directly related to the punctuality of the transportation task.
[0082] Estimated fuel consumption represents the economic cost of the path. Its value is obtained by an oil consumption estimation algorithm based on a physical model, and the calculation formula can be represented as, = (road mileage / 100) * vehicle 100 km reference fuel consumption * f(average speed, road slope) where road mileage is the total length of the path, vehicle 100 km reference fuel consumption is a specific vehicle's inherent parameter, and f(average speed, road slope) is a correction coefficient function that adjusts the fuel consumption according to the real-time predicted average driving speed and road slope information. This factor directly determines the fuel cost of transportation.
[0083] Congestion probability 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 congestion probability of a road segment in a specific time period can be obtained by analyzing historical data, and then corrected by superimposing the influence of real-time traffic accidents and weather events. This value is a scalar between 0 (absolute free flow) and 1 (complete congestion). High congestion probability not only increases travel time, but also increases the load of refrigeration equipment and the risk of temperature fluctuations.
[0084] Temperature control risk is the core cost item to ensure the quality of goods, which quantifies the risk of damage to goods due to temperature changes when driving on a specific route. Its calculation formula is,
[0085] where, is the temperature stability score calculated in the current time window. This formula indicates that the more unstable the current temperature control state is (the lower the , the higher the (1- ), and the longer the exposure time in this state (the longer the ), the greater the value of the temperature control risk . This allows the cost function to sensitively capture the real-time risk faced by the goods and quantify this risk as a value that can be compared with other costs (such as time, fuel consumption).
[0086] Adjustment formula for weight coefficient is,
[0087] where, is the adjustment score generated by the policy network of the reinforcement learning algorithm for the th cost factor, is the scaling constant.
[0088] Adjustment formula for weight coefficient is a variant of the Softmax function, which converts the original score output by the reinforcement learning policy network into a probability distribution with the sum of all weights equal to 1.
[0089] Scaling constant is used to control the "sharpness" of the weight distribution. The larger the value, the more obvious the weight advantage obtained by the cost factor with the highest score, and the stronger the preference of the system decision; The smaller the value, the more evenly distributed the weight. This parameter is usually determined by tuning during the training phase of the system.
[0090] Score generated by a reinforcement learning policy network. The network learns an optimal policy by constantly interacting with the environment and receiving feedback from the reward function R, which is how to choose the next action A t based on the current state S , so as to dynamically adjust the trade-off center of the cost function to maximize the long-term cumulative reward. For example, when the temperature stability is good, the network will reduce the score of , so that the system pays more attention to time and economic cost; when the stability is poor, the score of will be significantly increased, forcing the path planning to prefer the path that can get out of the risk state the fastest, at which time the goods preservation becomes the highest priority.
[0091] The optimal transportation path is dynamically calculated based on the reinforcement learning algorithm, which includes the following steps.
[0092] S105.1, extract real-time environmental state information from the third-level enhanced data stream, and construct a state space vector of the reinforcement learning model based on the real-time environmental state information, including the current position of the vehicle, the destination position, the current temperature stability score, the current temperature inside the vehicle, the remaining cold storage shelf life, the real-time traffic congestion state and the future weather forecast.
[0093] S105.2, define the set of executable actions of the reinforcement learning model, including maintaining the current path, switching to a pre-defined backup path, and requesting emergency assistance.
[0094] 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 the path search algorithm with constraints.
[0095] S105.3, define the immediate reward function of the reinforcement learning model.
[0096] The calculation formula of the immediate reward function of the reinforcement learning model is
[0097] wherein is the path cost function, is the estimated damage amount based on the current temperature, the remaining time and the characteristics of the goods, , is the balance coefficient.
[0098] The calculation of the estimated damage amount is based on a simplified model of the Arrhenius formula, which is positively correlated with temperature T and time t, and is specifically expressed as:
[0099] wherein, and are deterioration rate coefficients related to the type of goods.
[0100] S105.4, input the state space vector into the policy network, and output the weight coefficients of each cost factor in the path cost function.
[0101] The policy network is implemented using a deep neural network, with the input layer dimension consistent with that of the state space vector and the output layer dimension consistent with the number of cost factors. The current state space vector is input into the policy network, and a set of original adjustment scores {s1, s2, s3, s4} is generated at the output layer through nonlinear transformation of the internal hidden layers. The scores {s1, s2, s3, s4} are normalized by the Softmax function to obtain the final dynamic weight coefficients .
[0102] When the score is high (good stability), the policy network will allocate more weight to (time) and (fuel consumption), and the system tends to choose an economic or fast route.
[0103] When the score is low (poor stability), the policy network will automatically increase the weight of (temperature control risk), so that the proportion of the ΔT term in the cost function increases, thereby forcing the reinforcement learning model to choose a path that can minimize the transit time and reach the destination as quickly as possible, with the highest goal of preserving the quality of the goods.
[0104] S105.5, input the current state into the trained reinforcement learning model, which selects the action with the highest value as the optimal transportation path according to the decision rule. This action is a transportation path generated by the K-shortest path algorithm or a path search algorithm with constraints.
[0105] The decision-making process of the reinforcement learning model includes a two-level decision. The first-level decision (macro-strategy selection): the agent selects a macro-action A t with the highest value in the action space A according to its policy π, for example: a_routeA, which represents "selecting the backup path set A"; the second-level decision (micro-path calculation): once the macro-action A t is selected, the system calls the corresponding path planning algorithm to calculate the specific optimal path corresponding to the macro-action based on the latest real-time state information (such as traffic congestion, weather).
[0106] As another implementation, the action space A is directly defined as the set of top K optimal candidate paths generated by the path planning algorithm in real time, i.e., A = {Path1, Path2,..., PathK}; the policy of the reinforcement learning model directly selects the one with the lowest comprehensive cost from the K candidate paths as the final action A. K t .
[0107] The path planning algorithm is equivalent to an option generator, quickly and efficiently narrowing down the decision range, from the almost infinite path network, according to the basic constraints (such as road level, length, forbidden sections), to generate a controllable number (K) of high-quality candidate path shortlist, solving the challenge of reinforcement learning action space being too large and difficult to directly handle continuous or high-dimensional decision problems. The reinforcement learning module is equivalent to an intelligent decision maker, making a globally optimal decision in this high-quality candidate path set provided by the path planning algorithm, which no longer only considers path length or time, but also comprehensively considers multiple and dynamic cost factors such as real-time temperature control risk, cargo damage risk, fuel consumption, and congestion probability. It is equivalent to introducing learning and applicability, learning through the reward function R that when the temperature stability is poor, a slightly longer but smooth path may be more valuable than a short but congested path, as it can minimize the higher-priority cost of cargo damage.
[0108] S105.6, record the weight coefficients of each cost factor output in the decision-making process to the log.
[0109] S106, generate emergency control instructions based on temperature stability.
[0110] Based on the pre-defined hierarchical response rule base, generate corresponding emergency control instructions according to the stability level.
[0111] The rule engine maintains a hierarchical response rule base that defines the mapping relationship between different stability levels and their corresponding trigger conditions and response actions. The rule engine listens to the third-level enhanced data stream from the stream processing engine in real time, and as soon as it detects an update in the field, it immediately matches it with the conditions in the rule base and executes the corresponding action set.
[0112] First-level response (red alert): triggered when is "poor" or the temperature exceeds the safety threshold for 3 consecutive minutes. This level indicates that the temperature control system is facing serious risks and the goods are facing a substantial threat of damage. The response action triggered is the highest-priority comprehensive disposal plan, including: Path emergency switching: immediately invoke the path planning algorithm to calculate and switch to the shortest path or the fastest path currently available, with the sole goal of maximizing the reduction of remaining transportation time; Device emergency start: issue instructions to the vehicle controller to automatically start the backup refrigeration unit or force the main refrigeration unit to run at maximum power, attempting to restore the temperature in the vehicle cabin to a safe range. Personnel coordination warning: send the highest level of warning information to the driver terminal and the background monitoring center at the same time, and automatically notify the consignee to prepare for emergency pickup and inspection.
[0113] Secondary response (yellow warning): triggered when the temperature of the adjacent sampling point fluctuates more than ΔT_threshold (such as 2°C). This level indicates that the temperature control state is unstable and there is a potential risk. The response action is an intervention control measure, including: Driver intervention prompt: pop up a prominent warning message on the driver terminal (such as APP or vehicle display screen) to prompt the driver to pay attention to temperature abnormalities and check the equipment status; Driving strategy suggestion: suggest the driver reduce the vehicle speed to below 80 km / h to reduce temperature fluctuations caused by vehicle jolting, frequent starting and stopping.
[0114] Third-level response (blue warning): triggered when the system predicts through weather data analysis that the vehicle will encounter severe weather (such as heavy rain, high temperature) in the next 30 minutes. This level is a predictive defense, aiming to avoid potential risks. The response action is a preventive measure, including: Preventive route adjustment: re-plan the route to avoid dangerous areas such as mountainous areas, waterlogged sections, and other areas susceptible to weather; Vehicle self-check instructions: issue instructions to prompt the driver or automatically trigger a check of the vehicle cabin sealing and refrigeration equipment working conditions to prepare for the situation.
[0115] S107, the result is issued.
[0116] The generated optimal transportation path and emergency control instructions are issued to the vehicle-mounted execution equipment.
[0117] Receive the optimal transportation path from the decision engine and the emergency control instructions from the rule engine, and encapsulate them into standard data packets that conform to the vehicle-mounted device communication protocol (such as MQTT, HTTP / HTTPS). Then, push the instruction data packets to the message cluster through the designated Topic of the message middleware (such as Kafka).
[0118] The Kafka Edge node or dedicated protocol gateway on the edge side will subscribe to the above Topic. Once they receive a new instruction message, they will immediately convert it into an instruction format that can be parsed by the vehicle controller or driver APP, and issue it to the target vehicle's vehicle-mounted execution equipment through the wireless network.
[0119] The vehicle-mounted execution device, after receiving the instruction, will directly import the optimal transportation path into the vehicle-mounted navigation system or intelligent driving system as a new driving route for automatic execution; the emergency control instruction will be executed by the vehicle-mounted controller or displayed on the driver's interactive interface and executed after being confirmed by the driver.
[0120] The above describes an embodiment of a cold-chain logistics temperature monitoring and path optimization method, and based on the cold-chain logistics temperature monitoring and path optimization method described above, the embodiment of the present application further provides a cold-chain logistics temperature monitoring and path optimization system corresponding to the method.
[0121] Figure 2 The cold-chain logistics temperature monitoring and path optimization system provided in the embodiment of the present application is a structural schematic block diagram, and in the embodiment, the cold-chain logistics temperature monitoring and path optimization system 200 can be divided into multiple functional modules according to the functions performed by the system. The module referred to in the present application refers to a series of computer program segments that can be executed by at least one processor and can complete a fixed function, which are stored in the memory.
[0122] The temperature data collection and processing module 210 is configured to collect raw temperature data streams from temperature sensors through edge computing nodes deployed on cold-chain transportation vehicles, and to generate first-level data streams containing abnormality identification by preprocessing the raw temperature data streams, wherein the preprocessing includes filtering invalid data and performing abnormality detection based on a predefined machine learning model.
[0123] The data unification module 220 is configured to obtain traffic condition data streams and weather forecast data streams, and to convert the first-level data streams, the traffic condition data streams and the weather forecast data streams into a predefined standardized format by using a dynamic Schema registration mechanism, to generate second-level standardized data streams.
[0124] The data fusion module 230 is configured to calculate a stability score of the temperature data based on the second-level standardized data streams by using a sliding window model, to divide the stability score into a stability level, and to associate and fuse the first-level data streams with the traffic condition data streams based on geographic location information, to generate third-level enhanced data streams containing the stability level and context information.
[0125] The transportation path and control instruction generation module 240 is configured to dynamically calculate an optimal transportation path based on a reinforcement learning algorithm according to the third-level enhanced data streams, and to dynamically adjust the weight of each cost factor in the path cost function during the calculation of the optimal transportation path according to the real-time temperature control state; and to generate corresponding emergency control instructions according to the stability level based on a predefined hierarchical response rule library.
[0126] The result issuing module 250 is configured to issue the generated optimal transportation path and emergency control instruction to a vehicle-mounted execution device.
[0127] The cold-chain logistics temperature monitoring and path optimization system of the present embodiment is used to implement the cold-chain logistics temperature monitoring and path optimization method described above, and thus the specific implementation of the system can refer to the description of the corresponding part of the embodiment of the cold-chain logistics temperature monitoring and path optimization method, and will not be introduced here.
[0128] In addition, since the cold-chain logistics temperature monitoring and path optimization system of the present embodiment is used to implement the cold-chain logistics temperature monitoring and path optimization method described above, its role corresponds to the role of the above method, and will not be described here.
[0129] Figure 3 A structure schematic diagram of a terminal 300 provided by the present embodiment includes a processor 310, a memory 320, and a communication unit 330. The processor 310 is configured to implement the flow steps of the cold-chain logistics temperature monitoring and path optimization method embodiments described above when implementing the cold-chain logistics temperature monitoring and path optimization program stored in the memory 320.
[0130] The present application also provides a computer storage medium, which can be a magnetic disc, an optical disc, a read-only memory (ROM) or a random access memory (RAM), etc. The computer storage medium stores a cold-chain logistics temperature monitoring and path optimization program, and the flow steps of the cold-chain logistics temperature monitoring and path optimization method embodiments described above are implemented when the cold-chain logistics temperature monitoring and path optimization program is executed by a processor.
[0131] The above description of the disclosed embodiments enables a person skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined in the present application can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown in the present application, but will conform to the widest scope consistent with the principles and novel features disclosed in the present application.
Claims
1. A method for temperature monitoring and path optimization of cold chain logistics, characterized in that: The following steps are involved: Edge computing nodes deployed on cold chain transport vehicles collect raw temperature data streams from temperature sensors and preprocess the raw temperature data streams to generate first-level data streams containing anomaly identifiers. Preprocessing includes filtering out invalid data and performing anomaly detection based on predefined machine learning models. Obtain traffic status data stream and weather forecast data stream, and use the dynamic schema registration mechanism to convert the first-level data stream, traffic status data stream and weather forecast data stream into a predefined standardized format to generate the second-level standardized data stream; Based on the second-level standardized data stream, a sliding window model is used to calculate the stability score of the temperature data. Stability levels are then classified based on the stability score. The first-level data stream is then correlated and fused with the traffic condition data stream based on geographic location information to generate a third-level enhanced data stream containing stability levels and contextual information. Based on the third-level enhanced data stream, the optimal transportation path is dynamically calculated based on the 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. At the same time, based on the predefined hierarchical response rule library, corresponding emergency control instructions are generated according to the stability level. The generated optimal transport route and emergency control instructions are sent to the on-board execution equipment.
2. The method according to claim 1, characterized in that Anomaly detection based on predefined machine learning models, including: The original temperature data stream after filtering out invalid data is normalized and a fixed-length sliding window sequence is constructed in chronological order; Input the sliding window sequence into a predefined machine learning model and output a scalar value representing the probability of anomaly of the current sequence ; The scalar value Perform logical synthesis with the instantaneous change threshold based on rule judgment to generate the final anomaly identifier , expressed as, in, Represents an exception, Represents normal, is the model probability threshold, is the threshold of the temperature change amplitude of adjacent sampling points, 、 They are 、 The temperature sampling value at the moment.
3. The method according to claim 2, characterized in that The predefined machine learning model is based on the long short-term memory network model deployed by the TensorFlow Lite engine. That is, a standard long short-term memory network model is first trained with historical temperature data, and then the trained long short-term memory network model is converted into the TensorFlow Lite format using the model compression and conversion tool.
4. The method according to claim 1, wherein The stability score of temperature data is calculated using a sliding window model, specifically including: 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; Calculate the average value for each set of temperature values within the sliding window and standard deviation ; The stability score of the current sliding window is calculated by the following formula , 。 5. The method according to claim 1, wherein The path cost function is expressed as, in, To estimate the driving time, To estimate fuel consumption, is the congestion probability, For temperature control risks, is the weight coefficient, ; Weight coefficient The adjustment formula is: in, The policy network of the reinforcement learning algorithm is The adjustment score generated by the cost factor, is the scaling constant.
6. The method according to claim 5, characterized in that Dynamically calculate the optimal transportation path based on reinforcement learning algorithms, including: Extracting real-time environmental status information from the third-level enhanced data stream and constructing the state space vector of the reinforcement learning model based on the real-time environmental status information, including the vehicle's current location, destination location, current temperature stability score, current interior temperature, remaining refrigeration shelf life, real-time traffic congestion status, and future weather forecast; Define a set of actions that can be executed by the reinforcement learning model, including maintaining the current path, switching to a predefined backup path, and requesting emergency assistance. The paths in the action set are generated based on the vehicle's current state using a K-shortest path algorithm or a constrained path search algorithm. Define the immediate reward function of the reinforcement learning model; Input the state space vector into the policy network and output the weight coefficient of each cost factor in the path cost function; The current state is fed into the trained reinforcement learning model, which selects the action with the highest value as the optimal transport path based on the decision rule. This action is a transport path generated by the K-shortest path algorithm or the constrained path search algorithm. The weight coefficients of each cost factor output during the decision-making process are recorded in the log.
7. The method according to claim 6, characterized in that The calculation formula of the immediate reward function of the reinforcement learning model is, in, is the path cost function, The estimated amount of cargo damage based on the current temperature, remaining time and cargo characteristics. 、 is the balance coefficient.
8. A cold chain logistics temperature monitoring and path optimization system, characterized in that: include: A 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 out invalid data and performing anomaly detection based on a predefined machine learning model. The data unification module is used to obtain the traffic status data stream and the weather forecast data stream, and use the dynamic schema registration mechanism to convert the first-level data stream, the traffic status data stream, and the weather forecast data stream into a predefined standardized format to generate the second-level standardized data stream; A data fusion module is used to calculate the stability score of the temperature data using a sliding window model based on the second-level standardized data stream, classify the stability levels according to the stability score, and associate and fuse the first-level data stream with the traffic status data stream based on geographic location information to generate a third-level enhanced data stream containing stability levels and contextual information; The transport path and control instruction generation module is used to dynamically calculate the optimal transport path based on the third-level enhanced data stream and the reinforcement learning algorithm. The path cost function in the process of calculating the optimal transport path dynamically adjusts the weights of each cost factor according to the real-time temperature control status. At the same time, based on the predefined hierarchical response rule library, corresponding emergency control instructions are generated according to the stability level; The result sending module is used to send the generated optimal transportation path and emergency control instructions to the on-board execution equipment.
9. A terminal, characterized in that: include: Memory, used to store cold chain logistics temperature monitoring and route optimization programs; A processor is used to implement the steps of the cold chain logistics temperature monitoring and path optimization method as described in any one of claims 1 to 7 when executing the cold chain logistics temperature monitoring and path optimization program.
10. A computer-readable storage medium, characterized in that The readable storage medium stores a cold chain logistics temperature monitoring and path optimization program, which, when executed by the processor, implements the steps of the cold chain logistics temperature monitoring and path optimization method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Cold chain transportation path optimization method and system based on AI prediction
CN120013403A
Intelligent monitoring and early warning system for cold-chain medicine transportation environment
CN120146354A
Intelligent logistics scheduling method and device based on dynamic weight and medium
CN120506948A
System for providing coldchain delivery management service
KR102613819B1
Method for automatically regulating explicit congestion notification of data center network based on multi-agent reinforcement learning
US20240080270A1