Distributed dynamic weight allocation method and system based on real-time bias correction
The distributed dynamic weight allocation method with real-time deviation correction solves the problem of resource allocation imbalance in the existing technology, realizes rapid response to changes in node operating status and load balancing, and improves system resource utilization efficiency and scheduling response timeliness.
Patent Information
- Application Number
- CN202610564900.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-27
- Publication Date
- 2026-06-26
AI Technical Summary
Existing weight allocation methods lack the ability to sensitively capture real-time deviations during node task execution in a distributed environment, leading to unbalanced resource allocation and an inability to effectively cope with node performance fluctuations. Furthermore, manually set parameters limit the model's adaptive adjustment capabilities in complex scenarios, resulting in decreased system resource utilization efficiency and untimely scheduling response.
By acquiring the dual deviations between task execution time and performance output, a sequence of periodic node offset amplitudes is constructed. Node weights are adjusted in real time. A dual-deviation calculation mechanism and normalization processing are used to extract weight adjustment objects and set differentiated adjustment ratios, thereby achieving rapid response and accurate resource allocation to changes in node operating status.
It improves the rationality and timeliness of resource allocation, optimizes the load balancing effect between nodes, enhances the adaptive control capability for nonlinear changes in multi-task environments, and strengthens the scheduling system's ability to locate nodes with abnormal performance.
Smart Images

