Optical communication device resource allocation method and system based on virtualization technology

By introducing virtualization technology and reinforcement learning models into optical communication networks, virtual machine groups are constructed for resource prediction and optimal allocation, which solves the problems of unreasonable resource allocation and low utilization in traditional optical communication network resource management methods, and achieves More efficient resource utilization and flexibility.

CN118555510BActive Publication Date: 2024-10-11SUZHOU AIXIONGSI COMM TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411028114.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-10-11
Estimated Expiration
2044-07-30

AI Technical Summary

Technical Problem

Existing optical communication network resource management methods lack dynamic response capabilities, resulting in unreasonable resource allocation and low utilization, making it difficult to adapt to dynamic and changeable network environments.

Method used

An optical communication device resource allocation method based on virtualization technology and reinforcement learning model is adopted. By constructing multiple virtual machine groups to process optical signal processing operations respectively, historical resource consumption data is obtained for resource demand prediction, and resource allocation is optimized through the reinforcement learning model. , dynamically adjust resource allocation strategies.

Benefits of technology

It achieves dynamic allocation and optimization of optical communication device resources, improves resource utilization and prediction accuracy, enhances adaptability and flexibility to network load changes, and reduces resource waste and over-configuration risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118555510B_ABST
    Figure CN118555510B_ABST
Patent Text Reader

Abstract

The present application provides a method and system for allocating resources of an optical communication device based on virtualization technology, which relates to the field of optical communication equipment management. The method includes: constructing multiple virtual machine groups in an optical communication device, each virtual machine group is used to perform optical signal processing operations of a corresponding operation type; obtaining resource consumption time series data of each virtual machine group; predicting the first resource demand prediction amount of the virtual machine group for each virtual machine group to determine the corresponding initial allocation resources; obtaining the system real-time prediction error of each virtual machine group corresponding to the current moment; inputting each initial allocation resource and the system real-time prediction error into a resource allocation optimization network to determine the target allocation resources for each virtual machine group, and the resource allocation optimization network adopts a reinforcement learning model. Thus, by introducing virtualization technology and reinforcement learning models, dynamic allocation and optimization of optical communication device resources are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of optical communication equipment management, and in particular to a method and system for allocating resources of an optical communication device based on virtualization technology. Background Art

[0002] Optical communication technology plays a vital role in modern communication networks, with advantages such as fast transmission speed, large bandwidth, and long transmission distance. However, with the explosive growth of data traffic and the diversification of network applications, existing optical communication network resource management methods face many challenges and limitations.

[0003] Traditional optical communication resource management methods are often statically configured, that is, resources are allocated according to pre-set strategies. They lack the ability to dynamically respond to actual network loads and are difficult to adapt to dynamic and changing network environments, resulting in unreasonable resource allocation.

[0004] In response to the above problems, the industry has not yet proposed a better technical solution. Summary of the invention

[0005] The present application provides a method, system, storage medium, computer program product and electronic device for allocating resources of an optical communication device based on virtualization technology, which are used to at least solve the problems of unreasonable resource allocation and low resource utilization in traditional static resource configuration methods for optical communication devices.

[0006] In a first aspect, an embodiment of the present application provides a method for allocating resources of an optical communication device based on virtualization technology, including: constructing multiple virtual machine groups in an optical communication device, each of the virtual machine groups being used to perform optical signal processing operations of a corresponding operation type; the operation type includes any one of the following: encoding, decoding, compression, decompression, amplification and error processing; obtaining resource consumption time series data corresponding to a first preset time period of history for each of the virtual machine groups; the resource consumption time series data includes multiple historical operating moments and corresponding resource consumption records; the resource types corresponding to the resource consumption records include bandwidth resources, computing resources and storage resources; for each of the virtual machine groups, inputting the resource consumption time series data corresponding to the virtual machine group into a resource prediction model to determine a first resource demand prediction amount for the virtual machine group corresponding to a second preset time period in the future; the first preset time period is longer than the second preset time segment; determine the initial allocated resources corresponding to each of the virtual machine groups according to the first resource demand forecast of each of the virtual machine groups; obtain the second resource demand forecast and the real-time resource consumption of each of the virtual machine groups corresponding to the current moment, and determine the system real-time prediction error according to the real-time resource consumption and the second resource demand forecast; input each of the initial allocated resources and the system real-time prediction error into the resource allocation optimization network to determine the target allocated resources for each of the virtual machine groups; the resource allocation optimization network adopts a reinforcement learning model; the state of the reinforcement learning model is defined by the current resource utilization, historical resource consumption data and system real-time prediction error of each virtual machine group; the action of the reinforcement learning model is defined by the adjustment range of the allocated resources for each virtual machine group; the reward function of the reinforcement learning model is defined by the optimization degree of resource utilization and prediction error.

[0007] In a second aspect, an embodiment of the present application provides a resource allocation system for an optical communication device based on virtualization technology, including: a virtual construction unit, used to construct multiple virtual machine groups in an optical communication device, each of the virtual machine groups is used to perform optical signal processing operations of a corresponding operation type; the operation type includes any one of the following: encoding, decoding, compression, decompression, amplification and error processing; a consumption data acquisition unit, used to obtain resource consumption time series data corresponding to a first preset time period of history for each of the virtual machine groups; the resource consumption time series data includes multiple historical operating times and corresponding resource consumption records; the resource types corresponding to the resource consumption records include bandwidth resources, computing resources and storage resources; a resource demand prediction unit, used to input the resource consumption time series data corresponding to the virtual machine group into a resource prediction model for each of the virtual machine groups, so as to determine the first resource demand prediction amount of the virtual machine group corresponding to a second preset time period in the future; the first preset time period is longer than the second preset time segment; a resource pre-allocation unit, used to determine the initial allocated resources corresponding to each of the virtual machine groups according to the first resource demand forecast of each of the virtual machine groups; a real-time error acquisition unit, used to obtain the second resource demand forecast and resource real-time consumption of each of the virtual machine groups corresponding to the current moment, and determine the system real-time prediction error according to the resource real-time consumption and the second resource demand forecast; a target resource allocation unit, used to input each of the initial allocated resources and the system real-time prediction error into the resource allocation optimization network to determine the target allocated resources for each of the virtual machine groups; the resource allocation optimization network adopts a reinforcement learning model; the state of the reinforcement learning model is defined by the current resource utilization, historical resource consumption data and system real-time prediction error of each virtual machine group; the action of the reinforcement learning model is defined by the adjustment range of the allocated resources for each virtual machine group; the reward function of the reinforcement learning model is defined by the optimization degree of resource utilization and prediction error.

