A virtual machine flow control method and device based on priority perception and cooperative scheduling

By constructing a task dependency graph and performing dynamic priority calculation, combined with a virtual flow control switch, the shortcomings of traditional virtual machine traffic control methods in complex task dependencies and SR-IOV passthrough environments are addressed. This enables adaptive bandwidth allocation and traffic management, improving network resource utilization and service stability.

CN123123294APending Publication Date: 2026-11-17JINAN INSPUR DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611441355.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-16
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Traditional virtual machine traffic control methods cannot adapt to dynamic and ever-changing workloads and complex task dependencies, resulting in unreasonable bandwidth allocation, affecting system performance and stability. In particular, they cannot effectively control traffic in SR-IOV passthrough technology environments and lack task awareness and hidden channel protection.

Method used

By parsing the metadata of virtual machine tasks to construct a task dependency graph, dynamically calculating task priorities, and using virtual flow control switches to achieve flow control, the software-defined networking approach requires no specific hardware support. It generates bandwidth allocation strategies based on the criticality and dependency strength of tasks, and performs rate limiting or shaping operations.

Benefits of technology

It achieves fine-grained, adaptive virtual machine bandwidth allocation, improves network resource utilization, ensures the performance stability of critical business links, solves the limitations of traditional flow control solutions, and adapts to complex task dependencies and SR-IOV passthrough scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123123294A_ABST
    Figure CN123123294A_ABST
Patent Text Reader

Abstract

The application discloses a virtual machine flow control method and device based on priority awareness and cooperative scheduling, and relates to the technical field of cloud computing virtualization. The method comprises the following steps: analyzing the metadata of tasks running in a virtual machine, and constructing a task dependency graph representing the logical dependency relationship among the tasks; monitoring the execution progress state of each task, combining the criticality of the task and the dependency strength of the task in the task dependency graph, and dynamically calculating the real-time priority of each task; generating a bandwidth allocation strategy for each virtual machine according to the real-time priority, and determining the corresponding traffic control parameters of each virtual machine; intercepting the network traffic of the virtual machine through a virtual flow control switch, and performing a speed limiting or shaping operation on the intercepted network traffic according to the traffic control parameters. The application can dynamically adjust the traffic priority of the virtual machine based on the task dependency relationship and the real-time progress, realize fine-grained adaptive bandwidth allocation, and improve the resource utilization rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing virtualization technology, and in particular to a virtual machine flow control method and apparatus based on priority awareness and collaborative scheduling. Background Technology

[0002] With the widespread application of cloud computing and virtualization technologies, deploying multiple virtual machines on a single physical host has become the mainstream architecture. However, the limited network bandwidth and computing resources of shared hosts make traffic control between virtual machines a critical challenge. Traditional flow control methods mainly employ static bandwidth allocation or simple priority scheduling, which cannot adapt to dynamically changing workloads and complex task dependencies. Existing technologies have several significant limitations: first, coarse-grained flow control struggles to meet diverse application needs; second, they lack task awareness and cannot identify dependencies between tasks; and third, they are highly hardware-dependent, with many solutions requiring specific hardware support. Especially in pass-through technology environments such as SR-IOV, where data directly enters the virtual machine without passing through the physical machine's virtualized network processing, traditional flow control mechanisms completely fail. Furthermore, information leakage may occur between virtual machines through hidden channels, and existing flow control solutions lack effective protection. In virtual desktop infrastructure environments, all network traffic generated by user activity appears as a uniform data stream. Flow control devices cannot distinguish whether these data streams are generated by office applications, video streams, or other applications, thus making precise bandwidth allocation impossible. This limitation leads to performance degradation in critical applications due to insufficient bandwidth, while non-critical applications may consume excessive bandwidth. Summary of the Invention

[0003] The main purpose of this application is to provide a virtual machine flow control method based on priority awareness and cooperative scheduling.

[0004] Another objective of this application is to propose a virtual machine flow control device based on priority awareness and collaborative scheduling.

[0005] The third objective of this application is to propose an electronic device.

[0006] The fourth objective of this application is to provide a non-transitory computer-readable storage medium.

[0007] To achieve the above objectives, the first aspect of this application proposes a virtual machine flow control method based on priority awareness and cooperative scheduling, comprising: S1, parse the metadata of the tasks running in the virtual machine and construct a task dependency graph that represents the logical dependencies between tasks; S2, monitor the execution progress status of each task, and dynamically calculate the real-time priority of each task based on the criticality of the task and the dependence strength in the task dependency graph. S3, Generate a bandwidth allocation strategy for each virtual machine based on the real-time priority, and determine the traffic control parameters corresponding to each virtual machine; S4. The network traffic of the virtual machine is intercepted through the virtual flow control switch, and the intercepted network traffic is rate-limited or reshaped according to the flow control parameters.

[0008] In one embodiment of this application, parsing the metadata of tasks running in the virtual machine and constructing a task dependency graph representing the logical dependencies between tasks includes: Extract task feature information, including task type, input and output resources, and expected execution time, and analyze historical execution records of the task to identify common dependency patterns; A preliminary task dependency graph is constructed based on the identified dependency patterns, where nodes represent tasks and edges represent dependencies, including Finish-Start, Start-Start, or Finish-Finish types. Calculate the dependency strength between tasks in the preliminary task dependency graph, verify the rationality of the dependencies to remove erroneous dependencies, and output the final task dependency graph.

