Task algorithm assignment system and method in a server system

CN121658174BActive Publication Date: 2026-10-27WUHAN ZHUOHAO TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511740618.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-25
Publication Date
2026-10-27
Estimated Expiration
2045-11-25

AI Technical Summary

Technical Problem

[0005]本发明的目的在于提供一种服务器系统中任务算法分配系统及方法,旨在解决现有技术中的架构选择固化,任务决策维度单一,未结合任务实时性、复杂度、安全等级进行量化优先级划分,缺乏架构级的动态切换与闭环反馈机制,面对节点故障或任务属性突变时,系统可用性难以保障的技术问题

Benefits of technology

1、克服计算架构选择固化的局限性,通过“任务耦合度C+节点算力异构度H+节点算力F”的三维指标动态筛选适配架构,覆盖高并发、强实时、异构化任务的全场景需求,避免单一架构处理不同类型任务时的资源浪费,大幅提升异构集群的资源利用率与任务处理适配性;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure SMS_1
    Figure SMS_1
  • Figure SMS_2
    Figure SMS_2
  • Figure SMS_3
    Figure SMS_3
Patent Text Reader

Abstract

The application relates to the technical field of task algorithm distribution, and particularly discloses a task algorithm distribution system and method in a server system, which covers the full-scene requirements of high concurrency, strong real-time and heterogeneous tasks through a three-dimensional index dynamic screening adaptive architecture of "task coupling degree C+node computing power heterogeneity H+node computing power F", avoids resource waste when a single architecture processes different types of tasks, greatly improves the resource utilization rate and task processing adaptability of a heterogeneous cluster, quantizes task characteristics in combination with an analytic hierarchy process to distribute weights, quantizes the task characteristics into a task comprehensive score P and maps four gradient priorities and time delay threshold values, ensures that different attribute tasks can match accurate resources and time delay protection, improves service quality stability, reduces system energy consumption while ensuring that tasks are completed on time, realizes collaborative optimization, and ensures that a reinforcement learning model always maintains high prediction accuracy and continuously outputs an optimal distribution scheme.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of task algorithm allocation technology, and in particular to a task algorithm allocation system and method in a server system. Background Technology

[0002] Currently, with the rapid development of cloud computing, big data, and edge computing technologies, the tasks carried by servers are characterized by high concurrency, strong real-time performance, and heterogeneity. The system processing pressure is increasing day by day. To achieve efficient resource utilization and service quality assurance, reasonable task algorithm methods are needed. Common server task algorithm architectures and algorithms include master-slave architecture, peer-to-peer architecture, and traditional heuristic algorithms. In the master-slave architecture, the master node centrally manages task allocation, which can ensure task reliability, but resource utilization is low when facing highly parallel, dependency-free tasks, and the master node can easily become a bottleneck. In the peer-to-peer architecture, each node has equal status and is suitable for parallel tasks, but it is difficult to handle highly coupled dependency tasks and is prone to data interaction chaos. Traditional heuristic algorithms are mostly based on static rules or single-objective optimization, which are prone to getting trapped in local optima in heterogeneous clusters and lack dynamic feedback adjustment capabilities.

[0003] Existing technologies have significant shortcomings: the architecture selection is rigid, the task decision-making dimension is singular, the priority division is not based on the task's real-time performance, complexity, and security level, and there is a lack of architecture-level dynamic switching and closed-loop feedback mechanisms. When faced with node failures or sudden changes in task attributes, the system availability is difficult to guarantee.

[0004] Therefore, there is an urgent need for a server task allocation technology that can dynamically adapt to the architecture, make multi-dimensional quantitative decisions, perform multi-objective collaborative optimization, and has self-healing capabilities, in order to meet the allocation needs of diverse tasks in heterogeneous clusters. Summary of the Invention

[0005] The purpose of this invention is to provide a task algorithm allocation system and method in a server system, aiming to solve the technical problems in the prior art, such as fixed architecture selection, single task decision dimension, lack of quantitative priority division based on task real-time performance, complexity, and security level, lack of architecture-level dynamic switching and closed-loop feedback mechanism, and difficulty in guaranteeing system availability when facing node failures or sudden changes in task attributes.

[0006] To achieve the above objectives, the present invention employs a task allocation algorithm method in a server system, comprising the following steps: Collect task coupling degree C and node computing power F, calculate node computing power heterogeneity H, and select suitable computing architectures from master-slave architecture, peer-to-peer architecture and hybrid architecture based on task coupling degree C and node computing power heterogeneity H. Task features are extracted, including data volume V, computational complexity K, real-time level R, and encryption level S. The weights of the task features are assigned using the analytic hierarchy process (AHP). After standardizing the values ​​of each task feature, the overall task score P is calculated. Based on the overall task score P, four priority levels (urgent, high, medium, and low) and corresponding latency thresholds are mapped. The server hardware load data and energy consumption data are collected dynamically and periodically. The server hardware load data includes the number of idle CPUs, the amount of memory remaining, and the I / O throughput. The energy consumption data includes the energy consumption per unit of computing power E and the heat dissipation energy consumption T. The server hardware load data and energy consumption data are processed by min-max normalization to calculate the comprehensive computing power evaluation value Q. The algorithm integrates the computing architecture type, task comprehensive score P, and comprehensive computing power evaluation value Q. It inputs these values ​​into a reinforcement learning model with the dual optimization objectives of minimizing average task latency and minimizing total system energy consumption. The algorithm generates and executes an allocation scheme. The integrated computing architecture types include master-slave, peer-to-peer, and hybrid architectures. In a master-slave architecture, tasks are centrally allocated to master nodes, while slave nodes only execute tasks; the master-slave interaction latency is ≤50ms. In a peer-to-peer architecture, tasks are distributed with locks to prevent collisions; the task load on a single node is ≤70% of the maximum computing power, and the load difference is ≤15%. In a hybrid architecture, tasks with P≥0.7 are allocated to the master-slave architecture, and tasks with P<0.7 are allocated to the peer-to-peer architecture; cross-architecture data is transmitted incrementally. The reinforcement learning model is trained on ≥100,000 valid samples. The actual latency Tact and predicted latency Tpre of the server are collected and the deviation rate D is calculated. The parameters of the reinforcement learning model are then adjusted in a graded manner based on the deviation rate D. By verifying node status through a heartbeat mechanism and task progress, an architecture switch is triggered when a fault or performance abnormality is detected. The system then returns and re-selects a suitable computing architecture, regenerates the task allocation scheme, and ensures that the task interruption time is ≤200ms.