[0008] According to a third aspect, an electronic device is provided, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the steps of the method for resource allocation of an optical communication device based on virtualization technology of any embodiment of the present application.

[0009] In a fourth aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon, characterized in that when the program is executed by a processor, the steps of the method for resource allocation of an optical communication device based on virtualization technology of any embodiment of the present application are implemented.

[0010] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the method for allocating resources of an optical communication device based on virtualization technology in any embodiment of the present application.

[0011] The optical communication device resource allocation method based on virtualization technology provided by the present application can produce at least the following technical effects:

[0012] (1) By introducing virtualization technology and reinforcement learning models, dynamic allocation of optical communication device resources is achieved. Specifically, by introducing multiple virtual machine groups to implement corresponding optical signal processing operations, more efficient optical signal processing can be achieved compared to the traditional method of processing all optical signal operations on a single physical device in the device. It is also conducive to supporting flexible adjustment of different operation tasks and diversified resources. For example, encoding virtual machines require higher computing resources, while compression virtual machines require higher memory resources. By using historical resource consumption data and resource prediction models, it is possible to accurately predict resource demand in the future and pre-allocate resources; then, combined with the current real-time resource consumption and system prediction error, the pre-allocated resources are optimized through the reinforcement learning model, realizing dynamic adjustment of resource allocation and improving the system's adaptability to changes in network load.

[0013] (2) With the diversification of network applications, the resource requirements in optical communication networks have become complex and changeable. In this technical solution, through virtualization technology, the resources in the optical communication device are allocated to different virtual machine groups to handle optical signal processing tasks of different operation types such as encoding, decoding, compression, decompression, amplification and error processing, which can more flexibly respond to the diverse network application requirements and improve the flexibility and adaptability of the system.

[0014] (3) The resource prediction model is used to predict the future resource requirements of each virtual machine group and specify a preliminary resource allocation plan. The preliminary resource allocation plan is adjusted by detecting the current real-time prediction error, thereby achieving dynamic solution allocation based on real-time demand calibration, reducing the risk of over- and under-allocation of resources, and ensuring the stable operation of the optical communication device.

[0015] (4) The resource allocation optimization network optimizes the initial resource allocation plan through a reinforcement learning model, and defines the reward function of the reinforcement learning model by maximizing resource utilization and minimizing prediction error. This enables the system to adjust resource allocation based on the current resource utilization and prediction error of each virtual machine group, ensuring that the resource allocation of each virtual machine group is more accurate and reasonable, reducing resource waste and improving resource utilization.

[0016] Through this technical solution, by introducing virtualization technology and reinforcement learning models, dynamic allocation and optimization of optical communication device resources are achieved, which significantly improves the system's resource utilization and prediction accuracy, and enhances the adaptability and flexibility to changes in network load. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0018] Figure 1 A flowchart showing an example of a method for allocating resources of an optical communication device based on virtualization technology according to an embodiment of the present application is shown;

[0019] Figure 2 A schematic diagram showing an example of a state transition action in a reinforcement learning model;

[0020] Figure 3 An operation flow chart showing an example of dynamically deploying the number of virtual machines in an optical communication device according to an embodiment of the present application;

[0021] Figure 4 A schematic diagram showing a structural connection of an example of a resource prediction model according to an embodiment of the present application is shown;

[0022] Figure 5 A structural block diagram of an example of a resource allocation system for an optical communication device based on virtualization technology according to an embodiment of the present application is shown;

[0023] Figure 6 It is a schematic structural diagram of an embodiment of an electronic device of the present application. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0025] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved shall comply with the provisions of relevant laws and regulations and shall not violate public order and good morals.

[0026] Figure 1 A flowchart of an example of a method for allocating resources of an optical communication device based on virtualization technology according to an embodiment of the present application is shown.

[0027] Regarding the executor of the method of the embodiment of the present application, it can be any controller or processor with computing or processing capabilities. Through the combination of virtualization technology and reinforcement learning model, not only the resource utilization efficiency of the optical communication device and the dynamic response capability of the system are improved, but also the resource allocation strategy is optimized, which significantly improves the network performance and stability of the optical communication device.

[0028] In some examples, it can be a dynamic resource allocation platform and can be integrated and configured in an electronic device, terminal or server through software, hardware or a combination of software and hardware, and the types of terminals, electronic devices or servers can be diverse, such as optical transmitters, optical receivers, mobile phones, tablet computers or desktop computers, etc.

[0029] like Figure 1 As shown, in step S110, a plurality of virtual machine groups are constructed in the optical communication device.

[0030] In some embodiments, multiple virtual machines are constructed using virtualization technology based on the hardware of the optical communication device, and multiple independent virtual machine instances are created on the hardware resources of the optical communication device by using KVM (Kernel-based Virtual Machine) technology. Each virtual machine group is classified according to the type of optical signal processing operation, including but not limited to encoding, decoding, compression, decompression, amplification and error processing. Here, corresponding algorithms are configured for each virtual machine and virtual machine group to perform corresponding optical signal operation processing tasks.

[0031] It should be noted that virtual machines are used to provide an isolated computing environment, and each virtual machine can be configured with certain computing resources (such as CPU, memory) and network resources (such as bandwidth), thereby achieving resource isolation for different types of optical signal operations, facilitating further implementation of targeted resource allocation.

[0032] In some implementations, the upper layer of the optical communication device can uniformly manage each signal processing virtual machine to achieve efficient resource scheduling and management. For example, according to actual needs, the computing resources and network bandwidth of each virtual machine can be dynamically adjusted to ensure efficient use of resources. In addition, the load of each virtual machine can be monitored in real time, and the load distribution can be dynamically adjusted to ensure the stable operation of the system.

[0033] More specifically, the virtual machines deployed in the optical communication device can be divided into an optical signal encoding virtual machine, an optical signal decoding virtual machine, an optical signal compression virtual machine, an optical signal decompression virtual machine, an optical signal amplification virtual machine, and an error processing virtual machine. Through the optical signal encoding virtual machine, the encoding operation of the optical signal is performed to convert the original data into a signal format suitable for optical fiber transmission. Through the optical signal decoding virtual machine, the decoding operation of the optical signal is performed to convert the received optical signal back to the original data format. Through the optical signal compression virtual machine, the data compression operation of the optical signal is performed to reduce the amount of data and improve the transmission efficiency. Through the optical signal decompression virtual machine, the data decompression operation of the optical signal is performed to restore the compressed data to the original data format. Through the optical signal amplification virtual machine, the amplification operation of the optical signal is performed to enhance the signal strength and adapt to long-distance transmission. Through the error processing virtual machine, an efficient error detection algorithm is adopted to detect the errors generated during the transmission process in real time, and the detected errors are corrected through the error repair technology, and the error processing operation is performed to improve the reliability of data transmission.