[0009] In one embodiment of this application, the step of monitoring the execution progress status of each task and dynamically calculating the real-time priority of each task, based on the criticality of the task and the dependency strength in the task dependency graph, includes: Obtain the initial criticality of each task. The Determined based on service level agreement, business priority, application type, or data sensitivity, with a value range from 0 to 1; Real-time monitoring of the execution progress of each task to calculate the task progress ratio. The This indicates the proportion of the task that has been completed to the total workload, and its value ranges from 0 to 1. Read the dependency strength of each task from the task dependency graph. And call the preset weighting coefficients. , and ,in ; Based on the above , and Execute the priority calculation function to generate the real-time priority of each task. The calculation formula is: .

[0010] In one embodiment of this application, the step of generating a bandwidth allocation strategy for each virtual machine based on the real-time priority and determining the traffic control parameters corresponding to each virtual machine includes: The total priority value is obtained by summing the real-time priorities of all running tasks. For each virtual machine, divide its corresponding task real-time priority by the total priority value to obtain the bandwidth allocation ratio for that virtual machine; obtain the total available bandwidth value of the physical host, and multiply the total available bandwidth value by the bandwidth allocation ratio to obtain the target bandwidth value for that virtual machine. The target bandwidth value is determined as the rate limiting threshold in the traffic control parameters of the virtual machine, and a bandwidth allocation strategy containing the rate limiting threshold is generated.

[0011] In one embodiment of this application, the step of intercepting network traffic of virtual machines via a virtual flow control switch and performing rate limiting or shaping operations on the intercepted network traffic according to the flow control parameters includes: Configure the mirror port of the virtual flow control switch to copy the original network traffic of the virtual machine to be controlled to obtain mirror traffic; The mirrored traffic is sent to the central flow controller via tunneling technology. The central flow controller analyzes the traffic characteristics and calculates a flow control strategy that includes rate limiting or shaping instructions based on the task status. The flow control policy is distributed to the virtual flow control switches on each host. The virtual flow control switches directly perform rate limiting or shaping operations on the original network traffic on the data forwarding path. The operations do not depend on the hardware support of a specific model of physical switch.

[0012] To achieve the above objectives, a second aspect of this application proposes a virtual machine flow control device based on priority awareness and cooperative scheduling, comprising: The parsing module is used to parse the metadata of tasks running in the virtual machine and construct a task dependency graph that represents the logical dependencies between tasks. The monitoring module is used to monitor the execution progress status of each task and dynamically calculate the real-time priority of each task based on the criticality of the task and the dependence strength in the task dependency graph. The allocation module is used to generate a bandwidth allocation strategy for each virtual machine based on the real-time priority and to determine the traffic control parameters corresponding to each virtual machine. The execution module is used to intercept network traffic of virtual machines through a virtual flow control switch, and to perform rate limiting or shaping operations on the intercepted network traffic according to the flow control parameters.

[0013] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0014] To achieve the above objectives, a third aspect of this application provides an electronic device, including a processor and a memory; wherein the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory, for implementing the virtual machine flow control method based on priority awareness and cooperative scheduling as described in the first aspect embodiment.

[0015] To achieve the above objectives, a fourth aspect of this application provides a non-transitory computer-readable storage medium storing a computer program that, when executed by a processor, implements the virtual machine flow control method based on priority awareness and cooperative scheduling as described in the first aspect embodiment.

[0016] The embodiments of this application have the following beneficial effects: This application achieves fine-grained and adaptive virtual machine bandwidth allocation by parsing task dependencies and dynamically adjusting priorities based on real-time progress. This effectively solves the problem that traditional static flow control cannot handle complex task dependencies and SR-IOV passthrough scenarios. This solution significantly improves network resource utilization and ensures the performance stability of critical business links without requiring specific hardware support. Attached Figure Description

[0017] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 A flowchart illustrating a virtual machine flow control method based on priority awareness and cooperative scheduling, provided for an embodiment of this application; Figure 2 This is a task dependency graph of a virtual machine flow control method based on priority awareness and cooperative scheduling according to an embodiment of this application; Figure 3 This is a structural diagram of a virtual machine flow control device based on priority awareness and collaborative scheduling, provided in an embodiment of this application. Detailed Implementation

[0018] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0019] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0020] The virtual machine flow control method and apparatus based on priority awareness and cooperative scheduling proposed in this application are described below with reference to the accompanying drawings.

[0021] Example 1 This application provides a virtual machine flow control method based on priority awareness and cooperative scheduling, such as... Figure 1 As shown, the method includes the following steps: S1: Parse the metadata of the tasks running in the virtual machine and construct a task dependency graph that represents the logical dependencies between tasks.

[0022] To address the issue of traditional flow control schemes neglecting the logical relationships between tasks, this application introduces a task dependency graph model and designs a parsing algorithm to construct and optimize task dependencies to support dynamic adjustment of traffic priorities.

