Intelligent traffic flow prediction method for port collecting and distributing system

By constructing digital twins and intelligent agent models, and combining them with deep reinforcement learning, the decision-making behavior of various participants in the port's collection and distribution system is simulated. This solves the problems of accuracy and adaptability in traffic flow prediction in existing technologies, and enables efficient prediction and optimization strategy generation under emergencies.

CN121565027AActive Publication Date: 2026-02-24CHENGDU TONGGUANG NETLINK TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511750031.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-26
Publication Date
2026-02-24
Estimated Expiration
2045-11-26

AI Technical Summary

Technical Problem

Existing methods for predicting traffic flow in port collection and distribution systems lack modeling of decision-making mechanisms, leading to decreased accuracy of predictions during emergencies. Furthermore, they lack adaptability to changes in system operating rules and cannot simulate the traffic distribution after changes in prediction rules.

Method used

A twin framework is constructed to simulate the decision-making behavior of each participant in the system through digital twins, intelligent agent models, and deep reinforcement learning, driving interaction and evolution in the virtual environment, generating traffic flow prediction results, and optimizing strategies through deep reinforcement learning.

Benefits of technology

It enables more accurate traffic flow prediction under emergencies, can adapt to changes in system rules, and provides optimization strategies to improve the operational efficiency and adaptability of port collection and distribution systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121565027A_ABST
    Figure CN121565027A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent traffic flow prediction method for a port collection and distribution system, and relates to the technical field of traffic flow prediction. Comprising a data sensing layer, a model layer, a simulation engine and a strategy optimization layer; gathering multi-source data: acquiring real-time data and historical data of physical entities and business activities in the system through a data sensing layer; and training a behavior model: based on historical data, constructing and training a plurality of intelligent agent models capable of simulating decision behaviors of each participant in the system in a model layer. According to the method, the intelligent agent model is constructed, and the decision logic and the business preference of each participant are quantified and simulated, so that the model can deduce the decision behavior of each party under an emergency under the driving of an endogenous decision mechanism, and a more accurate traffic flow prediction result is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traffic flow prediction technology, specifically to an intelligent method for predicting traffic flow in a port collection and distribution system. Background Technology

[0002] A port's cargo handling system refers to a comprehensive transportation network connecting the port with its hinterland, responsible for the collection and distribution of import and export goods at the port. It includes various modes of transportation such as highways, railways, waterways, aviation, and pipelines, as well as their hubs. Accurate traffic flow forecasting is crucial for port operation and management within such a complex and dynamic system. Despite its importance, many conventional port cargo handling flow forecasting methods still have significant limitations, such as over-reliance on historical statistics and simple models, and poor real-time performance and adaptability. Therefore, intelligent traffic flow forecasting methods are urgently needed.

[0003] For example, the invention patent with publication number CN119811086A discloses an artificial intelligence-based traffic flow prediction method, which includes: extracting time and spatial dimension features based on cleaned historical traffic data, calculating traffic flow statistical features at different time scales and spatial correlations between nodes and road segments, and constructing a spatial weight matrix; quantifying heterogeneous data such as weather and holidays into numerical or categorical features, and integrating them with traffic flow features to form multi-view, multi-modal features; using long short-term memory networks to model spatiotemporal features, capturing long-term dependencies and short-term fluctuations through gating mechanisms, and introducing attention mechanisms to dynamically adjust spatiotemporal location weights and strengthen the focus on key areas.

[0004] However, the above technical solutions still have the following shortcomings: 1. They only predict future traffic flow by learning the statistical patterns of traffic flow and various characteristics in historical data, lacking modeling of the decision-making mechanism, which leads to a decrease in the accuracy of the prediction results when sudden events occur; 2. They lack adaptability to changes in system operation rules, which means they can only predict traffic flow under existing rules and cannot simulate and predict the traffic distribution after rule changes. Summary of the Invention

[0005] The purpose of this invention is to provide an intelligent traffic flow prediction method for port collection and distribution systems to solve the problems mentioned in the background art.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for intelligent prediction of traffic flow in a port collection and distribution system, comprising: Constructing a digital twin framework: Establishing a digital twin of the port's collection and distribution system, which includes a data perception layer, a model layer, a simulation engine, and a strategy optimization layer; Aggregate multi-source data: Through the data perception layer, obtain real-time and historical data of physical entities and business activities within the system; Training Behavioral Models: Based on historical data, several intelligent agent models that can simulate the decision-making behavior of each participant in the system are built and trained at the model layer. Deploy a virtual environment: Place several intelligent agent models in a virtual runtime environment built by the simulation engine and embed preset system operation rules; Driving scenario evolution: Input any one of real-time data and set scenario parameters into the virtual operating environment to drive the intelligent agent model to interact and evolve based on decision-making behavior and system operating rules, and obtain traffic flow prediction results; Generate dynamic policies: The virtual operating environment is intervened through a deep reinforcement learning-based decision model in the policy optimization layer, the intervention effect is evaluated, and the optimized policy is obtained.

