Model training method, resource prediction method, electronic equipment and computing equipment
By dividing equipment sets, joint model and independent model training in the cluster, combined with prediction model selection, the problem of inaccurate predictions caused by the interaction of equipment resource occupancy information is solved, and the prediction accuracy of resource occupancy information is improved.
Patent Information
- Application Number
- CN202410616285.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-16
- Publication Date
- 2024-08-30
AI Technical Summary
In a cluster, due to the mutual influence of resource occupancy information between different devices, it is impossible to accurately predict the resource occupancy information of a device in the future.
By determining the device set in the cluster, perform joint model training and independent model training, obtain the joint prediction model and independent prediction model, combine the two to select the optimal resource prediction model, consider the mutual influence of resource occupation information between devices, and improve prediction accuracy.
Improves the accuracy of device resource occupancy information prediction, ensuring more accurate resource prediction for each device in the cluster.
Smart Images

Figure CN118569353A
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computers, and in particular to a model training method, a resource prediction method, an electronic device, and a computing device. Background Art
[0002] The cluster includes multiple devices. During actual operation, resource occupancy information (eg, resource occupancy rate) of each device at a future moment can be predicted. For example, the resources may be memory resources, processor resources, and the like.
[0003] In the related technology, for any device in the cluster, the resource occupancy information of the device at a future moment can be predicted based on the resource occupancy information of the device in the historical period and the current moment. However, other devices in the cluster may affect the resource occupancy information of the device, resulting in the above method being unable to accurately determine the resource occupancy information of the device at a future moment. Summary of the invention
[0004] The embodiments of the present application provide a model training method, a resource prediction method, an electronic device and a computing device, which are used to solve the problem that the resource occupancy information of the device at the future moment cannot be accurately determined due to the mutual influence of resource occupancy information between different devices in the cluster.
[0005] In a first aspect, an embodiment of the present application provides a model training method, comprising:
[0006] Determine at least one device set in the cluster, where resource occupation information of different devices in the device set is associated with each other;
[0007] Perform joint model training on each device set to obtain a joint prediction model corresponding to each device set;
[0008] Perform independent model training on each device in the cluster to obtain independent prediction models corresponding to each device in the cluster;
[0009] The resource prediction model corresponding to each device in the cluster is determined based on the joint prediction model corresponding to each device set and the independent prediction model corresponding to each device in the cluster. The resource prediction model is used to predict the resource occupancy information of the device in the target time period.
[0010] In a possible implementation, determining a resource prediction model corresponding to each device in the cluster according to a joint prediction model corresponding to each device set and an independent prediction model corresponding to each device in the cluster includes:
[0011] For any device in the cluster, if the device is in any device set, the resource prediction model corresponding to the device is determined according to the joint prediction model corresponding to the device set and the independent prediction model corresponding to the device;
[0012] If the device is not located in at least one device set, the independent prediction model corresponding to the device is determined as the resource prediction model corresponding to the device.
[0013] In a possible implementation, determining a resource prediction model corresponding to a device according to a joint prediction model corresponding to a device set and an independent prediction model corresponding to a device includes:
[0014] Determine a first accuracy of resource prediction for the device by a joint prediction model corresponding to the device set;
[0015] Determine a second accuracy of resource prediction for the device by an independent prediction model corresponding to the device;
[0016] If the first accuracy is greater than or equal to the second accuracy, determining the joint prediction model corresponding to the device set as the resource prediction model corresponding to the device;
[0017] If the first accuracy is less than the second accuracy, the independent prediction model corresponding to the device is determined as the resource prediction model corresponding to the device.
[0018] In a possible implementation, for any device set, a joint model training is performed on the device set to obtain a joint prediction model corresponding to the device set, including:
[0019] Acquire multiple sample data corresponding to the device set, the sample data including sample historical resource occupancy information and annotated resource occupancy information, the sample historical resource occupancy information including resource occupancy information of each device in the device set at multiple sample historical moments, and the annotated resource occupancy information including resource occupancy information of each device in the device set at the annotated moment;
[0020] The model is trained based on multiple sample data to obtain a joint prediction model corresponding to the device set.
[0021] In a possible implementation, the resource occupancy information is the resource occupancy amount; and a plurality of sample data corresponding to the device set is obtained, including:
[0022] Obtain historical resource occupancy information of each device in the device set, where the historical resource occupancy information includes the resource occupancy of the device in a historical period;
[0023] For any device in the device set, the historical resource occupancy information of the device is sampled and missing values are filled to obtain the resource occupancy of the device at multiple historical moments;
[0024] According to the resource usage of each device at multiple historical moments, multiple sample data corresponding to the device set are determined.
[0025] In a possible implementation, determining at least one device set in a cluster includes:
[0026] Acquire at least one associated device information corresponding to the cluster, where the associated device information includes device identifiers of multiple associated devices;
[0027] For any associated device information, the device states of multiple associated devices corresponding to the associated device information in the historical period are obtained, and according to the device states of the multiple associated devices, a device set corresponding to the associated device information is determined from the multiple associated devices, and the device state of each device in the device set is normal.
[0028] In a second aspect, an embodiment of the present application provides a resource prediction method, comprising:
[0029] Determine a set of associated devices in the cluster, wherein resource occupation information of different devices in the set of associated devices has a mutual influence relationship, and resource prediction models corresponding to the devices in the set of associated devices are the same;
[0030] Determine a resource prediction model corresponding to the associated device set;
[0031] The resource occupancy information of each device in the associated device set during the target time period is predicted through a resource prediction model, wherein the resource prediction model is obtained according to the model training method involved in the first aspect and any possible implementation manner.
[0032] In a possible implementation, predicting resource occupancy information of each device in the associated device set during a target period of time by using a resource prediction model includes:
[0033] Get the historical resource usage information of each device in the device set;
[0034] The historical resource occupancy information of each device in the device set is processed through the resource prediction model to obtain the resource occupancy information of each device in the associated device set during the target period.
[0035] In a possible implementation manner, the resource occupancy information is a resource occupancy rate; and the method further includes:
[0036] Obtain a virtual machine creation request, where the virtual machine creation request is used to request deployment of a virtual machine in a cluster within a target period;
[0037] According to the resource occupancy information of each device in the cluster during the target period, a target device is determined in the cluster, and the resource occupancy rate of the target device during the target period is the lowest;
[0038] Deploy a virtual machine on a target device according to a virtual machine creation request.
[0039] In a third aspect, an embodiment of the present application provides a model training device, including: a first determination module, a joint training module, an independent training module, and a second determination module, wherein:
[0040] The first determination module is used to determine at least one device set in the cluster, and resource occupation information of different devices in the device set has an association relationship;
[0041] The joint training module is used to perform joint model training on each device set to obtain a joint prediction model corresponding to each device set;
[0042] The independent training module is used to perform independent model training on each device in the cluster to obtain an independent prediction model corresponding to each device in the cluster;
[0043] The second determination module is used to determine the resource prediction model corresponding to each device in the cluster according to the joint prediction model corresponding to each device set and the independent prediction model corresponding to each device in the cluster. The resource prediction model is used to predict the resource occupancy information of the device in the target time period.
[0044] In a possible implementation, the second determining module is specifically configured to:
[0045] For any device in the cluster, if the device is in any device set, the resource prediction model corresponding to the device is determined according to the joint prediction model corresponding to the device set and the independent prediction model corresponding to the device;
[0046] If the device is not located in at least one device set, the independent prediction model corresponding to the device is determined as the resource prediction model corresponding to the device.
[0047] In a possible implementation, the second determining module is specifically configured to:
[0048] Determine a first accuracy of resource prediction for the device by a joint prediction model corresponding to the device set;
[0049] Determine a second accuracy of resource prediction for the device by an independent prediction model corresponding to the device;
[0050] If the first accuracy is greater than or equal to the second accuracy, determining the joint prediction model corresponding to the device set as the resource prediction model corresponding to the device;
[0051] If the first accuracy is less than the second accuracy, the independent prediction model corresponding to the device is determined as the resource prediction model corresponding to the device.
[0052] In a possible implementation, for any set of devices, the joint training module is specifically used to:
[0053] Acquire multiple sample data corresponding to the device set, the sample data including sample historical resource occupancy information and annotated resource occupancy information, the sample historical resource occupancy information including resource occupancy information of each device in the device set at multiple sample historical moments, and the annotated resource occupancy information including resource occupancy information of each device in the device set at the annotated moment;
[0054] The model is trained based on multiple sample data to obtain a joint prediction model corresponding to the device set.
[0055] In a possible implementation, the resource occupancy information is the resource occupancy amount; and the joint training module is specifically used for:
[0056] Obtain historical resource occupancy information of each device in the device set, where the historical resource occupancy information includes the resource occupancy of the device in a historical period;
[0057] For any device in the device set, the historical resource occupancy information of the device is sampled and missing values are filled to obtain the resource occupancy of the device at multiple historical moments;
[0058] According to the resource usage of each device at multiple historical moments, multiple sample data corresponding to the device set are determined.
[0059] In a possible implementation, the first determining module is specifically configured to:
[0060] Acquire at least one associated device information corresponding to the cluster, where the associated device information includes device identifiers of multiple associated devices;
[0061] For any associated device information, the device states of multiple associated devices corresponding to the associated device information in the historical period are obtained, and according to the device states of the multiple associated devices, a device set corresponding to the associated device information is determined from the multiple associated devices, and the device state of each device in the device set is normal.
[0062] In a fourth aspect, an embodiment of the present application provides a resource prediction device, comprising: a first determination module, a second determination module and a prediction module, wherein:
[0063] The first determination module is used to determine a set of associated devices in the cluster, wherein resource occupation information of different devices in the set of associated devices has a mutual influence relationship, and resource prediction models corresponding to the devices in the set of associated devices are the same;
[0064] The second determination module is used to determine the resource prediction model corresponding to the associated device set;
[0065] The prediction module is used to predict the resource occupancy information of each device in the associated device set during the target time period through a resource prediction model, wherein the resource prediction model is obtained according to the model training method involved in the first aspect and any possible implementation method.
[0066] In a possible implementation, the prediction module is specifically used to:
[0067] Get the historical resource usage information of each device in the device set;
[0068] The historical resource occupancy information of each device in the device set is processed through the resource prediction model to obtain the resource occupancy information of each device in the associated device set during the target period.
[0069] In a possible implementation, the resource occupancy information is a resource occupancy rate; the device further includes a creation module, wherein the creation module is used to:
[0070] Obtain a virtual machine creation request, where the virtual machine creation request is used to request deployment of a virtual machine in a cluster within a target period;
[0071] According to the resource occupancy information of each device in the cluster during the target period, a target device is determined in the cluster, and the resource occupancy rate of the target device during the target period is the lowest;
[0072] Deploy a virtual machine on a target device according to a virtual machine creation request.
[0073] In a fifth aspect, an embodiment of the present application provides an electronic device, the electronic device including a memory and a processor;
[0074] Memory and processor coupling;
[0075] The memory is used to store program instructions;
[0076] The processor is used to call program instructions so that the electronic device executes the model training method involved in the first aspect and any possible implementation method.
[0077] In a sixth aspect, an embodiment of the present application provides a computing device, the computing device including a memory and a processor;
[0078] Memory and processor coupling;
[0079] The memory is used to store program instructions;
[0080] The processor is used to call program instructions to enable the computing device to execute the resource prediction method involved in the second aspect and any possible implementation manner.
[0081] In the seventh aspect, 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 an electronic device, they are used to implement the module training method involved in the first aspect and any possible implementation method.
[0082] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When the computer execution instructions are used by a first computing device, they are used to implement the resource prediction method involved in the second aspect and any possible implementation method.
[0083] In the ninth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by an electronic device, implements the model training method involved in the first aspect and any possible implementation method.
[0084] In the tenth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a first computing device, implements the resource prediction method involved in the second aspect and any possible implementation method.
[0085] In the model training method, resource prediction method, electronic device and computing device shown in the embodiments of the present application, the model training method determines a device set, performs joint model training on the device set, and obtains a joint prediction model corresponding to each device set. Perform independent model training on each device in the cluster to obtain an independent prediction model corresponding to each device in the cluster. According to the joint prediction model and the independent prediction model, a resource prediction model for each device in the cluster is selected. The resource prediction method predicts the resource occupancy information of the device in the target time period based on the resource prediction model of each device in the cluster. When each device in the cluster performs resource prediction, it is considered that the resource occupancy information of different devices in the cluster may affect each other, so that when predicting the resource occupancy information of the device, the prediction accuracy is higher. BRIEF DESCRIPTION OF THE DRAWINGS
[0086] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0087] Figure 1 An architecture diagram of a cluster provided in an embodiment of the present application;
[0088] Figure 2 A flowchart of a model training method provided in an embodiment of the present application;
[0089] Figure 3 A schematic diagram of a joint model training method provided in an embodiment of the present application;
[0090] Figure 4 A flowchart of another model training method provided in an embodiment of the present application;
[0091] Figure 5 A schematic diagram of a process flow of a resource prediction method provided in an embodiment of the present application;
[0092] Figure 6 A schematic diagram of a virtual machine deployment process provided in an embodiment of the present application;
[0093] Figure 7 A schematic diagram of the structure of a model training device provided in an embodiment of the present application;
[0094] Figure 8 A schematic diagram of the structure of a resource prediction device provided in an embodiment of the present application;
[0095] Fig. 9 A schematic diagram of the structure of another resource prediction device provided in an embodiment of the present application;
[0096] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0097] Fig.11 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0098] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the appended claims.
[0099] The cluster includes multiple devices. The method shown in the embodiment of the present application can be used to predict the resource occupancy information of various resources of each device in the cluster in the future period. For example, the various resources may include: memory resources, bandwidth resources, processor resources, etc. Resource occupancy information includes but is not limited to: resource occupancy amount, resource occupancy rate, etc.
[0100] For ease of understanding, the following Figure 1 , introducing the architecture diagram of the cluster to which the embodiments of the present application are applicable.
[0101] Figure 1This is a diagram of the cluster architecture provided in this application example. Figure 1 , a cluster includes multiple devices. In actual applications, the resource occupancy information of some devices in the cluster may be associated with each other (mutually affecting each other), for example, the memory usage of device 1 in the cluster will affect the memory usage of device 2. The resource occupancy information of some devices in the cluster may not be associated with each other, for example, the memory usage of device 1 in the cluster is not affected by the memory usage of any other device.
[0102] Based on the correlation between resource occupancy information of each device in the cluster, multiple device sets can be divided in the cluster, wherein resource occupancy information of different devices in one device set is correlated with each other, and resource occupancy information of devices in different device sets is not correlated with each other.
[0103] For example, assuming that there are 10 devices in a cluster, and there is an association between the resource occupancy information of device 1, device 2, device 6, and device 7, then devices 1, device 2, device 6, and device 7 are divided into device set 1. There is no association between the resource occupancy information of devices 3, device 4, and device 5 and the resource occupancy information of other devices in the cluster, so they are not divided into device sets. There is an association between the resource occupancy information of devices 8, device 9, and device 10, so devices 8, device 9, and device 10 are divided into device set 2.
[0104] It should be noted that Figure 1 The diagram is merely an example of a cluster architecture and is not intended to limit the cluster architecture.
[0105] In the related art, the resource occupancy information of any device in the past period and at the current moment is used to predict the resource occupancy information of the device at the future moment. The resource occupancy information of the device may be affected by other devices, resulting in a low prediction accuracy of the resource occupancy information of the device at the future moment.
[0106] In the embodiment of the present application, the resource occupancy information of each device in the cluster in the future period can be predicted by the model, and if the resource occupancy information of multiple devices in the cluster affects each other, the multiple devices can be simultaneously trained with a joint model, and independent model training can be performed for a single device to obtain the optimal resource prediction model for each device. In the process of training the resource prediction model corresponding to the device, the mutual influence of the resource occupancy information of different devices is taken into account, so when performing resource prediction through the resource prediction model, the accuracy of resource prediction is improved.
[0107] The test equipment shown in the present application is 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 repeated in different embodiments.
[0108] Figure 2 A flow chart of a model training method provided in an embodiment of the present application. Figure 2 , the method may include:
[0109] S201. Determine at least one device set in a cluster.
[0110] The execution subject of the embodiment of the present application can be a model training device, or a model training device set in the model training device. The model training device can be a server or other equipment, and the model training device can be implemented by software, or by a combination of software and hardware.
[0111] The device set includes at least two devices. In actual application, the minimum number of devices included in a device set can also be set according to actual needs. For example, the device set can be set to include at least three devices.
[0112] The resource occupation information of different devices in a device set is associated with each other, that is, the resource occupation information of one device in the device set will affect the resource occupation information of other devices in the device set.
[0113] There is no correlation between resource occupancy information in different device sets, that is, resource occupancy information of any device in a device set will not affect resource occupancy information of other devices in the cluster.
[0114] At least one device set may be determined in the cluster in the following manner: determining whether resource occupation information of every two devices in the cluster has an association relationship, and determining at least one device set in the cluster based on whether resource occupation information of every two devices in the cluster has an association relationship.
[0115] Assuming that a device set includes at least 3 devices, if the resource occupancy information of any device in the cluster is associated with the resource occupancy information of at least two other devices, the device and the other at least two devices are divided into a device set. If the resource occupancy information of a device in the cluster is not associated with the resource occupancy information of other devices, or is associated with the resource occupancy information of only one device, the target device is not divided into a device set.
[0116] For example, assuming that the cluster includes device 1, device 2, device 3, device 4, device 5, and device 6, and a device set includes at least 3 devices, if there is an association relationship between the resource occupancy information of device 1, device 2, and device 3, then device 1, device 2, and device 3 are determined as a device set. If there is an association relationship between the resource occupancy information of device 4 and device 5, and there is no association relationship between the resource occupancy information of device 6 and any other device, then device 4, device 5, and device 6 are not divided into device sets.
[0117] S202: Perform joint model training on each device set to obtain a joint prediction model corresponding to each device set.
[0118] The joint prediction model can be a spatiotemporal graph neural network, which is a neural network model used to process spatiotemporal data. It combines the characteristics of graph neural networks and time series data and can model and learn spatiotemporal relationships. Among them, the spatiotemporal graph neural network can be a Graph WaveNet spatiotemporal graph neural network model.
[0119] For any device set, joint model training for the device set means using the historical data of each device in the device set as training samples for model training. In the process of joint model training for the device set, the mutual influence relationship between the resource occupancy information of each device in the device set can be learned.
[0120] S203: Perform independent model training on each device in the cluster to obtain an independent prediction model corresponding to each device in the cluster.
[0121] The standalone model can be a Temporal Convolutional Network (TCN), which is specifically designed to process time series data and uses convolution operations to learn patterns and long-range dependencies in time series. TCN networks are widely used in various time series prediction and analysis tasks.
[0122] For any device in the cluster, independent model training for the device means using the historical data of the device as training samples for model training. In the process of independent model training for the device, the changing pattern of the resource occupancy information of the device itself can be learned.
[0123] S204: Determine a resource prediction model corresponding to each device in the cluster according to the joint prediction model corresponding to each device set and the independent prediction model corresponding to each device in the cluster.
[0124] For any device in the cluster, the resource prediction model corresponding to the device can be determined in the following way: if the device is located in any device set, the resource prediction model corresponding to the device is determined based on the joint prediction model corresponding to the device set and the independent prediction model corresponding to the device; if the device is not located in at least one device set, the independent prediction model corresponding to the device is determined as the resource prediction model corresponding to the device.
[0125] For example, assuming that device 1 in the cluster is in device set 1, and device 1 corresponds to joint prediction model 1 and independent prediction model 1, the resource prediction model of device 1 is determined in joint prediction model 1 and independent prediction model 1. Assuming that device 2 in the cluster is not in any device set, and device 2 corresponds to independent prediction model 2, independent prediction model 2 is determined as the resource prediction model of device 2.
[0126] exist Figure 2 In the illustrated embodiment, the device set is determined by judging whether there is a correlation between the resource occupancy information of different devices in the cluster, so that the resource occupancy information of different devices in the device set has a correlation. When performing model training, joint model training is performed on each device set, and independent model training is performed on each device to obtain a joint prediction model corresponding to each device set and an independent prediction model corresponding to each device, and the optimal resource prediction model for each device is selected from the joint prediction model and the independent prediction model. In the process of training the resource prediction model corresponding to the device, the mutual influence of the resource occupancy information of different devices is taken into account. Therefore, when performing resource prediction through the resource prediction model, the accuracy of resource prediction is improved.
[0127] Based on any of the above embodiments, for any device set, joint model training can be performed on the device set in the following manner: multiple sample data corresponding to the device set are obtained, and model training is performed based on the multiple sample data to obtain a joint prediction model corresponding to the device set. Figure 3 The embodiment shown in the figure illustrates the process of joint model training for a set of devices. Figure 3 In the illustrated embodiment, the resource occupancy information is described by taking the resource occupancy amount as an example.
[0128] Figure 3 Schematic diagram of the joint model training method provided in the embodiment of the present application. Figure 3 , the method may include:
[0129] S301: Obtain historical resource occupancy information of each device in a device set.
[0130] The historical resource occupancy information includes the resource occupancy of the device in a historical period.
[0131] The historical period may be a period of preset duration before the current moment, for example, the historical period may be one month, two months, etc. before the current moment.
[0132] The resource usage is related to the resource. For example, when the resource is a memory resource, the resource usage may be the size of the occupied memory. When the resource is a bandwidth resource, the resource usage may be the size of the occupied bandwidth. When the resource is a processor resource, the resource usage may be the number of occupied processor cores.
[0133] The historical resource occupancy information may include the resource occupancy of the device at each moment in the historical period. For example, the historical resource occupancy information may include the resource occupancy of the device per second in the historical period.
[0134] For any device in the cluster, during the operation of the device, the historical resource occupancy information of the device can be stored in the preset storage space. Correspondingly, the historical resource occupancy information of the device can be obtained in the preset storage space.
[0135] S302: For any device in the device set, perform sampling processing and missing value filling processing on the historical resource occupancy information of the device to obtain the resource occupancy of the device at multiple historical moments.
[0136] The historical resource occupancy information can be sampled to obtain the resource occupancy at multiple sampling moments, and the missing value filling processing can be performed on the resource occupancy at the sampling moment to obtain the resource occupancy of the device at multiple historical moments. The multiple historical moments include multiple sampling moments, that is, the sampling moment is a part of the multiple historical moments.
[0137] The historical resource occupancy information can be sampled and processed in the following manner: for the historical resource occupancy information, a certain time interval is set, and the time interval is used as the time interval of the sampling moment to sample the historical resource occupancy information, and the last moment of each time interval in the historical resource occupancy information is used as the sampling moment to obtain the resource occupancy at multiple sampling moments.
[0138] For example, assuming that the historical occupancy information of device 1 includes: the resource occupancy of device 1 per second in the historical 30 days, and assuming that the sampling processing time interval is 1 hour, the last second of each hour in the historical 30 days is determined as the sampling moment, and 720 (30*24) sampling moments are obtained, and the resource occupancy at each sampling moment is obtained in the historical occupancy information.
[0139] The missing values of resource occupancy at the sampling moment can be filled in the following way: for the resource occupancy at multiple sampling moments obtained by sampling, if the resource occupancy at a certain moment is missing, the resource occupancy at the moment before the moment in the historical resource occupancy information is used as the resource occupancy at the moment, and the resource occupancy of the device at multiple historical moments is obtained.
[0140] For example, assume that the historical resource occupancy information of device 1 includes: the resource occupancy of device 1 per second in the past 5 hours, the sampling interval is one hour, and the resource occupancy of device 1 in the first hour, the second hour, the fourth hour, and the fifth hour is obtained by sampling. If the resource occupancy obtained by sampling is missing the resource occupancy of the third hour, the resource occupancy of the second hour is used as the resource occupancy of the third hour, and the resource occupancy of device 1 in the first hour, the second hour, the third hour, the fourth hour, and the fifth hour are obtained.
[0141] After sampling or missing value filling, the resource usage can also be converted into units. Unit conversion refers to converting the unit of resource usage into another unit.
[0142] For example, assuming that the resource occupancy at multiple historical moments is the resource occupancy at moments t1, t2, t3, and t4, and the resource occupancy at moments t1, t2, t3, and t4 is in bytes, and the resource prediction model requires that the historical resource occupancy is in GB during the training process. The units of the resource occupancy at moments t1, t2, t3, and t4 can be converted to convert the resource occupancy in bytes into the resource occupancy in GB.
[0143] S303: Determine a plurality of sample data corresponding to the device set according to the resource usage of each device at a plurality of historical moments.
[0144] The sample data includes sample historical resource usage and annotated resource usage. The sample historical resource usage includes the resource usage of each device in the device set at multiple sample historical moments, and the annotated resource usage includes the resource usage of each device in the device set at the annotated moment. The annotated moment is located after multiple sample historical moments, for example, the standard moment may be a moment after the last sample historical moment.
[0145] The multiple sample data corresponding to the device set can be determined in the following manner: multiple time windows can be determined, and the sample data corresponding to each time window can be determined from the resource usage of each device at multiple historical moments, and one time window corresponds to one sample data. A time window includes M historical moments, where M is an integer greater than 1. The sample data corresponding to any time window includes: the resource usage of each device in the device set at multiple historical moments within the time window.
[0146] For example, assuming that device set 1 includes device 1, device 2, and device 3, the resource usage of each device in device set 1 at multiple historical moments is the resource usage of device 1, device 2, and device 3 in 100 historical moments.
[0147] Assuming that time window 1 is from time 1 to time 10, the sample data 1 corresponding to time window 1 is as follows:
[0148]
[0149] Among them, x 11 represents the resource usage of device 1 at the first moment, x 12 represents the resource usage of device 1 at the second moment, x 21 The first 9 columns in the matrix can be the sample historical resource occupancy in sample data 1, and the last column in the matrix can be the annotated resource occupancy in sample data 1.
[0150] Assuming that time window 2 is from time 3 to time 12, the sample data 2 corresponding to time window 2 is as follows:
[0151]
[0152] Among them, x 13 represents the resource usage of device 1 at the third moment, x 12 represents the resource usage of device 1 at the fourth moment, x 21 Indicates the resource usage of device 2 at the third moment. And so on. The first 9 columns in the above matrix can be the sample historical resource usage in sample data 2, and the last column in the above matrix can be the annotated resource usage in sample data 2.
[0153] S304: Perform model training based on multiple sample data to obtain a joint prediction model corresponding to the device set.
[0154] In the process of training the joint prediction model, multiple iterative trainings are required. For any iterative training, the historical resource occupancy of the samples in the sample data can be used as the input data of the model. After the model processes the input data, the predicted resource occupancy of each device in the device set is obtained, and the model parameters of the model are updated according to the predicted resource occupancy and the labeled resource occupancy.
[0155] For example, device set 1 includes device 1, device 2, and device 3. Assuming that the sample data 1 of device set 1 is as follows, when any iteration of model training is performed based on the following sample data 1, the first 9 columns of the following sample data 1 can be used as the input data of the model. After the model processes the input data, the predicted resource usage of each device can be obtained, and the predicted resource usage and the labeled resource usage (x 110 、x 210 and x 310 ), update the model parameters of the model.
[0156]
[0157] For any iterative training, the model parameters of the model can be updated in the following manner: the model loss can be determined according to the loss function, the predicted resource usage, and the labeled resource usage, and the model parameters of the model can be updated according to the model loss.
[0158] For any device in the device set, the predicted resource occupancy and the marked resource occupancy can be subtracted, and the root mean square error (RMSE) and mean absolute error (MAE) are used to process the difference corresponding to each device in the device set, and the weights of the results obtained after RMSE processing and the results obtained after MAE processing are taken as the model loss of the joint prediction model. The weights of RMSE and MAE are 0.5 respectively.
[0159] The loss function can be expressed as: Loss = 0.5RMSE + 0.5MAE, where
[0160]
[0161]
[0162] Among them, i represents the i-th device in the device set, m represents the total number of m devices in the device set, and X obs,i represents the predicted value of resource usage of the i-th device in the device set at the marked time, X model,i Indicates the resource usage of the i-th device in the device set at the marked time.
[0163] The training effect of the joint prediction model is optimized through continuous iterative training, so that the predicted value of the resource usage of each device in the device set at the time of annotation is closer and closer to the annotated data of the device, that is, the model loss of the joint prediction model is getting smaller and smaller during the iterative training process. Until the model loss reaches a convergence state, that is, when the model loss tends to be stable, the training of the joint prediction model is stopped to obtain the final joint prediction model.
[0164] exist Figure 3 In the illustrated embodiment, when joint model training is performed on each device set in the cluster, the historical resource occupancy of each device in the device set is processed using sampling processing and missing value filling processing operations to obtain the resource occupancy of each device in the device set at multiple historical moments. Multiple sample data corresponding to the device set are obtained based on the resource occupancy of each device in the device set at multiple historical moments, and the joint model is trained using the multiple sample data. The joint prediction model is trained for the device set, taking into account the mutual influence relationship between the resource occupancy of different devices, thereby improving the prediction effect of the joint prediction model when predicting resources for the device.
[0165] Based on any of the above embodiments, Figure 4 , the model training process is further explained in detail.
[0166] Figure 4 A flowchart of another model training method provided in an embodiment of the present application. Figure 4 , the method may include:
[0167] S401: Obtain at least one associated device information corresponding to a cluster.
[0168] The associated device information includes device identifications of multiple associated devices, and resource occupation information of the multiple associated devices is associated with each other.
[0169] S402: For any associated device information, obtain device states of multiple associated devices corresponding to the associated device information in a historical period, and determine a device set corresponding to the associated device information from the multiple associated devices according to the device states of the multiple associated devices.
[0170] Among them, the device status of each device in the device set is normal.
[0171] The device status is normal or abnormal.
[0172] For any associated device, if the associated device works normally during the historical period, the device status of the associated device during the historical period is normal; if the associated device works abnormally during the historical period, the status of the associated device during the historical period is abnormal.
[0173] The device set may be determined in the following manner: a plurality of associated devices may be determined as an initial device set, and associated devices in an abnormal state may be removed from the initial device set to obtain a device set.
[0174] Optionally, the user can also manually modify the device set to make the division of the device set more flexible. At the same time, if there are special needs, the division of the device set can also be made to better meet the specific needs of the user.
[0175] S403: Perform joint model training on each device set to obtain a joint prediction model corresponding to each device set.
[0176] It should be noted that the execution process of S403 can be found in Figure 3 The embodiments shown will not be described in detail here.
[0177] S404: Perform independent model training on each device in the cluster to obtain an independent prediction model corresponding to each device in the cluster.
[0178] In the process of training an independent prediction model, multiple iterative trainings are required. For any iterative training, the historical resource occupancy of the samples in the sample data can be used as the input data of the model. After the model processes the input data, the predicted resource occupancy of the device is obtained, and the model parameters of the model are updated according to the predicted resource occupancy and the labeled resource occupancy.
[0179] For example, assuming that the sample data 1 of device 1 is as follows, when any iterative training of the model is performed based on the sample data 1, the first 9 columns of the following sample data 1 can be used as the input data of the model. After the model processes the input data, the predicted resource usage of device 1 can be obtained, and the predicted resource usage and the labeled resource usage (x 110 ), update the model parameters.
[0180] [x 11 ,x 12 ,x 13 ...x 19 ,x 110 ]
[0181] For any iterative training, the model parameters of the model can be updated in the following ways: the model loss can be determined based on the loss function, the predicted resource usage, and the labeled resource usage, and the model parameters of the model can be updated based on the model loss. For any device in the cluster, the predicted resource usage and the labeled resource usage can be subtracted, and the absolute value of the difference can be calculated. The absolute value obtained is the model loss of the model.
[0182] The loss function can be expressed as: Loss = |X obs -X model |.
[0183] S405 . For any device in the cluster, determine whether the device is located in any device set.
[0184] If yes, execute S406.
[0185] If not, execute S410.
[0186] S406: Determine a first accuracy of resource prediction for the device by the joint prediction model corresponding to the device set.
[0187] The first accuracy may be determined in the following manner: for any device in the device set, use the joint prediction model corresponding to the device set to perform resource prediction on the device, and use the prediction accuracy as the first accuracy.
[0188] For example, assuming that device 1 is in device set 1, the joint prediction model corresponding to device set 1 is joint prediction model 1. When joint prediction model 1 performs resource prediction on device 1, the prediction accuracy is A, and prediction accuracy A is used as the first accuracy.
[0189] S407: Determine a second accuracy of resource prediction for the device by the independent prediction model corresponding to the device.
[0190] The second precision can be determined as follows:
[0191] For any device in the device set, resource prediction is performed on the device using the independent prediction model corresponding to the device set, and the prediction accuracy is used as the second accuracy.
[0192] For example, assuming that the independent resource prediction model of device 1 is independent prediction model 1, when independent prediction model 1 performs resource prediction on device 1, the prediction accuracy is B, and the prediction accuracy B is used as the second accuracy.
[0193] S408: Determine whether the first precision is greater than or equal to the second precision.
[0194] If yes, execute step S409.
[0195] If not, execute step S410.
[0196] For example, assuming that device 1 is in device set 1, the joint prediction model corresponding to device set 1 is joint prediction model 1, and the independent prediction model corresponding to device 1 is independent prediction model 1. When joint prediction model 1 performs resource prediction on device 1, the prediction accuracy is A, and when independent prediction model 1 performs resource prediction on device 1, the prediction accuracy is B. If A is greater than or equal to B, step S409 is executed, and if A is less than B, step S410 is executed.
[0197] S409: Determine the joint prediction model corresponding to the device set as the resource prediction model corresponding to the device.
[0198] For example, assuming that the joint prediction model corresponding to device 1 is joint prediction model 1, joint prediction model 1 is used as the resource prediction model of device 1.
[0199] S410: Determine the independent prediction model corresponding to the device as the resource prediction model corresponding to the device.
[0200] For example, assuming that the independent resource prediction model corresponding to device 1 is independent resource prediction model 1, independent resource prediction model 1 is used as the resource prediction model of device 1.
[0201] exist Figure 4 In the illustrated embodiment, when it is necessary to train the resource prediction model for each device in the cluster, the device set is first determined, and the joint model training is performed on the device set to obtain the joint prediction model corresponding to each device set. At the same time, independent model training is performed on each device in the cluster to obtain an independent prediction model corresponding to each device. For any device in the cluster, the joint prediction model corresponding to the device set to which the device belongs and the independent prediction model corresponding to the device are used to perform resource prediction on the device, and the prediction accuracy of the two models is compared, and the model with the best prediction accuracy is selected as the resource prediction model for the device. The prediction effect when performing resource prediction on each device in the cluster is improved.
[0202] Based on the resource prediction model obtained by training the above model, Figure 5 , introduces a resource prediction method for performing resource prediction on a device using a resource prediction model.
[0203] Figure 5 This is a flow chart of the resource prediction method provided in the embodiment of the present application. Figure 5 , the method may include:
[0204] S501: Determine a set of associated devices in a cluster.
[0205] The resource occupation information of different devices in the associated device set has a mutual influence relationship, and the resource prediction models corresponding to the devices in the associated device set are the same.
[0206] During the model training phase, a corresponding resource prediction model is determined for each device in the cluster. The resource prediction models corresponding to some devices are independent prediction models, while the resource prediction models corresponding to some devices are joint prediction models.
[0207] The associated device set may be determined in the cluster in the following manner: devices in the cluster corresponding to the same joint prediction model are determined as an associated device set.
[0208] The number of associated device sets can be one or more.
[0209] S502: Determine a resource prediction model corresponding to the associated device set.
[0210] The resource prediction model corresponding to the associated device set is a joint prediction model.
[0211] Since the resource prediction models corresponding to the devices in the associated device set are the same, the resource prediction model corresponding to any device in the associated device set can be determined as the resource prediction model corresponding to the associated device set.
[0212] S503: Predict resource occupancy information of each device in the associated device set during a target period of time using a resource prediction model.
[0213] The resource occupancy information may be the resource occupancy amount or the resource occupancy rate.
[0214] The historical resource occupancy information of each device in the device set can be obtained, and the historical resource occupancy information of each device in the device set can be processed through the resource prediction model to obtain the resource occupancy information of each device in the associated device set in the target time period.
[0215] The historical resource occupancy information may be the resource occupancy information of each device in a historical period. For example, the historical period may be one month or two months before the current time.
[0216] The target time period is a future time period, for example, the target time period may be the next hour, the next day, etc.
[0217] The historical resource occupancy information of each device may be input into a resource prediction model, and the historical resource occupancy information of each device may be processed by the resource prediction model to obtain the resource occupancy information of each device in a target period.
[0218] exist Figure 5In the illustrated embodiment, a set of associated devices and a resource prediction model corresponding to the set of associated devices are determined, first historical resource occupancy information and second historical resource occupancy information are determined based on resource occupancy information of each device in the set of associated devices at multiple historical moments, and the first historical resource occupancy information and the second historical resource occupancy information are processed using the resource prediction model to obtain predicted resource occupancy information of each device in the set of associated devices during a target period. When predicting the resource occupancy information of a device, the mutual influence relationship between resource occupancy information of different devices is taken into account, thereby improving the prediction accuracy when predicting the resource occupancy information of a device.
[0219] Based on the above resource prediction method for each device in the cluster, Figure 6 The embodiment shown in the figure illustrates the deployment of virtual machines in a cluster. Figure 6 In the illustrated embodiment, the resource occupancy information is described by taking the resource occupancy rate as an example.
[0220] Figure 6 For a virtual machine deployment process diagram provided in an embodiment of the present application, see Figure 6 , the method may include:
[0221] S601: Obtain a virtual machine creation request.
[0222] The virtual machine creation request is used to request deployment of the virtual machine in the cluster within a target period.
[0223] S602: Determine a target device in the cluster according to the resource occupancy rate of each device in the cluster during the target period.
[0224] The device with the lowest resource usage in the cluster during the target period may be determined as the target device.
[0225] S603: Deploy a virtual machine in the target device according to the virtual machine creation request.
[0226] For example, cluster 1 includes device 1, device 2, and device 3. If the target device is determined to be device 1, the virtual machine is deployed on device 1.
[0227] exist Figure 6 In the illustrated embodiment, by predicting the resource occupancy rate of each device in the cluster during the target period, the virtual machine is deployed on the device with the lowest resource occupancy rate during the target period. In the process of deploying the virtual machine, the resource occupancy rate of the device during the target period is taken into account, which can make the deployment of the virtual machine more reasonable and avoid the memory resources of the cluster being affected due to unreasonable deployment of the virtual machine.
[0228] Figure 7 This is a schematic diagram of the structure of a model training device provided in an embodiment of the present application. Figure 7 The model training device 10 may include: a first determination module 11, a joint training module 12, an independent training module 13 and a second determination module 14, wherein:
[0229] The first determination module 11 is used to determine at least one device set in the cluster, and resource occupation information of different devices in the device set has an association relationship;
[0230] The joint training module 12 is used to perform joint model training on each device set to obtain a joint prediction model corresponding to each device set;
[0231] The independent training module 13 is used to perform independent model training on each device in the cluster to obtain an independent prediction model corresponding to each device in the cluster;
[0232] The second determination module 14 is used to determine the resource prediction model corresponding to each device in the cluster according to the joint prediction model corresponding to each device set and the independent prediction model corresponding to each device in the cluster. The resource prediction model is used to predict the resource occupancy information of the device in the target time period.
[0233] The model training device provided in this embodiment can be used to execute the model training method shown in the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail here.
[0234] In a possible implementation, the second determining module 14 is specifically configured to:
[0235] For any device in the cluster, if the device is in any device set, the resource prediction model corresponding to the device is determined according to the joint prediction model corresponding to the device set and the independent prediction model corresponding to the device;
[0236] If the device is not located in at least one device set, the independent prediction model corresponding to the device is determined as the resource prediction model corresponding to the device.
[0237] In a possible implementation, the second determining module 14 is specifically configured to:
[0238] Determine a first accuracy of resource prediction for the device by a joint prediction model corresponding to the device set;
[0239] Determine a second accuracy of resource prediction for the device by an independent prediction model corresponding to the device;
[0240] If the first accuracy is greater than or equal to the second accuracy, determining the joint prediction model corresponding to the device set as the resource prediction model corresponding to the device;
[0241] If the first accuracy is less than the second accuracy, the independent prediction model corresponding to the device is determined as the resource prediction model corresponding to the device.
[0242] In a possible implementation, for any set of devices, the joint training module 12 is specifically used to:
[0243] Acquire multiple sample data corresponding to the device set, the sample data including sample historical resource occupancy information and annotated resource occupancy information, the sample historical resource occupancy information including resource occupancy information of each device in the device set at multiple sample historical moments, and the annotated resource occupancy information including resource occupancy information of each device in the device set at the annotated moment;
[0244] The model is trained based on multiple sample data to obtain a joint prediction model corresponding to the device set.
[0245] In a possible implementation, the resource occupancy information is the resource occupancy amount; the joint training module 12 is specifically used for:
[0246] Obtain historical resource occupancy information of each device in the device set, where the historical resource occupancy information includes the resource occupancy of the device in a historical period;
[0247] For any device in the device set, the historical resource occupancy information of the device is sampled and missing values are filled to obtain the resource occupancy of the device at multiple historical moments;
[0248] According to the resource usage of each device at multiple historical moments, multiple sample data corresponding to the device set are determined.
[0249] In a possible implementation, the first determining module 11 is specifically configured to:
[0250] Acquire at least one associated device information corresponding to the cluster, where the associated device information includes device identifiers of multiple associated devices;
[0251] For any associated device information, the device states of multiple associated devices corresponding to the associated device information in the historical period are obtained, and according to the device states of the multiple associated devices, a device set corresponding to the associated device information is determined from the multiple associated devices, and the device state of each device in the device set is normal.
[0252] The model training device provided in this embodiment can be used to execute the model training method shown in the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail here.
[0253] Figure 8 For a schematic diagram of a resource prediction device provided in an embodiment of the present application, see Figure 8The resource prediction device 20 may include: a first determination module 21, a second determination module 22 and a prediction module 23, wherein:
[0254] The first determination module 21 is used to determine a set of associated devices in the cluster, where resource occupation information of different devices in the set of associated devices has a mutual influence relationship, and resource prediction models corresponding to the devices in the set of associated devices are the same;
[0255] The second determination module 22 is used to determine the resource prediction model corresponding to the associated device set;
[0256] The prediction module 23 is used to predict the resource occupancy information of each device in the associated device set during the target time period through a resource prediction model, wherein the resource prediction model is obtained according to the model training method involved in the first aspect and any possible implementation method.
[0257] The resource prediction device provided in this embodiment can be used to execute the resource prediction method shown in the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail here.
[0258] In a possible implementation, the prediction module 23 is specifically used to:
[0259] Get the historical resource usage information of each device in the device set;
[0260] The historical resource occupancy information of each device in the device set is processed through the resource prediction model to obtain the resource occupancy information of each device in the associated device set during the target period.
[0261] Fig. 9 A schematic diagram of the structure of another resource prediction device provided in an embodiment of the present application, in Figure 8 Based on the examples shown, see Fig. 9 The device further includes a creation module 24, wherein the creation module 24 is used to:
[0262] A virtual machine creation request, which is used to request to deploy a virtual machine in the cluster within a target period;
[0263] According to the resource occupancy information of each device in the cluster during the target period, a target device is determined in the cluster, the resource occupancy rate of the target device during the target period is the lowest, and the resource occupancy information is the resource occupancy rate;
[0264] Deploy a virtual machine on a target device according to a virtual machine creation request.
[0265] The resource prediction device provided in this embodiment can be used to execute the resource prediction method shown in the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail here.
[0266] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Fig.10 As shown, the electronic device 40 may include: a memory 41 and a processor 42 .
[0267] Among them, the memory 41 and the processor 42 are coupled and can communicate with each other; exemplarily, the memory 41 and the processor 42 communicate through the communication bus 33, the memory 41 is used to store computer execution instructions, and the processor 42 is used to call program instructions so that the electronic device executes the model training method involved in the first aspect and any possible implementation method.
[0268] Fig.11 A schematic diagram of a computing device provided in an embodiment of the present application is shown in FIG. Fig.10 As shown, the computing device 50 may include: a memory 51 and a processor 52;
[0269] Among them, the memory 51 and the processor 52 are coupled and can communicate with each other; illustratively, the memory 51 and the processor 52 communicate through the communication bus 43, the memory 51 is used to store computer execution instructions, and the processor 52 is used to call program instructions so that the computing device executes the resource prediction method involved in the second aspect and any possible implementation method.
[0270] Optionally, the electronic device may be the same as the computing device, or the electronic device may execute any one of the methods in the embodiments of the present application, and the computing device may also execute any one of the methods in the embodiments of the present application.
[0271] Optionally, the processor may be a central processing unit (CPU), a graphics processing unit (GPU), other general-purpose processors, a digital signal processor (DSP), or an application-specific integrated circuit (ASIC). A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of the present application may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
[0272] 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 an electronic device, they are used to implement the module training method involved in the first aspect and any possible implementation method.
[0273] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. The computer-executable instructions are used by a first computing device to implement the resource prediction method involved in the second aspect and any possible implementation method.
[0274] An embodiment of the present application provides a computer program product, including a computer program, which, when executed by an electronic device, implements the model training method involved in the first aspect and any possible implementation method.
[0275] An embodiment of the present application provides a computer program product, including a computer program, which, when executed by a first computing device, implements the resource prediction method involved in the second aspect and any possible implementation manner.
[0276] All or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned memory (storage medium) includes: read-only memory (English: read-only memory, abbreviated: ROM), RAM, flash memory, hard disk, solid state drive, magnetic tape (English: magnetic tape), floppy disk (English: floppy disk), optical disc (English: optical disc) and any combination thereof.
[0277] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable terminal device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable terminal 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.
[0278] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including 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.
[0279] These computer program instructions can also be loaded onto a computer or other programmable terminal 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 executing on the computer or other programmable device to implement 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.
[0280] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the embodiments of the present application are also intended to include these modifications and variations.
[0281] In the embodiments of the present application, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article 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, article or device. In the absence of further restrictions, the elements defined by the sentence "include one..." do not exclude the existence of other identical elements in the process, method, article or device including the element. The term "or" and its variations may refer to "and / or". In the embodiments of the present application, the terms "first", "second", etc. are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. In the embodiments of the present application, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, A and / or B, which may represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.
[0282] After considering the invention disclosed in the specification and practice, those skilled in the art will easily think of other embodiments of the present application. The embodiments of the present application are intended to cover any variation, use or adaptive change of the embodiments of the present application, which follows the general principles of the embodiments of the present application and includes common knowledge or conventional technical means in the technical field that are not disclosed in the embodiments of the present application.
Claims
1. A model training method, It is characterized in that include: Determine at least one device set in the cluster, wherein resource occupation information of different devices in the device set is associated with each other; Perform joint model training on each device set to obtain a joint prediction model corresponding to each device set; Performing independent model training on each device in the cluster to obtain an independent prediction model corresponding to each device in the cluster; According to the joint prediction model corresponding to each device set and the independent prediction model corresponding to each device in the cluster, the resource prediction model corresponding to each device in the cluster is determined, and the resource prediction model is used to predict the resource occupancy information of the device in the target time period.
2. The method according to claim 1, It is characterized in that Determining a resource prediction model corresponding to each device in the cluster according to the joint prediction model corresponding to each device set and the independent prediction model corresponding to each device in the cluster includes: For any device in the cluster, if the device is located in any device set, determining a resource prediction model corresponding to the device according to a joint prediction model corresponding to the device set and an independent prediction model corresponding to the device; If the device is not located in the at least one device set, the independent prediction model corresponding to the device is determined as the resource prediction model corresponding to the device.
3. The method according to claim 2, It is characterized in that Determining a resource prediction model corresponding to the device according to the joint prediction model corresponding to the device set and the independent prediction model corresponding to the device includes: Determine a first accuracy of resource prediction performed by a joint prediction model corresponding to the device set on the device; Determine a second accuracy of resource prediction for the device by an independent prediction model corresponding to the device; If the first accuracy is greater than or equal to the second accuracy, determining the joint prediction model corresponding to the device set as the resource prediction model corresponding to the device; If the first accuracy is less than the second accuracy, the independent prediction model corresponding to the device is determined as the resource prediction model corresponding to the device.
4. The method according to any one of claims 1 to 3, It is characterized in that For any device set, a joint model training is performed on the device set to obtain a joint prediction model corresponding to the device set, including: Acquire multiple sample data corresponding to the device set, the sample data including sample historical resource occupancy information and annotated resource occupancy information, the sample historical resource occupancy information including resource occupancy information of each device in the device set at multiple sample historical moments, and the annotated resource occupancy information including resource occupancy information of each device in the device set at an annotated moment; Model training is performed based on the multiple sample data to obtain a joint prediction model corresponding to the device set.
5. The method according to claim 4, It is characterized in that The resource occupancy information is the resource occupancy amount; obtaining a plurality of sample data corresponding to the device set, including: Acquire historical resource occupancy information of each device in the device set, wherein the historical resource occupancy information includes resource occupancy of the device in a historical period; For any device in the device set, sampling processing and missing value filling processing are performed on the historical resource occupancy information of the device to obtain the resource occupancy of the device at multiple historical moments; A plurality of sample data corresponding to the device set is determined according to the resource occupation amount of each device at the plurality of historical moments.
6. The method according to any one of claims 1 to 5, It is characterized in that Identify at least one device set in the cluster, including: Acquire at least one piece of associated device information corresponding to the cluster, wherein the associated device information includes device identifiers of multiple associated devices; For any associated device information, the device states of multiple associated devices corresponding to the associated device information in the historical period are obtained, and according to the device states of the multiple associated devices, a device set corresponding to the associated device information is determined among the multiple associated devices, wherein the device state of each device in the device set is a normal state.
7. A resource prediction method, It is characterized in that include: Determine a set of associated devices in the cluster, wherein resource occupation information of different devices in the set of associated devices has a mutual influence relationship, and resource prediction models corresponding to the devices in the set of associated devices are the same; Determining a resource prediction model corresponding to the associated device set; The resource prediction model is used to predict resource occupancy information of each device in the associated device set during a target time period, wherein the resource prediction model is determined according to the method according to any one of claims 1-6.
8. The method according to claim 7, It is characterized in that Predicting resource occupancy information of each device in the associated device set during a target period of time by using the resource prediction model includes: Obtaining historical resource occupancy information of each device in the device set; The historical resource occupancy information of each device in the device set is processed by the resource prediction model to obtain the resource occupancy information of each device in the associated device set in the target time period.
9. The method according to claim 7 or 8, It is characterized in that The resource occupancy information is a resource occupancy rate; the method further includes: Obtaining a virtual machine creation request, wherein the virtual machine creation request is used to request deployment of a virtual machine in the cluster within the target time period; Determine a target device in the cluster according to the resource occupation information of each device in the cluster during the target time period, wherein the resource occupation rate of the target device in the target time period is the lowest; A virtual machine is deployed in the target device according to the virtual machine creation request.
10. An electronic device, It is characterized in that The electronic device comprises a memory and a processor; The memory is coupled to the processor; The memory is used to store program instructions; The processor is used to call the program instructions so that the electronic device executes the method as described in any one of claims 1-6 or 7-9.