[0034] Through the embodiments of the present application, multiple virtual machine groups are set to process different optical signal operation links respectively, so that the failure of a virtual machine or virtual machine group will not affect the normal operation of other virtual machines or virtual machine groups. For example, other virtual machines in the virtual machine group can share the work of the failed virtual machine, and when the encoding virtual machine group fails, the compression virtual machine group can still work normally, thereby improving reliability and fault tolerance. In addition, compared to all processing operations being completed by the optical communication device at the device system level, virtual machines are isolated from each other to disperse security risks, and have stronger security protection capabilities.

[0035] In one example of an embodiment of the present application, the optical communication device is an optical transmitter, and the main task of the optical transmitter is to convert electronic signals into optical signals and transmit them through optical fibers. Accordingly, the multiple virtual machine groups contained in the optical transmitter are respectively used to perform optical signal processing operations including the following types of operations: encoding, compression, and amplification. In another example of an embodiment of the present application, the optical communication device is an optical receiver, and the main task of the optical receiver is to receive and process optical signals from optical fibers, convert them into electronic signals, and perform corresponding processing. Accordingly, the multiple virtual machine groups contained in the optical receiver are respectively used to perform optical signal processing operations including the following types of operations: decoding, decompression, amplification, and error handling. Through the cooperation between the above-mentioned virtual machines, efficient transmission and processing of optical signals are achieved.

[0036] As a further optimization of the embodiment of the present application, without considering the hardware differences, specifically, the laser set in the optical transmitter and the photodetector set in the optical receiver, assuming that all hardware accessories are integrated in the optical communication device, the optical communication device can no longer be strictly divided into an optical transmitter and an optical receiver. More specifically, according to business needs, by configuring differentiated virtual machines, the optical communication device can be deployed as an optical receiver or an optical transmitter, thereby improving the versatility and flexibility of the device.

[0037] In step S120, resource consumption time series data of each virtual machine group corresponding to a first preset time period in history is obtained.

[0038] In some implementations, the resource consumption time series data is obtained by analyzing the operation log of the optical communication device. Specifically, the most recent month or quarter is defined as a first preset time period as a time period for collecting historical resource consumption data, and the operation log is parsed to obtain the corresponding resource consumption time series data.

[0039] Here, for each virtual machine group, its resource consumption is recorded within a first preset time period, including multiple historical running moments and corresponding resource consumption records. The data types of the resource consumption records include bandwidth resources, computing resources, and storage resources. Exemplarily, the bandwidth resource information indicates the bandwidth usage of the virtual machine group at each historical moment, the computing resource information indicates the CPU usage of the virtual machine group at each historical moment, and the storage resource information indicates the storage space usage of the virtual machine group at each historical moment.

[0040] In step S130 , for each virtual machine group, the resource consumption time series data corresponding to the virtual machine group is input into a resource prediction model to determine a first resource demand prediction amount corresponding to the virtual machine group in a second preset time period in the future.

[0041] Here, the resource prediction model can use various time series analysis models, such as ARIMA (AutoRegressiveIntegrated Moving Average) model, LSTM (Long Short-Term Memory) model, etc., so as to process the resource consumption time series data and predict the resource demand of each virtual machine group in the future. More preferably, the resource prediction model uses the Temporal Variational Autoencoder (T-VAE) model, and more details will be expanded in conjunction with other examples below.

[0042] In some embodiments, the resource prediction model can be trained and converged based on historical data. After the resource consumption time series data of each virtual machine group is input into the resource prediction model, it can determine the first resource demand forecast for the second preset time period in the future. The second preset time period can be a short-term time period, such as the next day or week. Therefore, by inputting and learning long-term historical data, short-term resource demand can be predicted, which can effectively ensure the accuracy of the resource demand prediction results.

[0043] In step S140 , initial allocated resources corresponding to each virtual machine group are determined according to the first resource demand forecast of each virtual machine group.

[0044] In some implementations, bandwidth resources, computing resources, and storage resources are preliminarily allocated to the corresponding virtual machine group based on the first resource demand forecast of each virtual machine group. In addition, the determination of the initial allocation of resources may take into account a certain redundancy (for example, more margin resources may be deliberately set and may be adjusted in subsequent operations) to cope with prediction errors and sudden demands. Thus, reasonable initial resource allocation is performed based on the predicted resource demand to ensure that each virtual machine group can operate normally and basically meet the optical signal processing requirements.

[0045] In step S150, the second resource demand forecast and the real-time resource consumption of each virtual machine group at the current moment are obtained, and the system real-time prediction error is determined according to the real-time resource consumption and the second resource demand forecast.

[0046] In some implementations, the resource consumption of each virtual machine group is monitored in real time, the resource consumption at the current moment is collected, and the log is called to view the historical prediction results for the current moment (i.e., the second resource demand prediction amount), and the two are compared to calculate the real-time prediction error of the system. In this way, the deviation characteristics of the resource prediction model can be discovered and quantified in a timely manner, and the future resource allocation plan can be adjusted accordingly to ensure the rationality and accuracy of resource allocation.

[0047] In step S160 , each initial allocated resource and the system real-time prediction error are input into a resource allocation optimization network to determine a target allocated resource for each virtual machine group.

[0048] In some implementations, the resource allocation optimization network uses a reinforcement learning model to adjust the resource allocation scheme through the spatial optimization operation of the reinforcement learning model.

[0049] Figure 2 A schematic diagram showing an example of state transition actions in a reinforcement learning model.

[0050] like Figure 2 As shown, it involves multiple statesS The action corresponding to the state transition in the state space of 1~Sn, for example a 1 means from S 1 to S 2. The action of state transition, a 2 means from S 2 to S 1 action, a 3 means from S 1 to S 3 state transition, and so on. Here, the corresponding state transition can occur based on the strategy, and each state transition strategy can be used to cause different transitions. S 1 transfer strategy, action can occur a 2 or a 3.

[0051] It should be noted that the range of states that a state can transfer to (also called transferable states) may be restricted or conditional, for example S 1~ S None of the 3 S 4~ Sn There is a state transition between S 1 can be transferred to the state S 2 and S 3, etc.