[0007] The formula for calculating the task coupling degree C is as follows: In the formula, C1 is the number of subtasks with upstream and downstream execution relationships; C2 is the total number of subtasks; The formula for calculating the node computing power heterogeneity H is as follows: In the formula, Fmax is the computing power of the strongest node; Fmin is the computing power of the weakest node; The formula for calculating the node computing power F is as follows: In the formula, U is the number of CPU cores; Z is the clock speed in GHz; and N is the memory capacity in GB. Computational architecture selection: If C≥60% and H≤20%, then a master-slave architecture should be selected. If C > 30% and H ≥ 40%, then choose the peer-to-peer architecture; In other cases, a hybrid architecture is chosen.

[0008] In the process of allocating task feature weights using the analytic hierarchy process (AHP) and standardizing the feature values ​​of each task to calculate the overall task score P: The formula for calculating the overall task score P is as follows: In the formula, Wv+Wk+Wr+Ws=1, and Wr≥0.3; Data volume V standardized values: ≥10GB is 1.0; 1~10GB is 0.8; 0.1~1GB is 0.5; <0.1GB is 0.2; Standardized values ​​for computational complexity K: High is 1.2; Medium is 1.0; Low is 0.8. Normalized R values ​​for real-time risk level: Emergency 1.0; High 0.8; Medium 0.5; Low 0.3; Encryption level S standardized values: Confidential: 1.2; Sensitive: 1.0; Normal: 0.6.

[0009] Among them, the mapping of four priority levels (urgent, high, medium, and low) and corresponding delay thresholds based on the overall task score P: When P ≥ 0.9, it is an emergency priority, and the delay threshold is ≤ 500ms; When 0.7 ≤ P < 0.9, it is considered high priority, with a delay threshold of ≤ 2s; When 0.4 ≤ P < 0.7, it is a medium priority, with a delay threshold of ≤ 5s; When P < 0.4, it is a low priority, and the delay threshold is ≤ 10s.

[0010] The formula for calculating the energy consumption per unit of computing power, E, is as follows: In the formula, E1 is the total energy consumption after the task; E2 is the baseline energy consumption in the first minute before the task; and E3 is the amount of energy completed in the task. Standardized values ​​for heat dissipation energy consumption T: 1.0 when server temperature ≤ 35℃ and fan speed < 50%; 0.7 when server temperature 35~50℃ and fan speed 50~80%; 0.3 when server temperature > 50℃ or fan speed ≥ 80%. The formula for calculating the hardware load normalized value L is: The formula for calculating the comprehensive computing power assessment value Q is: In the formula, the rated energy consumption is the energy consumption of the server per unit of task completed under 100% hardware load; The min-max normalization calculation method is as follows: The calculation accuracy is ≤1%, and X' is the normalized standard value.

[0011] In this process, the actual latency Tact of the acquisition server is compared with the predicted latency Tpre, and the deviation rate D is calculated. Based on the deviation rate D, the parameters of the reinforcement learning model are adjusted in a tiered manner. The formula for calculating the deviation rate D is as follows: When D < 10%, the learning rate is fine-tuned to 0.001~0.005; When 10%≤D≤30%, adjust the number of hidden layer nodes in the neural network according to the direction of the deviation. If D∈[10%,20%] and the predicted latency Tpre of the reinforcement learning model is consistently lower than the actual latency Tact, increase the number of hidden layer nodes by 10%~15%; if D∈[20%,30%] and the predicted latency Tpre of the reinforcement learning model is consistently higher than the actual latency Tact, decrease the number of hidden layer nodes by 15%~20%. When D > 30%, based on historical samples with a bias rate < 20%, prioritize retraining the output layer parameters and the hidden layer parameters directly connected to the output layer of the reinforcement learning model. After retraining, the prediction accuracy is improved by ≥ 15%.

[0012] The dynamic cycle rule is as follows: The initial acquisition period is 10 seconds; When the number of tasks to be assigned is ≥5 × the number of servers, the collection cycle is shortened to 5 seconds. When the number of tasks to be assigned is less than 1 / 3 × the number of servers, the collection cycle is extended to 20 seconds.

[0013] If a heartbeat packet is sent at a frequency of 100ms / time, and no heartbeat response is received for 3 consecutive times with a cumulative duration of 300ms, or if the task progress does not change within 10 seconds, it is determined to be a node failure. When the master node fails, the slave node with the highest comprehensive computing power evaluation value Q is selected for upgrade, with a switching latency of ≤300ms.

[0014] The present invention also provides a task algorithm allocation system for a server system, for executing the task algorithm allocation method for a server system as described above, including an architecture decision module, a task feature module, a status monitoring module, an intelligent allocation module, a feedback optimization module, and an exception handling module; The architecture decision module is used to calculate the task coupling degree C, the node computing power heterogeneity H, and the node computing power F. It outputs the results of the filtered computing architecture within 100ms and triggers the switching mechanism. The task feature module is used to extract task features and substitute them into the P-value formula for calculation, generating data with priority identifiers within 20ms. The status monitoring module is used to collect data according to a dynamic cycle, synchronously calculate the hardware load normalization value L, unit computing power energy consumption E, heat dissipation energy consumption T, and comprehensive computing power evaluation value Q, and output the allocation scheme within 10ms. The intelligent allocation module is used to load the reinforcement learning model, input the P value and Q value, and output the allocation scheme within 10ms. The feedback optimization module is used to collect Tact and Tpre data to calculate the deviation rate D, adjust parameters according to rules, and take effect within 1 minute. The anomaly handling module is used to monitor the heartbeat mechanism and triggers a switch within 50ms after a fault. The architecture decision module, the task feature module, the status monitoring module, the intelligent allocation module, the feedback optimization module, and the exception handling module interact through a ≥10Gb internal bus, and the redundancy switching latency is ≤10ms when a single module fails.

