Digital twinborn traffic system-oriented twinborn body dynamic placement method
By constructing a decision-making model for dynamic placement of twins, the dynamic nature and resource utilization problems of twin deployment in digital twin transportation systems are solved, and real-time and stability improvements in complex traffic environments are achieved.
Patent Information
- Application Number
- CN202510556143.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-08-08
AI Technical Summary
The prior art is difficult to efficiently deploy twins in dynamic environments in digital twin transportation systems, optimize resource utilization and reduce communication delays, especially in multi-twin and multi-server environments, lacking accurate prediction of future situations and dynamic considerations of resource requirements.
Build a dynamic placement decision model for twins, including demand prediction module, twin grouping module, adaptive association module and placement strategy generation module. By predicting twin resource requirements and edge server load, dynamically adjust placement strategies, and use attention mechanisms and reinforcement learning to optimize resource matching.
It improves the resource utilization rate of edge servers, reduces the communication delay between twins and edge servers, improves the real-time and stability of the digital twin traffic system, and is suitable for large-scale complex traffic scenarios.
Smart Images

Figure CN120449472A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of intelligent transportation technology, and more specifically, relates to a twin dynamic placement method for a digital twin transportation system. Background Art
[0002] Digital twins, an emerging digital transformation tool, are bringing profound changes to the transportation sector. By integrating key technologies such as the Internet of Things, artificial intelligence, and edge computing, digital twins can create a virtual twin of each entity in the physical transportation system that is synchronized and accurately mapped in real time, significantly improving the monitoring accuracy and predictive analysis capabilities of the transportation system. Currently, this technology is widely used in areas such as traffic light control, traffic flow management, and autonomous driving, providing strong support for the real-time responsiveness and dispatch efficiency of transportation systems.
[0003] However, to ensure real-time synchronization between the physical entity and its twin, twin placement technology becomes critical. Twins are typically deployed on edge servers to reduce communication latency. However, due to the limited coverage of edge nodes and the high mobility of traffic participants, computational and transmission delays between the twin and the physical entity remain prominent. Therefore, how to efficiently deploy twins in a dynamic environment, optimize resource utilization, and reduce communication latency has become an urgent issue to be addressed. Existing research has made some progress in twin placement optimization. Some work uses fixed rules (such as integer programming and heuristic algorithms) for placement optimization, but these methods have difficulty adapting to complex and dynamic traffic environments. Other studies use deep learning technology to optimize twin placement in a data-driven manner, but rely on historical data decisions and lack accurate predictions of future situations. In addition, existing methods have significant shortcomings in resource demand prediction and placement decisions in multi-twin and multi-server environments. On the one hand, existing research focuses on predicting changes in server resource load, while ignoring the dynamic nature of twin resource requirements; on the other hand, existing methods mainly focus on the deployment optimization of a single object, and fail to fully consider the complex matching relationship between multiple twins and multiple servers. Summary of the Invention
[0004] The purpose of the present invention is to overcome the shortcomings of the existing technology and provide a dynamic placement method for twins in a digital twin transportation system. By predicting the predicted resource requirements of the twins and the predicted load of the edge server, the matching relationship between multiple twins and multiple servers is optimized, the placement strategy is dynamically adjusted, the resource utilization of the edge server is improved, and the communication delay between the twins and the edge server is reduced, thereby improving the real-time and stability of the digital twin transportation system.
[0005] In order to achieve the above-mentioned purpose of the invention, the twin dynamic placement method for the digital twin transportation system of the present invention includes the following steps:
[0006] S1: Construct a digital twin transportation system, and record the physical entity set P = {P1, P2, ..., P N}, where P n Denotes the nth physical entity, n=1,2,…,N, N represents the number of physical entities, and the twin set DT corresponding to the physical entity is recorded as DT={DT1,DT2,…,DT N}, where DT n is a physical entity P n Corresponding twins; let the edge server set ES = {ES1, ES2, ..., ES M}, ES m represents the mth edge server, m = 1, 2, ..., M, where M is the number of edge devices;
[0007] S2: Construct a twin dynamic placement decision model, including a demand prediction module, a twin grouping module, an adaptive association module, and a placement decision generation module, where:
[0008] The demand forecasting module is used to forecast demand based on the system data of the digital twin transportation system at the current time t and the previous τ-1 time. The system data at each time includes the data of each twin DT at that time. n The eigenvector of t′=t-τ+1,…,t, each edge server ES m The eigenvector of The relationship between the twin and the edge device n,m (t′), if at the current time t′ the twin DT n Placed on edge server ES m On, then z n,m (t′)=1, otherwise z n,m (t′)=0, get the predicted DT of each twin at time t+1 n Forecast resource requirements And each edge server ES m Forecast load and sent to the adaptive association module and placement decision generation module;
[0009] The twin grouping module is used to group each twin DT according to the current time t and the previous τ-1 time n The twins are grouped according to the characteristics of , and Q twin groups C are obtained. q , generate twin group feature ψ according to the feature vectors of all twins at the current time t in each twin group q And sent to the adaptive association module, q = 1, 2, ..., Q;
[0010] The adaptive association module is used to n Forecast resource requirements Each edge server ES m Forecast load and the twin grouping characteristics ψ of Q twin groups q Calculate the probability p of each twin belonging to each twin group n,q , and sent to the placement decision generation module; the calculation method of the belonging probability is as follows:
[0011] For each twin DT n and each twin group, will predict resource requirements As a query, the twin group feature ψ k As the key, the attention mechanism is used to calculate the similarity s between the two n,q :
[0012]
[0013] Among them, W Q and W K are weight matrices corresponding to queries and keys, respectively, d k Represents the dimension of the key;
[0014] Then the similarity s is converted into n,q Converted to belonging probability p n,q :
[0015]
[0016] The placement strategy generation module is used to generate a strategy based on each twin DT n Forecast resource requirements Each edge server ES m Forecast load And the probability p of each twin belonging to each twin group n,q Generate the association relationship z between each twin and each edge device at the prediction time t+1 n,m (t+1), if the twin DT at the predicted time t+1 n Placed on edge server ES m On, then z n,m (t+1)=1, otherwise z n,m (t+1)=0;
[0017] S3: Train the twin dynamic placement decision model constructed in step S3 to obtain a trained twin dynamic placement decision model;
[0018] S4: During the operation of the digital twin transportation system, when a dynamic placement decision of the twin is required, the system data of the digital twin transportation system at the current moment and the previous τ-1 moments are collected and input into the trained twin dynamic placement decision model to predict the association relationship between each twin and each edge device at the next moment and obtain the twin placement strategy.
[0019] The present invention is directed to a twin dynamic placement method for a digital twin transportation system, constructs a digital twin transportation system, and constructs a twin dynamic placement decision model, wherein the demand prediction module is used to predict the predicted resource demand of the twin and the predicted load of the edge server based on system data, the twin grouping module is used to group the twins, the adaptive association module is used to calculate the probability of each twin belonging to each twin group, and the placement strategy generation module is used to generate the twin placement strategy at the prediction moment based on the above information, train the twin dynamic placement decision model, and collect system quantity in real time to input the trained twin dynamic placement decision model to obtain the twin placement strategy.
[0020] The present invention has the following beneficial effects:
[0021] 1) By predicting the resource requirements of the twin and the load of the edge server, the present invention can dynamically adapt to the complex and changing traffic environment, ensuring the real-time and stability of the twin placement;
[0022] 2) The adaptive association module in the present invention uses the attention mechanism to adjust the association between twins and groups in real time, enabling the system to flexibly respond to real-time changing resource demands and enhancing its adaptability in dynamic environments;
[0023] 3) The twin placement strategy obtained by the present invention based on the predicted resource demand of the twin, the predicted load of the edge server and the association between the twin and the group is more reasonable, has a better resource matching degree, can significantly reduce communication delay, improve resource utilization and system stability, and is suitable for large-scale complex traffic scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 This is a flowchart of a specific implementation of the method for dynamic placement of twins for a digital twin transportation system according to the present invention;
[0025] Figure 2 is a structural diagram of the digital twin transportation system in the present invention;
[0026] Figure 3 It is a structural diagram of the twin dynamic placement decision model in the present invention;
[0027] Figure 4 is a flow chart of the twin grouping method based on feature-driven clustering in this embodiment;
[0028] Figure 5 is a comparison chart of resource utilization efficiency and overall system performance of the present invention and the comparative method in this embodiment;
[0029] Figure 6 is a graph showing the ablation experiment results of each module of the twin dynamic placement decision model of the present invention in this embodiment;
[0030] Figure 7 This is a performance comparison chart based on heterogeneous graphs and homogeneous graphs in this embodiment. DETAILED DESCRIPTION
[0031] The following describes the specific embodiments of the present invention in conjunction with the accompanying drawings so that those skilled in the art can better understand the present invention. It should be noted that in the following description, when detailed descriptions of known functions and designs may dilute the main content of the present invention, such descriptions will be omitted here.
[0032] Example
[0033] Figure 1 This is a flowchart of a specific implementation of the method for dynamic placement of twins in a digital twin transportation system according to the present invention. Figure 1 As shown, the specific steps of the twin dynamic placement method for the digital twin transportation system of the present invention include:
[0034] S101: Building a Digital Twin Transportation System:
[0035] In the present invention, it is first necessary to build a digital twin transportation system. Figure 2 This is the structural diagram of the digital twin transportation system in the present invention. Figure 2 As shown in the figure, the digital twin transportation system network in the present invention includes physical space and twin space. All physical entities in the transportation system constitute the physical space. In the physical space, each entity has a corresponding twin, and all twins constitute the twin space of the entire transportation system. Specifically, let the set of physical entities contained in the transportation system P = {P1, P2, ..., P N}, where P i Denotes the i-th physical entity, i=1,2,…,N, N represents the number of physical entities. Let the twin set DT corresponding to the physical entity be {DT1,DT2,…,DT N}, where DT i is a physical entity P i Corresponding twins. Each twin DT i All need to be deployed on edge servers (such as base stations, roadside units, etc.), and the edge server set ES = {ES1, ES2, ..., ES M}, ESj represents the jth edge server, j = 1, 2, ..., M, M is the number of edge devices. Each edge server ES j Contains information such as its available computing resources, bandwidth, and processing power.
[0036] The entire digital twin transportation system connects the twins on each edge device with the entities in the physical space through the network. Each edge server is responsible for updating and synchronizing the twin status it holds, processing the assigned twin tasks, and feeding back the processing results to the corresponding physical entity, forming a distributed computing environment.
[0037] In order to ensure the real-time performance, low latency and high reliability of the system, the twins need to be dynamically deployed as the physical entity moves, so as to be closer to the physical entity and optimize resource allocation. Figure 2 The twin corresponding to vehicle P1(t) is DT1(t), and at the current moment DT1(t) is placed on edge server C1. After k moments, vehicle P1 moves from area 1 to area 3. At this time, the physical distance between the twin DT1(t+k) and vehicle P1(t+k) increases, resulting in an increase in data transmission overhead. At the same time, edge server C1 will find it difficult to support low latency requirements due to load changes. Therefore, it is more appropriate to place the twin DT1(t+k) on edge server C3 or C4. In this process, factors such as global latency, resource matching, and network load balancing must also be considered.
[0038] S102: Build a twin dynamic placement decision model:
[0039] Because the movement of a physical entity increases the distance between it and its corresponding twin, and also causes changes in network topology and resource requirements, to ensure real-time performance, low latency, and high reliability of the system, twins need to be dynamically deployed as the physical entity moves, bringing them closer to the physical entity while optimizing resource allocation. To address these challenges, the present invention constructs a dynamic twin placement decision model. Figure 3 This is the structural diagram of the twin dynamic placement decision model in the present invention. Figure 3 As shown in FIG, the twin dynamic placement decision model of the present invention includes a demand prediction module, a twin grouping module, an adaptive association module, and a placement strategy generation module. Each module will be described in detail below.
[0040] The demand forecasting module is used to forecast demand based on the system data of the digital twin transportation system at the current time t and the previous τ-1 time. The system data at each time includes the data of each twin DT at that time. n The eigenvector of t′=t-τ+1,…,t, each edge server ES m The eigenvector of The relationship between the twin and the edge device n,m (t′), if at the current time t′ the twin DT n Placed on edge server ES m On, then z n,m (t′)=1, otherwise z n,m (t′)=0, get the predicted DT of each twin at time t+1 n Forecast resource requirements And each edge server ES m Forecast load
[0041] In this embodiment, the characteristics of the twin and edge server include device type, location, resource demand and remaining resource amount. The value of each feature is normalized to construct a feature vector. In order to make the twin placement more predictive, the demand prediction module in this embodiment accurately predicts future resource demand and server load by capturing the communication, placement and social relationship between the twin and the edge server. Figure 3 As shown, the demand prediction module in this embodiment includes a heterogeneous graph construction module, a meta-path extraction module, a graph convolution module and a fully connected module.
[0042] The heterogeneous graph construction module is used to construct the heterogeneous graph G at each time t′ based on the system data of the digital twin transportation system at the current time t and the previous τ-1 time t′ =(V,E t′ ), where the node set V=DT∪ES={DT1,DT2,...,DT N ,ES1,ES2,...,ES M}, that is, the heterogeneous graph contains two types of nodes: twins and servers. The feature vector of the node is the feature vector of the corresponding twin or edge server. t′ There are two types of edges: placement relationship edges and communication relationship edges. Represents the node v at time t′ i Placed at node v j On, i, j = 1, 2, ..., N + M, Represents the node v at time t′ i Not placed at node v j Communication relationship side Represents the node v at time t′ i and node v j Can communicate, Represents the node v at time t′ i and node v j Communication is not possible. In practical applications, the communication relationship It can be determined based on the distance between the two nodes, that is, when the node v i and node v j The distance between them is less than the preset threshold, then the communication relationship edge Communication relationship edge
[0043] The meta-path extraction module is used to extract the heterogeneous graph G at each time t′ t′ =(V,E t′ ) extracts the meta-path and sends it to the graph convolution module. Different meta-paths are defined in the present invention to characterize different interaction modes between nodes, including: twin-communication-edge server path, which is used to capture the direct impact of communication quality on twin resource requirements and edge server load, twin-placement-edge server path, which is used to capture the resource allocation relationship between twins and edge servers, and twin-communication-twin path, which is used to express the social relationship between each twin, helping the system to better understand the mutual influence between different traffic participants. Therefore, the specific method for extracting meta-paths by the meta-path extraction module in the present invention is as follows:
[0044] In the heterogeneous graph G t′ =(V,E t′ ), if a twin DT n With edge server ES m The communication relationship between Then extract the twin-communication-edge server path If a twin DT n With edge server ES m Placement relationship edges between Then extract the twin-placement-edge server path If a twin DT n With another twin DT n′ The communication relationship between n′=1,2,…,N, and n′≠n, then the twin-communication-twin path is extracted
[0045] The graph convolution module is used to perform graph convolution operations on the meta-path at each time t′ extracted by the meta-path extraction module to extract historical twin features. and historical edge server characteristics And sent to the fully connected module. In graph convolution, the features of neighboring nodes are aggregated layer by layer to update the representation of the current node. Since three meta-paths are extracted in this invention, each meta-path is updated with features separately. Therefore, the specific method of graph convolution operation in the graph convolution module is as follows:
[0046] The feature update formula of the twin in the twin-communication-edge server path is as follows:
[0047]
[0048] in, Respectively represent the twin DT obtained after the convolution operation of the twin-communication-edge server path of the sth layer and the s+1th layer. n Features, σ() represents the activation function, represents the weight of the twin in the twin-communication-server path in the sth layer, Representation and twin DT n The set of edge servers for which there exists a twin-communication-edge server path, represents the weight of the edge server in the twin-communication-server path in the sth layer, Represents the attention weight on the twin-communication-edge server path, which is used to measure the edge server ES m Twin DT n impact. Represents the edge server ES obtained after the convolution operation of the s-th layer twin-communication-edge server path m Features,
[0049] The feature update formula of the edge server in the twin-communication-edge server path is as follows:
[0050]
[0051] in, Represents the edge server ES obtained after the convolution operation of the s+1th layer twin-communication-edge server path m Features, Represents edge server ES m There is a set of twins with a twin-communication-edge server path, Represents the attention weight on the twin-communication-edge server path, which is used to measure the twin DT n Edge Server ES m impact.
[0052] The feature update formula for the twin in the twin-placement-edge server path is as follows:
[0053]
[0054] in, Respectively represent the twin DT obtained after the convolution operation of the twin-placement-edge server path of the s-th layer and the s+1-th layer.n Features, denote the weight of the twin and the weight of the edge server in the twin-placement-server path in the sth layer, Represents the attention weight on the twin-placement-edge server path, which is used to measure the edge server ES m Twin DT n The impact of Represents the edge server ES obtained after the convolution operation of the s-th layer twin-placement-edge server path m Features,
[0055] The feature update formula for the edge server in the twin-placement-edge server path is as follows:
[0056]
[0057] in, Represents the edge server ES obtained after the convolution operation of the s+1th layer twin-placement-edge server path m Features, Represents edge server ES m There is a set of twins with a twin-placement-edge server path, represents the attention weight on the twin-placement-edge server path, which is used to measure the twin DT n Edge Server ES m impact.
[0058] The feature update formula of the twins in the twin-communication-twin path is as follows:
[0059]
[0060] in, Respectively represent the twin DT obtained after the convolution operation of the twin-communication-twin path of the sth layer and the s+1th layer n Features, Represents the twin DT obtained after the convolution operation of the twin-communication-twin path of the s+1th layer n′ Features, represents the weight of the twin in the twin-communication-twin path in the sth layer, Representation and twin DT n There is a set of twins with a twin-communication-twin path, Represents the attention weight on the twin-communication-twin path, which is used to measure the twin DT n′ Twin DT nimpact.
[0061] After L layers of graph convolution operations, the features obtained on the three paths are fused to obtain the final twin features. and edge server characteristics
[0062]
[0063]
[0064] Among them, concat() represents feature concatenation.
[0065] Then concatenate the twin features at τ moments to get the historical twin features Concatenate the edge server features at τ moments to get the historical edge server features
[0066] The fully connected module includes a twin fully connected layer and an edge server fully connected layer, where the twin fully connected layer is used to integrate the historical twin features of each twin. Processing to generate predicted resource requirements The edge server fully connected layer is used to analyze the historical edge server features of each edge server Processing to generate predicted load
[0067] The twin grouping module is used to group each twin DT according to the current time t and the previous τ-1 time n The twins are grouped according to the characteristics of , and Q twin groups C are obtained. q , generate twin group feature ψ according to the feature vectors of all twins at the current time t in each twin group q And sent to the adaptive association module, q = 1, 2, ..., Q. In practical applications, the value of Q can be set according to actual needs.
[0068] In this embodiment, a twin grouping method based on feature-driven clustering is proposed. By integrating the resource requirements, geographical location and regional traffic flow data of the twins, the initial feature representation of the twins is generated, and principal component analysis and dynamic K-means clustering algorithm are used to achieve efficient grouping of the twins. Figure 4 This is a flow chart of the twin grouping method based on feature-driven clustering in this embodiment. Figure 4 As shown, the specific steps of the twin grouping method based on feature-driven clustering in this embodiment include:
[0069] S401: Get twin features:
[0070] For each twin node DT n, collect its resource requirements at τ moments to form the resource requirement vector R n , the geographical locations at τ moments constitute the geographical location vector L n The traffic flow at τ moments constitutes the traffic flow characteristic vector T n , and then normalize it to get the standardized resource demand vector Geographic location vector and traffic flow feature vector Reconstruct the initial features of each twin node
[0071] In practical applications, the resource requirement R n Can include twin nodes DT n The computing resources, storage resources and communication resource requirements of the system are used to describe the service demand intensity. The geographical location L n The position of the twin in space can be described to analyze its geographical correlation with other nodes, and the traffic flow characteristics T n It can include traffic peaks, congestion conditions, and traffic distribution in the area where the node is located, and is used to quantify the traffic pressure in the area.
[0072] By standardizing and unifying the dimensions of different features, the deviation introduced by different feature scales can be eliminated, which facilitates subsequent cluster analysis.
[0073] S402: Feature Dimensionality Reduction:
[0074] In order to retain key information while reducing computational complexity, the initial features Perform principal component analysis to reduce the dimension and obtain feature X n .
[0075] S403: Feature clustering:
[0076] Dynamic K-means clustering algorithm is used to cluster the features X n The twins are clustered to obtain Q twin clusters, each twin cluster corresponds to a group, and the feature vector at the current time t corresponding to the cluster center in each twin group is used as the twin group feature.
[0077] The adaptive association module is used to calculate each for each twin DT n Forecast resource requirements Each edge server ES m Forecast load and the twin grouping characteristics ψ of Q twin groups q Calculate the probability p of each twin belonging to each twin group n,q And sent to the placement strategy generation module.
[0078] In a dynamic environment, the resource requirements of twins may change over time. To ensure that the system can flexibly respond to these real-time changes, the present invention uses an adaptive association module to dynamically adjust the association between twins and groups to enhance the adaptability of the system in a dynamic environment. The specific method of attribution probability calculation is as follows:
[0079] For each twin DT n and each twin group, will predict resource requirements As a query, the twin group feature ψ k As the key, the attention mechanism is used to calculate the similarity s between the two n,q , which is used to measure the matching degree between the twin requirements and the grouping characteristics. The similarity calculation formula is as follows:
[0080]
[0081] Among them, W Q and W K are weight matrices corresponding to queries and keys, respectively, d k Indicates the dimension of the key, used to scale the similarity value to avoid excessively large values when the feature dimension is high. By calculating the similarity s n,q , we get the twin DT n and Group C q The higher the similarity score, the more the twin's needs match the grouping characteristics.
[0082] Then the similarity s is converted into n,q Converted to belonging probability p n,q :
[0083]
[0084] Attribution probability p n,q Can be regarded as a twin DT n Group C q The fitness score of the twins is thus quantified to achieve the fitness of different groups. It can be seen that the belonging probability of all groups satisfies Based on the calculated belonging probability p n,q , the twin can dynamically adjust its association with different groups. Specifically, the twin DT n The probability of belonging to different groups p n,q Will follow demand The grouping is recalculated based on the changes in the current demand, allowing each twin to flexibly select the grouping that best matches the current demand.
[0085] The placement strategy generation module is used to generate a strategy based on each twin DT nForecast resource requirements Each edge server ES m Forecast load And the probability p of each twin belonging to each twin group n,q Generate the association relationship z between each twin and each edge device at the prediction time t+1 n,m (t+1), if the twin DT at the predicted time t+1 n Placed on edge server ES m On, then z n,m (t+1)=1, otherwise z n,m (t+1)=0.
[0086] In order to achieve global optimal resource allocation in a complex dynamic environment, this embodiment proposes a multi-level placement strategy generation, which achieves global optimal resource allocation through the collaboration of group level and global level. Figure 3 As shown, the placement strategy generation module in this embodiment includes Q intra-group actor-critic networks and a global critic network, where:
[0087] In the qth intra-group actor-critic network, the input state s of the intra-group actor network q For N twin DT n Forecast resource requirements M edge servers ES m Forecast load And each twin DT n The probability p of belonging to the current twin group n,q The vector formed, output action a q For each twin DT at the prediction time t+1 under the current group n With each edge server ES m The relationship matrix between Each element is the corresponding twin DT n With edge server ES m The relationship between The internal critic network is used to calculate the value V of the state-action pair q and reward R q The specific calculation method of the reward function can be selected according to actual needs. In this embodiment, the reward function is calculated by comprehensively considering the delay, resource matching and load balancing of the twin placement strategy corresponding to the current action.
[0088] The global critic network is based on Q correlation matrices Z q The concatenation matrix generates the weight vector W=(w1,w2,…,w Q), and then the reward R of the critic network in each group q Perform weighted summation to obtain the global reward R global :
[0089]
[0090] The actor-critic network is a commonly used reinforcement learning network. Its specific structure and working process will not be described here. At each moment, the actor-critic network in the group optimizes the strategy through gradient update. This process is not only based on its own group reward R q The update is also subject to the global reward R generated by the global critic network global The actor-critic network in the group adjusts its strategy based on the global reward signal and its own group-level reward. The gradient update method is used to optimize the parameters of the actor-critic network in the group, achieving a balance between local optimization and global optimization, ensuring the coordination of local decisions in the global scope.
[0091] S103: Training the twin dynamic placement decision model:
[0092] The twin dynamic placement decision model constructed in step S102 is trained to obtain a trained twin dynamic placement decision model.
[0093] The specific training method can be set according to the specific structure of the twin dynamic placement decision model. In this embodiment, the demand prediction module is pre-trained through a preset data sample set, which can be obtained through historical data collection. The twin grouping module, adaptive association module and placement strategy generation module perform reverse parameter optimization based on the global reward signal generated by the global critic network in the placement strategy generation module and the group-level reward signal generated by the intra-group critic network.
[0094] S104: Twin placement decision:
[0095] During the operation of the digital twin transportation system, when dynamic placement decisions of twins are required, the system data of the digital twin transportation system at the current moment and the previous τ-1 moments are collected and input into the trained twin dynamic placement decision model. The association relationship between each twin and each edge device at the next moment is predicted to obtain the twin placement strategy.
[0096] To better illustrate the technical effects of the present invention, a specific example was used to experimentally verify the present invention. Three baseline methods were used as comparison methods in this example, and comparative experiments were conducted with the present invention, focusing on verifying the advantages of the present invention in terms of latency, computing, storage, and bandwidth resource matching. Furthermore, ablation experiments were conducted to analyze the contributions of each module in the twin dynamic placement decision model and evaluate the impact of different factors.
[0097] The experimental platform built in this embodiment is as follows:
[0098] Hardware: Using NVIDIA GeForce RTX 4060Ti GPU (8188MB video memory, support CUDA 12.7), paired with Intel Core i7-14700F processor (20 cores, 28 threads, main frequency 2.1GHz, support Hyper-Threading technology), and 32GB of memory, providing strong support for large-scale data sets and computing tasks.
[0099] Software: The experiment was based on the SUMO simulation platform (version 1.21.0). The dynamic distribution of 200 vehicles was simulated within a 5000m x 5000m area, with a simulation step size of 1 second. Various factors, such as vehicle speed, road density, and server communication radius, were considered to enhance the realism and complexity of the simulation environment. The experiment was run on Windows 11 using Python 3.8. The main libraries relied on were PyTorch 2.4.1, PyTorch-CUDA 12.4, and NumPy 1.24.3.
[0100] The dataset used in this paper was generated using the SUMO (Simulation of Urban Mobility) simulation platform and covers a 5×5 km urban traffic area. To simulate a real-world edge computing environment, 16 edge servers were deployed within the area, assuming a uniform distribution of servers within the area, with each server covering a radius of 1.5 km. To ensure efficient resource utilization and uniform distribution, these servers were deployed at the center of each cell in a 4×4 grid. Data collection lasted two hours, with dynamic data collected from 200 vehicles every second. The collected data included real-time vehicle trajectory information, traffic flow data, and the resource status of surrounding base stations, including server computing, storage, and bandwidth resources. The data sent by vehicles ranged from 40 to 120 Mbits, requiring computing resources of 30 to 100 MHz per vehicle. Furthermore, the edge servers had storage capacities ranging from 300 to 600 Mbits, computing power ranging from 0.8 to 1.2 GHz, and bandwidth capabilities ranging from 400 to 800 Mbps. After collection, the raw data was normalized to eliminate scale differences between features. Subsequently, a sliding pane (size 300) was used to segment the data into time series and separate the data into historical data and labeled data for model training and evaluation. These processing steps help capture the dynamic changes in time series data and improve the model's predictive capabilities.
[0101] The three baseline methods used in this embodiment are:
[0102] Fixed location algorithm: The twin of each vehicle is always fixed on the initially randomly selected server and does not change during the entire process.
[0103] Distance priority algorithm: Each time a vehicle selects the nearest server for twin placement, the position is dynamically adjusted based on the real-time distance.
[0104] Deep Reinforcement Learning (AC_MARL) Algorithm: This method is also based on deep reinforcement learning. Specifically, each vehicle is equipped with a separate Actor network that generates a twin placement policy based on vehicle observations. A globally shared Critic network evaluates the placement policy and optimizes the allocation of twins.
[0105] This embodiment uses four evaluation metrics to measure system performance: average latency, computing resource matching, storage resource matching, and bandwidth resource matching. Average latency refers to the average latency of all vehicles globally, and its calculation includes propagation delay, transmission delay, and computational delay. Resource matching is calculated by comparing the resources required by the current vehicle to the remaining server resources, reflecting the utilization efficiency and matching degree of computing, storage, and bandwidth resources.
[0106] First, experiments were conducted on resource utilization efficiency and overall system performance of the present invention and the comparative method to verify the performance of the present invention in terms of average delay and utilization of various resources. Figure 5 This is a comparison chart of resource utilization efficiency and overall system performance of the present invention and the comparative method in this embodiment. Figure 5 As shown in (a), the present invention performs best in global average delay, and the global average delay is reduced by 70.24% compared with the baseline AC_MARL method; the main reason is the accurate prediction of edge server and twin status by the heterogeneous demand prediction module of the present invention, and the dynamic resource allocation strategy of the multi-layer placement optimization module. The delay fluctuations of the two strategies of fixed position and distance priority are small, and the overall curve is relatively smooth. This is because the twin placement is relatively stable and will not be frequently adjusted over a large range. However, these two strategies fail to globally optimize system resources, resulting in a higher overall average delay of the system. As shown in Figure 5As shown in (b), (c), and (d), the proposed method outperforms other methods in terms of resource matching (the closer the matching degree is to 1, the better the effect). Compared with the baseline AC_MARL method, the computing resource matching degree increased from 2.7124 to 1.2271, an improvement of 54.76%; the storage resource matching degree increased from 1.7344 to 1.314, an improvement of 24.24%; and the bandwidth resource matching degree increased from 2.162 to 1.0284, an optimization of 52.43%. This is mainly due to the feature-driven clustering module's optimization of the twin grouping and the adaptive association module's dynamic adjustment of the grouping structure. The fixed location strategy has the second-best resource matching degree and is the most stable. This is mainly because this strategy randomly selects servers for each vehicle's twin in the initial stage and distributes them relatively evenly across all servers, keeping resource utilization stable and less affected by external factors. However, due to its lack of dynamic adjustment capabilities, it has the highest average latency. (iii) The distance-first strategy has the worst resource matching. Although it can adjust the placement of twins according to real-time locations, it ignores load balancing, which may cause some servers to be overloaded, resulting in excessive resource matching, which in turn affects the overall balance and performance of the system.
[0107] Next, we conduct an ablation experiment to verify the necessity of each module of the twin dynamic placement decision model in this invention. It is worth noting that since the implementation of the placement decision generation module depends on the previous grouping, it is not verified separately. Figure 6 : is the ablation experiment result diagram of each module of the twin dynamic placement decision model of this embodiment of the present invention. Figure 6 As shown, the average delay of the present invention increases after the demand prediction module is eliminated, and the global average delay increases from 0.62417s to 3.91657s. This is because the module predicts the edge server load and twin resource requirements, providing key inputs for subsequent grouping and reinforcement learning. After ablation, the system loses the ability to predict future states and can only perform grouping and resource allocation based on the current state, resulting in a decrease in the timeliness and accuracy of placement decisions, thereby increasing the global average delay. In terms of resource matching, the matching of computing, storage and bandwidth resources has all decreased, by 30.17%, 55.81% and 76.11% respectively. This is because the lack of the demand prediction module makes the system unable to perceive changes in resource demand in advance, making the resource allocation strategy passive and short-sighted.
[0108] like Figure 6As shown, the global average delay of the present invention with the twin grouping module eliminated increases from 0.62417s to 2.58872s. This is because the lack of the twin grouping module makes it impossible for the system to group the twins, which makes it impossible for the system to perform fine-grained optimization based on the characteristics of different groups, thereby increasing the global average delay. The matching degrees of various resources also changed from 1.2271, 1.314 and 1.0284 to 1.438, 1.7297 and 1.25634, respectively, with decreases of 17.19%, 31.62% and 22.16%, respectively. This is because the lack of the twin grouping module causes the system to use only one global AC network for strategy learning, resulting in a decrease in the accuracy and flexibility of the resource allocation strategy, which in turn causes a significant decrease in resource matching.
[0109] like Figure 6 As shown, after eliminating the adaptive association module, the average delay of the present invention increases, and the global average delay increases from 0.62417s to 2.76954s. The fluctuation range of each resource matching degree is also greater than that of the present invention. This is because the module dynamically adjusts the association relationship between the twin and the group through the attention mechanism, and can flexibly adapt to changes in the system state. After ablation, the system loses its dynamic adjustment ability and cannot adapt to changes in resource requirements. Overall, the advantage of the present invention lies not only in its precise prediction mechanism, but also depends on a reasonable grouping strategy. They work together to optimize the configuration of system resources and improve overall performance and resource utilization.
[0110] Next, we evaluated the impact of different prediction methods on the performance of the present invention to verify the performance of the heterogeneous graph-based demand prediction module in this embodiment. Specifically, this embodiment compared the latency, computing resource matching, storage resource matching, and bandwidth resource matching of predictions using homogeneous and heterogeneous graphs. Figure 7 This is a performance comparison chart based on heterogeneous graphs and homogeneous graphs in this embodiment. Figure 7 As shown, the present invention is based on heterogeneous graph prediction, which is superior to the version based on homogeneous graph prediction in terms of latency, computing resource matching, storage resource matching and bandwidth resource matching. This is because heterogeneous graph prediction can distinguish different types of relationships in the system (such as placement relationships and communication relationships) and assign different weights to them, accurately capturing diverse resource demand characteristics, thereby achieving more efficient resource allocation and latency optimization. In contrast, homogeneous graph prediction regards all relationships as homogeneous and cannot make full use of this information, resulting in poor optimization effect. Therefore, heterogeneous graph prediction significantly improves system performance through more comprehensive relationship modeling.
[0111] Although the above describes the illustrative specific embodiments of the present invention to facilitate understanding of the present invention by those skilled in the art, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the appended claims, these changes are obvious, and all inventions and creations using the concepts of the present invention are protected.
Claims
1. A twin dynamic placement method for digital twin transportation system, characterized in that: The following steps are involved: S1: Construct a digital twin transportation system, and record the physical entity set P = {P1, P2, ..., P N }, where P n Denotes the nth physical entity, n=1,2,…,N, N represents the number of physical entities, and the twin set DT corresponding to the physical entity is recorded as DT={DT1,DT2,…,DT N }, where DT n is a physical entity P n Corresponding twins; let the edge server set ES = {ES1, ES2, ..., ES M }, ES m represents the mth edge server, m = 1, 2, ..., M, where M is the number of edge devices; S2: Construct a twin dynamic placement decision model, including a demand prediction module, a twin grouping module, an adaptive association module, and a placement decision generation module, where: The demand forecasting module is used to forecast demand based on the system data of the digital twin transportation system at the current time t and the previous τ-1 time. The system data at each time includes the data of each twin DT at that time. n The eigenvector of Each edge server ES m The eigenvector of The relationship between the twin and the edge device n,m (t′), if at the current time t′ the twin DT n Placed on edge server ES m On, then z n,m (t′)=1, otherwise z n,m (t′)=0, get the predicted DT of each twin at time t+1 n Forecast resource requirements And each edge server ES m Forecast load and sent to the adaptive association module and placement decision generation module; The twin grouping module is used to group each twin DT according to the current time t and the previous τ-1 time n The twins are grouped according to the characteristics of , and Q twin groups C are obtained. q , generate twin group feature ψ according to the feature vectors of all twins at the current time t in each twin group q And sent to the adaptive association module, q = 1, 2, ..., Q; The adaptive association module is used to n Forecast resource requirements Each edge server ES m Forecast load and the twin grouping characteristics ψ of Q twin groups q Calculate the probability p of each twin belonging to each twin group n,q , and sent to the placement decision generation module; the calculation method of the belonging probability is as follows: For each twin DT n and each twin group, will predict resource requirements As a query, the twin group feature ψ k As the key, the attention mechanism is used to calculate the similarity s between the two n,q : Among them, W Q and W K are weight matrices corresponding to queries and keys, respectively, d k Represents the dimension of the key; Then the similarity s is converted into n,q Converted to belonging probability p n,q : The placement strategy generation module is used to generate a strategy based on each twin DT n Forecast resource requirements Each edge server ES m Forecast load And the probability p of each twin belonging to each twin group n,q Generate the association relationship z between each twin and each edge device at the prediction time t+1 n,m (t+1), if the twin DT at the predicted time t+1 n Placed on edge server ES m On, then z n,m (t+1)=1, otherwise z n,m (t+1)=0; S3: Train the twin dynamic placement decision model constructed in step S3 to obtain a trained twin dynamic placement decision model; S4: During the operation of the digital twin transportation system, when a dynamic placement decision of the twin is required, the system data of the digital twin transportation system at the current moment and the previous τ-1 moments are collected and input into the trained twin dynamic placement decision model to predict the association relationship between each twin and each edge device at the next moment and obtain the twin placement strategy.
2. The twin dynamic placement method according to claim 1, characterized in that: The features of the twin and edge server in step S2 include device type, location, resource requirements and remaining resources. The feature vector is constructed after the numerical value of each feature is normalized.
3. The twin dynamic placement method according to claim 1, characterized in that: The demand prediction module in step S2 includes a heterogeneous graph construction module, a meta-path extraction module, a graph convolution module and a fully connected module, wherein: The heterogeneous graph construction module is used to construct the heterogeneous graph G at each time t′ based on the system data of the digital twin transportation system at the current time t and the previous τ-1 time t′ =(V,E t′ ), where the node set V=DT∪ES={DT1,DT2,...,DT N ,ES1,ES2,...,ES M }, that is, the heterogeneous graph contains two types of nodes, twins and servers, and the feature vector of the node is the feature vector of the corresponding twin or edge server; the edge set E includes two types of edges, namely placement relationship edges and communication relationship edges. Represents the node v at time t′ i Placed at node v j On, i, j = 1, 2, ..., N + M, Represents the node v at time t′ i Not placed at node v j Communication relationship side Represents the node v at time t′ i and node v j Can communicate, Represents the node v at time t′ i and node v j No communication possible; The meta-path extraction module is used to extract the heterogeneous graph G at each time t′ t′ =(V,E t′ ) extracts the meta-path and sends it to the graph convolution module. The meta-path extraction method is: t′ =(V,E t′ ), if a twin DT n With edge server ES m The communication relationship between Then extract the twin-communication-edge server path If a twin DT n With edge server ES m Placement relationship edges between Then extract the twin-placement-edge server path If a twin DT n With another twin DT n′ The communication relationship between And n′≠n, then extract the twin-communication-twin path The graph convolution module is used to perform graph convolution operations on the meta-path at each time t′ extracted by the meta-path extraction module to extract historical twin features. and historical edge server characteristics And send it to the fully connected module; the specific method of graph convolution operation is: The feature update formula of the twin in the twin-communication-edge server path is as follows: in, Respectively represent the twin DT obtained after the convolution operation of the twin-communication-edge server path of the sth layer and the s+1th layer. n Features, σ() represents the activation function, represents the weight of the twin in the twin-communication-server path in the sth layer, Representation and twin DT n The set of edge servers for which there exists a twin-communication-edge server path, represents the weight of the edge server in the twin-communication-server path in the sth layer, Represents the attention weight on the twin-communication-edge server path, which is used to measure the edge server ES m Twin DT n the impact of; Represents the edge server ES obtained after the convolution operation of the s-th layer twin-communication-edge server path m Features, The feature update formula of the edge server in the twin-communication-edge server path is as follows: in, Represents the edge server ES obtained after the convolution operation of the s+1th layer twin-communication-edge server path m Features, Represents edge server ES m There is a set of twins with a twin-communication-edge server path, Represents the attention weight on the twin-communication-edge server path, which is used to measure the twin DT n Edge Server ES m the impact of; The feature update formula for the twin in the twin-placement-edge server path is as follows: in, Respectively represent the twin DT obtained after the convolution operation of the twin-placement-edge server path of the s-th layer and the s+1-th layer. n Features, denote the weight of the twin and the weight of the edge server in the twin-placement-server path in the sth layer, Represents the attention weight on the twin-placement-edge server path, which is used to measure the edge server ES m Twin DT n The impact of Represents the edge server ES obtained after the convolution operation of the s-th layer twin-placement-edge server path m Features, The feature update formula for the edge server in the twin-placement-edge server path is as follows: in, Represents the edge server ES obtained after the convolution operation of the s+1th layer twin-placement-edge server path m Features, Represents edge server ES m There is a set of twins with a twin-placement-edge server path, represents the attention weight on the twin-placement-edge server path, which is used to measure the twin DT n Edge Server ES m the impact of; The feature update formula of the twins in the twin-communication-twin path is as follows: in, Respectively represent the twin DT obtained after the convolution operation of the twin-communication-twin path of the sth layer and the s+1th layer n Features, Represents the twin DT obtained after the convolution operation of the twin-communication-twin path of the s+1th layer n′ Features, represents the weight of the twin in the twin-communication-twin path in the sth layer, Representation and twin DT n There is a set of twins with a twin-communication-twin path, Represents the attention weight on the twin-communication-twin path, which is used to measure the twin DT n′ Twin DT n the impact of; After L layers of graph convolution operations, the features obtained on the three paths are fused to obtain the final twin features. and edge server characteristics Among them, concat() represents feature concatenation; Then concatenate the twin features at τ moments to get the historical twin features Concatenate the edge server features at τ moments to get the historical edge server features The fully connected module includes a twin fully connected layer and an edge server fully connected layer, where the twin fully connected layer is used to integrate the historical twin features of each twin. Processing to generate predicted resource requirements The edge server fully connected layer is used to analyze the historical edge server features of each edge server Processing to generate predicted load 4. The twin dynamic placement method according to claim 1, characterized in that: The twin grouping module in step S2 adopts a twin grouping method based on feature-driven clustering, including the following steps: 1) For each twin node DT n , collect its resource requirements at τ moments to form the resource requirement vector R n , the geographical locations at τ moments constitute the geographical location vector L n The traffic flow at τ moments constitutes the traffic flow characteristic vector T n , and then normalize it to get the standardized resource demand vector Geographic location vector and traffic flow feature vector Reconstruct the initial features of each twin node 2) Initial features Perform principal component analysis to reduce the dimension and obtain feature X n ; 3) Using dynamic K-means clustering algorithm according to feature X n Cluster the twins to obtain Q twin clusters. Each twin cluster corresponds to a group, and the feature vector corresponding to the cluster center at the current time t in each twin group is used as the twin group feature ψ q .
5. The twin dynamic placement method according to claim 1, characterized in that: The placement strategy generation module in step S3 includes Q intra-group actor-critic networks and a global critic network, where: In the qth intra-group actor-critic network, the input state s of the intra-group actor network q For N twin DT n Forecast resource requirements M edge servers ES m Forecast load And each twin DT n For the current twin grouping, the probability p n,q The vector formed, output action a q For each twin DT at the prediction time t+1 under the current group n With each edge server ES m The relationship matrix between Each element is the corresponding twin DT n With edge server ES m The relationship between The internal critic network is used to calculate the value V of the state-action pair q and reward R q ; The global critic network is based on Q correlation matrices Z q The concatenation matrix generates the weight vector W=(w1,w2,…,w Q ), and then the reward R of the critic network in each group q Perform weighted summation to obtain the global reward R global :