Multi-task scheduling optimization method and system in optical communication device
By constructing a task graph structure and a particle swarm optimization model, tasks in optical communication equipment are dynamically scheduled, which solves the problems of low resource utilization and unstable service quality in static scheduling and priority scheduling, and achieves efficient and flexible task scheduling and Resource management.
Patent Information
- Application Number
- CN202411046899.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-08-01
AI Technical Summary
Among existing optical communication equipment task scheduling methods, static scheduling and priority scheduling have problems such as low resource utilization, unstable service quality, and poor scheduling flexibility. It is especially difficult to dynamically respond to sudden traffic and network status changes.
By obtaining the virtual machine resource usage data and task description data of the task queue in the optical communication device, the task graph structure is constructed, the graph neural network is used to update the node characteristics, and combined with the particle swarm optimization model, the task scheduling plan is determined, and tasks are dynamically assigned to the corresponding tasks. virtual machines for efficient scheduling.
It realizes dynamic task scheduling in complex network environments, improves resource utilization and service quality, provides more stable and high-quality optical communication services, can quickly respond to changes in network status, and reduces task conflicts and resource competition.
Smart Images

Figure CN118590548B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of optical communication equipment management, and in particular to a multi-task scheduling optimization method and system in an optical communication device. Background Art
[0002] As an important infrastructure of the modern information society, optical communication technology is widely used in data centers, long-distance backbone networks, access networks and other fields. With the rapid development of emerging technologies such as 5G, the Internet of Things and big data, the demand for optical communication networks has increased significantly, bringing higher bandwidth requirements and more complex network topologies. In this context, the multi-task scheduling problem of optical communication devices has become particularly important.
[0003] At present, the task scheduling methods for optical communication equipment mainly include static scheduling methods and priority-based scheduling methods. In the static scheduling method, the scheduling strategy has been determined before the task arrives, such as fixed bandwidth allocation (FBA) and round-robin scheduling (RRS). It is simple to implement and easy to manage, but lacks flexibility and cannot dynamically respond to sudden traffic and changes in network status, resulting in low resource utilization.
[0004] In the priority-based scheduling method, scheduling is performed according to the priority of the task to ensure that high-priority tasks are processed first, such as Weighted Fair Queuing (WFQ) and Strict Priority Scheduling (SPS). Although this method can improve the service quality to a certain extent, due to the relatively static setting of the priority and the lack of dynamic evaluation of the urgency of the task, the service quality is still unstable.
[0005] In response to the above problems, the industry has not yet proposed a better technical solution. Summary of the invention
[0006] The present application provides a multi-task scheduling optimization method, system, storage medium, computer program product and electronic device in an optical communication device, which are used to at least solve the problems of low resource utilization, unstable service quality and poor scheduling flexibility caused by static scheduling or priority scheduling in the current related technology.
[0007] In a first aspect, an embodiment of the present application provides a multi-task scheduling optimization method in an optical communication device, comprising: obtaining resource usage data of each virtual machine in the optical communication device, and collecting task description data corresponding to each task in a task queue; the resource types corresponding to the resource usage data include bandwidth resources, computing resources and storage resources; the task description data includes task type, task priority, task resource requirements and task estimated duration; the task type includes any one of the following: real-time data transmission task, batch data transmission task, dynamic resource allocation task, path optimization task, network fault handling task and network upgrade task; constructing a task graph structure according to each of the task description data; the task graph structure includes multiple graph nodes and edge connections, The node features of each graph node are defined by the task description data of the corresponding task, and the edge features of each edge connection are defined by the task dependency indicated by the connected graph nodes; the node features of each graph node in the graph structure are updated based on the graph neural network to construct a task feature matrix; the task feature matrix and the resource usage data of each virtual machine are input into the particle swarm optimization model to determine the target task scheduling scheme for directing each of the tasks to the corresponding virtual machine; the task feature matrix and the resource usage data of each virtual machine are used to initialize the particle swarm, and each particle in the particle swarm is defined by the corresponding potential task scheduling scheme, and the potential task scheduling scheme contains the pre-allocated relationship between each of the tasks and each of the virtual machines.
[0008] In a second aspect, an embodiment of the present application provides a multi-task scheduling optimization system in an optical communication device, including: a data acquisition unit, used to acquire resource usage data of each virtual machine in the optical communication device, and collect task description data corresponding to each task in the task queue; the resource types corresponding to the resource usage data include bandwidth resources, computing resources and storage resources; the task description data includes task type, task priority, task resource requirements and task estimated duration; the task type includes any one of the following: real-time data transmission task, batch data transmission task, dynamic resource allocation task, path optimization task, network fault handling task and network upgrade task; a graph structure construction unit, used to construct a task graph structure according to each of the task description data; the task graph structure includes multiple graph nodes and edge connections, each The node features of a graph node are respectively defined by the task description data of the corresponding task, and the edge features of each edge connection are respectively defined by the task dependency indicated by the connected graph node; a task matrix construction unit is used to update the node features of each graph node in the graph structure based on the graph neural network to construct a task feature matrix; a task scheduling optimization unit is used to input the task feature matrix and the resource usage data of each virtual machine into a particle swarm optimization model to determine a target task scheduling scheme for directing each of the tasks to the corresponding virtual machine; the task feature matrix and the resource usage data of each virtual machine are used to initialize a particle swarm, and each particle in the particle swarm is respectively defined by a corresponding potential task scheduling scheme, and the potential task scheduling scheme contains a pre-allocated relationship between each of the tasks and each of the virtual machines.
[0009] According to a third aspect, an electronic device is provided, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the steps of the multi-task scheduling optimization method in the optical communication device of any embodiment of the present application.
[0010] In a fourth aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon, characterized in that when the program is executed by a processor, the steps of the multi-task scheduling optimization method in the optical communication device of any embodiment of the present application are implemented.
[0011] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the multi-task scheduling optimization method in an optical communication device of any embodiment of the present application.
[0012] The multi-task scheduling optimization method and system in an optical communication device provided by the present application can produce at least the following technical effects:
[0013] (1) By obtaining the resource usage data of each virtual machine in the optical communication device and combining it with the task description data of each task in the task queue, the actual usage of current resources and the resource requirements of future tasks can be accurately grasped. By constructing a task graph structure and using a graph neural network to update the node features of each graph node in the graph structure, the dependencies and resource demand characteristics between tasks can be effectively captured. When determining the target task scheduling scheme based on the particle swarm optimization model, the optimal task scheduling strategy can be found through iterative optimization to direct different tasks to the corresponding virtual machines for response, thus realizing dynamic task scheduling in a complex network environment, so that all types of tasks can be better processed and high-quality optical communication services can be provided more stably.
[0014] (2) By deploying multiple virtual machines in the optical communication device and calling the virtual machines to process various types of tasks in the task queue, the resource isolation characteristics of the virtual machines can effectively avoid mutual interference during the processing of each task. In addition, the virtual machine provides a high degree of flexibility and scalability, and can dynamically adjust resources and task allocation according to the needs of the task queue, quickly respond to changes in network status, and achieve refined management and efficient use of resources. In addition, the virtual machine supports smooth upgrades and expansions, ensuring the continuous operation of network equipment and systems, and minimizing the impact on existing services.
[0015] (3) By collecting resource usage data and task description data in real time, using each task description data to build a task graph structure and extracting the dependencies between tasks through a graph neural network, a more accurate task feature matrix is constructed. By integrating resource usage data, a more reliable initial input is provided for the particle swarm optimization model. In a complex network topology and multi-task environment, a near-optimal task allocation solution can be found in a shorter time, which can better balance the needs of each task and achieve more flexible and efficient task scheduling.
[0016] Through this technical solution, virtualization technology, graph neural network and particle swarm optimization model are integrated to construct an efficient, accurate and stable multi-task scheduling optimization method for optical communication devices. The comprehensive analysis of task dependencies can better cope with various abnormal situations in the network, and through the optimization of task scheduling schemes, task conflicts and resource competition can be reduced, significantly improving the efficiency of network resource utilization and the quality of network communication services. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 A flowchart showing an example of a multi-task scheduling optimization method in an optical communication device according to an embodiment of the present application is shown;
[0019] Figure 2 A schematic diagram of the structural connection of an example of a graph neural network according to an embodiment of the present application is shown;
[0020] Figure 3 An operation flow chart of an example of using a hierarchical feature fusion layer to generate a fused feature representation according to an embodiment of the present application is shown;
[0021] Figure 4 A structural block diagram of an example of a multi-task scheduling optimization system in an optical communication device according to an embodiment of the present application is shown;
[0022] Figure 5 It is a schematic structural diagram of an embodiment of an electronic device of the present application. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0024] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved shall comply with the provisions of relevant laws and regulations and shall not violate public order and good morals.
[0025] Figure 1 A flowchart of an example of a multi-task scheduling optimization method in an optical communication device according to an embodiment of the present application is shown.
[0026] Regarding the executor of the method of the embodiment of the present application, it can be any controller or processor with computing or processing capabilities. By integrating virtualization technology, graph neural network technology and particle swarm optimization model, it fully considers various task types and their characteristics in the optical communication network, can adapt to optical communication network scenarios of different scales and complexities, and can effectively improve the scheduling efficiency and service quality of optical communication devices in practical applications.
[0027] In some examples, it can be an optical communication task scheduling platform, and can be integrated and configured in an electronic device, terminal or server through software, hardware or a combination of software and hardware, and the types of terminals, electronic devices or servers can be diverse, such as mobile phones, tablet computers or desktop computers, etc.
[0028] like Figure 1 As shown, in step S110, resource usage data of each virtual machine in the optical communication device is obtained, and task description data corresponding to each task in the task queue is collected.
[0029] In some embodiments, the current resource usage is periodically obtained from each virtual machine in the optical communication device, including bandwidth, computing resources (e.g., CPU utilization), and storage resources (e.g., disk space usage). Exemplarily, a distributed monitoring system or resource management tool (e.g., Prometheus, Nagios) can be used for data collection to ensure the real-time and accuracy of the data.
[0030] On the other hand, the description data of each task in the task queue can be obtained from the task management system. The task description data includes the task type, task priority, task resource requirements (such as required bandwidth, computing resources and storage resources) and the estimated duration of the task. Here, the tasks are classified and managed so that they can be optimized according to the task type during subsequent scheduling. The task type includes any one of the following: real-time data transmission task, batch data transmission task, dynamic resource allocation task, path optimization task, network fault handling task and network upgrade task.
[0031] Through the embodiment of the present application, a virtual machine is deployed in an optical communication device, and the virtual machine is called to process various types of optical communication tasks. When processing real-time data transmission tasks, based on the resource isolation characteristics of the virtual machine, the real-time data transmission tasks are independent of other tasks to avoid mutual interference, which can effectively ensure the quality of real-time transmission tasks such as video conferencing and online games. For batch data transmission tasks, the parallel processing capability of the virtual machine enables batch data transmission tasks to be performed on multiple virtual machines at the same time, improving transmission speed and efficiency. For dynamic resource allocation tasks, the virtual machine dynamically adjusts bandwidth, computing and storage resources according to real-time needs, which can quickly respond to changes in network status and task requirements, ensuring that the system can operate efficiently under different load conditions. For path optimization tasks, the virtual machine dynamically calculates and optimizes the data transmission path according to the network topology and real-time traffic conditions, reduces transmission delays, and improves transmission efficiency. For network fault handling tasks, the real-time monitoring and automatic fault recovery functions of the virtual machine can quickly detect and repair network faults, and can isolate faults through virtual machines to prevent faults from spreading and enhance system stability. For network upgrade tasks, the dynamic migration and resource adjustment of virtual machines can ensure that the impact on existing services is minimized when performing network upgrades, ensuring the continuous operation of the system.
[0032] In step S120, a task graph structure is constructed according to each task description data.
[0033] Here, the task graph structure includes multiple graph nodes and edge connections. The node characteristics of each graph node are defined by the task description data of the corresponding task, and the edge characteristics of each edge connection are defined by the task dependency indicated by the connected graph nodes.
[0034] In some embodiments, each task is represented as a graph node in the task graph, and the characteristics of the node are defined by the task description data, including the task type, priority, resource requirements, and estimated duration. In addition, edge connections are added based on the dependencies between tasks. For example, if task A must be executed after task B is completed, a directed edge is added from task B to task A in the task graph. Edge characteristics may include the dependency type and dependency strength between tasks so that these factors can be considered in subsequent optimization.
[0035] Therefore, by constructing a task graph structure, complex task dependencies are structured in the form of a graph, and the dependencies between tasks are clarified, we can better understand the execution order and degree of dependency of tasks, and provide richer information for scheduling optimization.
[0036] In step S130, the node features of each graph node in the graph structure are updated based on the graph neural network to construct a task feature matrix.
[0037] Here, the type of Graph Neural Network (GNN) can be diverse, such as GAT (Graph Attention Network) or GCN (Graph Convolutional Network), etc. More preferably, the graph neural network adopts a hierarchical attention graph neural network, and more details will be expanded in conjunction with other examples below.
[0038] In some implementations, the current task graph structure is input into a trained graph neural network, the features of each node are updated through multi-layer propagation, and the task feature matrix is output, thereby integrating the global comprehensive features of the task queue into each task, which can adapt to the real-time changing task queue and improve the flexibility and adaptability of the scheduling strategy.
[0039] In step S140 , the task feature matrix and resource usage data of each virtual machine are input into a particle swarm optimization model to determine a target task scheduling scheme for directing each task to a corresponding virtual machine.
[0040] Here, the task feature matrix and the resource usage data of each virtual machine are used to initialize the particle swarm. Each particle in the particle swarm is defined by a corresponding potential task scheduling scheme, which contains the pre-allocation relationship between each task and each virtual machine.
[0041] In some implementations, the task feature matrix and the resource usage data of the virtual machine are used as input to initialize the particle swarm. Each particle represents a potential task scheduling solution, including a pre-allocation relationship between tasks and virtual machines.
[0042] More specifically, the size, inertia weight, acceleration factor and other parameters of the particle swarm can be set to ensure that the particle swarm effectively explores and converges in the search space. In each iteration, the quality of the scheduling plan of each particle is evaluated according to the fitness function, which can include indicators such as task completion time, resource utilization, task priority and service quality. By updating the position and speed of the particles, the particle swarm gradually converges to the global optimal particle, and then outputs the final target task scheduling plan.
[0043] In this embodiment, the particle swarm optimization algorithm can perform global search in multiple dimensions. Based on parallel computing and iterative optimization, the optimal task scheduling solution can be found in a relatively short time, which significantly improves resource utilization, service quality, scheduling flexibility and overall performance, and avoids the problem of local optimality.
[0044] It should be noted that the types of tasks that can be performed by the optical communication device are diverse, and each task may not be independent, and there may be extremely high closeness or high dependence between other tasks. For example, for real-time data transmission tasks such as video transmission, in order to ensure low latency and high reliability, dynamic resource allocation tasks are usually required to adjust bandwidth and computing resources in real time to meet the needs of real-time data transmission.
[0045] In some examples of the embodiments of the present application, after collecting the task description data corresponding to each task in the task queue, at least one task group with task dependencies is extracted from each task according to the task type of each task in the task queue. For each task group, a corresponding task group identifier is marked for each task in the task group, each task group has a corresponding task group identifier, and tasks marked with the same task group identifier in the potential task scheduling scheme are pre-allocated to the same virtual machine.
[0046] More specifically, the task dependency includes at least one of the following: an associated real-time data transmission task and a dynamic resource allocation task, an associated bulk data transmission task and a dynamic resource allocation task, and an associated network fault handling task and a path optimization task.
[0047] Here, by binding the real-time data transmission task and the dynamic resource allocation task in the same virtual machine, it is ensured that the bandwidth and computing resources required by the real-time task can be allocated and adjusted in time, thereby reducing transmission delay and improving transmission efficiency. By binding the batch data transmission task and the dynamic resource allocation task in the same virtual machine, the bandwidth and storage resources can be adjusted in real time during the batch data transmission process to improve the efficiency and reliability of data transmission. For example, the backup task between data centers needs to dynamically adjust the bandwidth and storage resources during off-peak hours to optimize the transmission efficiency. By binding the network fault handling task and the path optimization task in the same virtual machine, when a network fault is detected, the optimal transmission path can be immediately recalculated and selected to ensure the continuity and stability of data transmission. For example, when a transmission path fails, the path optimization task needs to quickly find an alternative path to ensure that data transmission is not interrupted. Through the binding processing of these related tasks, it can be ensured that the task dependencies are met in the case of resource shortage and network status changes, and the task execution efficiency and network performance are improved.
[0048] Through this embodiment, the associated tasks are bound to ensure that the associated tasks are always assigned to the same virtual machine during the optimization process, reducing communication delays and resource contention and conflicts between tasks, and ensuring efficient use of resources. In addition, by binding the associated tasks together, the consistency of the task group during execution can be ensured, and the complexity of scheduling and management can be reduced, thereby improving the efficiency of task execution and the overall service experience.
[0049] In some examples of the embodiments of the present application, the graph neural network adopts a hierarchical attention graph neural network (HA-GNN).
[0050] Figure 2 A schematic diagram of the structural connection of an example of a graph neural network according to an embodiment of the present application is shown.
[0051] like Figure 2 As shown, HA-GNN 200 includes an input layer 210 , a plurality of Hierarchical Attention Graph Neural Modules (HA-GNM) ( 221 , …, 22n ) and an output layer 230 .
[0052] The input layer 210 is used to receive node features of each graph node and edge features of each edge connection.
[0053] Specifically, the input layer provides a basis for subsequent deep feature extraction by receiving the node feature vectors of each task node and the edge features of each edge connection, including task type, resource requirements, estimated duration, task dependencies and other information.
[0054] Multiple HA-GNMs update and fuse node features layer by layer through a hierarchical convolutional structure and attention mechanism to generate a comprehensive feature representation for task scheduling optimization.
[0055] Each HA-GNM contains a local graph convolution layer, a global graph convolution layer, a self-attention mechanism layer, and a hierarchical feature fusion layer to enrich the extracted features from multiple dimensions. As a result, the features of each graph node are updated layer by layer in each HA-GNM, and finally a comprehensive feature representation for task scheduling optimization is generated, which not only considers the features of the graph node itself, but also considers the features of adjacent graph nodes and edge connections, thereby more comprehensively capturing the relationship between nodes, improving the accuracy of feature representation and the optimization effect of task scheduling.
[0056] More specifically, the local graph convolution layer is used to capture the node features of each neighboring graph node and the edge features of each edge connection through the local graph convolution operation to extract the local graph convolution features corresponding to the graph node:
[0057] , formula (1);
[0058] In the formula, For Node In the The local graph convolution features output by the local graph convolution layer in the hierarchical attention graph neural module, For Node Enter the Feature representation of a hierarchical attention map neural module; is the adjacency matrix element, which is based on the node and nodes The edges between them are defined by the edge features; Represents edge connections The edge features of is the vector concatenation operator; For Node The set of neighbor nodes of and Respectively represent the nodes and nodes The number of directly connected edge connections; For the The local graph convolution weight matrix of the hierarchical attention graph neural module, is the activation function.
[0059] The global graph convolution layer is used to capture the edge features of each edge connection of the graph node and the global context information of each graph node through the global graph convolution operation to extract the global graph convolution features corresponding to the graph node:
[0060] , formula (2);
[0061] In the formula, For Node In the The global graph convolution features output by the global graph convolution layer in the hierarchical attention graph neural module, For the adjacency matrix elements Perform softmax normalization processing, M Represents the total number of graph nodes in the task graph structure; For the The global graph convolution weight matrix of the hierarchical attention graph neural module:
[0062] The self-attention mechanism layer is used to calculate the attention weights between the graph node and each neighboring graph node to extract the attention node features corresponding to the graph node:
[0063] , formula (3);
[0064] , formula (4);
[0065] In the formula, For Node and nodes In the The attention weights in the hierarchical attention graph neural module, is the attention weight matrix, represents the transpose of the attention vector, is the LeakyReLU activation function; For Node In the The attention node features output by the self-attention mechanism layer in the hierarchical attention graph neural module.
[0066] The hierarchical feature fusion layer is used to fuse the local graph convolution features, global graph convolution features, and attention node features corresponding to the graph nodes to generate a fused feature representation:
[0067] , formula (5);
[0068] In the formula, For Node In the The fused feature representation output by the hierarchical feature fusion layer in the hierarchical attention graph neural module; , and They respectively represent the local feature fusion weights, global feature fusion weights, and attention feature fusion weights in the fusion weight group.
[0069] Through this embodiment, by fusing node features and edge features, the features of task nodes, including local features and global features, can be more accurately represented. Local features can ensure the accuracy of feature representation, and global feature fusion can help identify and reduce redundancy and contention in resource allocation, so that the final feature representation can better reflect the dependencies and resource requirements between tasks, which helps to optimize scheduling decisions.
[0070] The output layer 230 is used to generate the final node feature representation for each graph node, and can be fused to obtain a task feature matrix to achieve a global feature expression of the tasks in the task queue.
[0071] More specifically, the output layer is used to construct the task feature matrix based on the updated feature representations of each node:
[0072] , formula (6);
[0073] , formula (7);
[0074] In the formula, L represents the total number of neural modules of the hierarchical attention map, represents the task feature matrix, The last hierarchical attention graph neural module targets the graph nodes The output fusion feature representation.
[0075] Through the structural design of HA-GNN provided in this embodiment, node features and edge features are integrated, task dependencies and node information are accurately modeled, the accuracy of feature representation is improved, all node features are comprehensively processed, and a task feature matrix is constructed to provide comprehensive information for task scheduling optimization, which can effectively reduce delays and conflicts in task execution and improve optimization effects.
[0076] Figure 3 An operational flowchart of an example of using a hierarchical feature fusion layer to generate a fused feature representation according to an embodiment of the present application is shown.
[0077] like Figure 3 As shown, in step S310, a fusion weight group matching the task type corresponding to the graph node is determined.
[0078] In some implementations, corresponding fusion weight groups are pre-configured for various task types, so that feature fusion in different tasks and environments is more targeted.
[0079] More specifically, in the fusion weight group corresponding to the real-time data transmission task, the local feature fusion weight is the largest, because the real-time task is highly dependent on the information of neighboring nodes and requires a quick response. In the fusion weight group corresponding to the batch data transmission task, the attention feature fusion weight is the largest, because the batch data transmission task needs to consider the global resource allocation and the status of key nodes. In the fusion weight group corresponding to the dynamic resource allocation task, the global feature fusion weight is the largest, because dynamic resource allocation needs to consider the resource utilization of the entire network. In the fusion weight group corresponding to the path optimization task, the local feature fusion weight is the largest, because path optimization needs to consider the local connection and path between nodes. In the fusion weight group corresponding to the network fault handling task, the attention feature fusion weight is the largest, because network fault handling needs to pay attention to the status and dependencies of key nodes. In the fusion weight group corresponding to the network upgrade task, the global feature fusion weight is the largest, because the network upgrade task needs to consider the global network topology and resource allocation.
[0080] In step S320, the local graph convolution features, global graph convolution features and attention node features corresponding to the graph nodes are fused according to the matched fusion weight group to generate a fused feature representation.
[0081] Through the adaptive fusion weight mechanism adopted in the embodiment of the present application, the feature fusion weight is dynamically adjusted. By adaptively fusing local features, global features and attention features, the features of the task nodes can be more accurately represented, and the dependencies and resource requirements between tasks can be better reflected, ensuring the stability of the system under different load and resource conditions. The fusion weight is dynamically adjusted according to different task types, and by comprehensively considering local features, global features and attention features, the optimal scheduling allocation that comprehensively considers the task type and virtual machine resources is achieved.
[0082] In some examples of the embodiments of the present application, the particle swarm optimization model is used to complete the optimization process by performing the following operations.
[0083] Each particle in the particle swarm is configured with a corresponding position vector and velocity vector to represent the characteristic vector and change trend of the corresponding potential task scheduling scheme, respectively. The formula is:
[0084] , formula (8);
[0085] , formula (9);
[0086] In the formula, Indicates The particle in The position vector at the iteration represents the feature vector of the task scheduling scheme; Indicates The particle in The velocity vector at the iteration time indicates the changing trend of the task scheduling scheme; The data dimension of the task scheduling plan.
[0087] By introducing adaptive inertia weight, the algorithm has different search capabilities at different stages. The corresponding inertia weight adjustment formula is:
[0088] , formula (10);
[0089] In the formula, Indicates The inertia weight at the iteration; and are the maximum and minimum values of the inertia weight respectively; Indicates the maximum number of iterations.
[0090] In this way, the inertia weight is dynamically adjusted from large to small, improving the global search capability in the early stage and the local search capability in the later stage.
[0091] During each iteration, the positions and velocities of the particles in the swarm are updated:
[0092] , formula (11);
[0093] , formula (12);
[0094] In the formula, For the The particle in The speed at the iteration; For the The particle in The position at the iteration; and is the learning factor, which controls the weight of the particle accelerating toward the individual optimal solution and the global optimal solution; and is a random number between 0 and 1; For the The particle in The individual optimal position at the iteration; For all particles in The global optimal position of the iteration.
[0095] Through this embodiment, based on the adaptive inertia weight and dynamic adjustment strategy, a global search can be quickly performed in the initial stage, and a local search can be concentrated in the later stage, so as to find the global optimal solution more quickly and improve the efficiency of task scheduling.
[0096] Perform population crossover or population mutation operations:
[0097] , formula (13);
[0098] , formula (14);
[0099] In the formula, and Respectively represent The particle in The position determined by crossover and mutation at the first iteration; Indicates The particle in The position of the iteration, For the Another particle randomly selected from the population in the iteration location; and are the parameters in crossover and mutation operations; and represent the crossover probability and mutation probability respectively; is the best position in the current population.
[0100] Through this embodiment, by introducing population crossover and mutation operations, the diversity of the population is improved, and the particle swarm is prevented from falling into the local optimal solution. At the same time, the elite particle retention strategy ensures the continuous existence of high-quality solutions, further enhancing the robustness and stability of the scheduling scheme.
[0101] After each iteration, the top one with the highest fitness is selected. Particles act as elite particles.
[0102] It should be understood that the fitness function can be implemented using various current related index evaluation functions or simulation evaluation software modules, such as evaluation functions of comprehensive resource utilization, task completion time, and service quality, which are not limited here. Furthermore, in the process of practicing this application, various index evaluation functions are also optimized and improved, and more details will be expanded in conjunction with other examples below.
[0103] At the beginning of the next iteration, the elite particles are directly retained without updating their speed and position.
[0104] Therefore, after each iteration, by retaining the elite particles with the highest fitness, the stability and continuity of the optimal solution can be ensured, preventing it from being replaced by new suboptimal solutions, improving the quality of the solution, and accelerating the convergence process.
[0105] If in continuous Z In each iteration, there are , then it is determined that the convergence judgment condition is met, and according to the The global optimal position output by the iteration Determine the target task scheduling plan; Represents the preset fitness change threshold, Indicates that the particle swarm is The fitness function value corresponding to the global optimal position of the iteration.
[0106] In this way, by judging whether the algorithm has converged through the change in fitness of continuous iterations, premature stopping can be avoided, while ensuring that the solution found is optimal, thereby enhancing the robustness of the optimization process.
[0107] Through the structural design of the particle swarm optimization model in the embodiment of the present application, the adaptive inertia weight and elite particle retention strategy are comprehensively utilized to improve the convergence speed of the algorithm, and it is possible to find the optimal or near-optimal task scheduling solution in a relatively short time and adapt to the rapidly changing network environment. As a result, the efficiency, resource utilization and service quality of task scheduling in the multi-task scheduling optimization scenario of the optical communication device can be significantly improved, the robustness and flexibility of the scheduling solution can be enhanced, and efficient multi-task collaborative processing can be achieved.
[0108] It should be noted that the task group binding mechanism is considered when generating candidate solutions to ensure that tasks with dependencies can be executed on the same virtual machine, reduce the communication overhead between tasks, and improve the efficiency and stability of scheduling. Therefore, in order to ensure or encourage the final task scheduling solution to allocate the above-mentioned tasks with task dependencies to the same virtual machine, the fitness function can be improved and optimized. In addition, when designing the fitness function, multiple factors such as maximizing task execution efficiency and optimizing resource utilization should also be considered comprehensively.
[0109] In some examples of the embodiments of the present application, the fitness function of the particle swarm optimization model is determined in the following manner:
[0110] , formula (15);
[0111] In the formula, For the The position of the particle The corresponding fitness value; Indicates that the task is at location The task execution efficiency under the indicated scheduling scheme, Indicates that the task is at location The degree of task dependency violation under the indicated scheduling scheme, Indicates that the task is at location the degree of resource constraint violation under the indicated scheduling scheme; The parameters are used to balance the impact of each part on the fitness, and can be adjusted according to actual needs, so that the scheduling scheme can dynamically adapt to the task requirements of different business scenarios and priorities, and improve the flexibility and adaptability of the system. Therefore, by comprehensively considering the task execution efficiency, dependencies, and resource constraints, the pros and cons of the task scheduling scheme are comprehensively evaluated. For example, the larger the fitness value, the better the task scheduling scheme for the corresponding particle or the current position of the particle.
[0112] Task execution efficiency refers to the execution of tasks under the scheduling scheme, which can be evaluated by calculating the completion time and throughput of the tasks.
[0113] , formula (16);
[0114] In the formula, For all tasks at location The total time to complete the indicated schedule, For location The task throughput under the indicated scheduling scheme.
[0115] The degree of task dependency violation measures the violation of dependencies between tasks under the scheduling scheme, which can be evaluated by calculating the number of violations and delays of task dependencies.
[0116] , formula (17);
[0117] In the formula, is a set of task dependencies, Indicates the task and The dependencies between them; is a binary variable. If the task and If the dependency between ,otherwise ; For the task and The delay time of the dependency relationship between them.
[0118] The resource constraint violation degree measures the usage of resources by tasks under the scheduling scheme, which can be evaluated by calculating the over-allocation of resources.
[0119] , formula (18);
[0120] In the formula, is a collection of resource types. For resources In the scheduling plan The usage of For resources The maximum available capacity.
[0121] Through the embodiments of the present application, the task execution efficiency, task dependencies and resource constraints are comprehensively considered in the fitness function, and each task scheduling scheme is comprehensively evaluated to ensure the balance and optimization of various aspects. By maximizing the task execution efficiency, it is ensured that the tasks are completed at the fastest speed and the efficiency of the overall system is improved. By optimizing resource utilization, the reasonable allocation of bandwidth, computing and storage resources is ensured to avoid resource waste and conflicts. By including the calculation of the degree of violation of task dependencies in the fitness function, it is ensured that in the final optimized scheduling scheme, tasks with dependencies are executed on the same virtual machine, reducing communication delays between tasks and improving the reliability and stability of task scheduling. Therefore, through the design of the above-mentioned fitness function, it is possible to effectively improve service quality and user satisfaction, and provide users with faster and more stable services.
[0122] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of actions combined, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application. In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0123] Figure 4 A structural block diagram of an example of a multi-task scheduling optimization system in an optical communication device according to an embodiment of the present application is shown.
[0124] like Figure 4 As shown, the multi-task scheduling optimization system 400 in the optical communication device includes a data acquisition unit 410, a graph structure construction unit 420, a task matrix construction unit 430 and a task scheduling optimization unit 440.
[0125] The data acquisition unit 410 is used to obtain resource usage data of each virtual machine in the optical communication device, and collect task description data corresponding to each task in the task queue; the resource types corresponding to the resource usage data include bandwidth resources, computing resources and storage resources; the task description data includes task type, task priority, task resource requirements and task estimated duration; the task type includes any one of the following: real-time data transmission task, batch data transmission task, dynamic resource allocation task, path optimization task, network fault handling task and network upgrade task.
[0126] The graph structure construction unit 420 is used to construct a task graph structure based on each of the task description data; the task graph structure includes multiple graph nodes and edge connections, the node characteristics of each graph node are defined by the task description data of the corresponding task, and the edge characteristics of each edge connection are defined by the task dependency indicated by the connected graph nodes.
[0127] The task matrix construction unit 430 is used to update the node features of each graph node in the graph structure based on the graph neural network to construct a task feature matrix.
[0128] The task scheduling optimization unit 440 is used to input the task feature matrix and the resource usage data of each virtual machine into the particle swarm optimization model to determine the target task scheduling scheme for directing each of the tasks to the corresponding virtual machine; the task feature matrix and the resource usage data of each virtual machine are used to initialize the particle swarm, and each particle in the particle swarm is defined by a corresponding potential task scheduling scheme, and the potential task scheduling scheme contains a pre-allocated relationship between each of the tasks and each of the virtual machines.
[0129] In some embodiments, an embodiment of the present application provides a non-volatile computer-readable storage medium, in which one or more programs including execution instructions are stored, and the execution instructions can be read and executed by an electronic device (including but not limited to a computer, a server, or a network device, etc.) to execute the steps of the multi-task scheduling optimization method in any of the above-mentioned optical communication devices of the present application.
[0130] In some embodiments, the embodiments of the present application also provide a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the steps of any one of the above-mentioned multi-task scheduling optimization methods in an optical communication device.
[0131] In some embodiments, the embodiments of the present application also provide an electronic device, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the steps of the multi-task scheduling optimization method in an optical communication device.
[0132] Figure 5 is a schematic diagram of the hardware structure of an electronic device for executing a multi-task scheduling optimization method in an optical communication device provided by another embodiment of the present application, such as Figure 5 As shown, the device includes:
[0133] One or more processors 510 and memory 520, Figure 5 A processor 510 is taken as an example.
[0134] The device for executing the multi-task scheduling optimization method in the optical communication device may further include: an input device 530 and an output device 540 .
[0135] The processor 510, the memory 520, the input device 530 and the output device 540 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.
[0136] The memory 520, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the multi-task scheduling optimization method in the optical communication device in the embodiment of the present application. The processor 510 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 520, that is, the multi-task scheduling optimization method in the optical communication device in the above method embodiment is implemented.
[0137] The memory 520 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 520 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 520 may optionally include a memory remotely arranged relative to the processor 510, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0138] The input device 530 may receive input digital or character information and generate signals related to user settings and function control of the electronic device. The output device 540 may include a display device such as a display screen.
[0139] The one or more modules are stored in the memory 520, and when executed by the one or more processors 510, the multi-task scheduling optimization method in the optical communication device in any of the above method embodiments is executed.
[0140] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present application.
[0141] The electronic devices of the embodiments of the present application exist in various forms, including but not limited to:
[0142] (1) Mobile communication equipment: This type of equipment is characterized by having mobile communication functions and its main purpose is to provide voice and data communications. This type of terminal includes: smart phones, multimedia phones, functional phones, and low-end phones.
[0143] (2) Ultra-mobile personal computer devices: These devices belong to the category of personal computers, have computing and processing functions, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, etc.
[0144] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players, handheld game consoles, e-books, smart toys, and portable car navigation devices.
[0145] (4) Other onboard electronic devices with data interaction functions, such as on-board devices installed in vehicles.
[0146] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0147] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the relevant technology, can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.
[0148] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A multi-task scheduling optimization method in an optical communication device, comprising: Obtain resource usage data of each virtual machine in the optical communication device, and collect task description data corresponding to each task in the task queue; The resource types corresponding to the resource usage data include bandwidth resources, computing resources and storage resources; the task description data includes task type, task priority, task resource requirements and task estimated duration; the task type includes any one of the following: real-time data transmission task, batch data transmission task, dynamic resource allocation task, path optimization task, network fault handling task and network upgrade task; Constructing a task graph structure according to each of the task description data; the task graph structure comprises a plurality of graph nodes and edge connections, the node characteristics of each graph node are respectively defined by the task description data of the corresponding task, and the edge characteristics of each edge connection are respectively defined by the task dependency relationship indicated by the connected graph nodes; Based on the graph neural network, the node features of each graph node in the graph structure are updated to construct a task feature matrix; Inputting the task feature matrix and the resource usage data of each virtual machine into a particle swarm optimization model to determine a target task scheduling scheme for directing each of the tasks to the corresponding virtual machine; the task feature matrix and the resource usage data of each virtual machine are used to initialize a particle swarm, each particle in the particle swarm is defined by a corresponding potential task scheduling scheme, and the potential task scheduling scheme includes a pre-allocated relationship between each of the tasks and each of the virtual machines; After collecting the task description data corresponding to each task in the task queue, the method further includes: According to the task type of each task in the task queue, extracting at least one task group having a task dependency relationship from each task; For each of the task groups, a corresponding task group identifier is marked for each task in the task group; each task group has a corresponding task group identifier; Among them, tasks marked with the same task group identifier in the potential task scheduling scheme are pre-allocated to the same virtual machine; The task dependency relationship includes at least one of the following: an associated real-time data transmission task and a dynamic resource allocation task, an associated bulk data transmission task and a dynamic resource allocation task, and an associated network fault handling task and a path optimization task.
2. The method according to claim 1, wherein: The graph neural network adopts a hierarchical attention graph neural network, which includes a cascaded input layer, multiple hierarchical attention graph neural modules and an output layer; the hierarchical attention graph neural module includes a local graph convolution layer, a global graph convolution layer, a self-attention mechanism layer and a hierarchical feature fusion layer; The input layer is used to receive node features of each graph node and edge features of each edge connection; The local graph convolution layer is used to capture the node features of each neighboring graph node and the edge features of each edge connection of the graph node through the local graph convolution operation, so as to extract the local graph convolution features corresponding to the graph node: In the formula, For Node In the The local graph convolution features output by the local graph convolution layer in the hierarchical attention graph neural module, For Node Enter the Feature representation of a hierarchical attention map neural module; is the adjacency matrix element, which is based on the node and nodes The edges between them are defined by the edge features; Represents edge connections The edge features of is the vector concatenation operator; For Node The set of neighbor nodes of and Respectively represent the nodes and nodes The number of directly connected edge connections; For the The local graph convolution weight matrix of the hierarchical attention graph neural module, is the activation function; The global graph convolution layer is used to capture the edge features of each edge connection of the graph node and the global context information of each graph node through the global graph convolution operation, so as to extract the global graph convolution features corresponding to the graph node: In the formula, For Node In the The global graph convolution features output by the global graph convolution layer in the hierarchical attention graph neural module, For the adjacency matrix elements Perform softmax normalization processing, Represents the total number of graph nodes in the task graph structure; For the The global graph convolution weight matrix of the hierarchical attention graph neural module; The self-attention mechanism layer is used to calculate the attention weights between the graph node and each neighboring graph node to extract the attention node features corresponding to the graph node: In the formula, For Node and nodes In the The attention weights in the hierarchical attention graph neural module, is the attention weight matrix, represents the transpose of the attention vector, is the LeakyReLU activation function; For Node In the The attention node features output by the self-attention mechanism layer in the hierarchical attention graph neural module; The hierarchical feature fusion layer is used to fuse the local graph convolution features, global graph convolution features and attention node features corresponding to the graph nodes to generate a fused feature representation: In the formula, For Node In the The fused feature representation output by the hierarchical feature fusion layer in the hierarchical attention graph neural module; , and They represent the local feature fusion weight, global feature fusion weight, and attention feature fusion weight in the fusion weight group respectively; The output layer is used to construct a task feature matrix according to the updated feature representations of each node: In the formula, represents the total number of neural modules of the hierarchical attention map, represents the task feature matrix, It is the fused feature representation output by the last hierarchical attention graph neural module for the graph node.
3. The method according to claim 2, wherein: The hierarchical feature fusion layer is used to generate a fused feature representation by performing the following operations, including: Determine the fusion weight group that matches the task type corresponding to the graph node; among them, in the fusion weight group corresponding to the real-time data transmission task, the local feature fusion weight is the largest; in the fusion weight group corresponding to the batch data transmission task, the attention feature fusion weight is the largest; in the fusion weight group corresponding to the dynamic resource allocation task, the global feature fusion weight is the largest; in the fusion weight group corresponding to the path optimization task, the local feature fusion weight is the largest; in the fusion weight group corresponding to the network fault handling task, the attention feature fusion weight is the largest; in the fusion weight group corresponding to the network upgrade task, the global feature fusion weight is the largest; The local graph convolution features, global graph convolution features and attention node features corresponding to the graph nodes are fused according to the matching fusion weight group to generate a fused feature representation.
4. The method according to claim 3, wherein: The particle swarm optimization model is used to perform the following operations: Each particle in the particle swarm is configured with a corresponding position vector and velocity vector to represent the characteristic vector and change trend of the corresponding potential task scheduling scheme, respectively. The formula is: In the formula, Indicates The particle in The position vector at the iteration represents the feature vector of the task scheduling scheme; Indicates The particle in The velocity vector at the iteration time indicates the changing trend of the task scheduling scheme; The data dimension of the task scheduling solution; By introducing adaptive inertia weight, the algorithm has different search capabilities at different stages. The corresponding inertia weight adjustment formula is: In the formula, Indicates The inertia weight at the iteration; and are the maximum and minimum values of the inertia weight respectively; Indicates the maximum number of iterations; During each iteration, the positions and velocities of the particles in the swarm are updated: In the formula, For the The particle in The speed at the iteration; For the The particle in The position at the iteration; and is the learning factor, which controls the weight of the particle accelerating toward the individual optimal solution and the global optimal solution; and is a random number between 0 and 1; For the The particle in The individual optimal position at the iteration; For all particles in The global optimal position of the iteration; Perform population crossover or population mutation operations: In the formula, and Respectively represent The particle in The position determined by crossover and mutation at the first iteration; Indicates The particle in The position of the iteration, For the Another particle randomly selected from the population in the iteration location; and are the parameters in crossover and mutation operations; and represent the crossover probability and mutation probability respectively; is the best position in the current population; After each iteration, the top one with the highest fitness is selected. Particles as elite particles; At the beginning of the next iteration, the elite particles are directly retained without updating their speed and position; If in continuous In each iteration, there are , then it is determined that the convergence judgment condition is met, and according to the The global optimal position output by the iteration Determine the target task scheduling plan; Represents the preset fitness change threshold, Indicates that the particle swarm is The fitness function value corresponding to the global optimal position of the iteration.
5. The method according to claim 4, wherein: The fitness function of the particle swarm optimization model is determined in the following way: In the formula, For the The position of the particle The corresponding fitness value; Indicates that the task is at location The task execution efficiency under the indicated scheduling scheme, Indicates that the task is at location The degree of task dependency violation under the indicated scheduling scheme, Indicates that the task is at location the degree of resource constraint violation under the indicated scheduling scheme; It is an adjustment parameter used to balance the impact of each part on fitness; In the formula, For all tasks at location The total time to complete the indicated schedule, For location The task throughput under the indicated scheduling scheme; In the formula, is a set of task dependencies, Indicates the task and The dependencies between them; is a binary variable. If the task and If the dependency between ,otherwise ; For the task and The delay time of the dependencies between them; In the formula, is a collection of resource types. For resources In the scheduling plan The usage of For resources The maximum available capacity.
6. A multi-task scheduling optimization system in an optical communication device, used to implement the multi-task scheduling optimization method in an optical communication device according to any one of claims 1 to 5; the system comprises: A data acquisition unit, used to acquire resource usage data of each virtual machine in the optical communication device, and collect task description data corresponding to each task in the task queue; The resource types corresponding to the resource usage data include bandwidth resources, computing resources and storage resources; the task description data includes task type, task priority, task resource requirements and task estimated duration; the task type includes any one of the following: real-time data transmission task, batch data transmission task, dynamic resource allocation task, path optimization task, network fault handling task and network upgrade task; A graph structure construction unit, configured to construct a task graph structure according to each of the task description data; the task graph structure comprises a plurality of graph nodes and edge connections, the node characteristics of each graph node are respectively defined by the task description data of the corresponding task, and the edge characteristics of each edge connection are respectively defined by the task dependency relationship indicated by the connected graph nodes; A task matrix construction unit, used for updating the node features of each graph node in the graph structure based on the graph neural network to construct a task feature matrix; The task scheduling optimization unit is used to input the task feature matrix and the resource usage data of each virtual machine into the particle swarm optimization model to determine a target task scheduling scheme for directing each of the tasks to the corresponding virtual machine; the task feature matrix and the resource usage data of each virtual machine are used to initialize a particle swarm, each particle in the particle swarm is defined by a corresponding potential task scheduling scheme, and the potential task scheduling scheme contains a pre-allocated relationship between each of the tasks and each of the virtual machines.