[0023] In this application, we comprehensively improve upon the shortcomings of traditional flow control schemes. Traditional flow control schemes typically only consider basic parameters such as network bandwidth, while severely neglecting the complex logical relationships between different tasks. This can easily lead to problems such as unreasonable resource allocation and disordered task execution timing during traffic scheduling, thereby affecting the overall system's operating efficiency and stability. To address this, we introduce a task dependency graph model, aiming to accurately describe the various dependencies between virtual machine tasks in a formal way, providing a solid theoretical foundation and structural support for intelligent traffic management.

[0024] In this embodiment of the application, the system first defines a standardized set of tasks and virtual machines, wherein the set of virtual machines is represented as follows: The task set is represented as Based on this, three core task dependency expressions are defined: {Finish-Start, Start-Start, Finish-Finish}. These three types of dependencies comprehensively cover various temporal correlation scenarios that may occur during task execution, such as sequential startup and termination. Based on these clearly defined dependencies, this application can construct a clearly structured task dependency graph. In this graph, nodes specifically represent various tasks in the system, while edges represent the specific dependencies between tasks, thus intuitively presenting the abstract task logic connections.

[0025] In this application embodiment, a dedicated task dependency parsing algorithm is designed to automatically construct and maintain the task dependency graph. The core process of this algorithm begins with parsing task metadata. The system automatically extracts the characteristic information of each task, including key elements such as task type attributes, details of input and output resources required for task execution, and expected execution time parameters. Subsequently, the system deeply analyzes the historical execution records of the tasks. Through mining and learning from a large amount of historical data, it identifies common dependency patterns in past task executions, such as which tasks typically start only after the previous task is completed, and which tasks start synchronously. This serves as an important basis for constructing the task dependency graph.

[0026] In this embodiment, after initial dependency identification, the algorithm further calculates the dependency strength between tasks. This strength index quantifies the tightness of the dependency relationship between tasks, providing a quantitative reference for subsequent dynamic adjustment of traffic priorities. Next, the system verifies the rationality of the identified dependencies. Through preset rules and logical judgments, it checks whether the constructed dependency relationships conform to business logic and system operation specifications. For erroneous dependencies discovered during the verification process, the system removes them promptly to ensure the accuracy and effectiveness of the task dependency graph. Finally, after the above series of parsing, calculation, verification, and correction steps, the system outputs the final task dependency graph, providing accurate and reliable structural support for subsequent dynamic traffic scheduling and management.

[0027] In this embodiment, by parsing task metadata, mining inter-task dependencies and verifying optimizations, a task dependency graph is constructed and a parsing algorithm is designed to achieve accurate sorting and verification of logical relationships between tasks, providing reliable support for dynamic adjustment of flow control priorities.

[0028] S2 monitors the execution progress status of each task and dynamically calculates the real-time priority of each task based on the criticality of the task and the dependence strength in the task dependency graph.

[0029] To achieve more reasonable virtual machine task scheduling, this application constructs a dynamic priority calculation method by comprehensively considering task criticality, progress, and dependency strength, and accurately allocates task execution weights.

[0030] In the embodiments of this application, a dynamic priority scheduling algorithm is used to schedule the traffic and execution of virtual machine tasks. This algorithm comprehensively considers the criticality of tasks, the progress of task execution, and the strength of dependencies between tasks to achieve fine-grained and dynamic allocation of task priorities, avoiding the problems of unreasonable resource allocation and execution blocking caused by traditional fixed priority scheduling methods.

[0031] In this embodiment, the system pre-assigns an initial priority value to each virtual machine task and dynamically adjusts it based on the real-time running status during task execution, thereby ensuring that critical tasks and highly dependent tasks can obtain network and computing resources first.

[0032] In this embodiment, a unified priority calculation function is defined, the specific expression of which is as follows: Where P represents the dynamic priority calculated by the task at its final stage. Indicates the criticality of the task, with a value between 0 and 1. This represents the task progress ratio, with a value ranging from 0 to 1, and is used to characterize the current actual progress of the task. This indicates the dependency strength of a task, and is a value obtained after standardizing the number of downstream dependent tasks. These are the weighting coefficients for the corresponding parameters, and the three satisfy... The constraints are fixed, and the weighting coefficients can be dynamically adjusted according to actual business scenarios and scheduling needs, thereby improving the applicability and flexibility of the algorithm.

[0033] In the embodiments of this application, the degree of mission criticality This parameter is used to reflect the business value and importance of a task within the system. It can be determined in the early stages of the task's lifecycle, and there are two main ways to obtain it.

[0034] The first method assigns values ​​based on service level agreements or preset business priorities. System administrators or users pre-define the criticality level according to the task type and the user's group. For example, in a cloud platform scenario, tasks submitted by platinum users correspond to... The value ranges from 0.9 to 1.0, corresponding to the tasks submitted by gold users. The value ranges from 0.7 to 0.8, corresponding to Silver users and test-type tasks. The value ranges from 0.3 to 0.6, corresponding to background batch processing tasks such as log analysis. The value ranges from 0.1 to 0.2.

[0035] The second approach is based on automatic value assignment according to application type and data sensitivity. The system has a built-in recognition engine that can automatically determine the criticality of a task based on its actual content, such as core transaction business or database synchronization tasks. A value of 0.95 indicates an extremely high criticality level, suitable for tasks such as video streaming and file downloading. A value of 0.5 indicates a medium level of criticality; this is for software update package distribution tasks. A value of 0.3 indicates a low level of criticality, meaning that tasks of this type can be allowed to have a short delay in execution.