[0052] In some embodiments, each action has a corresponding action reward, and each action reward can be determined based on a preset reward function. Generally, if the transfer reward is larger, the transfer action is considered more valuable, and the system will give priority to executing this action. a The reward corresponding to 1 is greater than a The reward corresponding to 3 indicates the transfer action. a 1 is more valuable.

[0053] In some examples of the embodiments of the present application, the state of the reinforcement learning model corresponding to the resource allocation optimization network is defined by the current resource utilization rate of each virtual machine group, the historical resource consumption data and the real-time prediction error of the system. Here, by taking the current resource utilization rate of each virtual machine group as part of the state, the system can dynamically adjust the resource allocation strategy to maximize the utilization rate of the resource. By taking the real-time prediction error of the system as part of the state, it is helpful for the system to timely discover and correct the prediction error, thereby enhancing the robustness of the system. In addition, the action of the reinforcement learning model is defined by the adjustment range of the allocated resources for each virtual machine group. Thus, the system can perform flexible resource allocation adjustments through action space optimization operations. The reward function of the reinforcement learning model is defined by the degree of optimization of resource utilization and prediction error. For example, the greater the resource utilization rate after the optimization action and the smaller the prediction error after the optimization action, the higher the corresponding reward value will be, thereby maximizing resource utilization and minimizing prediction error. Thus, the reinforcement learning model is motivated to make a resource allocation strategy that can simultaneously support maximization of resource utilization and minimization of prediction error, and optimizes the target allocation resources for each virtual machine group based on a comprehensive strategy.

[0054] Through the embodiments of the present application, combined with the optimization decision of the reinforcement learning model, the system can continuously optimize the resource allocation strategy, so that it has adaptability in a dynamic network environment, and find the best balance between maximizing resource utilization and minimizing prediction errors, thereby achieving optimal resource allocation, and can minimize the phenomenon of unreasonable resource allocation to the greatest extent, ensuring that system resources are used reasonably and effectively.

[0055] It should be noted that in addition to the above-mentioned applications, in the process of practicing this application, the algorithm of the reinforcement learning model was further improved and optimized in combination with the resource allocation scenario in this application. More details will be elaborated in conjunction with other examples below.

[0056] As a preferred implementation of the embodiment of the present application, thanks to the flexibility of virtualization technology, the system can also dynamically deploy the number of virtual machines according to real-time needs.

[0057] Figure 3 An operational flow chart showing an example of dynamically deploying the number of virtual machines in an optical communication device according to an embodiment of the present application is shown.

[0058] like Figure 3 As shown, in step S310, the average resource utilization rate of each virtual machine group corresponding to the third preset time period in history is obtained.

[0059] In some implementations, resource utilization data of each virtual machine group within a third preset time period (eg, the past week or month) may be collected and calculated to calculate a corresponding average value.

[0060] In step S320, when it is determined that the average resource utilization of the first virtual machine group is greater than a preset overload utilization threshold, at least one virtual machine matching the operation type of the first virtual machine group is newly created.

[0061] Here, the overload utilization threshold can be adjusted according to system configuration or business needs. For example, it can be set to 90%, so that when this value is exceeded, the system is triggered to automatically expand the virtual machine for the corresponding operation type to share its workload.

[0062] In step S330 , when it is determined that the average resource utilization of the second virtual machine group is less than a preset low-load utilization threshold, at least one virtual machine is uninstalled from the second virtual machine group.

[0063] Here, when it is detected that the average resource utilization of a virtual machine group is lower than a preset low-load utilization threshold (such as 20%), in order to avoid resource idleness and waste, the system is triggered to recycle the corresponding resource units and automatically unload at least one virtual machine from the virtual machine group, thereby improving the overall resource utilization of the optical communication device.

[0064] Through the embodiments of the present application, the optical communication device can dynamically expand and reduce virtual machine resources, thereby improving system elasticity and scalability. The optical communication device can be operated stably by automatically expanding virtual machines to cope with high loads, and resource configuration can be optimized to adapt to different load conditions by dynamically unloading virtual machines.

[0065] Figure 4 A schematic diagram of the structural connection of an example of a resource prediction model according to an embodiment of the present application is shown.

[0066] like Figure 4 As shown, the resource prediction model 400 adopts a temporal variational autoencoder model, which includes an input layer 410, an encoder 420 and a decoder 430.

[0067] The input layer 410 is used to receive resource consumption time series data and convert it into a corresponding input time series matrix , each row in the matrix represents a historical time step, and each column represents a resource consumption type:

[0068] , formula (1);

[0069] In the formula, , represents the total number of historical time steps, Indicates the number of resource types;

[0070] Here, the input layer can simultaneously process multiple resource consumption data such as bandwidth resources, computing resources, and storage resources, perform joint modeling, and improve the ability to predict complex resource requirements.

[0071] The encoder 420 includes a first LSTM layer 421 , an attention layer 422 , a first fully connected layer 423 , and a latent variable sampling layer 424 .

[0072] More specifically, the first LSTM layer 421 is used to extract the input time series matrix The time-dependent features of the output hidden state matrix :

[0073] , formula (2);

[0074] In the formula, is the hidden state matrix Corresponding to The hidden state of the historical time step, The input timing matrix Corresponding to Input data of historical time steps, For the corresponding The hidden state of each historical time step;

[0075] Here, by extracting the time-dependent features of historical resource consumption data through the first LSTM layer, we can capture the pattern of resource consumption changes over time, and simultaneously process the long-term and short-term dependencies of the data, thereby improving the model's ability to remember historical data and handle complex time series relationships.

[0076] The attention layer 422 is used to focus on important time steps through the attention mechanism to calculate the context vector :

[0077] , formula (3);

[0078] , formula (4);

[0079] , formula (5);

[0080] In the formula, For the corresponding The attention weights of the historical time steps, For the corresponding The attention score function for the history time steps, is the transpose of the weight vector of the scoring function, and Represent the hidden state weight matrix and input data weight matrix respectively; Indicates the corresponding The attention score function for the history time steps, Represents the exponential sum of the scoring functions over all historical time steps.

[0081] Here, the importance weight of each historical time step is calculated through the attention mechanism, focusing on the time step with the greatest impact on future resource demand prediction. The feature information of important time steps is integrated through weighted summation to generate a context vector, ensuring that the model can refer to key historical information when making predictions.

[0082] The first fully connected layer 423 is used to process the context vector , to generate the mean of the latent variable and log variance :