[0007] Furthermore, the method for constructing the intelligent agent model includes: Based on historical data, quantify the business preference attributes of each participant in the system; Extracting behavioral data related to participants' decision-making from historical data, including the set of decision options, decision results, and the environment in which the decision was made; Define quantitative indicators for the various business preference attributes of different types of participants; Based on behavioral data and combined with quantitative indicators, calculate the values ​​of various business preference attribute parameters; Decision logic for constructing an intelligent agent model based on business preference attributes; Define the model's input and output. The input is the current environment state and the set of available options, and the output is the final selected option. The attributes of each option in the available option set are broken down into multiple evaluation dimensions corresponding to business preferences; Based on the business preference attribute parameter values, each evaluation dimension is weighted and scored, and the weighted scores of all dimensions are aggregated to calculate the overall utility value of the option; the overall utility values ​​of each option are compared to generate the final decision.

[0008] Furthermore, the real-time data is input into the virtual operating environment for routine traffic flow prediction: It continuously receives real-time data from the data perception layer, maps it to the corresponding entities and states in the virtual operating environment; The intelligent agent model interacts with the system according to its built-in decision-making logic in the latest real-time environment, deduces the system's evolution process over a period of time, collects and outputs traffic flow data generated during the evolution process, and forms traffic flow prediction results.

[0009] Furthermore, the design scenario parameters are input into the virtual environment for traffic flow prediction under emergency events: Receive hypothetical scenario instructions, which include: the parameters to be adjusted and their target values; Based on hypothetical scenario instructions, adjust the corresponding system operation rules and environment status in the virtual runtime environment; Drive the intelligent agent model to re-interact and make decisions under new system operating rules and environmental conditions; The process of the system reaching a new equilibrium state under the given scenario is simulated, and traffic flow data generated during the simulation process is collected and output to form the traffic flow prediction results under the given scenario.

[0010] Furthermore, the step of generating a dynamic policy includes: Collect all control methods of the port management, form a standardized set of operational instructions that can be executed in a virtual environment, and define it as the action space of the decision-making model; The optimization objectives that the port collection and distribution system needs to achieve are clearly defined and quantified as a global reward function; and the set of variables representing the system's operating state in the digital twin is defined as the state space of the decision model. The decision model acquires the system status of the digital twin in real time, and selects and issues operation instructions from the action space to the virtual runtime environment for execution through its policy network; Observe and record the impact of the operation command on the behavior of the intelligent agent model and the traffic flow of the system, and calculate the immediate reward of this intervention through the global reward function; Using immediate rewards and system state transition data, the policy network parameters are updated based on a deep reinforcement learning algorithm; the above interaction and learning process is repeated to obtain the final optimized policy.

[0011] Furthermore, the metrics of the global reward function include the system's total traffic efficiency, total delay cost, carbon emissions, and system recovery time after an emergency.

[0012] Furthermore, the participants in the system include vehicles, drivers, logistics companies, freight forwarding companies, terminal operators, and shipping companies; the method also includes a closed-loop optimization step, which applies the optimization strategy to the actual port collection and distribution system, and collects feedback data after the application of the optimization strategy through the data perception layer in the digital twin, and updates the intelligent agent model and decision model.

[0013] Compared with the prior art, the beneficial effects of the present invention are: A method for intelligently predicting traffic flow in a port collection and distribution system is proposed. By deeply integrating deep reinforcement learning with digital twins, the system optimization objective is used as the reward function, allowing artificial intelligence to autonomously learn the optimal control strategy through a large number of trials and errors in a virtual operating environment.

[0014] Meanwhile, by constructing an intelligent agent model, the decision-making logic and business preferences of each participant are quantified and simulated, enabling the model to deduce the decision-making behavior of all parties under emergencies under the drive of the endogenous decision-making mechanism, and obtain more accurate traffic flow prediction results. By embedding system operation rules in the virtual operating environment, when the actual system rules change, only the rules in the virtual environment need to be adjusted to drive the intelligent agent model to interact under the new rules and obtain prediction results under the new rules. Attached Figure Description

[0015] Figure 1 This is a schematic diagram of the traffic flow prediction method for the port collection and distribution system of the present invention; Figure 2 This is a schematic diagram of the intelligent agent model construction method of the present invention; Figure 3 This is a schematic diagram of the conventional traffic flow prediction method of the present invention; Figure 4 This is a schematic diagram of the traffic flow prediction method under emergencies according to the present invention; Figure 5 This is a schematic diagram of the dynamic strategy generation method of the present invention. Detailed Implementation

[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0017] like Figure 1 As shown, the present invention provides a technical solution: a method for intelligent prediction of traffic flow in a port collection and distribution system, comprising: Constructing a digital twin framework: Establishing a digital twin of the port's collection and distribution system, which includes a data perception layer, a model layer, a simulation engine, and a strategy optimization layer.