[0036] In this application embodiment, dependency strength This is a fully dynamically calculated value used to quantify the impact of a task on the overall workflow. Its calculation process relies on the aforementioned task dependency graph, and the specific calculation formula is as follows: It equals the number of downstream tasks that the current task directly or indirectly depends on, divided by the total number of tasks in the system minus one.

[0037] In this embodiment of the application, a scenario containing five tasks is used as an example for specific explanation. Task A is to purchase ingredients and runs on VM1. Task B is to process ingredients and runs on VM2 and depends on task A. Task C is to cook the main dish and runs on VM3 and depends on task B. Task D is to make desserts and runs on VM4 and depends on task A. Task E is to plate and serve the dishes and runs on VM5 and depends on both task C and task D.

[0038] In this embodiment, the total number of system tasks is 5, and the denominator is 5 minus 1, which is 4. Task A directly affects tasks B and D, and indirectly affects tasks C and E. The total number of downstream tasks is 4. =4 / 4=1.0, indicating that task A is the starting point of the workflow, and its delay will block all subsequent tasks, making it the most dependent task. Task B directly affects task C and indirectly affects task E. The total number of downstream tasks is 2. =2 / 4=0.5. Task C directly affects Task E, and the total number of downstream tasks is 1. =1 / 4=0.25. Task D directly affects Task E, and the total number of downstream tasks is 1. =1 / 4=0.25. Task E is the final task to be executed, and it has no downstream dependent tasks. The total number of downstream tasks is 0. Therefore... =0 / 4=0.0, indicating that the delay of task E only affects the workflow completion time and does not affect the execution of other tasks, with the lowest dependency strength.

[0039] In this embodiment of the application, by constructing a dynamic priority calculation function and clarifying the value rules for the criticality and dependence of tasks, the scientific quantification and precise scheduling of virtual machine task priorities are achieved.

[0040] S3. Generate a bandwidth allocation strategy for each virtual machine based on the real-time priority, and determine the traffic control parameters corresponding to each virtual machine.

[0041] To intuitively demonstrate the feasibility and effectiveness of the dynamic scheduling scheme, this application combines a three-virtual machine task scenario and fully illustrates the implementation method through specific numerical calculations and staged process examples.

[0042] In this embodiment of the application, to clearly illustrate the dynamic priority scheduling and bandwidth allocation scheme of this application, detailed implementation examples are given in conjunction with specific application scenarios, as follows: In this application embodiment, the application takes "three virtual machines running on a physical host and executing different related tasks" as a specific scenario, and describes in detail the complete implementation process of dynamic priority scheduling and bandwidth allocation, clarifying the execution logic and calculation method of each link.

[0043] In this embodiment of the application, the three virtual machines in this scenario correspond to different tasks: VM1 performs a data acquisition task (task A), VM2 performs a data processing task (task B), and task B depends on the output of task A; VM3 performs a result storage task (task C), and task C depends on the output of task B. The three tasks form a clear dependency chain, which provides a basis for subsequent priority calculation and bandwidth allocation.

[0044] In the embodiments of this application, the initial parameters of each task are first defined, wherein the criticality of task A (VM1) is 0.6, the progress ratio is 0, and the dependency strength is 0.9; the criticality of task B (VM2) is 0.8, the progress ratio is 0, and the dependency strength is 0.7; and the criticality of task C (VM3) is 0.4, the progress ratio is 0, and the dependency strength is 0.2.

