Calculation power demand prediction method and device based on image modality

By converting numerical time series data into images and using image modal models for prediction, the problems of inaccurate prediction of extreme value of computing power in the prior art, high computational complexity and solidification of evaluation indicators are solved, and efficient and accurate Computing power demand forecast and resource allocation.

CN118941817APending Publication Date: 2024-11-12PIO CLOUD COMPUTING (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411109133.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The existing computing power demand prediction technology cannot accurately predict the computing power extreme value, the computing complexity is high, and it is difficult to operate efficiently on resource-constrained edge devices, and the evaluation indicators cannot be adjusted dynamically, resulting in low resource utilization and increased computing delay.

Method used

Using the computing power demand prediction method based on image mode, by converting one-dimensional numerical computing power timing data into two-dimensional images, using Patch technology and vector encoding to generate graph-encoded vectors, combining time projection full-connection layer and feature projection full-connection layer Produce and introduce dynamic evaluation indicators to optimize the model.

Benefits of technology

It significantly improves the accuracy and real-timeness of computing power demand forecasting, improves resource utilization, reduces computing costs, and enhances the stability and overall performance of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118941817A_ABST
    Figure CN118941817A_ABST
Patent Text Reader

Abstract

The invention discloses a computing power demand prediction method and device based on image modality. The method comprises the following steps: constructing a load sample sequence comprising historical workload data and device feature data of different edge devices at each sampling moment; drawing a load change trend graph of each edge device, and generating a device state graph of each edge device based on the load change trend graph and the device feature data; on the basis of the device state diagram, utilizing a Patch technology and vector coding to obtain diagram coding vectors, and utilizing a preset load prediction model to execute coding fusion and channel fusion on each diagram coding vector of each edge device to obtain a channel fusion vector; projecting the channel fusion vector by using a time projection full-connection layer and a feature projection full-connection layer to obtain a load prediction value; and screening samples to calculate load prediction loss, and optimizing the preset load prediction model by taking minimization of the load prediction loss as a target. According to the invention, through analysis of the modal features of the image, the computing power demand can be accurately predicted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of edge computing technology, and specifically relates to a method and device for predicting computing power demand based on image modality, which can not only be applied to edge cloud scenarios, but also can be reused in multiple scenarios such as central cloud, IDC, CDN, terminal equipment, etc. to predict computing power demand. Background Art

[0002] With the advent of the Internet of Everything era and the popularization of 5G communication networks, the scale of Internet data is growing exponentially. In this context, the traditional centralized cloud computing architecture can no longer meet the needs of end users for timeliness, capacity, and computing power. The ultra-low latency, massive data, and edge intelligence of edge cloud have prompted more companies to choose edge cloud technology solutions, making edge cloud computing an important component between the central cloud and the terminal in the market.

[0003] In the context of the rapid development of edge cloud computing, how to accurately predict computing power demand has become a key issue. Especially in computationally intensive tasks such as numerical simulation and scientific computing, the volatility and uncertainty of computing power demand increase the complexity of resource scheduling. Existing computing power demand prediction technologies generally use static methods such as supervised classification or time series prediction to allocate and predict resources, which cannot meet the dynamic needs of actual edge cloud scenarios with complex heterogeneous devices and changing services, resulting in low resource utilization or increased computing delays, thus affecting user experience. At the same time, it has the following disadvantages:

[0004] 1. Focus on trends rather than extreme value predictions: Conventional prediction methods use numerical modes, which causes the model to only learn numerical trends and is difficult to fit extreme value features. But in fact, computing power scheduling pays more attention to extreme value predictions, which is crucial for identifying potential risks and making reasonable scheduling;

[0005] 2. High computational complexity: Some existing computing power demand prediction methods have high computational complexity, resulting in high computational overhead in actual deployment. They are difficult to run efficiently on resource-constrained edge devices, affecting the real-time and practicality of the prediction.

[0006] 3. The optimization goal is relatively single: Traditional computing power demand prediction methods only rely on historical computing power data to predict the future, ignoring the impact of other possible hardware requirements on computing power demand;

[0007] 4. Evaluation indicators are relatively rigid: Existing evaluation indicators cannot be dynamically adjusted according to actual forecasting needs, making it impossible for the model to focus only on extreme values ​​or certain important time points. Summary of the invention

[0008] In view of the above problems, the present invention proposes a method and device for predicting computing power demand based on image modality, which can not only significantly improve the accuracy and real-time performance of computing power demand prediction, but also improve resource utilization, reduce computing costs, and enhance system stability in practical applications. To solve the above technical problems, the technical solutions adopted by the present invention are as follows:

[0009] A computing power demand prediction method based on image modality includes the following steps:

[0010] S1, builds corresponding load sample sequences based on historical workload data and device feature data at different edge devices at different sampling times;

[0011] S2, plotting the load change trend graph of each edge device with the sampling time as the horizontal axis and the upload bandwidth workload in the load sample sequence as the vertical axis, and generating a device status graph of each edge device based on the load change trend graph and the device feature data in the load sample sequence;

[0012] S3, initialization training round Set the total number of training rounds and sample screening period

[0013] S4, based on the device state graph obtained in step S2, using patch technology and vector coding to obtain a graph coding vector for each edge device, and performing coding fusion and channel fusion on each graph coding vector of each edge device using a preset load prediction model according to the graph coding vector to obtain a feature fusion vector for each edge device;

[0014] S5, using a time projection fully connected layer and a feature projection fully connected layer to project the feature fusion vector obtained in step S4 to obtain a corresponding load prediction value;

[0015] S6, based on sample screening period The load sample sequence of the edge device obtained in step S1 is screened to construct a set of concerned load sample sequences for each edge device, and the set of concerned load sample sequences for each edge device is divided into δ groups, and the maximum value of the upload bandwidth workload is selected from each group of load sample sequences, and the load prediction loss is calculated based on the load sample sequence at the sampling time corresponding to the maximum value, the γ load sample sequences adjacent to the load sample sequence, and the load prediction value obtained in step S5, and the load prediction model is optimized with the goal of minimizing the load prediction loss;

[0016] S7, Judgment If yes, execute And return to step S4, otherwise, collect new workload data and device feature data of the edge device online, build the corresponding device state diagram according to the method of steps S1-S2, and output the corresponding load prediction value according to the method of steps S4-S5.

[0017] The step S4 comprises the following steps:

[0018] S4.1, initialize the number of neural network layers m of the preset load prediction model = 1, set the total number of neural network layers

[0019] S4.2, using the Patch technology to split each device state graph into several image blocks, and encoding each image block to obtain a corresponding graph encoding vector;

[0020] S4.3, randomly initialize the parameter matrix of the preset load prediction model, and use the updated preset load prediction model to obtain the corresponding row feature extraction vector based on the graph encoding vector obtained in step S4.2;

[0021] S4.4, randomly initialize the parameter matrix of the preset load prediction model, and use the updated load prediction model to obtain the corresponding feature fusion vector based on the row feature extraction vector obtained in step S4.3;

[0022] S4.5, Judgment If so, execute step S5, otherwise, execute m=m+1, update the graph encoding vector based on the feature fusion vector and return to step S4.3.

[0023] In step S4.3, the expression of the row feature extraction vector is:

[0024]

[0025] In the formula, Representing graph encoding vector The corresponding row feature extraction vector, LN(·) represents layer normalization, W1 and W2 represent the parameter matrices corresponding to the first fully connected layer and the second fully connected layer after random initialization, σ(·) represents the GELU activation function, represents the i-th graph encoding vector of edge device n, P represents the number of patches, and X n The feature representation vector representing edge device n.

[0026] The preset load prediction model includes a plurality of neural networks connected in sequence, and each neural network includes an input layer, a first fully connected layer, an activation function layer, a second fully connected layer and an output layer connected in sequence.

[0027] The load prediction model also includes several residual network layers corresponding to the neural networks respectively. The input end of each residual network layer is connected to the input layer and output layer of the corresponding neural network respectively. The output end of the last residual network layer is connected to the input end of the time projection fully connected layer, and the output ends of the remaining residual network layers are connected to the input layer of the next neural network of the neural network to which they correspond.

[0028] The data dimension of the input layer of each neural network of the preset load prediction model is consistent with the data dimension of its output layer.

[0029] In step S4, the expression of the feature fusion vector of the edge device is:

[0030]

[0031] In the formula, represents the feature fusion vector of edge device n, Represents a column vector The corresponding feature fusion vector, Represents a column vector The corresponding feature fusion vector, Represents the row feature extraction combination vector T n The column vector corresponding to the first channel in , Represents the row feature extraction combination vector T n The column vector corresponding to the Cth channel in, Represents a column vector The corresponding feature fusion vector, Represents the feature extraction combination vector T n The column vector corresponding to the jth channel in , C represents the length of each graph encoding vector encoding;

[0032] The column vector The corresponding feature fusion vector The expression is:

[0033]

[0034] Where W3 represents the parameter matrix of the first fully connected layer after random initialization, W5 represents the parameter matrix of the second fully connected layer after random initialization, LN(·) represents layer normalization, and σ(·) represents the GELU activation function.

[0035] A computing power demand prediction device based on image modality, comprising:

[0036] Sequence construction module: used to collect historical workload data and device feature data of different edge devices at each sampling time, and build several load sample sequences based on the historical workload data and device feature data;

[0037] State diagram drawing module: used to draw the load change trend diagram of each edge device with the sampling time as the horizontal axis and the upload bandwidth workload in the load sample sequence obtained by the sequence construction module as the vertical axis, and generate a device state diagram of each edge device based on the load change trend diagram and the device feature data in the load sample sequence;

[0038] Model training module: used to obtain the graph coding vector of each edge device by using the patch technology and vector coding based on the device state graph obtained by the state graph drawing module, perform coding fusion and channel fusion on each graph coding vector of each edge device by using the preset load prediction model according to the graph coding vector to obtain the feature fusion vector of each edge device, and use the time projection fully connected layer and the feature projection fully connected layer to project the feature fusion vector to output the load prediction value;

[0039] Model optimization module: used to filter the load sample sequence of the edge device obtained by the sequence construction module based on the set sample screening period, construct a set of concerned load sample sequences for each edge device, divide the concerned load sample sequence set of each edge device into δ groups, select the maximum value of the upload bandwidth workload from each group of load sample sequences, calculate the load prediction loss based on the load sample sequence at the sampling moment corresponding to the maximum value, the γ load sample sequences adjacent to the load sample sequence, and the load prediction value obtained by the model training module, and optimize the model training module with the goal of minimizing the load prediction loss;

[0040] Load prediction module: used to collect new workload data and device feature data of edge devices online, update the historical workload data and device feature data in the sequence construction module based on the collected new workload data and device feature data to generate a new load sample sequence, use the state diagram drawing module to generate a device state diagram based on the new load sample sequence, and use the model training module to output the load prediction value corresponding to the new load sample sequence.

[0041] Beneficial effects of the present invention:

[0042] 1. Improve the traditional computing power prediction method based on numerical modality to a method based on image modality, that is, plot the one-dimensional numerical computing power time series data into two-dimensional image computing power time series data, and then learn the historical computing power data through the image modality model, and finally predict the future computing power demand. Image modality allows the model to observe and understand the data from a macro perspective, shift the focus from trend prediction to extreme value prediction, learn the characteristics of extreme value points, and thus make the prediction of extreme value points more accurate, which is convenient for risk identification and the allocation and subsequent scheduling of computing power;

[0043] 2. Use a lightweight multi-layer perceptron as the backbone network, abandon the high complexity brought by the bulky convolutional network and self-attention mechanism, and greatly improve the real-time performance of the prediction without affecting the prediction accuracy;

[0044] 3. Combining the hardware data of edge devices with the computing power demand data can not only greatly improve the performance of training and reasoning, but also significantly improve the accuracy of the final computing power demand prediction;

[0045] 4. The introduction of dynamic evaluation indicators, namely load prediction loss, can dynamically adjust the model's focus on certain future time points according to actual business needs, thereby affecting the model's learning effect and training and optimizing the model for specific business scenarios;

[0046] In summary, this application accurately predicts computing power requirements and guides the rational allocation of resources by analyzing image modal features. This method can provide more accurate computing power demand predictions while ensuring processing timeliness, improve the utilization efficiency of edge computing resources, and enhance the overall performance and stability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0048] Figure 1 It is a schematic diagram of the process of the present invention;

