A CPU-GPU dynamic load balancing method for underwater acoustic processing based on a task flow model
By constructing a task flow model and dynamic programming algorithm, the load imbalance problem caused by static task partitioning is solved, achieving efficient utilization and real-time performance of CPU-GPU resources, adapting to the dynamic changes of underwater acoustic processing tasks, and improving the performance and real-time performance of underwater acoustic processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA SHIP DEV & DESIGN CENT
- Filing Date
- 2026-03-05
- Publication Date
- 2026-06-19
AI Technical Summary
Existing static task partitioning strategies cannot dynamically adapt to the dynamic characteristics of underwater acoustic processing tasks, resulting in unbalanced CPU or GPU load, low resource utilization, neglect of inter-task dependencies and communication overhead, and difficulty in meeting real-time requirements.
Build a task flow model, establish task feature profiles, monitor system status in real time, use dynamic programming algorithms for task decision-making and scheduling, dynamically adjust the allocation of tasks between CPU and GPU, and optimize the total completion time of the task flow.
It achieves efficient CPU-GPU resource utilization, significantly reduces communication overhead, improves computing efficiency, enhances real-time performance, adapts to different load changes, and meets the needs of high-performance underwater acoustic processing.
Smart Images

Figure CN121764696B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of underwater acoustic processing technology, specifically relating to a CPU-GPU dynamic load balancing method for underwater acoustic processing based on a task flow model. Background Technology
[0002] With the rapid development of applications such as virtual reality, real-time voice communication, high-quality underwater acoustic coding, and 3D sound field rendering, modern underwater acoustic processing algorithms face increasingly stringent requirements in terms of complexity, computational load, and real-time performance. Traditional pure software processing solutions based on central processing units (CPUs) are no longer sufficient to meet the computational power demands of high-performance underwater acoustic processing applications. In recent years, the use of graphics processing units (GPGPUs) for general-purpose computing, leveraging their advantages of massively parallel architecture, has been widely introduced into underwater acoustic processing workflows, forming a CPU-GPU heterogeneous computing model to address these computational challenges.
[0003] Currently, most common CPU-GPU hybrid computing solutions employ a static task partitioning strategy. That is, during the application design or initialization phase, based on prior knowledge or experience, specific tasks in the underwater acoustic processing pipeline (e.g., Fast Fourier Transform (FFT), large-scale convolution operations, etc.) are fixedly assigned to the GPU for execution, while logic control, serial processing, or I / O-related tasks are assigned to the CPU. However, this static allocation method has several inherent drawbacks, making it difficult to achieve ideal performance in practical applications:
[0004] Lack of dynamic adaptability: Underwater acoustic signals and the processing environment have significant dynamic characteristics. For example, the sparsity, noise level, and processing complexity of underwater acoustic signals change over time; at the same time, the CPU and GPU loads of the system itself fluctuate due to background tasks, power management, and other factors. Static partitioning cannot perceive and respond to these dynamic changes, which can easily lead to one CPU or GPU becoming overloaded and a performance bottleneck at a certain moment, while the other is idle or lightly loaded, resulting in low overall utilization of heterogeneous computing resources.
[0005] Ignoring inter-task dependencies and communication overhead: Complex underwater acoustic processing applications typically consist of multiple tasks with data dependencies forming a task flow. Static partitioning often focuses only on the execution platform of a single task, ignoring the dependencies between tasks and the resulting data transfer overhead between the CPU and GPU. Frequent and unnecessary cross-device data transfers can introduce significant latency, sometimes even exceeding the computation time of the task itself, thus severely limiting the processing efficiency of the entire task flow.
[0006] Inefficient resource utilization: Static strategies cannot perform fine-grained, dynamic optimization based on the specific computational characteristics of the task and the current system state. They cannot flexibly allocate tasks suitable for serial processing and complex logic to the CPU, while simultaneously allocating highly parallel tasks to the GPU. This results in the inability to fully leverage the architectural advantages of both CPUs and GPUs, and the overall performance potential of heterogeneous computing platforms remains untapped.
[0007] Difficulty in meeting real-time requirements: For real-time underwater acoustic processing applications, such as low-latency communication and interactive underwater acoustic rendering, processing latency must be strictly limited. Static load balancing methods, unable to dynamically adjust to cope with instantaneous load spikes or changes in data characteristics, may lead to unstable task completion times or even timeouts, failing to guarantee stable real-time performance.
[0008] Therefore, there is an urgent need in this field for a load balancing method for underwater acoustic processing that can overcome the above-mentioned defects. It should be able to dynamically and intelligently allocate and schedule tasks between the CPU and GPU based on task characteristics, inter-task dependencies, and real-time system load status, thereby achieving truly efficient collaborative computing and meeting the needs of high-performance, low-latency underwater acoustic processing applications. Summary of the Invention
[0009] In view of this, the purpose of this invention is to provide a CPU-GPU dynamic load balancing method for underwater acoustic processing based on a task flow model.
[0010] To achieve the above objectives, the present invention provides the following technical solution:
[0011] A CPU-GPU dynamic load balancing method for underwater acoustic processing based on a task flow model includes the following steps:
[0012] S1. Construct a task flow model: Deconstruct the underwater acoustic processing task into a task flow model that includes multiple task nodes and the dependencies between nodes;
[0013] S2. Construct a feature profile: Build a feature profile for each task node, and construct a cost prediction model based on the feature profile to predict the execution time of the task on different processors.
[0014] S3. Real-time monitoring: Real-time monitoring includes system status parameters such as CPU utilization, GPU utilization, and CPU-GPU data transfer performance;
[0015] S4. Task Decision: With the goal of minimizing the total completion time of the task flow model, and combining the cost prediction model and real-time system state parameters, a dynamic programming algorithm is used to allocate a corresponding processor to each task node.
[0016] S5. Task Scheduling: Based on the decision result of S4, dynamically schedule tasks to CPU or GPU for execution, and periodically return to S3 to update the scheduling policy.
[0017] As a further preferred embodiment of the present invention, S1 specifically includes the following steps:
[0018] The overall process of the target underwater acoustic processing task is analyzed, and the target underwater acoustic processing application is deconstructed into a task flow model represented by a directed acyclic graph. ,in: Let E represent the set of task nodes, where each task node represents an atomic underwater acoustic processing task, including underwater acoustic frame acquisition, frequency domain filtering, Fourier transform, and echo cancellation; let E represent the set of directed edges. Indicates task The output is the task The input defines the data dependencies between tasks.
[0019] As a further preferred embodiment of the present invention, S2 specifically includes the following steps:
[0020] S21. Feature Profile Construction: For each task node in the task flow model... Establish a multi-dimensional feature profile, which includes the following three core feature categories:
[0021] Computational complexity characteristics include the number of floating-point operations and integer operations per frame of data, as well as the size of the data being processed, including the length of the underwater acoustic frame and the number of channels.
[0022] Parallelism characteristics include the proportion of operations that can be executed in parallel within a task, the granularity of data parallel processing, and the existence of inter-thread dependencies.
[0023] Data throughput characteristics include memory read / write bandwidth requirements and cache hit rate during task execution.
[0024] S22. Cost Prediction Model Establishment: Based on the above feature profile, a cost prediction model is constructed. This model is used to predict costs based on task nodes. Feature profile to predict its performance in the processor Execution time on The cost prediction model is obtained through offline training or online learning using historical operating data.
[0025] As a further preferred embodiment of the present invention, the dynamic programming algorithm described in S4 uses a backward recursive method to calculate the state value, and its state transition equation is defined as follows:
[0026]
[0027] in, , for The set of all direct successor tasks, ∈ , Indicates task In processor When the above is executed, the shortest completion time of all its subsequent task flows. Indicates task In processor The predicted execution time is on the table. Indicates the data transfer time between processors;
[0028] After calculating the state values of all task nodes, starting from the initial task node, calculate the state value sequence for each task node. Choose the processor that minimizes the overall completion time. .
[0029] As a further preferred embodiment of the present invention, S5 specifically includes the following steps:
[0030] S51. Task Distribution and Execution: Based on the optimal processor allocation scheme obtained in step S4. The task scheduling is performed by a central scheduler, which schedules each task node sequentially according to the dependencies defined in the task flow model. Distributed to the corresponding target processor Perform calculations: when At this time, the central scheduler executes the task by creating CPU threads or processes. At that time, the central scheduler submits the corresponding task and related data to the GPU computing queue by calling the GPU computing API;
[0031] S52. Dynamic Feedback and Strategy Update: During execution, the latest system status parameters are continuously obtained through the monitoring mechanism established in step S3. When the system load changes beyond a preset threshold or reaches a fixed time period, the system re-executes the complete process from S3 to S5 and applies a new scheduling strategy.
[0032] As a further preferred embodiment of the present invention, S5 also includes S53, dynamic task granularity reorganization: when multiple consecutive lightweight task nodes are detected to be allocated to the same processor and the total computational load is lower than a preset threshold, these task nodes are merged into a single scheduling unit; when the execution time of a single task node exceeds a preset upper limit, it is split into multiple subtasks for parallel execution according to the parallelism characteristics in its feature profile; the reorganization operation updates the topology of the task flow model in real time and triggers incremental updates of the scheduling strategy.
[0033] As a further preferred embodiment of the present invention, when calculating the state transition equation, the dynamic programming algorithm determines the task... and subsequent tasks If assigned to a heterogeneous processor, then pre-configured The output data is asynchronously copied to the target processor's cache area; during S5 task scheduling, a double-buffering strategy is used to process data input or output in parallel with the execution of the computation kernel, minimizing the data transfer time between processors. Overlapping is hidden within the computation time.
[0034] As a further preferred embodiment of the present invention, an energy efficiency feature dimension is added to the feature profile constructed in S2. The energy efficiency feature includes processor dynamic power consumption, thermal design power margin, and unit computing power consumption ratio. Constraints are added to the dynamic programming algorithm. When the system temperature exceeds a preset threshold or the power consumption is lower than a set value, the algorithm switches to an energy efficiency priority mode. Under the premise of meeting the soft constraint of the total task completion time, tasks are preferentially assigned to the processor with the best energy efficiency feature, and the processor is dynamically adjusted in conjunction with the processor.
[0035] As a further preferred embodiment of the present invention, in each task node of the task flow model G The above indicates the deadline constraint. The cutoff time is calculated based on the underwater acoustic frame length and processing frame rate; the state transition equation is modified into a constrained optimization problem: in the calculation At that time, if the candidate processor If this causes any subsequent task to violate the corresponding deadline constraint, then the candidate task will be removed from the list. Set to infinity; scan forward from the starting task node, and when a dead-line constraint that is not met is detected, trigger task flow reconstruction, and perform algorithm-level parallel splitting or downgrade the computational precision of the task nodes on the path.
[0036] The beneficial effects of this invention are as follows:
[0037] This invention forms a complete and adaptive CPU-GPU load balancing solution by constructing a task flow model, establishing task feature profiles, monitoring system status in real time, making task decisions based on dynamic programming, and dynamically scheduling and updating feedback. Compared with the existing static methods described in the background art, it achieves significant advantages.
[0038] This invention achieves high dynamic adaptability and efficient resource utilization: Addressing the issues of "lack of dynamic adaptability" and "low resource utilization efficiency" in the background technology, this invention uses S3 to monitor system status parameters (CPU / GPU utilization, transmission performance) in real time, and combines this with the dynamic feedback and strategy update mechanism of S5. This allows it to keenly perceive and respond to dynamic changes in the characteristics of underwater acoustic processing tasks and system load. This makes the load balancing strategy no longer static, but dynamically adjusts task allocation according to real-time conditions, effectively avoiding resource waste caused by one side being overloaded while the other is idle, and significantly improving the overall utilization of heterogeneous computing resources (CPU and GPU) and system throughput.
[0039] Global optimization significantly reduces communication overhead: Addressing the issue of "ignoring inter-task dependencies and communication overhead" in the background technology, this invention constructs a task flow model (DAG) including task nodes and dependencies in S1, and employs a dynamic programming algorithm for global optimization decisions in S4. This algorithm explicitly considers data transfer time between processors in the state transition equation, thus intelligently balancing computational and communication overhead when allocating tasks, prioritizing solutions that reduce unnecessary cross-device data transfer, and minimizing the total task flow completion time from a global perspective. This effectively overcomes the communication bottleneck caused by static partitioning ignoring dependencies.
[0040] Leveraging the advantages of heterogeneous architecture to improve computational efficiency: Addressing the issue of "low resource utilization efficiency" in the background technology, this invention constructs a multi-dimensional feature profile for each task in S2, including computational complexity, parallelism, and data throughput, and establishes a cost prediction model based on this profile. This enables the system to accurately determine whether each task is more suitable for CPU's serial logic processing or GPU's large-scale parallel computing, thus intelligently allocating tasks to the most suitable processor in S4 decision-making, fully leveraging the architectural advantages of both CPU and GPU, and maximizing computational efficiency.
[0041] Enhancing Real-Time Performance: Addressing the issue of "difficulty in meeting real-time requirements" in the background technology, this invention ensures that the system can quickly respond to load changes and maintain stable low-latency processing through the periodic scheduling update and dynamic feedback mechanism of S5. In particular, the introduced deadline constraints and task flow reconstruction mechanism provide strict guarantees for real-time performance, and can proactively intervene (such as task splitting and precision adjustment) when potential timeout risks are detected, thereby meeting the stringent requirements of high-quality real-time underwater acoustic processing applications (such as low-latency communication and interactive underwater acoustic rendering).
[0042] This invention introduces energy efficiency optimization and adaptive task granularity, expanding its application scenarios: The addition of an energy efficiency optimization dimension allows load balancing to prioritize performance while also considering energy consumption, making it particularly suitable for power-sensitive scenarios such as mobile devices and edge computing. The dynamic task granularity reorganization function enables the system to dynamically optimize the task graph granularity based on actual execution conditions, further enhancing the precision and adaptability of load balancing. These innovations significantly enhance the overall performance and practicality of this method.
[0043] Other advantages, objectives, and features of the invention will be set forth in the following description and will be apparent to those skilled in the art in some respects, or may be learned by practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0044] To make the objectives, technical solutions, and beneficial effects of this invention clearer, the following figures are provided for illustration:
[0045] Figure 1 This is a schematic diagram of the overall process of the present invention;
[0046] Figure 2 This is a schematic diagram of the process of S2 in this invention;
[0047] Figure 3 This is a schematic diagram of the process of S5 of the present invention. Detailed Implementation
[0048] like Figures 1-3 As shown, this invention discloses a CPU-GPU dynamic load balancing method for underwater acoustic processing based on a task flow model, comprising the following steps:
[0049] S1. Construct a task flow model: Deconstruct the underwater acoustic processing application into a task flow model that includes multiple task nodes and dependencies between nodes;
[0050] S2. Construct a feature profile: Build a feature profile for each task node, and construct a cost prediction model based on the feature profile to predict the execution time of the task on different processors.
[0051] S3. Real-time monitoring: Real-time monitoring includes system status parameters such as CPU utilization, GPU utilization, and CPU-GPU data transfer performance;
[0052] S4. Task Decision: With the goal of minimizing the total completion time of the task flow model, and combining the cost prediction model and real-time system state parameters, a dynamic programming algorithm is used to allocate a corresponding processor to each task node.
[0053] S5. Task Scheduling: Based on the decision result of S4, dynamically schedule tasks to CPU or GPU for execution, and periodically return to S3 to update the scheduling policy.
[0054] S1 may specifically include the following steps:
[0055] The overall process of the target underwater acoustic processing application is analyzed, and the application is deconstructed into a task flow model represented by a directed acyclic graph (DAG). ,in: } represents the set of task nodes, each task node representing an atomic underwater acoustic processing task, including underwater acoustic frame acquisition, frequency domain filtering, Fourier transform, and echo cancellation; E represents the set of directed edges, where each edge... Indicates task The output is the task The input defines the data dependencies between tasks.
[0056] Task Node Identification: Taking a real-time noise suppression underwater acoustic processing application as an example, the complete processing flow is analyzed, and the following atomic tasks are identified: Acoustic frame acquisition (acquiring raw underwater acoustic data from the input device) Fast Fourier Transform (FFT) (time-domain to frequency-domain conversion) : Spectral noise estimation (analysis of noise characteristics) Wiener filtering (frequency domain noise reduction processing) Inverse Fast Fourier Transform (IFFT) (frequency domain to time domain conversion) Level calculation (calculating signal amplitude) Automatic gain control (dynamically adjusts volume) HRTF convolution (3D sound field rendering) : Underwater acoustic frame output (sent to output device).
[0057] Dependency analysis: Determine the data flow between tasks and establish dependencies.
[0058] ,That There is a two-way data dependency.
[0059] Formal Modeling: Constructing a Directed Acyclic Graph (DAG) Model .
[0060] in: ;
[0061] .
[0062] The DAG model accurately describes the complex dependencies between underwater acoustic processing tasks, providing a structured foundation for subsequent global optimization and overcoming the shortcomings of static partitioning that ignores task dependencies.
[0063] S2 may specifically include the following steps:
[0064] S21. Feature Profile Construction: For each task node in the task flow model... Establish a multi-dimensional feature profile, which includes the following three core feature categories:
[0065] Computational complexity characteristics include the number of floating-point operations and integer operations per frame of data, as well as the size of the data being processed. The data size includes the underwater acoustic frame length and the number of channels. For example, for... The task is to calculate the number of floating-point operations per frame. (N is the frame length), and the data size is 1024 points per channel.
[0066] Parallelism characteristics include the proportion of operations that can be executed in parallel within the task, the granularity of data parallel processing, and the existence of inter-thread dependencies; for example, for... The assessment shows that 85% of the data can be operated in parallel, with a data parallelism granularity of 256 points and no inter-thread dependencies.
[0067] Data throughput characteristics: including memory read / write bandwidth requirements and cache hit rate during task execution; for example, monitoring The task requires 800MB / s of memory read / write bandwidth and has a cache hit rate of approximately 65%.
[0068] S22. Cost Prediction Model Establishment: Based on the above feature profile, a cost prediction model is constructed. This model is used to predict costs based on the task. Feature profile to predict its performance in the processor Execution time on The cost prediction model Obtained through offline training or online learning using historical operational data.
[0069] The preferred approach is to use a linear regression model:
[0070]
[0071] Where A is the computational complexity feature, B is the parallelism feature, C is the data throughput feature, and b is the bias. The weight parameters are obtained through training on historical data. With bias b, or through an online learning mechanism: when the prediction error exceeds 15% for 5 consecutive times, the model parameters are updated. Multidimensional feature profiling accurately characterizes task features, and the machine learning model provides accurate execution time predictions, offering a reliable basis for load balancing decisions and significantly improving the accuracy of task allocation.
[0072] S3. Real-time Monitoring: Real-time monitoring includes system status parameters such as CPU utilization, GPU utilization, and CPU-GPU data transfer performance. For example, CPU utilization can be obtained through Linux's / proc / stat. Obtain GPU utilization through the NVML library Measure CPU-GPU data transfer bandwidth using CUDA Event timestamps and delay .
[0073] Monitoring Mechanism: Periodic Monitoring: System status is collected every 100ms; Event-Triggered Monitoring: Data is collected immediately when the GPU kernel starts or a data transfer operation is completed; System status parameters: Real-time sensing of system load changes provides data support for dynamic adjustments, effectively solving the problem of the lack of adaptability of static methods.
[0074] The dynamic programming algorithm described in S4 uses a backward recursive approach to calculate the state values, and its state transition equation is defined as follows:
[0075]
[0076] in, , for The set of all direct successor tasks, ∈ , Indicates task In processor When the above is executed, the shortest completion time of all its subsequent task flows. Indicates task In processor The predicted execution time is on the table. Indicates the data transfer time between processors;
[0077] After calculating the state values of all task nodes, starting from the initial task node, calculate the state value sequence for each task node. Choose the processor that minimizes the overall completion time. .
[0078] Algorithm initialization: from the final task start,
[0079] Reverse recursive calculation: Calculate the state values of each task in reverse topological order; state transition equation:
[0080] ,
[0081] in Calculate based on the current transmission bandwidth B(t): When hour, ;when hour, .
[0082] Optimal decision extraction: from To begin, select to make The smallest processor allocation sequence, recording the optimal allocation scheme. Global optimization takes into account computational and communication overhead, intelligently balances task allocation, significantly reduces the total completion time of task flows, and improves the overall system performance.
[0083] S5 may specifically include the following steps:
[0084] S51. Task Distribution and Execution: Based on the optimal processor allocation scheme obtained in step S4. The task scheduling is performed by a central scheduler, which schedules each task node sequentially according to the dependencies defined in the task flow model. Distributed to the corresponding target processor Perform calculations: when At this time, the central scheduler executes the task by creating CPU threads or processes. At that time, the central scheduler submits the corresponding task and related data to the GPU computing queue by calling the GPU computing API.
[0085] S52. Dynamic Feedback and Strategy Update: During execution, the latest system status parameters are continuously obtained through the monitoring mechanism established in step S3. When system load changes exceed a preset threshold or reach a fixed time period, the system re-executes the complete S3-S5 process and applies a new scheduling strategy. When CPU / GPU utilization changes by more than 20%, a re-decision is triggered or the complete S3-S5 process is executed periodically every 2 seconds.
[0086] S5 also includes S53, dynamic task granularity reorganization: when multiple consecutive lightweight task nodes are detected to be assigned to the same processor and the total computation is below a preset threshold, these task nodes are merged into a single scheduling unit; when the execution time of a single task node exceeds a preset upper limit, it is split into multiple subtasks for parallel execution based on the parallelism characteristics in its feature profile; the reorganization operation updates the topology of the task flow model in real time and triggers incremental updates to the scheduling strategy. For example, when When tasks are continuously allocated to the CPU and the total computation time is less than 1ms, they are merged into a composite task; when When the execution time is greater than 10ms, it is split into 4 subtasks based on parallel characteristics.
[0087] When calculating the state transition equation, the dynamic programming algorithm determines the task... and subsequent tasks If assigned to a heterogeneous processor, then pre-configured The output data is asynchronously copied to the target processor's cache area; during S5 task scheduling, a double-buffering strategy is used to process data input or output in parallel with the execution of the computation kernel, minimizing the data transfer time between processors. Overlapping is hidden within the computation time.
[0088] The S2-constructed feature profile is enhanced with an energy efficiency dimension, including processor dynamic power consumption, thermal design power margin, and energy consumption per unit operation. Constraints are added to the dynamic programming algorithm: when the system temperature exceeds a preset threshold or the battery level falls below a set value, the algorithm switches to an energy efficiency priority mode. Under the premise of meeting the soft constraint of total task completion time, tasks are preferentially assigned to the processor with the best energy efficiency characteristics, and the processor's operating frequency is dynamically adjusted accordingly. For example, when the system temperature is >80℃ or the battery level is <20%, the algorithm switches to energy efficiency priority mode. The energy efficiency model E(P) is constructed based on the processor's current frequency and historical power consumption.
[0089] In each task node of the task flow model G The above indicates the deadline constraint. The cutoff time is calculated based on the underwater acoustic frame length and processing frame rate; the state transition equation is modified into a constrained optimization problem: in the calculation At that time, if the candidate processor If this causes any subsequent task to violate the corresponding deadline constraint, then the candidate task will be removed from the list. Set to infinity; scan forward from the starting task node. When a non-satisfied dead-end constraint is detected, trigger task flow reconstruction, splitting the task nodes on the path into algorithm-level parallel components or reducing computational precision. Set a deadline for each task, such as... It must be completed within 20ms; failure to meet the deadline will trigger task splitting or accuracy degradation. It achieves true dynamic load balancing, maximizing system throughput and energy efficiency while ensuring real-time performance through continuous optimization and adaptive adjustment, making it particularly suitable for high-performance underwater acoustic processing applications.
[0090] Finally, it should be noted that the above preferred embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail through the above preferred embodiments, those skilled in the art should understand that various changes can be made to it in form and detail without departing from the scope defined by the claims of the present invention.
Claims
1. A CPU-GPU dynamic load balancing method based on a task flow model, characterized in that, Includes the following steps: S1. Construct a task flow model: Deconstruct the underwater acoustic processing task into a task flow model that includes multiple task nodes and the dependencies between nodes; S2. Construct a feature profile: Build a feature profile for each task node, and construct a cost prediction model based on the feature profile to predict the execution time of the task on different processors. S3. Real-time monitoring: Real-time monitoring includes system status parameters such as CPU utilization, GPU utilization, and CPU-GPU data transfer performance; S4. Task Decision: With the goal of minimizing the total completion time of the task flow model, and combining the cost prediction model and real-time system state parameters, a dynamic programming algorithm is used to allocate a corresponding processor to each task node. S5. Task Scheduling: Based on the decision result of S4, dynamically schedule tasks to CPU or GPU for execution, and periodically return to S3 to update the scheduling policy. S1 specifically includes the following steps: analyzing the overall process of the target underwater acoustic processing task, and deconstructing the target underwater acoustic processing application into a task flow model represented by a directed acyclic graph. ,in: Let E represent the set of task nodes, where each task node represents an atomic underwater acoustic processing task, including underwater acoustic frame acquisition, frequency domain filtering, Fourier transform, and echo cancellation; let E represent the set of directed edges. Indicates task The output is the task The input defines the data dependencies between tasks; S2 specifically comprises the following steps: S21, feature image construction: constructing a feature image for each task node in the task flow model A multi-dimensional feature image is established, which includes the following three types of core features: Computational complexity characteristics: including the number of floating-point operations and integer operations per frame of data, as well as the size of the data being processed, including the length of the underwater acoustic frame and the number of channels; Parallelism characteristics include the proportion of operations that can be executed in parallel within a task, the granularity of data parallel processing, and the existence of inter-thread dependencies. Data throughput characteristics include memory read / write bandwidth requirements and cache hit rate during task execution. S22. Cost Prediction Model Establishment: Based on the above feature profile, a cost prediction model is constructed. This model is used to predict costs based on task nodes. Feature profile to predict its performance in the processor Execution time on The cost prediction model uses a linear regression model: Where A is the computational complexity feature, B is the parallelism feature, C is the data throughput feature, and b is the bias, with weight parameters obtained through training on historical data. And bias b, or through an online learning mechanism: when the prediction error exceeds 15% for 5 consecutive times, the model parameters are updated.
2. The CPU-GPU dynamic load balancing method for underwater acoustic processing based on a task flow model according to claim 1, characterized in that: The dynamic programming algorithm described in S4 uses a backward recursive approach to calculate the state values, and its state transition equation is defined as follows: in, , for The set of all direct successor tasks, ∈ , Indicates task In processor When the above is executed, the shortest completion time of all its subsequent task flows. Indicates task In processor The predicted execution time is on the table. Indicates the data transfer time between processors; After calculating the state values of all task nodes, starting from the initial task node, calculate the state value sequence for each task node. Choose the processor that minimizes the overall completion time. .
3. The CPU-GPU dynamic load balancing method based on a task flow model according to claim 2, characterized in that: S5 specifically includes the following steps: S51. Task Distribution and Execution: Based on the optimal processor allocation scheme obtained in step S4. The task scheduling is performed by a central scheduler, which schedules each task node sequentially according to the dependencies defined in the task flow model. Distributed to the corresponding target processor Perform calculations: when At this time, the central scheduler executes the task by creating CPU threads or processes. At that time, the central scheduler submits the corresponding task and related data to the GPU computing queue by calling the GPU computing API; S52. Dynamic Feedback and Strategy Update: During execution, the latest system status parameters are continuously obtained through the monitoring mechanism established in step S3. When the system load changes beyond a preset threshold or reaches a fixed time period, the system re-executes the complete process from S3 to S5 and applies a new scheduling strategy.
4. The CPU-GPU dynamic load balancing method based on a task flow model according to claim 3, characterized in that: S5 also includes S53, dynamic task granularity reorganization: when multiple consecutive lightweight task nodes are detected to be assigned to the same processor and the total computation is lower than a preset threshold, these task nodes are merged into a single scheduling unit. When the execution time of a single task node exceeds the preset limit, it is split into multiple subtasks for parallel execution based on the parallelism characteristics in its feature profile; the reorganization operation updates the topology of the task flow model in real time and triggers incremental updates of the scheduling strategy.
5. The CPU-GPU dynamic load balancing method based on a task flow model according to claim 2, characterized in that: When calculating the state transition equation, the dynamic programming algorithm determines the task... and subsequent tasks If assigned to a heterogeneous processor, then pre-configured The output data is asynchronously copied to the target processor's cache area; During S5 task scheduling, a double-buffering strategy is employed to process data input or output in parallel with the execution of the computation kernel, minimizing the data transfer time between processors. Overlapping is hidden within the computation time.
6. The CPU-GPU dynamic load balancing method based on a task flow model according to claim 2, characterized in that: The energy efficiency feature dimension is added to the feature profile constructed by S2. The energy efficiency feature includes processor dynamic power consumption, thermal design power margin and unit computing power consumption ratio. Constraints are added to the dynamic programming algorithm. When the system temperature exceeds the preset threshold or the power is lower than the set value, the algorithm switches to the energy efficiency priority mode. Under the premise of meeting the soft constraint of the total completion time of the task flow, the task is preferentially assigned to the processor with the best energy efficiency feature, and the processor is dynamically adjusted in conjunction with the processor.
7. The CPU-GPU dynamic load balancing method based on a task flow model according to claim 2, characterized in that: In each task node of the task flow model G The above indicates the deadline constraint. The cutoff time is calculated based on the underwater acoustic frame length and processing frame rate; the state transition equation is modified into a constrained optimization problem: in the calculation At that time, if the candidate processor If this causes any subsequent task to violate the corresponding deadline constraint, then the candidate task will be removed from the list. Set to infinity; scan forward from the starting task node, and when a dead-line constraint that is not met is detected, trigger task flow reconstruction, and perform algorithm-level parallel splitting or downgrade the computational precision of the task nodes on the path.