[0045] In this embodiment of the application, a weighting coefficient is set. =0.5、 =0.3、 =0.2 ( (Conforming to the priority calculation specification), through the priority calculation formula Calculate the initial priority of each task: the priority of task A is P(A) = 0.5 × 0.6 + 0.3 × 0 + 0.2 × 0.9 = 0.48, the priority of task B is P(B) = 0.5 × 0.8 + 0.3 × 0 + 0.2 × 0.7 = 0.54, and the priority of task C is P(C) = 0.5 × 0.4 + 0.3 × 0 + 0.2 × 0.2 = 0.24.

[0046] In this embodiment, the total bandwidth is set to 1000Mbps. The bandwidth is allocated according to the rule "bandwidth of each task = (priority of the task / total priority of all tasks) × total bandwidth". First, the total priority is calculated as 0.48 + 0.54 + 0.24 = 1.26. Then, the bandwidth allocation results of each virtual machine are obtained: VM1 (task A) bandwidth BW(A) = (0.48 / 1.26) × 1000 ≈ 381Mbps, VM2 (task B) bandwidth BW(B) = (0.54 / 1.26) × 1000 ≈ 429Mbps, VM3 (task C) bandwidth BW(C) = (0.24 / 1.26) × 1000 ≈ 190Mbps, so as to achieve reasonable allocation of bandwidth resources.

[0047] In this embodiment, the dynamic scheduling process is divided into three core stages. The first stage is dynamic monitoring: the system continuously monitors the execution status of each task in real time and updates the progress ratio of each task in real time. When task A is 50% complete, its progress ratio is updated to 0.5. At this time, the priority of each task is recalculated: the priority of task A is P(A) = 0.5 × 0.6 + 0.3 × 0.5 + 0.2 × 0.9 = 0.63, while the priorities of tasks B and C remain unchanged (still 0.54). The total priority is updated to 0.63 + 0.54 + 0.24 = 1.41, and the bandwidth allocation is adjusted accordingly: VM1 bandwidth BW(A) = (0.63 / 1.41) × 1000 ≈ 447Mbps, VM2 bandwidth BW(B) = (0.54 / 1.41) × 1000 ≈ 383Mbps, VM3 bandwidth BW(C) = (0.24 / 1.41) × 1000 ≈ 170Mbps, to ensure that the bandwidth allocation matches the task execution progress.

[0048] In this embodiment, the dynamic scheduling is divided into three specific stages: Stage 1 is the initial execution stage, where tasks A and B are in full execution, while task C is in a waiting state because its prerequisites (requiring task B to complete) are not met. The flow control strategy prioritizes the bandwidth of VM1 and VM2 and restricts the bandwidth usage of VM3 to avoid resource waste and ensure that tasks A and B quickly acquire network data and advance their execution progress. Stage 2 is the task B completion stage, where the system detects that task B has completed execution and its bandwidth requirement has decreased significantly. The application redistributes the bandwidth released by VM2 to VM1, which is still executing, to further accelerate the completion of task A. At this time, task C is still in a waiting state and its bandwidth is still restricted. Stage 3 is the task A completion stage, where the system detects that both tasks A and B have been completed and all prerequisites for task C have been removed. The system then adjusts the bandwidth priority, lowering the bandwidth priority of VM1 and VM2 and allocating sufficient bandwidth to VM3 to ensure that task C executes efficiently and completes the closed loop of the entire workflow.

[0049] In this embodiment, the application also has dynamic prediction and resource reservation functions. When the system detects that task A and task B are in the later stage of execution (such as task A being 85% complete), it will automatically predict that task C is about to start, reserve the required bandwidth resources for VM3 in advance, and gradually increase its bandwidth limit to achieve a smooth transition of bandwidth resources. This avoids network jitter caused by sudden bandwidth grabbing when task C starts, further ensuring the stability and efficiency of the entire scheduling process, and fully demonstrating the core advantages of dynamic scheduling and precise resource allocation of this application.

[0050] In this application embodiment, the complete implementation process and actual effect of dynamic priority and bandwidth allocation are clearly demonstrated through numerical calculation and phased scheduling examples of a three-virtual machine task scenario.

[0051] S4. The network traffic of the virtual machine is intercepted through the virtual flow control switch, and the intercepted network traffic is rate-limited or reshaped according to the flow control parameters.

[0052] To achieve traffic control that is hardware-independent, compatible with pass-through devices, and centrally managed, this application draws on the concept of software-defined networking to design a virtual flow control switch and complete the entire flow control process.

[0053] In this embodiment, the application draws on the concept of software-defined networking to implement a virtual flow control switch. This virtual flow control switch, as a logically centralized and physically distributed control entity, does not rely on specific physical hardware. Through software-level mirroring ports and tunneling technology, it completes the replication and forwarding of data packets, realizing a fully software-based flow control function, effectively solving the limitations of traditional flow control solutions.

[0054] In this embodiment, the workflow of the virtual flow control switch is clear and orderly. First, it performs traffic capture: the virtual flow control switch uses its mirror port to copy all traffic generated by each virtual machine requiring flow control, ensuring complete data collection and providing a foundation for subsequent analysis and control. Then, it enters the traffic routing stage: the virtual flow control switch encapsulates the copied traffic data using tunneling technology and sends it to the central flow control controller, achieving centralized collection of all traffic data. This facilitates unified analysis and processing by the controller, avoiding the problem of scattered traffic being difficult to manage.

[0055] In this embodiment, the central flow controller receives and analyzes the collected traffic characteristic data, and combines this data with information such as the running status and priority of each virtual machine task to calculate a precise flow control policy. For example, different rate limiting standards are set for different virtual machines, such as limiting VM1 to 300Mbps and VM2 to 500Mbps, thus clearly defining the traffic usage limit for each virtual machine. Then, the policy distribution and execution phase begins: the central controller distributes the calculated flow control policy to the virtual flow control switches on each host. The virtual flow control switches directly perform rate limiting, shaping, and other operations on the raw traffic in the packet forwarding path to ensure that the traffic control meets the policy requirements.

[0056] In this embodiment, the virtual flow control switch solution has significant advantages: First, it has no hardware dependency; the entire flow control process is completed at the software level, eliminating the need for specific physical switches, reducing hardware investment costs, and improving the versatility of the solution. Second, it offers seamless compatibility; for virtual machines using SR-IOV passthrough technology, even if their data flow bypasses the host machine's traditional virtual switch, it can still be captured by the mirror port of the virtual flow control switch, completely solving the fatal flaw of traditional flow control solutions being unable to control traffic on passthrough devices. Third, it enables centralized management; administrators can uniformly configure, adjust, and monitor the traffic policies of all virtual machines in the entire cluster through a single console, significantly improving the efficiency and convenience of flow control management, and ensuring that the entire flow control process is efficient, controllable, and traceable.

[0057] In this embodiment, a virtual flow control switch is constructed by drawing on the concept of software-defined networking and a standardized flow control process is established to achieve centralized traffic management that is hardware-independent and compatible with SR-IOV pass-through devices.

[0058] Example 2 This application relates to a virtual machine flow control system based on priority awareness and cooperative scheduling, such as... Figure 2 As shown, it specifically includes: 1. Task Dependency Resolver: Traditional flow control schemes only consider network bandwidth parameters, ignoring the logical relationships between tasks. This application introduces a task dependency graph model to formally describe the dependencies between virtual machine tasks. The system automatically constructs the dependency graph by parsing task metadata and dynamically adjusts traffic priority based on task status.

[0059] The dependency expression is as follows: Let the set of virtual machines be The task set is Defining dependencies {Finish-Start, Start-Start, Finish-Finish} represents the dependency type. Based on these dependencies, we can construct a task dependency graph, where nodes represent tasks and edges represent dependencies. The task dependency resolution algorithm automatically identifies dependencies between tasks by analyzing task metadata and historical execution records. The algorithm steps are as follows: extract task feature information, including task type, input and output resources, expected execution time, etc.; analyze task historical execution records; identify common dependency patterns; construct a task dependency graph; calculate dependency strength; verify the rationality of dependencies; remove erroneous dependencies; and output the final task dependency graph.

[0060] 2. Priority-Aware Traffic Scheduling Algorithm: A dynamic priority scheduling algorithm that comprehensively considers task criticality, progress status, and dependency strength. Each virtual machine task is assigned an initial priority, which is dynamically adjusted based on real-time progress.

[0061] The priority calculation function is as follows:

[0062] in, The parameter indicates the level of criticality of the task (range 0-1), followed by an explanation of its source. The task progress ratio (range 0-1) represents the current progress percentage of the task. This represents the dependency strength (a standardized value of the number of downstream dependent tasks). The dependency strength will be explained later. , , For the weighting coefficients, satisfying The weighting coefficients can be dynamically adjusted as needed.

[0063] Based on the calculated priorities, the system dynamically adjusts the bandwidth allocation ratio of each virtual machine to ensure that high-priority tasks obtain the necessary network resources.

[0064] 3. Software-Defined Flow Control Model: Drawing inspiration from software-defined networking, this application implements a virtual flow control switch, which is a logically centralized but physically distributed control entity. This switch replicates and forwards data packets using mirroring ports and tunneling technology, achieving flow control functionality independent of physical hardware. The workflow is as follows: Traffic Capture: The virtual flow control switch replicates the traffic of the virtual machines to be controlled through mirroring ports. Traffic Direction: This replicated traffic is sent to the central flow controller through a tunnel. In this way, all traffic data is centrally collected for analysis. Policy Calculation: The central controller analyzes traffic characteristics and combines them with task status to calculate flow control policies (e.g., limiting VM1 to 300Mbps and VM2 to 500Mbps). Policy Distribution and Execution: The central controller distributes the policies to the virtual flow control switches on each host. The virtual switches directly perform rate limiting, shaping, and other operations on the original traffic along the data forwarding path. The advantages of this approach are: No hardware dependency: The entire process is completed at the software level, requiring no specific model of physical switch support. Seamless Compatibility: For virtual machines using SR-IOV passthrough, although their data flow bypasses the host machine's traditional virtual switch, it can still be captured by the mirrored port, thus solving the fatal flaw of traditional solutions that cannot control flow through passthrough devices. Centralized Management: Administrators can manage the traffic policies of the entire cluster from a single console.

[0065] The implementation of this application is illustrated below with a specific example.

[0066] Scenario Description: Three virtual machines are running on a physical host, each performing the following tasks: VM1: Data acquisition task (task A) VM2: Data processing task (task B), dependent on the output of task A VM3: Result storage task (task C), dependent on the output of task B.

[0067] Initial state: Task A: Criticality = 0.6, Progress Ratio = 0, Dependency = 0.9; Task B: Criticality = 0.8, Progress Ratio = 0, Dependency = 0.7; Task C: Criticality = 0.4, Progress Ratio = 0, Dependency = 0.2.

[0068] Priority calculation (assuming α=0.5, β=0.3, γ=0.2): P(A)=0.5×0.6+0.3×0+0.2×0.9=0.48; P(B)=0.5×0.8+0.3×0+0.2×0.7=0.54; P(C)=0.5×0.4+0.3×0+0.2×0.2=0.24.

[0069] Bandwidth allocation (total bandwidth 1000Mbps): Total priority = 0.48 + 0.54 + 0.24 = 1.26; BW(A)=(0.48 / 1.26)×1000≈381Mbps; BW(B)=(0.54 / 1.26)×1000≈429Mbps; BW(C)=(0.24 / 1.26)×1000≈190Mbps.

[0070] When task A is 50% complete, the progress ratio is updated and the priority is recalculated. P(A)=0.5×0.6+0.3×0.5+0.2×0.9=0.63; P(B)=0.5×0.8+0.3×0+0.2×0.7=0.54; P(C)=0.5×0.4+0.3×0+0.2×0.2=0.24.

[0071] reallocate bandwidth: Total priority = 0.63 + 0.54 + 0.24 = 1.41; BW(A)=(0.63 / 1.41)×1000≈447Mbps; BW(B)=(0.54 / 1.41)×1000≈383Mbps; BW(C)=(0.24 / 1.41)×1000≈170Mbps.

[0072] This example demonstrates how the system dynamically adjusts bandwidth allocation based on task progress to ensure that critical tasks receive sufficient resources.

[0073] The following examples illustrate the degree of importance. The method of deriving ) is as follows: a) Based on Service Level Agreement (SLA) or Business Priority: This is the most common method. System administrators or users pre-define a priority level for different task types or user / user group. Example: On a cloud platform: A Platinum user (paying the highest fee) submits the following task: Tasks submitted by Gold users (values ​​0.9-1.0): =0.7-0.8 Silver users and testing tasks: =0.3-0.6 Background batch processing tasks (such as log analysis): =0.1-0.2.

