Load balancing task scheduling method for grid hydrological model parallel computing

By applying Flink streaming processing technology and load balancing task scheduling algorithm based on resource feedback in the grid Xin'anjiang model, the problem of bottleneck in the calculation performance of traditional hydrological models is solved, and efficient and accurate hydrological data processing and simulation are achieved.

CN119621266APending Publication Date: 2025-03-14HOHAI UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411666464.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

Traditional hydrological models have computing performance bottlenecks under the requirements of large-scale data processing and real-time performance, which is difficult to meet the needs of real-time and large-scale data processing.

Method used

Flink streaming processing technology is used to apply to the five major modules of the grid Xin'anjiang model. By dividing the computing tasks into multiple subtasks and using Flink's distributed streaming processing architecture for parallel processing, combined with the load balancing task scheduling algorithm based on resource feedback, the load balancing of the cluster is realized.

Benefits of technology

The calculation efficiency and accuracy of the hydrological model are improved, the rapid and accurate processing of hydrological data is achieved, the time for hydrological process simulation is reduced, and the system cluster utilization and execution efficiency are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621266A_ABST
    Figure CN119621266A_ABST
Patent Text Reader

Abstract

The invention discloses a load balancing task scheduling method for grid hydrological model parallel computing. The method comprises the following steps: (1) analyzing a model based on component characteristics: analyzing four sub-model processing flows of a grid Xinanjiang model, and determining a model input file, related parameters, a calling relationship among the models and a model output result; the model is divided into three types of components, namely an independent calculation component, a time sequence dependence component and a space logic dependence component, and the processing mode of the components under a distributed parallel calculation framework is analyzed. And (2) Flink cluster construction and parallel algorithm design: according to the analysis, dividing a task into a plurality of sub-tasks, distributing the sub-tasks to different computing nodes, and processing the sub-tasks by using the parallel computing capability of the Flink. And (3) proposing a load balancing task scheduling algorithm based on resource feedback: aiming at the condition of non-uniform load in the distributed system, through real-time resource monitoring, distributing tasks in a waiting state in machines with heavy load to machines with light load so as to realize load balancing of the cluster. And (4) result integration: integrating calculation results of the models, and outputting a final hydrological simulation result. According to the load balancing task scheduling method for grid hydrological model parallel computing, distributed processing is carried out on subtasks of a grid Xinanjiang model through an Flink parallel computing framework, and the hydrological simulation computing efficiency is improved through load balancing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of hydrological model calculation, and in particular to a load balancing task scheduling method for parallel calculation of a grid hydrological model. Background Art

[0002] With the development of information technology and the widespread application of network technology and big data technology, data has become a very valuable asset, and informatization and automation are sought after by people. At the same time, more and more hydrological data are generated. These large amounts of hydrological data are of great significance in the field of hydrological forecasting and flood control and disaster prevention, ensuring the safety of people's lives and reducing unnecessary economic losses, and contributing to the rapid development of my country's economy and technology.

[0003] The grid hydrological model is a type of distributed hydrological model. It divides the watershed into multiple grid units. Each grid unit has independent parameters, data, initialization status, etc., which can more finely consider the spatial heterogeneity of various geographical factors in the watershed. The grid Xin'anjiang model is a distributed hydrological model built based on the principle of the Xin'anjiang model and DEM. The grid Xin'anjiang model uses each grid as a calculation unit. The evapotranspiration calculation, runoff calculation and water source calculation use the three-layer evapotranspiration model of the Xin'anjiang calculation principle, the full runoff model and the free water reservoir structure to divide the water source. Then the tension water storage capacity and free water storage capacity on each grid are calculated to obtain the runoff and three water sources of surface, soil and underground for each grid unit. According to the grid calculation order, the surface runoff and soil flow on each grid are calculated grid by grid according to the Muskingum method to the outlet of the watershed, and the underground runoff is calculated to the outlet of the watershed using the linear reservoir method in the Xin'anjiang model.