[0018] It is important to note that the first step is to define the system boundaries and elements. This involves clearly defining the physical and operational boundaries of the port's distribution system to be covered by the digital twin. Specifically, this includes the geographical area of ​​the port terminal, the distribution road network, and surrounding logistics hubs, as well as ship operations, container circulation, vehicle transportation, and logistics management operations (such as freight forwarding booking and fleet dispatch). Based on these defined boundaries, the system systematically identifies and defines the key entities and business processes that need to be mapped to the virtual space. These key entities include, but are not limited to, physical entities such as ships, vehicles, and equipment, as well as management entities such as shipping companies and logistics enterprises. The business processes include, but are not limited to, gate reservations, loading and unloading operations, and vehicle dispatch for container pickup. Entity attributes and relationships are defined using class diagrams in the Unified Modeling Language (UML), while the spatial coordinates and topological relationships of physical facilities are labeled using Geographic Information System (GIS) technology.

[0019] The second step is to design a layered architecture. A four-layer architecture for the digital twin is designed, clearly defining the functions and data flows of each layer: The data perception layer is responsible for multi-source data acquisition, cleaning, and storage; it uses IoT technology to collect real-time and historical data and processes it through an ETL tool (such as Apache Kafka). The model layer includes intelligent agent models (such as driver behavior models and vehicle route selection models) and mechanistic models (such as traffic flow models and loading / unloading efficiency models). Machine learning libraries (such as Scikit-learn) are used to train the intelligent agent models, and differential equations or discrete event simulations are used to characterize the mechanistic models. The simulation engine constructs a virtual environment based on discrete event simulation or agent-based modeling techniques (such as SUMO software) to drive entity interactions and state evolution. The policy optimization layer integrates deep reinforcement learning algorithms (such as the PPO algorithm implemented in PyTorch) to generate control policies and evaluate their effectiveness.

[0020] The third step is to create a virtual space. Containerization technology (such as Docker) is used to encapsulate the simulation engine and model-dependent environment, ensuring cross-platform portability; a container cluster is deployed using virtual machine groups on a cloud platform (such as AWS) to provide elastic computing resources; and a 3D visualization tool (such as Unity3D) is used to render the port's 3D scene, supporting user interaction.

[0021] The fourth step is to establish a data channel. This involves constructing a two-way data communication link: an uplink (physical system-digital twin) that receives real-time sensor data via IoT protocols (such as MQTT) and stores it in a time-series database (such as lnfluxDB); and a downlink (digital twin-physical system) that sends commands to physical devices (such as gate displays and traffic lights) via application programming interfaces (APIs).

[0022] The fifth step is to integrate functional components. Integrate the modules at each layer into the virtual container: use a microservice architecture to break down the functions of each layer, and manage service calls uniformly through an API gateway (such as Kong); use a configuration manager (such as Ansible) to automate the deployment of modules and initialize connection parameters; and use log aggregation tools (such as ELK Stack) to monitor the communication status between modules to ensure system stability.

[0023] Aggregate multi-source data: Through the data perception layer, obtain real-time and historical data of physical entities and business activities within the system.

[0024] It is important to note that data is acquired through multi-source heterogeneous interfaces: physical entity data, utilizing the Global Positioning System (GPS) to obtain real-time location, speed, and status data of vehicles and ships; automatic identification of container and vehicle identity information through RFID technology; and traffic flow information such as lane occupancy and queue length collected using roadside sensing devices such as LiDAR and cameras. Through APIs of various information systems, such as port operating systems, ship traffic management systems, electronic data exchange centers, and reservation platforms, using the WebSocke protocol, business data such as operation instructions, ship plans, container status, reservation lists, and fee settlements can be obtained in batches or in real-time. Real-time weather data such as wind speed, rainfall, and visibility is accessed through meteorological department APIs.

[0025] The Apache Kafka protocol is used as the data bus to uniformly access and transmit real-time streaming data, which is stored in a time-series database (such as LnfluxDB). For large-scale historical data, structured query language (SQL) or API is used to extract data from business databases (such as MySQL) in batches at regular intervals. Stream processing engines (such as Apache Flink) are used to perform real-time cleaning, filtering, transformation (such as coordinate transformation and unit unification) and simple aggregation on the real-time streaming data. Data governance tools are used to correlate, merge, and standardize multi-source data.

[0026] Training Behavioral Models: Based on historical data, several intelligent agent models are built and trained at the model layer to simulate the decision-making behavior of each participant in the system.

