Virtual machine performance detection method, representation model training method, device and equipment
By obtaining performance data before and after virtual machine migration and extracting cycle characteristics and trend characteristics, the problem of low accuracy of performance detection results after virtual machine migration in the existing technology is solved, and more accurate performance abnormality detection is achieved.
Patent Information
- Application Number
- CN202311497915.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-09
- Publication Date
- 2025-05-09
AI Technical Summary
The prior art is difficult to accurately detect performance abnormalities after virtual machines are migrated, resulting in low accuracy of detection results.
By obtaining the performance data of the virtual machine, we determine the periodic characteristics and trend characteristics before and after the migration, and determine the performance detection results based on these characteristics to improve the accuracy of the detection results.
By extracting the periodic characteristics and trend characteristics before and after virtual machine migration, performance abnormalities after virtual machine migration can be detected more accurately, improving the accuracy of detection results.
Smart Images

Figure CN119960897A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a virtual machine performance detection method, a characterization model training method, a device and equipment. Background Art
[0002] A virtual machine can be installed in a server. Based on actual application requirements, a virtual machine can be hot migrated from one server to another. Hot migration refers to migration without stopping the server. Since hot migration may cause the performance of the virtual machine to fluctuate, it is necessary to compare the performance of the virtual machine before and after the migration to detect whether the performance of the virtual machine after the migration is abnormal.
[0003] In the related art, a model can be used to detect performance anomalies in the performance data before and after the virtual machine migration. However, in the above method, the model can only be compared based on the performance data before and after the migration, resulting in low accuracy in determining the performance detection results. Summary of the invention
[0004] Multiple aspects of the present application provide a virtual machine performance detection method, a characterization model training method, an apparatus and a device to improve the accuracy of determining performance detection results.
[0005] In a first aspect, an embodiment of the present application provides a virtual machine performance detection method, comprising:
[0006] Acquire performance data of the virtual machine, the performance data including performance values of multiple performances of the virtual machine before and after migration;
[0007] Determining a first period characteristic and a first trend characteristic of the performance data before the migration, and a second period characteristic and a second trend characteristic of the performance data after the migration;
[0008] A performance detection result of the virtual machine after migration is determined according to the first period feature, the second period feature, the first trend feature, and the second trend feature.
[0009] In a possible implementation manner, determining the first period characteristic and the first trend characteristic of the performance data before the migration, and the first period characteristic and the second trend characteristic of the performance data after the migration includes:
[0010] Preprocessing the performance data to obtain preprocessed data;
[0011] Performing time series decomposition processing on the preprocessed data to obtain target cycle data and target trend data of the performance data;
[0012] The target periodic data is processed by a characterization model to obtain the first periodic feature and the second periodic feature, and the target trend data is processed by the characterization model to obtain the first trend feature and the second trend feature.
[0013] In a possible implementation, the characterization model includes a period characterization model; and processing the target periodic data by using the characterization model to obtain the first periodic feature and the second periodic feature includes:
[0014] Segmenting the target periodic data according to the migration time of the virtual machine to obtain first periodic data before the migration and second periodic data after the migration;
[0015] Processing the first periodic data and the second periodic data by using the periodic characterization model to obtain a first periodic sequence corresponding to before the migration and a second periodic sequence corresponding to after the migration;
[0016] The first periodic sequence is pooled to obtain the first periodic feature, and the second periodic sequence is pooled to obtain the second periodic feature.
[0017] In a possible implementation, the characterization model includes a trend characterization model; and the target trend data is processed by the characterization model to obtain the first trend feature and the second trend feature, including:
[0018] Segmenting the target trend data according to the migration time of the virtual machine to obtain first trend data before the migration and second trend data after the migration;
[0019] Processing the first trend data and the second trend data by using the trend characterization model to obtain a first trend sequence corresponding to before the migration and a second trend sequence corresponding to after the migration;
[0020] The first trend sequence is pooled to obtain the first trend feature, and the second trend sequence is pooled to obtain the second trend feature.
[0021] In a possible implementation, performing time series decomposition processing on the preprocessed data to obtain target cycle data and target trend data of the performance data includes:
[0022] performing a period extraction process on the preprocessed data to determine at least one period length in the preprocessed data;
[0023] According to the at least one cycle length, performing at least one data extraction process on the pre-processed data until the remaining residual data after the data extraction process converges, determining the cycle data extracted by the data extraction process as the target cycle data, and determining the extracted trend data as the target trend data, wherein the data extraction process is used to extract the cycle data and the trend data;
[0024] The timing decomposition process includes the period extraction process and the data extraction process.
[0025] In a possible implementation, performing period extraction processing on the preprocessed data to determine at least one period length in the preprocessed data includes:
[0026] Performing HP filtering on the pre-processed data to obtain filtered data;
[0027] Performing maximum cross wavelet transform processing on the filtered data to obtain time-frequency data corresponding to the preprocessed data;
[0028] The time-frequency data is verified by using an autocorrelation function ACF to obtain the at least one cycle length.
[0029] In a possible implementation manner, the first periodic feature includes a first multi-performance periodic feature and a plurality of first single-performance periodic features corresponding to the plurality of performances;
[0030] The second periodic characteristics include a second multi-performance periodic characteristic and a plurality of second single-performance periodic characteristics corresponding to the plurality of performances;
[0031] The first trend feature includes a first multiple performance trend feature and a plurality of first single performance trend features corresponding to the plurality of performances;
[0032] The second trend feature includes a second multiple performance trend feature and a plurality of second single performance trend features corresponding to the plurality of performances;
[0033] Among them, the multi-performance periodic characteristics are used to indicate the periodic characteristics of the multiple performances, the single-performance periodic characteristics are used to indicate the periodic characteristics of a single performance, the multi-performance trend characteristics are used to indicate the trend characteristics of the multiple performances, and the single-performance trend characteristics are used to indicate the trend characteristics of a single performance.
[0034] In a possible implementation, determining a performance detection result of the virtual machine after migration according to the first period feature, the second period feature, the first trend feature, and the second trend feature includes:
[0035] determining a multi-performance detection result according to the first multi-performance period feature, the second multi-performance period feature, the first multi-performance trend feature, and the second multi-performance trend feature;
[0036] For any one performance, determine a single performance detection result corresponding to the performance according to a first single performance cycle feature corresponding to the performance, a second single performance cycle feature corresponding to the performance, a first single performance trend feature corresponding to the performance, and a second single performance trend feature corresponding to the performance;
[0037] The performance test result is determined according to the multiple performance test results and the single performance test result corresponding to each performance, wherein the performance test result includes the multiple performance test results and the single performance test result corresponding to each performance.
[0038] In a possible implementation, determining a single performance detection result corresponding to the performance according to a first single performance cycle feature corresponding to the performance, a second single performance cycle feature corresponding to the performance, a first single performance trend feature corresponding to the performance, and a second single performance trend feature corresponding to the performance includes:
[0039] Determining a target detection method and a fluctuation ratio threshold corresponding to the performance according to historical complaint data of the virtual machine;
[0040] Processing the first single performance cycle feature and the second single performance cycle feature by the target detection method to obtain a first fluctuation ratio;
[0041] Processing the first single performance trend feature and the second single performance trend feature by the target detection method to obtain a second fluctuation ratio;
[0042] If the first fluctuation ratio and the second fluctuation ratio are respectively less than or equal to the fluctuation ratio threshold, determining that the single performance detection result is normal;
[0043] If one of the first fluctuation ratio and the second fluctuation ratio has a fluctuation ratio greater than the fluctuation ratio threshold, it is determined that the single performance detection result is a detection abnormality.
[0044] In a second aspect, an embodiment of the present application provides a representation model training method, comprising:
[0045] Obtaining N sample performance data of N sample virtual machines, wherein the sample performance data includes performance values of multiple performances of the sample virtual machines before and after migration, where N is an integer greater than 1;
[0046] Performing time series decomposition processing on the N sample performance data to obtain N periodic data and N trend data;
[0047] Processing the N periodic data or the N trend data by using an initial model to obtain 2N instance data, where the instance data is periodic data or trend data, and the 2N instance data includes N pre-migration instance data and N post-migration instance data;
[0048] According to the sample virtual machines corresponding to the instance data, a plurality of positive sample pairs and a plurality of negative sample pairs are determined in the 2N instance data, wherein the positive sample pairs include the instance data before migration and the instance data after migration, and the instance data in the positive sample pairs correspond to the same sample virtual machine, and the negative sample pairs include two instance data, and the two instance data correspond to different sample virtual machines;
[0049] The multiple positive sample pairs and the multiple negative sample pairs are subjected to comparative learning to update the model parameters of the initial model until a characterization model is obtained, wherein the characterization model is used to determine the periodic characteristics of the target periodic data, or to determine the trend characteristics of the target trend data.
[0050] In a possible implementation, the N periodic data or the N trend data are processed by an initial model to obtain 2N instance data, including:
[0051] According to the migration time of the sample virtual machine, the N periodic data are segmented to obtain 2N periodic data;
[0052] According to the migration time of the sample virtual machine, the N trend data are segmented to obtain 2N trend data;
[0053] The 2N periodic data are processed by the initial model to obtain the 2N instance data; or, the 2N trend data are processed by the initial model to obtain the 2N instance data.
[0054] In a possible implementation, performing comparative learning on the multiple positive sample pairs and the multiple negative sample pairs to update the model parameters of the initial model until the model is characterized includes:
[0055] Performing pooling processing on the multiple positive sample pairs to obtain multiple pooled positive sample pairs;
[0056] Performing pooling processing on the multiple negative sample pairs to obtain multiple pooled negative sample pairs;
[0057] Determine the similarity between two instance data in the plurality of pooled positive sample pairs to obtain a plurality of positive similarities;
[0058] Determine the similarity between two instance data in the plurality of pooled negative sample pairs to obtain a plurality of negative similarities;
[0059] According to the multiple positive similarities and the multiple negative similarities, the model parameters of the initial model are updated until the representation model is obtained.
[0060] In a third aspect, an embodiment of the present application provides a virtual machine performance detection device, the device comprising: an acquisition module, a first determination module and a second determination module, wherein:
[0061] The acquisition module is used to acquire performance data of the virtual machine, wherein the performance data includes performance values of multiple performances of the virtual machine before and after migration;
[0062] The first determining module is used to determine a first period characteristic and a first trend characteristic of the performance data before the migration, and a second period characteristic and a second trend characteristic of the performance data after the migration;
[0063] The second determination module is used to determine a performance detection result of the virtual machine after migration according to the first period feature, the second period feature, the first trend feature, and the second trend feature.
[0064] In a possible implementation manner, the first determining module is specifically configured to:
[0065] Preprocessing the performance data to obtain preprocessed data;
[0066] Performing time series decomposition processing on the preprocessed data to obtain target cycle data and target trend data of the performance data;
[0067] The target periodic data is processed by a characterization model to obtain the first periodic feature and the second periodic feature, and the target trend data is processed by the characterization model to obtain the first trend feature and the second trend feature.
[0068] In a possible implementation manner, the characterization model includes a period characterization model; and the first determination module is specifically configured to:
[0069] Segmenting the target periodic data according to the migration time of the virtual machine to obtain first periodic data before the migration and second periodic data after the migration;
[0070] Processing the first periodic data and the second periodic data by using the periodic characterization model to obtain a first periodic sequence corresponding to before the migration and a second periodic sequence corresponding to after the migration;
[0071] The first periodic sequence is pooled to obtain the first periodic feature, and the second periodic sequence is pooled to obtain the second periodic feature.
[0072] In a possible implementation manner, the characterization model includes a trend characterization model; and the first determination module is specifically configured to:
[0073] Segmenting the target trend data according to the migration time of the virtual machine to obtain first trend data before the migration and second trend data after the migration;
[0074] Processing the first trend data and the second trend data by using the trend characterization model to obtain a first trend sequence corresponding to before the migration and a second trend sequence corresponding to after the migration;
[0075] The first trend sequence is pooled to obtain the first trend feature, and the second trend sequence is pooled to obtain the second trend feature.
[0076] In a possible implementation manner, the first determining module is specifically configured to:
[0077] performing a period extraction process on the preprocessed data to determine at least one period length in the preprocessed data;
[0078] According to the at least one cycle length, performing at least one data extraction process on the pre-processed data until the remaining residual data after the data extraction process converges, determining the cycle data extracted by the data extraction process as the target cycle data, and determining the extracted trend data as the target trend data, wherein the data extraction process is used to extract the cycle data and the trend data;
[0079] The timing decomposition process includes the period extraction process and the data extraction process.
[0080] In a possible implementation manner, the first determining module is specifically configured to:
[0081] Performing HP filtering on the pre-processed data to obtain filtered data;
[0082] Performing maximum cross wavelet transform processing on the filtered data to obtain time-frequency data corresponding to the preprocessed data;
[0083] The time-frequency data is verified by using an autocorrelation function ACF to obtain the at least one cycle length.
[0084] In a possible implementation manner, the first periodic feature includes a first multi-performance periodic feature and a plurality of first single-performance periodic features corresponding to the plurality of performances;
[0085] The second periodic characteristics include a second multi-performance periodic characteristic and a plurality of second single-performance periodic characteristics corresponding to the plurality of performances;
[0086] The first trend feature includes a first multiple performance trend feature and a plurality of first single performance trend features corresponding to the plurality of performances;
[0087] The second trend feature includes a second multiple performance trend feature and a plurality of second single performance trend features corresponding to the plurality of performances;
[0088] Among them, the multi-performance periodic characteristics are used to indicate the periodic characteristics of the multiple performances, the single-performance periodic characteristics are used to indicate the periodic characteristics of a single performance, the multi-performance trend characteristics are used to indicate the trend characteristics of the multiple performances, and the single-performance trend characteristics are used to indicate the trend characteristics of a single performance.
[0089] In a possible implementation manner, the second determining module is specifically configured to:
[0090] determining a multi-performance detection result according to the first multi-performance period feature, the second multi-performance period feature, the first multi-performance trend feature, and the second multi-performance trend feature;
[0091] For any one performance, determine a single performance detection result corresponding to the performance according to a first single performance cycle feature corresponding to the performance, a second single performance cycle feature corresponding to the performance, a first single performance trend feature corresponding to the performance, and a second single performance trend feature corresponding to the performance;
[0092] The performance test result is determined according to the multiple performance test results and the single performance test result corresponding to each performance, wherein the performance test result includes the multiple performance test results and the single performance test result corresponding to each performance.
[0093] In a possible implementation manner, the second determining module is specifically configured to:
[0094] Determining a target detection method and a fluctuation ratio threshold corresponding to the performance according to historical complaint data of the virtual machine;
[0095] Processing the first single performance cycle feature and the second single performance cycle feature by the target detection method to obtain a first fluctuation ratio;
[0096] Processing the first single performance trend feature and the second single performance trend feature by the target detection method to obtain a second fluctuation ratio;
[0097] If the first fluctuation ratio and the second fluctuation ratio are respectively less than or equal to the fluctuation ratio threshold, determining that the single performance detection result is normal;
[0098] If one of the first fluctuation ratio and the second fluctuation ratio has a fluctuation ratio greater than the fluctuation ratio threshold, it is determined that the single performance detection result is a detection abnormality.
[0099] In a fourth aspect, an embodiment of the present application provides a representation model training device, including: an acquisition module, a decomposition module, a processing module, a determination module and a learning module, wherein:
[0100] The acquisition module is used to acquire N sample performance data of N sample virtual machines, wherein the sample performance data includes performance values of multiple performances of the sample virtual machines before and after migration, and N is an integer greater than 1;
[0101] The decomposition module is used to perform time series decomposition processing on the N sample performance data to obtain N periodic data and N trend data;
[0102] The processing module is used to process the N periodic data or the N trend data through the initial model to obtain 2N instance data, where the instance data is periodic data or trend data, and the 2N instance data includes N pre-migration instance data and N post-migration instance data;
[0103] The determination module is used to determine a plurality of positive sample pairs and a plurality of negative sample pairs in the 2N instance data according to the sample virtual machines corresponding to the respective instance data, wherein the positive sample pairs include the instance data before migration and the instance data after migration, and the instance data in the positive sample pairs correspond to the same sample virtual machine, and the negative sample pairs include two instance data, and the two instance data correspond to different sample virtual machines;
[0104] The learning module is used to perform comparative learning on the multiple positive sample pairs and the multiple negative sample pairs to update the model parameters of the initial model until a characterization model is obtained, and the characterization model is used to determine the periodic characteristics of the target periodic data, or determine the trend characteristics of the target trend data.
[0105] In a possible implementation, the N periodic data or the N trend data are processed by an initial model to obtain 2N instance data, including:
[0106] According to the migration time of the sample virtual machine, the N periodic data are segmented to obtain 2N periodic data;
[0107] According to the migration time of the sample virtual machine, the N trend data are segmented to obtain 2N trend data;
[0108] The 2N periodic data are processed by the initial model to obtain the 2N instance data; or, the 2N trend data are processed by the initial model to obtain the 2N instance data.
[0109] In a possible implementation manner, the processing module is specifically used to:
[0110] According to the migration time of the sample virtual machine, the N periodic data are segmented to obtain 2N periodic data;
[0111] According to the migration time of the sample virtual machine, the N trend data are segmented to obtain 2N trend data;
[0112] The 2N periodic data are processed by the initial model to obtain the 2N instance data; or, the 2N trend data are processed by the initial model to obtain the 2N instance data.
[0113] In a possible implementation manner, the learning module is specifically used for:
[0114] Performing pooling processing on the multiple positive sample pairs to obtain multiple pooled positive sample pairs;
[0115] Performing pooling processing on the multiple negative sample pairs to obtain multiple pooled negative sample pairs;
[0116] Determine the similarity between two instance data in the plurality of pooled positive sample pairs to obtain a plurality of positive similarities;
[0117] Determine the similarity between two instance data in the plurality of pooled negative sample pairs to obtain a plurality of negative similarities;
[0118] According to the multiple positive similarities and the multiple negative similarities, the model parameters of the initial model are updated until the representation model is obtained.
[0119] In a fifth aspect, an embodiment of the present application provides an electronic device, including: a memory and a processor;
[0120] The memory stores computer-executable instructions;
[0121] The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method described in any one of the first aspects.
[0122] In a sixth aspect, an embodiment of the present application provides an electronic device, including: a memory and a processor;
[0123] The memory stores computer-executable instructions;
[0124] The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method described in any one of the second aspects.
[0125] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in any one of the first aspects.
[0126] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in any one of the second aspects.
[0127] In a ninth aspect, an embodiment of the present application provides a computer program product, comprising a computer program, which, when executed by a processor, implements the method shown in any one of the first aspects.
[0128] In a tenth aspect, an embodiment of the present application provides a computer program product, including a computer program, which implements the method shown in any one of the second aspects when executed by a processor.
[0129] The embodiments of the present application provide a virtual machine performance detection method, a characterization model training method, an apparatus and a device, wherein the electronic device can obtain the performance data of the virtual machine, and determine the first period characteristics and the first trend characteristics of the performance data before migration, and the second period characteristics and the second trend characteristics of the performance data after migration. The electronic device can determine the performance detection result of the virtual machine after migration based on the first period characteristics, the second period characteristics, the first trend characteristics and the second trend characteristics. Since the electronic device can determine the period characteristics and trend characteristics before and after migration through the improved characterization model based on the Ts2vec method, and can use different detection methods for different abnormal types for detection, the accuracy of determining the performance detection result is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0130] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0131] Figure 1 A schematic diagram of a scenario provided for an exemplary embodiment of the present application;
[0132] Figure 2 A flowchart of a virtual machine performance detection method provided for an exemplary embodiment of the present application;
[0133] Figure 3 A schematic diagram of a structure of a characterization model provided for an exemplary embodiment of the present application;
[0134] Figure 4 A flowchart of another virtual machine performance detection method provided for an exemplary embodiment of the present application;
[0135] Figure 5 A process diagram of a virtual machine performance detection method provided for an exemplary embodiment of the present application;
[0136] Figure 6 A flowchart of a characterization model training method provided for an exemplary embodiment of the present application;
[0137] Figure 7 A process diagram of a characterization model training method provided for an exemplary embodiment of the present application;
[0138] Figure 8 A schematic diagram of the structure of a virtual machine performance detection device provided for an exemplary embodiment of the present application;
[0139] Fig. 9 A schematic diagram of the structure of a representation model training device provided for an exemplary embodiment of the present application;
[0140] Fig.10 A schematic structural diagram of an electronic device is provided according to an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0141] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0142] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only 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 making creative work are within the scope of protection of the present application.
[0143] Figure 1 A schematic diagram of a scenario provided for an exemplary embodiment of the present application. Figure 1 , including server 1 and server 2.
[0144] Server 1 may include virtual machine 1. The electronic device may hot migrate virtual machine 1 in server 1 to server 2. The electronic device may obtain performance data of virtual machine 1 before and after migration, and detect the performance data before and after migration to detect virtual machine 1 and determine the performance detection result of virtual machine 1 after migration.
[0145] In the related art, a model can be used to detect performance anomalies in the performance data before and after the virtual machine migration. However, in the above method, the model can only be compared based on the performance data before and after the migration, resulting in low accuracy in determining the performance detection results.
[0146] In an embodiment of the present application, the electronic device can obtain the performance data of the virtual machine, and can determine the first periodic characteristics and the first trend characteristics before the migration, and the second periodic characteristics and the second trend characteristics after the migration according to the performance data of the virtual machine, and then determine the performance detection result of the virtual machine after the migration according to the first periodic characteristics, the second periodic characteristics, the first trend characteristics and the second trend characteristics. Since the electronic device can determine the periodic characteristics and the trend characteristics before and after the migration according to the performance data, and compare them, the accuracy of determining the performance detection result is improved.
[0147] The technical solutions shown in the present application are described in detail below through specific embodiments. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or similar contents will not be described repeatedly in different embodiments.
[0148] Figure 2 A flowchart of a virtual machine performance detection method provided by an exemplary embodiment of the present application. Figure 2 , the method may include:
[0149] S201. Obtain performance data of a virtual machine.
[0150] The execution subject of the embodiment of the present application may be an electronic device, or a virtual machine performance detection device set in the electronic device. The virtual machine performance detection device may be implemented by software, or by a combination of software and hardware. The virtual machine performance detection device may be a processor in the electronic device. For ease of understanding, the following description is made by taking the execution subject as an electronic device as an example.
[0151] The performance data may include performance values of multiple performances of the virtual machine before and after migration. The performance values of the multiple performances may be collected according to a collection period.
[0152] The multiple performances may be performances such as a central processing unit (CPU) usage rate, a memory usage rate, and access volume of the virtual machine.
[0153] Optionally, the electronic device may collect performance values of multiple performances of the virtual machine before and after the migration according to a collection cycle to obtain performance data of the virtual machine.
[0154] For example, if the migration time is 10:00, if the collection period of the performance value is 1 minute, if the multiple performances are respectively CPU usage, memory usage and access volume, then the performance data 1 collected by the electronic device to the virtual machine 1 may include the performance values of the three performances every minute within 30 minutes before the migration time and within 30 minutes after the migration time, that is, 9:30-10:30. The performance data 1 can be a 60*3 matrix, as shown below:
[0155]
[0156] The data in the first column indicates the CPU usage of the virtual machine per minute from 9:30 to 10:30, the data in the second column indicates the memory usage of the virtual machine per minute from 9:30 to 10:30, and the data in the third column indicates the number of visits of the virtual machine per minute from 9:30 to 10:30.
[0157] S202: Determine a first period characteristic and a first trend characteristic of the performance data before migration, and a second period characteristic and a second trend characteristic of the performance data after migration.
[0158] In an optional embodiment, the first cycle characteristics and the first trend characteristics of the performance data before migration, and the first cycle characteristics and the second trend characteristics of the performance data after migration can be determined in the following manner: preprocessing the performance data to obtain preprocessed data; performing time series decomposition processing on the preprocessed data to obtain target cycle data and target trend data of the performance data; processing the target cycle data through a characterization model to obtain the first cycle characteristics and the second cycle characteristics, and processing the target trend data through the characterization model to obtain the first trend characteristics and the second trend characteristics.
[0159] Optionally, the preprocessing may include null value filling, noise reduction processing, and normalization processing. Null value filling may adopt a linear filling method. Noise reduction processing may adopt a bilateral filtering method.
[0160] Since the data levels of performance values of different performance of virtual machines are different, for example, the performance value of CPU utilization is between 0 and 100%, while the performance value of access volume is in the tens of thousands, the performance data needs to be normalized to avoid a certain performance value being too small, resulting in inaccurate detection.
[0161] Normalization processing refers to processing each performance value in the performance data into data between 0 and 1.
[0162] For example, if the performance data 1 is a 60*3 matrix 1, the electronic device can perform null value filling, noise reduction, and normalization on the performance data 1 to obtain preprocessed data 1. The preprocessed data 1 can be a 60*3 matrix 2. Each performance value in the matrix 2 is data between 0 and 1. It is assumed that it can be as follows:
[0163]
[0164] Time series decomposition processing is to extract and process the preprocessed data to obtain target period data and target trend data.
[0165] The target cycle data may include multiple sub-cycle data, and the target trend data may include multiple sub-trend data.
[0166] Optionally, the time series decomposition process may be performed using an enhanced (Robust) Seasonal-Trend Decomposition (STL) algorithm.
[0167] For example, if the preprocessed data 1 is a 60*3 matrix 2, the electronic device can extract and process the preprocessed data 1 to obtain target cycle data 1 and target trend data 1. The target cycle data 1 can be shown as the following 60*3 matrix 3:
[0168]
[0169] Since the data in the first column of the preprocessed data 1 represents the CPU usage of the virtual machine per minute, the data in the second column represents the memory usage of the virtual machine per minute, and the data in the third column represents the access volume of the virtual machine per minute, in the target cycle data 1, the data in the first column includes the periodic data of the CPU usage in multiple cycles. For example, the 8 data from 0.51 to 0.52 in the first column of data can be the CPU usage in a sub-cycle; the data in the second column includes the periodic data of the memory usage in multiple cycles. For example, the 8 data from 0.43 to 0.41 in the second column of data can be the memory usage in a sub-cycle; the data in the third column includes the periodic data of the access volume in multiple cycles. For example, the 8 data from 0.63 to 0.60 in the third column of data can be the access volume in a sub-cycle.
[0170] The target trend data 1 may be represented by the following 60*3 matrix 4:
[0171]
[0172] In the target trend data 1, the first column of data includes trend data of CPU usage. For example, the trend of CPU usage in the first column of data is an upward trend; the second column of data includes trend data of memory usage. For example, the trend of memory usage in the second column of data is an upward trend; the third column of data includes trend data of access volume. For example, the trend data of access volume in the third column of data is an upward trend.
[0173] The representation model can be an improved model based on the time series representation learning (Towards Universal Representation of Time Series, Ts2vec) method.
[0174] Next, combine Figure 3 , the characterization model is explained.
[0175] Figure 3 A schematic diagram of a representation model provided for an exemplary embodiment of the present application. Figure 3 , the representation model may include a fully connected layer, a mask layer, a convolution layer and a pooling layer. The convolution layer may include multiple residual blocks. The multiple residual blocks may be residual block 1, residual block 2, ..., residual block n. Each residual block may include 2 one-dimensional convolution kernels, and the size of the convolution kernel may be 3.
[0176] Optionally, the target periodic data may be processed by a characterization model to obtain a first periodic feature and a second periodic feature, and the target trend data may be processed by a characterization model to obtain a first trend feature and a second trend feature.
[0177] The first period feature and the first trend feature are features before the migration, and the second period feature and the second trend feature are features after the migration.
[0178] The first cycle feature may include a first multi-performance cycle feature and a plurality of first single-performance cycle features corresponding to a plurality of performances; the second cycle feature may include a second multi-performance cycle feature and a plurality of second single-performance cycle features corresponding to a plurality of performances.
[0179] The first trend feature may include a first multi-performance trend feature and a plurality of first single-performance trend features corresponding to a plurality of performances; the second trend feature may include a second multi-performance trend feature and a plurality of second single-performance trend features corresponding to a plurality of performances.
[0180] Among them, the multi-performance periodic characteristics can be used to indicate the periodic characteristics of multiple performances, the single performance periodic characteristics can be used to indicate the periodic characteristics of a single performance, the multi-performance trend characteristics can be used to indicate the trend characteristics of multiple performances, and the single performance trend characteristics can be used to indicate the trend characteristics of a single performance.
[0181] For example, if there are target cycle data 1 and target trend data 1, the target cycle data 1 can be processed through the characterization model to obtain the first cycle feature 1 and the second cycle feature 1, the first cycle feature 1 is the feature before migration, and the second cycle feature 1 is the feature after migration; the target trend data 1 can be processed through the characterization model to obtain the first trend feature 1 and the second trend feature 1, the first trend feature 1 is the trend feature before migration, and the second trend feature 1 is the trend feature after migration. For example, if there are three performances, namely CPU usage, memory usage, and access volume, the first cycle feature 1, the second cycle feature 1, the first trend feature 1, and the second trend feature 1 can include multiple features, as shown in Table 1:
[0182] Table 1
[0183]
[0184] S203: Determine a performance detection result of the virtual machine after migration according to the first period feature, the second period feature, the first trend feature, and the second trend feature.
[0185] Optionally, the performance test results of the virtual machine after migration can be determined according to the first cycle characteristics, the second cycle characteristics, the first trend characteristics and the second trend characteristics in the following manner: determine multiple performance test results according to the first multiple performance cycle characteristics, the second multiple performance cycle characteristics, the first multiple performance trend characteristics and the second multiple performance trend characteristics; for any performance, determine the single performance test result corresponding to the performance according to the first single performance cycle characteristic corresponding to the performance, the second single performance cycle characteristic corresponding to the performance, the first single performance trend characteristic corresponding to the performance and the second single performance trend characteristic corresponding to the performance; determine the performance test result according to the multiple performance test results and the single performance test result corresponding to each performance, the performance test result including the multiple performance test results and the single performance test result corresponding to each performance.
[0186] Optionally, a multi-performance period consistency test can be performed on the first multi-performance period feature and the second multi-performance period feature through a hypothesis test method to determine whether the periodicity of the multi-performance is consistent; a multi-performance trend consistency test can be performed on the first multi-performance trend feature and the second multi-performance trend feature through a hypothesis test method to determine whether the trend of the multi-performance is consistent. If the period and trend of the multi-performance are consistent, it can be determined that the multi-performance test result is normal; if the period or trend of the multi-performance is inconsistent, it can be determined that the multi-performance test result is abnormal.
[0187] Optionally, for any performance, the abnormality type can be determined based on the first single performance periodic feature and the second single performance periodic feature corresponding to the performance, or the first single performance trend feature and the second single performance trend feature corresponding to the performance, and then the target detection method can be determined based on the abnormality type, so as to detect the periodic feature or trend feature corresponding to the performance through the target detection method to determine the single performance detection result corresponding to the performance. The single performance detection result corresponding to the performance may include a single performance periodic detection result and a single performance trend detection result.
[0188] If both the single performance period detection result and the single performance trend detection result are normal, it can be determined that the single performance detection result corresponding to the performance is normal; if the single performance period detection result or the single performance trend detection result is abnormal, it can be determined that the single performance detection result corresponding to the performance is abnormal.
[0189] Optionally, the detection method may include data outlier detection (Extreme Studentized Deviate, ESD), F-test, and T-test.
[0190] In an embodiment of the present application, the electronic device can obtain the performance data of the virtual machine, and determine the first periodic characteristics and the first trend characteristics of the performance data before migration, and the second periodic characteristics and the second trend characteristics of the performance data after migration. The electronic device can determine the performance detection result of the virtual machine after migration based on the first periodic characteristics, the second periodic characteristics, the first trend characteristics and the second trend characteristics. Since the electronic device can determine the periodic characteristics and trend characteristics before and after migration through the improved characterization model based on the Ts2vec method, and different detection methods can be used for detection for different abnormal types, the accuracy of determining the performance detection results is improved.
[0191] Below, in Figure 2 Based on the embodiment shown, combined Figure 4 The above virtual machine performance detection method is described in detail.
[0192] Figure 4 A flowchart of another virtual machine performance detection method provided by an exemplary embodiment of the present application. Figure 4 , the method may include:
[0193] S401. Obtain performance data of a virtual machine.
[0194] It should be noted that the execution process of step S401 can refer to step S201, which will not be described again here.
[0195] S402: Preprocess the performance data to obtain preprocessed data.
[0196] Optionally, the performance data may be subjected to null-filling, noise reduction, and normalization processing to obtain preprocessed data.
[0197] S403 , performing time series decomposition processing on the preprocessed data to obtain target cycle data and target trend data of the performance data.
[0198] In an optional embodiment, the preprocessed data may be subjected to time series decomposition processing to obtain target cycle data and target trend data of the performance data in the following manner: performing cycle extraction processing on the preprocessed data to determine at least one cycle length in the preprocessed data; performing data extraction processing on the preprocessed data at least once according to the at least one cycle length until the remaining residual data after the data extraction processing converges, determining the cycle data extracted by the data extraction processing as the target cycle data, and determining the extracted trend data as the target trend data.
[0199] The time series decomposition process includes a period extraction process and a data extraction process. The data extraction process can be used to extract period data and trend data.
[0200] Optionally, the preprocessed data can be subjected to period extraction processing to determine at least one period length in the preprocessed data in the following manner: the preprocessed data is subjected to HP filtering processing to obtain filtered data; the filtered data is subjected to maximum cross wavelet transform processing to obtain time-frequency data corresponding to the preprocessed data; the time-frequency data is verified by an autocorrelation function (ACF) to obtain at least one period length.
[0201] HP filtering can be used to smooth the preprocessed data, making the periodicity of the preprocessed data more significant.
[0202] The maximum cross wavelet transform process can be used to perform local analysis on the filtered data to obtain time-frequency data corresponding to the preprocessed data. The time-frequency data may include time-frequency data of multiple performances.
[0203] For example, if the preprocessed data 1 is a 60*3 matrix 2, the preprocessed data can be subjected to HP filtering to obtain filtered data 1, and the filtered data 1 can be a 60*3 matrix. The maximum cross wavelet transform can be performed on the filtered data 1 to obtain the time-frequency data corresponding to the preprocessed data. For example, if there are three performances, the time-frequency data can include the time-frequency data corresponding to the three performances.
[0204] The time-frequency data can be verified by the ACF function to obtain at least one cycle length. For example, if the time-frequency data includes data of 3 cycles, and the cycle lengths of the 3 cycles are 3 minutes, 5 minutes, and 8 minutes respectively, the 3 cycle lengths can be verified by the ACF function to obtain at least one cycle length, assuming that the at least one cycle length is 5 minutes and 8 minutes respectively.
[0205] After determining the cycle length, when performing data extraction processing on the preprocessed data at least once according to at least one cycle length, L1 regularization trend removal processing and non-local multi-cycle removal processing can be performed on the preprocessed data, and then data extraction processing can be performed at least once according to at least one cycle length until the remaining residual data after the data extraction processing converges, the cycle data extracted by the data extraction processing is determined as the target cycle data, and the extracted trend data is determined as the target trend data.
[0206] Convergence means that after performing data extraction processing on the preprocessed data at least once to obtain periodic data and trend data, if data extraction processing is continued on the residual data, periodic data and trend data can no longer be extracted, and the residual data no longer changes or changes very slightly, it is convergence.
[0207] The residual data refers to the data without periodic characteristics and trend characteristics after the pre-processed data is subjected to at least one data extraction process.
[0208] For example, if the preprocessed data 1 is a 60*3 matrix 2, the target period data 1 is a 60*3 matrix 3, and the target trend data 1 is a 60*3 matrix 4, then after performing at least one data extraction process on the preprocessed data 1, the remaining residual data 1 may be shown as the following 60*3 matrix 5:
[0209]
[0210] The data in the residual data 1 is discrete and has no periodic or trend characteristics.
[0211] For example, if the cycle length 1 is 5 minutes and the cycle length 2 is 8 minutes, the preprocessed data can be extracted according to the cycle length 1 to obtain sub-cycle data 1 and sub-trend data 1; the preprocessed data can be extracted according to the cycle length 2 to obtain sub-cycle data 2 and sub-trend data 2. If sub-cycle data 2 and trend data 2 are extracted and the residual data in the preprocessed data converges, the target cycle data 1 can be determined according to the sub-cycle data 1 and the sub-cycle data 2, and the target cycle data 1 can include sub-cycle data 1 and sub-cycle data 2; the target trend data 1 can be determined according to the sub-trend data 1 and the sub-trend data 2. The target trend data 1 can include sub-trend data 1 and sub-trend data 2.
[0212] S404: Process the target periodic data through the characterization model to obtain a first periodic feature and a second periodic feature.
[0213] Optionally, the characterization model may include a period characterization model. The period characterization model may be used to process target period data.
[0214] In an optional embodiment, the target cycle data may be processed by a characterization model to obtain a first cycle feature and a second cycle feature in the following manner: the target cycle data is segmented according to the migration time of the virtual machine to obtain the first cycle data before the migration and the second cycle data after the migration; the first cycle data and the second cycle data are processed by a cycle characterization model to obtain a first cycle sequence corresponding to before the migration and a second cycle sequence corresponding to after the migration; the first cycle sequence is pooled to obtain the first cycle feature, and the second cycle sequence is pooled to obtain the second cycle feature.
[0215] Optionally, the electronic device may determine a virtual migration time, and segment the target periodic data according to the migration time of the virtual machine to obtain first periodic data before the migration and second periodic data after the migration.
[0216] The data lengths of the first cycle data and the second cycle data are consistent. For example, if the first cycle data includes 30 data, the second cycle data also includes 30 data.
[0217] Through the pooling process, the most significant features of the first periodic sequence and the second periodic sequence can be retained.
[0218] The first periodic feature and the second periodic feature can be represented by a one-dimensional vector. The periodic feature before the migration can be expressed by the first periodic feature, and the periodic feature after the migration can be expressed by the second periodic feature.
[0219] For example, if the migration time is 10:00, the electronic device can segment the target periodic data 1 according to 10:00 to obtain the first periodic data 1 and the second periodic data 1. The first periodic data 1 can be processed by the periodic characterization model to obtain the first periodic sequence 1; the second periodic data 1 can be processed by the periodic characterization model to obtain the second periodic sequence 1. The first periodic sequence 1 can be pooled to obtain the first periodic feature 1; the second periodic sequence 1 can be pooled to obtain the second periodic feature 1.
[0220] S405 , processing the target trend data through the characterization model to obtain a first trend feature and a second trend feature.
[0221] Optionally, the characterization model may include a trend characterization model. The trend characterization model may be used to process target trend data.
[0222] In an optional embodiment, the target trend data may be processed by a characterization model to obtain a first trend feature and a second trend feature in the following manner: the target trend data is segmented according to the migration time of the virtual machine to obtain first trend data before migration and second trend data after migration; the first trend data and the second trend data are processed by a trend characterization model to obtain a first trend sequence corresponding to before migration and a second trend sequence corresponding to after migration; the first trend sequence is pooled to obtain a first trend feature, and the second trend sequence is pooled to obtain a second trend feature.
[0223] The data lengths of the first trend data and the second trend data are consistent.
[0224] Through pooling processing, the most significant features of the first trend sequence and the second trend sequence can be retained.
[0225] The first trend feature and the second trend feature can be represented by a one-dimensional vector. The first trend feature can express the trend feature before the migration, and the second trend feature can express the trend feature after the migration.
[0226] For example, if the migration time is 10:00, the electronic device can segment the target trend data 1 according to 10:00 to obtain the first trend data 1 and the second trend data 1. The first trend data 1 can be processed by the trend feature model to obtain the first trend sequence 1; the second trend data 1 can be processed by the trend feature model to obtain the second trend sequence 1. Then, the first trend sequence 1 can be pooled to obtain the first trend feature 1, and the second trend sequence 1 can be pooled to obtain the second trend feature 1.
[0227] S406: Determine a multi-performance detection result according to the first multi-performance period feature, the second multi-performance period feature, the first multi-performance trend feature, and the second multi-performance trend feature.
[0228] Since the first cycle characteristic may include the first multi-performance cycle characteristic and the second cycle characteristic may include the second multi-performance cycle characteristic, the first multi-performance cycle characteristic can be determined according to the first cycle characteristic, and the second multi-performance cycle characteristic can be determined according to the second cycle characteristic. Then, the multi-performance cycle consistency test can be performed on the first multi-performance cycle characteristic and the second performance cycle characteristic through the hypothesis testing method to determine the multi-performance cycle detection result.
[0229] For example, if there are a first periodic feature 1 and a second periodic feature 1, the first multi-performance feature 1 can be determined according to the first periodic feature 1, and the second multi-performance feature 1 can be determined according to the second periodic feature 1. The multi-performance period consistency detection can be performed on the first multi-performance feature 1 and the second multi-performance feature 1 by the hypothesis test method. If the periods of the first multi-performance feature 1 and the second multi-performance feature 1 are consistent, it can be determined that the periodic detection result of the multi-performance is normal; if the periods of the first multi-performance feature 1 and the second multi-performance feature 1 are inconsistent, it can be determined that the periodic detection result of the multi-performance is abnormal.
[0230] Since the first trend feature may include the first multi-performance trend feature and the second trend feature may include the second multi-performance trend feature, the first multi-performance trend feature can be determined according to the first trend feature, and the second multi-performance trend feature can be determined according to the second trend feature. Then, the multi-performance trend consistency test can be performed on the first multi-performance trend feature and the second performance trend feature through the hypothesis testing method to determine the multi-performance trend detection result.
[0231] For example, if there are a first trend feature 1 and a second trend feature 1, the first multi-performance feature 1 can be determined according to the first trend feature 1, and the second multi-performance feature 1 can be determined according to the second trend feature 1. The multi-performance trend consistency test can be performed on the first multi-performance feature 1 and the second multi-performance feature 1 by the hypothesis test method. If the trends of the first multi-performance feature 1 and the second multi-performance feature 1 are consistent, it can be determined that the trend test result of the multi-performance is normal; if the trends of the first multi-performance feature 1 and the second multi-performance feature 1 are inconsistent, it can be determined that the trend test result of the multi-performance is abnormal.
[0232] The multi-performance test results may include periodic test results and trend test results. If both the periodic test results and the trend test results are normal, the multi-performance test results may be determined to be normal; if the periodic test results or the trend test results are abnormal, the multi-performance test results may be determined to be abnormal.
[0233] S407. For any performance, determine a single performance detection result corresponding to the performance according to a first single performance cycle feature corresponding to the performance, a second single performance cycle feature corresponding to the performance, a first single performance trend feature corresponding to the performance, and a second single performance trend feature corresponding to the performance.
[0234] In an optional embodiment, a single performance detection result corresponding to the performance can be determined according to a first single performance cycle feature corresponding to the performance, a second single performance cycle feature corresponding to the performance, a first single performance trend feature corresponding to the performance, and a second single performance trend feature corresponding to the performance in the following manner: determining a target detection method and a fluctuation ratio threshold corresponding to the performance according to historical complaint data of the virtual machine; processing the first single performance cycle feature and the second single performance cycle feature by the target detection method to obtain a first fluctuation ratio; processing the first single performance trend feature and the second single performance trend feature by the target detection method to obtain a second fluctuation ratio; if the first fluctuation ratio and the second fluctuation ratio are respectively less than or equal to the fluctuation ratio threshold, determining that the single performance detection result is a normal detection; if there is a fluctuation ratio in the first fluctuation ratio and the second fluctuation ratio that is greater than the fluctuation ratio threshold, determining that the single performance detection result is an abnormal detection.
[0235] The historical complaint data may be obtained by preprocessing the original complaint data. The original complaint data may be in text form. For example, the original complaint data may be "CPU jitter of virtual machine 1 is abnormal".
[0236] Optionally, preprocessing may include structured processing, labeling processing and extended processing. Structured processing refers to statistically analyzing the original complaint data to obtain the original complaint data in a tabular form, and labeling processing refers to labeling the original complaint data to mark the abnormal type and performance sensitivity upper and lower limits of the original complaint data.
[0237] Since the amount of original complaint data is small, a small amount of original complaint data can be expanded and processed through collaborative filtering algorithm to obtain a large amount of original complaint data.
[0238] The historical complaint data may include the ID of the virtual machine, the abnormality type, and the fluctuation ratio threshold. For example, the historical complaint data 1 may include 001, the abnormality type is a single point change, and the CPU fluctuation ratio threshold is 50%. Among them, 001 is the ID of virtual machine 1.
[0239] Optionally, different abnormality types may correspond to different detection methods, as shown in Table 2:
[0240] Table 2
[0241] Exception Type Detection Methods Single point change ESD Variance Change F-test Mean change T-test
[0242] For example, if a performance test is performed on the three performances of virtual machine 1, if there is historical complaint data 1 of virtual machine 1, if the historical complaint data 1 includes 001, the abnormal type is a single point change, and the CPU fluctuation ratio threshold is 50%, then the target detection method can be determined to be the ESD method based on the historical complaint data 1, and the CPU fluctuation ratio threshold is determined to be 50%. For CPU performance, the first single performance cycle feature 1 and the second single performance cycle feature 1 corresponding to the CPU can be processed by the ESD method to obtain the first fluctuation ratio 1, assuming that the first fluctuation ratio 1 is 30%; the first single performance trend feature 1 and the second single performance trend feature 1 corresponding to the CPU can be processed by the ESD method to obtain the second fluctuation ratio 1, assuming that the second fluctuation ratio 1 is 40%. Since both the first fluctuation ratio and the second fluctuation ratio are less than the fluctuation ratio threshold of 50%, it can be determined that the single performance test result corresponding to the CPU is normal.
[0243] Since the historical complaint data 1 does not include the fluctuation ratio thresholds corresponding to memory and access volume, the first single-performance cycle feature 2 and the second single-performance cycle feature 2 corresponding to the memory can be detected and processed by a general hypothesis testing method to obtain the single-performance cycle detection result 2 corresponding to the memory; the first single-performance trend feature 2 and the second single-performance trend feature 2 corresponding to the memory can be detected and processed by a hypothesis testing method to obtain the single-performance trend detection result 2 corresponding to the memory. If both the single-performance cycle detection result 2 and the single-performance trend detection result 2 are normal, it can be determined that the single-performance detection result corresponding to the memory is normal.
[0244] Similarly, the first single-sex cycle feature 3 and the second single-sex cycle feature 3 corresponding to the access volume can be tested and processed by a hypothesis testing method to obtain a single-sex cycle detection result 3 corresponding to the access volume; the first single-sex trend feature 3 and the second single-sex trend feature 3 corresponding to the access volume can be tested and processed by a hypothesis testing method to obtain a single-sex trend detection result 3 corresponding to the access volume. If both the single-sex cycle detection result 3 and the single-sex trend detection result 3 are normal, it can be determined that the single-sex detection result corresponding to the access volume is normal.
[0245] S408: Determine a performance test result according to the multiple performance test results and the single performance test result corresponding to each performance.
[0246] The performance test results may include multiple performance test results and a single performance test result corresponding to each performance.
[0247] For example, if there are three performances, namely CPU, memory and access volume, the performance test results may include multiple performance test results being normal, the single performance test result corresponding to the CPU being abnormal, the single performance test result corresponding to the memory being normal, and the single performance test result corresponding to the access volume being normal.
[0248] In an embodiment of the present application, the electronic device can obtain the performance data of the virtual machine, and pre-process the performance data to obtain the pre-processed data. The electronic device can perform time series decomposition processing on the pre-processed data to obtain the target period data and target trend data of the performance data, and then process the target period data through the characterization model to obtain the first period feature and the second period feature, and process the target trend data through the characterization model to obtain the first trend feature and the second trend feature. The electronic device can determine the multi-performance detection results according to the first multi-performance period feature, the second multi-performance period feature, the first multi-performance trend feature and the second multi-performance trend feature. For any performance, the single performance detection result corresponding to the performance is determined according to the first single performance period feature corresponding to the performance, the second single performance period feature corresponding to the performance, the first single performance trend feature corresponding to the performance, and the second single performance trend feature corresponding to the performance. The electronic device can determine the performance detection result according to the multi-performance detection results and the single performance detection result corresponding to each performance. Since the electronic device can determine the periodic characteristics and trend characteristics before and after the migration through the improved characterization model based on the Ts2vec method, and can use different detection methods for different abnormal types for detection, the accuracy of determining the performance detection result is improved.
[0249] Next, combine Figure 5 , the above virtual machine performance detection method is further explained in detail through specific examples.
[0250] Figure 5 A process diagram of a virtual machine performance detection method provided by an exemplary embodiment of the present application. Figure 5 , including performance data preprocessing process, periodic extraction process, data extraction processing process, representation model processing process, original complaint data preprocessing process, and anomaly detection process.
[0251] During the performance data preprocessing process, the electronic device can perform null-filling processing, noise reduction processing and normalization processing on the performance data to obtain preprocessed data.
[0252] In the periodic extraction process, the electronic device can perform HP filtering on the preprocessed data to obtain filtered data, and then perform maximum cross wavelet transform on the filtered data to obtain time-frequency data. The electronic device can perform verification processing on the time-frequency data through an ACF function to obtain at least one period length.
[0253] During the data extraction process, the electronic device can perform L1 regularization trend removal processing and non-local multi-cycle removal processing on the pre-processed data, and then adjust the components and perform at least one data extraction process according to at least one cycle length. The electronic device can determine whether the residual data of the pre-processed data converges. If not, the data extraction process can be continued; if converged, the data extraction process can be stopped to obtain the target cycle data and the target trend data.
[0254] In the characterization model processing process, the target periodic data can be segmented to obtain the first periodic data and the second periodic data, and then the first periodic data and the second periodic data can be pooled to obtain the first periodic feature and the second periodic feature; the target trend data can be segmented to obtain the first trend data and the second trend data, and then the first trend data and the second trend data can be pooled to obtain the first trend feature and the second trend feature. The first periodic feature includes a first multi-performance periodic feature and a plurality of first single-performance periodic features corresponding to a plurality of performances; the second periodic feature includes a second multi-performance periodic feature and a plurality of second single-performance periodic features corresponding to a plurality of performances; the first trend feature includes a first multi-performance trend feature and a plurality of first single-performance trend features corresponding to a plurality of performances; the second trend feature includes a second multi-performance trend feature and a plurality of second single-performance trend features corresponding to a plurality of performances.
[0255] During the preprocessing of the original complaint data, the original complaint data can be structured, labeled and expanded to obtain historical complaint data.
[0256] During the anomaly detection process, single-performance anomaly detection and multi-performance anomaly detection can be performed.
[0257] When performing single performance anomaly detection, for any performance, the target detection method and fluctuation ratio threshold corresponding to the performance can be determined based on the historical complaint data of the virtual machine, and then anomaly classification can be performed. The first single performance cycle feature and the second single performance cycle feature are processed by the target detection method to obtain the first fluctuation ratio; the first single performance trend feature and the second single performance trend feature are processed by the target detection method to obtain the second fluctuation ratio; if the first fluctuation ratio and the second fluctuation ratio are respectively less than or equal to the fluctuation ratio threshold, then the single performance detection result is determined to be normal; if there is a fluctuation ratio in the first fluctuation ratio and the second fluctuation ratio that is greater than the fluctuation ratio threshold, then the single performance detection result is determined to be abnormal.
[0258] When performing multi-performance anomaly detection, a multi-performance cycle consistency test can be performed on the first multi-performance cycle feature and the second performance cycle feature through a hypothesis test method to determine the multi-performance cycle detection result; a multi-performance trend consistency test can be performed on the first multi-performance trend feature and the second performance trend feature through a hypothesis test method to determine the multi-performance trend detection result. The multi-performance detection result can be determined based on the cycle detection result and the trend detection result.
[0259] The electronic device may determine the performance test result based on the multiple performance test results and the single performance test result corresponding to each performance.
[0260] In an embodiment of the present application, the electronic device can obtain the performance data of the virtual machine, and pre-process the performance data to obtain the pre-processed data. The electronic device can perform time series decomposition processing on the pre-processed data to obtain the target period data and target trend data of the performance data, and then process the target period data through the characterization model to obtain the first period feature and the second period feature, and process the target trend data through the characterization model to obtain the first trend feature and the second trend feature. The electronic device can determine the multi-performance detection results according to the first multi-performance period feature, the second multi-performance period feature, the first multi-performance trend feature and the second multi-performance trend feature. For any performance, the single performance detection result corresponding to the performance is determined according to the first single performance period feature corresponding to the performance, the second single performance period feature corresponding to the performance, the first single performance trend feature corresponding to the performance, and the second single performance trend feature corresponding to the performance. The electronic device can determine the performance detection result according to the multi-performance detection results and the single performance detection result corresponding to each performance. Since the electronic device can determine the periodic characteristics and trend characteristics before and after the migration through the improved characterization model based on the Ts2vec method, and can use different detection methods for different abnormal types for detection, the accuracy of determining the performance detection result is improved.
[0261] Next, combine Figure 6 , explaining the process of training the representation model.
[0262] Figure 6 A flowchart of a characterization model training method provided for an exemplary embodiment of the present application. Figure 6 , the method may include:
[0263] S601. Obtain N sample performance data of N sample virtual machines.
[0264] The sample performance data includes performance values of multiple performances of the sample virtual machine before and after migration, where N is an integer greater than 1.
[0265] For any sample virtual machine, the electronic device may collect performance values of multiple performances of the sample virtual machine before and after migration according to a collection cycle to obtain sample performance data of the sample virtual machine.
[0266] For example, for sample virtual machine 1, if the collection period is 1 minute, and the multiple performances are CPU usage, memory usage, and access volume, the electronic device can collect multiple performance values corresponding to the CPU usage, memory usage, and access volume of the sample virtual machine 1 before and after migration according to the collection period to obtain sample performance data of the sample virtual machine 1.
[0267] If there are 100 sample virtual machines, the electronic device can obtain 100 sample performance data.
[0268] S602 , performing time series decomposition processing on N sample performance data to obtain N periodic data and N trend data.
[0269] Optionally, for any sample performance data, the electronic device may perform time series decomposition processing on the sample performance data to obtain period data and trend data corresponding to the sample performance data.
[0270] For example, if there are 100 sample performance data, the 100 sample performance data can be subjected to time series decomposition processing to obtain 100 period data and 100 trend data.
[0271] S603 . Process N periodic data or N trend data by using the initial model to obtain 2N instance data.
[0272] The instance data may be periodic data or trend data, and the 2N instance data may include N pre-migration instance data and N post-migration instance data.
[0273] In an optional embodiment, N periodic data or N trend data may be processed by the initial model to obtain 2N instance data in the following manner: according to the migration time of the sample virtual machine, the N periodic data are segmented and processed to obtain 2N periodic data; according to the migration time of the sample virtual machine, the N trend data are segmented and processed to obtain 2N trend data; the 2N periodic data are processed by the initial model to obtain 2N instance data; or, the 2N trend data are processed by the initial model to obtain 2N instance data.
[0274] The 2N periodic data may include N pre-migration periodic data and N post-migration periodic data.
[0275] The 2N trend data may include N pre-migration trend data and N post-migration trend data.
[0276] For example, if the migration time of sample virtual machine 1 is 15:00, corresponding to periodic data 1 and trend data 1, the periodic data 1 can be split according to the migration time to obtain two periodic data, namely, periodic data 1 before migration and periodic data 1 after migration; the trend data 1 can be split according to the migration time to obtain two trend data, namely, trend data 1 before migration and trend data 2 after migration.
[0277] For example, if there are 100 sample virtual machines, the migration time of the 100 sample virtual machines can be determined, and the periodic data of each sample virtual machine can be segmented according to the migration time of each sample virtual machine, that is, 100 periodic data are segmented to obtain 200 periodic data, and the 200 periodic data may include 100 pre-migration periodic data and 100 post-migration periodic data; the trend data of each sample virtual machine can be segmented according to the migration time of each sample virtual machine, that is, 100 trend data are segmented to obtain 200 trend data; the 200 trend data may include 100 pre-migration trend data and 100 post-migration trend data.
[0278] Alternatively, the structure of the initial model can be as follows Figure 3As shown. The initial model may include a fully connected layer, a mask layer, a convolutional layer, and a pooling layer. The fully connected layer can be used to perform nonlinear feature expression on periodic data or trend data. The mask layer can be used to enhance the features of periodic data or trend data. The mask generation probability follows a binomial distribution, and the mask layer can randomly set certain timestamps to 0 in the time dimension. The convolutional layer can be used to transform the dimensions of periodic data and trend data. The convolutional layer may include multiple residual blocks. Each residual block may include two one-dimensional convolution kernels, and the size of the convolution kernel may be 3. The pooling layer can be used to obtain instances of different resolutions.
[0279] For example, if there are 200 periodic data and 200 trend data, the 200 periodic data can be processed by the initial model to obtain 200 instance data; or, the 200 trend data can be processed by the initial model to obtain 200 instance data.
[0280] S604 . Determine a plurality of positive sample pairs and a plurality of negative sample pairs in the 2N instance data according to the sample virtual machines corresponding to the instance data.
[0281] The positive sample pair may include pre-migration instance data and post-migration instance data, and the instance data in the positive sample pair corresponds to the same sample virtual machine. The negative sample pair may include two instance data, and the two instance data correspond to different sample virtual machines.
[0282] Since the 2N instance data include the pre-migration instance data and post-migration instance data of N sample virtual machines, the pre-migration instance data and post-migration instance data of the same sample virtual machine can be determined as a positive sample pair among the 2N instance data, and the pre-migration instance data and post-migration instance data belonging to different sample virtual machines can be determined as a negative sample pair.
[0283] For example, if the instance data is periodic data, the pre-migration instance data 1 and the post-migration instance data 1 of the sample virtual machine 1 can be determined as positive sample 1 in 200 periodic data; the pre-migration instance data 1 of the sample virtual machine 1 and the post-migration instance data 2 of the sample virtual machine 2 can be determined as negative sample pairs.
[0284] S605 , performing comparative learning on multiple positive sample pairs and multiple negative sample pairs to update model parameters of the initial model until a representation model is obtained.
[0285] In an optional embodiment, comparative learning can be performed on multiple positive sample pairs and multiple negative sample pairs in the following manner to update the model parameters of the initial model until a characterization model is obtained: multiple positive sample pairs are pooled to obtain multiple pooled positive sample pairs; multiple negative sample pairs are pooled to obtain multiple pooled negative sample pairs; the similarity between two instance data in the multiple pooled positive sample pairs is determined to obtain multiple positive similarities; the similarity between two instance data in the multiple pooled negative sample pairs is determined to obtain multiple negative similarities; and the model parameters of the initial model are updated according to the multiple positive similarities and the multiple negative similarities until a characterization model is obtained.
[0286] Optionally, the multiple pooled positive sample pairs obtained through the pooling process are positive samples of different resolutions.
[0287] For example, if there are 100 positive samples, the 100 positive sample pairs can be pooled to obtain 300 pooled positive sample pairs. For any one of the 300 pooled positive sample pairs, the similarity between the two instance data in the pooled positive sample pair can be determined, and the positive similarity of the pooled positive sample pair can be obtained, and 300 positive similarities can be obtained; if there are 500 negative sample pairs, the 500 negative sample pairs are pooled to obtain 1500 pooled negative sample pairs. For any one of the 1500 pooled negative sample pairs, the similarity between the two instance data in the pooled negative sample pair can be determined, and the negative similarity of the pooled negative sample pair can be obtained, and 1500 negative similarities can be obtained.
[0288] Optionally, after determining multiple positive similarities and multiple negative similarities, a loss function can be determined according to the multiple positive similarities and multiple negative similarities, and the model parameters of the initial model can be updated according to the loss function until the loss value of the loss function is less than a preset threshold, thereby obtaining a characterization model. The characterization model can be used to determine the periodic characteristics of the target periodic data, or to determine the trend characteristics of the target trend data.
[0289] For example, if the preset threshold is 0.1, if the loss value is 0.05, and the loss value is less than the preset threshold 0.1, the training of the initial model can be terminated to obtain the representation model.
[0290] In an embodiment of the present application, the electronic device can obtain N sample performance data of N sample virtual machines, and perform time series decomposition processing on the N sample performance data to obtain N periodic data and N trend data. The electronic device can process N periodic data or N trend data through the initial model to obtain 2N instance data, and then determine multiple positive sample pairs and multiple negative sample pairs in the 2N instance data according to the sample virtual machines corresponding to each instance data. The electronic device can perform comparative learning on multiple positive sample pairs and multiple negative sample pairs to update the model parameters of the initial model until a characterization model is obtained. Since multiple positive sample pairs and multiple negative sample pairs can be determined in 2N instance data, and multiple pooled positive sample pairs can be determined based on multiple positive sample pairs, multiple pooled negative sample pairs can be determined based on multiple negative sample pairs, and the multiple pooled positive sample pairs and multiple pooled negative sample pairs are instance data of different resolutions. By performing comparative learning on instance data of different resolutions, the accuracy of the model can be effectively improved, and the complexity of the model can be reduced, and the training efficiency of the model can be improved.
[0291] Figure 7 A process diagram of a characterization model training method provided for an exemplary embodiment of the present application. Figure 7 , the electronic device can obtain N sample performance data of N sample virtual machines. The electronic device can perform time series decomposition processing on the N sample performance data to obtain N periodic data and N trend data.
[0292] According to the migration time of the sample virtual machine, N periodic data are segmented and processed to obtain N pre-migration periodic data and N post-migration periodic data; according to the migration time of the sample virtual machine, N trend data can be segmented and processed to obtain N pre-migration trend data and N post-migration trend data.
[0293] N pre-migration cycle data and N post-migration cycle data may be input into the initial model, and the N pre-migration cycle data and N post-migration cycle data may be processed through a fully connected layer, a mask layer, and a convolutional layer to obtain N pre-migration instance data and N post-migration instance data.
[0294] Similarly, N pre-migration trend data and N post-migration trend data can be input into the initial model, and the N pre-migration trend data and N post-migration trend data can be processed through the fully connected layer, the mask layer and the convolution layer to obtain N pre-migration instance data and N post-migration instance data.
[0295] When processing through the convolution layer, in order to maintain dimensional consistency, the time dimension can be bilaterally padded. Each residual block input and output are connected by a solid line to ensure that the time series data will not be lost during transmission. In the last residual block of the convolution layer, the corresponding dimension can be converted to a specified output dimension. For example, the input dimension can be 16*60*64, and the output dimension can be specified as 16*60*320. For example, if the convolution layer is set to include 10 residual blocks, the residual blocks can be used to process the N pre-migration period data after mask enhancement and the N post-migration period data after mask enhancement. The electronic device can determine whether 9 residual blocks have been executed. If not, the periodic data before and after the migration can continue to be processed through the residual block; if so, the N pre-migration instance data and the N post-migration instance data can be output through the 10th residual block. The output dimension of each instance data can be 16*60*320.
[0296] The electronic device can determine multiple positive sample pairs and multiple negative sample pairs in N pre-migration instance data and N post-migration instance data based on the sample virtual machines corresponding to each instance data, and then perform pooling processing on the multiple positive sample pairs to obtain multiple pooled positive sample pairs, and perform pooling processing on the multiple negative sample pairs to obtain multiple pooled negative sample pairs.
[0297] The electronic device can determine the similarity between two instance data in multiple pooled negative sample pairs to obtain multiple negative similarities; and update the model parameters of the initial model according to the multiple positive similarities and the multiple negative similarities until a representation model is obtained.
[0298] In an embodiment of the present application, the electronic device can obtain N sample performance data of N sample virtual machines, and perform time series decomposition processing on the N sample performance data to obtain N periodic data and N trend data. The electronic device can process N periodic data or N trend data through the initial model to obtain 2N instance data, and then determine multiple positive sample pairs and multiple negative sample pairs in the 2N instance data according to the sample virtual machines corresponding to each instance data. The electronic device can perform comparative learning on multiple positive sample pairs and multiple negative sample pairs to update the model parameters of the initial model until a characterization model is obtained. Since multiple positive sample pairs and multiple negative sample pairs can be determined in 2N instance data, and multiple pooled positive sample pairs can be determined based on multiple positive sample pairs, multiple pooled negative sample pairs can be determined based on multiple negative sample pairs, and the multiple pooled positive sample pairs and multiple pooled negative sample pairs are instance data of different resolutions. By performing comparative learning on instance data of different resolutions, the accuracy of the model can be effectively improved, and the complexity of the model can be reduced, and the training efficiency of the model can be improved.
[0299] Figure 8This is a schematic diagram of a virtual machine performance detection device provided by an exemplary embodiment of the present application. Figure 8 The virtual machine performance detection device 10 includes: an acquisition module 11, a first determination module 12 and a second determination module 13, wherein:
[0300] The acquisition module 11 is used to acquire performance data of the virtual machine, wherein the performance data includes performance values of multiple performances of the virtual machine before and after migration;
[0301] The first determining module 12 is used to determine a first period feature and a first trend feature of the performance data before the migration, and a second period feature and a second trend feature of the performance data after the migration;
[0302] The second determination module 13 is used to determine the performance detection result of the virtual machine after migration according to the first period feature, the second period feature, the first trend feature, and the second trend feature.
[0303] The virtual machine performance detection device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0304] In a possible implementation manner, the first determining module 12 is specifically configured to:
[0305] Preprocessing the performance data to obtain preprocessed data;
[0306] Performing time series decomposition processing on the preprocessed data to obtain target cycle data and target trend data of the performance data;
[0307] The target periodic data is processed by a characterization model to obtain the first periodic feature and the second periodic feature, and the target trend data is processed by the characterization model to obtain the first trend feature and the second trend feature.
[0308] In a possible implementation manner, the characterization model includes a period characterization model; and the first determination module 12 is specifically configured to:
[0309] Segmenting the target periodic data according to the migration time of the virtual machine to obtain first periodic data before the migration and second periodic data after the migration;
[0310] Processing the first periodic data and the second periodic data by using the periodic characterization model to obtain a first periodic sequence corresponding to before the migration and a second periodic sequence corresponding to after the migration;
[0311] The first periodic sequence is pooled to obtain the first periodic feature, and the second periodic sequence is pooled to obtain the second periodic feature.
[0312] In a possible implementation manner, the characterization model includes a trend characterization model; and the first determination module 12 is specifically configured to:
[0313] Segmenting the target trend data according to the migration time of the virtual machine to obtain first trend data before the migration and second trend data after the migration;
[0314] Processing the first trend data and the second trend data by using the trend characterization model to obtain a first trend sequence corresponding to before the migration and a second trend sequence corresponding to after the migration;
[0315] The first trend sequence is pooled to obtain the first trend feature, and the second trend sequence is pooled to obtain the second trend feature.
[0316] In a possible implementation manner, the first determining module 12 is specifically configured to:
[0317] performing a period extraction process on the preprocessed data to determine at least one period length in the preprocessed data;
[0318] According to the at least one cycle length, performing at least one data extraction process on the pre-processed data until the remaining residual data after the data extraction process converges, determining the cycle data extracted by the data extraction process as the target cycle data, and determining the extracted trend data as the target trend data, wherein the data extraction process is used to extract the cycle data and the trend data;
[0319] The timing decomposition process includes the period extraction process and the data extraction process.
[0320] In a possible implementation manner, the first determining module 12 is specifically configured to:
[0321] Performing HP filtering on the pre-processed data to obtain filtered data;
[0322] Performing maximum cross wavelet transform processing on the filtered data to obtain time-frequency data corresponding to the preprocessed data;
[0323] The time-frequency data is verified by using an autocorrelation function ACF to obtain the at least one cycle length.
[0324] In a possible implementation manner, the first periodic feature includes a first multi-performance periodic feature and a plurality of first single-performance periodic features corresponding to the plurality of performances;
[0325] The second periodic characteristics include a second multi-performance periodic characteristic and a plurality of second single-performance periodic characteristics corresponding to the plurality of performances;
[0326] The first trend feature includes a first multiple performance trend feature and a plurality of first single performance trend features corresponding to the plurality of performances;
[0327] The second trend feature includes a second multiple performance trend feature and a plurality of second single performance trend features corresponding to the plurality of performances;
[0328] Among them, the multi-performance periodic characteristics are used to indicate the periodic characteristics of the multiple performances, the single-performance periodic characteristics are used to indicate the periodic characteristics of a single performance, the multi-performance trend characteristics are used to indicate the trend characteristics of the multiple performances, and the single-performance trend characteristics are used to indicate the trend characteristics of a single performance.
[0329] In a possible implementation manner, the second determining module 13 is specifically configured to:
[0330] determining a multi-performance detection result according to the first multi-performance period feature, the second multi-performance period feature, the first multi-performance trend feature, and the second multi-performance trend feature;
[0331] For any one performance, determine a single performance detection result corresponding to the performance according to a first single performance cycle feature corresponding to the performance, a second single performance cycle feature corresponding to the performance, a first single performance trend feature corresponding to the performance, and a second single performance trend feature corresponding to the performance;
[0332] The performance test result is determined according to the multiple performance test results and the single performance test result corresponding to each performance, wherein the performance test result includes the multiple performance test results and the single performance test result corresponding to each performance.
[0333] In a possible implementation manner, the second determining module 13 is specifically configured to:
[0334] Determining a target detection method and a fluctuation ratio threshold corresponding to the performance according to historical complaint data of the virtual machine;
[0335] Processing the first single performance cycle feature and the second single performance cycle feature by the target detection method to obtain a first fluctuation ratio;
[0336] Processing the first single performance trend feature and the second single performance trend feature by the target detection method to obtain a second fluctuation ratio;
[0337] If the first fluctuation ratio and the second fluctuation ratio are respectively less than or equal to the fluctuation ratio threshold, determining that the single performance detection result is normal;
[0338] If one of the first fluctuation ratio and the second fluctuation ratio has a fluctuation ratio greater than the fluctuation ratio threshold, it is determined that the single performance detection result is a detection abnormality.
[0339] The virtual machine performance detection device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0340] Fig. 9 A schematic diagram of a representation model training device provided by an exemplary embodiment of the present application. Fig. 9 The representation model training device 20 may include: an acquisition module 21, a decomposition module 22, a processing module 23, a determination module 24 and a learning module 25, wherein:
[0341] The acquisition module 21 is used to acquire N sample performance data of N sample virtual machines, wherein the sample performance data includes performance values of multiple performances of the sample virtual machines before and after migration, and N is an integer greater than 1;
[0342] The decomposition module 22 is used to perform time series decomposition processing on the N sample performance data to obtain N periodic data and N trend data;
[0343] The processing module 23 is used to process the N periodic data or the N trend data through the initial model to obtain 2N instance data, where the instance data is periodic data or trend data, and the 2N instance data includes N pre-migration instance data and N post-migration instance data;
[0344] The determination module 24 is used to determine a plurality of positive sample pairs and a plurality of negative sample pairs in the 2N instance data according to the sample virtual machines corresponding to the respective instance data, wherein the positive sample pairs include the instance data before migration and the instance data after migration, and the instance data in the positive sample pairs correspond to the same sample virtual machine, and the negative sample pairs include two instance data, and the two instance data correspond to different sample virtual machines;
[0345] The learning module 25 is used to perform comparative learning on the multiple positive sample pairs and the multiple negative sample pairs to update the model parameters of the initial model until a characterization model is obtained, and the characterization model is used to determine the periodic characteristics of the target periodic data, or determine the trend characteristics of the target trend data.
[0346] The characterization model training device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0347] In a possible implementation manner, the processing module 23 is specifically configured to:
[0348] According to the migration time of the sample virtual machine, the N periodic data are segmented to obtain 2N periodic data;
[0349] According to the migration time of the sample virtual machine, the N trend data are segmented to obtain 2N trend data;
[0350] The 2N periodic data are processed by the initial model to obtain the 2N instance data; or, the 2N trend data are processed by the initial model to obtain the 2N instance data.
[0351] In a possible implementation manner, the learning module 25 is specifically used for:
[0352] Performing pooling processing on the multiple positive sample pairs to obtain multiple pooled positive sample pairs;
[0353] Performing pooling processing on the multiple negative sample pairs to obtain multiple pooled negative sample pairs;
[0354] Determine the similarity between two instance data in the plurality of pooled positive sample pairs to obtain a plurality of positive similarities;
[0355] Determine the similarity between two instance data in the plurality of pooled negative sample pairs to obtain a plurality of negative similarities;
[0356] According to the multiple positive similarities and the multiple negative similarities, the model parameters of the initial model are updated until the representation model is obtained.
[0357] The characterization model training device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.
[0358] The exemplary embodiment of the present application provides a structural diagram of an electronic device, see Fig.10The electronic device 30 may include a processor 31 and a memory 32. Exemplarily, the processor 31 and the memory 32 are interconnected via a bus 33.
[0359] The memory 32 stores computer-executable instructions;
[0360] The processor 31 executes the computer execution instructions stored in the memory 32, so that the processor 31 executes the virtual machine performance detection method or the characterization model training method as shown in the above method embodiment.
[0361] Accordingly, an embodiment of the present application provides a computer-readable storage medium, which stores computer execution instructions. When the computer execution instructions are executed by a processor, they are used to implement the virtual machine performance detection method or the characterization model training method described in the above method embodiment.
[0362] Accordingly, an embodiment of the present application may also provide a computer program product, including a computer program. When the computer program is executed by a processor, it can implement the virtual machine performance detection method or the characterization model training method shown in the above method embodiment.
[0363] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take 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.) containing computer-usable program code.
[0364] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks 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 produce 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.
[0365] 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.
[0366] 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. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0367] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0368] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0369] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0370] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0371] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A virtual machine performance detection method, characterized in that: include: Acquire performance data of the virtual machine, the performance data including performance values of multiple performances of the virtual machine before and after migration; Determining a first period characteristic and a first trend characteristic of the performance data before the migration, and a second period characteristic and a second trend characteristic of the performance data after the migration; A performance detection result of the virtual machine after migration is determined according to the first period feature, the second period feature, the first trend feature, and the second trend feature.
2. The method according to claim 1, characterized in that Determining a first period feature and a first trend feature of the performance data before the migration, and a first period feature and a second trend feature of the performance data after the migration, includes: Preprocessing the performance data to obtain preprocessed data; Performing time series decomposition processing on the preprocessed data to obtain target cycle data and target trend data of the performance data; The target periodic data is processed by a characterization model to obtain the first periodic feature and the second periodic feature, and the target trend data is processed by the characterization model to obtain the first trend feature and the second trend feature.
3. The method according to claim 2, characterized in that The characterization model includes a period characterization model; the target periodic data is processed by the characterization model to obtain the first periodic feature and the second periodic feature, including: Segmenting the target periodic data according to the migration time of the virtual machine to obtain first periodic data before the migration and second periodic data after the migration; Processing the first periodic data and the second periodic data by using the periodic characterization model to obtain a first periodic sequence corresponding to before the migration and a second periodic sequence corresponding to after the migration; The first periodic sequence is pooled to obtain the first periodic feature, and the second periodic sequence is pooled to obtain the second periodic feature.
4. The method according to claim 2 or 3, characterized in that: The characterization model includes a trend characterization model; the target trend data is processed by the characterization model to obtain the first trend feature and the second trend feature, including: Segmenting the target trend data according to the migration time of the virtual machine to obtain first trend data before the migration and second trend data after the migration; Processing the first trend data and the second trend data by using the trend characterization model to obtain a first trend sequence corresponding to before the migration and a second trend sequence corresponding to after the migration; The first trend sequence is pooled to obtain the first trend feature, and the second trend sequence is pooled to obtain the second trend feature.
5. The method according to any one of claims 2 to 4, characterized in that: Performing time series decomposition processing on the preprocessed data to obtain target cycle data and target trend data of the performance data includes: performing a period extraction process on the preprocessed data to determine at least one period length in the preprocessed data; According to the at least one cycle length, performing at least one data extraction process on the pre-processed data until the remaining residual data after the data extraction process converges, determining the cycle data extracted by the data extraction process as the target cycle data, and determining the extracted trend data as the target trend data, wherein the data extraction process is used to extract the cycle data and the trend data; The timing decomposition process includes the period extraction process and the data extraction process.
6. The method according to claim 5, characterized in that Performing period extraction processing on the preprocessed data to determine at least one period length in the preprocessed data includes: Performing HP filtering on the pre-processed data to obtain filtered data; Performing maximum cross wavelet transform processing on the filtered data to obtain time-frequency data corresponding to the preprocessed data; The time-frequency data is verified by using an autocorrelation function ACF to obtain the at least one cycle length.
7. The method according to any one of claims 1 to 6, characterized in that: The first cycle characteristics include a first multi-performance cycle characteristic and a plurality of first single-performance cycle characteristics corresponding to the plurality of performances; The second periodic characteristics include a second multi-performance periodic characteristic and a plurality of second single-performance periodic characteristics corresponding to the plurality of performances; The first trend feature includes a first multiple performance trend feature and a plurality of first single performance trend features corresponding to the plurality of performances; The second trend feature includes a second multiple performance trend feature and a plurality of second single performance trend features corresponding to the plurality of performances; Among them, the multi-performance periodic characteristics are used to indicate the periodic characteristics of the multiple performances, the single-performance periodic characteristics are used to indicate the periodic characteristics of a single performance, the multi-performance trend characteristics are used to indicate the trend characteristics of the multiple performances, and the single-performance trend characteristics are used to indicate the trend characteristics of a single performance.
8. The method according to claim 7, characterized in that Determining a performance detection result of the virtual machine after migration according to the first period feature, the second period feature, the first trend feature, and the second trend feature includes: determining a multi-performance detection result according to the first multi-performance period feature, the second multi-performance period feature, the first multi-performance trend feature, and the second multi-performance trend feature; For any one performance, determine a single performance detection result corresponding to the performance according to a first single performance cycle feature corresponding to the performance, a second single performance cycle feature corresponding to the performance, a first single performance trend feature corresponding to the performance, and a second single performance trend feature corresponding to the performance; The performance test result is determined according to the multiple performance test results and the single performance test result corresponding to each performance, wherein the performance test result includes the multiple performance test results and the single performance test result corresponding to each performance.
9. The method according to claim 8, characterized in that Determining a single performance detection result corresponding to the performance according to a first single performance cycle feature corresponding to the performance, a second single performance cycle feature corresponding to the performance, a first single performance trend feature corresponding to the performance, and a second single performance trend feature corresponding to the performance, includes: Determining a target detection method and a fluctuation ratio threshold corresponding to the performance according to historical complaint data of the virtual machine; Processing the first single performance cycle feature and the second single performance cycle feature by the target detection method to obtain a first fluctuation ratio; Processing the first single performance trend feature and the second single performance trend feature by the target detection method to obtain a second fluctuation ratio; If the first fluctuation ratio and the second fluctuation ratio are respectively less than or equal to the fluctuation ratio threshold, determining that the single performance detection result is normal; If one of the first fluctuation ratio and the second fluctuation ratio has a fluctuation ratio greater than the fluctuation ratio threshold, it is determined that the single performance detection result is a detection abnormality.
10. A representation model training method, characterized in that: include: Obtaining N sample performance data of N sample virtual machines, wherein the sample performance data includes performance values of multiple performances of the sample virtual machines before and after migration, where N is an integer greater than 1; Performing time series decomposition processing on the N sample performance data to obtain N periodic data and N trend data; Processing the N periodic data or the N trend data by using an initial model to obtain 2N instance data, where the instance data is periodic data or trend data, and the 2N instance data includes N pre-migration instance data and N post-migration instance data; According to the sample virtual machines corresponding to the instance data, a plurality of positive sample pairs and a plurality of negative sample pairs are determined in the 2N instance data, wherein the positive sample pairs include the instance data before migration and the instance data after migration, and the instance data in the positive sample pairs correspond to the same sample virtual machine, and the negative sample pairs include two instance data, and the two instance data correspond to different sample virtual machines; The multiple positive sample pairs and the multiple negative sample pairs are subjected to comparative learning to update the model parameters of the initial model until a characterization model is obtained, wherein the characterization model is used to determine the periodic characteristics of the target periodic data, or to determine the trend characteristics of the target trend data.
11. The method according to claim 10, characterized in that The N periodic data or the N trend data are processed by the initial model to obtain 2N instance data, including: According to the migration time of the sample virtual machine, the N periodic data are segmented to obtain 2N periodic data; According to the migration time of the sample virtual machine, the N trend data are segmented to obtain 2N trend data; The 2N periodic data are processed by the initial model to obtain the 2N instance data; or, the 2N trend data are processed by the initial model to obtain the 2N instance data.
12. The method according to claim 10 or 11, characterized in that: Performing comparative learning on the multiple positive sample pairs and the multiple negative sample pairs to update the model parameters of the initial model until the model is characterized, including: Performing pooling processing on the multiple positive sample pairs to obtain multiple pooled positive sample pairs; Performing pooling processing on the multiple negative sample pairs to obtain multiple pooled negative sample pairs; Determine the similarity between two instance data in the plurality of pooled positive sample pairs to obtain a plurality of positive similarities; Determine the similarity between two instance data in the plurality of pooled negative sample pairs to obtain a plurality of negative similarities; According to the multiple positive similarities and the multiple negative similarities, the model parameters of the initial model are updated until the representation model is obtained.
13. A virtual machine performance detection device, characterized in that: include: An acquisition module, a first determination module and a second determination module, wherein: The acquisition module is used to acquire performance data of the virtual machine, wherein the performance data includes performance values of multiple performances of the virtual machine before and after migration; The first determining module is used to determine a first period characteristic and a first trend characteristic of the performance data before the migration, and a second period characteristic and a second trend characteristic of the performance data after the migration; The second determination module is used to determine a performance detection result of the virtual machine after migration according to the first period feature, the second period feature, the first trend feature, and the second trend feature.
14. A representation model training device, characterized in that: include: An acquisition module, a processing module, a determination module and a learning module, wherein: The acquisition module is used to acquire N sample performance data of N sample virtual machines, wherein the sample performance data includes performance values of multiple performances of the sample virtual machines before and after migration, and N is an integer greater than 1; The processing module is used to process the N sample performance data through the initial model to obtain 2N instance data, where the instance data is periodic data or trend data, and the 2N instance data includes N pre-migration instance data and N post-migration instance data; The determination module is used to determine a plurality of positive sample pairs and a plurality of negative sample pairs in the 2N instance data according to the sample virtual machines corresponding to the respective instance data, wherein the positive sample pairs include the instance data before migration and the instance data after migration, and the instance data in the positive sample pairs correspond to the same sample virtual machine, and the negative sample pairs include two instance data, and the two instance data correspond to different sample virtual machines; The learning module is used to perform comparative learning on the multiple positive sample pairs and the multiple negative sample pairs to update the model parameters of the initial model until a characterization model is obtained, and the characterization model is used to determine the periodic characteristics of the target periodic data, or determine the trend characteristics of the target trend data.
15. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the electronic device to perform the method described in any one of claims 1 to 12.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1 to 12 is implemented.
17. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 12 is implemented.