[0004] Traditional hydrological models have computing performance bottlenecks under large-scale data processing and real-time requirements. With the rapid growth of meteorological data, topographic data, and hydrological data, computing time and resource consumption have greatly increased, especially when simulating and predicting complex hydrological phenomena such as floods and runoff. Most of the existing parallel computing methods are based on traditional distributed computing frameworks, which are difficult to meet the real-time and large-scale data processing requirements. Therefore, how to achieve parallel computing of hydrological models through a more efficient distributed computing framework has become a current technical problem. Summary of the invention

[0005] Purpose of the invention: The purpose of the present invention is to solve the shortcomings of the prior art. Hydrological models usually need to process a large amount of hydrological data, including geographic information, rainfall data, terrain data, etc. Flink streaming processing technology is applied to the five modules of the Xinanjiang model to implement parallel computing methods, effectively process and manage these large-scale hydrological data, so as to improve computing efficiency and accuracy, and realize the collection, processing, distributed computing, analysis, storage and result display of hydrological data.

[0006] Technical solution: A load-balanced task scheduling method for parallel computing of a grid hydrological model. The method divides the computational task of the hydrological model into multiple subtasks, uses Flink's distributed stream processing architecture to process each subtask in parallel, and uses load balancing to improve the efficiency of hydrological simulation computing. The method includes the following steps:

[0007] Step S1: Model is based on component characteristics analysis. Preprocess the data of the four sub-models of the grid Xinanjiang model, obtain the input file of the model, obtain the relevant parameters of the model, determine the calling relationship of each model and the output file and output parameters of each model. Based on the analysis of component characteristics, it can be divided into the following three types: independent calculation components, time sequence dependent components, and spatial logic dependent components. Through different types of component analysis, the calculation processing method based on the distributed parallel computing framework is analyzed.

[0008] Step S2 builds a Flink cluster. According to the complexity and data volume of the computing task analyzed in step S1, the task is divided into multiple subtasks and assigned to different computing nodes. The parallel computing capability of Flink is used to perform parallel computing on each subtask to improve computing efficiency.

[0009] Step S3 addresses the uneven load situation in the distributed system by allocating waiting tasks in overloaded machines to lighter-loaded machines through real-time resource monitoring to achieve cluster load balancing. A load balancing task scheduling algorithm based on resource feedback is proposed.

[0010] Step S4 integrates the calculation results of each model in step 4 and outputs the final hydrological simulation results.

[0011] In the load balancing task scheduling method for parallel computing of a grid hydrological model as described above, the detailed process of step S1 is as follows:

[0012] Step S11 is divided into three types based on the characteristics of each component of the model. Among them, the independent calculation component is completely independent of the calculation of each grid unit, and there is no data dependency between them; the time sequence dependent component means that within the calculation unit, the calculation of the component at the current moment requires the calculation result of the component at the previous moment as an input parameter. Logically, the calculation unit is serially calculated within the hydrological simulation time, but parallel calculations can be performed between each grid unit, such as flow generation components and water source distribution components; spatial logic dependent components mean that the calculation of components within the step time needs to be executed in sequence from upstream to downstream in the calculation order. It is serially calculated in spatial logic, and still belongs to time sequence dependent components at the time level, such as confluence components.

[0013] Step S12 can analyze the parameter estimation module (GXAJPar module) to obtain independent calculation components: estimation of deep evapotranspiration coefficient, calculation of aeration zone thickness and related intermediate variables, and estimation of runoff distribution ratio. During these calculation processes, each grid is independent and each grid unit can be calculated in parallel. However, in the process of calculating the calculation order of the grid, the calculation order of the downstream grid needs to be derived based on the upstream grid, so they are spatially interdependent and cannot be calculated in parallel.

[0014] Step S13 analyzes the evapotranspiration capacity calculation module (GXAJETP module). The evapotranspiration capacity calculation of each grid in each time period is independent and does not interfere with each other. Therefore, this module belongs to an independent calculation component and parallel calculation can be considered.

