Task allocation method and device, electronic equipment, storage medium and program product
By using the processing capability prediction model on the computing nodes, dynamically adjusting task allocation is solved, and the problem of the inability to dynamically adjust task allocation according to the actual situation of the computing nodes in the existing technology is solved, and accurate computing power balance between computing nodes and task processing requirements in complex scenarios are realized.
Patent Information
- Application Number
- CN202510327363.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-07-01
AI Technical Summary
The prior art cannot dynamically adjust task allocation according to the actual task processing situation and processing capacity changes of computing nodes, resulting in the inability to achieve accurate computing power balance between nodes and cannot meet the task processing needs in complex and changing scenarios.
The historical time series is determined based on the historical hardware resource data and historical processing capability data of the computing node, and input it into the pre-trained processing capability prediction model, and obtain the prediction processing capability data, and dynamically adjust the task allocation based on this data. The processing capability prediction model includes a first prediction layer for estimating the theoretical processing capability corresponding to the hardware resource configuration, and a second prediction layer for predicting future processing capabilities.
It realizes dynamic perception and accurate prediction of the processing capabilities of the computing nodes, and makes task allocation adjustments in advance, avoids task allocation errors caused by single indicator considerations, and realizes accurate computing power balance between computing nodes, meeting the task processing needs in complex and changeable scenarios.
Smart Images

