A heterogeneous edge resource prediction method and system based on a scheduling task intention
By integrating scheduling task intent with historical resource status and utilizing gated cross-attention processing, the problem of lag in resource prediction response in existing technologies is solved, achieving more accurate and stable resource prediction.
Patent Information
- Application Number
- CN202611554848.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-09
- Publication Date
- 2026-11-06
AI Technical Summary
Existing resource prediction methods struggle to leverage the scheduler to obtain task information before load changes in scenarios such as task initiation, task termination, model switching, concurrent adjustment, and cross-node migration. This results in delayed prediction response, and exogenous variables fail to effectively integrate the scheduling task intent, potentially introducing noise or bias.
By obtaining the structured task intent determined by the scheduler as an exogenous prior, and fusing it with the historical resource state under time constraints, the resource-intent interaction features are generated using gated cross-attention processing, resulting in more accurate resource prediction results.
It enables proactive response to resource load changes before resource curve changes, reduces noise impact, and improves the accuracy and stability of resource prediction, especially by maintaining conservative output during scheduling state transitions.
Smart Images

Figure CN123048237A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of heterogeneous edge resource management and computer system performance prediction technology, specifically involving a heterogeneous edge resource prediction method and system based on scheduling task intent. Background Technology
[0002] Heterogeneous edge computing systems typically include embedded edge terminals, edge servers, and edge computing clusters equipped with graphics processors, neural network processors, field-programmable gate arrays, or other dedicated computing accelerators. To enable elastic scaling, capacity planning, cross-node service migration, and resource scheduling, the scheduler needs to understand the trends in resource status over several future timescales.
[0003] Existing resource prediction methods typically predict future resource states based on historical resource status monitoring sequences such as power consumption, utilization, memory usage, network throughput, queue depth, and service latency prior to the prediction time. While these methods can learn the periodicity and short-term trends of historical resource curves, in scenarios where state transitions are actively triggered by the scheduler, such as task initiation, task termination, model switching, concurrency adjustments, batch size changes, or cross-node migrations, the scheduling plan usually precedes changes in the resource curve. When passively extrapolating based solely on historical resource sequences, the model often needs to respond fully only after the resource changes have occurred, making it difficult to utilize the task information already known to the scheduler before load changes.
[0004] Existing time series forecasting methods enhanced with exogenous variables can fuse exogenous variables with historical sequences, but they typically treat exogenous variables as ordinary auxiliary sequences without establishing specific constraints on the observable boundaries of scheduling task intentions, plan effective times, and field semantics. If all historical locations interact indiscriminately with all scheduling fields, it may introduce field noise that is weakly correlated with the current resource state; if scheduling intentions are directly and continuously injected into all prediction times, it may also cause unnecessary prediction biases in the steady-state interval or when scheduling information is abnormal. Summary of the Invention
[0005] To address the problems and needs in the background technology, this invention proposes a heterogeneous edge resource prediction method and system based on scheduling task intent. This invention uses structured task intents, whose prediction anchor point time has been determined and can be read by the scheduler, as an exogenous prior prior to changes in resource load. This prior intent is then fused with historical resource states prior to the prediction anchor point under time constraints. This allows for a response before significant changes occur in the resource curve, i.e., adjusting the executed tasks, configuring, or migrating nodes.
[0006] The technical solution of the present invention is as follows:
[0007] In a first aspect, the present invention proposes a method for predicting heterogeneous edge resources based on scheduling task intent, the method comprising the following steps:
[0008] Step 1: Obtain the historical resource monitoring sequence of the edge accelerator node and generate the historical resource token sequence, and obtain the scheduling plan and generate the task intent token sequence;
[0009] Step 2: Generate a historical resource status feature sequence based on the historical resource token sequence, and then generate the first resource prediction result;
[0010] Step 3: Combine the temporal semantic information of the scheduling plan to generate a temporal constraint mask based on the historical resource token sequence and task intent token sequence;
[0011] Step 4: Based on the temporal constraint mask, historical resource state feature sequence, and task intent token sequence, gated cross-attention processing is performed to obtain resource-intent interaction features, thereby generating the second resource prediction result;
[0012] Step 5: Generate the final resource prediction result based on the first resource prediction result and the second resource prediction result.
[0013] Further, in step 2, generating a historical resource status feature sequence based on the historical resource token sequence includes:
[0014] Input the historical resource token sequence into the historical resource self-attention encoding module, and the module outputs the historical resource state feature sequence.
[0015] Further, step 3 includes:
[0016] The plan lead time is determined based on the observable time and effective time of the scheduling plan to which the task intent token belongs. The plan lead time is then mapped to obtain the allowable time span. Based on the allowable time span, the mask information of the i-th historical resource token and the j-th task intent is generated according to the time position of the i-th historical resource token in the historical resource token sequence and the effective time of the plan to which the j-th task intent belongs in the task intent token sequence. The timing constraint mask is generated from all the mask information.
[0017] Further, in step 4, after performing gated cross-attention processing based on the temporal constraint mask, historical resource state feature sequence, and task intent token sequence, resource-intent interaction features are obtained, including:
[0018] For single-head gated cross-attention, firstly, a task intent field gating matrix is generated based on the historical resource state feature sequence, task intent token sequence, task intent field type, and the relative temporal relationship between historical resource tokens and task intent tokens. Next, a query matrix is constructed based on the historical resource state feature sequence, and a key matrix and value matrix are constructed based on the task intent token sequence. Combined with a temporal constraint mask, basic attention weights are generated. Then, gated attention weights are generated based on the basic attention weights and the task intent field gating matrix. Finally, resource-intent interaction features are generated based on the gated attention weights and the value matrix.
[0019] Further, in step 4, generating a second resource prediction result includes:
[0020] The target resource state to be predicted is determined. When the target resource state to be predicted includes accelerator utilization or target server end-to-end latency, the final resource-intent interaction features are input into the corresponding prediction head to generate the corresponding prediction result. When the target resource state to be predicted includes the total power consumption of the node, an intent-enhanced neural power consumption correction term is generated based on the final resource-intent interaction features. Then, the total power consumption prediction value of the node in the second resource prediction result is generated by combining the current power consumption anchor point and the training set conditional residual, thereby obtaining the second resource prediction result.
[0021] Furthermore, the target resource state to be predicted includes one or more of the following: the total power consumption of the target edge accelerator node at the prediction time scale, the accelerator utilization rate, and the end-to-end latency of the target server deployed on the target edge accelerator node.
[0022] Secondly, this invention proposes a heterogeneous edge resource prediction system based on scheduling task intent, the system comprising:
[0023] The data acquisition unit is used to acquire historical resource monitoring sequences of edge accelerator nodes and to acquire scheduling plans.
[0024] The first token generation unit is used to generate a historical resource token sequence based on the historical resource monitoring sequence of the edge accelerator node.
[0025] The second token generation unit is used to generate a sequence of task intent tokens based on the obtained scheduling plan;
[0026] The historical benchmark prediction unit is used to generate a historical resource status feature sequence based on the historical resource token sequence, and then generate the first resource prediction result.
[0027] The mask generation unit is used to generate a timing constraint mask based on the historical resource token sequence and the task intent token sequence by combining the temporal semantic information of the scheduling plan.
[0028] The intent enhancement prediction unit is used to obtain resource-intent interaction features by performing gated cross-attention processing on the temporal constraint mask, historical resource state feature sequence and task intent token sequence, and then generate a second resource prediction result.
[0029] The resource status output unit is used to generate the final resource prediction result based on the first resource prediction result and the second resource prediction result.
[0030] Thirdly, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in the first aspect above.
[0031] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect above.
[0032] Fifthly, the present invention provides a computer program product comprising a computer program / instructions which, when executed by a processor, implement the steps of the method described in the first aspect above.
[0033] The beneficial effects of this invention are as follows:
[0034] 1. This invention utilizes the observable task intent of the scheduler before resource changes to establish a time sequence constraint of "scheduling intent appears first, resource load changes later", which extends resource prediction from passive extrapolation that only depends on historical sequences to active prediction.
[0035] 2. The present invention establishes a two-dimensional pairwise temporal constraint based on historical resource location and field-level task intent token. This constraint can explicitly restrict the historical resource locations in which different structured task intent fields can participate in the interaction, avoid generating resource-intent interaction features that do not conform to the planned temporal relationship, and reduce indiscriminate fusion noise.
[0036] 3. This invention generates gated attention weights based on the task intent field gating matrix and the basic attention weights, and these gated attention weights are not renormalized. This allows for both field-level selection and control over the overall injection magnitude of the task intent, thereby preventing the weights corresponding to the suppressed parts of the attention weights from being redistributed to other fields.
[0037] 4. This invention uses the historical baseline prediction path, which relies solely on the historical resource status, as an independent reference for intention-enhanced prediction. Combined with the event window and path difference safety rollback mechanism, this invention can utilize task intention during scheduling state transitions to maintain conservative output in the steady-state range or when prediction discrepancies are large.
[0038] 5. The total power consumption of the node proposed in this invention adopts a hierarchical structure of currently observable power consumption anchor points, pre-statistical conditional residuals, and bounded neural corrections. It strictly distinguishes between training statistics, verification parameter selection, and test evaluation, which can limit abnormal prediction bias caused by neural corrections and reduce the risk of ex-post information entering deployment parameters, thereby improving the deployment stability of power consumption prediction. Attached Figure Description
[0039] Figure 1 This is a flowchart of the method of the present invention.
[0040] Figure 2 This is a system framework diagram of the present invention.
[0041] Figure 3 This is a network structure diagram for gating cross-attention.
[0042] Figure 4 A schematic diagram of timing constraint mask generation driven by planned lead time.
[0043] Figure 5 A flowchart for selecting a safe rollback based on path differences in the event window. Detailed Implementation
[0044] To enable those skilled in the art to better understand the present invention and to more clearly define the scope of protection claimed by the present invention, the present invention will be described in detail below with reference to certain specific embodiments and accompanying drawings. It should be noted that the following specific embodiments are only a part of the embodiments of the present invention, and the specific direct descriptions of related structures are only for the convenience of understanding the present invention; each specific feature does not necessarily or directly limit the scope of implementation of the present invention. Conventional selections and substitutions made by those skilled in the art under the guidance of the inventive concept, as well as reasonable arrangements and combinations of several technical features under the guidance of the inventive concept, should all be considered within the scope of protection claimed by the present invention.
[0045] like Figure 1 As shown, the heterogeneous edge resource prediction method based on scheduling task intent proposed in this invention includes the following steps:
[0046] Step 1: Obtain the historical resource monitoring sequence of the target edge accelerator node before the prediction anchor point and generate the historical resource token sequence of the current edge accelerator node; also, obtain the scheduling plan and generate the task intent token sequence. This scheduling plan is a valid scheduling plan that has been determined by the scheduler at the current prediction anchor point and can be read by the prediction system.
[0047] In one feasible implementation, the historical resource monitoring sequence may include one or more of the following: total node power consumption of the target edge accelerator node, accelerator utilization, accelerator storage space utilization, processor utilization, system memory utilization, historical queue depth, network transmit and receive throughput, temperature, and end-to-end latency of the target server deployed on the target node.
[0048] Total node power consumption refers to the overall electrical power of the node as collected by the node's power input terminal, intelligent power distribution unit, or equivalent interface.
[0049] Server-to-end latency is the total time from when a request enters the target service queue, through queuing, necessary data transmission, accelerator processing, and result return.
[0050] When the target to be predicted includes the end-to-end latency of the target server, a target service identifier can be associated with the prediction instance to distinguish different services on the same target node. If the corresponding latency label is missing in the training sample, the label is only masked during loss calculation and offline evaluation.
[0051] It should be noted that the time interval between two adjacent prediction anchor points is denoted as the prediction anchor step size.
[0052] An effective scheduling plan contains several scheduling plan records, and the r-th scheduling plan record... It can be represented as ,in For the purpose of identifying the plan, For task or service identification, and These are the source node and the target node, respectively. For the planned observable time, The time when the plan takes effect, In the planned state, This is a set of structured task intent fields. The plan observable time describes the time boundary at which the prediction system can first read the corresponding scheduled task intent. The plan effective time is the time when the plan, determined by the scheduler and readable by the prediction system at the prediction anchor point, begins to take effect. Only when... Furthermore, a plan is considered a valid scheduling plan for the current prediction anchor only if it is relevant to the target node, not canceled, not invalidated, and not overwritten by an updated version. Scheduling task intentions are generally more valuable near state transitions such as task switching, model switching, concurrency adjustments, and node migrations, while continuously injecting task intentions into the long-term steady-state interval may increase unnecessary offsets. Therefore, this invention introduces a resource state prediction path that includes scheduling task intentions, in addition to the resource state baseline prediction path.
[0053] In one data acquisition implementation, the observable time of the plan can correspond to the time when the scheduler dispatches the decision record, and the effective time of the plan can correspond to the start time of the plan that the scheduler has determined during dispatch. The plan record used for task intent input is already readable at the current prediction anchor point, and its observable time is no later than the effective time of the plan. For plan records that are read by the prediction system after the plan takes effect, they can be recorded as post-event windows starting from their actual observable time.
[0054] In one feasible implementation, generating a historical resource token sequence for the current edge accelerator node includes:
[0055] First, historical resource monitoring sequences are uniformly resampled to fixed time intervals. For the resampled historical resource monitoring sequences, short-term missing values can be filled with the most recent valid values, while longer missing values can be filled with statistical values calculated solely from the training set, and a missing indicator variable is generated simultaneously. The statistical values include one or more of the following: mean, standard deviation, median, or other standardized parameters.
[0056] Next, let the length of the historical resource window be... For the m-th resource variable channel (excluding the resource variable type channel and the time location channel), combined with the time slice length... and sliding step size The historical resource window is used to divide time slices, resulting in several complete time slices. The numerical sequence of the i-th complete time slice is linearly mapped to obtain the corresponding fragment representation. Resource variable type code and time position code are then added to each fragment representation to form the historical resource token of the i-th complete time slice. The time position of the i-th historical resource token. The last sampling moment of the corresponding time slice is preferred.
[0057] In one specific embodiment, the historical resource window length is 60 seconds, the prediction anchor step size is 5 seconds (meaning a new prediction is triggered every 5 seconds), and the prediction time scale includes 5 seconds, 10 seconds, and 20 seconds; the time slice length can be 16 sampling points, and the sliding step size can be 8 sampling points. The above values are used to illustrate an implementable configuration and do not constitute a limitation on the scope of protection of this invention.
[0058] In one possible implementation, generating a task intent token sequence includes:
[0059] Structured task intent fields may include task type, target node, model identifier or model size, batch size, concurrency configuration, priority, scheduling strategy, plan switchover type, plan switchover intensity, and plan context queue depth snapshot. Task type, target node, model identifier, priority, scheduling strategy, and plan switchover type are usually used as categorical fields; batch size, concurrency configuration, model size, and plan context queue depth snapshot can be used as continuous fields according to their actual record format; plan switchover intensity is used as a categorical field when using discrete levels such as low, medium, and high, and as a continuous field when using continuous numerical representation.
[0060] Each structured task intent field is encoded using a dedicated field-specific encoding method to form a field-level task intent token. These field-level task intent tokens then constitute a task intent token sequence. The planning lead time and the relative effective time of the prediction anchor point serve as temporal semantics associated with the task intent tokens and are not generated as separate field-level task intent tokens.
[0061] Categorical fields can be encoded using embedding layers. Continuous fields can be standardized using training set statistics and then projected onto a unified feature dimension via a shallow feedforward network or linear mapping. Embedding, feedforward networks, and linear layers can all use existing mature network structures, but their weight parameters are determined through training on the actual constructed training data, rather than directly using ready-made pre-trained weights.
[0062] Determine the effective date of each task intent token associated with its respective plan. and the lead time of the plan Lead time for the plan ,in, This is the moment when the plan becomes readable information for the prediction system. For the current prediction anchor point... The corresponding prediction anchor point relative to the effective time ,in, Used to describe the dynamic time relationship between the current moment and the time from when the plan takes effect.
[0063] The plan switching intensity describes the magnitude of resource status changes anticipated by the scheduler during plan generation, including task initiation or termination, model switching, concurrent configuration adjustment, batch size adjustment, or node migration. The scheduler can pre-determine ordered discrete levels (low, medium, high) or equivalent values. This field serves two purposes: firstly, as a structured task intent field in task intent encoding; and secondly, as a grouping condition for training set conditional residuals and an online query condition in total node power consumption prediction.
[0064] It should be noted that when there is no valid task intent at the current prediction anchor point, an empty task intent token with a value vector of zero can be set to maintain the shape of the tensor.
[0065] Step 2: Generate a historical resource status feature sequence based on the historical resource token sequence of the current edge accelerator node, and then generate the first resource prediction result of the current edge accelerator node, which is denoted as the historical baseline prediction path;
[0066] In one feasible implementation, a historical resource status feature sequence is generated based on the historical resource token sequence of the current edge accelerator node, including:
[0067] Input the historical resource token sequence of the current edge accelerator node into the historical resource self-attention encoding module, and the module outputs the historical resource state feature sequence.
[0068] In one feasible implementation, the historical resource self-attention encoding module is obtained by training a multi-head self-attention network using a constructed dataset, as shown in the following formula:
[0069]
[0070] Wherein, MHSA() represents multi-head self-attention. For historical resource token sequences, It is a sequence of historical resource status characteristics.
[0071] In one feasible implementation, the historical resource self-attention encoding module consists of one or more encoding layers connected in series, that is, the output of the previous encoding layer serves as the input of the next encoding layer, and the last encoding layer outputs a sequence of historical resource state features. For each encoding layer, firstly, the input of the encoding layer is fed into a multi-head self-attention sub-layer, and the input and output of the multi-head self-attention sub-layer are residually concatenated. The result after residual concatenation is normalized by the first layer. Subsequently, the normalized output of the first layer is used as the input of a feedforward sub-layer, and the input and output of the feedforward sub-layer are residually concatenated. The result after residual concatenation is normalized by the second layer to obtain the output of the current encoding layer. A historical resource token validity mask is added before the softmax calculation of the multi-head self-attention sub-layer to set the attention score corresponding to the padding token to a sufficiently small negative number, so that its attention weight approaches 0. In a specific embodiment, the historical resource self-attention encoding module can be composed of two encoding layers connected in series. The multi-head self-attention sub-layer in each encoding layer uses four attention heads, with an encoding feature dimension of 64, and a dropout rate of 0.1 during encoding layer training.
[0072] In one feasible implementation, generating the first resource prediction result for the current edge accelerator node includes:
[0073] The historical resource status feature sequence is input into the historical baseline prediction head to generate the first resource prediction result. The historical baseline prediction head can adopt a linear layer or FFN / MLP structure, and its specific weight parameters are determined by training using the constructed training data.
[0074] Each prediction is based on a prediction instance. This is the basic processing unit, where n is the target edge accelerator node and t is the prediction anchor point time. For predicting a set of timescales, satisfying , These are the first prediction time scale, the second prediction time scale, and the third prediction time scale, respectively. Prediction time scale. When the target to be predicted includes the end-to-end latency of the target server, it can be further associated with the target service instance or service category w. In this case, the prediction instance can be represented as... .
[0075] Step 3: Combining the temporal semantic information of the scheduling plan, and based on the time position of each historical resource token in the historical resource token sequence of the current edge accelerator node and the schedule time information associated with each field-level task intent token in the task intent token sequence, generate a temporal constraint mask between the historical resource token position and the field-level task intent token.
[0076] In one feasible implementation, step 3 includes:
[0077] The plan lead time is determined based on the observable time and effective time of the scheduling plan to which the task intent token belongs. The plan lead time is then mapped to obtain the allowable time span. Based on the allowable time span, the mask information of the i-th historical resource token and the j-th task intent is generated according to the time position of the i-th historical resource token in the historical resource token sequence and the effective time of the plan to which the j-th task intent belongs in the task intent token sequence. The timing constraint mask is generated from all the mask information.
[0078] Specifically as follows:
[0079] like Figure 4 As shown, the planned lead time To represent the length of time, and to ensure that it is dimensionless when entering the logarithmic mapping, a fixed positive time base is first used. Dimensionless conversion yields the dimensionless planning lead time. , Then, the allowed time span is obtained through a preset continuous monotonic mapping. , , and To allow time span mapping parameters, It is a positive value. The mask determination method can be written as: .
[0080] For the i-th historical resource token and the j-th field-level task intent token, their mask information satisfies the following formula:
[0081]
[0082] in, The masking suppression constant is a sufficiently large positive number that makes the weights of the masked positions approach 0 after softmax; it can also be used in theoretical expressions. This indicates the location that has been blocked. This represents the time position of the i-th historical resource token.
[0083] It should be noted that, , and The temporal constraint mask is fixed before online inference; it can be pre-set by the system or selected based on training and / or validation samples. The temporal constraint mask itself involves deterministic rule calculation and does not participate in neural network gradient training; during online inference, it is only based on the fixed mask. , , And the mask for generating planned time information. Planned effective time. and historical resource token time location It belongs to an absolute moment.
[0084] Let the number of historical resource tokens be... The number of field-level task intent tokens is Then the timing constraint mask Its rows correspond to the positions of historical resource tokens, and its columns correspond to the field-level task intent tokens.
[0085] Planning satisfaction used for proactive task intent prediction and participation in planning lead time timing constraints ,therefore This nonnegative constraint only applies to the validity of the planning lead time. (Timing constraint mask) This is used to apply temporal constraints to each combination of historical resource location and each task intent field. The longer the plan lead time, the larger the allowed time span, allowing the task intent of the plan to participate in interactions at earlier historical resource locations; when the plan lead time is short, only historical locations closer to the plan's effective time are allowed to participate in interactions.
[0086] Furthermore, when all real field-level task intent tokens corresponding to a certain historical resource location are masked by the time-series constraint mask, the mask position between the historical resource location and the empty task intent token is set to an allowed interaction value, and other historical resource locations with real interactive task intents are kept masked from the empty task intent token; the value vector of the empty task intent token is zero, which can avoid meaningless uniform weights or numerical anomalies in the softmax calculation of the fully masked row.
[0087] Step 4: Based on the temporal constraint mask, historical resource state feature sequence, and task intent token sequence, gated cross-attention processing is performed to obtain resource-intent interaction features, thereby generating the second resource prediction result of the current edge accelerator node, which is denoted as the intent enhancement prediction path;
[0088] One feasible implementation method is, for example Figure 3 As shown, based on the temporal constraint mask, historical resource state feature sequence, and task intent token sequence, after gating cross-attention processing, resource-intent interaction features are obtained, including:
[0089] For single-head gated cross-attention, firstly, a task intent field gating matrix is generated based on the historical resource state feature sequence, task intent token sequence, task intent field type, and the relative temporal relationship between historical resource tokens and task intent tokens. Next, a query matrix is constructed based on the historical resource state feature sequence, and a key matrix and value matrix are constructed based on the task intent token sequence. Combined with a temporal constraint mask, basic attention weights are generated. Then, gated attention weights are generated based on the basic attention weights and the task intent field gating matrix. Finally, resource-intent interaction features are generated based on the gated attention weights and the value matrix.
[0090] It should be noted that in the task intent field gating matrix, the field type indicates that as an explicit input, the corresponding field gating value... The generation process is used to adjust the contribution of different fields in the current historical resource state.
[0091] Specifically as follows:
[0092] For the i-th historical resource status feature and the j-th field-level task intent token, calculate the relative time difference between the resource token and the task intent token. The formula is as follows:
[0093]
[0094] in, This indicates that the plan's effective time is later than the historical resource token's time position; based on the relative time difference. Constructing a representation of relative time relationships The task intent field type is represented as an explicit input. This relative time difference is used for paired interactions between historical location and the task intent field.
[0095] Field gating can be represented as:
[0096]
[0097] in, This represents the field gating value between the i-th historical resource status feature and the j-th field-level task intent token. , For the Sigmoid function; This represents a multilayer perceptron. For the i-th historical resource state feature, For the j-th task intent token, This represents the type of the j-th task intent field. [·] represents the encoding of relative time relationships, and [·] represents the feature concatenation operation.
[0098] It should be noted that the task intent field gating matrix With the basic attention weight matrix They have the same two-dimensional index relationship of "historical resource location × task intent field", so they can perform Hadamard element-wise multiplication at the corresponding positions.
[0099] Query matrix of cross-attention mechanism Key matrix Sum matrix Satisfy the following formula:
[0100]
[0101]
[0102]
[0103] in, , , These are linear projection parameter matrices for the query, key, and value, respectively. It is a sequence of historical resource status characteristics. This is a sequence of task intent tokens.
[0104] Calculate the scaled dot product attention score by combining the temporal constraint mask. The formula is as follows:
[0105]
[0106] Scaling dot product attention score along the task intent token dimension Perform softmax normalization to obtain the basic attention weights. The formula is as follows:
[0107]
[0108] Then, based on the basic attention weights and task intent field gating matrix Generate attention weights after gating The formula is as follows:
[0109]
[0110] Finally, based on the value matrix Attention weights after gating Generate Resources - Intent Interaction Features The formula is as follows:
[0111]
[0112] in, This indicates the transpose operation. The feature dimension of the key vector. Represents the normalized exponential function, This represents Hadamard element-wise multiplication.
[0113] In this embodiment, the value matrix is used directly. Attention weights after gating Generate Resources - Intent Interaction Features Therefore, when the overall gating values of all task intent fields in a row are small, the overall injection strength of task intents received at that historical resource location decreases; if only a few fields have large gating values, then the task intent increment is mainly provided by these highly relevant fields. The usual approach is to first renormalize the attention weights, so that the attention weights corresponding to the suppressed parts are redistributed to other fields. Compared to this approach, the method adopted in this invention can simultaneously complete field-level selection and overall intent injection strength control.
[0114] For example, if the softmax base attention weights for three task intent fields corresponding to a certain historical resource location are [0.50, 0.30, 0.20], and the field gating values are [0.82, 0.68, 0.31], then the gating weights are [0.410, 0.204, 0.062], and the row sum is 0.676. This implementation does not renormalize the row; therefore, the gating cross-attention processing proposed in this invention can simultaneously reduce the relative contribution of low-relevance fields and the overall intensity of the task intent received at that historical resource location.
[0115] Furthermore, gated cross-attention can employ a multi-head structure. Each attention head constructs a query, key, and value, and calculates the corresponding resource-intent interaction features by combining temporal constraint masks and field gating. Subsequently, the outputs of each attention head are concatenated and linearly projected, and then residual connections and feedforward transformations are performed with historical resource state features. That is, the features obtained after concatenating and linearly projecting the outputs of all attention heads are residually connected with the historical resource state features. The result after residual connection is normalized by a third layer. Then, the output of the third layer normalization is used as the input of the corresponding feedforward network, and the input of the feedforward network is residually connected with its output. The result after residual connection is normalized by a fourth layer to obtain the fused resource state features used for intent enhancement prediction, i.e., the final resource-intent interaction features.
[0116] In one feasible implementation, generating a second resource prediction result for the current edge accelerator node includes:
[0117] Determine the target resource state to be predicted. For accelerator utilization and target server end-to-end latency, input the final resource-intent interaction features into the corresponding prediction head to obtain the corresponding prediction results; for total node power consumption, input the final resource-intent interaction features into the intent-enhanced power consumption neural prediction head or linear projection to obtain the intent-enhanced neural power consumption correction term. Construct the predicted value of total node power consumption based on the intent-enhanced neural power consumption correction term, the current power consumption anchor point, and the training set conditional residuals to obtain the second resource prediction result.
[0118] The target resource status to be predicted includes one or more of the following: total node power consumption, accelerator utilization, and end-to-end latency of the target server deployed on the target edge accelerator node at the prediction timescale. The number of prediction timescales can be one or more. Among these, total node power consumption and accelerator utilization are node-level predictions, while the end-to-end latency of the target server is a service-level prediction associated with the target service; all three can serve as prediction targets in this invention.
[0119] When the target to be predicted includes the total power consumption of nodes, the total power consumption of nodes in the second resource prediction result is calculated using the method of "current power consumption anchor point + training set conditional residual + bounded intention-enhanced neural power consumption correction".
[0120] Specifically as follows:
[0121] For the target node The current power binning is obtained from the power binning rules or binning boundaries determined by the current power quantiles in the training set. Planned switching intensity The event association rules are already observable at the prediction anchor point of the training samples and are obtained according to the event association rules predetermined during the sample construction phase. Specifically, among the planned events that are observable at prediction anchor point t, relevant to the target node, and valid, the event with the smallest time distance from prediction anchor point t is selected as the currently relevant event. It can be seen that this rule only uses information available at the prediction anchor point to ensure consistency between training statistics and online query conditions.
[0122] In one feasible implementation, based on preset grouping conditions, the statistical process of the training set conditional residuals is as follows:
[0123] For training samples Prediction anchor point Based on training samples belonging to a specified group, the residuals of future real power consumption relative to the current power consumption anchor point are calculated. A preferred approach is to use the median of the residuals as a robust statistic, i.e., the residual statistic. And denoted as the training set conditional residual, the formula is as follows:
[0124]
[0125] in, This represents a bin consisting of the target node n, the planned switching intensity s, and the current power consumption. A subset of training samples is obtained by jointly filtering based on four conditions: prediction time scale h. This indicates the median-taking operation; The median of the residuals of "future real node total power consumption - current power consumption anchor point" in this training sample subset is a scalar statistic indexed by four conditions. This indicates that the training sample u is at the prediction anchor point time. Then predict the actual total power consumption of the node at the corresponding time scale h; For training sample u at prediction anchor time The total power consumption of the current node as actually observed, i.e., the current power consumption anchor point.
[0126] During online reasoning, first determine the relevant events based on the set of valid planned events. And determine the total power consumption of the current node corresponding to the prediction anchor time t of the current prediction instance (denoted as the current power consumption anchor). Then, based on the total power consumption of the current node... Determine the current power consumption bin If the current relevant events provide a plan to switch intensity And the conditional residual table contains The corresponding residual statistic is then read. And the residual statistic Perform a preset amplitude clipping to obtain the conditional residuals of the training set, as shown in the following formula:
[0127]
[0128] Next, based on the current power consumption anchor point The training set conditional residuals and the power consumption correction term for intention-enhanced neurons are used to perform node-level bounded neural correction, as shown in the following formula:
[0129]
[0130]
[0131] in, The intention to enhance neural power consumption correction term is obtained by pooling the fused resource state features and then inputting them into the intention to enhance power consumption neural prediction head or linear projection. To enhance the neural power consumption correction term with bounded intent, The mixing coefficient is a node-level neural correction factor. For the clipping function, . All are correction ranges; The predicted power consumption of the target node at prediction anchor time t and prediction time scale h is the predicted power consumption value obtained by adding the current power consumption anchor point and the training set conditional residual statistics after preset amplitude clipping. In other words, it is the predicted total power consumption value of the node after conditional residual correction and before the node-level bounded neural correction term is superimposed.
[0132] It should be noted that the conditional residual table, current power consumption binning rules or binning boundaries, and related statistics are determined only based on the training set; the current power consumption binning for the current sample... During online inference, the total power consumption of the current node is observable. Binning rules or binning boundaries are determined; node-level neural correction mixing coefficients are predetermined before online inference, and in one implementation, they can be selected based on the validation set after network training. This invention enables the power consumption basis term to be primarily provided by strictly observable current power consumption and low-variance training statistics, with neural branches providing fine-grained corrections to scheduling state transitions only within a limited amplitude.
[0133] When there is no valid event information or corresponding conditional residual statistics available for conditional residual query, the corresponding intention-enhanced power output item is marked as unavailable. The basic output and final output are determined by the event window, output availability and safety fallback rules described later. The historical baseline power consumption is still generated independently by the historical baseline prediction path.
[0134] Step 5: After the first and second resource prediction results have been generated or the output availability judgment has been completed, determine the basic output according to the event window corresponding to the effective planned event, and perform a safe rollback based on the path prediction difference between the outputs of the two prediction paths to generate the final resource prediction result of the target edge accelerator node.
[0135] One feasible implementation method is, for example Figure 5 As shown, step 5 includes:
[0136] A set of effective planned events is constructed based on the scheduling plan, target edge accelerator nodes, and prediction anchor point times. If the set of effective planned events is empty, the first resource prediction result is used as the basic output. If the set of effective planned events is not empty, the effective planned event with the smallest time distance from the prediction anchor point is selected as the current relevant event, and the prediction anchor point is determined to be within a preset event window based on the time distance between the prediction anchor point time and the planned effective time of the current relevant event. For each target resource state and prediction time scale to be predicted, if it is within the event window and the corresponding second resource prediction result is available, the second resource prediction result is used as the basic output; if it is outside the event window or the second resource prediction result is unavailable, the first resource prediction result is used as the basic output. When the prediction results corresponding to the two prediction paths (i.e., the first resource prediction result and the second resource prediction result) are both available, the path prediction difference is calculated based on the corresponding outputs under one or more common available prediction time scales for the same target resource state. When the path prediction difference exceeds a predetermined safety backoff threshold, the first resource prediction result is used; otherwise, the basic output is used. If the prediction result for only one prediction path is available, the available output item is used; if the corresponding output items for both prediction paths are unavailable, the preset protection output is executed.
[0137] Specifically as follows:
[0138] In generating prediction anchor points, this embodiment constructs a corresponding event window based on all observable planned events at the current time node. The current prediction anchor point... A set of valid planning events is constructed from observable and valid scheduling plan records related to the target node and their effective times. Each planned event Inherit the effective time of the corresponding valid scheduling plan record And the structured task intent field that is observable at the current prediction anchor point. This invention constructs an event window indication function for prediction anchor point time t. This is used to determine whether the current prediction anchor point is within the preset event window of a valid planned event; it is set to 1 if it is within the event window, and 0 otherwise. The formula is as follows:
[0139]
[0140] in, This is an indicator function; it takes the value 1 if the condition within the parentheses is true, and 0 otherwise. The width of the event window.
[0141] For valid scheduling plan records that are read by the prediction system after the plan takes effect, they can be used as post-event window records from the time they become observable; if the plan switching intensity is already observable, they can also be used as conditional residual query conditions.
[0142] When the effective planned event set When the event is not empty, the event with the smallest time distance from the prediction anchor point is selected as the current planned event. It is used for window judgment and power consumption residual query for event conditions; if multiple events have the same minimum time interval, one of the events is selected according to a preset deterministic order, such as determining it according to the plan priority, the plan observable time and the plan identifier in turn.
[0143] The path difference comparison uses two paths to predict the same target and the same prediction time scale. For the total power consumption of a node, the power consumption candidate output of the intentionally enhanced path is compared after combining the current power consumption anchor point, training set conditional residuals, and bounded neural corrections; the historical benchmark path is compared with its independently generated complete power consumption prediction value.
[0144] Under normal circumstances where the second prediction result is available, the base output It can be represented as:
[0145]
[0146] in, This is the result of the second resource prediction; This is the prediction result for the first resource.
[0147] It should be noted that the prediction target In the prediction time scale The prediction result is called available if it has been actually generated, is not missing, has a finite value, and is within the pre-determined physical validity range for the prediction target; if any of these conditions are not met, it is called unavailable.
[0148] To avoid directly adding different physical quantities at the same degree of difference, path prediction differences are calculated based on corresponding outputs with the same prediction objective and the same prediction time scale. The prediction objective... In the prediction time scale The scale-wise path difference is denoted as The calculation formula is as follows:
[0149]
[0150]
[0151] in, This is an absolute value operation, which takes the absolute value of the difference between the prediction results of two prediction paths under the same prediction target and the same prediction time scale, and is used to calculate the path prediction difference by scale. Indicates the target of prediction The aim is to enhance the set of forecast timescales that can be used together with historical baseline forecast paths.
[0152] When predicting timescale set When the data is not empty, the scale-wise differences can be aggregated to obtain the target-level path prediction difference. When predicting a set of timescales If empty, do not calculate. Instead, it directly enters the single-path available or protected output branch. When using target-level path prediction variance aggregation across multiple common available prediction timescales... When using Corresponding safety rollback threshold When using the variability of prediction time scales When using a safe backoff threshold corresponding to the corresponding prediction objective and prediction time scale, The safety backoff threshold is predetermined before online inference; in one implementation, it can be selected by the average error on the validation set, the tail error, or a combination thereof.
[0153] To predict the difference using target-level paths Taking the implementation method as an example, if the corresponding intent enhancement output in the event window is unavailable, the intent enhancement output is not forced, and the output availability processing of this embodiment is applied to output the final prediction result. The formula is as follows:
[0154]
[0155]
[0156] For any prediction target—the prediction timescale output item—if only one path's corresponding output is available, that available output is directly used; if neither path's corresponding output is available, a preset protection output is executed. The protection output can be a finite output based on the most recent valid historical observations or a system preset safety value, and its specific form can be preset according to the system safety strategy.
[0157] In practical applications, the training set, validation set, and test set are preferably divided according to the complete running batch and time sequence, so that the same running batch belongs to only one set, avoiding data leakage caused by adjacent time slices crossing sets. The training set is used for network parameter optimization and training statistics estimation, the validation set is used for parameter selection such as early stopping, node-level neural correction of mixing coefficients, event windows, and safe backoff thresholds, and the test set is only used for the final evaluation after freezing all parameters.
[0158] The enhanced prediction path and the historical baseline prediction path can be jointly trained, and the prediction loss at multiple time scales can be calculated separately. Optionally, a consistency regularization loss of the two path outputs can be added; when the consistency regularization loss involves different physical quantities such as power consumption, utilization, and latency, it can be calculated in the normalized output space used for model training, or calculated separately for each prediction target and then weighted and combined. The scale information used is determined only by the training data.
[0159] For prediction targets with missing true labels, the label validity mask is used only during loss calculation, and the true label validity is not used as input for online inference. The output consistency regularization and its specific standardization method are optional training configurations and do not constitute a limitation on the core technical solution of this invention.
[0160] The planned lead time mapping parameters can be obtained during the model training phase or the independent parameter determination phase, and fixed before testing and online inference; the specific parameter determination method can be selected according to the model implementation configuration. The conditional residual table and the current power consumption binning rules or binning boundaries belong to the training statistics and do not participate in gradient backpropagation; after the network training is completed, the node-level neural correction mixing coefficients, event window width, and safe backoff threshold can be selected using the validation set.
[0161] It should be noted that the specific optimizer, batch size, number of training epochs, number of early stopping patience epochs, etc. are standard training configurations and can be adjusted according to the model size and computing equipment.
[0162] In a set of validation experiments, the dataset included three heterogeneous nodes, 27 sets of production data, approximately 108 hours of power consumption data collection, and 77,162 prediction samples. The historical resource window was 60 seconds, and the prediction timescales included 5 seconds, 10 seconds, and 20 seconds. 18 sets of production data were used for training, 4 sets for validation, and 5 sets for testing, and each batch of production data belonged to only one of the training, validation, or testing sets.
[0163] Under a fair comparison protocol that matches the power correction strength, in a 20-second prediction timescale, the mean absolute error corresponding to the total power consumption of the event window nodes of the calibrated original TimeXer comparison method is approximately 3.6248 watts, while that of the method of this invention is approximately 2.1042 watts; the absolute error of the event window power consumption P90 (i.e., the 90th percentile of the absolute error distribution) is reduced from approximately 7.6496 watts to approximately 4.2700 watts; and the absolute error of the power consumption CVaR95 of all valid test samples (i.e., the mean absolute error of the tail samples in the absolute error distribution that exceed the 95th percentile threshold, used to characterize the high error tail risk) is reduced from approximately 5.8954 watts to approximately 5.3735 watts.
[0164] Independent ablation experiments further showed that after removing the planned lead time timing constraint mask, the mean absolute error of event window power consumption increased from approximately 2.1698 watts to approximately 2.5927 watts; after removing the event window gating, the event window power consumption P90 increased from approximately 4.3965 watts to approximately 8.6300 watts.
[0165] like Figure 2 As shown, the heterogeneous edge resource prediction system based on scheduling task intent proposed in this invention includes:
[0166] The data acquisition unit is used to acquire historical resource monitoring sequences of edge accelerator nodes and to acquire scheduling plans.
[0167] The first token generation unit is used to generate a historical resource token sequence based on the historical resource monitoring sequence of the edge accelerator node.
[0168] The second token generation unit is used to generate a sequence of task intent tokens based on the obtained scheduling plan;
[0169] The historical benchmark prediction unit is used to generate a historical resource status feature sequence based on the historical resource token sequence, and then generate the first resource prediction result.
[0170] The mask generation unit is used to generate a timing constraint mask based on the historical resource token sequence and the task intent token sequence by combining the temporal semantic information of the scheduling plan.
[0171] The intent enhancement prediction unit is used to obtain resource-intent interaction features by performing gated cross-attention processing on the temporal constraint mask, historical resource state feature sequence and task intent token sequence, and then generate a second resource prediction result.
[0172] The resource status output unit is used to generate the final resource prediction result based on the first resource prediction result and the second resource prediction result.
Claims
1. A method for predicting heterogeneous edge resources based on scheduling task intent, characterized in that, Includes the following steps: Step 1: Obtain the historical resource monitoring sequence of the edge accelerator node and generate the historical resource token sequence, and obtain the scheduling plan and generate the task intent token sequence; Step 2: Generate a historical resource status feature sequence based on the historical resource token sequence, and then generate the first resource prediction result; Step 3: Combine the temporal semantic information of the scheduling plan to generate a temporal constraint mask based on the historical resource token sequence and task intent token sequence; Step 4: Based on the temporal constraint mask, historical resource state feature sequence, and task intent token sequence, gated cross-attention processing is performed to obtain resource-intent interaction features, thereby generating the second resource prediction result; Step 5: Generate the final resource prediction result based on the first resource prediction result and the second resource prediction result.
2. The heterogeneous edge resource prediction method based on scheduling task intent according to claim 1, characterized in that, In step 2, generating a historical resource status feature sequence based on the historical resource token sequence includes: Input the historical resource token sequence into the historical resource self-attention encoding module, and the module outputs the historical resource state feature sequence.
3. The heterogeneous edge resource prediction method based on scheduling task intent according to claim 1, characterized in that, Step 3 includes: The plan lead time is determined based on the observable time and effective time of the scheduling plan to which the task intent token belongs. The plan lead time is then mapped to obtain the allowable time span. Based on the allowable time span, the mask information of the i-th historical resource token and the j-th task intent is generated according to the time position of the i-th historical resource token in the historical resource token sequence and the effective time of the plan to which the j-th task intent belongs in the task intent token sequence. The timing constraint mask is generated from all the mask information.
4. The heterogeneous edge resource prediction method based on scheduling task intent according to claim 1, characterized in that, In step 4, after performing gated cross-attention processing based on the temporal constraint mask, historical resource state feature sequence, and task intent token sequence, resource-intent interaction features are obtained, including: For single-head gated cross-attention, firstly, a task intent field gating matrix is generated based on the historical resource state feature sequence, task intent token sequence, task intent field type, and the relative temporal relationship between historical resource tokens and task intent tokens. Next, a query matrix is constructed based on the historical resource state feature sequence, and a key matrix and value matrix are constructed based on the task intent token sequence. Combined with a temporal constraint mask, basic attention weights are generated. Then, gated attention weights are generated based on the basic attention weights and the task intent field gating matrix. Finally, resource-intent interaction features are generated based on the gated attention weights and the value matrix.
5. The heterogeneous edge resource prediction method based on scheduling task intent according to claim 1, characterized in that, In step 4, the second resource prediction result is generated, including: Determine the target resource state to be predicted; when the target resource state to be predicted includes accelerator utilization or target server end-to-end latency, input the final resource-intent interaction features into the corresponding prediction head to generate the corresponding prediction result; when the target resource state to be predicted includes the total power consumption of the node, generate an intent-enhanced neural power consumption correction term based on the final resource-intent interaction features, and then combine the current power consumption anchor point and training set conditional residuals to generate the predicted value of the total power consumption of the node in the second resource prediction result.
6. The heterogeneous edge resource prediction method based on scheduling task intent according to claim 5, characterized in that, The target resource status to be predicted includes one or more of the following: the total power consumption of the target edge accelerator node at the prediction time scale, the accelerator utilization, and the end-to-end latency of the target server deployed on the target edge accelerator node.
7. A heterogeneous edge resource prediction system based on scheduling task intent, characterized in that, include: The data acquisition unit is used to acquire historical resource monitoring sequences of edge accelerator nodes and to acquire scheduling plans. The first token generation unit is used to generate a historical resource token sequence based on the historical resource monitoring sequence of the edge accelerator node. The second token generation unit is used to generate a sequence of task intent tokens based on the obtained scheduling plan; The historical benchmark prediction unit is used to generate a historical resource status feature sequence based on the historical resource token sequence, and then generate the first resource prediction result. The mask generation unit is used to generate a timing constraint mask based on the historical resource token sequence and the task intent token sequence by combining the temporal semantic information of the scheduling plan. The intent enhancement prediction unit is used to obtain resource-intent interaction features by performing gated cross-attention processing on the temporal constraint mask, historical resource state feature sequence and task intent token sequence, and then generate a second resource prediction result. The resource status output unit is used to generate the final resource prediction result based on the first resource prediction result and the second resource prediction result.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the heterogeneous edge resource prediction method based on scheduling task intent as described in any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the heterogeneous edge resource prediction method based on scheduling task intent as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the steps of the heterogeneous edge resource prediction method based on scheduling task intent as described in any one of claims 1 to 6.