[0015] Step S14 analyzes the three-layer evapotranspiration and runoff calculation module (GXAJSMS3 module), which mainly has two parts: runoff calculation and three-water source division calculation; for runoff calculation, it is necessary to calculate the evaporation and runoff of each grid in each time period, but the calculation process of each grid in each time period is independent, and there is no upstream and downstream dependency, so we can perform parallel calculations for runoff; for three-water source division calculation, the results of runoff calculation are needed, and the calculation process is also an independent calculation of each grid in each time period, which can be calculated in parallel. From the above analysis, we can conclude that although there is a dependency between runoff and three-water source division, the two calculation processes are independent of each other, and the two processes can be designed for parallel calculation separately.

[0016] Step S15 is for the analysis of the confluence module (GXAJLAG3 module), which is divided into two parts: slope confluence and river confluence. For the slope confluence stage, the confluence results of each grid in each time period need to be calculated, and they are relatively independent, without upstream and downstream dependencies, and can be calculated in parallel; for the river confluence stage, each grid in each time period needs to consider the confluence results of the previous time period and the confluence results of the upstream grid. There is a strong dependency, but the confluence calculation of the grids in the same time period and the same calculation order can still be calculated in parallel.

[0017] Furthermore, the step S2 uses the Flink parallel computing framework to improve the detailed process of the model as follows:

[0018] Step S21 designs a parallel computing method based on the analysis of the detailed process of step S1 and the characteristics of the Flink computing framework. Flink provides a distributed parallel execution framework, and you can regard each grid unit as an independent computing task. Parallel processing of independent computing tasks: In Flink, each grid unit can be mapped to an independent Task, and each task can be executed in parallel.

[0019] Step S22 is as follows:

[0020] 1. Data partitioning: First, divide the grid into multiple independent grid units, and treat the data in each unit as an independent partition. Flink supports partitioning data sets into different tasks, so that each task can be calculated in parallel.

[0021] 2. Task Slot Configuration: Flink's execution environment will allocate tasks to Task Slots based on available resources. Each computing node (i.e., each grid unit) can be used as an independent Task Slot. By adjusting the number of Task Slots and resource allocation, the degree of parallelism can be significantly improved. Task Manager will manage the concurrent execution of these tasks.

[0022] 3. Parallelism: You can set the parallelism parameter of Flink to determine the number of tasks to be executed in parallel. For example, if there are 100 grid units and the parallelism is set to 10, 10 grid units can be processed simultaneously, and the remaining 90 will queue up and wait for free Task Slots.

[0023] Furthermore, the step S3 designs a load balancing task scheduling algorithm based on resource feedback, and the detailed process of optimizing the model is as follows:

[0024] Step S31 first defines and explains the variables and formulas used in the algorithm. Let TM = {TM1, TM2, ..., TM m} is the set of resource nodes in the distributed system, T = {T1, T2, ..., T n} is a collection of all tasks that need to be executed.

[0025] Definition 1 (Total Task Completion Time) The total task completion time refers to the time from the start of the first task to the completion of the last task among all tasks, recorded as Total Time. The goal of load balancing is to make TotalTime as small as possible.

[0026] Definition 2 (Resource Node Performance Index) The performance index of a resource node is shown in formula (1):

[0027] Metric j =C1*Core_Num j *ω 1j +

[0028] C2*(1-ω 2j )*ω 3j , j = 1, 2, ..., m(1)

[0029] Among them, C1 and C2 are constants, Core_Num j Indicates resource node TM j The number of CPU cores, ω 1j Indicates resource node TM j CPU utilization, ω 2j Indicates resource node TM j Memory utilization, ω 3j Indicates resource node TM j Therefore, the resource node performance indicator Metric j It is determined by the number of CPU cores, CPU utilization, and free memory size, and is finally normalized.

[0030] Definition 3 (Resource node load value) The load value represents the capacity of the task load on the resource node relative to the current performance of the node. The smaller the load value, the better the node's ability to bear the load, that is, it can bear more tasks; conversely, the larger the load value, the worse the node's ability to bear the load, and it is necessary to reduce the tasks performed by the node. The definition of the load value is shown in formula (2):

[0031]