[0083] , formula (6);

[0084] , formula (7);

[0085] In the formula, and Corresponding to and The fully connected layer weight matrix, and Corresponding to and The fully connected layer bias term.

[0086] By generating the mean and logarithmic variance of the latent variables through the first fully connected layer and capturing the latent characteristics of the historical resource consumption data, the noise interference of the input data can be reduced and the generalization ability of the model and its adaptability to future data can be improved.

[0087] The latent variable sampling layer 424 is used to generate Calculate the standard deviation 𝜎 of the latent variable and use the reparameterization technique to generate Sampling from a standard normal distribution , and generate latent variables :

[0088] , formula (8);

[0089] , formula (9);

[0090] In the formula, represents a random variable that follows a standard normal distribution.

[0091] Here, by sampling latent variables 𝑧 through reparameterization techniques, introducing randomness, and using latent variable sampling, the model can be prevented from overfitting and ensure that the model still maintains high prediction performance when processing unknown data. Therefore, based on the generation and reconstruction process of latent variables, the model shows stronger robustness when processing complex distributions of resource consumption data and can cope with data noise and outliers.

[0092] The decoder 430 includes a second LSTM layer 431 and a second fully connected layer 432 .

[0093] The second LSTM layer 431 is used to decode the latent variables , to output the reconstructed time series data hidden state:

[0094] , formula (10);

[0095] In the formula, For the reconstruction The hidden state of the future time step, For the reconstruction hidden state for future time steps.

[0096] In this embodiment, the latent variable 𝑧 is decoded into the hidden state of future time series data through the second LSTM layer, and the time-dependent features in the historical data are reconstructed. The hidden state of each future time step is generated by step-by-step decoding, ensuring that the model can accurately capture the changing trend of resource demand in future time steps.

[0097] The second fully connected layer 432 is used to process the reconstructed time series data hidden state to generate a resource demand prediction value matrix :

[0098]

[0099] In the formula, and Represent the weight matrix and bias term of the second fully connected layer, respectively. Indicated in The resource demand forecast for future time steps.

[0100] Here, through the fully connected layer, the decoded hidden state can be efficiently mapped to the specific resource demand prediction value, generating a reconstructed resource demand prediction value matrix, and providing a specific resource demand prediction value for each future time step.

[0101] In this embodiment, latent variables are generated by the encoder to capture the implicit features of historical data, and the decoder is used for reconstruction and prediction, which can effectively capture complex time series patterns and provide more comprehensive predictions for future resource requirements.

[0102] Through the time series variational autoencoder model provided in this embodiment, in the resource prediction of optical communication devices, not only the accuracy and robustness of the prediction can be improved, but also the dynamic adaptability and resource utilization of the system can be enhanced. Based on accurate resource demand prediction and optimized resource allocation, it can better meet the ever-changing business needs and complex communication environment in optical communication networks.

[0103] In some examples of the embodiments of the present application, in the temporal variational autoencoder model adopted by the resource prediction model, the loss function is mainly composed of reconstruction loss and KL divergence loss, and can integrate weighting strategy and adaptive adjustment mechanism.

[0104] Here, reconstruction loss is used to measure the difference between reconstructed data and real data, and by introducing a weighted strategy, the model has different weights for prediction errors of different resource types, thereby more accurately reflecting business needs. In addition, KL divergence loss is used to measure the difference between the distribution of latent variables and the standard normal distribution, and by introducing an adaptive adjustment mechanism, the KL divergence loss is dynamically adjusted according to the size of the reconstruction error, thereby achieving a balance between the model's generation ability and prediction ability.

[0105] Here, the loss function of the resource prediction model is the weighted sum of the reconstruction loss and the KL divergence loss. By introducing the business demand weighting strategy and adaptive adjustment mechanism, the total loss can dynamically reflect the prediction error and generation capacity of the model.

[0106] More specifically, the loss function of the resource prediction model is for:

[0107] , formula (12);

[0108] , formula (13);

[0109] , formula (14);

[0110] , formula (15);

[0111] In the formula, and Represent the reconstruction loss term and KL divergence loss term respectively, and Respectively represent the weight hyperparameters of the corresponding loss terms; Indicates The weight of each resource type, Indicates the real data corresponding to the data sample Future time steps The value of the resource type. Represents the reconstructed data for the data sample Future time steps The predicted value of each resource type; Represents the latent variable m The standard deviation of the dimension, Represents the latent variable m The mean of the dimensions; represents the adaptive adjustment coefficient, which is dynamically adjusted according to the reconstruction error; is the preset deviation threshold.

[0112] In some examples of the embodiments of the present application, the weights can be set or adjusted according to business needs. , weighting the reconstruction error and . In addition, according to business scenarios or environmental requirements, and Adjustments are made to achieve a balanced adjustment of the reconstruction loss and the KL divergence loss.

[0113] Through the embodiment of the present application, an adaptive adjustment mechanism is introduced into the KL divergence loss, and the weight of the KL divergence loss is dynamically adjusted according to the size of the reconstruction error, so that the model can better adapt to the noise and outliers of the data when processing complex data distribution, realize the adaptive adjustment mechanism, and improve the robustness and reliability of the model. and , dynamically adjust the reconstruction loss and KL divergence loss to achieve the best balance between the model's generation ability and prediction ability, ensuring that the model can maintain a high prediction accuracy and generate a reasonable distribution of latent variables when performing resource prediction.

[0114] In some examples of the embodiments of the present application, the resource allocation optimization network may adopt an adaptive dynamic resource allocation reinforcement learning model.

[0115] More specifically, each state in the state space of the learning model It is expressed by the following formula:

[0116] , formula (16);

[0117] In the formula, Indicates The current resource utilization of the virtual machine group, Indicates Historical resource consumption data of virtual machine groups, n Indicates the number of virtual machine groups. Represents the real-time prediction error of the system.

[0118] Actions in the action space of the reinforcement learning model It is expressed by the following formula:

[0119] , formula (17);

[0120] In the formula, Expressing the n The amount by which resource allocation for a virtual machine group is adjusted.

[0121] For the principle explanation and basic definition of the state space and action space of the reinforcement learning model, please refer to the above combined Figure 2 The description of the example is not repeated here.

[0122] The reward function is expressed as follows:

[0123] , formula (18);

[0124] , formula (19);

[0125] , formula (20);

[0126] , formula (21);

[0127] , formula (22);