[0015] The task allocation system and method in a server system of the present invention have the following beneficial effects: 1. Overcome the limitations of fixed computing architecture selection. Dynamically select and adapt the architecture through three-dimensional indicators of "task coupling degree C + node computing power heterogeneity H + node computing power F". Cover the full-scenario requirements of high concurrency, strong real-time and heterogeneous tasks. Avoid resource waste when a single architecture processes different types of tasks. Significantly improve the resource utilization and task processing adaptability of heterogeneous clusters. 2. To address the issue of a single dimension in traditional task decision-making, the quantification of task characteristics is combined with the analytic hierarchy process (AHP) to allocate weights. Task characteristics are quantified into a comprehensive task score P and mapped to a four-tier priority and time delay threshold. This avoids task scheduling chaos caused by neglecting real-time performance and security levels, ensuring that tasks with different attributes can be matched with accurate resource and latency guarantees, thereby improving service quality and stability. 3. To overcome the limitations of traditional single-objective optimization, this approach takes minimizing the average task latency and minimizing the total system energy consumption as dual optimization objectives. It integrates architecture type, task comprehensive score P, and comprehensive computing power evaluation value Q into the reinforcement learning model, and formulates execution rules for different architectures. This ensures that tasks are completed on time while reducing system energy consumption, thus achieving collaborative optimization. 4. To address the issue of insufficient dynamic feedback mechanisms, the deviation rate D is calculated by collecting the actual latency Tact and the predicted latency Tpre. The model parameters are then adjusted according to the hierarchical rules to prevent the model from falling into local optima due to sudden changes in task attributes or system state. This ensures that the reinforcement learning model always maintains high prediction accuracy and continuously outputs the optimal allocation scheme. Detailed Implementation

[0016] This invention provides a task allocation algorithm method in a server system, comprising the following steps: Collect task coupling degree C and node computing power F, calculate node computing power heterogeneity H, and select suitable computing architectures from master-slave architecture, peer-to-peer architecture and hybrid architecture based on task coupling degree C and node computing power heterogeneity H. Task features are extracted, including data volume V, computational complexity K, real-time level R, and encryption level S. The weights of the task features are assigned using the analytic hierarchy process (AHP). After standardizing the values ​​of each task feature, the overall task score P is calculated. Based on the overall task score P, four priority levels (urgent, high, medium, and low) and corresponding latency thresholds are mapped. The server hardware load data and energy consumption data are collected dynamically and periodically. The server hardware load data includes the number of idle CPUs, the amount of memory remaining, and the I / O throughput. The energy consumption data includes the energy consumption per unit of computing power E and the heat dissipation energy consumption T. The server hardware load data and energy consumption data are processed by min-max normalization to calculate the comprehensive computing power evaluation value Q. The algorithm integrates the computing architecture type, task comprehensive score P, and comprehensive computing power evaluation value Q. It inputs these values ​​into a reinforcement learning model with the dual optimization objectives of minimizing average task latency and minimizing total system energy consumption. The algorithm generates and executes an allocation scheme. The integrated computing architecture types include master-slave, peer-to-peer, and hybrid architectures. In a master-slave architecture, tasks are centrally allocated to master nodes, while slave nodes only execute tasks; the master-slave interaction latency is ≤50ms. In a peer-to-peer architecture, tasks are distributed with locks to prevent collisions; the task load on a single node is ≤70% of the maximum computing power, and the load difference is ≤15%. In a hybrid architecture, tasks with P≥0.7 are allocated to the master-slave architecture, and tasks with P<0.7 are allocated to the peer-to-peer architecture; cross-architecture data is transmitted incrementally. The reinforcement learning model is trained on ≥100,000 valid samples. The actual latency Tact and predicted latency Tpre of the server are collected and the deviation rate D is calculated. The parameters of the reinforcement learning model are then adjusted in a graded manner based on the deviation rate D. By verifying node status through a heartbeat mechanism and task progress, an architecture switch is triggered when a fault or performance abnormality is detected. The system then returns and re-selects a suitable computing architecture, regenerates the task allocation scheme, and ensures that the task interruption time is ≤200ms.

[0017] Furthermore, the formula for calculating the task coupling degree C is as follows: In the formula, C1 is the number of subtasks with upstream and downstream execution relationships; C2 is the total number of subtasks; The formula for calculating the node computing power heterogeneity H is as follows: In the formula, Fmax is the computing power of the strongest node; Fmin is the computing power of the weakest node; The formula for calculating the node computing power F is as follows: In the formula, U is the number of CPU cores; Z is the clock speed in GHz; and N is the memory capacity in GB. Computational architecture selection: If C≥60% and H≤20%, then a master-slave architecture should be selected. If C > 30% and H ≥ 40%, then choose the peer-to-peer architecture; In other cases, a hybrid architecture is chosen.

[0018] Furthermore, in the step of allocating task feature weights using the analytic hierarchy process (AHP) and standardizing the feature values ​​of each task to calculate the overall task score P: The formula for calculating the overall task score P is as follows: In the formula, Wv+Wk+Wr+Ws=1, and Wr≥0.3; Data volume V standardized values: ≥10GB is 1.0; 1~10GB is 0.8; 0.1~1GB is 0.5; <0.1GB is 0.2; Standardized values ​​for computational complexity K: High is 1.2; Medium is 1.0; Low is 0.8. Normalized R values ​​for real-time risk level: Emergency 1.0; High 0.8; Medium 0.5; Low 0.3; Encryption level S standardized values: Confidential: 1.2; Sensitive: 1.0; Normal: 0.6.

[0019] Furthermore, in the step of mapping four priority levels (urgent, high, medium, and low) and corresponding latency thresholds based on the overall task score P: When P ≥ 0.9, it is an emergency priority, and the delay threshold is ≤ 500ms; When 0.7 ≤ P < 0.9, it is considered high priority, with a delay threshold of ≤ 2s; When 0.4 ≤ P < 0.7, it is a medium priority, with a delay threshold of ≤ 5s; When P < 0.4, it is a low priority, and the delay threshold is ≤ 10s.