[0032] Among them, TaskNum j Indicates resource node TM j The number of tasks in the task queue; Metricj Represents resource node TM j Performance indicators, Metric j The larger the value, the better the performance of the resource node, and the more tasks it can process per unit time; conversely, the worse the performance of the resource node, and the fewer tasks it can process per unit time.

[0033] The definition of the cluster load average is shown in formula (3):

[0034]

[0035] Definition 4 (Cluster load value) The cluster load value indicates the load balance degree of the entire cluster, as shown in formula (4). If the cluster load value C_Load is less than the threshold β, it means that the overall load of the cluster is in a balanced state and the algorithm ends; otherwise, the larger the cluster load value, the higher the degree of cluster load imbalance. At this time, it is necessary to store the load value of each node and the cluster load value in the database to prepare for the next stage of task rescheduling.

[0036]

[0037] In step S32, if the cluster is in an unbalanced state, it is necessary to schedule tasks of resource nodes with a larger load to resource nodes with a smaller load, so as to achieve resource load balancing and improve system cluster utilization and execution efficiency.

[0038] Furthermore, the detailed process of integrating the parallel computing results in step S4 is as follows:

[0039] After the subtasks in steps S2 and S3 are calculated in parallel, step S41 needs to summarize the calculation results of each grid and generate the required result files.

[0040] Step S42 saves the calculation results: for the calculation results of each grid unit, the results can be directly stored in the corresponding position of the two-dimensional array after the calculation is completed.

[0041] After the calculation in step S43 is completed, the entire result is output to the NC file.

[0042] Beneficial effects of the invention: The application scenario of the invention is data processing and distributed computing in the hydrological field. The focus of the invention is to find an efficient parallel computing data processing method based on the Flink parallel computing framework through an in-depth analysis of the grid Xin'anjiang model, and to achieve cluster load balancing based on resource feedback load balancing task scheduling, thereby achieving fast and accurate hydrological data processing, improving system cluster utilization and execution efficiency, and reducing the time of hydrological process simulation. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is a model framework diagram of the parallel computing method of the grid Xinanjiang model based on Flink of the present invention;

[0044] Figure 2 It is a diagram of the results of the model calculation process classified according to the component type;

[0045] Figure 3 This is the parameter flow chart of the Xinanjiang model calculation process;

[0046] Figure 4 It is a calculation flow chart of independent calculation components;

[0047] Figure 5 This is the overall framework diagram of the load balancing task scheduling algorithm based on resource feedback. DETAILED DESCRIPTION

[0048] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific implementation modes, but the protection scope of the present invention is not limited to the scope of the embodiments.

[0049] The embodiment of the present invention provides a load balancing task scheduling method for parallel computing of a grid hydrological model, comprising the following steps:

[0050] Step S1: Model is based on component characteristics analysis. Preprocess the data of the four sub-models of the grid Xinanjiang model, obtain the input file of the model, obtain the relevant parameters of the model, determine the calling relationship of each model and the output file and output parameters of each model. Based on the analysis of component characteristics, it can be divided into the following three types: independent calculation components, time sequence dependent components, and spatial logic dependent components. Through different types of component analysis, the calculation processing method based on the distributed parallel computing framework is analyzed.

[0051] Step S2 builds a Flink cluster. According to the complexity and data volume of the computing task analyzed in step S1, the task is divided into multiple subtasks and assigned to different computing nodes. The parallel computing capability of Flink is used to perform parallel computing on each subtask to improve computing efficiency.

[0052] Step S3 addresses the uneven load situation in the distributed system by allocating waiting tasks in overloaded machines to lighter-loaded machines through real-time resource monitoring to achieve cluster load balancing. A load balancing task scheduling algorithm based on resource feedback is proposed.

[0053] Step S4 integrates the calculation results of each model in step 4 and outputs the final hydrological simulation results.

[0054] The specific implementation steps of the present invention are as follows:

[0055] In step S1 of the embodiment of the present invention, referring to Figure 3 The characteristics of the grid Xinanjiang model are analyzed and divided into three types based on the characteristics of each component of the model. In this example, the independent calculation components in the model are mainly processed. Figure 4 This is a processing logic flow chart of independent computing components. Time sequence dependent components and spatial logic dependent components are not processed for the time being. Figure 2 The model calculation process is shown in the diagram with the result classified according to the component type.

[0056] Further, see Figure 1 In the example of the present invention, step S2 first builds the Flink parallel computing framework. The deployed Flink cluster has three nodes: Hadoop102, Hadoop103, and Hadoop104. Hadoop102 is the JobManager responsible for task scheduling, and the rest, including itself, are TaskManagers to handle tasks. Test our environment in YARN operation mode. The deployment process on YARN is that the client submits the Flink application to Yarn's ResourceManager, and Yarn's ResourceManager applies for a container from Yarn's NodeManager. On these containers, Flink deploys instances of JobManager and TaskManager to start the cluster. Flink dynamically allocates TaskManager resources according to the number of slots required for the job running on the JobManger. Start the cluster and start the yarn resource manager. The cluster node deployment is shown in Table 1:

[0057] Table 1

[0058]

[0059] In step S4, Flink relies on the DataSet API to process batch data. For independent computing tasks in the grid model, parallel computing is achieved in the following ways: ①. Map Transformation: The calculation of each grid unit is processed through the map() function. Flink's map() operation maps an input to an output, and uses this feature to achieve parallel processing of independent computing tasks. DataStream represents Flink's data stream, which can contain multiple grid units, and the calculation of each grid unit is independent of each other; MapFunction can define the calculation logic of each grid unit in the map() function, such as the estimation of deep evapotranspiration coefficient; Parallelism can set the parallelism through the setParallelism() method to ensure that multiple tasks run simultaneously. ②. Task Slot allocation: Flink's parallelism is managed through Task Slot. Each Task Slot can process the calculation of multiple grid units. By configuring Task Slot, resource utilization can be improved. Find the taskmanager.numberOfTaskSlots parameter in the Flink configuration file and set it to 4, indicating that each Task Manager has 4 slots.

[0060] In step S3 of the embodiment of the present invention, see Figure 5 The overall framework diagram of the load balancing task scheduling algorithm based on resource feedback. When the cluster load value is greater than or equal to β, for each resource node TM in the cluster j , according to the getOperatingSystemMXBean method in the Management Factory class of the monitoring and management Java Virtual Machine (JVM) management interface, obtain the underlying performance indicators of the resource node and calculate the number of CPU cores Core_Num of the node TMj j 、CPU utilization ω 1j and the amount of free memory ω 2j According to equations (1) and (2), we can get the resource node TM j Performance Metrics j and Load value j ; The cluster load value is obtained according to formula (4), and the load value of each node and the cluster load value are put into the database until the cluster load value is less than the threshold β, that is, the cluster achieves overall load balancing.

[0061] In step S3, according to the load value, the tasks of the nodes with larger load are scheduled to the nodes with smaller load. The specific steps are as follows: select the task set to be scheduled from the node TMi with high load; use Flink's DataStream API to migrate the task set to the node with smaller load, and dynamically adjust the load value of the node. After each load adjustment, the cluster load information is stored in the database or persistent storage to analyze the effect of load balancing and optimize the scheduling algorithm. Repeat step S32 until all nodes reach load balance.

[0062] In step S4 of the example of the present invention, the calculation results of each grid are integrated, and the integrated result data is output to the NC file. The implementation process is: first, a two-dimensional array is defined to store the calculation results of each grid unit. During the calculation process, the tasks of the grid units are assigned in parallel, and the calculations of each grid unit are performed independently, avoiding the performance bottleneck of serial calculations. The calculation results of each grid unit will be synchronously stored in the corresponding array position in a thread-safe manner. After the calculation is completed, all calculation results are integrated and output to the specified NC file for subsequent processing and analysis. This method effectively solves the performance problems in large-scale grid computing and ensures the correctness and integrity of the result data.

Claims

1. A load balancing task scheduling method for parallel computing of a grid hydrological model, characterized in that: The following steps are involved: Step S1: Model is based on component characteristics analysis. Preprocess the data of the four sub-models of the grid Xinanjiang model, obtain the input file of the model, obtain the relevant parameters of the model, determine the calling relationship of each model and the output file and output parameters of each model. Based on the analysis of component characteristics, it can be divided into the following three types: independent calculation components, time sequence dependent components, and spatial logic dependent components. Through different types of component analysis, the calculation processing method based on the distributed parallel computing framework is analyzed. Step S2 builds a Flink cluster. According to the complexity and data volume of the computing task analyzed in step S1, the task is divided into multiple subtasks and assigned to different computing nodes. The parallel computing capability of Flink is used to perform parallel computing on each subtask to improve computing efficiency. Step S3 addresses the uneven load situation in the distributed system by allocating waiting tasks in overloaded machines to lighter-loaded machines through real-time resource monitoring to achieve cluster load balancing. A load balancing task scheduling algorithm based on resource feedback is proposed. Step S4 integrates the calculation results of each model in step 4 and outputs the final hydrological simulation results.

2. A load balancing task scheduling method for parallel computing of a grid hydrological model according to claim 1, characterized in that: The detailed process of step S1 based on component characteristics analysis is as follows: Step S11 is divided into three types based on the characteristics of each component of the model. Among them, the independent calculation component is completely independent of the calculation of each grid unit, and there is no data dependency between them; the time sequence dependent component means that within the calculation unit, the calculation of the component at the current moment requires the calculation result of the component at the previous moment as an input parameter. Logically, the calculation unit is serially calculated within the hydrological simulation time, but parallel calculations can be performed between each grid unit, such as flow generation components and water source distribution components; spatial logic dependent components mean that the calculation of components within the step time needs to be executed in sequence from upstream to downstream in the calculation order. It is serially calculated in spatial logic, and still belongs to time sequence dependent components at the time level, such as confluence components. Step S12 can analyze the parameter estimation module (GXAJPar module) to obtain independent calculation components: estimation of deep evapotranspiration coefficient, calculation of aeration zone thickness and related intermediate variables, and estimation of runoff distribution ratio. During these calculation processes, each grid is independent and each grid unit can be calculated in parallel. However, in the process of calculating the calculation order of the grid, the calculation order of the downstream grid needs to be derived based on the upstream grid, so they are spatially interdependent and cannot be calculated in parallel. Step S13 analyzes the evapotranspiration capacity calculation module (GXAJETP module). The evapotranspiration capacity calculation of each grid in each time period is independent and does not interfere with each other. Therefore, this module belongs to an independent calculation component and parallel calculation can be considered. Step S14 analyzes the three-layer evapotranspiration and runoff calculation module (GXAJSMS3 module), which mainly has two parts: runoff calculation and three-water source division calculation: For runoff calculation, it is necessary to calculate the evaporation and runoff of each grid in each time period, but the calculation process of each grid in each time period is independent, and there is no upstream and downstream dependency, so we can perform parallel calculations for runoff; for three-water source division calculation, the results of runoff calculation are needed, and the calculation process is also an independent calculation of each grid in each time period, which can be calculated in parallel. From the above analysis, we can conclude that although there is a dependency between runoff and three-water source division, the two calculation processes are independent of each other, and the two processes can be designed for parallel calculation separately. Step S15 is for the analysis of the confluence module (GXAJLAG3 module), which is divided into two parts: slope confluence and river confluence. For the slope confluence stage, the confluence results of each grid in each time period need to be calculated, and they are relatively independent, without upstream and downstream dependencies, and can be calculated in parallel; for the river confluence stage, each grid in each time period needs to consider the confluence results of the previous time period and the confluence results of the upstream grid. There is a strong dependency, but the confluence calculation of the grids in the same time period and the same calculation order can still be calculated in parallel.