[0049] Figure 2 A schematic diagram of dividing the device state diagram into blocks using Patch technology and vector coding;

[0050] Figure 3 Schematic diagram of the model prediction effect. DETAILED DESCRIPTION

[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0052] Multilayer Perceptron (MLP): is a feedforward neural network and one of the basic forms of neural networks. It consists of an input layer, one or more hidden layers, and an output layer, each of which consists of many neurons (also called nodes or units).

[0053] Patch technology: From the paper AN IMAGE IS WORTH 16X16 WORDS: TRANSFORMERS FORIMAGE RECOGNITION AT SCALE, this method divides the input image into patches of fixed size, each patch is flattened and processed as an independent input.

[0054] GELU (Gaussian Error Linear Unit): is an activation function. GELU uses a Gaussian error function to smoothly map input values ​​to output values. The formula is GELU(x) = x·Φ(x), where Φ(x) is the cumulative distribution function of the standard normal distribution. Compared to ReLU, GELU can adjust the activation value according to the size and positive and negative of the input value, allowing the model to better capture complex features and subtle changes.

[0055] MLP-Mixer: From the paper MLP-Mixer: An all-MLP Architecture for Vision, this model can process image data without using convolution operations by alternating between channel MLP and spatial MLP. MLP-Mixer divides the image into patches and flattens it, then captures channel and spatial features through linear projection and multi-layer perceptron layers. Compared with traditional convolutional neural networks, MLP-Mixer has a simpler design and higher computational efficiency, demonstrating the potential of multi-layer perceptrons in image classification tasks.

[0056] A computing power demand prediction method based on image modality includes the following steps:

[0057] S1, constructing a corresponding load sample sequence based on the historical workload data and device feature data of different edge devices at each sampling time, including the following steps:

[0058] S1.1, collect workload data and device feature data of different edge devices at the sampling time;

[0059] The device feature data includes at least two of the edge server location, Internet Service Provider (ISP), available server bandwidth, CPU quantity, memory size, disk size, network stress test quality, and packet loss quality, and may also include network quality assessment, etc., which are all static data; the workload data includes upload bandwidth workload and recording time, i.e. sampling time, and may also include disk usage, memory usage, CPU usage, etc., which are all dynamic data. The above data is generally collected through tools such as databases and log4j.

[0060] The sampling frequency can be set to 5 minutes or 10 minutes per day. In this embodiment, data is collected every 5 minutes within 24 hours a day, with a total of 288 sampling moments a day, and each edge device obtains 288 sets of data a day. The sampling period can also be set during specific sampling. The sampling period can be set to sky, and It is a positive integer. For example, if the sampling period is 30 days and there are 288 sampling moments per day, an edge device can obtain 30*288 groups of sampling data in one sampling period.

[0061] S1.2, constructing a load sample sequence for each edge device based on the data collected in step S1.1;

[0062] Preferably, before constructing the load sample sequence, some abnormal data can be cleaned up, such as vacant low-volume periods, missing feature field values, feature value abnormal points, and other abnormal data. Design the representative characters corresponding to each data. In this embodiment, the upload bandwidth workload is represented by bw_upload, the recording time includes week, day, and time, which are represented by week, day, and hour respectively, the edge server location is represented by province, the network quality evaluation is represented by nat_type, the Internet service provider is represented by isp, the available server bandwidth is represented by upbandwidth, the number of CPUs is represented by cpu_num, the memory size is represented by memory_size, the disk size is represented by disk_size, the network stress test quality is represented by test_sat, and the packet loss quality is represented by loss_sat.

[0063] After preprocessing, the text-type data in the preprocessed data is encoded to obtain the corresponding text vector, the maximum and minimum values ​​of each type of data in the 288 groups are screened out, and each data is normalized based on the maximum and minimum values; the numerical type data in the preprocessed data can be normalized without encoding. After obtaining the corresponding normalized data according to the above method, 288 load sample sequences for each edge device are constructed based on the normalized data and the representative characters of each type of data. For example, the following load sample sequence: "bw_upload = '0.17', hour = '0.00', day = '0.00', week = '0.00', province = '0.74', bandwidth_type = '1.00', nat_type = '1.00', isp = '0.50', upbandwidth = '0.43', cpu_num = '0.39', memory_size = '0.13', disk_size = '0.56', test_sat = '0.40', loss_sat = '0.39'".

[0064] S2, such as Figure 3 As shown, the load change trend graph of each edge device is drawn with the sampling time as the horizontal axis and the upload bandwidth workload in the load sample sequence as the vertical axis, and the device status graph of each edge device is generated based on the load change trend graph and the device feature data in the load sample sequence;

[0065] Plot the sample sequence constructed in step 1.2 into a two-dimensional image in chronological order. You can use Matplotlib in Python to plot, and choose bright contrasting colors, such as black and white, red and green, etc. Converting the dynamic data in the load sample sequence from numerical mode to image mode allows the model to use the rich features of the image mode, such as cycle, trend, texture, shape, peak and valley, etc., to capture the complex semantic information in the data.

[0066] In addition to directly drawing two-dimensional graphs, different drawing methods (such as cycle graphs and Gram angle fields) can also be used to increase the model's recognition and learning of data. The normalized device feature data of each edge device can be spliced ​​with the corresponding two-dimensional image to obtain the device status graph corresponding to each edge device. Specifically, assuming that a load change trend graph is a two-dimensional graph with a high H and a long L, there are L moments in total, and the number of device feature data is By combining the equipment characteristic data at each moment with the corresponding column in the load change trend chart at that moment, we can get The matrix is ​​also the matrix corresponding to the device state diagram.

[0067] S3, initialization training round Set the total number of training rounds and sample screening period

[0068] S4, based on the device state graph obtained in step S2, using Patch technology and vector coding to obtain the graph coding vector of each edge device, and performing coding fusion and channel fusion on each graph coding vector of each edge device using a preset load prediction model according to the graph coding vector to obtain a feature fusion vector of each edge device, including the following steps:

[0069] S4.1, initialize the number of neural network layers m of the preset load prediction model = 1, set the total number of neural network layers

[0070] The preset load prediction model includes several neural networks connected in sequence, each of which includes an input layer, a first fully connected layer, an activation function layer, a second fully connected layer and an output layer connected in sequence. Preferably, the intermediate layer dimension can also be set to adjust the parameter amount. The intermediate layer refers to other neural network layers other than the input layer and the output layer. Specifically, if the data dimension corresponding to the input data is P*C, the first fully connected layer should be C*H, so that the dimension of the output data obtained after the input data is multiplied by the parameter matrix of the first fully connected layer is P*H. The activation function layer does not change the data dimension, so the data dimension after passing through the activation function layer is still P*H. The second fully connected layer should be H*C, so that the dimension of the output data of the second fully connected layer is P*C. In summary, it can be ensured that the dimension of the input data remains unchanged after passing through MLP (first fully connected layer + one activation function layer + second fully connected layer). Adjust the intermediate layer dimension, that is, H. The larger H is, the larger the parameter matrix is, and the larger the parameter amount is. In addition, this part can also use several residual network connections, one residual network corresponds to one neural network, the input end of each residual network layer is respectively connected to the input layer and output layer of the corresponding neural network, the output end of the last residual network layer is connected to the input end of the time projection fully connected layer, and the output ends of the remaining residual network layers are connected to the input layer of the next neural network of the corresponding neural network. The initial input and output of each neural network are added, so that the input features can be retained. The present application can also use layer normalization before presetting the load prediction model, in order to accelerate training convergence and improve the generalization ability of the model. In this embodiment, the activation function is a GELU activation function.

[0071] S4.2, using the Patch technology to split each device state graph into several image blocks, and encoding each image block to obtain a corresponding graph encoding vector;

[0072] In order to compress the features in learning, the image modality data is encoded into a one-dimensional vector. Figure 2 As shown, the device state graph is first split into several small blocks through the Patch technology, and then each small block is encoded into a one-dimensional vector. The final several graph encoding vectors can be regarded as the features of the image data.

[0073] S4.3, randomly initialize the parameter matrix of the preset load prediction model, and use the updated preset load prediction model to obtain the corresponding row feature extraction vector based on the graph encoding vector obtained in step S4.2;

[0074] Assume that the vector composed of all the graph encoding vectors in a device state graph is the feature representation vector, and the feature representation vector of edge device n is X n Represents, feature representation vector and Where P represents the number of patches, i.e. the number of image blocks, and c represents the length of each image encoding vector. represents the first graph encoding vector of edge device n, represents the Pth graph encoding vector of edge device n, represents the set of real numbers, then this part of the calculation process can be expressed as:

[0075]

[0076] In the formula, Representing graph encoding vector The corresponding row feature extraction vector, LN(·) represents layer normalization, and denote the parameter matrices corresponding to the first fully connected layer and the second fully connected layer, respectively. H denotes the dimension of the intermediate layer. σ(·) denotes the GELU activation function. Represents the i-th graph encoding vector of edge device n.

[0077] S4.4, randomly initialize the parameter matrix of the preset load prediction model, and use the updated load prediction model to obtain the corresponding feature fusion vector based on the row feature extraction vector obtained in step S4.3;

[0078] Based on all the row feature extraction vectors, a row feature extraction combination vector is constructed, which uses T n Represents the row feature extraction combination vector in, Representing graph encoding vector The corresponding row feature extraction vector, Representing graph encoding vector The corresponding row feature extraction vector, and The updated load prediction model is used to extract the combination vector T based on row features. nGet the corresponding feature fusion vector, the corresponding expression is:

[0079]

[0080] In the formula, Represents a column vector The corresponding feature fusion vector, Represents the row feature extraction combination vector T n The column vector corresponding to the j-th channel in, represents the parameter matrix of the first fully connected layer after random initialization, represents the parameter matrix of the second fully connected layer after random initialization. Finally, we get represents the feature fusion vector of edge device n, It is the fusion result of the backbone network output, that is, the final output result of the preset load prediction model, where: Represents a column vector The corresponding feature fusion vector, Represents a column vector The corresponding feature fusion vector, Represents the row feature extraction combination vector T n The column vector corresponding to the first channel in , Represents the row feature extraction combination vector T n The column vector corresponding to the Cth channel in .

[0081] S4.5, Judgment If yes, execute step S5, otherwise execute m=m+1, update the image encoding vector based on the feature fusion vector and return to step S4.3;

[0082] Repeating steps 4.3 and 4.4 multiple times can make the fusion learning of data more sufficient by expanding the number of parameters. When setting the specific iteration termination condition, it is necessary to select the difficulty required by the actual business, which is roughly in the range of 2 to 8 times. In this embodiment, the data is processed using MLP-Mixer in the field of computer vision. The backbone network, that is, the two connection layers and the activation function layer, only has a multi-layer perceptron. Compared with the convolution and self-attention mechanism, it has higher computational efficiency and is more suitable for parallel computing. It can make full use of the matrix multiplication acceleration capability of hardware (such as GPU or TPU).

[0083] S5, using a time projection fully connected layer and a feature projection fully connected layer to project the feature fusion vector obtained in step S4 to obtain a corresponding load prediction value;

[0084] The output of the backbone network Projection to output dimension In the figure, L represents the load prediction length, and F represents the number of output features, that is, the number of dynamic parameters. It only needs to pass through two fully connected layers, that is, the two dimensions are and If necessary, a denormalization module can be added. The denormalization corresponds to the maximum and minimum normalization in the previous step S1.2. The addition of denormalization can map the output data back to the original interval. The denormalized data is more meaningful for analysis and interpretation.

[0085] S6, based on sample screening period The load sample sequence of the edge device obtained in step S1 is screened to construct a set of concerned load sample sequences for each edge device, and the set of concerned load sample sequences for each edge device is divided into δ groups, and the maximum value of the upload bandwidth workload is selected from each group of load sample sequences, and the load prediction loss is calculated based on the load sample sequence at the sampling moment corresponding to the maximum value, the γ load sample sequences adjacent to the load sample sequence, and the load prediction value obtained in step S5, and the preset load prediction model is optimized based on minimizing the load prediction loss;

[0086] The loss can be calculated based on MSE (Mean Squared Error) or MAE (Mean Absolute Error), and the corresponding calculation formula is as follows:

[0087]

[0088]

[0089] Where Y l represents the true value of the lth upload bandwidth workload, represents the predicted value of the lth upload bandwidth workload, and L represents the number of samples. Among them, MSE can amplify the error and is more commonly used in practical applications. Each edge device can obtain δ load prediction losses, and then calculate the average load prediction loss of all edge devices, and then optimize the preset load prediction model based on the average load prediction loss.

[0090] Set sample screening period When combined with the sampling period It can be set to certain times or days. In actual business needs, optimizing the model based on the load sample sequence in the sample screening period can bring more accurate prediction results for predictions at specific times. For example, when the sample screening period is set to certain times, you can pay more attention to the load peak of edge devices to avoid overload; when it is set to a certain day, you can pay more attention to the long-term trend analysis of edge devices, thereby optimizing computing power scheduling and allocation.

[0091] This embodiment takes sampling at 5-minute intervals as an example. However, in actual business scenarios, we may only pay attention to certain time periods (such as 10:00-20:00), and the traditional loss function method loses its pertinence. Therefore, this application uses a dynamic loss function calculation method, that is, according to different business scenarios, some of the 288 sampling points are selected for loss function calculation, which can better reflect the demand target. Specifically, we may pay more attention to the daily computing power extreme points, because we can use this for early warning and scheduling, so we can also dynamically select the extreme points in each segment of data through code for loss function calculation, so as to highlight the impact of extreme points on model learning. The method of selecting extreme points and optimizing the model in this embodiment is as follows:

[0092] a. Divide the 288 load sample sequences into 24 groups;

[0093] b. Confirm the maximum value of the upload bandwidth workload in each set of load sample sequences, and confirm the load sample sequences corresponding to the γ sampling moments before and after the maximum value. The upload bandwidth workloads corresponding to these 2γ+1 load sample sequences are all extreme points;

[0094] c. Calculate the loss value of each extreme point according to formula (3) or formula (4);

[0095] b. Update the model using the loss value.

[0096] Loss propagation is an algorithm used to train artificial neural networks. Its main purpose is to minimize the loss function by continuously adjusting the weights in the network to make the predicted results as close to the actual results as possible. After calculating the loss value, starting from the output layer, the gradient of the loss with respect to each parameter is calculated. The gradient calculation uses the chain rule, by calculating the error of each node layer by layer and passing it back, and finally using the optimization algorithm to adjust the weights and biases of the network according to the calculated gradient.

[0097] S7, Judgment If yes, execute And return to step S4, otherwise, collect new workload data and device feature data of the edge device online, build the corresponding device state diagram according to the method of steps S1-S2, and output the corresponding load prediction value according to the method of steps S4-S5;