[0020] Furthermore, the formula for calculating the energy consumption per unit of computing power, E, is as follows: In the formula, E1 is the total energy consumption after the task; E2 is the baseline energy consumption in the first minute before the task; and E3 is the amount of energy completed in the task. Standardized values ​​for heat dissipation energy consumption T: 1.0 when server temperature ≤ 35℃ and fan speed < 50%; 0.7 when server temperature 35~50℃ and fan speed 50~80%; 0.3 when server temperature > 50℃ or fan speed ≥ 80%. The formula for calculating the hardware load normalized value L is: The formula for calculating the comprehensive computing power assessment value Q is: In the formula, the rated energy consumption is the energy consumption of the server per unit of task completed under 100% hardware load; The min-max normalization calculation method is as follows: The calculation accuracy is ≤1%, and X' is the normalized standard value.

[0021] Furthermore, in the process of comparing the actual latency Tact and the predicted latency Tpre of the acquisition server and calculating the deviation rate D, the reinforcement learning model parameters are adjusted in a graded manner based on the deviation rate D: The formula for calculating the deviation rate D is as follows: When D < 10%, the learning rate is fine-tuned to 0.001~0.005; When 10%≤D≤30%, adjust the number of hidden layer nodes in the neural network according to the direction of the deviation. If D∈[10%,20%] and the predicted latency Tpre of the reinforcement learning model is consistently lower than the actual latency Tact, increase the number of hidden layer nodes by 10%~15%; if D∈[20%,30%] and the predicted latency Tpre of the reinforcement learning model is consistently higher than the actual latency Tact, decrease the number of hidden layer nodes by 15%~20%. When D > 30%, based on historical samples with a bias rate < 20%, prioritize retraining the output layer parameters and the hidden layer parameters directly connected to the output layer of the reinforcement learning model. After retraining, the prediction accuracy is improved by ≥ 15%.

[0022] Furthermore, the dynamic periodic rule is as follows: The initial acquisition period is 10 seconds; When the number of tasks to be assigned is ≥5 × the number of servers, the collection cycle is shortened to 5 seconds. When the number of tasks to be assigned is less than 1 / 3 × the number of servers, the collection cycle is extended to 20 seconds.

[0023] Furthermore, if a heartbeat packet is sent at a frequency of 100ms, and no heartbeat response is received for three consecutive times with a cumulative duration of 300ms, or if the task progress remains unchanged within 10 seconds, then it is determined to be a node failure. When the master node fails, the slave node with the highest comprehensive computing power evaluation value Q is selected for upgrade, with a switching latency of ≤300ms.

[0024] The present invention also provides a task algorithm allocation system for a server system, for executing the task algorithm allocation method for a server system as described above, including an architecture decision module, a task feature module, a status monitoring module, an intelligent allocation module, a feedback optimization module, and an exception handling module; The architecture decision module is used to calculate the task coupling degree C, the node computing power heterogeneity H, and the node computing power F. It outputs the results of the filtered computing architecture within 100ms and triggers the switching mechanism. The task feature module is used to extract task features and substitute them into the P-value formula for calculation, generating data with priority identifiers within 20ms. The status monitoring module is used to collect data according to a dynamic cycle, synchronously calculate the hardware load normalization value L, unit computing power energy consumption E, heat dissipation energy consumption T, and comprehensive computing power evaluation value Q, and output the allocation scheme within 10ms. The intelligent allocation module is used to load the reinforcement learning model, input the P value and Q value, and output the allocation scheme within 10ms. The feedback optimization module is used to collect Tact and Tpre data to calculate the deviation rate D, adjust parameters according to rules, and take effect within 1 minute. The anomaly handling module is used to monitor the heartbeat mechanism and triggers a switch within 50ms after a fault. The architecture decision module, the task feature module, the status monitoring module, the intelligent allocation module, the feedback optimization module, and the exception handling module interact through a ≥10Gb internal bus, and the redundancy switching latency is ≤10ms when a single module fails.

[0025] In this embodiment, the Analytic Hierarchy Process (AHP) achieves a closed loop through four functional modules and a two-level hierarchical structure, with strong correlations between modules through "data input-processing-output-feedback". Includes the following modules: Layered structure component module: used to define the target layer and criterion layer for weight allocation, clarify the analysis framework, input data is the task scenario requirements of this invention (such as high real-time, classified tasks), and output data is the target layer (weight allocation of task features) - criterion layer (V, K, R, S) hierarchical structure; Judgment Matrix Component Module: Performs pairwise comparisons of the importance of the criteria layer elements to generate a judgment matrix. The input data consists of the criteria layer elements (V, K, R, S) in the hierarchical structure and the importance values ​​using the 1-9 scale. The output data is an n*n judgment matrix (n=4). Consistency verification module: Verifies the logical rationality of the judgment matrix and ensures that the weight allocation is consistent. The input data is the judgment matrix, and the output data is the consistency index CI, the random consistency index RI, and the random consistency ratio CR. Weight Calculation and Normalization Module: Calculates the weights of each feature and satisfies the constraints, outputs the normalization results, and the input data is the judgment matrix that passes the consistency test and the constraints (Wr≥0.3, weight sum is 1). The output data is the normalized weights (Wv, Wk, Wr, Ws). In the reinforcement learning model, closed-loop decision-making is achieved through five core modules. These modules are strongly correlated through "state awareness - action policy - reward feedback - model update," and include the following modules: State Awareness Module: Collects and quantifies the key forms of tasks and nodes, inputs task features (V, K, R, S) and node states (F, L, E, H), and outputs a normalized state vector (dimensions: 4-dimensional task features + 4-dimensional node states). Action decision module: Selects the optimal architecture and task allocation strategy based on state vectors. Input data is normalized into state vectors and action vectors (architecture selection: master-slave architecture / peer architecture / hybrid architecture; task allocation: node ID + resource proportion). Environment interaction module: simulates / executes actions and provides feedback on new states, inputs dynamic vector data, and outputs new states and immediate rewards after execution; Reward Calculation Module: Quantifies the merits of an action (dual objectives of latency and energy consumption), inputs data on the state before and after execution (latency, energy consumption), and outputs data as reward values. (α+β=1, priority is adjustable); Model update module: Based on the reward, update the policy network parameters, input data state, action, reward, new state (experience sample), and output the optimized policy network; The model is trained using a proximal strategy optimization algorithm: Step 1: Define the state space and action space State space: Task feature dimensions: Data volume V (normalized to [0,1]), computational complexity K (normalized to [0,1]), real-time level R (normalized to [0,1]), and task comprehensive score P (normalized to [0,1]).

