CN115600111B - Resource prediction model training method, cloud resource prediction method and device - Google Patents
Resource prediction model training method, cloud resource prediction method and device Download PDFInfo
- Publication number
- CN115600111B CN115600111B CN202211384090.XA CN202211384090A CN115600111B CN 115600111 B CN115600111 B CN 115600111B CN 202211384090 A CN202211384090 A CN 202211384090A CN 115600111 B CN115600111 B CN 115600111B
- Authority
- CN
- China
- Prior art keywords
- historical
- resource
- data
- related data
- cloud
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000012549 training Methods 0.000 title claims abstract description 115
- 238000000034 method Methods 0.000 title claims abstract description 70
- 238000012545 processing Methods 0.000 claims description 17
- 238000010219 correlation analysis Methods 0.000 claims description 15
- 230000002159 abnormal effect Effects 0.000 claims description 13
- 238000004590 computer program Methods 0.000 claims description 13
- 238000013461 design Methods 0.000 description 19
- 230000000875 corresponding effect Effects 0.000 description 14
- 238000010606 normalization Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 230000000694 effects Effects 0.000 description 5
- 238000013468 resource allocation Methods 0.000 description 5
- 238000013507 mapping Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 230000008602 contraction Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000006855 networking Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 238000007781 pre-processing Methods 0.000 description 2
- OKTJSMMVPCPJKN-UHFFFAOYSA-N Carbon Chemical compound [C] OKTJSMMVPCPJKN-UHFFFAOYSA-N 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 229910052799 carbon Inorganic materials 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 230000002596 correlated effect Effects 0.000 description 1
- 238000003066 decision tree Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 235000019800 disodium phosphate Nutrition 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000009499 grossing Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000013486 operation strategy Methods 0.000 description 1
- 230000035699 permeability Effects 0.000 description 1
- 230000001737 promoting effect Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/04—Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Human Resources & Organizations (AREA)
- Economics (AREA)
- Strategic Management (AREA)
- Marketing (AREA)
- Game Theory and Decision Science (AREA)
- Entrepreneurship & Innovation (AREA)
- Development Economics (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Tourism & Hospitality (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The application provides a training method of a resource prediction model, a cloud resource prediction method and equipment, wherein the training method of the resource prediction model comprises the following steps: the cloud service electronic equipment obtains historical resource related data and used historical cloud resource data of a plurality of sample vehicles in a historical period before a prediction moment. Judging whether the predicted time belongs to the week or the weekend, generating a judging result, and generating a training set according to the judging result, the historical resource related data and the historical cloud resource data. Training is carried out according to the training set, and a resource prediction model is generated. According to the technical scheme, the training set containing the historical full data is used for model training, so that the accuracy of the predicted cloud resource data obtained by predicting the resource prediction model according to the prediction time and the resource related data is improved.
Description
Technical Field
The application relates to the technical field of vehicles, in particular to a training method of a resource prediction model, a cloud resource prediction method and cloud resource prediction equipment.
Background
With the rapid development of intelligent networking technology, the degree, permeability and level of intelligent networking of vehicles are remarkably improved. In order to meet the increasing application demands of users when using vehicles, it is necessary to design routes through a service technology to achieve flexible deployment and mapping of terminal capabilities in cloud virtualization. However, with the rapid increase of the cloud resource demand, how to reasonably allocate resources to vehicles is a current urgent problem to be solved.
At present, the resource allocation of the vehicle is to determine the usage rule of the cloud resource by the vehicle in the time dimension according to the cloud resource consumed by the vehicle history, predict the demand condition of the vehicle machine for the cloud resource at the future moment according to the usage rule, and allocate the cloud resource required by the vehicle at the future moment according to the demand condition.
However, there is a problem in that the prior art has inaccuracy in configuring the resources of the vehicle.
Disclosure of Invention
The application provides a training method of a resource prediction model, a cloud resource prediction method and cloud resource prediction equipment, and aims to solve the problem of inaccuracy in resource allocation of a vehicle.
In a first aspect, an embodiment of the present application provides a training method for a resource prediction model, including:
Acquiring historical resource related data and used historical cloud resource data of a plurality of sample vehicles in a historical period before a prediction moment, wherein the historical period comprises the week and the weekend, and the historical resource related data comprises cloud historical performance index data and vehicle external environment historical data;
judging whether the predicted time belongs to the week or the weekend, and generating a judging result;
generating a training set according to the judging result, the historical resource related data and the historical cloud resource data;
And training according to the training set to generate a resource prediction model, wherein the resource prediction model is used for predicting cloud resources required by a plurality of vehicles.
In one possible design of the first aspect, the generating a training set according to the determination result, the historical resource related data and the historical cloud resource data includes:
According to the judging result, determining the weight of each piece of sub-historical resource related data in the historical resource related data, wherein any piece of sub-historical resource related data is the data of which the historical moment in the historical resource related data is in the week or the weekend;
And giving corresponding weight to each sub-historical resource related data in the historical resource related data, and generating the training set according to the historical cloud resource data.
In another possible design of the first aspect, the cloud historical performance index data includes an instance use quantity feature, a CPU feature, and an instance concurrency number feature, and the vehicle external environment historical data includes a temperature feature or a weather feature, which is determined jointly according to a temperature, wind power, and a rain and snow state of the sample vehicle external environment.
Optionally, the historical resource related data further includes a preset event feature and a preset date feature, and each sub-historical resource related data further includes a mean value, a maximum value, a minimum value and a median of each feature in the sub-historical resource related data;
The preset date characteristic value is a pulse factor, and the pulse factor is calculated according to historical resource related data and historical cloud resource data of a preset date, and historical resource related data and historical cloud resource data of a non-preset date.
In still another possible design of the first aspect, the obtaining historical resource-related data and used historical cloud resource data of the plurality of sample vehicles in a historical period before the predicted time includes:
Acquiring first historical resource related data and first historical cloud resource data of a plurality of sample vehicles in a historical period before the prediction moment;
Removing or correcting abnormal values in the first historical resource related data and the first historical cloud resource data, and carrying out normalization processing on the processed data to generate second historical resource related data and second historical cloud resource data;
And carrying out correlation analysis on each feature in the second historical resource related data and the second historical cloud resource data, eliminating the features with the correlation degree lower than the preset correlation degree, which are obtained by the correlation analysis, in the second historical resource related data, generating the historical resource related data, and determining the second historical cloud resource data as the historical cloud resource data.
In a second aspect, an embodiment of the present application provides a method for predicting cloud resources, including:
Acquiring resource related data of a plurality of vehicles at a predicted time, wherein the resource related data comprises cloud performance index data and vehicle external environment data;
The resource-related data is input into a resource prediction model, cloud resources required by a plurality of vehicles are predicted, and predicted cloud resource data corresponding to the plurality of vehicles is obtained, wherein the resource prediction model is determined according to historical resource-related data, used historical cloud resource data and the prediction time of a plurality of sample vehicles in a historical period, and the historical resource-related data comprises cloud historical performance index data and vehicle external environment historical data.
In one possible design of the second aspect, the acquiring resource-related data of the plurality of vehicles at the predicted time includes:
acquiring initial resource related data of a plurality of vehicles at a predicted time;
And eliminating or correcting the abnormal value in the initial resource-related data, and carrying out normalization processing on the processed data to generate the resource-related data.
In another possible design of the second aspect, the cloud performance index data includes an instance use number feature, a central processing unit CPU feature, and an instance concurrency number feature, and the vehicle external environment data includes a temperature feature or a weather feature, which is determined jointly according to a temperature, wind power, and a rain and snow state of the vehicle external environment.
In a third aspect, an embodiment of the present application provides a training apparatus for a resource prediction model, including:
the system comprises an acquisition module, a prediction module and a prediction module, wherein the acquisition module is used for acquiring historical resource related data and used historical cloud resource data of a plurality of sample vehicles in a historical period before a prediction moment, the historical period comprises a week and a weekend, and the historical resource related data comprises cloud historical performance index data and vehicle external environment historical data;
the judging module is used for judging whether the predicted time belongs to the week or the weekend and generating a judging result;
the generation module is used for generating a training set according to the judging result, the historical resource related data and the historical cloud resource data;
the generating module is further used for training according to the training set to generate a resource prediction model, and the resource prediction model is used for predicting cloud resources required by a plurality of vehicles.
In one possible design of the third aspect, the generating module is specifically configured to:
According to the judging result, determining the weight of each piece of sub-historical resource related data in the historical resource related data, wherein any piece of sub-historical resource related data is the data of which the historical moment in the historical resource related data is in the week or the weekend;
And giving corresponding weight to each sub-historical resource related data in the historical resource related data, and generating the training set according to the historical cloud resource data.
In another possible design of the third aspect, the cloud historical performance index data includes an instance usage number feature, a CPU feature, and an instance concurrency number feature, and the vehicle external environment historical data includes a temperature feature or a weather feature that is commonly determined according to a temperature, wind power, and a rain and snow state of the sample vehicle external environment.
Optionally, the historical resource related data further includes a preset event feature and a preset date feature, and each sub-historical resource related data further includes a mean value, a maximum value, a minimum value and a median of each feature in the sub-historical resource related data;
The preset date characteristic value is a pulse factor, and the pulse factor is calculated according to historical resource related data and historical cloud resource data of a preset date, and historical resource related data and historical cloud resource data of a non-preset date.
In yet another possible design of the third aspect, the obtaining module is specifically configured to:
Acquiring first historical resource related data and first historical cloud resource data of a plurality of sample vehicles in a historical period before the prediction moment;
Removing or correcting abnormal values in the first historical resource related data and the first historical cloud resource data, and carrying out normalization processing on the processed data to generate second historical resource related data and second historical cloud resource data;
And carrying out correlation analysis on each feature in the second historical resource related data and the second historical cloud resource data, eliminating the features with the correlation degree lower than the preset correlation degree, which are obtained by the correlation analysis, in the second historical resource related data, generating the historical resource related data, and determining the second historical cloud resource data as the historical cloud resource data.
In a fourth aspect, an embodiment of the present application provides a device for predicting cloud resources, including:
The system comprises an acquisition module, a prediction module and a prediction module, wherein the acquisition module is used for acquiring resource-related data of a plurality of vehicles at a prediction time, and the resource-related data comprises cloud performance index data and vehicle external environment data;
The resource prediction model is determined according to historical resource related data, used historical cloud resource data and the prediction moment of a plurality of sample vehicles in a historical period, and the historical resource related data comprises cloud historical performance index data and vehicle external environment historical data.
In one possible design of the fourth aspect, the acquiring module is specifically configured to:
acquiring initial resource related data of a plurality of vehicles at a predicted time;
And eliminating or correcting the abnormal value in the initial resource-related data, and carrying out normalization processing on the processed data to generate the resource-related data.
In another possible design of the fourth aspect, the cloud performance index data includes an instance usage number feature, a CPU feature, and an instance concurrency number feature, and the vehicle external environment data includes a temperature feature or a weather feature, which is determined jointly according to a temperature, wind power, and a rain and snow state of the vehicle external environment.
In a fifth aspect, an embodiment of the application provides an electronic device comprising a processor, a memory and computer program instructions stored on the memory and executable on the processor for implementing the methods provided by the first aspect, the second aspect and each possible design when the processor executes the computer program instructions.
In a sixth aspect, embodiments of the present application may provide a computer-readable storage medium having stored therein computer-executable instructions which, when executed by a processor, are adapted to carry out the methods provided by the first aspect, the second aspect, and each of the possible designs.
In a seventh aspect, embodiments of the present application provide a computer program product comprising a computer program for implementing the methods provided by the first aspect, the second aspect and each possible design when executed by a processor.
According to the training method of the resource prediction model, the cloud resource prediction method and the cloud resource prediction device, in the training method of the resource prediction model, the electronic equipment of the cloud service obtains historical resource related data and used historical cloud resource data of a plurality of sample vehicles in a historical period before a prediction time. Judging whether the predicted time belongs to the week or the weekend, generating a judging result, and generating a training set according to the judging result, the historical resource related data and the historical cloud resource data. Training is carried out according to the training set, and a resource prediction model is generated. According to the technical scheme, the training set is dynamically determined by combining the characteristics of holidays, temperatures, weather, instance concurrency numbers and the like and the prediction time, and the training set containing the historical full data is used for model training, so that the accuracy of predicted cloud resource data obtained by a resource prediction model according to the prediction time and the resource related data is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
FIG. 1 is a flowchart of a first embodiment of a training method of a resource prediction model according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of a second embodiment of a training method of a resource prediction model according to an embodiment of the present application;
fig. 3 is a flowchart of a first embodiment of a method for predicting cloud resources according to an embodiment of the present application;
fig. 4 is a schematic flow chart of a second embodiment of a cloud resource prediction method provided by the embodiment of the present application;
FIG. 5 is a schematic structural diagram of a training device for a resource prediction model according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a cloud resource prediction apparatus according to an embodiment of the present application;
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Specific embodiments of the present application have been shown by way of the above drawings and will be described in more detail below. The drawings and the written description are not intended to limit the scope of the inventive concepts in any way, but rather to illustrate the inventive concepts to those skilled in the art by reference to the specific embodiments.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Before describing the embodiments of the present application, an application background of the embodiments of the present application will be explained first:
The cloud service is used for serving various running services, corresponding cloud resources are configured for each service according to the size of the service volume, the configured cloud resources are positively correlated with the service volume, namely, the larger the service volume is, the larger the configured cloud resources are, and otherwise, the smaller the service volume is, the smaller the configured cloud resources are.
Along with the improvement of the intelligent level of the intelligent vehicle, the traditional method for providing service for the user by using vehicle-end calculation cannot meet the increasing application demands of the user, and in order to solve the problem of the application demands, the vehicle service can be deployed in the cloud, the cloud supports the rapid introduction of massive and complex intelligent applications, and the safety, stability and high efficiency of the application operation can be ensured. In practical application, data interaction is performed between the vehicle and the cloud, so that corresponding services are provided for users. However, the cloud performs resource allocation on the vehicle to meet the use requirement of the user on the application, and the requirement on the cloud resource increases rapidly, so how to reasonably allocate the resource on the vehicle is a problem to be solved at present.
Currently, the resource allocation of the vehicle mainly determines the usage rule of the cloud resource by the vehicle in the time dimension according to the cloud resource consumed by the vehicle history, for example, the usage rule may be gradually decreasing or gradually increasing. Further, the demand condition of the vehicle for cloud resources at the future moment is predicted according to the usage rule, and the cloud resources required by the vehicle at the future moment are configured according to the demand condition.
However, in the prior art, only the influence of time factors on cloud resources required by the vehicle is considered, and the factors are single, so that the problem of inaccuracy exists when the vehicle is subjected to resource allocation.
In order to solve the problems in the prior art, the inventor finds that in the process of researching the technical field, a training set can be dynamically determined in advance according to the prediction time, model training is carried out according to the training set so as to obtain a resource prediction model, cloud resources required by a plurality of vehicles are predicted according to the resource prediction model, and accuracy of a prediction result can be effectively improved.
The technical scheme of the application is described in detail through specific embodiments.
It should be noted that the following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
Fig. 1 is a flowchart of a training method embodiment of a resource prediction model according to an embodiment of the present application. As shown in fig. 1, the training method of the resource prediction model may include the following steps:
s101, acquiring historical resource related data and used historical cloud resource data of a plurality of sample vehicles in a historical period before a prediction moment.
In this step, since the resource prediction model is obtained by training according to the training set, the prediction accuracy of the data in the training set on the resource prediction model is closely related, that is, the higher the matching degree between each feature in the training set and each feature of the input resource prediction model in the actual prediction process, the higher the prediction accuracy of the prediction model. Therefore, before model training is performed, the training set is determined according to the prediction time, and the historical resource related data and the historical cloud resource data are important components in the training set, so that the historical resource related data and the used historical cloud resource data of a plurality of sample vehicles in a historical period before the prediction time need to be acquired.
The predicted time may be a specific day, or may be a specific time of day, and may be determined according to an actual situation, which is not limited in the embodiment of the present application.
The history period includes a week and a weekend, and for example, the history period may be one week, one month, three months, or the like before the predicted time, and may be determined according to actual situations, which is not particularly limited in the embodiment of the present application.
Because the demands of users on applications are different between the week and the weekend, for example, the users usually use vehicles to carry out commute in the week, the time for using the applications is shorter, the cloud resources required by the vehicles are less, and the users usually use the vehicles to go out and play in the weekend, the time for using the applications is longer, and the cloud resources required by the vehicles are more. Therefore, when the history period comprises the week and the weekend, the richness of the data in the training set determined later is improved, and the learning ability of the model is improved, so that the prediction accuracy of the resource prediction model is improved.
The historical resource related data comprises cloud historical performance index data and vehicle external environment historical data.
Optionally, the cloud historical performance index data includes an instance use number feature, a central processing unit (Central Processing Unit, CPU) feature, and an instance concurrency number feature, the vehicle external environment historical data includes a temperature feature or a weather feature, and the weather feature is determined jointly according to a temperature, wind power, and a rain and snow state of the sample vehicle external environment.
Optionally, the weather features have a mapping relationship with temperature, wind power and rain and snow states. The weather characteristic value is considered to be comfortable weather if the temperature is between 20 ℃ and 30 ℃, the wind power is less than three levels and no rain or snow exists, the weather characteristic value is considered to be general weather if the temperature is above 30 ℃, the wind power is greater than three levels and no rain or snow exists, and the weather characteristic value is considered to be extreme weather if heavy rain, heavy snow or thunder exists.
The historical resource related data further comprises preset event characteristics and preset date characteristics. By way of example, the preset event may be an ongoing offline activity, such as a tree planting activity, a large examination or a large promotional activity, etc.
The preset date may be a holiday, and because the holiday has a longer rest time, unlike the week and the weekend, the user usually chooses to play or visit relatives and friends at the holiday, so the historical resource related data of the holiday and the corresponding historical cloud resource data usually have pulses to form data outliers. Therefore, the impulse factor can be obtained by calculation according to the historical resource related data and the historical cloud resource data of the preset date and the historical resource related data and the historical cloud resource data of the non-preset date, and the impulse factor is taken as the characteristic value of the preset date to participate in model training, so that the data in the training set is divided by the impulse factor in the model training process to carry out smoothing treatment.
Optionally, the pulse factor obtained by calculating the historical resource related data and the historical cloud resource data according to the historical resource related data and the historical cloud resource data of the preset date and the historical resource related data and the historical cloud resource data of the non-preset date can be realized through an existing model, and the embodiment of the application does not limit the pulse factor specifically.
S102, judging whether the predicted time belongs to the week or the weekend, and generating a judging result.
In this step, since the cloud resources required by the vehicle in the week have a large difference from the cloud resources required on the weekend, in order to improve the matching degree between each feature in the training set and each feature input in the actual prediction process, it is necessary to determine whether the prediction time belongs to the week or the weekend, so as to determine the data in the training set according to the determination result.
Optionally, the determination result is used to characterize whether the predicted time belongs to the week or the weekend.
And S103, generating a training set according to the judging result, the historical resource related data and the historical cloud resource data.
In this step, after the determination result is obtained, each sub-historical resource related data in the historical resource related data may be adjusted according to the determination result, and a training set may be generated according to the historical cloud resource data.
In one possible implementation manner, the weight of each sub-historical resource related data in the historical resource related data may be determined according to the determination result, the corresponding weight is given to each sub-historical resource related data in the historical resource related data, and the training set is generated according to the historical cloud resource data.
Any sub-historical resource related data is data in which the historical moment in the historical resource related data is in the week or on the weekend.
Optionally, when the judgment result characterizes the prediction time as the week, determining that the weight of the sub-historical resource related data (abbreviated as the week historical data) with the history time as the week is a first weight, determining that the weight of the sub-historical resource related data (abbreviated as the weekend historical data) with the history time as the weekend is a second weight, and when the judgment result characterizes the prediction time as the weekend, determining that the weight of the weekend historical data is a first weight, and determining that the weight of the week historical data is a second weight. Wherein the first weight is greater than the second weight.
As a specific example of the above manner, the first weight may be 1.2 and the second weight may be 0.8. That is, when the judgment result indicates that the predicted time is within a week, the training set may be expressed by the following formula, training set=1.2×history data within a week+0.8×history data within a week, and when the judgment result indicates that the predicted time is a weekend, the training set may be expressed by the following formula, training set=1.2×history data within a week+0.8×history data within a week.
The sub-historical resource related data also comprises a mean value, a maximum value, a minimum value and a median of each feature in the sub-historical resource related data.
S104, training is carried out according to the training set, and a resource prediction model is generated.
In this step, after the training set is determined, model training may be performed according to the training set, thereby generating a resource prediction model. The resource prediction model is used for predicting cloud resources required by a plurality of vehicles.
In one possible implementation, the pre-established initial model may be trained from a training set to generate a resource prediction model. Optionally, the initial model is pre-established based on a timing model and a decision tree algorithm.
In another possible implementation manner, the resource prediction model generated last time can be retrained according to the training set, so as to obtain a new resource prediction model.
According to the training method of the resource prediction model, the electronic equipment of the cloud service obtains the historical resource related data and the used historical cloud resource data of the plurality of sample vehicles in the historical period before the prediction time. Judging whether the predicted time belongs to the week or the weekend, generating a judging result, and generating a training set according to the judging result, the historical resource related data and the historical cloud resource data. Training is carried out according to the training set, and a resource prediction model is generated. According to the technical scheme, the training set is dynamically determined by combining the characteristics of holidays, temperatures, weather, instance concurrency numbers and the like and the prediction time, and the training set containing the historical full data is used for model training, so that the accuracy of predicted cloud resource data obtained by a resource prediction model according to the prediction time and the resource related data is improved.
Fig. 2 is a flowchart of a second embodiment of a training method of a resource prediction model according to an embodiment of the present application. As shown in fig. 2, on the basis of any of the above embodiments, S101 may be implemented by:
s201, acquiring first historical resource related data and first historical cloud resource data of a plurality of sample vehicles in a historical period before a prediction time.
In this step, since there may be erroneous data in the initial data acquired by the electronic device, the initial data needs to be preprocessed to improve the accuracy of the training set. Before preprocessing the initial data, the initial data needs to be acquired, and it should be understood that the initial data is the first historical resource related data and the first historical cloud resource data.
The first historical resource related data and the first historical cloud resource data may be data corresponding to a plurality of sample vehicles running in a historical period.
S202, eliminating or correcting abnormal values in the first historical resource related data and the first cloud resource data, and normalizing the processed data to generate second historical resource related data and second historical cloud resource data.
In this step, the preprocessing may be to reject or correct the error data, that is, reject or correct the abnormal value in the first historical resource related data and the first cloud resource data, so as to improve the accuracy of the training set generated later.
For example, it is assumed that the CPU utilization rate is equal to or less than 0 when the cloud provides services for each service, and at this time, the CPU utilization rate is an outlier, that is, the error data needs to be removed or corrected, and the average value of the CPU utilization rate when the cloud is running under the normal and no special conditions may be used to perform replacement correction.
Further, normalization processing is carried out on the processed data, and the processed data is mapped to be within the range of 0-1, so that the speed and convenience of subsequent model training are improved.
S203, performing correlation analysis on each feature in the second historical resource related data and the second historical cloud resource data, removing the features with the correlation lower than the preset correlation in the second historical resource related data, generating the historical resource related data, and determining the second historical cloud resource data as the historical cloud resource data.
In this step, features with low correlation with the historical cloud resource data may exist in the second historical resource related data, and the features have low help to model training and can be removed, so that the speed of model training is improved, and the computing resources required by model training are reduced.
It should be understood that the correlation analysis refers to analyzing each feature in the second historical resource related data and the second historical cloud resource data, so as to determine the correlation closeness between the features and the second historical cloud resource data, that is, the correlation degree.
The preset correlation degree may be determined by a relevant staff in advance according to an empirical value, may be determined by the relevant staff according to an experimental result, may be determined by the relevant staff according to historical data, and may be determined according to an actual situation.
In the above embodiment, the data forming the training set is preprocessed before the model training, so that the accuracy of the training set can be effectively improved, and the speed, convenience and accuracy of the subsequent model training are improved.
After the resource prediction model is obtained, cloud resources required by a plurality of vehicles can be predicted by using the resource prediction model. The method for predicting cloud resources required by a plurality of vehicles by using the resource prediction model is described in detail below with reference to specific embodiments. The following embodiments may be combined with each other, and some embodiments may not be repeated for the same or similar concepts or processes.
In particular, the execution subject of the cloud resource prediction method may be an electronic device with processing capability, such as a terminal or a server. It should be understood that the electronic device executing the cloud resource prediction method and the electronic device executing the training method of the resource prediction model may be the same device or different devices.
Fig. 3 is a flowchart of a first embodiment of a cloud resource prediction method according to an embodiment of the present application. As shown in fig. 3, the method for predicting cloud resources may include the following steps:
S301, acquiring resource-related data of a plurality of vehicles at a predicted time.
In this step, when predicting cloud resources required by a plurality of vehicles at a prediction time, resource-related data of the plurality of vehicles at the prediction time needs to be acquired in advance.
The resource-related data comprises cloud performance index data and vehicle external environment data.
The cloud performance index data comprises example use quantity characteristics, CPU characteristics and example concurrency number characteristics, the vehicle external environment data comprises temperature characteristics or weather characteristics, and the weather characteristics are determined according to the temperature, wind power and rain and snow states of the vehicle external environment. It should be understood that the mapping relationship between the weather features and the temperature, wind force and the rain and snow status may refer to the relevant content in S101, which is not described herein.
For example, the temperature of the environment outside the vehicle, the wind power, and the rain and snow state may be obtained through a network according to the location of the vehicle and the predicted time.
In one possible implementation manner, initial resource-related data of a plurality of vehicles at a predicted time may be acquired, abnormal values in the initial resource-related data are removed or corrected, and the processed data are normalized to generate resource-related data.
In this implementation, the removing or correcting of the outlier and the normalizing of the processed data may refer to the related content in the S203 section, which is not described herein again.
S302, inputting the resource-related data into a resource prediction model, and predicting cloud resources required by a plurality of vehicles to obtain predicted cloud resource data corresponding to the plurality of vehicles.
The resource prediction model is determined according to historical resource related data, used historical cloud resource data and prediction time of a plurality of sample vehicles in a historical period, wherein the historical resource related data comprises cloud historical performance index data and vehicle external environment historical data.
The process of the resource prediction model may refer to the previous content of the embodiment shown in fig. 3, which is not described herein.
Optionally, when the prediction time is holidays, the resource prediction model may perform preliminary prediction on cloud resources required by a plurality of vehicles according to the input resource-related data when predicting the cloud resources required by the plurality of vehicles, so as to obtain an initial prediction result. And then, multiplying the initial prediction result by a pulse factor corresponding to the holiday, and outputting the processed prediction result as final predicted cloud resource data.
Optionally, after this step, the super sales coefficient of the vehicle may be adjusted according to the predicted cloud resource data, so as to implement elastic expansion or contraction of the cloud resource.
According to the cloud resource prediction method provided by the embodiment of the application, the electronic equipment of the cloud service acquires the resource related data of a plurality of vehicles at the prediction time, inputs the resource related data into the resource prediction model, predicts the cloud resources required by the plurality of vehicles, and obtains the predicted cloud resource data corresponding to the plurality of vehicles. According to the technical scheme, the cloud resources required by a plurality of vehicles at the prediction moment can be accurately predicted by utilizing the resource prediction model in real time, further, the cloud resources can be allocated to the vehicles according to the predicted cloud resource data, and the elastic capacity expansion or contraction of the cloud resources can be performed on the premise of meeting the user demands, so that the waste of the cloud resources is avoided, and the normal use of vehicle applications is ensured. Meanwhile, the configuration of operation strategies by operators can be facilitated, carbon emission is reduced, and the digital and differentiated operation of the intelligent automobile platform is realized.
The technical scheme provided by the application is exemplified by taking the same electronic equipment as a training method for executing the resource prediction model and a cloud resource prediction method.
Fig. 4 is a flowchart of a second embodiment of a cloud resource prediction method according to an embodiment of the present application. As shown in fig. 4, the method for predicting cloud resources provided by the application is as follows in an actual application:
S401, acquiring historical resource related data and used historical cloud resource data of a plurality of sample vehicles in a historical period before a prediction time.
And S402, performing model training according to the historical resource related data and the historical cloud resource data to obtain a resource prediction model.
S403, predicting cloud resources required by the vehicles according to the resource related data of the vehicles at the prediction time through a resource prediction model to obtain predicted cloud resource data corresponding to the vehicles.
S404, adjusting the super sales coefficient according to the predicted cloud resource data.
And S405, carrying out elastic capacity expansion or capacity reduction on the cloud resource according to the super-selling coefficient.
The following are examples of the apparatus of the present application that may be used to perform the method embodiments of the present application. For details not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the method of the present application.
Fig. 5 is a schematic structural diagram of a training device for a resource prediction model according to an embodiment of the present application. As shown in fig. 5, the training device of the resource prediction model includes:
The obtaining module 501 is configured to obtain historical resource related data and used historical cloud resource data of a plurality of sample vehicles in a historical period before a prediction moment, where the historical period includes a week and a weekend, and the historical resource related data includes cloud historical performance index data and vehicle external environment historical data;
The judging module 502 is configured to judge whether the predicted time belongs to the week or the weekend, and generate a judging result;
a generating module 503, configured to generate a training set according to the determination result, the historical resource related data, and the historical cloud resource data;
the generating module 503 is further configured to perform training according to the training set, and generate a resource prediction model, where the resource prediction model is used for predicting cloud resources required by a plurality of vehicles.
In one possible design of the embodiment of the present application, the generating module 503 is specifically configured to:
According to the judging result, determining the weight of each piece of sub-historical resource related data in the historical resource related data, wherein any piece of sub-historical resource related data is the data of which the historical moment in the historical resource related data is in the week or the weekend;
and giving corresponding weights to all sub-historical resource related data in the historical resource related data, and generating a training set according to the historical cloud resource data.
In another possible design of the embodiment of the present application, the cloud historical performance index data includes an instance use number feature, a CPU feature, and an instance concurrency number feature, and the vehicle external environment historical data includes a temperature feature or a weather feature, which are determined together according to a temperature, wind power, and a rain and snow state of the sample vehicle external environment.
Optionally, the historical resource related data further includes a preset event feature and a preset date feature, and each sub-historical resource related data further includes a mean value, a maximum value, a minimum value and a median of each feature in the sub-historical resource related data;
the preset date characteristic value is a pulse factor, and the pulse factor is obtained by calculating according to historical resource related data and historical cloud resource data of a preset date and historical resource related data and historical cloud resource data of a non-preset date.
In yet another possible design of the embodiment of the present application, the obtaining module 501 is specifically configured to:
Acquiring first historical resource related data and first historical cloud resource data of a plurality of sample vehicles in a historical period before a prediction moment;
Removing or correcting abnormal values in the first historical resource related data and the first historical cloud resource data, and carrying out normalization processing on the processed data to generate second historical resource related data and second historical cloud resource data;
Performing correlation analysis on each feature in the second historical resource related data and the second historical cloud resource data, removing the features with the correlation lower than the preset correlation in the second historical resource related data, generating historical resource related data, and determining the second historical cloud resource data as historical cloud resource data.
The training device for the resource prediction model provided by the embodiment of the application can be used for executing the training method for the resource prediction model in any embodiment, and the implementation principle and the technical effect are similar and are not repeated here.
Fig. 6 is a schematic structural diagram of a cloud resource prediction apparatus according to an embodiment of the present application. As shown in fig. 6, the prediction apparatus of the cloud resource includes:
The acquiring module 601 is configured to acquire resource-related data of a plurality of vehicles at a prediction time, where the resource-related data includes cloud performance index data and vehicle external environment data;
The input module 602 is configured to input the resource-related data into a resource prediction model, and predict cloud resources required by a plurality of vehicles to obtain predicted cloud resource data corresponding to the plurality of vehicles, where the resource prediction model is determined according to historical resource-related data, used historical cloud resource data and prediction time of a plurality of sample vehicles in a historical period, and the historical resource-related data includes cloud historical performance index data and vehicle external environment historical data.
In one possible design of the embodiment of the present application, the obtaining module 601 is specifically configured to:
acquiring initial resource related data of a plurality of vehicles at a predicted time;
and eliminating or correcting the abnormal value in the initial resource-related data, and carrying out normalization processing on the processed data to generate the resource-related data.
In another possible design of the embodiment of the present application, the cloud performance index data includes an instance use number feature, a CPU feature, and an instance concurrency number feature, and the vehicle external environment data includes a temperature feature or a weather feature, which are determined together according to a temperature, wind power, and a rain and snow state of the vehicle external environment.
The cloud resource prediction device provided by the embodiment of the application can be used for executing the cloud resource prediction method in any of the embodiments, and the implementation principle and the technical effect are similar and are not repeated here.
It should be noted that, it should be understood that the division of the modules of the above apparatus is merely a division of a logic function, and may be fully or partially integrated into a physical entity or may be physically separated. The modules can be realized in the form of software which is called by the processing element, in the form of hardware, in the form of software which is called by the processing element, and in the form of hardware. In addition, all or part of the modules may be integrated together or may be implemented independently. The processing element described herein may be an integrated circuit having signal processing capabilities. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in a software form.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 7, the electronic device may include a processor 71, a memory 72, and computer program instructions stored in the memory 72 and executable on the processor 71, where the processor 71 implements the training method of the resource prediction model or the prediction method of cloud resources provided in any of the foregoing embodiments when executing the computer program instructions.
Alternatively, the above devices of the electronic apparatus may be connected by a system bus.
The memory 72 may be a separate memory unit or may be a memory unit integrated into the processor. The number of processors is one or more.
Optionally, the electronic device may also include interfaces to interact with other devices.
It should be appreciated that the Processor 71 may be a CPU, but may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL processors, DSPs), application SPECIFIC INTEGRATED Circuits (ASICs), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present application may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in a processor for execution.
The system bus may be a peripheral component interconnect (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The system bus may be classified into an address bus, a data bus, a control bus, and the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus. The memory may include random access memory (random access memory, RAM) and may also include non-volatile memory (NVM), such as at least one disk memory.
All or part of the steps for implementing the method embodiments described above may be performed by hardware associated with program instructions. The foregoing program may be stored in a readable memory. The program, when executed, performs the steps comprising the method embodiments described above, and the aforementioned memory (storage medium) comprises read-only memory (ROM), RAM, flash memory, hard disk, solid state disk, magnetic tape (MAGNETIC TAPE), floppy disk (floppy disk), optical disk (optical disk), and any combination thereof.
The electronic device provided by the embodiment of the application can be used for executing the training method of the resource prediction model or the cloud resource prediction method provided by any of the method embodiments, and the implementation principle and the technical effect are similar, and are not repeated here.
The embodiment of the application provides a computer readable storage medium, wherein computer execution instructions are stored in the computer readable storage medium, and when the computer execution instructions run on a computer, the computer is enabled to execute the training method of a resource prediction model or the prediction method of cloud resources.
The computer readable storage medium described above may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as static random access memory, electrically erasable programmable read-only memory, magnetic memory, flash memory, magnetic disk or optical disk. A readable storage medium can be any available medium that can be accessed by a general purpose or special purpose computer.
In the alternative, a readable storage medium is coupled to the processor such that the processor can read information from, and write information to, the readable storage medium. In the alternative, the readable storage medium may be integral to the processor. The processor and the readable storage medium may reside in an Application SPECIFIC INTEGRATED Circuits (ASIC). The processor and the readable storage medium may reside as discrete components in a device.
The embodiment of the application also provides a computer program product, which comprises a computer program, wherein the computer program is stored in a computer readable storage medium, the computer program can be read from the computer readable storage medium by at least one processor, and the training method of the resource prediction model or the prediction method of cloud resources can be realized when the at least one processor executes the computer program.
It is to be understood that the application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211384090.XA CN115600111B (en) | 2022-11-07 | 2022-11-07 | Resource prediction model training method, cloud resource prediction method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211384090.XA CN115600111B (en) | 2022-11-07 | 2022-11-07 | Resource prediction model training method, cloud resource prediction method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115600111A CN115600111A (en) | 2023-01-13 |
CN115600111B true CN115600111B (en) | 2024-12-20 |
Family
ID=84852570
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211384090.XA Active CN115600111B (en) | 2022-11-07 | 2022-11-07 | Resource prediction model training method, cloud resource prediction method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115600111B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019182555A1 (en) * | 2018-03-19 | 2019-09-26 | Ford Motor Company | Customizing resources in a shared vehicle environment |
WO2022110444A1 (en) * | 2020-11-30 | 2022-06-02 | 中国科学院深圳先进技术研究院 | Dynamic prediction method and apparatus for cloud native resources, computer device and storage medium |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10304006B2 (en) * | 2013-02-15 | 2019-05-28 | The Charles Stark Draper Laboratory, Inc. | Method for integrating and fusing heterogeneous data types to perform predictive analysis |
EP3454506B1 (en) * | 2017-09-07 | 2020-03-04 | Nokia Solutions and Networks Oy | Method and device for monitoring a telecommunication network |
CN110806954B (en) * | 2019-09-19 | 2023-06-16 | 平安科技(深圳)有限公司 | Method, device, equipment and storage medium for evaluating cloud host resources |
CN110866633B (en) * | 2019-10-25 | 2023-11-24 | 上海电气集团股份有限公司 | A microgrid ultra-short-term load forecasting method based on SVR support vector regression |
CN111815027B (en) * | 2020-06-09 | 2024-08-02 | 山东大学 | Photovoltaic station generation power prediction method and system |
CN113554153A (en) * | 2021-07-23 | 2021-10-26 | 潍柴动力股份有限公司 | Method, device, computer equipment and medium for forecasting nitrogen oxide emissions |
CN114020460A (en) * | 2021-11-01 | 2022-02-08 | 中国电信股份有限公司甘肃分公司 | Computing resource scheduling method, device and storage medium |
CN114938545B (en) * | 2022-06-14 | 2025-04-08 | 中国电信股份有限公司 | Network slice resource adjustment method, device and computer readable storage medium |
-
2022
- 2022-11-07 CN CN202211384090.XA patent/CN115600111B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019182555A1 (en) * | 2018-03-19 | 2019-09-26 | Ford Motor Company | Customizing resources in a shared vehicle environment |
WO2022110444A1 (en) * | 2020-11-30 | 2022-06-02 | 中国科学院深圳先进技术研究院 | Dynamic prediction method and apparatus for cloud native resources, computer device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN115600111A (en) | 2023-01-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020119051A1 (en) | Cloud platform resource usage prediction method and terminal device | |
CN108205469B (en) | MapReduce-based resource allocation method and server | |
US20220253214A1 (en) | Data processing method, apparatus, device, and readable storage medium | |
CN111198799A (en) | Machine room power consumption early warning method, system, terminal and storage medium based on LSTM | |
CN111898826A (en) | Resource consumption prediction method, apparatus, electronic device, and readable storage device | |
CN119225933A (en) | A process scheduling method, device, equipment, medium and computer program product | |
CN113835626A (en) | Method and device for determining usable time of disk | |
CN104932898A (en) | Method for selecting to-be-increased components based on improved multi-target particle swam optimization algorithm | |
CN117827415A (en) | GPU resource scheduling method, server and storage medium | |
CN118626831B (en) | A computing power configuration detection method and system based on big data | |
CN115600111B (en) | Resource prediction model training method, cloud resource prediction method and device | |
CN117590792B (en) | Intelligent control method, system, terminal and medium based on large-scale direct drinking water equipment | |
CN112782584A (en) | Method, system, medium, and device for predicting remaining usage limit of battery power | |
CN111614578B (en) | A method and device for network resource allocation based on exponential weighting and inflection point detection | |
CN114253688A (en) | Method and application for rescheduling application load in cloud environment | |
CN119149210B (en) | Memory scheduling method, system and product based on separated memory system | |
CN118449875B (en) | Self-adaptive cloud server monitoring data collection method and device and cloud server | |
CN118378460B (en) | A planning method and device for reliability test of reusable rocket engine | |
CN114328402B (en) | Junk file cleaning method and device, electronic equipment and storage medium | |
CN118860812A (en) | Load prediction method, model training method, device and related equipment | |
CN119645638A (en) | Resource allocation method, device, electronic equipment, medium and product | |
CN115220872A (en) | A container adjustment method and device, and a computer-readable storage medium | |
CN116954817A (en) | Virtual machine dynamic migration method and system based on dirty page rate prediction | |
CN118069363A (en) | Cluster task resource estimation method and device and electronic equipment | |
CN119292796A (en) | A method and system for scaling up and down based on large models |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |