Edge cloud server load prediction method based on quantum theory
通过在边缘云平台上应用基于量子理论的负载预测方法,利用量子态和密度矩阵表示工作负载模式,结合注意力机制,解决了现有技术中工作负载预测准确性差的问题,实现了更高的 Prediction accuracy and model robustness.
Patent Information
- Application Number
- CN202411361824.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-02-07
AI Technical Summary
The prior art is difficult to effectively utilize heterogeneous attributes and location information of edge cloud platform servers, resulting in poor workload prediction accuracy, especially when faced with an unseen workload pattern.
The edge cloud server load prediction method based on quantum theory is adopted to predict future workloads by establishing a pure state density matrix and a mixed state density matrix, combining the feature vectors learned by the attention mechanism, and fusing historical load data and static feature attributes.
It significantly improves the accuracy of server workload prediction of edge cloud platform servers, enhances the generalization ability and robustness of the model, and can better handle uncertainty and volatility in server workloads.
Smart Images

Figure CN119396569A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things, and in particular to a method, device and storage medium for predicting edge cloud server load based on quantum theory. Background Art
[0002] With the advent of the Internet of Things era, more and more devices and sensors are connected to the Internet, generating massive amounts of data. These data cover a wide range of information, including environmental data, production data, health data, etc. The speed and scale of their generation far exceed the processing capabilities of traditional data processing and storage systems. In order to meet this challenge, edge computing has emerged. Edge computing can better meet the application's needs for real-time and privacy by placing processing and analysis closer to the data source, and has gradually become an important computing paradigm in the Internet of Things era. Today, edge computing and cloud computing work together and complement each other to form a hybrid edge cloud platform solution that provides efficient, flexible, and secure service support for various application scenarios, and demonstrates huge commercial value.
[0003] With the increasing number of applications on edge cloud platforms, including real-time streaming services, cloud games, VR / AR, etc., the requirements for latency and service quality are getting higher and higher. These applications are extremely sensitive to latency, and even millisecond-level latency may affect user experience and service quality. Therefore, how to reasonably deploy and allocate resources on edge cloud platforms to meet the service level agreements (SLAs) of these applications and provide good service quality assurance has become an important challenge facing edge cloud platforms.
[0004] In order to adapt to the business needs of different scenarios, the servers in the edge cloud platform are usually heterogeneous. They may have different hardware architectures, computing capabilities and characteristics. In addition, the geographical distribution of these servers is also different. Multi-dimensional heterogeneous features are interrelated and influence each other, and contain rich semantic information. However, this information is difficult to express and utilize effectively; and a variety of applications are deployed on the edge cloud platform. Some applications may be computationally intensive, some are data-intensive, and some have high real-time requirements. In addition, the frequency of use of some applications is closely related to people's living habits, and therefore they show a certain periodicity. Over time, the application categories on the server will switch dynamically. This causes the server to show uncertain workload patterns. These uncertain features are coupled together, making it difficult to predict the workload of the edge cloud platform. Existing time series prediction models such as ARIMA, RNN, LSTM, etc. cannot be directly used in workload prediction because they are difficult to effectively utilize the heterogeneous attributes and high semantic information such as location of the server, making it difficult to accurately predict server workloads with different patterns, and the prediction effect is often poor when encountering workload patterns that have never been seen during execution. Summary of the invention
[0005] The purpose of the present invention is to solve the shortcomings of the prior art and provide an edge cloud server load prediction method based on quantum theory, comprising the following steps:
[0006] S1: inputting historical load data and static feature attributes into a quantum-driven workload prediction model, wherein an input layer of the quantum-driven workload prediction model obtains an input sequence according to the historical load data;
[0007] S2: The quantum-driven workload prediction model clusters the input sequence, and the feature pool layer establishes a pure state density matrix according to the workload pattern obtained by the clustering, and establishes a mixed state density matrix according to the input sequence, and fuses the input sequence and the feature vector learned by the attention mechanism to obtain fused workload pattern information;
[0008] S3: The static feature layer obtains the most effective static feature according to the static feature information in the workload sequence and the fused workload pattern information parameters, and the decoding layer network obtains the predicted workload according to the workload sequence and the encoding parameters output by the most effective static feature encoder layer.
[0009] Preferably, in step S1, the input layer of the quantum-driven workload prediction model obtains an input sequence according to the historical load data, including:
[0010] The input layer maps the input historical load data into an embedding vector in a high-dimensional space, that is, introduces position information, and embeds the time step information into the historical load data through sine and cosine functions to obtain an input sequence. The input sequence X is expressed as:
[0011]
[0012] where t≤Γ-T+1,n∈[1,N] and is the time index when the workload was last measured, N is the number of workload sequences, and d t is the dynamic feature dimension (d t ≥1);
[0013] The static feature attributes are expressed as:
[0014]
[0015] Among them, d s is a static feature dimension, and d s ≥1.
[0016] Preferably, in step S2, the quantum-driven workload prediction model clusters the input sequence, further comprising:
[0017] S211: Time decomposition technology STL performs smoothing processing on the input sequence through local regression Loess to extract trend components, processes the input sequence through moving average to extract seasonal components, and extracts residual components based on the input sequence;
[0018] S212: constructing the feature pool layer according to the seasonal component;
[0019] S213: The seasonal component is input into the VaDE model through a sliding window for clustering to obtain the workload pattern.
[0020] Preferably, in step S213, the seasonal component is input into the VaDE model through a sliding window to cluster and obtain the workload pattern, further comprising:
[0021] The seasonal component The clustering results are obtained by inputting the sliding window into the VaDE model;
[0022] Akaike information criterion AIC and Bayesian information criterion BIC determine the optimal number of clusters P according to the clustering results;
[0023] Average pooling compresses time series of the same category into a compressed time series according to the clustering category of the clustering result to obtain the workload pattern;
[0024] The average pooling compresses the time series of the same category into a compressed time series according to the clustering category of the clustering result to obtain the workload pattern The calculation formula is as follows:
[0025]
[0026] where i∈[1,2,...,P], P i represents a workload pattern with representative features extracted from the historical workload data, and l represents a cluster C i The result of one of the clusters.
[0027] Preferably, in step S2, the feature pool layer establishes a pure state density matrix according to the workload pattern obtained by clustering, and establishes a mixed state density matrix according to the input sequence, and fuses the input sequence and the feature vector learned by the attention mechanism to obtain fused workload pattern information, further comprising:
[0028] The fully connected network maps the workload pattern to a high-dimensional embedding vector to obtain a pattern embedding vector and embed the pattern into a vector The standardized vector is obtained by standardization to establish the pure state density matrix. The calculation formula of the standardized vector is as follows:
[0029]
[0030] The pure state density matrix is calculated by calculating the outer product of the standardized vector to obtain the pure state density matrix. The calculation formula of the pure state density matrix ρ1 is as follows:
[0031] ρ1=|P i > <P i |,
[0032] Among them, P i is the pure state density matrix in the i-th pure state |P i > and satisfies Σ i p i =1, ρ is symmetric, positive semidefinite, and its trace is 1 (tr(ρ) = 1);
[0033] Establish a mixed state density matrix ρ based on the historical load data f , the calculation formula is as follows:
[0034]
[0035] in, It is symmetric, positive semidefinite, and has a trace of 1;
[0036] The workload pattern probability is calculated according to Gleason's theorem through the projection operator |ψ><ψ|:
[0037]
[0038] Among them, the workload pattern probability is the density matrix representation of the input sequence, It is the embedding vector obtained by upgrading the dimension of the time series to be predicted of the workload pattern through a fully connected network, and b represents the batch size of each round of iterative training of the neural network.
[0039] Preferably, in step S2, fusing the input sequence with the feature vector learned by the attention mechanism to obtain fused workload pattern information further includes:
[0040] Workload pattern probability Send it to a Q-Linear layer to get the output parameter Q, the mixed state density matrix ρ f It is sent to h Q-Linear layers to obtain the output parameters K and V respectively.
[0041]
[0042] K=U2ρ f U2 H ,
[0043] V=U3ρ f U3 H ,
[0044] Among them, U1, U2, U3 are unitary matrices;
[0045] The attention probability s between the parameter K and the parameter Q is calculated by the attention formula i , according to the attention probability s i Calculate the attention score α i , the calculation formula of the attention formula is as follows:
[0046] s i =tr(K i Q),
[0047] α i =Softmax(s i ),
[0048] For the parameter V and the attention score αi Perform weighted summation to obtain the eigenvector ρ:
[0049]
[0050] Among them, the feature vector Select the elements on the diagonal of the eigenvector ρ and use the parameter To express;
[0051] The input sequence is transformed into With the parameters Fusion is performed to ensure that the dimensions of input and output are consistent, and the fusion workload pattern information is obtained
[0052] Preferably, the input sequence With the parameters Performing fusion to obtain workload pattern information further includes:
[0053] The feature vector is expanded by the Expand operation The dimension is from d dm Expand to b×d model , we get the parameter Γ f , where b represents the batch size, and the parameter Γ f After a fully connected neural network layer, a Flatten operation is performed to obtain the same input sequence as described above. Dimensionally consistent parameters The input sequence and the parameter ε f After processing in the Add&Norm layer, the workload pattern information is integrated. The calculation formula of the workload pattern information is as follows:
[0054]
[0055] Preferably, the decoding layer network obtains the predicted workload according to the workload sequence and the encoding parameters output by the most effective static feature encoder layer, further comprising:
[0056] According to the input sequence and the workload pattern information Get the most effective static feature, and get the parameter according to the most effective static feature
[0057]
[0058] The input sequence d s is the dimension of static attributes. The encoder is composed of m similar modules with attention mechanism stacked together. When m=1,
[0059] According to the input sequence The most effective static feature predicts the future workload sequence, and the calculation formula is as follows:
[0060]
[0061]
[0062] in When n=1, the input of the decoder refers to The output of the decoder is finally passed through a linear layer to obtain the predicted workload.
[0063] Based on the same concept, the present invention also provides a computer device, including a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the steps of the edge cloud server load prediction method based on quantum theory as described in any one of the embodiments.
[0064] Based on the same concept, the present invention also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the edge cloud server load prediction method based on quantum theory as described in any of the embodiments.
[0065] Compared with the prior art, the present invention has the following beneficial effects:
[0066] 1) The present invention establishes a pure state density matrix and a mixed state density matrix according to the input sequence, thereby effectively improving the accuracy of workload prediction of edge cloud platform servers;
[0067] 2) The present invention can add fluctuations and randomness to the model according to quantum evolution theory in the edge cloud scenario, so as to avoid the server workload being often affected by various factors, including user behavior, changes in business needs, etc. These factors will introduce certain uncertainties and fluctuations.
[0068] 3) The present invention obtains fused workload pattern information by fusing the input sequence and the feature vector learned by the attention mechanism, thereby enhancing the generalization ability and robustness of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the following detailed description of the preferred embodiment.The drawings are only for the purpose of illustrating the preferred embodiments and are not to be construed as limiting the invention.
[0070] Figure 1 This is a flow chart of a method for predicting edge cloud server load based on quantum theory in the present invention;
[0071] Figure 2 This is an architecture diagram of an edge cloud server load prediction method based on quantum theory of the present invention;
[0072] Figure 3 This is the architecture diagram of the quantum attention layer of the present invention;
[0073] Figure 4 This is a diagram of the feature pool layer architecture of the present invention;
[0074] Figure 5 Constructing a graph for the feature pool of the present invention;
[0075] Figure 6 This is a diagram of the static attribute layer architecture of the present invention. DETAILED DESCRIPTION
[0076] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0077] Those skilled in the art will appreciate that, unless otherwise stated, the singular forms "a", "an", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0078] The technical terms involved in the embodiments of the present invention are defined as follows:
[0079] 1. Edge Computing: Edge computing is a distributed computing model that places computing resources and data storage closer to data sources and end users, such as the edge of the network, near devices, or on IoT nodes. In this way, most data processing and analysis can be done closer to the source of data generation, without having to transmit data to a central data center for processing, thereby reducing data transmission delays and network bandwidth pressure, and achieving more real-time data processing and response. In addition, by processing sensitive data locally or close to the data source, the risk of data being stolen or tampered with during transmission is reduced, and the privacy and security of the data are improved. The inherent characteristics of edge computing make it easy to support large-scale device access deployment and can effectively process data from a large number of devices. This emerging computing paradigm provides a more flexible and efficient solution for the needs of various application scenarios.
[0080] 2. Time Series Forecasting: It is a method of using historical time series data to predict future values. Time series data is a sequence of data arranged in chronological order, such as daily sales, hourly temperature, monthly stock prices, etc. Time series forecasting has a wide range of applications in many fields, including finance, meteorology, transportation, industrial production, etc. Commonly used time series forecasting models include statistical models, machine learning models, or deep learning models. Classic statistical models include the ARIMA (arithmetic regression integrated moving average) model. Machine learning models include linear regression models, decision tree models, or random forest models. With the development of deep learning technology, models such as recurrent neural networks (RNN) and long short-term memory networks (LSTM) have also begun to be gradually applied to time series forecasting, which can well capture the long-term dependencies of time series and improve the accuracy and generalization of predictions to a certain extent.
[0081] 3. Workload Prediction: Workload prediction is essentially a time series prediction problem. It mainly refers to the process of predicting and estimating the future system or server load using the server's historical load data and time series prediction models. In the field of computer science, load usually refers to the resource utilization of the system, such as CPU utilization, memory usage, network traffic, etc. Server load prediction can help predict the operating status of the system in advance, so that system administrators and operation and maintenance personnel can plan resources reasonably, which helps to avoid excessive or insufficient resources, ensure that the system can maintain stable performance and availability under high load conditions, and improve user experience and satisfaction.
[0082] 4. Quantum Theory: Quantum theory itself is a set of mathematical theories used to explain the behavior of particles in the microscopic physical world. It describes the behavior and interactions of basic particles (such as electrons, photons, etc.) in the microscopic world. Quantum is the basic unit in physics, describing some characteristics in the microscopic world, such as energy, momentum, etc. Unlike the continuity in classical physics, quantum theory describes these characteristics as discrete and discontinuous quantities, thus providing a basis for explaining and understanding various phenomena in the microscopic world. Today, quantum theory is no longer limited to the field of quantum physics. More and more scholars have extended it to scenarios that have similar commonalities with microscopic physical particles to solve different problems in special scenarios.
[0083] Example 1
[0084] Workload prediction plays a key role in solving the challenges faced by edge cloud platforms. This process involves predicting the future workload of the server to assist in the deployment of applications and avoid additional overhead caused by over-allocation or under-allocation of resources. Through accurate workload prediction, the edge cloud platform can effectively improve resource utilization and reduce power consumption while meeting the quality of service, thereby solving problems such as resource planning and capacity configuration. The predicted content can be the bandwidth, CPU or other resource utilization of the server. This embodiment is mainly used to predict the bandwidth occupancy of the server. Since the edge cloud platform contains multiple servers and static feature attributes such as server geographic location, memory size, and disk size are introduced in the prediction process, the problem can be defined as a multivariate multi-sequence prediction problem.
[0085] See also Figure 1 and Figure 2 As shown, this embodiment provides a method for predicting edge cloud server load based on quantum theory, comprising the following steps:
[0086] S1: Input historical load data and static feature attributes into the quantum-driven workload prediction model. The input layer of the quantum-driven workload prediction model obtains an input sequence based on the historical load data.
[0087] Preferably, in step S1, the input layer of the quantum-driven workload prediction model obtains an input sequence according to historical load data, including:
[0088] The input layer maps the input historical load data into an embedded vector in a high-dimensional space, that is, introduces position information, and embeds the time step information into the historical load data through sine and cosine functions to obtain the input sequence. The input sequence X is expressed as:
[0089]
[0090] in, and is the time index when the workload was last measured, N is the number of workload sequences, and d t is the dynamic feature dimension (d t ≥1);
[0091] Static feature attributes are represented as:
[0092]
[0093] Among them, d s is a static feature dimension, and d s ≥1.
[0094] The quantum-driven workload prediction model QDPformer is based on the transformer model. QDPformer uses concepts such as quantum states, density matrices, quantum measurements, and quantum evolution in quantum theory to model various uncertainty characteristics in the edge cloud platform workload prediction problem, thereby effectively improving the accuracy of the model in predicting the edge cloud platform load.
[0095] S2: The quantum-driven workload prediction model clusters the input sequence. The feature pooling layer establishes a pure state density matrix based on the workload pattern obtained by clustering, and a mixed state density matrix based on the input sequence. The input sequence and the feature vector learned by the attention mechanism are fused to obtain the fused workload pattern information.
[0096] Before predicting the load through the neural network model QDPformer, it is necessary to first model the server load data and static features, so that they can be input into the model for prediction. Edge cloud scenario servers usually deploy a variety of applications, and the static properties of each server are different (such as CPU type, memory size, disk size, etc.), so the load pattern of each server is also different, usually showing different periodicity. By utilizing this rule, the prediction accuracy of the model can be better improved.
[0097] Preferably, in step S2, the quantum-driven workload prediction model clusters the input sequence, further comprising:
[0098] S211: Time decomposition technology STL uses local regression Loess to smooth the input sequence to extract the trend component, uses moving average to process the input sequence to extract the seasonal component, and extracts the residual component based on the input sequence;
[0099] S212: constructing a feature pooling layer based on seasonal components for subsequent input into the model and improving the prediction effect of the load forecasting model;
[0100] S213: The seasonal component is input into the VaDE model through a sliding window to cluster the workload pattern.
[0101] Preferably, the decomposition process of the time decomposition technique STL can be expressed as follows:
[0102]
[0103] in is the workload sequence, They represent seasonal component, trend component and residual component respectively. Since seasonal component has more obvious time characteristics.
[0104] Preferably, in step S213, the seasonal component is input into the VaDE model through a sliding window to cluster and obtain a workload pattern, further comprising:
[0105] Seasonal Components The clustering results are obtained by inputting the sliding window into the VaDE model;
[0106] Akaike information criterion AIC and Bayesian information criterion BIC determine the optimal number of clusters P according to the clustering results;
[0107] Average pooling compresses the time series of the same category into a compressed time series according to the clustering category of the clustering result to obtain the workload pattern;
[0108] Among them, average pooling compresses the time series of the same category into a compressed time series according to the clustering category of the clustering result, and obtains the workload pattern The calculation formula is as follows:
[0109]
[0110] where i∈[1,2,...,P], P i represents the workload pattern with representative features extracted from historical workload data, and l is represented by the cluster C i The result of one of the clusters.
[0111] Preferably, clustering is performed by an encoder, a decoder and a Gaussian mixture model (GMM), and the clustering process can be expressed as:
[0112]
[0113] C=GMM(Z t )
[0114]
[0115] Among them, Encoder and Decoder are blocks composed of several different fully connected (fc) layers, Z t is the encoding vector of the workload sequence, and is the clustering result. GMM assumes a mixed Gaussian model that produces λ determined by the latent variable λ and can infer the probability of λ.
[0116] See also Figure 3 As shown, the feature pool is constructed by using concepts such as quantum state and density matrix in the quantum theory framework. In quantum mechanics, quantum state is used to describe the state of a quantum system. The quantum state can be in a pure state or a mixed state. A pure state means that the system is in a certain quantum state, which can be represented by the state vector |ψ> in the Hilbert space. A mixed state is a quantum state composed of several pure states according to quantum probability, which can usually be represented by a density matrix. The density matrix is usually expressed as ρ. For a quantum system in a pure state, its density matrix can be calculated using the outer product of the state vector |ψ>:
[0117] ρ=|ψ><ψ|
[0118] For a quantum system in a mixed state, its density matrix can be expressed as:
[0119]
[0120] Among them, P i The system is in the i-th pure state |ψ i > and satisfies Σ i p i = 1. ρ is symmetric, positive semidefinite, and has a trace of 1 (tr(ρ) = 1).
[0121] Furthermore, in quantum theory, the state of a system does not remain constant, but evolves over time. The evolution is described by a unitary operator U. U is a system that satisfies UU H =I 2 The complex unitary matrix of . The evolution process can be expressed as:
[0122]
[0123] In addition, according to Gleason's theorem, the projection operator |ψ><ψ| can be used to calculate the probability of observing |ψ> in the density operator space ρ:
[0124] p ψ (ρ)=<ψ|ρ|ψ>=tr(ρ|ψ><ψ|)
[0125] Observation probability p ψ (ρ) is a nonnegative real-valued scalar, since both ρ and |ψ><ψ| are Hermitian.
[0126] See also Figure 4 As shown, in step S2, the feature pool layer establishes a pure state density matrix according to the workload pattern obtained by clustering, and establishes a mixed state density matrix according to the input sequence, and fuses the input sequence and the feature vector learned by the attention mechanism to obtain the fused workload pattern information, further including:
[0127] The fully connected network maps the workload pattern to a high-dimensional embedding vector to obtain the pattern embedding vector and embed the pattern into a vector The standardized vector is obtained by standardization to establish the pure state density matrix. The calculation formula of the standardized vector is as follows:
[0128]
[0129] The pure state density matrix is calculated by calculating the outer product of the standardized vector to obtain the pure state density matrix. The calculation formula of the pure state density matrix ρ1 is as follows:
[0130] ρ1=|P i > <P i |,
[0131] Among them, P i is the pure state density matrix in the i-th pure state |P i > and satisfies Σ i p i =1, ρ is symmetric, semi-positive definite, and its trace is 1 (tr(ρ)=1). Specifically, in this embodiment, when predicting the server workload, the input workload sequence is abstracted as a quantum system in a mixed state, which has an uncertain workload pattern. The workload pattern P obtained from the clustering is i Treated as a pure state and mapped to a high-dimensional embedding vector through a fully connected network The vector representation of a quantum pure state must be a unit vector with a norm of 1. Therefore, in order to obtain a unit vector, each mode embedding vector needs to be normalized;
[0132] Establish the mixed state density matrix ρ based on historical load data f , the calculation formula is as follows:
[0133]
[0134] in, It is symmetric, positive semidefinite, and has a trace of 1;
[0135] The workload pattern probability is calculated according to Gleason's theorem through the projection operator |ψ><ψ|:
[0136]
[0137] Among them, the workload pattern probability is the density matrix representation of the input sequence, It is the embedding vector obtained by upgrading the dimension of the time series to be predicted of the workload pattern through a fully connected network, and b represents the batch size of each round of iterative training of the neural network.
[0138] See also Figure 4 As shown in the figure, the feature pooling layer is used to learn the workload pattern, and the Q-Embedding (quantum embedding layer) module is used to map the input sequence to the Hilbert space and construct its corresponding density matrix representation. The Q-Embedding & Measurement (QEM) module is used to build the feature pool. It is worth noting that in order to improve the prediction accuracy of the decoder, the probability obtained in the QEM module is The highest workload pattern sequence P i , which is then mapped through the linear layer and used as padding for the decoder input. This process can be expressed as:
[0139]
[0140] padding=Linear(P i )
[0141] in, represents the embedding vector of the workload. According to Gleason’s theorem, the input sequence is related to P i Has the highest workload pattern similarity.
[0142] In order to get the feature pool ρ f In order to extract more effective information, inspired by the multimodal fusion in the quantum language model, an improved quantum attention mechanism is designed:
[0143]
[0144] See also Figure 5 As shown, in step S2, the input sequence and the feature vector learned by the attention mechanism are fused to obtain fused workload pattern information, further comprising:
[0145] The workload pattern probability ρ x Send it to a Q-Linear layer to get the output parameter Q, the mixed state density matrix ρ f It is sent to h Q-Linear layers to obtain the output parameters K and V respectively.
[0146]
[0147] K=U2ρ f U2 H ,
[0148] V=U3ρ f U3 H ,
[0149] Among them, U1, U2, U3 are unitary matrices;
[0150] The attention probability s between parameters K and Q is calculated by the attention formula i , according to the attention probability s i Calculate the attention score α i , the calculation formula of the attention formula is as follows:
[0151] s i =tr(K i Q),
[0152] α i =Softmax(s i ),
[0153] For the parameters V and attention score α i Perform weighted summation to obtain the eigenvector ρ:
[0154]
[0155] Among them, the eigenvector Select the elements on the diagonal of the eigenvector ρ and use the parameter To express;
[0156] The input sequence is transformed into With parameters Fusion is performed to ensure that the dimensions of input and output are consistent, and the fusion workload pattern information is obtained
[0157] Preferably, the input sequence With parameters Performing fusion to obtain workload pattern information further includes:
[0158] By using the Expand operation, the feature vector The dimension is from d dm Expand to b×d model , we get the parameter Γ f , where b represents the batch size, and the parameter Γ f After a fully connected neural network layer, a Flatten operation is performed to obtain the same sequence as the input Dimensionally consistent parameters The input sequence and parameter ε f After processing at the Add&Norm layer, the fusion workload pattern information is obtained The calculation formula for workload pattern information is as follows:
[0159]
[0160] In edge cloud scenarios, server workloads are often affected by various factors, including changes in user behavior and business needs, which introduce a certain degree of uncertainty and volatility. Quantum evolution theory adds volatility and randomness to the model, which can simulate this dynamic change more realistically. Therefore, by introducing a quantum attention mechanism based on this theory, the ability of the FP layer (feature pool layer) to learn global pattern information can be significantly enhanced, so that the model performs better when facing new data.
[0161] S3: The static feature layer obtains the most effective static feature based on the static feature information in the workload sequence and the fused workload pattern information parameters. The decoding layer network obtains the predicted workload based on the workload sequence and the encoding parameters output by the most effective static feature encoder layer.
[0162] Preferably, the decoding layer network obtains the predicted workload according to the workload sequence and the encoding parameters output by the most effective static feature encoder layer, further comprising:
[0163] According to the input sequence and workload pattern information Get the most effective static features and get parameters based on the most effective static features
[0164]
[0165] The input sequence d s is the dimension of static attributes. The encoder is composed of m similar modules with attention mechanism stacked together. When m=1, Specifically, in this embodiment, please refer to Figure 6 As shown in the figure, the SA layer (static attribute layer) is used to embed static feature information (for example, the maximum bandwidth, memory, hard disk and geographic location of the server) into the workload series data. The SA layer adopts a similar structure to the FP Layer (feature pool layer) and the Q-Attention mechanism (quantum attention layer). The main difference is that the SA layer does not use the QEM module and the linear layer for processing workload patterns, but only processes the static feature sequence through a Q-Embedding layer (quantum embedding layer). The SA layer allows us to learn and select from them.
[0166] The decoder is used to predict future workload sequences, and its input includes and from the encoder block It consists of three layers, including the input layer, the SA layer, and n stacked decoder layers, which can be formalized as follows:
[0167]
[0168] According to the input sequence The most effective static feature predicts the future workload sequence, and the calculation formula is as follows:
[0169]
[0170] in When n=1, the input of the decoder refers to The output of the decoder is finally passed through a linear layer to obtain the predicted workload.
[0171] The clustering of workload patterns will be done in advance before the training of QDPformer. Both VaDE and QDPformer use mean square error (MSE) as their training loss function. The gradients calculated by backpropagation are combined with the stochastic gradient descent optimization algorithm to optimize the encoder, decoder and embedding layer parameters.
[0172] This embodiment also borrows deep learning technology to design and optimize a load prediction neural network model for edge cloud scenarios based on the transformer model. By using quantum theory to model the server and inputting its quantum state representation into the model, the prediction accuracy and generalization ability of the model can be effectively improved. In addition, the introduction of the quantum attention mechanism based on quantum evolution theory enables the model to simulate the dynamic changes of workload on the server and greatly enhances the model's ability to learn the rich semantic information in the load data.
[0173] The entire prediction process of the model can be expressed as:
[0174]
[0175] in is the predicted workload sequence, L is the prediction length, and f is the prediction model.
[0176] Example 2
[0177] In some embodiments of the present application, a computer device is also provided, including a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the steps of a method for edge cloud server load prediction based on quantum theory as described in any one of Example 1.
[0178] The present invention also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of a method for edge cloud server load prediction based on quantum theory as described in any one of Example 1.
[0179] It can be understood that for the aforementioned edge cloud server load prediction method based on quantum theory, if it is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0180] Computer readable storage media may include data signals propagated in baseband or as part of a carrier wave, wherein readable program codes are carried. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program codes contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.
[0181] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A method for predicting edge cloud server load based on quantum theory, characterized in that: The following steps are involved: S1: inputting historical load data and static feature attributes into a quantum-driven workload prediction model, wherein an input layer of the quantum-driven workload prediction model obtains an input sequence according to the historical load data; S2: The quantum-driven workload prediction model clusters the input sequence, and the feature pool layer establishes a pure state density matrix according to the workload pattern obtained by the clustering, and establishes a mixed state density matrix according to the input sequence, and fuses the input sequence and the feature vector learned by the attention mechanism to obtain fused workload pattern information; S3: The static feature layer obtains the most effective static feature according to the static feature information in the workload sequence and the fused workload pattern information parameters, and the decoding layer network obtains the predicted workload according to the workload sequence and the encoding parameters output by the most effective static feature encoder layer.
2. According to the method for predicting edge cloud server load based on quantum theory in claim 1, it is characterized in that: In step S1, the input layer of the quantum-driven workload prediction model obtains an input sequence according to the historical load data, including: The input layer maps the input historical load data into an embedding vector in a high-dimensional space, that is, introduces position information, and embeds the time step information into the historical load data through sine and cosine functions to obtain an input sequence. The input sequence X is expressed as: in, and is the time index when the workload was last measured, N is the number of workload sequences, and d t is the dynamic feature dimension (d t ≥1); The static feature attributes are expressed as: Among them, d s is a static feature dimension, and d s ≥1.
3. According to a method for predicting edge cloud server load based on quantum theory according to claim 2, it is characterized in that: In step S2, the quantum-driven workload prediction model clusters the input sequence, further comprising: S211: Time decomposition technology STL performs smoothing processing on the input sequence through local regression Loess to extract trend components, processes the input sequence through moving average to extract seasonal components, and extracts residual components based on the input sequence; S212: constructing the feature pool layer according to the seasonal component; S213: The seasonal component is input into the VaDE model through a sliding window for clustering to obtain the workload pattern.
4. According to the method for predicting edge cloud server load based on quantum theory in claim 3, it is characterized in that: In step S213, the seasonal component is input into the VaDE model through a sliding window to cluster and obtain the workload pattern, further comprising: The seasonal component The clustering results are obtained by inputting the sliding window into the VaDE model; Akaike information criterion AIC and Bayesian information criterion BIC determine the optimal number of clusters P according to the clustering results; Average pooling compresses time series of the same category into a compressed time series according to the clustering category of the clustering result to obtain the workload pattern; The average pooling compresses the time series of the same category into a compressed time series according to the clustering category of the clustering result to obtain the workload pattern The calculation formula is as follows: where i∈[1,2,...,P], P i represents a workload pattern with representative features extracted from the historical workload data, and l represents a cluster C i The result of one of the clusters.
5. According to the method described in 4, a method for predicting edge cloud server load based on quantum theory is characterized in that: In step S2, the feature pool layer establishes a pure state density matrix according to the workload pattern obtained by clustering, and establishes a mixed state density matrix according to the input sequence, and fuses the input sequence and the feature vector learned by the attention mechanism to obtain fused workload pattern information, further comprising: The fully connected network maps the workload pattern to a high-dimensional embedding vector to obtain a pattern embedding vector and embed the pattern into a vector The standardized vector is obtained by standardization to establish the pure state density matrix. The calculation formula of the standardized vector is as follows: The pure state density matrix is calculated by calculating the outer product of the standardized vector to obtain the pure state density matrix. The calculation formula of the pure state density matrix ρ1 is as follows: ρ1=|P i > <P i |, Among them, P i is the pure state density matrix in the i-th pure state |P i > and satisfies Σ i p i =1, ρ is symmetric, positive semidefinite, and its trace is 1 (tr(ρ) = 1); Establish a mixed state density matrix ρ based on the historical load data f , the calculation formula is as follows: in, It is symmetric, positive semidefinite, and has a trace of 1; The workload pattern probability is calculated according to Gleason's theorem through the projection operator |ψ><ψ|: Where, workload pattern probability ρ x is the density matrix representation of the input sequence, |x t > is the embedding vector obtained by upgrading the dimension of the time series to be predicted of the workload pattern through a fully connected network, and b represents the batch size of each round of iterative training of the neural network.
6. The edge cloud server load prediction method based on quantum theory according to claim 5 is characterized in that: In step S2, the input sequence and the feature vector learned by the attention mechanism are fused to obtain fused workload pattern information, further comprising: The workload pattern probability ρ x Send it to a Q-Linear layer to get the output parameter Q, the mixed state density matrix ρ f It is sent to h Q-Linear layers to obtain the output parameters K and V respectively. Q=U1ρ x U1 H , K=U2ρ f U2 H , V=U3ρ f U3 H , Among them, U1, U2, U3 are unitary matrices; The attention probability s between the parameter K and the parameter Q is calculated by the attention formula i , according to the attention probability s i Calculate the attention score α i , the calculation formula of the attention formula is as follows: s i =tr(K i Q), α i =Softmax(s i ), For the parameter V and the attention score α i Perform weighted summation to obtain the eigenvector ρ: Among them, the feature vector Select the elements on the diagonal of the eigenvector ρ and use the parameter To express; The input sequence is transformed into With the parameters Fusion is performed to ensure that the dimensions of input and output are consistent, and the fusion workload pattern information is obtained 7. The edge cloud server load prediction method based on quantum theory according to claim 6 is characterized in that: The input sequence With the parameters Performing fusion to obtain workload pattern information further includes: The feature vector is expanded by the Expand operation The dimension is from d dm Expand to b×d model , we get the parameter Γ f , where b represents the batch size, and the parameter Γ f After a fully connected neural network layer, a Flatten operation is performed to obtain the same input sequence as described above. Dimensionally consistent parameters The input sequence and the parameter ε f After processing in the Add&Norm layer, the workload pattern information is integrated. The calculation formula of the workload pattern information is as follows:
8. The edge cloud server load prediction method based on quantum theory according to claim 7 is characterized in that: The decoding layer network obtains a predicted workload according to the workload sequence and the encoding parameters output by the most effective static feature encoder layer, further comprising: According to the input sequence and the workload pattern information Get the most effective static feature, and get the parameter according to the most effective static feature The input sequence d s is the dimension of static attributes. The encoder is composed of m similar modules with attention mechanism stacked together. When m=1, According to the input sequence The most effective static feature predicts the future workload sequence, and the calculation formula is as follows: in When n=1, the input of the decoder refers to The output of the decoder is finally passed through a linear layer to obtain the predicted workload.
9. A computer device, characterized in that: It includes a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the steps of a method for edge cloud server load prediction based on quantum theory as described in any one of claims 1 to 8.
10. A storage medium storing computer-readable instructions, characterized in that: When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of a method for edge cloud server load prediction based on quantum theory as described in any one of claims 1 to 8.