[0074] b) Based on application type or data sensitivity: The system can integrate a recognition engine to automatically determine the criticality of a task based on its content. Examples: core transaction business, database synchronization tasks. =0.95 (Very High) Video streaming and file download: =0.5 (Medium) software update package distribution: =0.3 (low, can be delayed briefly).

[0075] It is an attribute determined early in the task lifecycle, reflecting the task's weight in terms of business value or system importance.

[0076] Dependency strength ( The method of deriving ) is as follows: It is a fully dynamically calculated value that quantifies a task's "influence" within the overall workflow. Its calculation is based on a task dependency graph.

[0077] The calculation formula is usually as follows: = (Number of downstream tasks that the current task directly or indirectly depends on) / (Total number of tasks in the system - 1).

[0078] For example: Suppose there are 5 tasks: Task A: Purchase ingredients (VM1) Task B: Process ingredients (VM2) depends on A Task C: Cook the main dish (VM3) depends on B Task D: Make dessert (VM4) depends on A (assuming dessert does not require processing ingredients) Task E: Plate and serve (VM5) depends on C and D.

[0079] Now, let's calculate the cost of each task. (Dependency Strength): Task A: Its completion directly affects B and D, and indirectly affects C and E. The total number of downstream tasks is 4 (B, C, D, E).

