Migration early warning method, device and equipment of virtual machine and computer storage medium
By using a pre-trained virtual machine migration prediction model, predicting the future migration probability of virtual machines based on historical data, solving the problem of long and low accuracy of migration warning in the existing technology, and achieving more efficient and accurate virtual machine migration warning.
Patent Information
- Application Number
- CN202411711859.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-14
AI Technical Summary
The existing virtual machine migration warning method uses data at the current moment to warn, which results in a long process from resource alarm to manual intervention judgment to migration preparation and execution, and the standards of manual judgment are inconsistent, affecting the accuracy of migration results.
By utilizing a pre-trained virtual machine migration prediction model, the migration probability in the future is predicted based on the use of the virtual machine's historical resource, and display the migration probability and historical data that mainly affects the migration probability so that workers can prepare in advance.
Improve the accuracy and efficiency of virtual machine migration, save time, and determine the migration cause through target historical data, improving the reliability of the migration process.
Smart Images

Figure CN119621477A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a migration warning method, device, equipment and computer storage medium for a virtual machine. Background Art
[0002] Virtual machine migration is the process of migrating a virtual machine from one physical host to another. It is usually used to achieve load balancing, fault recovery, and resource optimization. Virtual machine migration can dynamically adjust resource allocation, ensure stable system performance under high load conditions, and prevent overload of a single physical host.
[0003] When a physical host fails or requires maintenance, the virtual machines running on the physical host can be quickly migrated to other healthy physical hosts to minimize service interruption time and ensure business continuity.
[0004] In the prior art, the migration warning method of the virtual machine is that when the current resources of the system reach the preset warning threshold, the system will issue an alarm notification. After receiving the alarm, the operation and maintenance personnel will determine whether the virtual machine needs to be migrated based on experience, and make corresponding migration preparations and operations. However, this method is based on the current data for warning. Since the entire process from resource alarm to manual intervention and judgment, and then to migration preparation and execution may take a long time, and the standards for manual judgment are inconsistent, the accuracy of the result of determining whether to migrate is low. It will affect the operation of the entire system. Summary of the invention
[0005] The present invention provides a migration warning method for a virtual machine, which is used to predict the migration status of the virtual machine in the future and issue a warning based on the predicted migration probability, so that the staff can make accurate preparations in advance, save time, improve the subsequent migration efficiency and the accuracy of the determined migration probability.
[0006] In a first aspect, the present application provides a migration warning method for a virtual machine, the method comprising:
[0007] Obtain historical data corresponding to the virtual machine at specified intervals; wherein the historical data includes historical data of the virtual machine within the specified historical duration and historical data of the physical host where the virtual machine is located within the specified historical duration; the historical data is used to represent historical resource usage of the virtual machine or the physical host, and the specified historical duration is greater than the specified duration;
[0008] Input the historical data into a pre-trained virtual machine migration prediction model to obtain the migration probability of the virtual machine within the next specified time period and target historical data, wherein the target historical data is the historical data within the specified historical time period that mainly affects the migration probability;
[0009] The migration probability of the virtual machine within the next specified time period and the target historical data are displayed.
[0010] In the embodiment of the present application, the migration probability of the virtual machine in the next specified time period is predicted by using a pre-trained virtual machine migration prediction model based on the historical resource usage corresponding to the virtual machine, and the migration probability of the virtual machine in the next execution time period and the target historical data that mainly affects the migration probability are obtained. Therefore, in the embodiment of the present application, the migration situation of the virtual machine in the future period is predicted, and an early warning is issued based on the predicted migration probability, so that the staff can make accurate preparations in advance and save time, and the reason for migration can be determined in combination with the target historical data, so as to better migrate, improve the subsequent migration efficiency and the accuracy of the determined migration probability.
[0011] In a possible implementation, the virtual machine migration prediction model includes a coding layer, a feature extraction layer, and an output layer;
[0012] The inputting of the historical data into a pre-trained virtual machine migration prediction model to obtain the migration probability of the virtual machine within the next specified time period and the target historical data includes:
[0013] Using the coding layer to encode the historical data to obtain encoded historical data;
[0014] Using the feature extraction layer to extract features from the encoded historical data to obtain target features and the target historical data;
[0015] The target feature is normalized using the output layer to obtain the migration probability.
[0016] In a possible implementation, the feature extraction layer includes a long short-term memory network LSTM model, an attention mechanism, and a fully connected layer;
[0017] The step of extracting features from the encoded historical data using the feature extraction layer to obtain target features and the target historical data includes:
[0018] Using the LSTM model to extract features from the encoded historical data to obtain a first feature;
[0019] Using the attention mechanism to perform a linear transformation on the feature data to obtain a second feature and the target historical data;
[0020] The second feature is fully connected using the fully connected layer to obtain the target feature.
[0021] In a possible implementation manner, the using the encoding layer to encode the historical data to obtain the encoded historical data includes:
[0022] The historical data is encoded using a word2vec model to obtain the encoded historical data.
[0023] In a possible implementation, the using the output layer to perform a normalization operation on the target feature to obtain the migration probability includes:
[0024] The target feature is normalized using a sigmoid function to obtain the migration probability.
[0025] In a possible implementation, the historical data includes at least one of central processing unit CPU utilization, memory utilization, disk utilization, network utilization, names of key processes used during runtime, and log information corresponding to key runtime logs.
[0026] In the embodiment of the present application, the migration probability of the virtual machine in the future time period is predicted through multi-dimensional data, thereby improving the accuracy of the determined migration probability.
[0027] In a second aspect, the present application provides a migration warning device for a virtual machine, the device comprising:
[0028] An acquisition module, used to acquire historical data corresponding to the virtual machine at specified intervals; wherein the historical data includes historical data of the virtual machine within the specified historical duration and historical data of the physical host where the virtual machine is located within the specified historical duration; the historical data is used to represent historical resource usage of the virtual machine or the physical host, and the specified historical duration is greater than the specified duration;
[0029] A migration probability determination module, used to input the historical data into a pre-trained virtual machine migration prediction model to obtain the migration probability of the virtual machine within the next specified time period and target historical data, wherein the target historical data is the historical data within the specified historical time period that mainly affects the migration probability;
[0030] The migration probability display module is used to display the migration probability of the virtual machine within the next specified time period and the target historical data.
[0031] In a possible implementation, the virtual machine migration prediction model includes a coding layer, a feature extraction layer, and an output layer;
[0032] The migration probability determination module is specifically used to:
[0033] Using the coding layer to encode the historical data to obtain encoded historical data;
[0034] Using the feature extraction layer to extract features from the encoded historical data to obtain target features and the target historical data;
[0035] The target feature is normalized using the output layer to obtain the migration probability.
[0036] In a possible implementation, the feature extraction layer includes a long short-term memory network LSTM model, an attention mechanism, and a fully connected layer;
[0037] The migration probability determination module is further used for:
[0038] Using the LSTM model to extract features from the encoded historical data to obtain a first feature;
[0039] Using the attention mechanism to perform a linear transformation on the feature data to obtain a second feature and the target historical data;
[0040] The second feature is fully connected using the fully connected layer to obtain the target feature.
[0041] In a possible implementation manner, the migration probability determination module is further configured to:
[0042] The historical data is encoded using a word2vec model to obtain the encoded historical data.
[0043] In a possible implementation manner, the migration probability determination module is further configured to:
[0044] The target feature is normalized using a sigmoid function to obtain the migration probability.
[0045] In a possible implementation, the historical data includes at least one of central processing unit CPU utilization, memory utilization, disk utilization, network utilization, names of key processes used during runtime, and log information corresponding to key logs used during runtime.
[0046] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the early warning method for virtual machine migration when executing the computer program.
[0047] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-mentioned early warning method for virtual machine migration of the present application.
[0048] In the fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which is stored in a computer-readable storage medium; when the processor of the memory access device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the memory access device executes the steps in the above-mentioned virtual machine migration early warning method of the present application.
[0049] For each aspect from the second to the fifth aspect and the technical effects that may be achieved by each aspect, please refer to the technical effects that can be achieved by various possible solutions in the first aspect, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0051] Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application;
[0052] Figure 2 One of the flow diagrams of a migration warning method for a virtual machine provided in an embodiment of the present application;
[0053] Figure 3 A schematic diagram of the structure of a virtual machine migration prediction model provided in an embodiment of the present application;
[0054] Figure 4 A schematic diagram of the structure of a sample provided in an embodiment of the present application;
[0055] Figure 5 A second schematic diagram of a migration warning process of a virtual machine provided in an embodiment of the present application;
[0056] Figure 6 A schematic diagram of a migration warning device for a virtual machine provided in an embodiment of the present application;
[0057] Figure 7 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solution and advantages of the present application more clear, the present application will be further described in detail below in conjunction with the accompanying drawings. The specific operation method in the method embodiment can also be applied to the device embodiment or the system embodiment.
[0059] In the description of this application, "multiple" is understood to be "at least two". "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone. A is connected to B, which can represent two situations: A is directly connected to B and A is connected to B through C. In addition, in the description of this application, words such as "first" and "second" are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.
[0060] In the prior art, the migration warning method of the virtual machine is that when the current resources of the system reach the preset warning threshold, the system will issue an alarm notification. After receiving the alarm, the operation and maintenance personnel will determine whether the virtual machine needs to be migrated based on experience, and make corresponding migration preparations and operations. However, this method is based on the current data for warning. Since the entire process from resource alarm to manual intervention and judgment, and then to migration preparation and execution may take a long time, and the standards for manual judgment are inconsistent, the accuracy of the result of determining whether to migrate is low. It will affect the operation of the entire system.
[0061] In this regard, the embodiment of the present application provides a migration warning method for a virtual machine, which predicts the migration probability of the virtual machine within the next specified time period based on the historical resource usage corresponding to the virtual machine by using a pre-trained virtual machine migration prediction model, and obtains the migration probability of the virtual machine within the next execution time period. Therefore, the migration situation of the virtual machine in the future period is predicted in the embodiment of the present application, and an early warning is issued based on the predicted migration probability, so that the staff can make accurate preparations in advance, save time, and improve the subsequent migration efficiency and the accuracy of the determined migration probability.
[0062] like Figure 1 As shown, an application scenario of a migration warning method for a virtual machine includes a server 110 and a terminal device 120 .
[0063] In a possible application scenario, the server 110 obtains historical data corresponding to the virtual machine at specified time intervals; wherein the historical data includes historical data of the virtual machine within the specified historical time interval and historical data of the physical host where the virtual machine is located within the specified historical time interval; the historical data is used to represent the historical resource usage of the virtual machine or the physical host, and the specified historical time interval is greater than the specified time interval; then the server 110 inputs the historical data into a pre-trained virtual machine migration prediction model to obtain the migration probability of the virtual machine within the next specified time interval and the target historical data, wherein the target historical data is the historical data in the historical data within the specified historical time interval that mainly affects the migration probability; the server 110 sends the migration probability and the target historical data to the terminal device 120, and after receiving the migration probability and the target historical data, the terminal device 120 displays the migration probability of the virtual machine within the next specified time interval and the target historical data.
[0064] in, Figure 1 The server 110 and the terminal device 120 can exchange information through a communication network, wherein the communication mode adopted by the communication network can be divided into a wireless communication mode or a wired communication mode.
[0065] Exemplarily, the server 110 can access the network through cellular mobile communication technology to communicate with the terminal device 120, wherein the cellular mobile communication technology, for example, includes the fifth generation mobile communication (5th Generation Mobile Networks, 5G) technology.
[0066] Optionally, the server 110 may access the network and communicate with the terminal device 120 via short-range wireless communication, wherein the short-range wireless communication method, for example, includes Wireless Fidelity (Wi-Fi) technology.
[0067] Among them, the description in this application only details a single server 110 and a single terminal device 120, but those skilled in the art should understand that the server 110 and the terminal device 120 shown are intended to represent the operations of the server 110 and the terminal device 120 involved in the technical solution of this application. It does not imply any limitation on the number, type or location of the server 110 and the terminal device 120. It should be noted that if additional modules are added to the illustrated environment or individual modules are removed therefrom, the underlying concepts of the exemplary embodiments of this application will not be changed.
[0068] It should be noted that the early warning method for virtual machines proposed in this application is not only applicable to Figure 1 The application scenario shown is also applicable to any early warning device with a virtual machine.
[0069] The following describes the data encryption method in an exemplary implementation of the present application in combination with the application scenarios described above and with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate understanding of the methods and principles of the present application, and the implementation of the present application is not limited in this regard.
[0070] The present application is further described in detail below in conjunction with the accompanying drawings. Figure 2 FIG. 1 is a flow chart of a migration warning method for a virtual machine provided in an embodiment of the present application. The specific implementation process of the method is as follows:
[0071] Step 201: Obtain historical data corresponding to a virtual machine at specified time intervals; wherein the historical data includes historical data of the virtual machine within the specified historical time interval and historical data of the physical host where the virtual machine is located within the specified historical time interval; the historical data is used to represent historical resource usage of the virtual machine or the physical host, and the specified historical time interval is greater than the specified time interval;
[0072] The historical data in the embodiment of the present application includes at least one of the central processing unit CPU utilization, memory utilization, disk utilization, network utilization, the name of the key process used at runtime, and log information corresponding to the key log used at runtime.
[0073] In the embodiment of the present application, multiple key processes and multiple key logs are pre-set.
[0074] The historical data of the virtual machine in the embodiment of the present application within the specified historical duration includes the historical data corresponding to each time point of the virtual machine within the specified historical duration. And the historical data of the physical host where the virtual machine is located within the specified historical duration includes the historical data corresponding to each time point of the physical host where the virtual machine is located within the specified historical duration.
[0075] The historical data described above is only used for illustration and does not limit the historical data in the embodiments of the present application. The historical data in the embodiments of the present application can be set according to specific actual conditions.
[0076] It should be noted that the specified duration and historical specified duration in the embodiment of the present application can be set according to specific actual conditions, and the embodiment of the present application does not limit the specific values of the specified duration and historical specified duration.
[0077] Step 202: inputting the historical data into a pre-trained virtual machine migration prediction model to obtain the migration probability of the virtual machine within the next specified time period and target historical data, wherein the target historical data is the historical data in the specified historical time period that mainly affects the migration probability;
[0078] Next, the method of determining the migration probability in step 202 in the embodiment of the present application is described in conjunction with the structure of the virtual machine migration prediction model. Figure 3 As shown in the figure, it is a structural diagram of the virtual machine migration prediction model. Figure 3 As can be seen from the figure, the model includes an encoding layer 301, a feature extraction layer 302 and an output layer 303.
[0079] in:
[0080] The encoding layer 301 is used to encode the historical data to obtain the encoded historical data; the feature extraction layer 302 is used to extract features from the encoded historical data to obtain target features and the target historical data; the output layer 303 is used to normalize the target features to obtain the migration probability.
[0081] The following describes each layer in the model in the embodiment of the present application. In the encoding layer 301 in the embodiment of the present application, the word2vec model is used to encode the historical data to obtain the encoded historical data. And in the output layer 303 in the embodiment of the present application, the sigmoid function is used to normalize the target feature to obtain the migration probability.
[0082] from Figure 3 It can be seen that the feature extraction layer 302 in the embodiment of the present application includes a long short-term memory network LSTM model 3021, an attention mechanism 3022 and a fully connected layer 3023. Among them: the LSTM model 3021 is used to extract features from the encoded historical data to obtain a first feature; the attention mechanism 3022 is used to perform a linear transformation on the feature data to obtain a second feature and the target historical data; the fully connected layer 3023 is used to perform a full connection operation on the second feature to obtain the target feature.
[0083] The attention mechanism in the embodiment of the present application calculates the relevance score between the elements in each historical data in the sequence corresponding to the input historical data (CPU utilization, memory utilization, disk utilization, network utilization, the name of the key process used at runtime, and the log information corresponding to the key log at runtime) and the current task, and then performs weighted summation on the input sequence according to the relevance score to obtain the weighted target feature. In addition to outputting the target feature, the embodiment of the present application also outputs the target historical data whose relevance score is greater than the specified threshold.
[0084] In the embodiment of the present application, the attention mechanism for obtaining target features and determining correlation scores belongs to the prior art and will not be described in detail in the embodiment of the present application.
[0085] Step 203: Display the migration probability of the virtual machine within the next specified time period and the target historical data.
[0086] In the embodiment of the present application, after the migration probability within the next specified time period is displayed, the technician can determine whether to migrate the virtual machine based on the migration probability and obtain the migration reason based on the target historical data.
[0087] Next, the training method of the virtual machine migration prediction model in the embodiment of the present application is introduced.
[0088] First, you need to build training samples, which can be used to collect relevant data for the same virtual machine at different time nodes through system monitoring, log file collection and filtering, process monitoring, etc. (that is, collect CPU utilization, memory utilization, disk utilization, network utilization, pre-set key process names, and pre-set key logs corresponding to log information). Collect data once every specified time period. Every N pieces of data information constitute a time series of data, which is a sample, and each sample is labeled (that is, the migration probability corresponding to the data). The schematic diagram of the specific sample format is as follows: Figure 4 As shown, from Figure 4 It can be seen that each sample includes N pieces of data, and the sample includes the label corresponding to the sample.
[0089] Secondly, the training samples are encoded. Since the samples contain non-numeric data such as process information and log information, these data need to be encoded. The encoding method in the embodiment of the present application can use the word2vec model for encoding.
[0090] The format of a single data item in the sample in the embodiment of the present application is [ <time>,of, <src>,αvm,αhost,μvm,μhost,δvm,δhost,ηvm,ηhost, <prs>,P1,P2… <pad> , <log><h2 style=";text-align:left;direction:ltr">L1, L2…<h2 style=";text-align:left;direction:ltr"> <pad>].in, <time>Represents a timestamp, and ti is the specific value corresponding to the timestamp. <src>The information after occupies 8 bits, which are the virtual machine CPU utilization αvm, the host CPU utilization αhost, the virtual machine memory utilization μvm, the host memory utilization μhost, the virtual machine disk utilization δvm, the host disk utilization δhost, the virtual machine network utilization ηvm, and the host network utilization ηhost. <prs>Followed by the key process names P1, P2…Pn. <log>The following are the key log information L1, L2…Lm.
[0091] In the embodiment of the present application, the dimension of a single data is fixed, the number of key processes n and the log length m take fixed values, the excess part is truncated, and the insufficient part is used <pad>Fill in the identifier to complete. In the embodiment of the present application, before encoding, it is necessary to convert the separation flag, key process name, and key log information into corresponding indexes through a pre-set word list.
[0092] In the embodiment of the present application, each encoded training sample is divided into a training set, a validation set and a test set.
[0093] The training of the virtual machine migration prediction model in the embodiment of the present application is introduced below in combination with the training set, the validation set and the test set:
[0094] After the virtual machine migration prediction model is trained for a specified number of times using the training set, a trained virtual machine migration prediction model is obtained. The adjusted virtual machine migration prediction model is tested using the test set. If the test passes, the trained virtual machine migration prediction model is determined as the pre-trained virtual machine migration prediction model. If the test fails, the verification sample in the verification set is input into the trained virtual machine migration prediction model to obtain a predicted migration probability; a loss value is obtained based on the predicted migration probability and the actual migration probability in the label corresponding to the verification sample; if the loss value is greater than a specified threshold, the model parameters of the trained virtual machine migration prediction model are adjusted. After obtaining the adjusted virtual machine migration prediction model, the step of inputting the verification sample in the verification set into the trained virtual machine migration prediction model to obtain the predicted migration probability is returned until the loss value is no greater than the specified threshold, then the step ends, and the adjusted virtual machine migration prediction model is determined as the pre-trained virtual machine migration prediction model. Among them, the loss value can be obtained by formula (1):
[0095]
[0096] y i is the true migration probability of the i-th sample, is the predicted migration probability of the model for the i-th sample, n is the total number of samples of the validation sample, and L is the loss value.
[0097] In the embodiment of the present application, during the virtual machine migration prediction model process, the model will also output data that affects the predicted migration probability, but the model is not trained based on the data, so the data is not mentioned during the model training process.
[0098] In order to further understand the method in this application, Figure 5 FIG. 1 is a flow chart of a virtual machine migration early warning method in the present application, which may include the following steps:
[0099] Step 501: Obtain historical data corresponding to a virtual machine at specified time intervals; wherein the historical data includes historical data of the virtual machine within the specified historical time interval and historical data of the physical host where the virtual machine is located within the specified historical time interval; the historical data is used to represent historical resource usage of the virtual machine or the physical host, and the specified historical time interval is greater than the specified time interval;
[0100] Step 502: Encoding the historical data using the word2vec model to obtain the encoded historical data;
[0101] Step 503: Using the LSTM model to extract features from the encoded historical data to obtain a first feature;
[0102] Step 504: using the attention mechanism to perform a linear transformation on the feature data to obtain a second feature and the target historical data;
[0103] Step 505: using the fully connected layer to perform a fully connected operation on the second feature to obtain the target feature;
[0104] Step 506: using a sigmoid function to normalize the target feature to obtain the migration probability;
[0105] Step 507: Display the migration probability of the virtual machine within the next specified time period and the target historical data.
[0106] Based on the same inventive concept, the present application also provides a virtual machine migration warning device, see Figure 6 , the device 600 comprises:
[0107] The acquisition module 601 is used to acquire historical data corresponding to the virtual machine at specified intervals; wherein the historical data includes historical data of the virtual machine within the specified historical duration and historical data of the physical host where the virtual machine is located within the specified historical duration; the historical data is used to represent the historical resource usage of the virtual machine or the physical host, and the specified historical duration is greater than the specified duration;
[0108] A migration probability determination module 602 is used to input the historical data into a pre-trained virtual machine migration prediction model to obtain the migration probability of the virtual machine within the next specified time period and target historical data, wherein the target historical data is the historical data within the specified historical time period that mainly affects the migration probability;
[0109] The migration probability display module 603 is used to display the migration probability of the virtual machine within the next specified time period and the target historical data.
[0110] In a possible implementation, the virtual machine migration prediction model includes a coding layer, a feature extraction layer, and an output layer;
[0111] The migration probability determination module 603 is specifically used to:
[0112] Using the coding layer to encode the historical data to obtain encoded historical data;
[0113] Using the feature extraction layer to extract features from the encoded historical data to obtain target features and the target historical data;
[0114] The target feature is normalized using the output layer to obtain the migration probability.
[0115] In a possible implementation, the feature extraction layer includes a long short-term memory network LSTM model, an attention mechanism, and a fully connected layer;
[0116] The migration probability determination module 603 is further used for:
[0117] Using the LSTM model to extract features from the encoded historical data to obtain a first feature;
[0118] Using the attention mechanism to perform a linear transformation on the feature data to obtain a second feature and the target historical data;
[0119] The second feature is fully connected using the fully connected layer to obtain the target feature.
[0120] In a possible implementation manner, the transition probability determination module 603 is further configured to:
[0121] The historical data is encoded using a word2vec model to obtain the encoded historical data.
[0122] In a possible implementation manner, the transition probability determination module 603 is further configured to:
[0123] The target feature is normalized using a sigmoid function to obtain the migration probability.
[0124] In a possible implementation, the historical data includes at least one of central processing unit CPU utilization, memory utilization, disk utilization, network utilization, the name of a key process used during runtime, and log information corresponding to a key log during runtime.
[0125] Based on the same inventive concept, an electronic device is also provided in the embodiment of the present application. The electronic device can realize the function of the migration warning device of the aforementioned virtual machine, refer to Figure 7 , the electronic device comprises:
[0126] At least one processor 701, and a memory 702 connected to the at least one processor 701. The specific connection medium between the processor 701 and the memory 702 is not limited in the embodiment of the present application. Figure 7 In the example, the processor 701 and the memory 702 are connected via a bus 700. Figure 7 The connections between other components are shown in bold lines, and are not intended to be limiting. The bus 700 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, Figure 7 Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 701 can also be called a controller, and there is no limitation on the name.
[0127] In the embodiment of the present application, the memory 702 stores instructions that can be executed by at least one processor 701. The at least one processor 701 can execute the migration warning method of the virtual machine discussed above by executing the instructions stored in the memory 702. The processor 701 can implement Figure 6 The functions of each module in the device shown.
[0128] Among them, the processor 701 is the control center of the device, and can use various interfaces and lines to connect the various parts of the entire control device. By running or executing instructions stored in the memory 702 and calling data stored in the memory 702, the various functions of the device and process data, the device can be monitored as a whole.
[0129] In one possible design, the processor 701 may include one or more processing units, and the processor 701 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 701. In some embodiments, the processor 701 and the memory 702 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.
[0130] Processor 701 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the migration warning method of the virtual machine disclosed in the embodiment of the present application can be directly embodied as a hardware processor execution, or a combination of hardware and software modules in the processor.
[0131] The memory 702 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 702 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 702 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 702 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0132] By programming the processor 701, the code corresponding to the migration warning method of the virtual machine introduced in the above embodiment can be fixed into the chip, so that the chip can execute the code when running. Figure 2 The steps of the early warning method for a virtual machine in the embodiment shown are as follows: How to design and program the processor 701 is a technology well known to those skilled in the art and will not be described in detail here.
[0133] An embodiment of the present application also provides a computer-readable storage medium that stores computer-executable instructions required to execute the above-mentioned processor, which includes a program required to execute the above-mentioned processor.
[0134] In some possible implementations, various aspects of the virtual machine migration warning method provided in the present application can also be implemented in the form of a program product, which includes a program code. When the above-mentioned program product is run on an electronic device, the above-mentioned program code is used to enable the above-mentioned electronic device to execute the steps of the virtual machine migration warning method according to various exemplary embodiments of the present application described above in this specification.
[0135] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0136] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (apparatus), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0137] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0138] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0139] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0140] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.< / pad> < / log> < / prs> < / src> < / time> < / pad> < / log> < / pad> < / prs> < / src> < / time>
Claims
1. A migration warning method for a virtual machine, characterized in that: The method comprises: Obtain historical data corresponding to the virtual machine at specified intervals; wherein the historical data includes historical data of the virtual machine within the specified historical duration and historical data of the physical host where the virtual machine is located within the specified historical duration; the historical data is used to represent historical resource usage of the virtual machine or the physical host, and the specified historical duration is greater than the specified duration; Input the historical data into a pre-trained virtual machine migration prediction model to obtain the migration probability of the virtual machine within the next specified time period and target historical data, wherein the target historical data is the historical data within the specified historical time period that mainly affects the migration probability; The migration probability of the virtual machine within the next specified time period and the target historical data are displayed.
2. The method according to claim 1, characterized in that The virtual machine migration prediction model includes a coding layer, a feature extraction layer and an output layer; The inputting of the historical data into a pre-trained virtual machine migration prediction model to obtain the migration probability of the virtual machine within the next specified time period and the target historical data includes: Using the coding layer to encode the historical data to obtain encoded historical data; Using the feature extraction layer to extract features from the encoded historical data to obtain target features and the target historical data; The target feature is normalized using the output layer to obtain the migration probability.
3. The method according to claim 2, characterized in that The feature extraction layer includes a long short-term memory network LSTM model, an attention mechanism and a fully connected layer; The step of extracting features from the encoded historical data using the feature extraction layer to obtain target features and the target historical data includes: Using the LSTM model to extract features from the encoded historical data to obtain a first feature; Using the attention mechanism to perform a linear transformation on the feature data to obtain a second feature and the target historical data; The second feature is fully connected using the fully connected layer to obtain the target feature.
4. The method according to claim 2, characterized in that: The using the coding layer to encode the historical data to obtain the encoded historical data includes: The historical data is encoded using a word2vec model to obtain the encoded historical data.
5. The method according to claim 2, characterized in that: The using the output layer to perform a normalization operation on the target feature to obtain the migration probability includes: The target feature is normalized using a sigmoid function to obtain the migration probability.
6. The method according to any one of claims 1 to 5, characterized in that: The historical data includes at least one of central processing unit (CPU) utilization, memory utilization, disk utilization, network utilization, names of key processes used during runtime, and log information corresponding to key logs during runtime.
7. A migration warning device for a virtual machine, characterized in that: The device comprises: An acquisition module, used to acquire historical data corresponding to the virtual machine at specified intervals; wherein the historical data includes historical data of the virtual machine within the specified historical duration and historical data of the physical host where the virtual machine is located within the specified historical duration; the historical data is used to represent historical resource usage of the virtual machine or the physical host, and the specified historical duration is greater than the specified duration; A migration probability determination module, used to input the historical data into a pre-trained virtual machine migration prediction model to obtain the migration probability of the virtual machine within the next specified time period and target historical data, wherein the target historical data is the historical data within the specified historical time period that mainly affects the migration probability; The migration probability display module is used to display the migration probability of the virtual machine within the next specified time period and the target historical data.
8. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to implement the method according to any one of claims 1 to 6 when executing a computer program stored in the memory.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is enabled to execute the method according to any one of claims 1 to 6.
Citation Information
Cited By
Virtual machine state intelligent analysis method
CN119917382A