[0027] like Figure 2 As shown, this invention provides a method for constructing an intelligent agent model; Specifically: Extracting behavioral data related to participants' decision-making from historical data, including the set of decision options, decision results, and the environment in which the decision was made; Define quantitative indicators for the various business preference attributes of different types of participants; Based on behavioral data and combined with quantitative indicators, calculate the values ​​of various business preference attribute parameters; Define the model's input and output. The input is the current environment state and the set of available options, and the output is the final selected option. The attributes of each option in the available option set are broken down into multiple evaluation dimensions corresponding to business preferences; Based on the business preference attribute parameter values, each evaluation dimension is weighted and scored, and the weighted scores of all dimensions are aggregated to calculate the overall utility value of the option; the overall utility values ​​of each option are compared to generate the final decision.

[0028] It is important to note that in step one, the intrinsic preference parameters influencing the decisions of various participants are learned and quantified from historical data. From the aggregated multi-source data, historical decision records are extracted for each participant category. Each record includes three key elements: a decision option set (all feasible alternatives at the time of decision-making); for example, for a driver, the set of all possible routes in a given trip decision; for a freight forwarder, the list of all available shipping companies in a given booking decision; the decision result (the option ultimately chosen by the participant); and the environment at the time of decision-making (the external state at the time of the decision, such as time (whether it was peak season), real-time travel times for different routes, current freight rates of various shipping companies, and the congestion situation at the terminal). Large-scale historical data queries and associations are performed using SQL to construct a structured dataset for model training. The participants in the system include vehicles, drivers, logistics companies, freight forwarders, terminal operators, and shipping companies.

[0029] Define key, quantifiable business preference dimensions for each participant type, dimensions that explain their historical decision-making behavior. For example, driver / fleet business preference dimensions include time sensitivity (unit time cost), price sensitivity (sensitivity to tolls and fuel costs), and risk aversion (tolerance for route time uncertainty); logistics company / freight forwarder business preference dimensions include freight rate sensitivity, shipping company brand preference, emphasis on on-time performance, and emphasis on terminal operation efficiency; shipping company business preference dimensions include profit maximization preference, space utilization preference, and specific route preference. Through domain expert knowledge and relevant literature, clearly define proxy variables for these preference attributes; for example, time sensitivity can be quantified as "the extra cost willing to pay to save unit time."

[0030] Parameter calibration is performed using a discrete choice model within the framework of stochastic utility theory. Each option is assigned a "utility," and the option with the highest utility is selected. This utility is determined by the option's attributes (such as time and cost) and the participant's preference parameters (such as time sensitivity and cost sensitivity). The discrete choice model is fitted using the maximum likelihood estimation method from a general machine learning library (such as PythonStatsmodels), thereby calculating the specific parameter values ​​for each preference attribute.

[0031] Step two involves embedding the learned preference parameters into the intelligent agent model, forming its core algorithm for simulated decision-making. The interface for each decision made by the intelligent agent model in the simulation is defined: Input: the current environmental state, obtained from the simulation engine, such as travel time for each road segment and queue length at each dock; available option set, dynamically generated based on the current state, such as a list of currently passable routes and a list of shipping companies providing services. Output: the final selected option, such as which specific route and shipping company to choose.

[0032] For each available option, it is parsed into a series of quantifiable attribute values, which directly correspond to the aforementioned quantifiable preference dimensions. For example, for route options, attributes may include estimated travel time, estimated cost, and time uncertainty (variance); for shipping company options, attributes may include price, historical on-time performance, and destination port efficiency. Before making a decision, the relevant utility functions are invoked to calculate or query the attribute values ​​of each option in real time.

[0033] The learned preference parameters are transformed into specific decision rules, enabling the intelligent agent model to make choices from a set of options in any environment. The intelligent agent model calculates a comprehensive utility value for each available option, which is a weighted sum of the option's attributes and the participant's preferences:

[0034] in refers to participants From the options The total utility obtained includes a deterministic component and a random component; It refers to the definite part of utility, that is, the observable part; This refers to the random component of utility, representing factors that cannot be observed by the model, such as personal preferences, temporary emotions, and attributes not included in the model. These are the steps mentioned above for the participants. The learned preference parameters, for example It is time sensitivity, Cost sensitivity represents how much importance the participant places on each attribute; These are the options. The attribute value, for example This is the estimated time for this option. This is the cost required for that option. For example, a driver (participant) In choosing a path: his preference parameters, time sensitivity =-0.2 (the negative sign indicates that the longer the time, the lower the utility), cost sensitivity =-0.05; Path A (option) The attribute of ) and the time consumption =60 minutes, cost =50 yuan; then the definite utility of path A for this driver is: .

[0035] To address the uncertainty in simulated decision-making, intelligent agent models do not simply choose the option with the highest certain utility. Instead, they employ a Logit model to transform utility into choice probabilities:

[0036] in refers to participants Select Options The probability of; It refers to the options An exponential function of definite utility; This refers to all available options. The exponential utility is summed. The definite utility of all options is calculated. and the probability of choosing each option Then, using a random number generator, an option is randomly selected as the final decision based on the calculated probability distribution. For example, suppose there is also path B, which takes [time]. =50 minutes, cost =100 yuan; then the definite utility of path B for the driver is: The probabilities of choosing path A and path B are: , , , , Although there is a 61.7% probability that the driver will choose path A, which has slightly higher utility, there is also a 38.3% probability that the driver may choose path B for other unmodeled reasons (such as being more familiar with path B). The intelligent agent model will make a random sampling based on this probability to determine the final choice.

[0037] The core of training behavioral models is to quantify the business preferences of each participant through a data-driven approach, and build their decision-making logic based on this, so that the intelligent agent model can make choices that are highly consistent with those of real participants in a virtual operating environment.

[0038] Deploy virtual environment: Place several intelligent agent models in the virtual running environment built by the simulation engine and embed preset system running rules.

[0039] The decision-making logic and preference parameters of the intelligent agent model are loaded into the simulation engine, creating a large number of interactive agent instances, each with independent attributes and decision-making capabilities. Using object-oriented programming, each type of agent is defined as a class, with attributes as member variables and decision-making methods as member functions. These agent classes are instantiated in batches using simulation software (such as AnyLogic) based on the distribution of agent numbers in real-world data, generating an agent population. The initial state of the intelligent agent model is sampled from historical or real-time data.

[0040] The simulation engine constructs a static environment and dynamic entities consistent with the physical world, including: infrastructure networks, creating accurate road networks (nodes, connections, number of lanes, speed limits), wharf layouts (gates, berths, yards, blocks), railway tracks, etc.; service facility entities, creating entity models of cranes, yard cranes, gate servers, etc., and configuring service rules for them, such as service time distribution and capacity limits. The road network is imported using GIS data; the wharf layout is drawn in simulation software (such as AnyLogic); service facilities are modeled as service counters, and their service logic can be implemented by setting time delays or calling external functions.

[0041] The rules governing the operation of the port's collection and distribution system are transformed into computer-executable logic and embedded into the virtual environment. These rules constitute the external constraints and incentives for agent behavior. Operational rules include traffic rules, reservation rules, pricing and charging rules, and operational rules. For complex and potentially changing rules (such as dynamic pricing), a lightweight rule engine (such as Drools) can be integrated to write the rules as rule language files, which are then interpreted and executed by the rule engine during simulation. For fixed rules, they can be directly implemented in the behavioral or environmental logic of the agent model using if-else conditional statements.

[0042] A communication and perception mechanism is established between the intelligent agent model and the environment and other intelligent agent models. This provides the intelligent agent model with perception methods, enabling it to acquire all information from the environment in real time, such as current road speed and dock queue length. The intelligent agent model executes decisions by invoking actions provided by the environment, thereby changing the environmental state. Communication between intelligent agent models can be achieved through a message passing mechanism, where one intelligent agent model sends a message object containing information to another.

[0043] After configuring all intelligent agent models, environments, and rules, set the initial conditions, runtime parameters, and time synchronization mechanism for the simulation. By setting the simulation time step, discrete events are advanced; the initial state is loaded from an external file, and a seed is set for the random number generator to ensure the repeatability of the simulation and facilitate debugging and comparative experiments. During operation, the simulation engine schedules events according to the time step, updates the intelligent agent model state and environment state, and records logs.

[0044] Driving scenario evolution: Input any one of real-time data and set scenario parameters into the virtual operating environment to drive the intelligent agent model to interact and evolve based on decision-making behavior and system operating rules, and obtain traffic flow prediction results.

[0045] like Figure 3 As shown, the present invention provides a conventional traffic flow prediction method; Specifically: It continuously receives real-time data from the data perception layer, maps it to the corresponding entities and states in the virtual operating environment; The intelligent agent model interacts with the system according to its built-in decision-making logic in the latest real-time environment, deduces the system's evolution process over a period of time, collects and outputs traffic flow data generated during the evolution process, and forms traffic flow prediction results.

[0046] It is important to note that the simulation engine subscribes to specific subjects in the Apache Kafka message middleware in real time, continuously receiving real-time data streams from the data awareness layer; for each piece of data received, it finds the corresponding entity proxy model or facility in the virtual runtime environment based on its ID (such as license plate number, device number), and updates its status.

[0047] After synchronizing the virtual operating environment with the real-time status, the direct mapping of real-time data is paused, and the internal clock of the simulation engine is activated. Based on the decision logic of the intelligent agent model, the operation of the port's collection and distribution system over a future period is deduced. The simulation engine advances time according to the mechanism of discrete event simulation. At each time step or event point, the activated agents (such as vehicles arriving at intersections or ships completing loading and unloading) are scheduled to make decisions and execute actions based on their built-in decision logic and the latest environmental state, thereby changing the environmental state and triggering new events. During the deduction process, key data is recorded by listeners embedded in the simulation model, such as the number of vehicles and queue lengths on each road segment every 5 minutes, until the internal time of the simulation engine advances to the preset future time point and automatically ends. The recorded traffic flow data is then written to lnfluxDB; finally, the traffic flow data of each location in the system over a future period is obtained.