[0026] Node state dimensions: node computing power F (normalized to [0,1]), load L (normalized to [0,1]), energy consumption E (normalized to [0,1]), and node heterogeneity H (normalized to [0,1]).

[0027] Total number of dimensions: 4 + 4 = 8 dimensions.

[0028] Action space: Architecture selection: Discrete operation (master-slave architecture = 0, peer-to-peer architecture = 1, hybrid architecture = 2).

[0029] Task allocation: continuous action (allocate the resource percentage of each node to each task, such as 0.3 for node 1 and 0.7 for node 2, which must satisfy ∑ percentage = 1).

[0030] Step 2: Design the reward function and training objective Reward function: in, The actual average latency of the task (the smaller the latency, the greater the reward). The total system energy consumption is represented by 0.6 (the smaller the value, the greater the reward); 0.6 and 0.4 represent the weights of latency and energy consumption (which can be adjusted according to the scenario).

[0031] Training objective: Maximize the cumulative reward ∑R t This achieves the dual-objective optimization of "minimizing average task latency + minimizing total system energy consumption".

[0032] Step 3: Model Training Process Input data: ≥100,000 sets of historical task-node interaction samples (including task characteristics, node status, post-execution latency / energy consumption, and architecture selection records).

[0033] Training algorithm: PPO algorithm (including policy network and value network, the policy network outputs action probabilities, and the value network estimates state values).

[0034] Key parameter: Learning rate: Initially 5×10 -5 It decays linearly during training.

[0035] Batch size: 2048 samples / batch.

[0036] Number of iteration rounds: 500 rounds, stopping when the average reward of the validation set (20% of the samples) converges (fluctuation < 5%) in each round.

[0037] Exploration rate (ε): Initially 0.9, decaying by 0.01 per round, ensuring exploration in the early stages and utilization in the later stages.

[0038] In real-world task allocation scenarios, the trained reinforcement learning model generates an allocation scheme through the following steps, requiring a clear understanding of the intrinsic relationship between the input and output: Step 1: Collect input status Input data: Task side: The "data volume V, computational complexity K, real-time level R, and encryption level S" of the currently assigned task (the overall task score P is calculated using the analytic hierarchy process).

[0039] Node side: "Real-time computing power F, current load L, real-time energy consumption E, heterogeneity H" of each node (collected and normalized in real time by the system monitoring module).

[0040] Data processing: The above 8-dimensional data is integrated into a state vector and input into the policy network of the reinforcement learning model.

[0041] Step 2: Model outputs actions (generates allocation scheme) Output data: Architecture options: master-slave architecture (0), peer-to-peer architecture (1), or hybrid architecture (2).

[0042] Task allocation details: The ID of each task assigned to a specific node, and the percentage of resources allocated to that node for the task (e.g., "Task A → Node 1 (0.6) + Node 3 (0.4)").

[0043] Example of the solution: If the input state is "high P (urgent task) + high node computing power and low heterogeneity", the model outputs "master-slave architecture + task assigned to master node (resource ratio 1.0)" to ensure low latency execution of the task.

[0044] Step 3: Implementation and Feedback After the allocation scheme is executed, the actual latency (Tact) and total energy consumption are collected, the reward value is calculated, and the result is fed back to the reinforcement learning model.

[0045] High computational complexity K: CPU / GPU utilization remains ≥80% during task execution, or single calculation takes ≥10 seconds; In computational complexity K: CPU / GPU utilization is between 50% and 80%, or a single calculation takes 3-10 seconds; Low computational complexity K: CPU / GPU utilization ≤ 50%, or single calculation time ≤ 3 seconds; Real-time Level R (Urgent): The task must be completed within ≤500ms; Real-time rating R (High): Task must be completed within ≤1 second; In Real-Time Level R: Tasks must be completed within ≤5 seconds; Low real-time rating (R): Task latency requirement ≥ 5 seconds; Encryption level S (Confidential): Data involving state secrets and core commercial secrets; Encryption level S Sensitive: Data involving personal privacy or commercially sensitive information; Encryption level S (Ordinary): Publicly accessible or non-sensitive general data.

[0046] The heartbeat mechanism is a 1-second cycle heartbeat, which ensures that faults can be detected within 3 seconds, providing a prerequisite for subsequent "triggering switching within 50ms" and "task interruption time ≤200ms".

[0047] Example 1: The enterprise deploys a 5-node server to handle three types of core business tasks: 1. Real-time user behavior data analysis task (referred to as "real-time task A"), 2. Non-real-time user data backup task (referred to as "batch task B"), and 3. Confidential financial statement calculation task (referred to as "confidential task C"). The hardware parameters of the cluster nodes are shown in the table below. The rated energy consumption of the system is uniformly 0.8 kWh / unit task (at 100% load).