3. A load balancing task scheduling method for parallel computing of a grid hydrological model according to claim 1, characterized in that: The parallel calculation design analysis process in step S2 is as follows: Step S21 designs a parallel computing method based on the analysis of the detailed process of step S1 and the characteristics of the Flink computing framework. Flink provides a distributed parallel execution framework, and you can regard each grid unit as an independent computing task. Parallel processing of independent computing tasks: In Flink, each grid unit can be mapped to an independent Task, and each task can be executed in parallel. Step S22 is as follows: (1) Data partitioning: First, divide the grid into multiple independent grid units, and treat the data in each unit as an independent partition. Flink supports partitioning data sets into different tasks, so that each task can be calculated in parallel. (2) Task Slot Configuration: Flink's execution environment will allocate tasks to Task Slots based on available resources. Each computing node (i.e., each grid unit) can serve as an independent Task Slot. By adjusting the number of Task Slots and resource allocation, the degree of parallelism can be significantly improved. Task Manager will manage the concurrent execution of these tasks. Parallelism: You can set the parallelism parameter of Flink to determine the number of tasks to be executed in parallel. For example, if there are 100 grid units and the parallelism is set to 10, 10 grid units can be processed simultaneously, and the remaining 90 will queue up and wait for free Task Slots.

4. According to the load balancing task scheduling method for parallel computing of a grid hydrological model according to claim 1, the design process of the load balancing task scheduling algorithm based on resource feedback in step S3 is: Step S31 first defines and explains the variables and formulas used in the algorithm. Let TM = {TM1, TM2, ..., TM n } is the set of resource nodes in the distributed system, T = {T1, T2, ..., T n } is a collection of all tasks that need to be executed. Definition 1 (Total Task Completion Time) The total task completion time refers to the time from the start of the first task to the completion of the last task among all tasks, recorded as Total Time. The goal of load balancing is to make the Total Time as small as possible. Definition 2 (Resource Node Performance Index) The performance index of a resource node is shown in formula (1): in, C1, C2 are constants, Core_Num j Indicates resource node TM j The number of CPU cores, ω 1j Indicates resource node TM j CPU utilization, ω 2j Indicates resource node TM j Memory utilization, ω 3j Indicates resource node TM j Therefore, the resource node performance indicator Metric j It is determined by the number of CPU cores, CPU utilization, and free memory size, and is finally normalized. Definition 3 (Resource node load value) The load value represents the task load on the resource node relative to the current performance of the node. The smaller the load value, the better the node's ability to bear the load, that is, it can bear more tasks; On the contrary, the larger the load value, the worse the node's ability to bear the load, and the tasks performed by the node need to be reduced. The definition of the load value is shown in formula (2): Among them, TaskNum j Indicates resource node TM j The number of tasks in the task queue; Metric j Represents resource node TM j Performance indicators, Metric j The larger the value, the better the performance of the resource node, and the more tasks can be processed in a unit time; On the contrary, the worse the performance of the resource node is, the fewer tasks it can process per unit time. The definition of the cluster load average is shown in formula (3): Definition 4 (Cluster load value) The cluster load value indicates the load balance degree of the entire cluster, as shown in formula (4). If the cluster load value C_Load is less than the threshold β, it means that the overall load of the cluster is in a balanced state and the algorithm ends; otherwise, the larger the cluster load value, the higher the degree of cluster load imbalance. At this time, it is necessary to store the load value of each node and the cluster load value in the database to prepare for the next stage of task rescheduling. In step S32, if the cluster is in an unbalanced state, it is necessary to schedule tasks of resource nodes with a larger load to resource nodes with a smaller load, so as to achieve resource load balancing and improve system cluster utilization and execution efficiency.

5. The method for load balancing task scheduling of parallel computing of a grid hydrological model according to claim 1, characterized in that: The process of integrating the calculation results in step S4 is as follows: After the parallel calculations in steps S3 and S4, step S41 needs to summarize the calculation results of each grid and generate the required result files. Step S42 saves the calculation results: for the calculation results of each grid unit, the results can be directly stored in the corresponding position of the two-dimensional array after the calculation is completed. After the calculation in step S43 is completed, the entire result is output to the NC file.

Citation Information

Cited By

  • Efficient multi-source data output method based on FlinkSql

    CN120255863A