[0098] like Figure 3 The figure shows the load prediction results. The figure uses 336 historical moments as input and predicts the next 336 moments, where GroundTruth is the true value and Prediction is the predicted value. It can be seen that the prediction of the maximum value (the maximum value and the 2γ points nearby) is very accurate.

[0099] The embodiment of the present application also provides a computing power demand prediction device based on image modality, including:

[0100] Sequence construction module: used to collect historical workload data and device feature data of different edge devices at each sampling time, and build several load sample sequences based on the historical workload data and device feature data;

[0101] State diagram drawing module: used to draw the load change trend diagram of each edge device with the sampling time as the horizontal axis and the upload bandwidth workload in the load sample sequence obtained by the sequence construction module as the vertical axis, and generate a device state diagram of each edge device based on the load change trend diagram and the device feature data in the load sample sequence;

[0102] Model training module: used to obtain the graph coding vector of each edge device by using the patch technology and vector coding based on the device state graph obtained by the state graph drawing module, perform coding fusion and channel fusion on each graph coding vector of each edge device by using the preset load prediction model according to the graph coding vector to obtain the feature fusion vector of each edge device, and use the time projection fully connected layer and the feature projection fully connected layer to project the feature fusion vector to output the load prediction value;

[0103] Model optimization module: used to divide the load sample sequence of each edge device obtained by the sequence construction module into δ groups, select the maximum value of the upload bandwidth workload from each group of load sample sequences, calculate the load prediction loss value based on the load sample sequence at the sampling time corresponding to the maximum value, the γ load sample sequences adjacent to the load sample sequence, and the load prediction value obtained by the model training module, and optimize the model training module with the goal of minimizing the load prediction loss;

[0104] Load prediction module: used to collect new workload data and device feature data of edge devices online, update the historical workload data and device feature data in the sequence construction module based on the collected new workload data and device feature data to generate a new load sample sequence, use the state diagram drawing module to generate a device state diagram based on the new load sample sequence, and use the model training module to output the load prediction value corresponding to the new load sample sequence.

[0105] An embodiment of the present application also provides an electronic device, which includes a processor and a memory, wherein the memory stores a computer application, and the processor is used to run the computer application in the memory to execute the steps in the various possible image modality-based computing power demand prediction methods as described above.

[0106] The embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the steps of the various possible methods for predicting computing power requirements based on image modality as described above are executed. Specifically, the storage medium can be a general storage medium, such as a mobile disk, a hard disk, etc. When the computer-executable instructions on the storage medium are executed, the embodiments of the above-mentioned method for predicting computing power requirements based on image modality can be executed.

[0107] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps in the various possible image modality-based computing power demand prediction methods described above.

[0108] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A computing power demand prediction method based on image modality, characterized in that: The steps include: S1, builds corresponding load sample sequences based on historical workload data and device feature data at different edge devices at different sampling times; S2, plotting the load change trend graph of each edge device with the sampling time as the horizontal axis and the upload bandwidth workload in the load sample sequence as the vertical axis, and generating a device status graph of each edge device based on the load change trend graph and the device feature data in the load sample sequence; S3, initialization training round Set the total number of training rounds and sample screening period S4, based on the device state graph obtained in step S2, using patch technology and vector coding to obtain a graph coding vector for each edge device, and performing coding fusion and channel fusion on each graph coding vector of each edge device using a preset load prediction model according to the graph coding vector to obtain a feature fusion vector for each edge device; S5, using a time projection fully connected layer and a feature projection fully connected layer to project the feature fusion vector obtained in step S4 to obtain a corresponding load prediction value; S6, based on sample screening period The load sample sequence of the edge device obtained in step S1 is screened to construct a set of concerned load sample sequences for each edge device, and the set of concerned load sample sequences for each edge device is divided into δ groups, and the maximum value of the upload bandwidth workload is selected from each group of load sample sequences, and the load prediction loss is calculated based on the load sample sequence at the sampling time corresponding to the maximum value, the γ load sample sequences adjacent to the load sample sequence, and the load prediction value obtained in step S5, and the load prediction model is optimized with the goal of minimizing the load prediction loss; S7, Judgment If so, execute q,=q,+1, and return to step S4. Otherwise, collect new workload data and device characteristic data of the edge device online, build the corresponding device state diagram according to the method of steps S1-S2, and output the corresponding load prediction value according to the method of steps S4-S5.