[0048] Step 1: Calculate core metrics and select suitable architectures 1.1 Recalculate the node computing power F (the formula remains the same: F=(U×Z / 3.0)×0.4+(N / 16)×0.6, where N is the memory capacity in GB). Node 1: F1=(32×3.6 / 3.0)×0.4+(128 / 16)×0.6=38.4×0.4+8×0.6=15.36+4.8=20.16 Node2 / Node3: F2=(24×3.2 / 3.0)×0.4+(64 / 16)×0.6≈25.6×0.4+4×0.6=10.24+2.4=12.64 Node4 / Node5: F4=(16×2.8 / 3.0)×0.4+(32 / 16)×0.6≈14.93×0.4+2×0.6≈5.97+1.2=7.17 1.2 Recalculate the node computing power heterogeneity H (H=(Fmax-Fmin) / Fmax×100%) Determine the extreme values: Fmax=20.16 (Node1, maximum memory capacity). Fmin=7.17 (Node4 / 5, minimum memory capacity) Calculate H: H=(20.16-7.17) / 20.16×100%≈12.99 / 20.16×100%≈64.43% 1.3 Task Coupling Degree C (Based on task sub-dependencies, maintaining reasonable business logic) Task A (Real-time Order Processing): It is divided into 4 sub-tasks: "Order Receiving → Data Verification → Inventory Deduction → Result Return", all of which are upstream and downstream dependent (C1=4, C2=4). C A =4 / 4 × 100% = 100% Task B (Log Backup): It is divided into three sub-tasks: "Log Reading → Shard Compression → Distributed Storage", with no dependencies (C1=0, C2=3). C B =0 / 3 × 100% = 0% Task C (encrypted computation): It is divided into three sub-tasks: "data decryption → core computation → encrypted storage". The first two are upstream and downstream dependent (C1=2, C2=3). C C =2 / 3 × 100% ≈ 66.67% 1.4 Re-selecting the computing architecture Step 2: Calculate the overall task score P and priority. 2.1 Standardized values ​​of task feature set 2.2 Analytic Hierarchy Process (AHP) weights (satisfying the constraints: (Wv+Wk+Wr+Ws=1) and (Wr≥0.3)) Based on business priorities (real-time performance > encryption security > data volume > computational complexity), the following weights are assigned: (Wv=0.2) (data volume), (Wk=0.1) (computational complexity), (Wr=0.4) (real-time performance level), and (Ws=0.3) (encryption level). 2.3 Calculate the overall task score P (P=V×Wv+K×Wk+R×Wr+S×Ws) Task A: (P A =0.8×0.2+1.2×0.1+1.0×0.4+1.0×0.3=0.16+0.12+0.4+0.3=0.98) → Emergency Priority (P≥0.9), Delay Threshold ≤500ms Task B: (P B =1.0×0.2+0.8×0.1+0.3×0.4+0.6×0.3=0.2+0.08+0.12+0.18=0.58) → Medium priority (0.4≤P<0.7), delay threshold≤5s Task C: (P C =0.8×0.2+1.0×0.1+0.8×0.4+1.2×0.3=0.16+0.1+0.32+0.36=0.94) → Emergency Priority (P≥0.9), Delay Threshold ≤500ms Step 3: Calculate the overall computing power evaluation value Q (adjust memory-related parameters to ensure the consistency of the calculation logic). 3.1 Dynamic cycle determination (according to the invention rules: number of tasks to be assigned = 3, number of servers = 5) Judgment conditions: (3 < 5 × 5 = 25) and (3 ≥ 1 / 3 × 5 ≈ 1.67), initial acquisition period = 10s; 3.2 Collect hardware load and energy consumption data 3.3 Key Indicator Calculation (Based on memory capacity in GB, with adjusted L value) Hardware load normalized value L Node 1: L1=(18 / 32×50%)+(72 / 128×30%)+(4.8 / 6×20%)≈28.125%+16.875%+12%=57%=0.57 Node2: L2=(14 / 24×50%)+(38 / 64×30%)+(3.6 / 6×20%)≈29.17%+17.81%+12%=58.98%≈0.59 Node 3: L3=(13 / 24×50%)+(36 / 64×30%)+(3.5 / 6×20%)≈27.08%+16.875%+11.67%=55.625%≈0.56 Node 4: L4=(9 / 16×50%)+(18 / 32×30%)+(2.2 / 4×20%)≈28.125%+16.875%+11%=56%=0.56 Node 5: L5=(8 / 16×50%)+(16 / 32×30%)+(2.1 / 4×20%)=25%+15%+10.5%=50.5%≈0.51 Energy consumption per unit of computing power E (E=(E1-E2) / E3, E3=task completion amount=1) Node1: E1=(0.95-0.55) / 1=0.4; Node2: E2=(0.72-0.42) / 1=0.3; Node3: E3=(0.73-0.42) / 1=0.31; Node4: E4=(0.51-0.31) / 1=0.2; Node5: E5=(0.52-0.31) / 1=0.21; The overall computing power assessment value Q (rated energy consumption, rated energy consumption = 0.8) Node1: Q1=0.57×0.6+(1-0.4 / 0.8)×0.4=0.342+0.2=0.542 Node2: Q2=0.59×0.6+(1-0.3 / 0.8)×0.4≈0.354+0.275=0.629 Node3: Q3=0.56×0.6+(1-0.31 / 0.8)×0.4≈0.336+0.27=0.606 Node4: Q4=0.56×0.6+(1-0.2 / 0.8)×0.4=0.336+0.3=0.636 Node5: Q5=0.51×0.6+(1-0.21 / 0.8)×0.4≈0.306+0.295=0.601 Step 4: Reinforcement learning model generates allocation schemes (based on the revised metrics, meeting the dual optimization objectives). The reinforcement learning model is trained on 120,000 sets of historical enterprise task samples (covering real-time / batch / classified scenarios). The input is "architecture type + P-value + Q-value," and the output is a solution with the objectives of "minimizing average task latency + minimizing total system energy consumption." Task A (Hybrid Architecture - P≥0.7): Assign to a master-slave sub-architecture, select Node2 with the higher Q value as the master node (Q=0.629) and Node3 as the slave node (Q=0.606), master-slave interaction latency = 42ms≤50ms (satisfying master-slave architecture constraints), and ensure that the latency of urgent priority is ≤500ms; Task B (Peer-to-Peer Architecture): Assigned to Node4 (Q=0.636) and Node5 (Q=0.601), single node task load = 50%≤70% of maximum computing power (Node4 maximum computing power 7.17, task load 3.58), load difference = |50%-50%|=0%≤15% (complies with peer-to-peer architecture anti-collision rules); Task C (Hybrid Architecture - P≥0.7): Assign to a master-slave sub-architecture, select Node1 as the master node (maximum memory capacity 128GB, suitable for confidential computing), with no slave nodes, and use incremental transmission for cross-architecture data (to reduce data interaction loss) to ensure encrypted computing security and low latency.