[0128] In the formula, Represents the reward function used to evaluate actions The reward value generated for the current state; and It is a tuning parameter used to balance the weight of resource utilization and prediction error in action rewards; Indicates The change in resource utilization of each virtual machine group, which is used to quantify the impact of the current action on resource utilization; Indicates the preset upper limit of virtual machine resource utilization; Represents the change in the system prediction error, which is used to quantify the impact of the current action on the prediction error; Indicates the preset maximum prediction error; and are the initial adjustment parameters, indicating the proportion of resource utilization and prediction error in the reward function under the initial state; Represents the adjustment coefficient, which is used to control the sensitivity of weight adjustment; represents the average resource utilization within the sliding window, represents the size of the sliding window, Indicates The virtual machine group is in Resource utilization at each historical time step; represents the average prediction error within the sliding window, Indicated in The prediction error for each historical time step.

[0129] It should be noted that in the formula corresponding to the above reward function, a sliding window is used to dynamically update the adjustment parameters. and The method uses a sliding window to calculate the recent resource utilization and prediction error, and updates the adjustment parameters based on these indicators. More specifically, by calculating the average resource utilization within the sliding window and the average prediction error , and dynamically adjust the weight parameters accordingly and .

[0130] In this way, by using a sliding window to calculate recent resource utilization and prediction errors, we can ensure that weight adjustments are based on the latest system status and can quickly adapt to different loads and business needs, ensuring that resource allocation adjustments can still match future resource needs in a complex and changing environment.

[0131] In some implementations, the adaptive dynamic resource allocation reinforcement learning model according to this embodiment is used to perform the following processing flow:

[0132] 1) Initialize the reinforcement learning model, including the state ,action , reward function And the weight parameters and .

[0133] 2) At each time step , evaluate the current state , including the current resource utilization of each virtual machine group, historical resource consumption data and system real-time prediction error.

[0134] 3) Based on the current status , select an action To adjust resource allocation, action selection can be done through strategies to achieve.

[0135] 4) Perform the selected action , and observe the execution results, including the change in resource utilization and the change in prediction error .

[0136] 5) According to the reward function Calculate the reward value for the current action.

[0137] 6) Update the system status based on the results of the action .

[0138] 7) Dynamically adjust the average resource utilization and prediction error within the sliding window and .

[0139] 8) Use reinforcement learning algorithms (e.g., deep Q-networks) to optimize the model and update the strategy .

[0140] 9) Repeat the above steps 2)-8) until the preset number of iterations is reached.

[0141] Through the embodiments of the present application, based on the reinforcement learning model, the intelligent agent can adjust the resource allocation of each virtual machine group in real time based on the current system status and historical data to ensure maximum resource utilization. In the weighted reward function, a weighted strategy is used to focus on resource utilization in the reward function to ensure that the system can still operate efficiently under high load conditions. In addition, through an adaptive dynamic adjustment mechanism, the weight parameters in the reward function are adjusted according to the real-time prediction error, prompting the model to pay more attention to prediction correction when the prediction error is large. Thus, by weighting the reward function and balancing the proportion of resource utilization and prediction error, the optimization accuracy of resource allocation is ensured, intelligent decision-making is made, and the level of automated management of different virtual machine resources is improved.

[0142] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of actions combined, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application. In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0143] Figure 5 A structural block diagram of an example of a resource allocation system for an optical communication device based on virtualization technology according to an embodiment of the present application is shown.

[0144] like Figure 5 As shown, the optical communication device resource allocation system 500 based on virtualization technology includes a virtual construction unit 510, a consumption data acquisition unit 520, a resource demand prediction unit 530, a resource demand prediction unit 540, a resource pre-allocation unit 550 and a real-time error acquisition unit 560.

[0145] The virtual construction unit 510 is used to construct multiple virtual machine groups in the optical communication device, each of which is used to perform optical signal processing operations of a corresponding operation type; the operation type includes any one of the following: encoding, decoding, compression, decompression, amplification and error processing.

[0146] The consumption data acquisition unit 520 is used to obtain the resource consumption time series data corresponding to the first preset time period of history of each virtual machine group; the resource consumption time series data includes multiple historical running times and corresponding resource consumption records; the resource types corresponding to the resource consumption records include bandwidth resources, computing resources and storage resources.

[0147] The resource demand prediction unit 530 is used to input the resource consumption time series data corresponding to each virtual machine group into the resource prediction model to determine the first resource demand prediction amount of the virtual machine group corresponding to the second preset time period in the future; the first preset time period is longer than the second preset time period.

[0148] The resource pre-allocation unit 540 is configured to determine the initial allocated resources corresponding to each of the virtual machine groups according to the first resource demand prediction amount of each of the virtual machine groups.

[0149] The real-time error acquisition unit 550 is used to obtain the second resource demand forecast and the real-time resource consumption of each virtual machine group corresponding to the current moment, and determine the system real-time prediction error according to the real-time resource consumption and the second resource demand forecast.

[0150] The target resource allocation unit 560 is used to input each of the initial allocated resources and the system real-time prediction error into a resource allocation optimization network to determine a target allocated resource for each of the virtual machine groups.

[0151] The resource allocation optimization network adopts a reinforcement learning model; the state of the reinforcement learning model is defined by the current resource utilization of each virtual machine group, historical resource consumption data and the system real-time prediction error; the action of the reinforcement learning model is defined by the adjustment range of the allocated resources for each virtual machine group; the reward function of the reinforcement learning model is defined by the optimization degree of resource utilization and prediction error.

[0152] In some embodiments, an embodiment of the present application provides a non-volatile computer-readable storage medium, in which one or more programs including execution instructions are stored, and the execution instructions can be read and executed by an electronic device (including but not limited to a computer, a server, or a network device, etc.) to execute the steps of any of the above-mentioned methods for resource allocation of optical communication devices based on virtualization technology in the present application.

[0153] In some embodiments, the embodiments of the present application also provide a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer performs any step of the above-mentioned method for resource allocation of an optical communication device based on virtualization technology.

[0154] In some embodiments, the embodiments of the present application also provide an electronic device, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the optical communication device resource allocation method based on virtualization technology.

[0155] Figure 6 is a schematic diagram of the hardware structure of an electronic device for executing a resource allocation method for an optical communication device based on virtualization technology provided by another embodiment of the present application, such as Figure 6 As shown, the device includes:

[0156] One or more processors 610 and memory 620, Figure 6 A processor 610 is taken as an example.

[0157] The apparatus for executing the method for allocating resources of an optical communication device based on virtualization technology may further include: an input device 630 and an output device 640 .