[0080] =4 / (5-1)=4 / 4=1.0 Explanation: Task A is the starting point of the entire workflow. If it is delayed, it will cause all subsequent tasks to be blocked. Therefore, its dependency strength is the highest (1.0).

[0081] Task B: Its completion directly affects C and indirectly affects E. The total number of downstream tasks is 2(C, E). =2 / 4=0.5.

[0082] Task C: Its completion directly affects E. The total number of downstream tasks is 1 (E). =1 / 4=0.25.

[0083] Task D: Its completion directly affects E. The total number of downstream tasks is 1 (E). =1 / 4=0.25.

[0084] Task E: It is the final task, and there are no downstream tasks that depend on it. The total number of downstream tasks is 0. =0 / 4=0.0.

[0085] Explanation: The delay of task E will not affect any other tasks, but will only affect the final completion time of the entire workflow. Therefore, its dependency strength is the lowest (0.0).

[0086] Here's an example illustrating the entire solution process: Step 1: Virtual machine set V: {VM1, VM2, VM3} Task set T: {Task A (make the main course), Task B (make the dessert), Task C (plating)} Determine the dependencies: D: (Task A, Task C, Finish-Start) → Task A must be completed before Task C starts (Task B, Task C, Finish-Start) → Task B must be completed before Task C starts

[0087] The second step is dynamic monitoring and priority adjustment: The system continuously monitors the execution status (task status) of each task. The flow control policy changes dynamically based on these statuses: Stage 1: When tasks A and B first start: Task C is waiting and cannot start. Tasks A and B are executing at full speed. Flow control policy: The system recognizes that tasks A and B are the current critical paths. Therefore, it prioritizes the bandwidth of VM1 and VM2, allowing them to quickly obtain data from the network (like retrieving ingredients from a warehouse) and complete as soon as possible. At this time, the bandwidth of VM3 can be limited to a very low level because it does not need to transmit any data temporarily, avoiding resource waste. Stage 2: Task B completes first: Task B is completed. Task A is still in progress, and Task C is still waiting (because it still needs to wait for Task A). Flow control policy: The system detects this change. VM2's task has been completed, and its bandwidth requirement has dropped to a very low level. The system allocates more of the bandwidth released by VM2 to VM1 to accelerate its completion, rather than to VM3. VM3 is still limited. Stage 3: Task A completes: Both tasks A and B are in the completed state. Once all prerequisites for Task C are met, execution can begin. Flow control strategy: The system immediately detects the removal of the dependency, dynamically lowers the bandwidth priority of VM1 and VM2, and allocates the highest priority and sufficient bandwidth to VM3, ensuring that the final step of plating and serving can be completed quickly and smoothly.

[0088] Step 3: Dynamic Prediction and Resource Allocation: The system can not only react, but also predict. When tasks A and B are in their later stages, the system can predict that task C is about to start based on its progress (e.g., task A is 85% complete). It will reserve the necessary bandwidth resources for VM3 in advance and slowly increase its bandwidth limit, ensuring that task C achieves optimal performance at startup, resulting in a smooth transition rather than sudden resource contention causing network jitter.