Figure CN120234145A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and particularly to a task allocation method, device, electronic device, storage medium and program product. Background Art
[0002] In the network field with multiple computing nodes, such as the Real-time Network (RTN) and other fields, achieving a reasonable allocation of tasks between two or more nodes is the key to achieving computing power balance and efficiently completing tasks.
[0003] Currently, there are mainly two solutions for achieving reasonable task allocation: one is to preset a fixed priority order of computing nodes and allocate tasks to the computing nodes according to the established priority; the other is to statistically calculate the average number of processed tasks of the computing nodes in the past period of time, and then allocate tasks to the computing nodes.
[0004] However, in a network environment with strong real-time performance such as the RTN network, the first solution cannot dynamically adjust task allocation according to the actual task processing situation changes of the computing nodes, and the second solution cannot dynamically adjust task allocation according to the actual processing capacity changes of the computing nodes, and cannot achieve precise computing power balance between nodes, and cannot meet the task processing requirements in complex and changeable scenarios such as the RTN network. Summary of the Invention
[0005] The present invention provides a task allocation method, device, electronic device, storage medium and program product, which are used to solve the defect in the prior art that task allocation cannot be dynamically adjusted according to the actual task processing situation changes and real-time processing capacity changes of computing nodes, and to achieve a task allocation scheme that can accurately sense the dynamic change trend of the processing capacity of each computing node and make adjustments in advance.
[0006] The present invention provides a task allocation method, including: Determining a historical time series based on the historical hardware resource data and historical processing capacity data of a computing node; Inputting the historical time series into a pre-trained processing capacity prediction model to obtain predicted processing capacity data output by the processing capacity prediction model; Based on the predicted processing capacity data, allocating a task to be processed to the computing node; The processing capacity prediction model includes a first prediction layer and a second prediction layer; the input of the first prediction layer includes the historical hardware resource data in the historical time series, and the output includes the estimated processing capacity data corresponding to the historical hardware resource data; the input of the second prediction layer includes the historical processing capacity data and the estimated processing capacity data in the historical time series, and the output is the predicted processing capacity data.
[0007] According to a task allocation method provided by the present invention, the input of the second prediction layer includes the historical time series and the estimated processing capacity data.
[0008] According to a task allocation method provided by the present invention, the historical hardware resource data includes at least one of the historical processor utilization rate, historical memory occupancy rate, and historical network bandwidth occupancy rate of the computing node; The historical processing capacity data includes the historical processing speed of the computing node.
[0009] According to a task allocation method provided by the present invention, the computing node includes a first computing node and a second computing node; allocating the task to be processed to the computing node based on the predicted processing capacity data includes: Determining a node processing capacity ratio based on the predicted processing capacity data of the first computing node and the predicted processing capacity data of the second computing node; Allocating the task to be processed to the first computing node and the second computing node based on the node processing capacity ratio.
[0010] According to a task allocation method provided by the present invention, after allocating the task to be processed to the computing node based on the predicted processing capacity data, it further includes: If a first abnormal situation, a second abnormal situation, or a third abnormal situation occurs, then adjusting and allocating some or all of the unprocessed tasks that are allocated to the first computing node and have not been processed by the first computing node to the second computing node; The first abnormal situation is that the deviation between the actual processing capacity and the predicted capacity of the first computing node for processing the task to be processed is greater than a preset deviation; the predicted capacity is determined based on the predicted processing capacity data of the first computing node; The second abnormal situation is that the second computing node has completed processing the task to be processed allocated to the second computing node, and the number of unprocessed tasks of the first computing node is greater than a preset number; The third abnormal situation is that the real-time transmission delay of the first computing node is greater than or equal to a preset delay threshold.
[0011] According to a task allocation method provided by the present invention, determining the historical time series based on the historical hardware resource data and historical processing capacity data of the computing node includes: Collecting the original node data of the computing node; Replacing the abnormal data in the original node data with normal data to obtain the historical hardware resource data and the historical processing capacity data; The abnormal data is the original node data whose absolute difference from adjacent data is greater than a preset threshold; the absolute difference is the absolute value of the difference between the abnormal data and the mean of the adjacent data.
[0012] The present invention also provides a task allocation device, including: A sequence construction module, configured to determine a historical time series based on historical hardware resource data and historical processing capacity data of a computing node; A capacity prediction module, configured to input the historical time series into a pre-trained processing capacity prediction model to obtain predicted processing capacity data output by the processing capacity prediction model; An allocation module, configured to allocate a task to be processed to the computing node based on the predicted processing capacity data; The processing capacity prediction model includes a first prediction layer and a second prediction layer; the input of the first prediction layer includes the historical hardware resource data in the historical time series, and the output includes the estimated processing capacity data corresponding to the historical hardware resource data; the input of the second prediction layer includes the historical processing capacity data and the estimated processing capacity data in the historical time series, and the output is the predicted processing capacity data.
[0013] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and running on the processor. When the processor executes the computer program, the task allocation method as described in any one of the above is implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the task allocation method as described in any one of the above is implemented.
[0015] The present invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, the task allocation method as described in any one of the above is implemented.
[0016] The task allocation method, device, electronic device, storage medium, and program product provided by the present invention, by setting the processing capacity prediction model of the computing node to include a first prediction layer for estimating the theoretical processing capacity corresponding to the hardware resource configuration, can timely determine the potential impact of the fluctuation of the hardware resource status of the computing node on the processing capacity based on the collected historical hardware resource data in the constantly changing network environment and task characteristics; by further setting the processing capacity prediction model of the computing node to include a second prediction layer for estimating the predicted processing capacity of the computing node in the future, and inputting the estimated processing capacity data output by the first prediction layer and the collected historical processing capacity data into the second prediction layer at the same time, and combining the time series prediction ability of the second prediction layer, can further understand the complex relationship between the hardware resources and the processing capacity and the law of change over time, so as to more sensitively and accurately perceive the dynamic change trend of the processing capacity of each computing node during the task execution process, make task allocation adjustments in advance, avoid task allocation mistakes that may be caused by considering a single indicator, achieve precise computing power balance between computing nodes, and meet the task processing requirements in complex and changeable scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0018] Figure 1 It is a flowchart of the task allocation method provided by the present invention.
[0019] Figure 2 It is one of the structural diagrams of the processing capacity prediction model provided by the present invention.
[0020] Figure 3 It is another structural diagram of the processing capacity prediction model provided by the present invention.
[0021] Figure 4 It is a structural diagram of the task allocation device provided by the present invention.
[0022] Figure 5 It is a structural diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0023] To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.
[0024] It should be noted that in the description of the present invention, the terms "comprise", "include", or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or device that includes a series of elements includes not only those elements but also other elements not expressly listed, or elements that are inherent to such process, method, article, or device. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0025] The terms "first", "second", etc. in the present invention are used to distinguish similar objects and are not used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same category, and the number of objects is not limited. For example, the first object can be one or more.
[0026] The following is combined with Figures 1 - 5 Describe the task allocation method, device, electronic device, storage medium, and program product provided by the present invention.
[0027] In fields such as real-time audio and video transmission networks (RTN), it often involves how to balance the computing power between two or more nodes to achieve a reasonable allocation of processing tasks such as real-time audio and video transmission tasks.
[0028] One solution for reasonable allocation of processing tasks is to preset a fixed priority order for computing nodes, and allocate tasks in sequence according to the established priorities of each computing node until the computing nodes reach processing saturation. Although this solution has a certain degree of regularity, it lacks flexibility and adaptability. For example, in the RTN network environment, the resource status of computing nodes changes constantly. The static solution of presetting priorities cannot dynamically adjust the task allocation strategy according to the actual situation. Once there is a situation where high-priority nodes are overloaded while low-priority nodes have idle resources, it is very easy to cause waste of overall system resources and low task processing efficiency. Moreover, this solution does not consider the interference of information feedback delay between computing nodes, which may exist in the RTN network environment, on the accuracy and timeliness of task allocation. When a computing node experiences a delay, it may cause the task allocation error to intensify, further damaging the stability and efficiency of the system.
[0029] Another solution for reasonable allocation of processing tasks is a task allocation strategy based on the historical average processing capacity of computing nodes. By statistically calculating the average number of processing tasks of a computing node over a past period of time, new tasks are allocated based on this. However, this method responds slowly to changes in the node's processing capacity and cannot promptly capture fluctuations in the processing capacity caused by factors such as hardware upgrades, network environment optimization, or sudden failures of the node. In an RTN network environment, for example, where real-time requirements are extremely high and task characteristics and node states may change at any time, the method based on historical averages is difficult to quickly respond and adjust task allocation, unable to achieve precise computing power balance, and difficult to meet the task processing requirements in the complex and changeable scenarios of the RTN network.
[0030] In view of this, the present invention provides a task allocation method, device, electronic device, storage medium, and program product to solve at least one of the foregoing problems.
[0031] Figure 1 It is a schematic flowchart of the task allocation method provided by the present invention. As Figure 1 shown, the task allocation method includes but is not limited to steps 101 to 103.
[0032] It should be noted that the execution subject of the task allocation method provided by the present invention is the corresponding task allocation device, which may specifically be a server, computer device, such as a mobile phone, tablet computer, laptop computer, handheld computer, in-vehicle electronic device, wearable device, Ultra-Mobile Personal Computer (UMPC), netbook, or Personal Digital Assistant (PDA), etc.
[0033] Step 101: Determine a historical time series based on the historical hardware resource data and historical processing capacity data of the computing nodes.
[0034] A historical time series is a time series composed of historical hardware resource data and historical processing capacity data of computing nodes within a certain historical period.
[0035] For example, the historical period is 0 - 50 seconds, 51 - 100 seconds, etc. from the current time.
[0036] Among them, the historical hardware resource data includes but is not limited to at least one of the hardware resource data such as the historical processor utilization rate, historical memory occupancy rate, and historical network bandwidth occupancy rate of the computing node within a certain historical period; the historical processing capacity data includes but is not limited to the historical processing speed of the computing node within a certain historical period.
[0037] It should be noted that the historical processor utilization rate can be any one of the utilization rates of processors such as the Central Processing Unit (CPU) and Neural Processing Unit (NPU) of the computing node within a certain historical period; the historical processing speed of the computing node can be the speed of processing video frames and voice frames (unit: frames per second) of the computing node within a certain historical period, which can be specifically determined according to the actual tasks processed by the computing node, and the present invention does not limit this.
[0038] Specifically, taking the historical hardware resource data including the historical processor utilization rate, historical memory occupancy rate, and historical network bandwidth occupancy rate, and the historical processing capacity data including the historical processing speed of the computing node as an example, data acquisition units are deployed in each computing node in the network. The data acquisition units pre - set the data acquisition period seconds (such as seconds), and at each acquisition moment ( represents the th acquisition moment), collect data such as the processor utilization rate, memory occupancy rate, network bandwidth occupancy rate, and processing speed of each computing node in the network, so as to obtain historical hardware resource data including the historical processor utilization rate , historical memory occupancy rate , and historical network bandwidth occupancy rate , and historical processing capacity data including the historical processing speed .
[0039] Furthermore, after responding to the task allocation request of the computing node, integrate the historical hardware resource data and historical processing capacity data of each computing node, so as to determine the historical time series for predicting the processing capacity of each computing node.
[0040] The task allocation request for the computing node may be generated after the computing node comes online, or when a new task to be processed is generated, or may be generated in response to a user's task allocation input, and the present invention does not impose any limitation on this.
[0041] In the network, the processing power of computing nodes is closely related to hardware resource indicators, but this relationship is complex and nonlinear. Traditional single variable or simple comprehensive indicator analysis is difficult to accurately grasp this complex relationship, which can easily lead to unreasonable task allocation based on the processing power of computing nodes.
[0042] Taking the RTN network system as an example, for each computing node in the network, the processing capacity of the computing node does not only depend on a single factor. Multiple variables such as processor utilization, memory occupancy, and network bandwidth occupancy in the hardware resource information are interrelated and jointly affect the processing speed. For example, when the processor utilization is too high, even if the memory and network bandwidth are relatively abundant, the processing speed may be limited by the processor bottleneck; conversely, if the memory is insufficient and the data exchange is not smooth, it will also have a negative impact on the overall processing efficiency. By incorporating multiple variables such as hardware resources including processor utilization, memory occupancy, and network bandwidth occupancy, as well as processing capacity including processing speed into the consideration scope of the processing capacity prediction model, it is possible to comprehensively and accurately characterize the processing capacity status of each computing node at a future moment or future period, avoiding the misjudgment of the system status due to the one-sidedness of the single variable description, thereby providing a more reliable basis for subsequent task allocation.
[0043] Step 102: Input the historical time series into a pre-trained processing capacity prediction model to obtain predicted processing capacity data output by the processing capacity prediction model.
[0044] Among them, the processing capacity prediction model includes a first prediction layer and a second prediction layer; the input of the first prediction layer includes historical hardware resource data in the historical time series, and the output includes estimated processing capacity data corresponding to the historical hardware resource data; the input of the second prediction layer includes historical processing capacity data and estimated processing capacity data in the historical time series, and the output is predicted processing capacity data.
[0045] The estimated processing capacity data reflects the estimated processing capacity under the hardware resource configuration determined based on the hardware resource data of the computing node; the historical processing capacity data reflects the actual processing capacity under the hardware resource configuration determined based on the hardware resource data of the computing node.
[0046] The first prediction layer is used to estimate the processing capacity of the computing node according to the historical hardware resource data of the computing node, and obtain the estimated processing capacity data corresponding to the historical hardware resource data.
[0047] Optionally, the first prediction layer is constructed based on a deep learning model. For example, the deep learning model is a Multilayer Perceptron (MLP).
[0048] With the powerful non-linear fitting ability of the deep learning model, it can deeply learn the internal relationship between the processor utilization rate, memory occupancy rate, network bandwidth occupancy rate of the computing node and the processing ability of the computing node, so as to more accurately estimate the processing ability that should be possessed under the hardware resource configuration of the computing node, obtain the estimated processing ability data, and further provide more accurate input information for the subsequent second prediction layer to predict the future processing ability of the computing node.
[0049] The second prediction layer is used to predict the processing ability of the computing node at a future moment or in a future time period according to the estimated processing ability data and historical processing ability data of the computing node, and obtain the predicted processing ability data of the computing node at the future moment or in the future time period.
[0050] Optionally, the second prediction layer is constructed based on a Long Short-Term Memory (LSTM) network.
[0051] As a variant of the Recurrent Neural Network (RNN), LSTM aims to solve the long-term dependence problem in traditional RNN models. The core of LSTM lies in its unique memory cell structure, which controls the information transmission and update in the time series through a gating mechanism (forget gate, input gate, output gate).
[0052] Specifically, Figure 2 is one of the schematic diagrams of the structure of the processing ability prediction model provided by the present invention. As Figure 2 shown, the historical time series determined according to the historical hardware resource data and historical processing ability data of any computing node is input into the pre-trained processing ability prediction model. The first prediction layer of the processing ability prediction model processes the historical hardware resource data in the historical time series, and obtains the estimated processing ability data that the computing node should have under the hardware resource configuration corresponding to the historical hardware resource data output by the first prediction layer. Further, the second prediction layer of the processing ability prediction model processes the input estimated processing ability data and the historical processing ability data in the historical time series, fully excavates the relationship between the theoretical processing ability and the actual processing ability under the hardware resource configuration, and obtains the predicted processing ability data of the computing node at a future moment or in a future time period output by the second prediction layer.
[0053] For different computing nodes in the network, the historical time series determined by different computing nodes according to their own historical hardware resource data and historical processing capacity data are respectively input into the processing capacity prediction model, and the predicted processing capacity data of each computing node at a future moment or in a future time period output by the processing capacity prediction model can also be obtained.
[0054] Optionally, the second prediction layer constructed based on the LSTM network includes: (1) 3 hidden layers, so as to avoid the problem that fewer hidden layers may not be able to fully learn the complex features and time series relationships in the data, while too many hidden layers may lead to an increased risk of overfitting and an increase in computational cost; (2) The number of neurons in each of the 3 hidden layers gradually decreases. For example, the first hidden layer is set with 128 neurons, the second hidden layer is set with 64 neurons, and the third hidden layer is set with 32 neurons, which helps the second prediction layer to gradually extract the features in the input data and gradually transition from a more complex feature representation to a more abstract and representative feature; (3) The hidden layer uses the rectified linear activation function (Rectified Linear Unit, ReLU), which has high computational efficiency when processing large-scale data, can effectively alleviate the problem of gradient disappearance, accelerate the model training speed, and can introduce non-linear factors into the model to enhance the model's expression ability for complex data relationships. The number of neurons in the hidden layer is adjusted through experiments. For example, the optimal configuration of the number of neurons is determined according to the performance of the second prediction layer on the validation set (such as loss value, accuracy, etc.).
[0055] It should be noted that the processing capacity prediction model is pre-trained based on multiple time series samples and their corresponding processing capacity labels. Among them, the multiple time series samples are obtained by processing the collected hardware resource data sequence and processing capacity data sequence of the computing node based on the sliding window method.
[0056] The sliding window method is based on the concept of a sliding window, which divides the hardware resource data sequence and the processing capacity data sequence into multiple windows, and each window contains a certain number of consecutive time steps, so as to obtain a data set that can be used for the supervised learning of the processing capacity prediction model.
[0057] For example, based on the sliding window method, the event compensation, acquisition frequency, and data division using a fixed-size window are determined in advance. The expression of the time series sample obtained by processing the hardware resource data sequence and the processing capacity data sequence of the computing node is as follows: ; Among them, is the time series sample obtained based on the hardware resource data sequence and the processing capacity data sequence of the past time points, and it contains a total of data; is the processor utilization rate data collected at the -th past time point; is the memory occupancy rate data collected at the -th past time point; is the network bandwidth occupancy rate data collected at the -th past time point; is the processing speed data collected at the -th past time point; is the processor utilization rate data collected at the -th past time point; is the memory occupancy rate data collected at the -th past time point; is the network bandwidth occupancy rate data collected at the -th past time point; is the processing speed data collected at the -th past time point.
[0058] Accordingly, the expression of the processing capacity label corresponding to the time series sample is as follows: ; where is the processing capacity label corresponding to the time series sample , starting from the -th future time point, and consisting of the processing capacity data of time points; is the processing speed data collected at the -th time point; is the processing speed data collected at the -th time point.
[0059] Based on the foregoing expression, the time series sample and its corresponding processing capacity label are repeatedly obtained, so as to obtain multiple training samples of the pre-trained processing capacity prediction model. After pre-training the processing capacity prediction model using the training samples, the pre-trained processing capacity prediction model can output the predicted processing capacity data of the computing node at a future moment or in a future time period.
[0060] For example, to achieve task allocation under the RTN network, when preprocessing the processing capacity prediction model using multiple training samples, comprehensively consider the dataset size, model complexity, and the requirements of the RTN network for real-time performance and accuracy, and initially assume that the model is trained for 100 - 200 epochs. For a relatively small dataset (e.g., several thousand samples), around 100 epochs may be sufficient to converge the model to a good performance; if the dataset size is large (such as tens of thousands or more samples), then 150 - 200 epochs may be required to fully learn the features and patterns in the data. Of course, the actual number of training epochs is not fixed and needs to be dynamically adjusted according to the monitoring metrics during the training process.
[0061] Furthermore, divide the constructed training samples proportionally. In each round of training, the processing capacity prediction model obtains sample data from the training set according to the set mini-batch size. For example, if the batch size is 32, that is, 32 training samples are taken each time for training, and the processing capacity prediction model performs forward propagation calculations on these 32 training samples in sequence to obtain predicted values. The Mean-Square Error (MSE) is used as the loss function to calculate the loss between the predicted values and the actual values.
[0062] Use an adaptive learning rate algorithm (such as the Adam optimization algorithm), calculate the first-order moment estimate and second-order moment estimate of the gradient, closely monitor the changing trends of the training set loss and the validation set loss, and automatically adjust the learning rate according to the gradient changes of the model parameters, so that the model can converge to a better performance faster.
[0063] In the initial stage of training, as the model continuously learns the data features, the training set loss usually gradually decreases. If the validation set loss also decreases accordingly, it indicates that the model does not overfit during the learning process and has good generalization ability; if the validation set loss starts to increase after a certain round of training while the training set loss is still decreasing, it may indicate that the model begins to overfit. If the validation set loss does not decrease or starts to increase for several consecutive rounds (such as 5 - 10 rounds), stop the training according to the early stopping method to prevent the model from overfitting the validation set data, and select the model parameters at this time as the best model parameters to obtain the pre-trained processing capacity prediction model.
[0064] Step 103: Allocate the tasks to be processed to the computing nodes based on the predicted processing capacity data.
[0065] Specifically, according to the predicted processing capacity data of each computing node at a future moment or future time period output by the processing capacity prediction model, that is, according to the processing capacity of each computing node, allocate the tasks to be processed to each computing node in the network to ultimately achieve the computing power balance among the computing nodes in the network.
[0066] The task allocation method provided by the present invention, by setting the processing capacity prediction model of the computing node to include a first prediction layer for estimating the theoretical processing capacity corresponding to the hardware resource configuration, can timely determine the potential impact of the fluctuation of the hardware resource state of the computing node on the processing capacity based on the collected historical hardware resource data in the constantly changing network environment and task characteristics; by further setting the processing capacity prediction model of the computing node to include a second prediction layer for estimating the predicted processing capacity of the computing node in the future, and inputting the estimated processing capacity data output by the first prediction layer and the collected historical processing capacity data into the second prediction layer simultaneously, and combining the time series prediction ability of the second prediction layer, can further understand the complex relationship between the hardware resources and the processing capacity and the law of change over time, so as to more acutely and accurately perceive the dynamic change trend of the processing capacity of each computing node during the task execution process, make task allocation adjustments in advance, avoid task allocation mistakes that may be caused by considering a single indicator, achieve precise computing power balance between computing nodes, and meet the task processing requirements in complex and changeable scenarios.
[0067] Figure 3 is the second structural schematic diagram of the processing capacity prediction model provided by the present invention, as Figure 3 shown, based on the above embodiment, as an optional embodiment, the input of the second prediction layer includes the historical time series and the estimated processing capacity data.
[0068] Specifically, after inputting the historical time series into the pre-trained processing capacity prediction model, and the first prediction layer of the processing capacity prediction model processes the historical hardware resource data in the historical time series to obtain the estimated processing capacity data, the estimated processing capacity data and the historical time series including the historical hardware resource data and the historical processing capacity data are input into the second prediction layer simultaneously, and the predicted processing capacity data output by the second prediction layer is obtained as the predicted processing capacity data of the computing node at a future moment or in a future time period output by the processing capacity prediction model.
[0069] The task allocation method provided by the present invention, by inputting the complete historical time series including the historical hardware resource data and the historical processing capacity data into the second prediction layer of the processing capacity prediction model, can further explore the complex relationship between the hardware resources and the processing capacity and the law of change over time, so as to more acutely and accurately perceive the dynamic change trend of the processing capacity of each computing node during the task execution process, make task allocation adjustments in advance, and thus achieve precise computing power balance between computing nodes and meet the task processing requirements in complex and changeable scenarios.
[0070] Based on the above embodiment, as an optional embodiment, the computing node includes a first computing node and a second computing node; based on the predicted processing capacity data, allocating the task to be processed to the computing node includes: Determine the node processing capacity ratio based on the prediction processing capacity data of the first computing node and the prediction processing capacity data of the second computing node; Allocate the task to be processed to the first computing node and the second computing node based on the node processing capacity ratio.
[0071] Specifically, when the computing nodes in the network system include a first computing node and a second computing node, the processing capabilities of the first computing node and the second computing node are predicted respectively. That is, on the one hand, determine the historical time series of the first computing node based on the historical hardware resource data and historical processing capacity data of the first computing node, and input the historical time series of the first computing node into the processing capacity prediction model to obtain the predicted processing capacity data of the first computing node as the output. On the other hand, determine the historical time series of the second computing node based on the historical hardware resource data and historical processing capacity data of the second computing node, and input the historical time series of the second computing node into the processing capacity prediction model to obtain the predicted processing capacity data of the second computing node as the output.
[0072] Further, according to the predicted processing capacity data of the first computing node and the predicted processing capacity data of the second computing node, determine the node processing capacity ratio between the first computing node and the second computing node. Allocate the unallocated task to be processed to the first computing node and the second computing node according to the obtained node processing capacity ratio between the first computing node and the second computing node.
[0073] In one embodiment, if the predicted processing capacity data of both the first computing node and the second computing node are the predicted data at the future time L, the node processing capacity ratio between the first computing node and the second computing node at the future time L can be directly determined according to the ratio between the predicted processing capacity data of the first computing node and the predicted processing capacity data of the second computing node.
[0074] In another embodiment, if the predicted processing capacity data of both the first computing node and the second computing node are the predicted data in the future time period L1~L3, obtain the first average value according to the average value of the predicted processing capacity data of the first computing node in the future time period L1~L3, and obtain the second average value according to the average value of the predicted processing capacity data of the second computing node in the future time period L1~L3. Determine the node processing capacity ratio between the first computing node and the second computing node in the future time period L1~L3 according to the ratio between the first average value and the second average value.
[0075] At this time, the expressions of the average values determined by the predicted processing capacity data of the first computing node and the second node in the future time period L1~L3 are as follows: ; ; Wherein, is the first average value of the first computing node; is the predicted processing capacity data of the first computing node at time L1 in the future time periods L1 to L3; is the predicted processing capacity data of the first computing node at time L2 in the future time periods L1 to L3; is the predicted processing capacity data of the first computing node at time L3 in the future time periods L1 to L3; is the second average value of the second computing node; is the predicted processing capacity data of the second computing node at time L1 in the future time periods L1 to L3; is the predicted processing capacity data of the second computing node at time L2 in the future time periods L1 to L3; is the predicted processing capacity data of the second computing node at time L3 in the future time periods L1 to L3.
[0076] Based on the average value of the predicted processing capacity data of the first computing node and the second node, the node processing capacity ratio between the first computing node and the second node, that is, .
[0077] Furthermore, the calculation formula for the task volume of the task to be processed assigned to the first computing node is as follows: ; Wherein, is the task volume of the task to be processed assigned to the first computing node; is the total task volume of the task to be processed.
[0078] Correspondingly, the task volume of the task to be processed assigned to the first computing node .
[0079] For example, if there is a real-time audio and video processing task set currently, and the total task volume of the task to be processed includes 1000 video frames, the predicted processing capacity data of computing node A predicted by the processing capacity prediction model is 20 frames per second, and the predicted processing capacity data of computing node B is 30 frames per second. It can be determined that the task volume assigned to computing node A is 400 frames, and the task volume assigned to computing node B is 600 frames.
[0080] The task allocation method provided by the present invention can determine the node processing capacity ratio according to the predicted processing capacities between different computing nodes, and allocate the tasks to be processed to different computing nodes correspondingly according to the node processing capacity ratio. It can determine the allocation ratio of tasks based on the predicted processing capacity data of two or more computing nodes, achieve balanced computing power between nodes, and make the amount of tasks allocated to the computing nodes match their processing capabilities.
[0081] Based on the above embodiments, as an alternative embodiment, after allocating the tasks to be processed to the computing nodes based on the predicted processing capacity data, it further includes: If a first abnormal situation, a second abnormal situation or a third abnormal situation occurs, then allocate part or all of the unprocessed tasks that are allocated to the first computing node and have not been processed by the first computing node to the second computing node; The first abnormal situation is that the deviation between the actual capacity and the predicted capacity of the first computing node for processing the tasks to be processed is greater than a preset deviation; the predicted capacity is determined based on the predicted processing capacity data of the first computing node; The second abnormal situation is that the second computing node has completed processing the tasks to be processed allocated to the second computing node, and the number of the unprocessed tasks of the first computing node is greater than a preset number; The third abnormal situation is that the real-time transmission delay of the first computing node is greater than or equal to a preset delay threshold.
[0082] Specifically, after allocating the tasks to be processed to each computing node in the network system based on the predicted processing capacity data, the server side will regularly (such as every 1 second) obtain the real-time data of the hardware resources and processing capabilities collected by the data collection unit on each computing node, and judge whether the first computing node has abnormal situations such as a large deviation in processing capacity, an unbalanced task processing progress, or a large feedback delay based on the real-time data. When an abnormal situation occurs, the server side or the second computing node will allocate part or all of the unprocessed tasks that are allocated to the first computing node and have not been processed by the first computing node to the second computing node.
[0083] When an abnormal situation with a large deviation in processing capacity occurs, that is, when the first abnormal situation occurs, it means that after allocating the tasks to be processed, the deviation between the predicted processing capacity data of the first computing node predicted again by the server side based on the real-time data and the actual capacity for processing the tasks to be processed determined based on the real-time data is greater than a preset deviation (such as the deviation exceeds 10%). This indicates that the allocation of the tasks to be processed may have a large error due to reasons such as sudden hardware failures or temporary network fluctuations, and it needs to be adjusted in time. Allocate part or all of the unprocessed tasks that are allocated to the first computing node and have not been processed by the first computing node to the second computing node.
[0084] For example, if the actual processing speed of the first computing node A is more than 10% lower than the predicted value and the second computing node B still has remaining processing capacity, then the second computing node B can take back some of the tasks allocated to the first computing node A or reduce the amount of tasks allocated to the first computing node A in the future to ensure that the overall task processing progress is not affected too much.
[0085] In the abnormal situation of unbalanced task processing progress, that is, when the second abnormal situation occurs, the second computing node has completed the processing of the pending tasks allocated to the second computing node and is in an idle state, but the number of unprocessed tasks of the first computing node is greater than the preset number, that is, in a task backlog state. This may be because there is a problem with the adaptation of the task characteristics and the actual processing capacity at both ends of the first computing node and the second computing node, and it is necessary to re-evaluate and adjust in time. Part or all of the unprocessed tasks that the first computing node has not processed are adjusted and allocated to the second computing node to make the task processing progress of the first computing node and the second computing node tend to be balanced and improve the overall task processing efficiency.
[0086] In the abnormal situation of computing node feedback delay, that is, when the third abnormal situation occurs, the real-time transmission delay of the first computing node is greater than or equal to the preset delay threshold (such as 3 seconds), indicating that the task allocation cannot rely on the predicted processing capacity data of the first computing node by the processing capacity prediction model, and timely adjustment is required.
[0087] Optionally, when the third abnormal situation occurs, based on the historical processing capacity average value or historical change trend of the first computing node in a similar delay situation, the task allocation strategy is temporarily adjusted, and part or all of the unprocessed tasks that the first computing node has not processed are adjusted and allocated to the second computing node.
[0088] For example, if the historical processing capacity average value of the first computing node will decrease by 20% in a similar delay situation, more unprocessed tasks of the first computing node can be adjusted and allocated to the second computing node to avoid unreasonable task allocation and overall processing efficiency decline caused by the delay of the first computing node.
[0089] Optionally, after allocating the task to be processed to the computing node based on the predicted processing capability data, the following steps are further included: The server will regularly obtain the real-time data of the hardware resources and processing capabilities collected by the data collection units on each computing node. If a hardware anomaly (such as overheating CPU, memory failure, etc.) or network anomaly (such as network termination, high latency, etc.) of a computing node is detected in real time, the task being processed will be suspended and the server will be notified as soon as possible. After receiving the notification sent by the computing node with hardware anomaly or network anomaly, the server will, according to the current overall system state and the situation of other available resources, re-allocate the tasks to be processed of the computing node with hardware anomaly or network anomaly to other computing nodes without hardware anomaly or network anomaly.
[0090] Optionally, the server will record the anomaly situations that occur in the computing nodes for subsequent system analysis and optimization, so as to better handle similar anomaly situations and improve the stability and reliability of the system.
[0091] The task allocation method provided by the present invention, after allocating the tasks to be processed to each computing node according to the processing capabilities of each computing node obtained by prediction, determines whether there are anomaly situations such as large deviation in processing capabilities, unbalanced task processing progress, or excessive feedback delay according to the actual capabilities of the computing nodes in processing tasks. And in the case of these anomaly situations, the unprocessed tasks of the tasks to be processed that have been allocated to the computing nodes are adjusted and allocated, so as to avoid unreasonable task allocation and the possible resulting decrease in the overall task processing efficiency, and achieve dynamic balance among the computing nodes.
[0092] Based on the above embodiments, as an optional embodiment, the determining of the historical time series based on the historical hardware resource data and historical processing capability data of the computing node includes: Collect the original node data of the computing node; Replace the anomaly data in the original node data with normal data to obtain the historical hardware resource data and the historical processing capability data; The anomaly data is the original node data whose absolute difference from the adjacent data is greater than a preset threshold; the absolute difference is the absolute value of the difference between the anomaly data and the mean of the adjacent data.
[0093] The original node data includes original hardware resource data such as original processor utilization rate, original memory occupancy rate, and original network bandwidth occupancy rate, and also includes original processing capability data such as original processing speed.
[0094] When determining the historical time series using the historical hardware resource data and historical processing capability data of the computing node, it is necessary to clean the data to remove the obviously incorrect anomaly data.
[0095] Specifically, after collecting the foregoing multiple types of raw node data of the computing node, for each collection moment in each type of raw node data the collected raw node data , calculate the mean value according to the raw node data and several adjacent data collected at several adjacent collection moments If the mean value and the raw node data The absolute value of the difference between them, that is, the mean value and the raw node data The absolute difference between them is greater than the preset threshold, then the raw node data is abnormal data. Replace the abnormal data in each type of raw node data with normal data through methods such as mean value replacement and linear interpolation correction to obtain historical hardware resource data and historical processing capacity data, and determine the historical time series based on the historical hardware resource data and historical processing capacity data after clearing the abnormal data, so as to improve the accuracy of predicting the processing capacity of the computing node using the historical time series determined by the historical hardware resource data and historical processing capacity data.
[0096] Optionally, the abnormal data also includes raw node data with a negative value, and also includes raw node data with a value exceeding the maximum reasonable range.
[0097] The task allocation method provided by the present invention replaces the abnormal data in the raw node data with normal data when determining the historical time series using the historical hardware resource data and historical processing capacity data, improves the data quality, and can improve the accuracy of predicting the processing capacity of the computing node using the historical time series.
[0098] Optionally, in order to make the historical hardware resource data and historical processing capacity data between each computing node comparable and facilitate model training, the historical hardware resource data and historical processing capacity data are also normalized so that the data ranges of the historical hardware resource data and historical processing capacity data after normalization are both between 0 and 1.
[0099] For example, taking the historical processing capacity data as the historical processing speed, the calculation formula for normalizing the historical processing speed is as follows: ; where is the data obtained by normalizing the historical processing speed at the collection moment ; is the historical maximum processing speed of the computing node; is the historical maximum processing speed of the computing node.
[0100] It should be noted that the normalization methods for historical hardware resource data and historical processing capacity data are the same, and the present invention will not elaborate on this.
[0101] Figure 4 It is a schematic structural diagram of a task allocation device provided by the present invention. As Figure 4 shown, the task allocation device includes, but is not limited to, a sequence construction module 401, a capacity prediction module 402, and an allocation module 403.
[0102] The sequence construction module 401 is configured to determine a historical time series based on historical hardware resource data and historical processing capacity data of a computing node.
[0103] The capacity prediction module 402 is configured to input the historical time series into a pre-trained processing capacity prediction model to obtain predicted processing capacity data output by the processing capacity prediction model.
[0104] The allocation module 403 is configured to allocate a task to be processed to the computing node based on the predicted processing capacity data.
[0105] Among them, the processing capacity prediction model includes a first prediction layer and a second prediction layer; the input of the first prediction layer includes the historical hardware resource data in the historical time series, and the output includes the estimated processing capacity data corresponding to the historical hardware resource data; the input of the second prediction layer includes the historical processing capacity data and the estimated processing capacity data in the historical time series, and the output is the predicted processing capacity data.
[0106] It should be noted that the task allocation device provided by the present invention can execute the task allocation method described in any of the above embodiments during specific operation, and this embodiment will not elaborate on this.
[0107] The task allocation device provided by the present invention, by setting that the processing capacity prediction model of the computing node includes a first prediction layer for estimating the theoretical processing capacity corresponding to the hardware resource configuration, can timely determine the potential impact of the fluctuation of the hardware resource state of the computing node on the processing capacity based on the collected historical hardware resource data in a changing network environment and task characteristics; by further setting that the processing capacity prediction model of the computing node includes a second prediction layer for estimating the predicted processing capacity of the computing node in the future, and inputting the estimated processing capacity data output by the first prediction layer and the collected historical processing capacity data into the second prediction layer at the same time, and combining the time series prediction ability of the second prediction layer, can further understand the complex relationship between the hardware resources and the processing capacity and the law of change over time, so as to more acutely and accurately perceive the dynamic change trend of the processing capacity of each computing node during the task execution process, make task allocation adjustments in advance, avoid task allocation mistakes that may be caused by considering a single indicator, achieve precise computing power balance between computing nodes, and meet the task processing requirements in complex and changeable scenarios.
[0108] Figure 5 is a schematic structural diagram of the electronic device provided by the present invention, as Figure 5 shown, the electronic device may include: a processor (Processor) 510, a communication interface (Communications Interface) 520, a memory (Memory) 530, and a communication bus 540. Among them, the processor 510, the communication interface 520, and the memory 530 communicate with each other through the communication bus 540. The processor 510 can call the logical instructions in the memory 530 to execute the task allocation method provided by any of the above embodiments. The task allocation method includes but is not limited to the following steps: determining a historical time series based on the historical hardware resource data and historical processing capacity data of the computing node; inputting the historical time series into a pre-trained processing capacity prediction model to obtain predicted processing capacity data output by the processing capacity prediction model; based on the predicted processing capacity data, allocating a task to be processed to the computing node; the processing capacity prediction model includes a first prediction layer and a second prediction layer; the input of the first prediction layer includes the historical hardware resource data in the historical time series, and the output includes the estimated processing capacity data corresponding to the historical hardware resource data; the input of the second prediction layer includes the historical processing capacity data and the estimated processing capacity data in the historical time series, and the output is the predicted processing capacity data.
[0109] In addition, when the logical instructions in the above-mentioned memory 530 can be implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs.
[0110] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the task allocation method provided in any of the above embodiments. The task allocation method includes but is not limited to the following steps: determining a historical time series based on the historical hardware resource data and historical processing capacity data of a computing node; inputting the historical time series into a pre-trained processing capacity prediction model to obtain predicted processing capacity data output by the processing capacity prediction model; allocating a task to be processed to the computing node based on the predicted processing capacity data; the processing capacity prediction model includes a first prediction layer and a second prediction layer; the input of the first prediction layer includes the historical hardware resource data in the historical time series, and the output includes the estimated processing capacity data corresponding to the historical hardware resource data; the input of the second prediction layer includes the historical processing capacity data and the estimated processing capacity data in the historical time series, and the output is the predicted processing capacity data.
[0111] In another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the task allocation method provided in any of the above embodiments is implemented. The task allocation method includes but is not limited to the following steps: determining a historical time series based on historical hardware resource data and historical processing capacity data of a computing node; inputting the historical time series into a pre-trained processing capacity prediction model to obtain predicted processing capacity data output by the processing capacity prediction model; allocating a task to be processed to the computing node based on the predicted processing capacity data; the processing capacity prediction model includes a first prediction layer and a second prediction layer; the input of the first prediction layer includes the historical hardware resource data in the historical time series, and the output includes estimated processing capacity data corresponding to the historical hardware resource data; the input of the second prediction layer includes the historical processing capacity data and the estimated processing capacity data in the historical time series, and the output is the predicted processing capacity data.
[0112] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative work.
[0113] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0114] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments or perform equivalent replacements for some of the technical features. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A task allocation method, characterized in that: include: Determine the historical time series based on the historical hardware resource data and historical processing capacity data of the computing nodes; Inputting the historical time series into a pre-trained processing capacity prediction model to obtain predicted processing capacity data output by the processing capacity prediction model; Allocating the tasks to be processed to the computing nodes based on the predicted processing capacity data; The processing capacity prediction model includes a first prediction layer and a second prediction layer; the input of the first prediction layer includes the historical hardware resource data in the historical time series, and the output includes the estimated processing capacity data corresponding to the historical hardware resource data; the input of the second prediction layer includes the historical processing capacity data and the estimated processing capacity data in the historical time series, and the output is the predicted processing capacity data.
2. The task allocation method according to claim 1, characterized in that: The input of the second prediction layer includes the historical time series and the estimated processing capacity data.
3. The task allocation method according to claim 1, characterized in that: The historical hardware resource data includes at least one of the historical processor usage rate, historical memory occupancy rate and historical network bandwidth occupancy rate of the computing node; The historical processing capacity data includes the historical processing speed of the computing node.
4. The task allocation method according to claim 1, characterized in that: The computing nodes include a first computing node and a second computing node; and allocating the tasks to be processed to the computing nodes based on the predicted processing capacity data includes: Determining a node processing capacity ratio based on the predicted processing capacity data of the first computing node and the predicted processing capacity data of the second computing node; Based on the node processing capacity ratio, the to-be-processed tasks are allocated to the first computing node and the second computing node.
5. The task allocation method according to claim 4, characterized in that: After allocating the tasks to be processed to the computing nodes based on the predicted processing capacity data, the method further includes: If the first abnormal situation, the second abnormal situation or the third abnormal situation occurs, some or all of the unprocessed tasks that are allocated to the first computing node and have not been processed by the first computing node are adjusted and allocated to the second computing node; The first abnormal situation is that the deviation between the actual capability of the first computing node to process the task to be processed and the predicted capability is greater than a preset deviation; the predicted capability is determined based on the predicted processing capability data of the first computing node; The second abnormal situation is that the second computing node has processed the pending tasks assigned to the second computing node, and the number of the unprocessed tasks of the first computing node is greater than a preset number; The third abnormal situation is that the real-time transmission delay of the first computing node is greater than or equal to a preset delay threshold.
6. The task allocation method according to claim 1, characterized in that: The determining of the historical time series based on the historical hardware resource data and the historical processing capacity data of the computing node includes: Collecting original node data of the computing node; Replace the abnormal data in the original node data with normal data to obtain the historical hardware resource data and the historical processing capacity data; The abnormal data is original node data whose absolute difference with adjacent data is greater than a preset threshold; the absolute difference is the absolute value of the difference between the abnormal data and the mean of the adjacent data.
7. A task allocation device, characterized in that: include: A sequence building module for determining a historical time series based on historical hardware resource data and historical processing capacity data of computing nodes; A capacity prediction module, used for inputting the historical time series into a pre-trained processing capacity prediction model to obtain predicted processing capacity data output by the processing capacity prediction model; An allocation module, configured to allocate tasks to be processed to the computing nodes based on the predicted processing capacity data; The processing capacity prediction model includes a first prediction layer and a second prediction layer; the input of the first prediction layer includes the historical hardware resource data in the historical time series, and the output includes the estimated processing capacity data corresponding to the historical hardware resource data; the input of the second prediction layer includes the historical processing capacity data and the estimated processing capacity data in the historical time series, and the output is the predicted processing capacity data.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the task allocation method according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the task allocation method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the task allocation method according to any one of claims 1 to 6 is implemented.