[0048] like Figure 4As shown, the present invention provides a method for predicting traffic flow under emergencies; Specifically: Receive hypothetical scenario instructions, which include: the parameters to be adjusted and their target values; Based on hypothetical scenario instructions, adjust the corresponding system operation rules and environment status in the virtual runtime environment; Drive the intelligent agent model to re-interact and make decisions under new system operating rules and environmental conditions; The process of the system reaching a new equilibrium state under the given scenario is simulated, and traffic flow data generated during the simulation process is collected and output to form the traffic flow prediction results under the given scenario.

[0049] It is important to note that the digital twin receives hypothetical scenario instructions submitted by users through pre-built APIs, such as a RESTful API representing state transitions. These instructions are structured data objects (JSON format) that explicitly define the type, target, intensity, and timing parameters of the simulated emergency. Upon receiving the instructions, the digital twin invokes a parser to parse the JSON data, extracting key operational parameters to prepare for subsequent environmental adjustments. The types of emergencies include extreme scenarios, sudden situations, and policy / rule changes.

[0050] Based on the parsed scenario instructions, the simulation engine dynamically modifies the internal state and operating rules of the virtual runtime environment. For modifications to the environment state, the attributes of affected entities in the environment are directly updated. For example, based on a road closure instruction, the simulation engine's API locates the corresponding road segment object, subtracts the number of closed lanes from its "capacity" attribute value, or marks the "traffic status" as "interrupted." For modifications to system rules, complex rule changes (such as activating emergency plans or adjusting gate reservation rules) can be implemented by integrating a business rule engine (such as Drools); the scenario instructions are transformed into executable facts for the rule engine or the rule file is directly updated, thereby dynamically changing the logic of the constraints. All these adjustments must be ensured to take effect when the simulation clock advances to the "start time" specified by the instruction.

[0051] When the state and rules of the virtual operating environment change, the simulation engine drives all affected intelligent agent models to perceive these changes. For example, the vehicle agent model queries the road network API and finds that the capacity of frequently used routes has decreased, which will directly change its set of options for path decision and the attribute value of each option. The intelligent agent model will re-execute its decision-making process according to the new environmental state, calculate the comprehensive utility of each available option, and select the option that is currently advantageous to itself.

[0052] The simulation engine starts from the initial time of the scenario's activation and advances the timeline using discrete event simulation, simulating the dynamic evolution of the entire system under disturbances and its gradual approach to a new equilibrium. During the simulation, a built-in data listener automatically collects scenario traffic flow data every 5 minutes until the system recovers from the disturbance and reaches a new equilibrium or stable state, storing the collected data in a time-series database. Ultimately, the system obtains a traffic flow prediction result for a future period under this scenario, including timestamps, location identifiers, and flow values.

[0053] Generate dynamic policies: The virtual operating environment is intervened through a deep reinforcement learning-based decision model in the policy optimization layer, the intervention effect is evaluated, and the optimized policy is obtained.

[0054] like Figure 5 As shown, the present invention provides a dynamic strategy generation method; Specifically: Collect all control methods of the port management, form a standardized set of operational instructions that can be executed in a virtual environment, and define it as the action space of the decision-making model; The optimization objectives that the port collection and distribution system needs to achieve are clearly defined and quantified as a global reward function; and the set of variables representing the system's operating state in the digital twin is defined as the state space of the decision model. The decision model acquires the system status of the digital twin in real time, and selects and issues operation instructions from the action space to the virtual runtime environment for execution through its policy network; Observe and record the impact of the operation command on the behavior of the intelligent agent model and the traffic flow of the system, and calculate the immediate reward of this intervention through the global reward function; Using immediate rewards and system state transition data, the policy network parameters are updated based on a deep reinforcement learning algorithm; the above interaction and learning process is repeated to obtain the final optimized policy.

[0055] The metrics of the global reward function include the system's overall traffic efficiency, total delay cost, carbon emissions, and system recovery time after an emergency.

[0056] It is important to note that systematically collecting and formalizing all control measures available to port management is crucial. These measures are transformed into standard operational instructions that can be recognized and executed by the simulation engine. The set of all these instructions constitutes the action space of the decision-making model. Specifically, through business research, all controllable variables are listed, such as: dynamically adjusting the reservation fee rate for a gate, temporarily activating or deactivating emergency lanes, changing the timing scheme of traffic lights at intersections, and adjusting the priority of yard operations. Each control measure is then parameterized, for example, "increase the reservation fee rate for gate A by 20% during the 08:00-10:00 period." Within the framework of deep reinforcement learning, this set of instructions is formally defined as the action space that the decision-making model can choose from. This action space can be discrete or continuous.