[0158] The processor 610, the memory 620, the input device 630 and the output device 640 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0159] The memory 620, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the optical communication device resource allocation method based on virtualization technology in the embodiment of the present application. The processor 610 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 620, that is, the optical communication device resource allocation method based on virtualization technology in the above method embodiment is implemented.

[0160] The memory 620 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 620 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 620 may optionally include a memory remotely arranged relative to the processor 610, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0161] The input device 630 can receive input digital or character information and generate signals related to user settings and function control of the electronic device. The output device 640 can include a display device such as a display screen.

[0162] The one or more modules are stored in the memory 620, and when executed by the one or more processors 610, the optical communication device resource allocation method based on virtualization technology in any of the above method embodiments is executed.

[0163] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present application.

[0164] The electronic devices of the embodiments of the present application exist in various forms, including but not limited to:

[0165] (1) Mobile communication equipment: This type of equipment is characterized by having mobile communication functions and its main purpose is to provide voice and data communications. This type of terminal includes: smart phones, multimedia phones, functional phones, and low-end phones.

[0166] (2) Ultra-mobile personal computer devices: These devices belong to the category of personal computers, have computing and processing functions, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, etc.

[0167] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players, handheld game consoles, e-books, smart toys, and portable car navigation devices.

[0168] (4) Other onboard electronic devices with data interaction functions, such as on-board devices installed in vehicles.

[0169] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0170] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the relevant technology, can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.

[0171] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for allocating resources of an optical communication device based on virtualization technology, comprising: Constructing a plurality of virtual machine groups in an optical communication device, each of the virtual machine groups is used to perform an optical signal processing operation of a corresponding operation type; the operation type includes any one of the following: encoding, decoding, compression, decompression, amplification and error handling; Obtain resource consumption time series data corresponding to a first preset time period in history for each of the virtual machine groups; the resource consumption time series data includes multiple historical running times and corresponding resource consumption records; resource types corresponding to the resource consumption records include bandwidth resources, computing resources, and storage resources; For each of the virtual machine groups, inputting the resource consumption time series data corresponding to the virtual machine group into a resource prediction model to determine a first resource demand prediction amount of the virtual machine group corresponding to a second preset time period in the future; the first preset time period is longer than the second preset time period; Determining the initial allocated resources corresponding to each of the virtual machine groups according to the first resource demand forecast amount of each of the virtual machine groups; Obtaining a second resource demand forecast and a real-time resource consumption of each virtual machine group at the current moment, and determining a system real-time prediction error according to the real-time resource consumption and the second resource demand forecast; Inputting each of the initial allocated resources and the system real-time prediction error into a resource allocation optimization network to determine a target allocated resource for each of the virtual machine groups; The resource allocation optimization network adopts a reinforcement learning model; the state of the reinforcement learning model is defined by the current resource utilization rate of each virtual machine group, historical resource consumption data and the real-time prediction error of the system; the action of the reinforcement learning model is defined by the adjustment range of the allocated resources for each virtual machine group; the reward function of the reinforcement learning model is defined by the optimization degree of resource utilization rate and prediction error; The resource prediction model adopts a temporal variational autoencoder model, which includes an input layer, an encoder and a decoder; The input layer is used to receive resource consumption time series data and convert it into a corresponding input time series matrix : In the formula, , represents the total number of historical time steps, Indicates the number of resource types; The encoder comprises a first LSTM layer, an attention layer, a first fully connected layer, and a latent variable sampling layer; The first LSTM layer is used to extract the time-dependent features of the input time series matrix and output the hidden state matrix : In the formula, is the hidden state matrix Corresponding to The hidden state at the historical time step, The input timing matrix Corresponding to Input data of historical time steps, For the corresponding The hidden state of each historical time step; The attention layer is used to focus on important time steps through the attention mechanism to calculate the context vector : In the formula, For the corresponding The attention weights of the historical time steps, For the corresponding The attention score function for the history time steps, is the transpose of the weight vector of the scoring function, and Represent the hidden state weight matrix and input data weight matrix respectively; Indicates the corresponding The attention score function for the history time steps, represents the exponential sum of the scoring functions over all historical time steps; The first fully connected layer is used to process the context vector , to generate the mean of the latent variable and log variance : In the formula, and Corresponding to and The fully connected layer weight matrix, and Corresponding to and The fully connected layer bias term; The latent variable sampling layer is used to generate Calculate the standard deviation of the latent variable , and use the reparameterization technique to generate Sampling from a standard normal distribution , and generate latent variables : In the formula, represents a random variable that conforms to the standard normal distribution; The decoder comprises a second LSTM layer and a second fully connected layer; The second LSTM layer is used to decode the latent variable , to output the reconstructed time series data hidden state: In the formula, For the reconstruction The hidden state of the future time step, For the reconstruction The hidden state of the future time step; The second fully connected layer is used to process the reconstructed time series data hidden state to generate the resource demand prediction value matrix : In the formula, and Represent the weight matrix and bias term of the second fully connected layer, respectively. Indicated in The resource demand forecast for future time steps; Each state in the state space of the reinforcement learning model It is expressed by the following formula: In the formula, Indicates The current resource utilization of the virtual machine group, Indicates Historical resource consumption data of virtual machine groups, Indicates the number of virtual machine groups. Represents the real-time prediction error of the system; Each action in the action space of the reinforcement learning model It is expressed by the following formula: In the formula, Indicates The adjustment range of resource allocation for each virtual machine group; The reward function is expressed as follows: In the formula, Represents the reward function used to evaluate actions The reward value generated for the current state; and It is a tuning parameter used to balance the weight of resource utilization and prediction error in action rewards; Indicates The change in resource utilization of each virtual machine group, which is used to quantify the impact of the current action on resource utilization; Indicates the preset upper limit of virtual machine resource utilization; Represents the change in the system prediction error, which is used to quantify the impact of the current action on the prediction error; Indicates the preset maximum prediction error; and are the initial adjustment parameters, indicating the proportion of resource utilization and prediction error in the reward function under the initial state; Represents the adjustment coefficient, which is used to control the sensitivity of weight adjustment; represents the average resource utilization within the sliding window, represents the size of the sliding window, Indicates The virtual machine group is in Resource utilization at each historical time step; represents the average prediction error within the sliding window, Indicated in The prediction error for each historical time step.

2. The method according to claim 1, wherein: The optical communication device is an optical transmitter, and accordingly the plurality of virtual machine groups are respectively used to perform optical signal processing operations including the following types of operations: encoding, compression and amplification; or, The optical communication device is an optical receiver, and accordingly the multiple virtual machine groups are respectively used to perform optical signal processing operations including the following types of operations: decoding, decompression, amplification and error processing.