2. The method for predicting computing power demand based on image modality according to claim 1, characterized in that: The step S4 comprises the following steps: S4.1, initializing the number of neural network layers m of the preset load prediction model = 1, and setting the total number of neural network layers m; S4.2, using the Patch technology to split each device state graph into several image blocks, and encoding each image block to obtain a corresponding graph encoding vector; S4.3, randomly initialize the parameter matrix of the preset load prediction model, and use the updated preset load prediction model to obtain the corresponding row feature extraction vector based on the graph encoding vector obtained in step S4.2; S4.4, randomly initialize the parameter matrix of the preset load prediction model, and use the updated load prediction model to obtain the corresponding feature fusion vector based on the row feature extraction vector obtained in step S4.3; S4.5, Judgment If so, execute step S5, otherwise, execute m=m+1, update the graph encoding vector based on the feature fusion vector and return to step S4.

3.

3. The method for predicting computing power demand based on image modality according to claim 2, characterized in that: In step S4.3, the expression of the row feature extraction vector is: In the formula, Representing graph encoding vector The corresponding row feature extraction vector, LN(·) represents layer normalization, W1 and W2 represent the parameter matrices corresponding to the first fully connected layer and the second fully connected layer after random initialization, σ(·) represents the GELU activation function, represents the i-th graph encoding vector of edge device n, P represents the number of patches, and X n The feature representation vector representing edge device n.

4. The method for predicting computing power demand based on image modality according to claim 1, characterized in that: The preset load prediction model includes a plurality of neural networks connected in sequence, and each neural network includes an input layer, a first fully connected layer, an activation function layer, a second fully connected layer and an output layer connected in sequence.

5. The method for predicting computing power demand based on image modality according to claim 4, characterized in that: The load prediction model also includes several residual network layers corresponding to the neural networks respectively. The input end of each residual network layer is connected to the input layer and output layer of the corresponding neural network respectively. The output end of the last residual network layer is connected to the input end of the time projection fully connected layer, and the output ends of the remaining residual network layers are connected to the input layer of the next neural network of the neural network to which they correspond.

6. The method for predicting computing power demand based on image modality according to claim 4, characterized in that: The data dimension of the input layer of each neural network of the preset load prediction model is consistent with the data dimension of its output layer.

7. The method for predicting computing power demand based on image modality according to claim 1, characterized in that: In step S4, the expression of the feature fusion vector of the edge device is: In the formula, represents the feature fusion vector of edge device n, Represents a column vector The corresponding feature fusion vector, Represents a column vector The corresponding feature fusion vector, Represents the row feature extraction combination vector T n The column vector corresponding to the first channel in , Represents the row feature extraction combination vector T n The column vector corresponding to the Cth channel in, Represents a column vector The corresponding feature fusion vector, Represents the feature extraction combination vector T n The column vector corresponding to the jth channel in , C represents the length of each graph encoding vector encoding; The column vector The corresponding feature fusion vector The expression is: Where W3 represents the parameter matrix of the first fully connected layer after random initialization, W4 represents the parameter matrix of the second fully connected layer after random initialization, LN(·) represents layer normalization, and σ(·) represents the GELU activation function.

8. A computing power demand prediction device based on image modality, characterized in that: include: Sequence construction module: used to collect historical workload data and device feature data of different edge devices at each sampling time, and build several load sample sequences based on the historical workload data and device feature data; State diagram drawing module: used to draw the load change trend diagram of each edge device with the sampling time as the horizontal axis and the upload bandwidth workload in the load sample sequence obtained by the sequence construction module as the vertical axis, and generate a device state diagram of each edge device based on the load change trend diagram and the device feature data in the load sample sequence; Model training module: used to obtain the graph coding vector of each edge device by using the patch technology and vector coding based on the device state graph obtained by the state graph drawing module, perform coding fusion and channel fusion on each graph coding vector of each edge device by using the preset load prediction model according to the graph coding vector to obtain the feature fusion vector of each edge device, and use the time projection fully connected layer and the feature projection fully connected layer to project the feature fusion vector to output the load prediction value; Model optimization module: used to filter the load sample sequence of the edge device obtained by the sequence construction module based on the sample screening period, construct a set of concerned load sample sequences for each edge device, divide the set of concerned load sample sequences of each edge device into δ groups, select the maximum value of the upload bandwidth workload from each group of load sample sequences, calculate the load prediction loss based on the load sample sequence at the sampling moment corresponding to the maximum value, the γ load sample sequences adjacent to the load sample sequence, and the load prediction value obtained by the model training module, and optimize the model training module with the goal of minimizing the load prediction loss; Load prediction module: used to collect new workload data and device feature data of edge devices online, update the historical workload data and device feature data in the sequence construction module based on the collected new workload data and device feature data to generate a new load sample sequence, use the state diagram drawing module to generate a device state diagram based on the new load sample sequence, and use the model training module to output the load prediction value corresponding to the new load sample sequence.