[0057] A set of key variables that can comprehensively and accurately characterize the real-time operation of the system are selected from the digital twin, and this set of variables is defined as the state space of the decision model. Key variables include average vehicle speed on each road segment, queue length at key nodes, gate utilization rate, yard storage rate, ship operation progress, current time, and weather conditions. After normalization, these data form a fixed-dimensional state vector, which serves as the input to the policy network.

[0058] The macroscopic and abstract optimization goals of the port's cargo handling system are transformed into a calculable, scalar, and immediate reward. The ultimate optimization objectives of the port's cargo handling system are to maximize overall system throughput efficiency, minimize total delay cost, minimize carbon emissions, and minimize system recovery time after a sudden event. Overall system throughput efficiency can be measured by the number of standard containers passing through a critical section per unit time; the higher this value, the higher the reward. It can be set as: f(throughput efficiency) = throughput / baseline throughput. Total delay cost is calculated as ∑(all vehicle waiting time × waiting cost per unit time); the higher this value, the lower the reward. It can be set as f(delay cost) = -(total delay time / baseline delay time). Total system carbon emissions are calculated using a micro-emission model (such as the MOVES model) based on the instantaneous speed and acceleration of vehicles (directly generated by the vehicle agent behavior in the simulation). Calculate the carbon emission rate at the second or minute level; based on the emission model formula, aggregate the total carbon emissions of all vehicles during the simulation period. The higher this value, the lower the reward. It can be set as: f(carbon emissions) = -(total carbon emissions / carbon emission baseline value); the system recovery time after a sudden event is calculated as the time required for the system's key performance indicators (such as average vehicle speed) to recover from the abnormal value to the normal value. The shorter the time, the higher the reward. It can be set as: f(recovery time) = -(actual recovery time / expected recovery time); the baseline value is taken from the baseline simulation scenario data without any control strategy. The immediate reward is calculated as follows: reward = w1 × f (traffic efficiency) + w2 × f (delay cost) + w3 × f (carbon emissions) + w4 × f (recovery time). Here, f (traffic efficiency), f (delay cost), f (carbon emissions), and f (recovery time) are functions that convert the original indicators into reward values. They usually need to be normalized or negative to ensure that all sub-objectives are aligned (to maximize the reward). The weighting coefficients w1, w2, w3, and w4 are adjusted according to business priorities.

[0059] The decision-making model, based on the currently observed system state, makes decisions and issues control commands to the virtual environment through its neural network strategy. Specifically, at each decision point, the model obtains the latest state vector from the digital twin simulation environment and inputs this state vector into the current policy network. This policy network is a deep neural network whose output defines the probability distribution of choosing each action in a given state (stochastic policy) or directly outputs the optimal action (deterministic policy). Based on the output of the policy network, an action, i.e., a control command, is selected; the simulation engine receives this command and translates it into specific modifications to the virtual operating environment, such as calling an API to change the speed limit of a road.

[0060] After the action is executed, allow the simulation environment to project forward for a sufficiently long period to observe how the intelligent agent model reacts to the regulatory action. After the projection is complete, calculate the immediate reward resulting from this action based on the new system state data, according to the reward function formula defined above.

[0061] The decision model uses a large amount of data (states, actions, rewards, new states) generated by interactions to continuously update its policy network, thereby continuously improving its decision-making ability and eventually converging to a high-performance optimization policy.

[0062] Closed-loop optimization: The optimization strategy is applied to the actual port collection and distribution system, and feedback data after the application of the optimization strategy is collected through the data perception layer in the digital twin to update the intelligent agent model and decision model.

[0063] It is important to note that the optimal strategy trained by the decision-making model should be deployed to the actual port collection and distribution system. Through the data perception layer, comprehensive data on the actual system's response to this strategy should be collected, recording the time and content of each intervention, as well as system status data (such as traffic flow, queuing, delays, and carbon emissions) for a period after the intervention. The real data after strategy application should be compared and analyzed with the prediction results of the digital twin and the baseline data before strategy application to verify the accuracy of the digital twin's predictions and quantify the actual benefits of the strategy. Based on the comparative analysis results, the intelligent agent model and the decision-making model should be optimized and updated. For the intelligent agent model, new real data should be used as the training set to retrain or fine-tune the parameters of the intelligent agent model, such as the preference parameters in the discrete choice model. For the decision-making model based on deep reinforcement learning, real interaction data should be added to the model's experience replay buffer. When conducting the next round of strategy training, the decision-making model learns from this real data to optimize its strategy.

[0064] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended embodiments and their equivalents.

Claims