3. The method according to claim 1 or 2, wherein: After inputting each of the initial allocated resources and the system real-time prediction error into a resource allocation optimization network to determine a target allocated resource for each of the virtual machine groups, the method further includes: Obtaining an average resource utilization rate of each virtual machine group corresponding to a third preset time period in history; When it is determined that the average resource utilization rate of the first virtual machine group is greater than a preset overload utilization rate threshold, at least one virtual machine matching the operation type of the first virtual machine group is newly created; When it is determined that the average resource utilization of the second virtual machine group is less than a preset low-load utilization threshold, at least one virtual machine is uninstalled from the second virtual machine group.

4. The method according to claim 1, wherein: The loss function of the resource prediction model is for: In the formula, and Represent the reconstruction loss term and KL divergence loss term respectively, and They represent the weight hyperparameters of the corresponding loss terms respectively; Indicates The weight of each resource type, Indicates the real data corresponding to the data sample Future time steps The value of the resource type. Represents the reconstructed data for the data sample Future time steps The predicted value of each resource type; Represents the latent variable m The standard deviation of the dimension, Represents the latent variable m The mean of the dimensions; represents the adaptive adjustment coefficient, which is dynamically adjusted according to the reconstruction error; is the preset deviation threshold.

5. A resource allocation system for optical communication devices based on virtualization technology, comprising: A virtual construction unit, configured to construct a plurality of virtual machine groups in the optical communication device, each of the virtual machine groups being respectively configured to perform an optical signal processing operation of a corresponding operation type; the operation type comprising any one of the following: encoding, decoding, compression, decompression, amplification and error handling; A consumption data acquisition unit is used to acquire resource consumption time series data corresponding to a first preset time period of history for each of the virtual machine groups; the resource consumption time series data includes a plurality of historical running times and corresponding resource consumption records; resource types corresponding to the resource consumption records include bandwidth resources, computing resources and storage resources; a resource demand prediction unit, configured to input the resource consumption time series data corresponding to each virtual machine group into a resource prediction model, so as to determine a first resource demand prediction amount of the virtual machine group corresponding to a second preset time period in the future; the first preset time period is longer than the second preset time period; A resource pre-allocation unit, configured to determine the initial allocated resources corresponding to each of the virtual machine groups according to the first resource demand forecast of each of the virtual machine groups; A real-time error acquisition unit, configured to acquire a second resource demand forecast amount and a real-time resource consumption amount of each virtual machine group corresponding to the current moment, and determine a system real-time prediction error according to the real-time resource consumption amount and the second resource demand forecast amount; a target resource allocation unit, configured to input each of the initial allocated resources and the system real-time prediction error into a resource allocation optimization network to determine a target allocated resource for each of the virtual machine groups; The resource allocation optimization network adopts a reinforcement learning model; the state of the reinforcement learning model is defined by the current resource utilization rate of each virtual machine group, historical resource consumption data and the real-time prediction error of the system; the action of the reinforcement learning model is defined by the adjustment range of the allocated resources for each virtual machine group; the reward function of the reinforcement learning model is defined by the optimization degree of resource utilization rate and prediction error; The resource prediction model adopts a temporal variational autoencoder model, which includes an input layer, an encoder and a decoder; The input layer is used to receive resource consumption time series data and convert it into a corresponding input time series matrix : In the formula, , represents the total number of historical time steps, Indicates the number of resource types; The encoder comprises a first LSTM layer, an attention layer, a first fully connected layer, and a latent variable sampling layer; The first LSTM layer is used to extract the time-dependent features of the input time series matrix and output the hidden state matrix : In the formula, is the hidden state matrix Corresponding to The hidden state at the historical time step, The input timing matrix Corresponding to Input data of historical time steps, For the corresponding The hidden state of each historical time step; The attention layer is used to focus on important time steps through the attention mechanism to calculate the context vector : In the formula, For the corresponding The attention weights of the historical time steps, For the corresponding The attention score function for the history time steps, is the transpose of the weight vector of the scoring function, and Represent the hidden state weight matrix and input data weight matrix respectively; Indicates the corresponding The attention score function for the history time steps, represents the exponential sum of the scoring functions over all historical time steps; The first fully connected layer is used to process the context vector , to generate the mean of the latent variable and log variance : In the formula, and Corresponding to and The fully connected layer weight matrix, and Corresponding to and The fully connected layer bias term; The latent variable sampling layer is used to generate Calculate the standard deviation of the latent variable , and use the reparameterization technique to generate Sampling from a standard normal distribution , and generate latent variables : In the formula, represents a random variable that conforms to the standard normal distribution; The decoder comprises a second LSTM layer and a second fully connected layer; The second LSTM layer is used to decode the latent variable , to output the reconstructed time series data hidden state: In the formula, For the reconstruction The hidden state of the future time step, For the reconstruction The hidden state of the future time step; The second fully connected layer is used to process the reconstructed time series data hidden state to generate the resource demand prediction value matrix : In the formula, and Represent the weight matrix and bias term of the second fully connected layer, respectively. Indicated in The resource demand forecast for future time steps; Each state in the state space of the reinforcement learning model It is expressed by the following formula: In the formula, Indicates The current resource utilization of the virtual machine group, Indicates Historical resource consumption data of virtual machine groups, Indicates the number of virtual machine groups. Represents the real-time prediction error of the system; Each action in the action space of the reinforcement learning model It is expressed by the following formula: In the formula, Indicates The adjustment range of resource allocation for each virtual machine group; The reward function is expressed as follows: In the formula, Represents the reward function used to evaluate actions The reward value generated for the current state; and It is a tuning parameter used to balance the weight of resource utilization and prediction error in action rewards; Indicates The change in resource utilization of each virtual machine group, which is used to quantify the impact of the current action on resource utilization; Indicates the preset upper limit of virtual machine resource utilization; Represents the change in the system prediction error, which is used to quantify the impact of the current action on the prediction error; Indicates the preset maximum prediction error; and are the initial adjustment parameters, indicating the proportion of resource utilization and prediction error in the reward function under the initial state; Represents the adjustment coefficient, which is used to control the sensitivity of weight adjustment; represents the average resource utilization within the sliding window, represents the size of the sliding window, Indicates The virtual machine group is in Resource utilization at each historical time step; represents the average prediction error within the sliding window, Indicated in The prediction error for each historical time step.