Figure CN122285226A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of weight allocation technology, and in particular to a distributed dynamic weight allocation method and system based on real-time deviation correction. Background Technology
[0002] The field of weight allocation technology involves the allocation and adjustment of resources in computing systems, network systems, and task scheduling systems. This includes the scheduling and management of processing units, dynamic balancing of data load, prioritization of resource usage, and control of task execution efficiency. Typically, it quantitatively allocates multiple resources or nodes in the system by setting static or dynamic parameter models, and combines this with real-time feedback adjustment strategies to achieve multi-objective coordinated optimization. Common methods include weight factor setting, priority queue adjustment, real-time resource status monitoring, and distributed strategy fusion, aiming to achieve reasonable allocation and load control of system resources. Traditional distributed dynamic weight allocation methods refer to setting initial weight values based on task requirements or node status in a multi-node or multi-task distributed environment. These initial weights are then dynamically corrected and redistributed by periodically statistically analyzing node performance indicators such as task response time, CPU utilization, or data throughput. This typically involves comparing the current state with the expected state using preset calculation formulas, linear weighted models, or simple feedback correction mechanisms, and manually adjusting the weights of each node to achieve a reasonable redistribution of task resources.
[0003] In existing weight allocation processes, preset models are often used to dynamically adjust node weights. In distributed environments, this mainly relies on periodically collected operational indicator data and lacks the ability to sensitively capture real-time deviations during node task execution. This results in weight correction lagging behind actual load changes, making it unable to effectively address resource allocation imbalances caused by node performance fluctuations during scheduling. Furthermore, manually set parameters limit the model's adaptive adjustment capabilities in complex scenarios. The diversity of node operating states and feedback delays make it difficult for scheduling strategies to accurately match actual needs, leading to problems such as decreased system resource utilization efficiency, untimely scheduling response, and uneven task execution efficiency. Summary of the Invention
[0004] To address the technical problems existing in the prior art, embodiments of the present invention provide a distributed dynamic weight allocation method based on real-time deviation correction, comprising the following steps: To achieve the above objectives, the present invention adopts the following technical solution: a distributed dynamic weight allocation method based on real-time deviation correction, comprising the following steps: S1: Obtain the start time, end time and target execution time of the running tasks in each scheduling node of the edge computing server cluster, calculate the time offset difference between the actual execution time and the expected reference time of each node task in the current period, and obtain the performance error difference between the output performance parameters of each task and the corresponding target indicators, and generate a period node offset amplitude sequence. S2: Based on the performance error difference and time offset difference data corresponding to each node in the periodic node offset magnitude sequence, record the node number with the unique maximum offset difference in the current scheduling period, and generate the node number for weight adjustment in the current period. S3: Read the scheduling resource weight value configured in the previous period for the node corresponding to the current period weight adjustment node number, calculate the ratio of the time offset difference corresponding to the current node to the set offset upper limit value, use the calculation result as the adjustment ratio of the resource weight of the corresponding node, and generate the weight reduction numerical parameter. S4: Based on the adjustment ratio in the weight reduction numerical parameter, read the original resource weight value of the corresponding node in the node resource configuration table, calculate the updated resource weight value of the node in the current period, and generate a weight configuration update dataset. S5: Based on the weight configuration update dataset, the node numbers and corresponding updated weight contents that have undergone weight changes are combined to form a single node scheduling adjustment item, and the dynamic weight allocation result is archived.
[0005] As a further aspect of the present invention, the node number with the unique maximum offset difference specifically refers to the following: when there is a node performance error difference exceeding the set performance offset tolerance, the corresponding node number is extracted first; if no node exceeds the tolerance, the node number with the largest time offset difference is extracted.
[0006] As a further aspect of the present invention, the updated resource weight value specifically refers to calculating the weight that should be deducted from the corresponding node in the current period by performing a multiplication operation on the adjustment ratio and the original resource weight value, and subtracting the deducted weight from the original resource weight value to obtain the updated resource weight value.
[0007] As a further embodiment of the present invention, the periodic node offset amplitude sequence includes a time offset rate sequence, a performance error rate sequence, and a normalized mapping set; the current periodic weight adjustment node number includes a target node number, an offset type label, and an offset extreme value identifier; the weight reduction numerical parameters include the node's original weight value, the weight adjustment ratio, and the target deduction coefficient; the weight configuration update dataset includes the updated weight value, the weight change ratio, and a list of changed nodes; and the dynamic weight allocation result includes a node scheduling adjustment item set, a scheduling resource allocation graph, and an update configuration record table.
[0008] As a further aspect of the present invention, the step of obtaining the periodic node offset amplitude sequence is as follows: S111: Obtain the start time, end time and target execution time of the tasks running in each scheduling node of the edge computing server cluster, calculate the time difference between the actual execution time and the corresponding target execution time of each task, and generate a set of node time offset differences; S112: Obtain the output performance parameters and corresponding target performance index values of each task, establish the correspondence between performance parameters and target indexes according to task number, calculate the difference between the output performance parameters and target values of each task, and generate a node performance error difference set. S113: Based on the node time offset difference set and the node performance error difference set, normalize all values in the two sets respectively, index and map them according to the node number and superimpose them to generate a periodic node offset amplitude sequence.
[0009] As a further aspect of the present invention, the step of obtaining the current period weight adjustment node number is as follows: S211: Obtain the performance error difference and time offset difference data corresponding to each node in the periodic node offset amplitude sequence. For each node, compare the performance error difference with the set performance offset tolerance item by item, mark the node number whose performance error difference exceeds the set performance offset tolerance, and generate the node number set of the over-limit node. S212: Perform node determination according to the set of out-of-limit node numbers. When there are records in the set of out-of-limit node numbers, directly aggregate the node numbers. When the set of out-of-limit node numbers is empty, perform a size comparison on the time offset difference of each node in the periodic node offset amplitude sequence, filter the node number with the largest time offset difference, and obtain the candidate offset node number. S213: Based on the candidate offset node sequence number, record the node number with the largest unique offset difference in the current scheduling period, establish a one-to-one correspondence between the scheduling period and the node number, and generate the current period weight adjustment node number.
[0010] As a further aspect of the present invention, the step of obtaining the weight reduction numerical parameter is as follows: S311: Obtain the current period weight adjustment node number, read the historical scheduling configuration data stored locally, retrieve the resource weight configuration records of each node in the previous scheduling period, extract the scheduling resource weight value corresponding to the current period weight adjustment node number, establish a one-to-one mapping relationship between the node number and the weight value, and generate the resource weight value of the previous period. S312: Based on the resource weight value of the previous period and the offset amplitude sequence of the period nodes, retrieve the time offset difference value of the node corresponding to the weight adjustment node number of the current period, and at the same time obtain the preset offset upper limit parameter value, establish a directed comparison relationship between the two, and generate a time offset normalization reference pair. S313: Based on the time offset normalization reference pair, take the current time offset difference value as the comparison item, take the offset upper limit value as the normalization standard, perform numerical ratio calculation to output the adjustment ratio, and record the mapping relationship between the node number and the ratio result to generate weight reduction numerical parameters.
[0011] As a further aspect of the present invention, the step of obtaining the weight configuration update dataset is as follows: S411: Obtain the current period weight adjustment node number and corresponding ratio value recorded in the weight reduction numerical parameter, read the local node resource configuration table, retrieve the original resource weight value corresponding to the above node number, establish a mapping structure between the node number, the original resource weight value and the weight reduction numerical parameter, and generate a resource weight adjustment mapping pair. S412: Based on the resource weight adjustment mapping pair, the original resource weight value of each group of nodes is multiplied by the corresponding resource weight adjustment ratio. The result is defined as the weight to be deducted in the current period. The weight to be deducted is associated with the node number to generate a set of node weight deduction values. S413: Based on the original resource weight values in the node weight deduction value set and the resource weight adjustment mapping pair, perform subtraction calculations on each node, subtract the corresponding weight deduction value from the original resource weight value to obtain the updated resource weight values of each node in the current period, and establish a corresponding relationship with the node number to generate a weight configuration update dataset.
[0012] As a further aspect of the present invention, the step of obtaining the dynamic weight allocation result is as follows: S511: Obtain all node numbers and corresponding updated resource weight values in the weight configuration update dataset, retrieve the original resource weight values recorded by the above nodes in the previous period, compare whether there is a difference between the two values, filter the node numbers whose resource weight values have changed, and generate a set of nodes with weight changes. S512: Based on the set of nodes with weight changes, extract the updated resource weight value corresponding to each node, construct a key-value pair structure with node number as index and updated weight value as content, assemble the number of each node and the updated weight value to form an independent unit, and generate a single-node scheduling adjustment item set. S513: Based on the single-node scheduling adjustment item set, sort all adjustment items according to node number, merge and summarize them, construct a unified scheduling weight update record table under the current scheduling cycle, and archive and store it as an independent data file to generate dynamic weight allocation results.
[0013] A distributed dynamic weight allocation system based on real-time deviation correction includes: The node deviation acquisition module is used to perform S1: obtain the start time, end time and target execution time of the running tasks in each scheduling node in the edge computing server cluster, calculate the time offset difference between the actual execution time of each node task in the current period and the expected reference time, obtain the performance error difference between the output performance parameters of each task and the corresponding target indicators, and generate a periodic node offset amplitude sequence. The maximum offset filtering module is used to execute S2: based on the performance error difference and time offset difference data corresponding to each node in the periodic node offset magnitude sequence, record the node number with the unique maximum offset difference in the current scheduling period, and generate the node number for weight adjustment in the current period. The weight adjustment derivation module is used to execute S3: read the scheduling resource weight value configured in the previous period for the node corresponding to the current period weight adjustment node number, calculate the ratio of the time offset difference corresponding to the current node to the set offset upper limit value, use the calculation result as the adjustment ratio of the resource weight of the corresponding node, and generate the weight reduction numerical parameter. The resource mapping update module is used to execute S4: based on the adjustment ratio in the weight reduction numerical parameter, read the original resource weight value of the corresponding node in the node resource configuration table, calculate the updated resource weight value of the node in the current period, and generate a weight configuration update dataset; The deviation scheduling archiving module is used to execute S5: based on the weight configuration update dataset, the node numbers and corresponding updated weight contents that have undergone weight changes are combined to form a single node scheduling adjustment item, and the dynamic weight allocation result is archived.
[0014] Compared with the prior art, the advantages and positive effects of the present invention are as follows: By constructing a dual-deviation calculation mechanism for task execution time and performance output, a rapid response to changes in node operating status is achieved. Through the normalized generated offset amplitude sequence, weight adjustment objects are extracted and differentiated weight adjustment ratios are set, effectively breaking through the dependence of traditional models on static parameters and lag indicators. Through periodic refined calculation and dynamic ratio measurement, the node resource allocation ratio is corrected in real time, enhancing the scheduling system's ability to locate nodes with abnormal performance, improving the rationality and timeliness of resource allocation, optimizing the load balancing effect between nodes, and enhancing the adaptive control capability for nonlinear changes in multi-task environments. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a schematic diagram of the steps of the present invention; Figure 2 This is a flowchart of the process for obtaining the periodic node offset amplitude sequence of the present invention; Figure 3 This is a flowchart of the process for obtaining the node number of the current period weight adjustment in this invention; Figure 4 This is a flowchart of the process for obtaining the numerical parameters for weight reduction in this invention; Figure 5 Flowchart for obtaining the weight configuration update dataset for this invention; Figure 6 This is a flowchart of the process for obtaining the dynamic weight allocation results of this invention; Figure 7 This is a system module diagram of the present invention. Detailed Implementation
[0017] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0018] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0019] Please see Figure 1 This invention provides a distributed dynamic weight allocation method based on real-time deviation correction, comprising the following steps: S1: Obtain the start time, end time and target execution time of the running tasks in each scheduling node in the edge computing server cluster, calculate the time offset difference between the actual execution time and the expected reference time of each node task in the current period, and obtain the performance error difference between the output performance parameters of each task and the corresponding target indicators, and uniformly normalize the data to generate a period node offset amplitude sequence. S2: Based on the performance error difference and time offset difference data of each node in the periodic node offset magnitude sequence, when there is a node performance error difference exceeding the set performance offset tolerance, the corresponding node number is extracted first. If no node exceeds the tolerance, the node number with the largest time offset difference is extracted. The node number with the unique largest offset difference in the current scheduling period is recorded, and the node number for weight adjustment in the current period is generated. S3: Read the scheduling resource weight value configured in the previous period for the node corresponding to the current period weight adjustment node number, calculate the ratio of the time offset difference corresponding to the current node to the set offset upper limit value, use the calculation result as the adjustment ratio of the resource weight of the corresponding node, and generate the weight reduction numerical parameter. S4: Based on the adjustment ratio in the weight reduction numerical parameter, read the original resource weight value of the corresponding node in the node resource configuration table, perform a multiplication operation to calculate the weight that should be deducted from the corresponding node in the current period, perform a subtraction operation on the original resource weight value and the deducted weight, calculate the updated resource weight value of the node in the current period, and generate a weight configuration update dataset. S5: Based on the weight configuration, update the node numbers and corresponding updated weight content of the nodes in the dataset that have undergone weight changes, combine them to form a single node scheduling adjustment item, and archive to generate dynamic weight allocation results.
[0020] The periodic node offset magnitude sequence includes the time offset rate sequence, the performance error rate sequence, and the normalized mapping set. The current period weight adjustment node number includes the target node number, offset type label, and offset extreme value identifier. The weight reduction numerical parameters include the original weight value of the node, the weight adjustment ratio, and the target deduction coefficient. The weight configuration update dataset includes the updated weight value, the weight change ratio, and the list of changed nodes. The dynamic weight allocation result includes the node scheduling adjustment item set, the scheduling resource allocation graph, and the update configuration record table.
[0021] Please see Figure 2 The specific steps of S1 are as follows: S111: Obtain the start time, end time and target execution time of the tasks running in each scheduling node of the edge computing server cluster, calculate the time difference between the actual execution time and the corresponding target execution time of each task, and generate a set of node time offset differences; First, the log monitoring interface of the edge computing server cluster captures real-time timestamp data of running tasks on each scheduling node with millisecond-level time resolution. Specifically, this includes the system clock record at the moment the task begins execution as the execution start time, and the system clock record at the moment the task completes computation and outputs the result as the execution end time. The process synchronously accesses the task scheduling metadata database, retrieving the pre-set standard theoretical execution time (target execution time) based on the task's unique identifier ID. Then, a subtraction operation is performed, subtracting the execution start time from the execution end time to obtain the actual execution time of each task under the current hardware environment. Next, this actual execution time is compared with the target execution time, calculating the time difference. A positive difference indicates task delay; a negative difference indicates early completion. Finally, all calculated time differences are associated with their corresponding node IDs and stored, constructing a set containing node IDs and time deviation values—the node time offset difference set. For example, for server node 101, the monitored execution start time of task A is 14:00:00:100 milliseconds, and the execution end time is 14:00:00:600 milliseconds. Subtraction calculates the actual execution time to be 500 milliseconds. If the database records the target execution time of task A as 450 milliseconds, then the process subtracts 450 milliseconds from 500 milliseconds, resulting in a time difference of 50 milliseconds. Similarly, if task B on node 102 has an actual execution time of 400 milliseconds and a target execution time of 450 milliseconds, then the difference is -50 milliseconds. All such data is aggregated to form a node time offset difference set in the form {101: 50, 102: -50, ...}.
[0022] S112: Obtain the output performance parameters and corresponding target performance index values of each task, establish the correspondence between performance parameters and target indexes according to task number, calculate the difference between the output performance parameters and target values of each task, and generate a node performance error difference set. By calling the performance monitoring API of each compute node, the actual output performance parameters of each task after execution are read. These parameters include, but are not limited to, key metrics such as floating-point operations per second (FLOPS), data throughput, or response latency. Simultaneously, the process retrieves the corresponding theoretically optimal performance value (i.e., the target performance metric value) from a pre-defined performance metric library based on the task number. An index table using the task number as the primary key is created to align the acquired actual output performance parameters with the target performance metric values. Subsequently, numerical difference calculations are performed, subtracting the target performance metric value from the actual output performance parameter (or subtracting the actual value from the target value, depending on the nature of the metric, ensuring that a positive value represents the direction of increasing error; for example, for latency metrics, subtracting the target value from the actual value; for throughput metrics, subtracting the actual value from the target value), thereby quantifying the performance deviation of each task. This calculation process traverses all active tasks within the cluster, binding the calculated difference data to its corresponding node number to generate a node performance error difference set containing performance deviation data for all nodes. For example, the performance parameter can be set as data processing throughput, in megabytes per second (MB / s). For task C, its actual output throughput is 85 megabytes per second, while the target value is 100 megabytes per second. The process performs a subtraction operation, subtracting 85 from 100, resulting in a performance error of 15 megabytes per second, indicating that the performance did not meet the target. If another task D actually outputs 105 megabytes per second, with a target of 100 megabytes per second, the error is -5 megabytes per second (or 0, depending on the specific logic; here, the original difference of -5 is recorded). The final generated set records the specific performance discrepancies of each node, such as {101: 15, 102: -5}.
[0023] S113: Based on the node time offset difference set and the node performance error difference set, normalize all values in the above two sets respectively, index and map them according to the node number and superimpose them to generate a periodic node offset amplitude sequence. The node time offset difference set generated in step S111 and the node performance error difference set generated in step S112 are read, and the values in the two sets are dimensionless using the range normalization method. Specifically, for the time offset difference set, the process first iterates through the set to find the maximum and minimum values, subtracts the minimum value from the value of each node, and divides by the range (maximum value minus minimum value) to map it to the interval between 0 and 1; the same normalization operation is performed on the performance error difference set. Subsequently, the two normalized values are aligned according to the node number, and a weighted superposition calculation is performed according to the preset weight coefficients (e.g., time weight 0.6, performance weight 0.4), that is, the normalized time value multiplied by 0.6 and the normalized performance value multiplied by 0.4 are added to obtain a single comprehensive index. This index intuitively reflects the overall scheduling offset degree of the node in the current period. The comprehensive index of all nodes is arranged by number to generate a periodic node offset amplitude sequence.
[0024] Please refer to Table 1 Table 1. Calculation data for node offset magnitude
[0025] As shown in Table 1, assume the maximum time difference is 50, the minimum is -50, and the range is 100; the maximum performance difference is 15, the minimum is -5, and the range is 20. For node 101, the time normalization is calculated as (50 - (-50)) / 100 = 1.0, and the performance normalization is (15 - (-5)) / 20 = 1.0. If both the time weight and the performance weight are set to 0.5, then the overall offset magnitude of node 101 is 1.0 multiplied by 0.5 plus 1.0 multiplied by 0.5, resulting in 1.0. For node 103, the time difference is 0, the normalization value is 0.5; the performance difference is 5, the normalization value is 0.5, and the overall magnitude is 0.5. The final generated periodic node offset magnitude sequence is {101: 1.0, 102: 0.0, 103: 0.5}.
[0026] Please see Figure 3 The specific steps of S2 are as follows: S211: Obtain the performance error difference and time offset difference data corresponding to each node in the periodic node offset amplitude sequence. For each node, compare the performance error difference with the set performance offset tolerance item by item, mark the node number whose performance error difference exceeds the set performance offset tolerance, and generate the set of node numbers that exceed the tolerance. The process traces back from the source data of the periodic node offset amplitude sequence to extract the original performance error difference and time offset difference data corresponding to each node. A specific performance offset tolerance value is set, determined based on historical system stability tests, for example, 10 megabytes per second. The process iterates through each node, comparing its performance error difference with this tolerance value. If a node's performance error difference is significantly greater than the set tolerance, the node is considered to have severely degraded performance, and its number is immediately recorded. After the iteration is complete, all node numbers that meet the condition form the set of out-of-tolerance node numbers. For example, if the performance offset tolerance is set to 10, reviewing the previous steps, node 101 has a performance error difference of 15, which is greater than 10, so node 101 is marked; node 102 has a performance error difference of -5, which is less than 10, so it is not marked; node 103 has a performance error difference of 5, which is less than 10, so it is not marked. The final generated set of out-of-tolerance node numbers contains only {101}. This step involves setting specific numerical thresholds to identify the "weak points" that urgently need adjustment.
[0027] S212: Perform node determination based on the set of out-of-limit node numbers. When there are records in the set of out-of-limit node numbers, directly aggregate the node numbers. When the set of out-of-limit node numbers is empty, perform a size comparison on the time offset difference of each node in the periodic node offset amplitude sequence, and filter the node number with the largest time offset difference to obtain the candidate offset node number. First, the process checks if the generated set of out-of-limit node indices contains any elements. If the set is not empty, it indicates that there are nodes with severely out-of-limit performance. The process directly uses all node indices in this set as objects to be adjusted and aggregates them for output. If the set is empty (i.e., the performance errors of all nodes are within the tolerance range), the process then analyzes the time offset difference of each node. Under this branch, the process iterates through the time offset difference values of all nodes, uses a numerical comparison and sorting algorithm to select the node indices with the largest values (i.e., the node with the most severe latency), and defines it as a candidate offset node indices. For example, in the example of S211, the set of out-of-limit node indices is {101}, which is not empty, so 101 is directly locked. If we assume another scenario where the performance errors of all nodes are less than 10, then the set is empty. In this case, comparing the time offset differences: node 101 is 50 milliseconds, node 102 is -50 milliseconds, and node 103 is 0 milliseconds. The process identifies 50 milliseconds as the maximum value, so node 101 is selected as a candidate offset node indices. This logic ensures that, when all performance targets are met, the node with the largest time latency is prioritized for optimization, reflecting a multi-dimensional scheduling strategy.
[0028] S213: Based on the candidate offset node sequence number, record the node number with the largest unique offset difference in the current scheduling period, establish a one-to-one correspondence between the scheduling period and the node number, and generate the node number for weight adjustment in the current period. Based on the determined candidate offset node numbers (or aggregated over-limit node numbers), a final singleton lock operation is performed. Within the current scheduling period, if multiple candidates exist (e.g., multiple over-limit sets), a unique node number is selected as the adjustment target for this period based on a preset priority (e.g., smaller number priority or higher historical weight priority). A one-to-one correspondence is established between the current scheduling period ID (e.g., period 2024001) and the selected node number. This operation ensures that each adjustment period focuses on only one most critical bottleneck node, avoiding significant system-wide oscillations. The resulting data is the node number for weight adjustment in the current period. For example, if node 101 is determined to be the node most in need of adjustment, "period 2024001 -> node 101" is recorded, and 101 is output as the node number for weight adjustment in the current period.
[0029] Please see Figure 4 The specific steps of S3 are as follows: S311: Obtain the node number for weight adjustment in the current period, read the historical scheduling configuration data stored locally, retrieve the resource weight configuration records of each node in the previous scheduling period, extract the scheduling resource weight value corresponding to the node number for weight adjustment in the current period, establish a one-to-one mapping relationship between the node number and the weight value, and generate the resource weight value of the previous period. The system receives the node number (e.g., 101) for the current period's weight adjustment and then accesses the locally stored historical scheduling configuration database. This database stores the resource weight allocation status of all nodes in the cluster at the end of the previous scheduling period. Using node number 101 as the index key, the system retrieves the resource weight configuration record that actually took effect for that node in the previous period. The system extracts the value from this record, for example, 0.8 (representing the allocation of 80% of the standard resource units), and explicitly establishes a mapping relationship between node 101 and the weight value 0.8, thus fixing this value as the resource weight value for the previous period. This step ensures that the weight adjustment is based on the latest actual state, rather than on initial default values, guaranteeing the continuity of the adjustment.
[0030] S312: Based on the resource weight value of the previous period and combined with the period node offset amplitude sequence, retrieve the time offset difference value of the node corresponding to the weight adjustment node number of the current period, and at the same time obtain the preset offset upper limit parameter value, establish a directed comparison relationship between the two, and generate a time offset normalization benchmark pair. The process retrieves the resource weight value from the previous cycle (e.g., 0.8) and, combined with the original data from the cycle node offset magnitude sequence, retrieves the time offset difference value (e.g., 50 milliseconds) for the current weight adjustment node (node 101). Simultaneously, the process reads a preset offset upper limit parameter value, representing the maximum allowed time deviation, for example, set to 200 milliseconds. The process constructs a directed comparison relationship, confirming the comparison path between the "actual deviation" and the "allowed upper limit," and packages these two data points to form a time offset normalization baseline pair. This set of data (50 milliseconds, 200 milliseconds) will serve as the core basis for subsequent calculations of the adjustment magnitude. The setting of the offset upper limit parameter value is typically derived from the SLA (Service Level Agreement), such as stipulating that task response time should not exceed 200 milliseconds, which is a reasonable physical threshold.
[0031] S313: Based on the time offset normalization reference pair, the current time offset difference value is used as the comparison item, the offset upper limit value is used as the normalization standard, the numerical ratio calculation is performed to output the adjustment ratio, and the mapping relationship between the node number and the ratio result is recorded to generate the weight reduction numerical parameter. The specific numerical calculations are performed based on the time offset normalization benchmark. The current time offset difference of the node is used as the numerator, and the offset upper limit parameter value is used as the denominator, followed by a division operation. The calculation formula logic is: the adjustment ratio equals the time offset difference divided by the offset upper limit. The process uses the calculated quotient as the weight reduction ratio for that node. Subsequently, the node number is associated with this ratio value and recorded to generate the weight reduction numerical parameter. For example, substituting a time offset difference of 50 milliseconds and an offset upper limit of 200 milliseconds into the calculation logic, the process performs the operation of dividing 50 by 200, yielding a result of 0.25. This means that the resource weight of this node should be reduced by 25% (relative to the benchmark or as a coefficient). {101:0.25} is recorded as the weight reduction numerical parameter. The advantage of this calculation logic is that it dynamically determines the adjustment magnitude based on the proportion of the actual deviation to the allowable upper limit; the larger the deviation, the larger the reduction, achieving adaptive negative feedback adjustment.
[0032] Please see Figure 5 The specific steps of S4 are as follows: S411: Obtain the current period weight adjustment node number and corresponding ratio value recorded in the weight reduction numerical parameter, read the local node resource configuration table, retrieve the original resource weight value corresponding to the above node number, establish a mapping structure between node number, original resource weight value and weight reduction numerical parameter, and generate resource weight adjustment mapping pair. The process reads the output weight reduction parameter (e.g., {101: 0.25}) and parses out the node number 101 and the ratio value 0.25. Next, the process reads the local node resource configuration table again (or directly reuses data from S311) to confirm the original resource weight value (e.g., 0.8) corresponding to node 101 in the previous period. The process assembles these three key data items—node number 101, original weight 0.8, and reduction ratio 0.25—into a structured data unit, generating a resource weight adjustment mapping pair. This step completes the preparation and alignment of all operands required for the calculation, ensuring that subsequent calculations do not result in object mismatches.
[0033] S412: Based on the resource weight adjustment mapping pair, multiply the original resource weight value of each group of nodes with the corresponding resource weight adjustment ratio, and define the result as the weight to be deducted in the current period. Then associate the weight to be deducted with the node number to generate a set of node weight deduction values. The specific deduction amount is determined by performing a multiplication operation based on the resource weight adjustment mapping. The logical description is as follows: The process obtains the original resource weight value and the resource weight adjustment ratio, multiplies them, and the result is the weight value that should be deducted from the node in the current period. This calculation result is bound to the node number to generate a set of node weight deduction values. For example, substituting the original resource weight value of 0.8 and the weight reduction ratio of 0.25 into the calculation, the process calculates 0.8 multiplied by 0.25, resulting in 0.2. This indicates that the weight of node 101 needs to be reduced by 0.2 from the original 0.8. A dataset {101:0.2} is generated. This step converts the relative ratio value into an absolute weight value, making the adjustment amount specific.
[0034] S413: Based on the original resource weight values in the node weight deduction value set and the resource weight adjustment mapping pair, perform subtraction calculations on each node, subtract the corresponding weight deduction value from the original resource weight value to obtain the updated resource weight values of each node in the current period, and establish a corresponding relationship with the node number to generate a weight configuration update dataset. The final weight update calculation is performed. Based on the node weight deduction value set and the original resource weight value, the process performs a subtraction operation on the involved nodes: subtracting the corresponding weight deduction value from the original resource weight value. The calculated difference is the updated resource weight value of that node in the current period. The process re-maps the updated weight values to the node numbers, generating a weight configuration update dataset. For example, substituting the original weight 0.8 and the deduction value 0.2 into the subtraction logic, the process calculates 0.8 minus 0.2, resulting in 0.6. This means that the resource weight of node 101 in the new period is adjusted to 0.6. This result {101:0.6} is established as the new configuration standard. Through this series of calculations, the weight of poorly performing nodes is successfully reduced based on the actual performance of the nodes (time and performance deviation), thereby prompting the load to be transferred to other nodes and optimizing the overall cluster efficiency.
[0035] Please see Figure 6 The specific steps of S5 are as follows: S511: Obtain all node numbers and corresponding updated resource weight values in the weight configuration update dataset, retrieve the original resource weight values recorded by the above nodes in the previous period, compare whether there is a difference between the two values, filter the node numbers whose resource weight values have changed, and generate a set of nodes with weight changes. The process iterates through all records in the weight configuration update dataset, extracting the node ID and its corresponding updated resource weight value (e.g., 101: 0.6). Simultaneously, it retrieves the original resource weight values recorded for these nodes in the previous period (e.g., 101: 0.8). The process performs an equality check or a difference threshold check on each pair of values (updated vs. original). If the two values differ (e.g., 0.6 is not equal to 0.8), it determines that the node's configuration has undergone a substantial change. The process filters out all such changed node IDs and aggregates them into a weight-change node set. In the above example, because 0.6 and 0.8 are different, node 101 is included in the weight-change node set. This step aims to filter out nodes that are not affected by the adjustment, focusing on the changed items and improving subsequent processing efficiency.
[0036] S512: Based on the set of nodes with weight changes, extract the updated resource weight value corresponding to each node, construct a key-value pair structure with node number as index and updated weight value as content, assemble the node number and updated weight value of each node into an independent unit, and generate a single-node scheduling adjustment item set. For each node ID in the set of nodes with weight changes, its latest resource weight value is extracted from the weight configuration update dataset. The process constructs a standard key-value pair data structure, using the node ID as the unique index key and the updated weight value as the corresponding content value. Each node's key-value pair is assembled into an independent configuration unit, generating a single-node scheduling adjustment item set. For example, for node 101, the key-value pair {"NodeID": 101, "NewWeight": 0.6} is constructed. If other nodes change, such as node 105 changing to 0.7, then {"NodeID": 105, "NewWeight": 0.7} is similarly constructed. These unit sets constitute a specific update instruction package, ready for distribution or storage.
[0037] S513: Based on the single-node scheduling adjustment item set, sort all adjustment items according to the node number, merge and summarize them, construct a unified scheduling weight update record table under the current scheduling cycle, and archive and store it as an independent data file to generate dynamic weight allocation results. The process gathers all adjustment units in the single-node scheduling adjustment item set and sorts them according to their node numbers to ensure data order. These sorted adjustment items are then merged with the unchanged node configurations (or only the changed items are stored, depending on the strategy; here it's described as building a unified record table) to construct a complete unified scheduling weight update record table for the current scheduling cycle. Finally, the process serializes this record table into a standard JSON or XML file and writes it to disk for archiving, serving as a log and a benchmark for the next scheduling cycle, generating the final dynamic weight allocation result.
[0038] Please refer to Table 2 Table 2 Verification Table of Dynamic Weight Allocation Results
[0039] As shown in Table 2, the weight of node 101 was successfully and dynamically adjusted from 0.8 to 0.6 after the complete process from S111 to S513, while the weight of node 102 remained unchanged at 0.5 because the adjustment condition was not triggered (assuming its deviation did not exceed the limit). This experimental result shows that through the logical operations of the above steps, the resource weights of specific nodes can be accurately identified and quantified, effectively responding to the time and performance deviations of nodes and achieving closed-loop control. Archiving the updated weight table (containing 101: 0.6, 102: 0.5, etc.) completes the entire scheduling adjustment task for this cycle.
[0040] Please see Figure 7 A distributed dynamic weight allocation system based on real-time deviation correction includes: The node deviation acquisition module is used to perform S1: obtain the start time, end time and target execution time of the running tasks in each scheduling node in the edge computing server cluster, calculate the time offset difference between the actual execution time of each node task in the current period and the expected reference time, obtain the performance error difference between the output performance parameters of each task and the corresponding target indicators, and generate a periodic node offset amplitude sequence. The maximum offset filtering module is used to execute S2: based on the performance error difference and time offset difference data corresponding to each node in the periodic node offset magnitude sequence, record the node number with the unique maximum offset difference in the current scheduling period, and generate the node number for weight adjustment in the current period. The weight adjustment derivation module is used to execute S3: read the scheduling resource weight value configured in the previous period for the node corresponding to the current period's weight adjustment node number, calculate the ratio of the time offset difference corresponding to the current node to the set offset upper limit value, use the calculation result as the adjustment ratio of the corresponding node's resource weight, and generate weight reduction numerical parameters. The resource mapping update module is used to execute S4: based on the adjustment ratio in the weight down adjustment numerical parameter, read the original resource weight value of the corresponding node in the node resource configuration table, calculate the updated resource weight value of the node in the current period, and generate a weight configuration update dataset; The deviation scheduling archiving module is used to execute S5: based on the weight configuration update dataset, update the node number and corresponding updated weight content of the node that has undergone weight changes, combine them to form a single node scheduling adjustment item, and archive the dynamic weight allocation result.
[0041] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of protection of the described technical solutions.
Claims
1. A distributed dynamic weight allocation method based on real-time deviation correction, characterized in that, Includes the following steps: S1: Obtain the start time, end time and target execution time of the running tasks in each scheduling node of the edge computing server cluster, calculate the time offset difference between the actual execution time and the expected reference time of each node task in the current period, and obtain the performance error difference between the output performance parameters of each task and the corresponding target indicators, and generate a period node offset amplitude sequence. S2: Based on the performance error difference and time offset difference data corresponding to each node in the periodic node offset magnitude sequence, record the node number with the unique maximum offset difference in the current scheduling period, and generate the node number for weight adjustment in the current period. S3: Read the scheduling resource weight value configured in the previous period for the node corresponding to the current period weight adjustment node number, calculate the adjustment ratio of the corresponding node resource weight, and generate weight reduction numerical parameters. S4: Based on the adjustment ratio in the weight reduction numerical parameter, read the original resource weight value of the corresponding node in the node resource configuration table, calculate the updated resource weight value of the node in the current period, and generate a weight configuration update dataset. S5: Based on the weight configuration update dataset, the node numbers and corresponding updated weight contents that have undergone weight changes are combined to form a single node scheduling adjustment item, and the dynamic weight allocation result is archived.
2. The distributed dynamic weight allocation method based on real-time deviation correction according to claim 1, characterized in that: The node number with the unique maximum offset difference specifically refers to the following: when there is a node performance error difference that exceeds the set performance offset tolerance, the corresponding node number is extracted first; if no node exceeds the tolerance, the node number with the largest time offset difference is extracted.
3. The distributed dynamic weight allocation method based on real-time deviation correction according to claim 1, characterized in that: The updated resource weight value specifically refers to calculating the weight that should be deducted from the corresponding node in the current period by performing a multiplication operation on the adjustment ratio and the original resource weight value, and then subtracting the deducted weight from the original resource weight value to obtain the updated resource weight value.
4. The distributed dynamic weight allocation method based on real-time deviation correction according to claim 1, characterized in that: The periodic node offset magnitude sequence includes a time offset rate sequence, a performance error rate sequence, and a normalized mapping set. The current periodic weight adjustment node number includes the target node number, offset type label, and offset extreme value identifier. The weight reduction numerical parameters include the original node weight value, weight adjustment ratio, and target deduction coefficient. The weight configuration update dataset includes the updated weight value, weight change ratio, and list of changed nodes. The dynamic weight allocation result includes a node scheduling adjustment item set, a scheduling resource allocation graph, and an update configuration record table.
5. The distributed dynamic weight allocation method based on real-time deviation correction according to claim 1, characterized in that, The steps for obtaining the periodic node offset magnitude sequence are as follows: S111: Obtain the start time, end time and target execution time of the tasks running in each scheduling node of the edge computing server cluster, calculate the time difference between the actual execution time and the corresponding target execution time of each task, and generate a set of node time offset differences; S112: Obtain the output performance parameters and corresponding target performance index values of each task, establish the correspondence between performance parameters and target indexes according to task number, calculate the difference between the output performance parameters and target values of each task, and generate a node performance error difference set. S113: Based on the node time offset difference set and the node performance error difference set, normalize all values in the two sets respectively, index and map them according to the node number and superimpose them to generate a periodic node offset amplitude sequence.
6. The distributed dynamic weight allocation method based on real-time deviation correction according to claim 1, characterized in that, The steps for obtaining the current period weight adjustment node number are as follows: S211: Obtain the performance error difference and time offset difference data corresponding to each node in the periodic node offset amplitude sequence. For each node, compare the performance error difference with the set performance offset tolerance item by item, mark the node number whose performance error difference exceeds the set performance offset tolerance, and generate the node number set of the over-limit node. S212: Perform node determination according to the set of out-of-limit node numbers. When there are records in the set of out-of-limit node numbers, directly aggregate the node numbers. When the set of out-of-limit node numbers is empty, perform a size comparison on the time offset difference of each node in the periodic node offset amplitude sequence, filter the node number with the largest time offset difference, and obtain the candidate offset node number. S213: Based on the candidate offset node sequence number, record the node number with the largest unique offset difference in the current scheduling period, establish a one-to-one correspondence between the scheduling period and the node number, and generate the current period weight adjustment node number.
7. The distributed dynamic weight allocation method based on real-time deviation correction according to claim 1, characterized in that, The steps for obtaining the weight reduction numerical parameters are as follows: S311: Obtain the current period weight adjustment node number, read the historical scheduling configuration data stored locally, retrieve the resource weight configuration records of each node in the previous scheduling period, extract the scheduling resource weight value corresponding to the current period weight adjustment node number, establish a one-to-one mapping relationship between the node number and the weight value, and generate the resource weight value of the previous period. S312: Based on the resource weight value of the previous period and the offset amplitude sequence of the period nodes, retrieve the time offset difference value of the node corresponding to the weight adjustment node number of the current period, and at the same time obtain the preset offset upper limit parameter value, establish a directed comparison relationship between the two, and generate a time offset normalization reference pair. S313: Based on the time offset normalization reference pair, take the current time offset difference value as the comparison item, take the offset upper limit value as the normalization standard, perform numerical ratio calculation to output the adjustment ratio, and record the mapping relationship between the node number and the ratio result to generate weight reduction numerical parameters.
8. The distributed dynamic weight allocation method based on real-time deviation correction according to claim 1, characterized in that, The steps for obtaining the weight configuration update dataset are as follows: S411: Obtain the current period weight adjustment node number and corresponding ratio value recorded in the weight reduction numerical parameter, read the local node resource configuration table, retrieve the original resource weight value corresponding to the above node number, establish a mapping structure between the node number, the original resource weight value and the weight reduction numerical parameter, and generate a resource weight adjustment mapping pair. S412: Based on the resource weight adjustment mapping pair, the original resource weight value of each group of nodes is multiplied by the corresponding resource weight adjustment ratio. The result is defined as the weight to be deducted in the current period. The weight to be deducted is associated with the node number to generate a set of node weight deduction values. S413: Based on the original resource weight values in the node weight deduction value set and the resource weight adjustment mapping pair, perform subtraction calculations on each node, subtract the corresponding weight deduction value from the original resource weight value to obtain the updated resource weight values of each node in the current period, and establish a corresponding relationship with the node number to generate a weight configuration update dataset.
9. The distributed dynamic weight allocation method based on real-time deviation correction according to claim 1, characterized in that, The steps for obtaining the dynamic weight allocation result are as follows: S511: Obtain all node numbers and corresponding updated resource weight values in the weight configuration update dataset, retrieve the original resource weight values recorded by the above nodes in the previous period, compare whether there is a difference between the two values, filter the node numbers whose resource weight values have changed, and generate a set of nodes with weight changes. S512: Based on the set of nodes with weight changes, extract the updated resource weight value corresponding to each node, construct a key-value pair structure with node number as index and updated weight value as content, assemble the number of each node and the updated weight value to form an independent unit, and generate a single-node scheduling adjustment item set. S513: Based on the single-node scheduling adjustment item set, sort all adjustment items according to node number, merge and summarize them, construct a unified scheduling weight update record table under the current scheduling cycle, and archive and store it as an independent data file to generate dynamic weight allocation results.
10. A distributed dynamic weight allocation system based on real-time deviation correction, characterized in that, The system is used to implement the distributed dynamic weight allocation method based on real-time deviation correction as described in any one of claims 1-9, including: The node deviation acquisition module is used to perform S1: obtain the start time, end time and target execution time of the running tasks in each scheduling node in the edge computing server cluster, calculate the time offset difference between the actual execution time of each node task in the current period and the expected reference time, obtain the performance error difference between the output performance parameters of each task and the corresponding target indicators, and generate a periodic node offset amplitude sequence. The maximum offset filtering module is used to execute S2: based on the performance error difference and time offset difference data corresponding to each node in the periodic node offset magnitude sequence, record the node number with the unique maximum offset difference in the current scheduling period, and generate the node number for weight adjustment in the current period. The weight adjustment derivation module is used to execute S3: read the scheduling resource weight value configured in the previous period for the node corresponding to the current period weight adjustment node number, calculate the ratio of the time offset difference corresponding to the current node to the set offset upper limit value, use the calculation result as the adjustment ratio of the resource weight of the corresponding node, and generate the weight reduction numerical parameter. The resource mapping update module is used to execute S4: based on the adjustment ratio in the weight reduction numerical parameter, read the original resource weight value of the corresponding node in the node resource configuration table, calculate the updated resource weight value of the node in the current period, and generate a weight configuration update dataset; The deviation scheduling archiving module is used to execute S5: based on the weight configuration update dataset, the node numbers and corresponding updated weight contents that have undergone weight changes are combined to form a single node scheduling adjustment item, and the dynamic weight allocation result is archived.