[0049] Step 5: Feedback optimization of model parameters (based on actual time delay deviation, conforming to the hierarchical adjustment rules) 5.1 Collect latency data (sampled 10 minutes after the solution is executed) Task A: Predicted latency Tpre = 420ms, actual latency Tact = 435ms, deviation rate D = |435-420| / 420×100% ≈ 3.57% Task B: Predicted delay Tpre = 4.2s, actual delay Tact = 4.3s, deviation rate D = |4.3 - 4.2| / 4.2 × 100% ≈ 2.38% Task C: Predicted latency Tpre = 450ms, actual latency Tact = 462ms, deviation rate D = |462-450| / 450×100% ≈ 2.67% 5.2 Adjusting model parameters For all tasks with D < 10%, the learning rate of the reinforcement learning model is fine-tuned to 0.003 (within the range of 0.001 to 0.005) according to the invention rules to ensure that the model's prediction accuracy for similar tasks remains stable at over 96%.

[0050] Step 6: Exception handling and architecture self-healing (verify fault response capabilities and meet latency constraints) Suppose that the master node Node2 of task A experiences a sudden network failure: Fault detection: The system sends heartbeat packets every 100ms. If no response is received from Node2 for 3 consecutive times (300ms in total), and the progress of Task A is not updated within 10 seconds, it is determined to be a node failure. Architecture switchover: Select the node with the largest current Q value (Node4, Q=0.636) and upgrade it to the new master node. Switchover latency = 240ms ≤ 300ms; Task recovery: Regenerate the task A allocation scheme (Node4 as master, Node3 as slave). The task interruption time is 180ms ≤ 200ms. The actual latency after recovery is 445ms ≤ 500ms, which does not affect the order processing business.

[0051] III. Implementation Results (Revised to highlight business value) Latency fully met the standards: Task A (435ms≤500ms), Task B (4.3s≤5s), Task C (462ms≤500ms), with 100% latency compliance for emergency tasks and no business timeouts; Significantly optimized energy consumption: Total system energy consumption = Node1 (0.95) + Node2 (fault) + Node3 (0.73) + Node4 (0.51) + Node5 (0.52) = 2.71 kWh, which is 24.7% lower than the traditional static distribution (3.6 kWh), saving approximately RMB 12,000 in electricity costs annually (calculated based on an industrial electricity price of RMB 0.8 / kWh and 8,760 hours of operation per year). Reliable self-healing capability: After a node failure, the recovery task is completed within 180ms, with no order loss or data corruption, meeting the requirements of enterprise-level high availability (99.99%). Balanced resource utilization: In the peer-to-peer architecture, the load difference between Node4 and Node5 is 0%, and in the master-slave architecture, the resource ratio of Node2 and Node3 is reasonable, with no nodes overloaded or idle (CPU utilization is controlled between 30% and 60%).

[0052] The above description discloses only one preferred embodiment of the present invention, and should not be construed as limiting the scope of the present invention. Those skilled in the art will understand that all or part of the processes of the above embodiments can be implemented, and equivalent changes made in accordance with the claims of the present invention are still within the scope of the invention.

Claims

1. A task allocation algorithm method in a server system, characterized in that, Includes the following steps: Collect task coupling degree C and node computing power F, calculate node computing power heterogeneity H, and select suitable computing architectures from master-slave architecture, peer-to-peer architecture and hybrid architecture based on task coupling degree C and node computing power heterogeneity H. Task features are extracted, including data volume V, computational complexity K, real-time level R, and encryption level S. The weights of the task features are assigned using the analytic hierarchy process (AHP). After standardizing the values ​​of each task feature, the overall task score P is calculated. Based on the overall task score P, four priority levels (urgent, high, medium, and low) and corresponding latency thresholds are mapped. The server hardware load data and energy consumption data are collected dynamically and periodically. The server hardware load data includes the number of idle CPUs, the amount of memory remaining, and the I / O throughput. The energy consumption data includes the energy consumption per unit of computing power E and the heat dissipation energy consumption T. The server hardware load data and energy consumption data are processed by min-max normalization to calculate the comprehensive computing power evaluation value Q. The algorithm integrates the computing architecture type, task comprehensive score P, and comprehensive computing power evaluation value Q. It inputs these values ​​into a reinforcement learning model with the dual optimization objectives of minimizing average task latency and minimizing total system energy consumption. The algorithm generates and executes an allocation scheme. The integrated computing architecture types include master-slave, peer-to-peer, and hybrid architectures. In a master-slave architecture, tasks are centrally allocated to master nodes, while slave nodes only execute tasks; the master-slave interaction latency is ≤50ms. In a peer-to-peer architecture, tasks are distributed with locks to prevent collisions; the task load on a single node is ≤70% of the maximum computing power, and the load difference is ≤15%. In a hybrid architecture, tasks with P≥0.7 are allocated to the master-slave architecture, and tasks with P<0.7 are allocated to the peer-to-peer architecture; cross-architecture data is transmitted incrementally. The reinforcement learning model is trained on ≥100,000 valid samples. The actual latency Tact and predicted latency Tpre of the server are collected and the deviation rate D is calculated. The parameters of the reinforcement learning model are then adjusted in a graded manner based on the deviation rate D. By verifying node status through a heartbeat mechanism and task progress, an architecture switch is triggered when a fault or performance abnormality is detected. The system then returns and re-selects a suitable computing architecture, regenerates the task allocation scheme, and ensures that the task interruption time is ≤200ms.

2. The task allocation method in a server system as described in claim 1, characterized in that, The formula for calculating the task coupling degree C is as follows: In the formula, C1 is the number of subtasks with upstream and downstream execution relationships; C2 is the total number of subtasks; The formula for calculating the node computing power heterogeneity H is as follows: In the formula, Fmax is the computing power of the strongest node; Fmin is the computing power of the weakest node; The formula for calculating the node computing power F is as follows: In the formula, U is the number of CPU cores; Z is the clock speed in GHz; and N is the memory capacity in GB. Computational architecture selection: If C≥60% and H≤20%, then a master-slave architecture should be selected. If C > 30% and H ≥ 40%, then choose the peer-to-peer architecture; In other cases, a hybrid architecture is chosen.