[0089] Example 3 This application provides a virtual machine flow control device 10 based on priority awareness and cooperative scheduling, such as... Figure 3 As shown, the device includes: The parsing module 100 is used to parse the metadata of the tasks running in the virtual machine and construct a task dependency graph that represents the logical dependencies between tasks. The monitoring module 200 is used to monitor the execution progress status of each task and dynamically calculate the real-time priority of each task based on the criticality of the task and the dependence strength in the task dependency graph. The allocation module 300 is used to generate a bandwidth allocation strategy for each virtual machine based on the real-time priority and determine the traffic control parameters corresponding to each virtual machine. The execution module 400 is used to intercept the network traffic of the virtual machine through the virtual flow control switch, and to perform rate limiting or shaping operations on the intercepted network traffic according to the flow control parameters.

[0090] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0091] Example 4 To implement the methods of the above embodiments, this application also provides an electronic device, which includes a memory and a processor; wherein the processor reads executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement the various steps of the methods described above.

[0092] Example 5 To implement the above embodiments, this application also proposes a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the method described in the foregoing embodiments.

[0093] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

[0094] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0095] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.

Claims

1. A virtual machine flow control method based on priority awareness and cooperative scheduling, characterized in that, include: S1, parse the metadata of the tasks running in the virtual machine and construct a task dependency graph that represents the logical dependencies between tasks; S2, monitor the execution progress status of each task, and dynamically calculate the real-time priority of each task based on the criticality of the task and the dependence strength in the task dependency graph. S3, Generate a bandwidth allocation strategy for each virtual machine based on the real-time priority, and determine the traffic control parameters corresponding to each virtual machine; S4. The network traffic of the virtual machine is intercepted through the virtual flow control switch, and the intercepted network traffic is rate-limited or reshaped according to the flow control parameters.

2. The method according to claim 1, characterized in that, The process of parsing the metadata of tasks running in the virtual machine and constructing a task dependency graph representing the logical dependencies between tasks includes: Extract task feature information, including task type, input and output resources, and expected execution time, and analyze historical execution records of the task to identify common dependency patterns; A preliminary task dependency graph is constructed based on the identified dependency patterns, where nodes represent tasks and edges represent dependencies, including Finish-Start, Start-Start, or Finish-Finish types. Calculate the dependency strength between tasks in the preliminary task dependency graph, verify the rationality of the dependencies to remove erroneous dependencies, and output the final task dependency graph.

3. The method according to claim 1, characterized in that, The monitoring of the execution progress status of each task, combined with the criticality of the task and the dependency strength in the task dependency graph, dynamically calculates the real-time priority of each task, including: Obtain the initial criticality of each task. The Determined based on service level agreement, business priority, application type, or data sensitivity, with a value range from 0 to 1; Real-time monitoring of the execution progress of each task to calculate the task progress ratio. The This indicates the proportion of the task that has been completed to the total workload, and its value ranges from 0 to 1. Read the dependency strength of each task from the task dependency graph. And call the preset weighting coefficients. , and ,in ; Based on the above , and Execute the priority calculation function to generate the real-time priority of each task. The calculation formula is: .

4. The method according to claim 1, characterized in that, The step of generating a bandwidth allocation strategy for each virtual machine based on the real-time priority and determining the traffic control parameters corresponding to each virtual machine includes: The total priority value is obtained by summing the real-time priorities of all running tasks. For each virtual machine, divide its corresponding task real-time priority by the total priority value to obtain the bandwidth allocation ratio for that virtual machine; obtain the total available bandwidth value of the physical host, and multiply the total available bandwidth value by the bandwidth allocation ratio to obtain the target bandwidth value for that virtual machine. The target bandwidth value is determined as the rate limiting threshold in the traffic control parameters of the virtual machine, and a bandwidth allocation strategy containing the rate limiting threshold is generated.

5. The method according to claim 1, characterized in that, The step of intercepting network traffic from virtual machines via a virtual flow control switch and performing rate limiting or shaping operations on the intercepted network traffic based on the flow control parameters includes: Configure the mirror port of the virtual flow control switch to copy the original network traffic of the virtual machine to be controlled to obtain mirror traffic; The mirrored traffic is sent to the central flow controller via tunneling technology. The central flow controller analyzes the traffic characteristics and calculates a flow control strategy that includes rate limiting or shaping instructions based on the task status. The flow control policy is distributed to the virtual flow control switches on each host. The virtual flow control switches directly perform rate limiting or shaping operations on the original network traffic on the data forwarding path. The operations do not depend on the hardware support of a specific model of physical switch.

6. A virtual machine flow control device based on priority awareness and cooperative scheduling, characterized in that, include: The parsing module is used to parse the metadata of tasks running in the virtual machine and construct a task dependency graph that represents the logical dependencies between tasks. The monitoring module is used to monitor the execution progress status of each task and dynamically calculate the real-time priority of each task based on the criticality of the task and the dependence strength in the task dependency graph. The allocation module is used to generate a bandwidth allocation strategy for each virtual machine based on the real-time priority and to determine the traffic control parameters corresponding to each virtual machine. The execution module is used to intercept network traffic of virtual machines through a virtual flow control switch, and to perform rate limiting or shaping operations on the intercepted network traffic according to the flow control parameters.

7. An electronic device, characterized in that, Including processor and memory; The processor reads executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement the method as described in any one of claims 1-5.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-5.