1. A method for intelligent prediction of traffic flow in a port collection and distribution system, characterized in that, include: Constructing a digital twin framework: Establishing a digital twin of the port's collection and distribution system, which includes a data perception layer, a model layer, a simulation engine, and a strategy optimization layer; Aggregate multi-source data: Through the data perception layer, obtain real-time and historical data of physical entities and business activities within the system; Training Behavioral Models: Based on historical data, several intelligent agent models that can simulate the decision-making behavior of each participant in the system are built and trained at the model layer. Deploy a virtual environment: Place several intelligent agent models in a virtual runtime environment built by the simulation engine and embed preset system operation rules; Driving scenario evolution: Input any one of real-time data and set scenario parameters into the virtual operating environment to drive the intelligent agent model to interact and evolve based on decision-making behavior and system operating rules, and obtain traffic flow prediction results; Generate dynamic policies: The virtual operating environment is intervened through a deep reinforcement learning-based decision model in the policy optimization layer, the intervention effect is evaluated, and the optimized policy is obtained.

2. The intelligent traffic flow prediction method for a port collection and distribution system according to claim 1, characterized in that: The method for constructing the intelligent agent model includes: S1. Based on historical data, quantify the business preference attributes of each participant in the system; S11. Extract behavioral data related to participants’ decision-making from historical data, including a set of decision options, decision results, and the environment in which the decision was made. S12. Define quantitative indicators for the various business preference attributes of different types of participants; S13. Based on behavioral data and combined with quantitative indicators, calculate the values ​​of various business preference attribute parameters; S2. Decision logic for constructing an intelligent agent model based on business preference attributes; S21. Define the input and output of the model. The input is the current environment state and the set of available options, and the output is the final selected option. S22. Decompose the attributes of each option in the available option set into multiple evaluation dimensions corresponding to business preferences; S23. Based on the business preference attribute parameter values, assign a weighted score to each evaluation dimension, aggregate the weighted scores of all dimensions, and calculate the comprehensive utility value of the option; compare the comprehensive utility values ​​of each option to generate the final decision.

3. The intelligent traffic flow prediction method for a port collection and distribution system according to claim 1, characterized in that: The process involves inputting real-time data into a virtual operating environment for routine traffic flow prediction. M1 continuously receives real-time data from the data perception layer, maps it, and synchronizes it to the corresponding entities and states in the virtual operating environment; M2 drives the intelligent agent model to interact according to its built-in decision-making logic in the latest real-time environment, deduce the system's evolution process over a period of time, collect and output traffic flow data generated during the evolution process, and form traffic flow prediction results.

4. The intelligent traffic flow prediction method for a port collection and distribution system according to claim 1, characterized in that: The design scenario parameters are input into the virtual environment for traffic flow prediction under emergency events. N1. Receive hypothetical scenario instructions, which include: the parameters to be adjusted and their target values; N2. Based on hypothetical scenario instructions, adjust the corresponding system operation rules and environment status in the virtual runtime environment; N3 drives the intelligent agent model to interact and make decisions again under new system operating rules and environmental conditions; N4. Simulate the process of the system reaching a new equilibrium state under the given scenario, collect and output the traffic flow data generated during the simulation process, and form the traffic flow prediction result under the given scenario.

5. The intelligent traffic flow prediction method for a port collection and distribution system according to claim 1, characterized in that: The step of generating a dynamic strategy includes: Q1. Collect all control methods of the port management, form a standardized set of operation instructions that can be executed in a virtual environment, and define it as the action space of the decision-making model; Q2. Define the optimization objectives that the port collection and distribution system needs to achieve, and quantify them as a global reward function; and define the set of variables representing the system's operating state in the digital twin as the state space of the decision model; Q3. The decision model obtains the system status of the digital twin in real time, and selects and issues operation instructions from the action space to the virtual running environment for execution through its policy network; Q4. Observe and record the impact of the operation command on the behavior of the intelligent agent model and the traffic flow of the system, and calculate the immediate reward of this intervention through the global reward function; Q5. Using immediate rewards and system state transition data, update the policy network parameters based on a deep reinforcement learning algorithm; repeat the above interaction and learning process to obtain the final optimized policy.

6. The intelligent traffic flow prediction method for a port collection and distribution system according to claim 5, characterized in that: The metrics of the global reward function include the system's overall traffic efficiency, total delay cost, carbon emissions, and system recovery time after an emergency.

7. The intelligent traffic flow prediction method for a port collection and distribution system according to claim 1, characterized in that: The participants in the system include vehicles, drivers, logistics companies, freight forwarding companies, terminal operators, and shipping companies; the method also includes a closed-loop optimization step, which applies the optimization strategy to the actual port collection and distribution system, and collects feedback data after the application of the optimization strategy through the data perception layer in the digital twin, and updates the intelligent agent model and decision model.

Citation Information

Patent Citations

  • Traffic flow prediction method based on artificial intelligence

    CN119811086A

  • Smart city traffic planning method and system based on big data

    CN118917025A

  • Smart city monitoring system and method

    CN120087915A

  • Intelligent port scheduling and energy efficiency optimization method based on digital twinning

    CN120145663A

  • Intersection signal timing dynamic cooperation method and system based on real-time traffic prediction

    CN120954248A