3. The task allocation method in a server system as described in claim 1, characterized in that, In the process of allocating task feature weights using the analytic hierarchy process (AHP) and standardizing the feature values ​​of each task to calculate the overall task score P: The formula for calculating the overall task score P is as follows: In the formula, Wv+Wk+Wr+Ws=1, and Wr≥0.3; Data volume V standardized values: ≥10GB is 1.0; 1~10GB is 0.8; 0.1~1GB is 0.5; <0.1GB is 0.2; Standardized values ​​for computational complexity K: High is 1.2; Medium is 1.0; Low is 0.

8. Normalized R values ​​for real-time risk level: Emergency 1.0; High 0.8; Medium 0.5; Low 0.3; Encryption level S standardized values: Confidential: 1.2; Sensitive: 1.0; Normal: 0.

6.

4. The task allocation method in a server system as described in claim 1, characterized in that, The process of mapping four priority levels (urgent, high, medium, and low) and corresponding latency thresholds based on the overall task score P is as follows: When P ≥ 0.9, it is an emergency priority, and the delay threshold is ≤ 500ms; When 0.7 ≤ P < 0.9, it is considered high priority, with a delay threshold of ≤ 2s; When 0.4 ≤ P < 0.7, it is a medium priority, with a delay threshold of ≤ 5s; When P < 0.4, it is a low priority, and the delay threshold is ≤ 10s.

5. The task algorithm allocation method in a server system as described in claim 1, wherein the calculation of the comprehensive computing power evaluation value Q is characterized in that, The formula for calculating the energy consumption per unit of computing power, E, is: In the formula, E1 is the total energy consumption after the task; E2 is the baseline energy consumption in the first minute before the task; and E3 is the amount of energy completed in the task. Standardized values ​​for heat dissipation energy consumption T: 1.0 when server temperature ≤ 35℃ and fan speed < 50%; 0.7 when server temperature 35~50℃ and fan speed 50~80%; 0.3 when server temperature > 50℃ or fan speed ≥ 80%. The formula for calculating the hardware load normalized value L is: The formula for calculating the comprehensive computing power assessment value Q is: In the formula, the rated energy consumption is the energy consumption of the server per unit of task completed under 100% hardware load; The min-max normalization calculation method is as follows: The calculation accuracy is ≤1%, and X' is the normalized standard value.

6. The task allocation method in a server system as described in claim 1, characterized in that, The actual latency Tact and the predicted latency Tpre of the acquisition server are compared, and the deviation rate D is calculated. Based on the deviation rate D, the parameters of the reinforcement learning model are adjusted in a tiered manner. The formula for calculating the deviation rate D is as follows: When D < 10%, the learning rate is fine-tuned to 0.001~0.005; When 10%≤D≤30%, adjust the number of hidden layer nodes in the neural network according to the direction of the deviation. If D∈[10%,20%] and the predicted latency Tpre of the reinforcement learning model is consistently lower than the actual latency Tact, increase the number of hidden layer nodes by 10%~15%; if D∈[20%,30%] and the predicted latency Tpre of the reinforcement learning model is consistently higher than the actual latency Tact, decrease the number of hidden layer nodes by 15%~20%. When D > 30%, based on historical samples with a bias rate < 20%, prioritize retraining the output layer parameters and the hidden layer parameters directly connected to the output layer of the reinforcement learning model. After retraining, the prediction accuracy is improved by ≥ 15%.

7. The task allocation method in a server system as described in claim 1, wherein the dynamic periodic collection of server hardware load data and energy consumption data is characterized in that, The dynamic cycle rule is as follows: The initial acquisition period is 10 seconds; When the number of tasks to be assigned is ≥5 × the number of servers, the collection cycle is shortened to 5 seconds. When the number of tasks to be assigned is less than 1 / 3 × the number of servers, the collection cycle is extended to 20 seconds.

8. The task allocation method in a server system as described in claim 1, wherein triggering architecture switching when a fault or performance anomaly is detected, is characterized in that... If a heartbeat packet is sent at a frequency of 100ms, and no heartbeat response is received for 3 consecutive times with a cumulative duration of 300ms, or if the task progress remains unchanged within 10 seconds, it is considered a node failure. When the master node fails, the slave node with the highest comprehensive computing power evaluation value Q is selected for upgrade, with a switching latency of ≤300ms.

9. A task allocation system for a server system, used to execute the task allocation method for a server system according to any one of claims 1-8, characterized in that, It includes an architecture decision module, a task feature module, a status monitoring module, an intelligent allocation module, a feedback optimization module, and an exception handling module; The architecture decision module is used to calculate the task coupling degree C, the node computing power heterogeneity H, and the node computing power F. It outputs the results of the filtered computing architecture within 100ms and triggers the switching mechanism. The task feature module is used to extract task features and substitute them into the P-value formula for calculation, generating data with priority identifiers within 20ms. The status monitoring module is used to collect data according to a dynamic cycle, synchronously calculate the hardware load normalization value L, unit computing power energy consumption E, heat dissipation energy consumption T, and comprehensive computing power evaluation value Q, and output the allocation scheme within 10ms. The intelligent allocation module is used to load the reinforcement learning model, input the P value and Q value, and output the allocation scheme within 10ms. The feedback optimization module is used to collect Tact and Tpre data to calculate the deviation rate D, adjust parameters according to rules, and take effect within 1 minute. The anomaly handling module is used to monitor the heartbeat mechanism and triggers a switch within 50ms after a fault. The architecture decision module, the task feature module, the status monitoring module, the intelligent allocation module, the feedback optimization module, and the exception handling module interact through a ≥10Gb internal bus, and the redundancy switching latency is ≤10ms when a single module fails.

Citation Information

Patent Citations

  • Tight coupling heterogeneous multi-core processor architecture and processing method thereof

    CN112527729A

  • Multi-index resource scheduling method and system applied to computing power network

    CN120653420A