Model dynamic migration decision method based on parallel discrete event scheduling
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NAT UNIV OF DEFENSE TECH
- Filing Date
- 2026-04-13
- Publication Date
- 2026-06-12
AI Technical Summary
In existing multi-threaded parallel simulation systems, load prediction methods struggle to capture the spatiotemporal coupling characteristics between models, and migration decisions lack reliable basis, leading to decreased simulation system performance and insufficient simulation accuracy.
A hybrid prediction model is constructed, combining graph convolutional networks and long short-term memory networks. Spatial topological features and temporal dependencies between models are extracted. Parameters are dynamically updated through an incremental learning strategy. The simulated annealing algorithm is used to solve for the optimal transfer scheme, and a mapping model between task load and runtime is established.
This improved the accuracy of load prediction and the operating efficiency of the simulation system, ensuring the stability and efficiency of the distributed system and achieving an overall performance improvement in the simulation system.
Smart Images

Figure CN122019193B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a model dynamic migration decision method based on parallel discrete event scheduling. Background Technology
[0002] With the development of technology in the field of complex scene simulation, multi-threaded parallel simulation technology has been widely used. This technology can support multiple models to run at the same time, adapt to the dynamic changes of tasks in the scene and the data interaction needs between multiple models, and provide basic support for the simulation and analysis of various complex scenes.
[0003] However, in existing multi-threaded parallel simulation processes, the load of each running unit exhibits complex spatiotemporal characteristics. On the one hand, the load exhibits non-stationary fluctuations in the time dimension, and the related computational load will increase significantly in specific scenarios. Such dynamic changes are difficult to accurately capture using traditional time series models. On the other hand, there are close logical connections and data interactions between multiple models in the simulation system, forming a complex spatial topology. This causes the load to affect each other between different running units. Most existing load prediction methods only focus on feature extraction in the time dimension, ignoring the topological relationships between models. They cannot effectively cope with the spatiotemporal coupling characteristics of the load, making it difficult to output accurate load prediction results. Consequently, subsequent model migration decisions lack a reliable basis. Meanwhile, the migration decision-making process faces numerous challenges. Due to a lack of accurate understanding of the complex relationship between the number of tasks and the running time of the scheduling unit, traditional migration strategies struggle to accurately determine the optimal migration timing. Migrating too early can introduce unnecessary system overhead, while migrating too late may overload some running units, resulting in a severe deterioration in system performance. Furthermore, the logical dependencies between models further increase the difficulty of decision-making. During the migration process, it is necessary to ensure data consistency and logical coherence between models. Inappropriate decisions can easily lead to deviations in simulation results. Existing algorithms are unable to comprehensively weigh multiple factors in a short period of time to formulate the globally optimal migration decision, which restricts the operating efficiency and simulation accuracy of the simulation system. Summary of the Invention
[0004] Therefore, it is necessary to provide a model dynamic migration decision method based on parallel discrete event scheduling to address the above-mentioned technical problems.
[0005] A model dynamic migration decision method based on parallel discrete event scheduling, the method comprising:
[0006] Obtain multidimensional load data for each model in the distributed system; the distributed system includes multiple simulation event schedulers, and each model is attached to one simulation event scheduler.
[0007] A hybrid prediction model is constructed and trained based on historical multidimensional load data. The model parameters are optimized until convergence through a loss function. The hybrid prediction model includes an input layer, multiple long short-term memory networks, and an output layer, wherein the input layer contains multiple graph convolutional networks.
[0008] The multidimensional load data are input into the trained hybrid prediction model. The load sequence is constructed through the input layer and standardized to obtain the standard load sequence. A graph structure data representing the relationship between models is established. The spatial topological features between models are extracted through the graph convolutional network. The temporal dependencies of each load data are mined through each long short-term memory network. Multiple spatiotemporal joint features are output. The attention mechanism of the output layer is used to weight and fuse the spatiotemporal joint features to obtain the load prediction result.
[0009] Based on the load prediction results, a mapping model between task load and running time is established for each simulation event scheduler. The parameters of the mapping model are dynamically updated using an incremental learning strategy to obtain the predicted running time of the simulation event scheduler.
[0010] With the goal of minimizing the scheduler runtime variance during engine operation, a dynamic migration model is constructed using constraints such as model uniqueness, prohibition of self-migration, and migration logic coherence.
[0011] Using the predicted runtime of each simulation event scheduler as the decision-making basis, the simulated annealing algorithm is used to solve the dynamic migration model and output the optimal model migration scheme.
[0012] The aforementioned model dynamic migration decision-making method based on parallel discrete event scheduling, by establishing graph-structured data representing the relationships between models, can clearly capture the correlation features between models, providing high-quality data support for subsequent processing. By constructing a hybrid prediction model including graph convolutional networks, long short-term memory networks, and attention mechanisms, it can fully leverage the synergistic advantages of each network, accurately capture the spatiotemporal characteristics of load data, and improve the accuracy of load prediction. By establishing a mapping model between scheduler workload and runtime based on the load prediction results, and using an incremental learning strategy to dynamically update parameters to obtain predicted runtime, it can accurately correlate workload and runtime, adapting to dynamic changes in the system. By constructing a dynamic migration model and using simulated annealing algorithm to solve and output the optimal model migration scheme, it can effectively balance the load of each scheduler, standardize migration operations, ensure the stable and efficient operation of the distributed system, and improve the overall system performance and operational reliability. This invention can improve the operating efficiency and simulation accuracy of the simulation system. Attached Figure Description
[0013] Figure 1 This is a flowchart illustrating a model dynamic migration decision method based on parallel discrete event scheduling in one embodiment.
[0014] Figure 2 This is a schematic diagram of the structure of a GCN-LSTM hybrid prediction model in one embodiment;
[0015] Figure 3 Here is a flowchart of the time attention mechanism learning load features in one embodiment;
[0016] Figure 4 This is a flowchart of a simulated annealing algorithm in one embodiment. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0018] This invention aims to effectively address four major challenges faced by dynamic model migration in existing technologies: First, the complexity of load prediction; the dynamic changes in complex simulation tasks and the spatiotemporal coupling characteristics between models make it difficult for traditional prediction methods to accurately capture load changes. Second, migration decision-making is difficult; unclear scheduler task execution rules and complex model logical dependencies make it difficult to determine the optimal migration timing and scheme. Third, the model migration process lacks stability; accuracy loss and network latency during data transmission affect simulation continuity. Fourth, there are obstacles to dynamic resource adaptation; changes in task priorities and hardware heterogeneity prevent resources from being allocated on demand. This invention achieves refined allocation and efficient utilization of computing resources by constructing a high-precision load prediction model and a dynamic model migration strategy, thereby ensuring the stability and efficiency of the simulation system in complex application scenarios and providing solid and reliable simulation support for relevant decisions.
[0019] In one embodiment, such as Figure 1 As shown, a model dynamic migration decision method based on parallel discrete event scheduling is provided, including the following steps:
[0020] Step 102: Obtain multi-dimensional load data for each model in the distributed system. The distributed system includes multiple simulation event schedulers, with each model mounted on one simulation event scheduler.
[0021] A distributed system refers to a system containing multiple independent yet collaborative simulation event schedulers. The simulation event scheduler is the core component responsible for scheduling and executing model tasks. Multidimensional load data refers to the various types of task volume data generated by each model during operation. A load sequence is a data sequence formed by organizing these multidimensional load data in chronological order. Standardization is a process of normalizing the load sequence and eliminating differences in the dimensions of different data types; the resulting standardized data sequence is the standard load sequence. Graph-structured data is a data structure built using models in a distributed system as nodes and the relationships between models as edges, used to represent the interrelationships between models.
[0022] It is understandable that by standardizing the load data format, eliminating the interference caused by differences in data units, and clearly capturing the correlation features between models, a high-quality and reliable data foundation can be provided for subsequent load prediction work. This will help improve the accuracy of subsequent model training and prediction, and build a solid data support for the entire dynamic migration decision-making process.
[0023] Step 104: Construct a hybrid prediction model. Train the hybrid prediction model based on historical multidimensional load data, and optimize the model parameters until convergence using a loss function. The hybrid prediction model includes an input layer, multiple long short-term memory networks, and an output layer, where the input layer contains multiple graph convolutional networks.
[0024] Historical multidimensional load data refers to the load data generated by the past operation of various models in a distributed system, which is used for model training and learning. The loss function is a function used to measure the deviation between the model's predictions and the actual data.
[0025] Step 106: Input the multidimensional load data into the trained hybrid prediction model, construct the load sequence through the input layer and perform standardization to obtain the standard load sequence, and establish graph structure data representing the relationship between models. Extract the spatial topological features between models through graph convolutional networks, mine the temporal dependency of each load data through each long short-term memory network, output multiple spatiotemporal joint features, and perform weighted fusion of each spatiotemporal joint feature through the attention mechanism of the output layer to obtain the load prediction result.
[0026] Spatial topological features refer to the features extracted through graph convolutional networks that reflect the strength and distribution patterns of spatial relationships among models. Temporal dependencies refer to the correlation patterns exhibited by the load data of each model over time. Spatiotemporal joint features are comprehensive features formed by fusing the extracted spatial topological features with the mined temporal dependency features. Weighted fusion is a method of assigning corresponding weights based on the importance of different spatiotemporal joint features and performing fusion calculations. The final data that reflects the future load change trend is the load prediction result.
[0027] It is understandable that this step can accurately extract the spatiotemporal core features of the load data, and by weighted fusion focusing on key features and weakening irrelevant interference, it can effectively improve the accuracy and comprehensiveness of the load prediction results. It can provide accurate input data for the subsequent mapping of the scheduler's task load and running time, which is conducive to ensuring the rationality and reliability of the subsequent mapping model construction.
[0028] Step 108: Based on the load prediction results, establish a mapping model between task load and running time for each simulation event scheduler, and dynamically update the parameters of the mapping model using an incremental learning strategy to obtain the predicted running time of the simulation event scheduler.
[0029] The task load-runtime mapping model is used to establish the relationship between the task load input and the runtime output of the simulation event scheduler. Predicted runtime refers to the time required for each simulation event scheduler to run in the future, obtained by combining the updated mapping model with load prediction results.
[0030] Understandably, this step establishes a precise correlation between workload and runtime. It's important to note that, leveraging the synergistic effect of the hybrid prediction model, the LSTM (Long Short-Term Memory) network organically combines the spatial topological features extracted by GCN with the temporal series modeling advantages of LSTM to generate long- and short-term time dependencies in the load data. This time dependency provides more comprehensive input feature support for the mapping model, helping the linear regression model accurately capture the intrinsic correlation between workload and runtime. Simultaneously, relying on the attention mechanism's ability to assign weights to different tasks, it provides more comprehensive input feature support for the mapping model, breaking through the accuracy bottleneck of traditional single linear regression mapping. Furthermore, through an incremental learning strategy, the mapping model is dynamically optimized, accurately capturing the dynamic changes in system load and accurately obtaining the predicted runtime of each simulation event scheduler. This provides a reliable decision-making basis for the subsequent construction and solution of the dynamic transfer model, improving the targeting and rationality of transfer decisions.
[0031] Step 110: With the goal of minimizing the scheduler runtime variance during engine operation, and with constraints such as model unique mounting constraint, prohibition of self-migration constraint, and migration logic coherence constraint, a dynamic migration model is constructed.
[0032] The engine operation process refers to the entire process of various simulation event schedulers collaboratively executing model tasks in a distributed system. Scheduler runtime variance is an indicator used to measure the degree of difference in runtime among various simulation event schedulers; the smaller the variance, the more balanced the load on each scheduler.
[0033] It is understandable that by constructing a dynamic migration model that fits the actual operating needs of the system, a clear optimization direction and constraint framework can be provided for subsequent algorithm solutions, which helps to ensure the feasibility and scientific nature of the final migration solution.
[0034] Step 112: Using the predicted running time of each simulation event scheduler as the decision basis, the simulated annealing algorithm is used to solve the dynamic migration model and output the optimal model migration scheme.
[0035] It is understandable that this step can use accurate predicted runtime as decision support, leverage the global search advantage of the simulated annealing algorithm to efficiently solve the dynamic migration model, quickly select the optimal model migration scheme, effectively balance the load of each simulation event scheduler, reduce system operating overhead, ensure the stable and efficient operation of the distributed system, and help improve the overall performance and operational reliability of the system.
[0036] In the aforementioned model dynamic migration decision-making method based on parallel discrete event scheduling, by establishing graph-structured data representing the relationships between models, the inter-model correlation features can be clearly captured, providing high-quality data support for subsequent processing. By constructing a hybrid prediction model including graph convolutional networks, long short-term memory networks, and attention mechanisms, the synergistic advantages of each network can be fully utilized to accurately capture the spatiotemporal characteristics of load data, improving the accuracy of load prediction. By establishing a mapping model between scheduler workload and runtime based on the load prediction results, and using an incremental learning strategy to dynamically update parameters and obtain predicted runtime, the workload and runtime can be accurately correlated, adapting to dynamic system changes. By constructing a dynamic migration model and using simulated annealing algorithm to solve and output the optimal model migration scheme, the load of each scheduler can be effectively balanced, migration operations can be standardized, the stable and efficient operation of the distributed system can be ensured, and the overall system performance and operational reliability can be improved. This embodiment of the invention can improve the operating efficiency and simulation accuracy of the simulation system.
[0037] In one specific embodiment, such as Figure 2 As shown, a schematic diagram of a GCN-LSTM hybrid prediction model is presented. This model combines the advantages of Graph Convolutional Networks (GCN) in processing complex network structures with the powerful capabilities of Long Short-Term Memory Networks (LSTM) in time series analysis, achieving high-precision prediction of the computational tasks and resource loads of each thread. The hybrid prediction model architecture adopts a layered design, mainly consisting of an input layer, an LSTM layer, and an output layer. The LSTM layer follows the classic LSTM model architecture, while the input and output layers respectively introduce GCN networks and attention mechanisms to achieve topological feature extraction and time series feature enhancement.
[0038] In the input layer, the model uses a sliding time window mechanism to collect multidimensional feature information from each model in the simulation engine within a specific time range, constructing a multidimensional load sequence. Normalization is then used to eliminate dimensional differences in the data. Subsequently, spatial topological features extracted by a Graph Convolutional Network (GCN) are used for graph model building and adjacency matrix calculation, structurally representing the relationships between models. Finally, the constructed graph model is input into the GCN network to achieve efficient extraction of spatial features from the load data.
[0039] The LSTM layer receives the topological spatial features input from the input layer and models the time series of each Long Short-Term Memory (LSTM) network. It uses a gating mechanism to dynamically update the cell state, thereby achieving spatiotemporal joint modeling of the dynamic changes in the number of tasks. This effectively solves the limitations of traditional methods that only consider the time or space dimension.
[0040] The output layer introduces a temporal attention mechanism. By adaptively learning weight coefficients, the states of the cell units output by the LSTM layer are weighted and fused, enabling the model to adaptively focus on the latest and most valuable data information. This mechanism dynamically adjusts the importance of features at different time steps, thereby enhancing the model's ability to capture the load features of key time steps, improving the model's prediction accuracy for dynamically changing task quantities, and providing a more accurate decision-making basis for dynamic model transfer.
[0041] In one embodiment, the number of graph convolutional networks and long short-term memory networks is consistent with the number of time steps in the load sequence.
[0042] In one embodiment, constructing a load sequence includes: based on a sliding time window mechanism, extracting continuous data within a preset continuous time range from the acquired multidimensional load data of each model at each time step to construct a load sequence; the length of the sliding time window is set according to the system load fluctuation characteristics, and the load sequence includes various heterogeneous task volume data of each model in the corresponding time step, and all heterogeneous task volume data are non-negative values.
[0043] In one embodiment, establishing graph structure data representing the relationships between models includes: using models in the distributed simulation system as nodes and the relationships between models as edges, constructing a node feature matrix based on the number of tasks of each model in the standard load sequence at the corresponding time step, and constructing graph structure data based on the node feature matrix and node correlation matrix of each node; the node correlation matrix is used to calculate and determine the adjacency relationship between models.
[0044] In this embodiment, the GCN-LSTM hybrid prediction model first employs a graph convolutional network at the input layer to build graph data and perform graph convolution calculations. The graph data model building stage includes steps such as establishing nodes and node feature matrices, calculating the correlation matrix, and establishing the adjacency matrix and degree matrix. During this stage, graph data construction is performed for each time step of the distributed simulation system. Using the models in the system as node units, the number of tasks for each model is used to construct the node feature matrix. A node correlation matrix is constructed, and a threshold is set as the judgment criterion. When the correlation value between any two nodes exceeds this threshold, it is determined that the two nodes have an adjacency relationship. Based on the adjacency relationships between nodes, the adjacency matrix and degree matrix of the graph data are constructed, thereby completing the construction of the graph data model.
[0045] In one embodiment, extracting spatial topological features between models using a graph convolutional network includes: receiving graph structure data through a graph convolutional network, adding a self-loop structure to the adjacency matrix of the graph structure data to obtain an optimized adjacency matrix; and performing convolution operations based on the optimized adjacency matrix, the degree matrix of the graph structure data, and the node feature matrix to extract spatial topological features between models.
[0046] In this embodiment, during the graph convolution calculation stage, the adjacency matrix is first optimized by introducing a self-loop structure. This operation can enhance the efficiency of information transmission between nodes and effectively solve the problem of difficulty in updating feature information caused by the lack of external connections for isolated nodes. Based on the adjacency matrix after introducing the self-loop, the graph convolution calculation is carried out according to formula (1), and the final calculation result is output. This result is the extraction result of the model space topology relationship at the corresponding time step.
[0047] (1)
[0048] in: : No. Layer node feature matrix (input layer) (This is the original feature matrix). : Add a self-loop adjacency matrix. : The degree matrix. :No. The learnable weight matrix of the layer. Activation function.
[0049] Secondly, the spatial topological features extracted by GCN are organically combined with the temporal series modeling advantages of LSTM, and cell states are dynamically updated through a gating mechanism. During model training, forward and backpropagation algorithms are used to deeply mine the long-term and short-term temporal dependencies of the workload data. Cell unit state information is passed through the time series and finally summarized to the output layer, realizing spatiotemporal joint modeling of the dynamic changes in the number of tasks, providing a feature foundation for subsequent predictions. During model training, this invention uses mean squared error (MSE) as the loss function. LSTM calculates the MSE loss value through the stepwise transmission of time series data and uses the backpropagation algorithm to update the weight matrix in the model. Through continuous iterative optimization, the optimal weight parameters that minimize the loss function are finally obtained.
[0050] Finally, in the process of using LSTM to predict time series data, since LSTM does not update model parameters according to the correlation between data and time, and time series data is closely related to time, it is often difficult to obtain optimal results. Therefore, this invention introduces a time attention mechanism into the output layer of the LSTM network to focus on the temporal characteristics of the data, thereby improving the prediction accuracy of the LSTM network. Figure 3 As shown, the specific steps are as follows:
[0051] Step 301: Input Mapping: Given a query vector and a set of key-value pairs First, linear transformation and weight matrix are used. and This maps query vectors and key-value pairs to the same space.
[0052] Step 302: Additive Fusion and Activation: Query With each key Additive fusion is performed, followed by enhancement of expressive power using the tanh function. The formula is as follows:
[0053] (2)
[0054] Step 303: Attention Weight Calculation: The additively fused and activated vectors are processed through a weight matrix. and The softmax function is converted into attention weights. The formula is as follows:
[0055] (3)
[0056] Step 304: Weighted Summation Output: Based on the calculated attention weights , and vector values Weighted summation yields the final output vector. .
[0057] (4)
[0058] The temporal attention mechanism deployed in the output layer adaptively learns weight coefficients to weight and fuse the states of the cell units output by the LSTM layer. This mechanism can dynamically adjust the importance of features at different time steps, significantly enhancing the model's ability to capture features loaded at key time steps.
[0059] ; ;
[0060] ;
[0061] ;
[0062] In one embodiment, the unique model mounting constraint includes that each model must be mounted on one and only one simulation event scheduler at any time step; the prohibition of self-migration constraint includes that the migration scheduler and the migration scheduler cannot be the same during the model's migration operation; and the migration logic coherence constraint includes that the model's mounting state at the current time step is obtained by updating the mounting state and migration operation of the previous time step.
[0063] In this embodiment, a mathematical model is established for the dynamic migration problem of the model during the operation of the distributed simulation system to solve the problem of unbalanced system load.
[0064] System definition: This invention designs a system that includes A distributed system with simulated schedulers is denoted as set. The system is deployed Each independent model is denoted as a set. Each model At time step Three heterogeneous tasks are generated internally, with the following task quantities: Each model must and can only be mounted on one simulation event scheduler. Models cannot migrate themselves during migration. The goal is to achieve long-term load balancing of the system through dynamic model migration.
[0065] The problem definition of model dynamic transfer specifically includes:
[0066] Definition 1: Mounted state variables:
[0067] (5)
[0068] Definition 2: Transition operation variables:
[0069] (6)
[0070] Definition 3: Scheduler Load: Scheduler At time step t The total load is the sum of the number of tasks of all models mounted on it. This indicates the weights of the three types of tasks handled by the scheduler.
[0071] (7)
[0072] Definition 4: Objective function: Based on the purpose of dynamic model transfer, the objective function is defined as minimizing the scheduler runtime variance during engine operation.
[0073] (8)
[0074] in, , indicating time step The average load. , representing the model From the scheduler Migrate to The cost. The parameter represents the degree to which the system inhibits model migration.
[0075] Definition 5: Systematically define model constraints:
[0076] (1) Model uniqueness constraint: This means that the model must be mounted on one simulation event scheduler.
[0077] (9)
[0078] (2) Migration logic constraint: indicates that the position update of the model needs to be completed through migration operation.
[0079] (10)
[0080] (3) Prohibition of self-transfer constraint: This means that the model cannot be transferred in or out by the same scheduler.
[0081] (11)
[0082] With the goal of minimizing the scheduler runtime variance during engine operation, and with constraints such as model uniqueness, prohibition of self-migration, and consistency of migration logic, a dynamic migration model is constructed.
[0083] In one embodiment, establishing a mapping model between task load and runtime for each simulated event scheduler based on load prediction results includes: the mapping model is a linear regression model, with the predicted task load values of each simulated event scheduler as input feature vectors, and the runtime of the simulated event scheduler as the output scalar, and the training objective is to minimize the deviation between the predicted runtime and the actual runtime; the linear regression model characterizes the degree of influence of different types of tasks on runtime through the weight parameters of the attention mechanism, and characterizes the basic runtime of the simulated event scheduler through the bias term, wherein the linear regression model dynamically adapts to the time variation characteristics of task load based on the long-term and short-term time dependencies of the load data output by the hybrid prediction model.
[0084] In this embodiment, the present invention provides a simulated annealing optimization algorithm that integrates linear regression prediction for dynamic model migration. It utilizes a linear regression model combined with an incremental learning mechanism to continuously update model parameters, quickly adapt to load fluctuations, and dynamically map the relationship between the number of tasks and runtime of the scheduler, providing real-time decision-making basis for the simulated annealing algorithm. Furthermore, to avoid frequent model migrations between schedulers, the present invention designs a model migration frequency suppression mechanism and a migration cooldown period strategy, effectively reducing the system overhead caused by frequent migrations and ensuring the stability and operating efficiency of the simulation system. Simultaneously, by introducing a migration suppression cost function, comprehensively considering scheduler runtime and migration costs, and using the Metropolis criterion to filter solutions, the present invention ultimately achieves effective control of system load balancing and migration costs.
[0085] Specifically, firstly, a linear regression model is used to linearly map the relationship between scheduler runtime and scheduler load, providing a reliable decision-making basis for the simulated annealing algorithm. Since the distributed simulation system data is time-series data, it is impossible to build a model for the entire process at once. Therefore, this invention adopts an incremental learning mechanism to support dynamic model updates and real-time adaptation to load fluctuations. Furthermore, since different schedulers may have different mapping relationships, this invention establishes a separate linear regression model for each scheduler. Input feature vectors... , indicating the scheduler N At time step t The number of tasks, of which d Indicates the task type. Output scalar. , indicating the scheduler N At time step t The predicted runtime. The regression model is as follows:
[0086]
[0087] in, This indicates the impact of each type of task on the scheduler's runtime. bThe bias term represents the scheduler's base runtime. Furthermore, the model training objective is to minimize the mean squared error (MSE) loss function as follows:
[0088]
[0089] in, This is the L2 regularization coefficient, used to control model complexity and prevent overfitting. To adapt to dynamic changes in task load, an incremental learning strategy is used to update model parameters. Whenever a new data point is added... Upon arrival, calculate the current prediction error and update the parameters using stochastic gradient descent (SGD), where Learning rate:
[0090]
[0091]
[0092] Secondly, the simulated annealing algorithm uses the results calculated by the linear regression model as the basis for decision-making, and adopts a neighborhood solution generation strategy that combines greedy and random approaches, thereby improving search efficiency and achieving effective control of system load balancing and migration costs.
[0093] In one embodiment, using the predicted runtime of each simulation event scheduler as the decision-making basis, the simulated annealing algorithm is used to solve the dynamic migration model, and the optimal model migration scheme is output. This includes: setting the initial temperature, cooling rate, and iteration number corresponding to each temperature for the simulated annealing algorithm; using the current mounting scheme of each model on the simulation event scheduler as the initial solution; calculating the corresponding scheduler runtime variance based on the initial solution as the initial objective function value; and using the initial solution as the current optimal solution; dynamically adjusting the probability of using the greedy strategy according to the current temperature; generating neighborhood solutions of the initial solution using a mixture of greedy and random strategies; limiting the number of models migrated in a single step when generating neighborhood solutions; calculating the scheduler runtime variance corresponding to the neighborhood solution based on the predicted runtime of each simulation event scheduler; using the objective function value of the neighborhood solution; determining whether to accept the neighborhood solution according to a preset criterion; if accepted, updating the neighborhood solution as the new current optimal solution; determining whether the current algorithm temperature has dropped to the preset termination temperature; if not, reducing the temperature according to the preset cooling rate and iteratively updating the optimal solution; if the temperature has dropped, outputting the current optimal solution as the optimal model migration scheme.
[0094] In this embodiment, the simulated annealing algorithm is divided into four main stages: algorithm initialization, neighborhood solution generation, acceptance condition judgment, and termination condition judgment. Figure 4 As shown, the specific steps for each stage are as follows:
[0095] Step 401, Algorithm initialization stage: Generate an initial solution based on the mounting scheme of the current model.
[0096] The algorithm sets parameters such as initial temperature, cooling rate, and number of iterations at each temperature, and generates an initial solution based on the current model's mounting scheme.
[0097] Step 402, Neighborhood Solution Generation Stage: Generate different schemes for different model migrations.
[0098] This stage generates different schemes for different model transfers, employing a hybrid approach of greedy and random strategies to generate neighborhood solutions. First, the probability of using the greedy strategy is calculated based on the initial and final greedy strategy probabilities set during initialization, as well as the current temperature value. The formula is as follows, where... 、 、 Let represent the current greedy strategy probability, the initial greedy strategy probability, and the final greedy strategy probability, respectively. , , These represent the current temperature, initial temperature, and final temperature, respectively. The current greedy strategy probability represents the proportion of the number of possible solutions generated using the greedy strategy for the current temperature out of the total number of possible temperature solutions.
[0099] (16)
[0100] Secondly, feasible solutions are generated based on the neighborhood solution generation strategy. Considering the complexity of model transfer implementation, an upper limit is set for model transfer to limit the number of model transfers in each solution, preventing excessive changes in a single neighborhood operation. Controlling the search space size while improving the quality of solutions helps to find better local optima.
[0101] Step 403, Acceptance and Judgment Phase: Calculate the cost of generating the solution.
[0102] This stage calculates the cost of generating the proposed solution and determines whether to accept it based on the Metropolis criterion. When calculating the cost, a linear regression model is used to map the relationship between the number of tasks and the runtime of the scheduler, while a migration suppression mechanism is incorporated to constrain model migration.
[0103] (17)
[0104] in Used to measure the degree of migration inhibition. And based on the Metropolis criterion, it is expressed as a probability. The Metropolis criterion formula for determining whether to accept the current solution is as follows:
[0105] (18)
[0106] in, This represents the newly generated scheme. This indicates the currently accepted solution.
[0107] Step 404, Termination condition judgment stage.
[0108] This stage determines whether to terminate the iteration. If the termination condition is met, the iteration ends; otherwise, the temperature decay is calculated, the temperature is lowered, and the next iteration continues.
[0109] In one embodiment, the preset criterion is the Metropolis criterion; if the objective function value of the neighborhood solution is less than the objective function value of the current optimal solution, the neighborhood solution is directly accepted; if the objective function value of the neighborhood solution is greater than or equal to the objective function value of the current optimal solution, the acceptance probability is calculated based on the current algorithm temperature, and then a random judgment is made to determine whether to accept the neighborhood solution; if the neighborhood solution is accepted, the objective function value of the neighborhood solution is synchronously updated to the new objective function value of the current optimal solution.
[0110] In one embodiment, determining whether to accept a neighborhood solution by random judgment includes: generating a random number and comparing the random number with the calculated acceptance probability; if the random number is less than the acceptance probability, then accepting the neighborhood solution; if the random number is greater than or equal to the acceptance probability, then rejecting the neighborhood solution.
[0111] In one specific embodiment, the method of the present invention first uses a hybrid prediction model based on GCN-LSTM to innovatively establish a graph model between models to address the complex interaction relationships between models in complex simulation scenarios. Leveraging the powerful topology modeling capabilities of graph convolutional networks, it deeply extracts spatial features such as dependencies and interaction strengths between simulation models, transforming the topology into computable feature vectors. Simultaneously, it combines Long Short-Term Memory (LSTM) networks to mine the temporal dependencies of load data, outputting accurate load prediction results. This provides structured and high-precision data support for subsequent dynamic migration decisions. This load prediction result is further used as input to a linear regression mechanism, which is integrated to construct a precise mapping relationship between the number of tasks and runtime in the scheduler. An incremental learning mechanism is also incorporated, enabling the mapping model to be dynamically updated based on real-time data, enhancing its adaptability to dynamic system changes. This precise and dynamically updated mapping relationship is the core link connecting the GCN-LSTM hybrid prediction model and the simulated annealing algorithm, providing a reliable decision-making basis for the simulated annealing algorithm's dynamic model migration. In the multi-threaded simulation engine architecture, the event scheduler acts as the core hub, collaboratively managing multiple simulation models. Each model is mounted on the event scheduler. Each time step model generates a different number of tasks, which are processed by the scheduler in real time. The different number of tasks will lead to different processing times for the scheduler, which in turn will cause load imbalance. Therefore, based on the above decision criteria, it is necessary to use the simulated annealing algorithm to dynamically migrate the models, effectively solve the problem of the difficulty in accurately modeling the relationship between the number of tasks and the running time of the scheduler, and finally achieve system load balancing.
[0112] It should be understood that, although Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0113] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0114] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A model dynamic migration decision method based on parallel discrete event scheduling, characterized in that, The method includes: Obtain multidimensional load data for each model in the distributed system; the distributed system includes multiple simulation event schedulers, and each model is attached to one simulation event scheduler. A hybrid prediction model is constructed and trained based on historical multidimensional load data. The model parameters are optimized until convergence through a loss function. The hybrid prediction model includes an input layer, multiple long short-term memory networks, and an output layer, wherein the input layer contains multiple graph convolutional networks. The multidimensional load data are input into the trained hybrid prediction model. The load sequence is constructed through the input layer and standardized to obtain the standard load sequence. A graph structure data representing the relationship between models is established. The spatial topological features between models are extracted through the graph convolutional network. The temporal dependencies of each load data are mined through each long short-term memory network. Multiple spatiotemporal joint features are output. The attention mechanism of the output layer is used to weight and fuse the spatiotemporal joint features to obtain the load prediction result. Based on the load prediction results, a mapping model between task load and running time is established for each simulation event scheduler. The parameters of the mapping model are dynamically updated using an incremental learning strategy to obtain the predicted running time of the simulation event scheduler. With the goal of minimizing the scheduler runtime variance during engine operation, a dynamic migration model is constructed using constraints such as model uniqueness, prohibition of self-migration, and migration logic coherence. Using the predicted runtime of each simulation event scheduler as the decision-making basis, the simulated annealing algorithm is used to solve the dynamic migration model and output the optimal model migration scheme.
2. The method according to claim 1, characterized in that, The construction of the load sequence includes: Based on the sliding time window mechanism, continuous data within a preset continuous time range is extracted from the multidimensional load data of each model at each time step to construct a load sequence. The length of the sliding time window is set according to the system load fluctuation characteristics. The load sequence contains multiple heterogeneous task volume data of each model in the corresponding time step, and all heterogeneous task volume data are non-negative values.
3. The method according to claim 1, characterized in that, The graph structure data used to establish the relationships between the characterization models includes: Using models in a distributed simulation system as nodes and the relationships between models as edges, a node feature matrix is constructed based on the number of tasks for each model in the standard load sequence at the corresponding time step. Graph structure data is constructed based on the node feature matrix and the node correlation matrix of each node. The node correlation matrix is used to calculate and determine the adjacency relationship between models.
4. The method according to claim 1, characterized in that, The number of graph convolutional networks and long short-term memory networks is consistent with the number of time steps of the load sequence.
5. The method according to claim 1, characterized in that, Extracting spatial topological features between models using graph convolutional networks includes: The graph structure data is received through the graph convolutional network, and a self-loop structure is added to the adjacency matrix of the graph structure data to obtain an optimized adjacency matrix. Convolution operations are performed based on the optimized adjacency matrix, the degree matrix of the graph structure data, and the node feature matrix to extract spatial topological features between models.
6. The method according to claim 1, characterized in that, Based on the load prediction results, a mapping model between task load and runtime is established for each simulation event scheduler, including: The mapping model is a linear regression model, with the predicted values of various task quantities of each simulation event scheduler as the input feature vector and the running time of the simulation event scheduler as the output scalar. The training objective is to minimize the deviation between the predicted running time and the actual running time. The linear regression model uses the weight parameters of the attention mechanism to characterize the degree of influence of different types of tasks on runtime, and uses the bias term to characterize the basic runtime of the simulation event scheduler. The linear regression model dynamically adapts to the time variation characteristics of task volume based on the long-term and short-term time dependencies of the load data output by the hybrid prediction model.
7. The method according to claim 1, characterized in that, The unique model mounting constraint includes that each model must be mounted on one simulation event scheduler at any time step; The prohibition on self-migration constraint includes the requirement that the inbound scheduler and the outbound scheduler cannot be the same during the model's migration operation. The migration logic coherence constraint includes the model's mounting state at the current time step, which is obtained by updating the mounting state and migration operation at the previous time step.
8. The method according to claim 1, characterized in that, Using the predicted runtime of each simulation event scheduler as the decision-making basis, the simulated annealing algorithm is used to solve the dynamic migration model, and the optimal model migration scheme is output, including: Set the initial temperature, cooling rate, and number of iterations for each temperature in the simulated annealing algorithm. Use the current mounting scheme of each model on the simulation event scheduler as the initial solution, and calculate the corresponding scheduler runtime variance based on the initial solution as the initial objective function value. At the same time, use the initial solution as the current optimal solution. The probability of using the greedy strategy is dynamically adjusted according to the current temperature. A combination of greedy and random strategies is used to generate the neighborhood solution of the initial solution. The number of models in a single migration is limited when generating the neighborhood solution. Based on the predicted running time of each simulated event scheduler, the variance of the scheduler running time corresponding to the neighborhood solution is calculated and used as the objective function value of the neighborhood solution. The neighborhood solution is determined according to a preset criterion. If accepted, the neighborhood solution is updated to the new current optimal solution. Determine whether the current algorithm temperature has dropped to the preset termination temperature. If it has not dropped, reduce the temperature according to the preset cooling rate and iteratively update the optimal solution. If it has dropped, output the current optimal solution as the optimal model migration scheme.
9. The method according to claim 8, characterized in that, The preset criterion is the Metropolis criterion; If the objective function value of the neighborhood solution is less than the objective function value of the current optimal solution, then the neighborhood solution is accepted directly. If the objective function value of the neighborhood solution is greater than or equal to the objective function value of the current optimal solution, the acceptance probability is calculated based on the current algorithm temperature, and then the neighborhood solution is randomly determined to be accepted. If the neighborhood solution is accepted, the objective function value of the neighborhood solution is synchronously updated to the objective function value of the new current optimal solution.
10. The method according to claim 9, characterized in that, The step of determining whether to accept the neighborhood solution through random judgment includes: Generate a random number and compare the random number with the calculated acceptance probability; If the random number is less than the acceptance probability, the neighborhood solution is accepted; if the random number is greater than or equal to the acceptance probability, the neighborhood solution is rejected.