Resource prediction model training method, cloud resource prediction method and device
By generating a weight-adjusted training set and training a resource prediction model, the problem of inaccurate vehicle resource allocation in the existing technology is solved, prediction accuracy and resource utilization efficiency are improved, and flexible allocation of cloud resources is realized.
Patent Information
- Application Number
- CN202211384090.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-07
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2042-11-07
AI Technical Summary
The existing technology has inaccurate problems in the allocation of vehicle resources, mainly because it only considers time factors and ignores the impact of holidays, temperature, weather and other factors on cloud resource demand, resulting in unreasonable resource allocation.
By obtaining historical resource-related data and cloud resource data of multiple sample vehicles, we judge whether the prediction time is within a week or on a weekend, and generate a weight-adjusted training set based on these data, and train the resource prediction model to improve the accuracy of resource prediction.
The accuracy of the prediction of the resource prediction model for prediction moments and resource-related data is improved, the rationality of cloud resource allocation is ensured, resource waste is avoided, user needs are met, and cloud resources are supported to expand or shrink.
Smart Images

Figure CN115600111B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle technology, and in particular to a resource prediction model training method, a cloud resource prediction method and a device. Background Art
[0002] With the rapid development of intelligent networking technology, the degree, penetration rate and level of vehicle intelligent networking have been significantly improved. In order to meet the increasing application needs of users when using vehicles, it is necessary to realize the flexible deployment and mapping of terminal capabilities in the cloud virtualization through a service-oriented technical design route. However, this has brought about a sharp increase in demand for cloud resources, and how to reasonably allocate resources for vehicles has become a problem that needs to be solved urgently.
[0003] Currently, resource allocation for vehicles is done by determining the vehicle's usage pattern of cloud resources in the time dimension based on the vehicle's historical consumption of cloud resources. Based on this usage pattern, the vehicle's demand for cloud resources in the future is predicted, and the cloud resources required by the vehicle in the future are allocated based on this demand.
[0004] However, there is an inaccurate problem when allocating resources to vehicles in the prior art. Summary of the invention
[0005] The present application provides a resource prediction model training method, a cloud resource prediction method and a device to solve the problem of inaccuracy in resource allocation for a vehicle.
[0006] In a first aspect, an embodiment of the present application provides a method for training a resource prediction model, comprising:
[0007] Acquire historical resource-related data and historical cloud resource data used by multiple sample vehicles in a historical period before the prediction time, wherein the historical period includes weekdays and weekends, and the historical resource-related data includes cloud historical performance indicator data and vehicle external environment historical data;
[0008] Determine whether the predicted time is within the week or on the weekend, and generate a determination result;
[0009] Generate a training set according to the judgment result, the historical resource-related data and the historical cloud resource data;
[0010] Training is performed according to the training set to generate a resource prediction model, where the resource prediction model is used to predict cloud resources required by multiple vehicles.
[0011] In a possible design of the first aspect, generating a training set according to the judgment result, the historical resource-related data, and the historical cloud resource data includes:
[0012] According to the judgment result, the weight of each sub-historical resource related data in the historical resource related data is determined, and any sub-historical resource related data is data in the historical resource related data whose historical time is within the week or on the weekend;
[0013] Each sub-historical resource related data in the historical resource related data is assigned a corresponding weight, and the training set is generated according to the historical cloud resource data.
[0014] In another possible design of the first aspect, the cloud historical performance indicator data includes instance usage quantity characteristics, CPU characteristics, and instance concurrency characteristics, and the vehicle external environment historical data includes temperature characteristics or weather characteristics, and the weather characteristics are determined based on the temperature, wind speed, and rain and snow conditions of the sample vehicle's external environment.
[0015] Optionally, the historical resource related data further includes preset event features and preset date features, and each sub-historical resource related data further includes the mean, maximum, minimum and median of each feature in the sub-historical resource related data;
[0016] The preset date characteristic value is a pulse factor, and the pulse factor is calculated based on historical resource related data and historical cloud resource data of the preset date, and historical resource related data and historical cloud resource data of non-preset dates.
[0017] In another possible design of the first aspect, the acquiring of historical resource-related data and historical cloud resource data used by multiple sample vehicles in a historical period before the prediction time includes:
[0018] Acquire 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;
[0019] Eliminate or correct abnormal values in the first historical resource-related data and the first historical cloud resource data, and normalize the processed data to generate second historical resource-related data and second historical cloud resource data;
[0020] A correlation analysis is performed on each feature in the second historical resource-related data and the second historical cloud resource data, and features in the second historical resource-related data whose correlation obtained through the correlation analysis is lower than a preset correlation are eliminated to generate historical resource-related data, and the second historical cloud resource data is determined as historical cloud resource data.
[0021] In a second aspect, an embodiment of the present application provides a cloud resource prediction method, including:
[0022] Obtain resource-related data of multiple vehicles at a prediction time, wherein the resource-related data includes cloud performance indicator data and vehicle external environment data;
[0023] The resource-related data is input into a resource prediction model, and the cloud resources required by multiple vehicles are predicted to obtain predicted cloud resource data corresponding to the multiple vehicles; wherein the resource prediction model is determined based on historical resource-related data of multiple sample vehicles in a historical period, historical cloud resource data used, and the prediction time, and the historical resource-related data includes historical cloud performance indicator data and historical data of the vehicle's external environment.
[0024] In a possible design of the second aspect, the acquiring resource-related data of the plurality of vehicles at the prediction time includes:
[0025] Obtaining initial resource-related data of multiple vehicles at the prediction time;
[0026] The abnormal values in the initial resource-related data are eliminated or corrected, and the processed data are normalized to generate the resource-related data.
[0027] In another possible design of the second aspect, the cloud performance indicator data includes instance usage quantity characteristics, central processing unit CPU characteristics, and instance concurrency number characteristics, and the vehicle external environment data includes temperature characteristics or weather characteristics, and the weather characteristics are determined based on the temperature, wind force, and rain and snow conditions of the vehicle's external environment.
[0028] In a third aspect, an embodiment of the present application provides a training device for a resource prediction model, comprising:
[0029] An acquisition module, used to acquire historical resource-related data and historical cloud resource data used by multiple sample vehicles in a historical period before the prediction time, wherein the historical period includes weekdays and weekends, and the historical resource-related data includes cloud historical performance indicator data and vehicle external environment historical data;
[0030] A judgment module, used to judge whether the predicted time belongs to the week or the weekend, and generate a judgment result;
[0031] A generation module, used to generate a training set according to the judgment result, the historical resource-related data and the historical cloud resource data;
[0032] The generation module is further used to perform training according to the training set to generate a resource prediction model, and the resource prediction model is used to predict the cloud resources required by multiple vehicles.
[0033] In a possible design of the third aspect, the generating module is specifically configured to:
[0034] According to the judgment result, the weight of each sub-historical resource related data in the historical resource related data is determined, and any sub-historical resource related data is data in the historical resource related data whose historical time is within the week or on the weekend;
[0035] Each sub-historical resource related data in the historical resource related data is assigned a corresponding weight, and the training set is generated according to the historical cloud resource data.
[0036] In another possible design of the third aspect, the cloud historical performance indicator data includes instance usage quantity characteristics, CPU characteristics, and instance concurrency characteristics, and the vehicle external environment historical data includes temperature characteristics or weather characteristics, and the weather characteristics are determined based on the temperature, wind speed, and rain and snow conditions of the sample vehicle's external environment.
[0037] Optionally, the historical resource related data further includes preset event features and preset date features, and each sub-historical resource related data further includes the mean, maximum, minimum and median of each feature in the sub-historical resource related data;
[0038] The preset date characteristic value is a pulse factor, and the pulse factor is calculated based on historical resource related data and historical cloud resource data of the preset date, and historical resource related data and historical cloud resource data of non-preset dates.
[0039] In yet another possible design of the third aspect, the acquisition module is specifically configured to:
[0040] Acquire 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;
[0041] Eliminate or correct abnormal values in the first historical resource-related data and the first historical cloud resource data, and normalize the processed data to generate second historical resource-related data and second historical cloud resource data;
[0042] A correlation analysis is performed on each feature in the second historical resource-related data and the second historical cloud resource data, and features in the second historical resource-related data whose correlation obtained through the correlation analysis is lower than a preset correlation are eliminated to generate historical resource-related data, and the second historical cloud resource data is determined as historical cloud resource data.
[0043] In a fourth aspect, an embodiment of the present application provides a cloud resource prediction device, including:
[0044] An acquisition module, used to acquire resource-related data of multiple vehicles at the prediction time, wherein the resource-related data includes cloud performance indicator data and vehicle external environment data;
[0045] An input module is used to input the resource-related data into a resource prediction model, predict the cloud resources required by multiple vehicles, and obtain predicted cloud resource data corresponding to the multiple vehicles; wherein the resource prediction model is determined based on historical resource-related data of multiple sample vehicles in a historical period, historical cloud resource data used, and the prediction time, and the historical resource-related data includes historical cloud performance indicator data and historical data of the vehicle's external environment.
[0046] In a possible design of the fourth aspect, the acquisition module is specifically used to:
[0047] Obtaining initial resource-related data of multiple vehicles at the prediction time;
[0048] The abnormal values in the initial resource-related data are eliminated or corrected, and the processed data are normalized to generate the resource-related data.
[0049] In another possible design of the fourth aspect, the cloud performance indicator data includes instance usage quantity characteristics, CPU characteristics, and instance concurrency characteristics, and the vehicle external environment data includes temperature characteristics or weather characteristics, and the weather characteristics are determined based on the temperature, wind speed, and rain and snow conditions of the vehicle's external environment.
[0050] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and computer program instructions stored in the memory and executable on the processor, wherein the processor is used to implement the methods provided by the first aspect, the second aspect, and various possible designs when executing the computer program instructions.
[0051] In a sixth aspect, an embodiment of the present application may provide a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the methods provided by the first aspect, the second aspect, and various possible designs.
[0052] In a seventh aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, is used to implement the methods provided by the first aspect, the second aspect, and various possible designs.
[0053] The training method of the resource prediction model, the prediction method and device of cloud resources provided in the embodiments of the present application, in the training method of the resource prediction model, the electronic device of the cloud service obtains the historical resource-related data and the historical cloud resource data used by multiple sample vehicles in the historical period before the prediction time. It determines whether the prediction time belongs to the week or the weekend, generates a judgment result, and generates a training set according to the judgment result, the historical resource-related data and the historical cloud resource data. Training is performed according to the training set to generate a resource prediction model. In this technical solution, the training set is dynamically determined in combination with features such as holidays, temperature, weather, and the number of concurrent instances as well as the prediction time, and the training set containing the full amount of historical data is used for model training, thereby improving the accuracy of the predicted cloud resource data predicted by the resource prediction model according to the prediction time and resource-related data. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0055] Figure 1 A flowchart of a first embodiment of a method for training a resource prediction model provided in an embodiment of the present application;
[0056] Figure 2 A flowchart of a second embodiment of a method for training a resource prediction model provided in an embodiment of the present application;
[0057] Figure 3 A flowchart of a first embodiment of a method for predicting cloud resources provided in an embodiment of the present application;
[0058] Figure 4 A flowchart of a second embodiment of a method for predicting cloud resources provided in an embodiment of the present application;
[0059] Figure 5 A schematic diagram of the structure of a training device for a resource prediction model provided in an embodiment of the present application;
[0060] Figure 6 A schematic diagram of the structure of a cloud resource prediction device provided in an embodiment of the present application;
[0061] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0062] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0064] Before introducing the embodiments of the present application, the application background of the embodiments of the present application is first explained:
[0065] The cloud serves the various businesses it runs and configures corresponding cloud resources for each business based on the size of the business volume. The configured cloud resources are positively correlated with the business volume. That is, the larger the business volume, the larger the configured cloud resources; conversely, the smaller the business volume, the smaller the configured cloud resources.
[0066] With the improvement of the intelligence level of smart vehicles, the traditional way of using vehicle-side computing to provide services to users is increasingly unable to meet the increasing application needs of users. In order to solve the above application demand problems, vehicle services can be deployed in the cloud. The cloud supports the rapid introduction of massive and complex intelligent applications, and can ensure the safety, stability and efficiency of application operation. In actual applications, data is exchanged between vehicles and the cloud to provide users with corresponding services. However, the cloud configures resources for vehicles to meet user application needs, which brings about a sharp increase in demand for cloud resources. Therefore, how to reasonably configure resources for vehicles has become a problem that needs to be solved urgently.
[0067] At present, the resource allocation for vehicles is mainly based on the cloud resources consumed by the vehicle in the past, and the usage pattern of the cloud resources by the vehicle is determined in the time dimension. For example, the usage pattern can be a gradual decrease or a gradual increase. Furthermore, the demand for cloud resources by the vehicle at a future time is predicted based on the usage pattern, and the cloud resources required by the vehicle at a future time are configured based on the demand.
[0068] However, the prior art only considers the impact of time factors on the cloud resources required by the vehicle, which is a relatively single factor and leads to inaccurate resource allocation for the vehicle.
[0069] In order to solve the problems existing in the prior art, the inventors discovered during their research in this technical field that a training set can be dynamically determined in advance according to the prediction time, and a model can be trained based on the training set to obtain a resource prediction model. The cloud resources required by multiple vehicles can be predicted based on the resource prediction model, which can effectively improve the accuracy of the prediction results.
[0070] The technical solution of the present application is described in detail below through specific embodiments.
[0071] It should be noted that the following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0072] Figure 1 The flowchart of the training method of the resource prediction model provided in the embodiment of the present application is shown in FIG. Figure 1 As shown, the training method of the resource prediction model may include the following steps:
[0073] S101. Obtain historical resource-related data and historical cloud resource data used by multiple sample vehicles in a historical period before a prediction time.
[0074] In this step, since the resource prediction model is obtained by training based on the training set, the data in the training set is closely related to the prediction accuracy of the resource prediction model. In other words, the higher the matching degree between the features in the training set and the features input into the resource prediction model in the actual prediction process, the higher the prediction accuracy of the prediction model. Therefore, before model training, 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 of the training set. Therefore, it is necessary to obtain the historical resource-related data of multiple sample vehicles in the historical period before the prediction time and the historical cloud resource data used.
[0075] Exemplarily, the predicted time may be a specific day, or a specific time on a specific day, which may be determined based on actual conditions, and the embodiments of the present application do not impose specific limitations on this.
[0076] Among them, the historical time period includes weeks and weekends. Exemplarily, the historical time period can be one week, one month, or three months before the prediction time, etc., which can be determined according to actual conditions. The embodiments of the present application do not impose specific restrictions on this.
[0077] Since users have different demands for applications during the week and on weekends, for example, during the week, users usually use vehicles for commuting, use applications for a shorter time, and require fewer cloud resources for vehicles; on weekends, users usually use vehicles for outings, use applications for a longer time, and require more cloud resources for vehicles. Therefore, when the historical period includes both weekdays and weekends, the richness of the data in the training set determined later is increased, which helps improve the learning ability of the model, thereby improving the prediction accuracy of the resource prediction model.
[0078] Among them, historical resource-related data include historical performance indicator data in the cloud and historical data on the vehicle's external environment.
[0079] Optionally, the cloud historical performance indicator data includes instance usage quantity characteristics, central processing unit (CPU) characteristics, and instance concurrency characteristics, and the vehicle external environment historical data includes temperature characteristics or weather characteristics. The weather characteristics are determined based on the temperature, wind speed, and rain and snow conditions of the sample vehicle's external environment.
[0080] Optionally, there is a mapping relationship between the weather feature and the temperature, wind speed, and rain and snow conditions. For example, if the temperature is between 20 degrees Celsius and 30 degrees Celsius, the wind speed is less than level 3, and there is no rain or snow, the weather feature value is considered to be comfortable weather; if the temperature is above 30 degrees Celsius, the wind speed is greater than level 3, and there is rain and snow, the weather feature value is considered to be normal weather; if there is heavy rain, heavy snow, or thunder and lightning, the weather feature value is considered to be extreme weather.
[0081] The historical resource related data also includes preset event features and preset date features. For example, the preset event may be an offline event, such as an Arbor Day event, a large-scale examination, or a large-scale promotional event.
[0082] Among them, the preset date can be a holiday. Since the rest time on holidays is longer, unlike during the week and weekends, users usually choose to go out for fun or visit relatives and friends on holidays. Therefore, the historical resource-related data and the corresponding historical cloud resource data on holidays usually have pulses, forming data outliers. Therefore, the pulse factor can be calculated based on the historical resource-related data and historical cloud resource data of the preset date, as well as the historical resource-related data and historical cloud resource data of the non-preset date, and the pulse factor is used as the characteristic value of the preset date to participate in the model training, so that the data in the training set is divided by the pulse factor for smoothing during the model training process.
[0083] Optionally, the pulse factor calculated based on historical resource-related data and historical cloud resource data of a preset date, as well as historical resource-related data and historical cloud resource data of a non-preset date can be implemented through an existing model, and the embodiments of the present application do not impose specific restrictions on this.
[0084] S102: Determine whether the predicted time is during the week or on the weekend, and generate a determination result.
[0085] In this step, since the cloud resources required by the vehicle during the week are quite different from those required on the weekend, in order to improve the matching degree between the features in the training set and the features 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 based on the judgment result.
[0086] Optionally, the judgment result is used to characterize whether the predicted time belongs to a weekday or a weekend.
[0087] S103: Generate a training set based on the judgment result, historical resource-related data, and historical cloud resource data.
[0088] In this step, after obtaining the judgment result, each sub-historical resource related data in the historical resource related data can be adjusted according to the judgment result, and a training set can be generated according to the historical cloud resource data.
[0089] In one possible implementation, the weight of each sub-historical resource related data in the historical resource related data can be determined based on the judgment result, each sub-historical resource related data in the historical resource related data can be assigned a corresponding weight, and a training set can be generated based on the historical cloud resource data.
[0090] Among them, any sub-historical resource related data is data in the historical resource related data whose historical time is during the week or on the weekend.
[0091] Optionally, when the judgment result indicates that the predicted moment is within a week, the weight of the sub-historical resource related data whose historical moment is within a week (referred to as: historical data within a week) is determined to be the first weight, and the weight of the sub-historical resource related data whose historical moment is the weekend (referred to as: historical data on the weekend) is determined to be the second weight; when the judgment result indicates that the predicted moment is the weekend, the weight of the historical data on the weekend is determined to be the first weight, and the weight of the historical data within a week is determined to be the second weight. The first weight is greater than the second weight.
[0092] As a specific example of the above method, the first weight can be 1.2, and the second weight can be 0.8. That is, when the judgment result indicates that the prediction moment is within the week, the training set can be expressed by the following formula: training set = 1.2 × historical data within the week + 0.8 × historical data on the weekend; when the judgment result indicates that the prediction moment is within the weekend, the training set can be expressed by the following formula: training set = 1.2 × historical data on the weekend + 0.8 × historical data within the week.
[0093] The data related to each sub-historical resource also includes the mean, maximum, minimum and median of each feature in the data related to the sub-historical resource.
[0094] S104: Perform training according to the training set to generate a resource prediction model.
[0095] In this step, after the training set is determined, model training can be performed based on the training set to generate a resource prediction model, wherein the resource prediction model is used to predict the cloud resources required by multiple vehicles.
[0096] In a possible implementation, a pre-established initial model may be trained according to a training set to generate a resource prediction model. Optionally, the initial model is pre-established based on a time series model and a decision tree algorithm.
[0097] In another possible implementation, the resource prediction model generated last time may be retrained according to the training set to obtain a new resource prediction model.
[0098] The training method of the resource prediction model provided in the present application is that the electronic device of the cloud service obtains the historical resource-related data of multiple sample vehicles in the historical period before the prediction time and the historical cloud resource data used. It determines whether the prediction time belongs to the week or the weekend, generates a judgment result, and generates a training set according to the judgment result, the historical resource-related data and the historical cloud resource data. Training is performed according to the training set to generate a resource prediction model. In this technical solution, the training set is dynamically determined based on the characteristics such as holidays, temperature, weather, and the number of concurrent instances as well as the prediction time, and the training set containing the full amount of historical data is used for model training, thereby improving the accuracy of the predicted cloud resource data predicted by the resource prediction model according to the prediction time and resource-related data.
[0099] Figure 2 The flowchart of the second embodiment of the training method of the resource prediction model provided in the embodiment of the present application is as follows. Figure 2 As shown, based on any of the above embodiments, S101 can be implemented by the following steps:
[0100] S201. Obtain first historical resource-related data and first historical cloud resource data of multiple sample vehicles in a historical period before a prediction time.
[0101] In this step, since the initial data obtained by the electronic device may contain erroneous data, 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 obtained first. It should be understood that the initial data here is the first historical resource-related data and the first historical cloud resource data.
[0102] The first historical resource-related data and the first historical cloud resource data may be corresponding data when multiple sample vehicles were running in a historical period.
[0103] S202: Eliminate or correct abnormal values in the first historical resource-related data and the first cloud resource data, and normalize the processed data to generate second historical resource-related data and second historical cloud resource data.
[0104] In this step, the preprocessing may be to remove or correct erroneous data, that is, to remove or correct abnormal values in the first historical resource-related data and the first cloud resource data, so as to improve the accuracy of the training set generated subsequently.
[0105] For example, assuming that the CPU utilization is equal to or less than 0 when the cloud provides services for various services, the CPU utilization is an abnormal value, that is, the above-mentioned erroneous data, which needs to be eliminated or corrected. It can also be replaced and corrected by the average value of the CPU utilization when the cloud is running normally and without special circumstances.
[0106] Furthermore, the processed data is normalized and mapped to the range of 0 to 1, thereby improving the speed and convenience of subsequent model training.
[0107] S203, performing correlation analysis on each feature in the second historical resource related data and the second historical cloud resource data, removing features in the second historical resource related data whose correlation obtained through the correlation analysis is lower than a preset correlation, generating historical resource related data, and determining the second historical cloud resource data as historical cloud resource data.
[0108] In this step, the second historical resource-related data may contain features that have low correlation with the historical cloud resource data. This feature is of little help to model training and can be eliminated to increase the speed of model training and reduce the computing resources required for model training.
[0109] It should be understood that 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 degree of correlation between the two, that is, the correlation degree.
[0110] Among them, the preset relevance can be determined in advance by relevant staff based on empirical values, can be determined by relevant staff based on experimental results, or can be determined by relevant staff based on historical data. The method for determining the preset relevance can be determined according to actual conditions, and the embodiments of the present application do not impose specific restrictions on this.
[0111] In the above embodiment, preprocessing the data constituting the training set before model training can effectively improve the accuracy of the training set, thereby improving the speed, convenience and accuracy of subsequent model training.
[0112] After obtaining the above resource prediction model, the resource prediction model can be used to predict the cloud resources required by multiple vehicles. The following is a detailed description of the method for predicting the cloud resources required by multiple vehicles using the resource prediction model in conjunction with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0113] In specific implementation, the execution subject of the cloud resource prediction method can also be an electronic device with processing capabilities such as a terminal or a server. It should be understood that the electronic device that executes the cloud resource prediction method and the electronic device that executes the above-mentioned resource prediction model training method can be the same device or different devices.
[0114] Figure 3 This is a flow chart of a first embodiment of a method for predicting cloud resources provided in an embodiment of the present application. Figure 3 As shown, the cloud resource prediction method may include the following steps:
[0115] S301. Obtain resource-related data of multiple vehicles at the prediction time.
[0116] In this step, when predicting the cloud resources required by multiple vehicles at the prediction time, it is necessary to obtain resource-related data of the multiple vehicles at the prediction time in advance.
[0117] Among them, resource-related data includes cloud performance indicator data and vehicle external environment data.
[0118] Exemplarily, the cloud performance indicator data includes instance usage quantity features, CPU features, and instance concurrency features, and the vehicle external environment data includes temperature features or weather features, and the weather features are determined based on the temperature, wind force, and rain and snow conditions of the vehicle external environment. It should be understood that the mapping relationship between weather features and temperature, wind force, and rain and snow conditions can refer to the relevant content in S101, which will not be repeated here.
[0119] For example, the temperature, wind speed, and rain and snow conditions of the vehicle's external environment can be acquired through the network based on the vehicle's location and predicted time.
[0120] In a possible implementation, initial resource-related data of multiple vehicles at the prediction time may be obtained, outliers in the initial resource-related data may be removed or corrected, and the processed data may be normalized to generate resource-related data.
[0121] Among them, in this implementation, the removal or correction of outliers and the normalization of processed data can all refer to the relevant content in S203, which will not be repeated here.
[0122] S302: Inputting resource-related data into a resource prediction model, predicting cloud resources required by multiple vehicles, and obtaining predicted cloud resource data corresponding to the multiple vehicles.
[0123] Among them, the resource prediction model is determined based on the historical resource-related data of multiple sample vehicles in the historical period, the historical cloud resource data used and the prediction time. The historical resource-related data includes the historical cloud performance indicator data and the historical data of the vehicle's external environment.
[0124] The process of resource prediction model can refer to Figure 3 The contents before the illustrated embodiment will not be repeated here.
[0125] Optionally, when the prediction time is a holiday, the resource prediction model can make a preliminary prediction of the cloud resources required by multiple vehicles based on the input resource-related data to obtain an initial prediction result. After that, the initial prediction result is multiplied by the pulse factor corresponding to the holiday, and the processed prediction result is output as the final predicted cloud resource data.
[0126] Optionally, after this step, the oversold coefficient of the vehicle may be adjusted according to the predicted cloud resource data to achieve elastic expansion or contraction of cloud resources.
[0127] In the cloud resource prediction method provided in the embodiment of the present application, the electronic device of the cloud service obtains the resource-related data of multiple vehicles at the prediction time, and inputs the resource-related data into the resource prediction model, predicts the cloud resources required by the multiple vehicles, and obtains the predicted cloud resource data corresponding to the multiple vehicles. In this technical solution, the resource prediction model can be used in real time to accurately predict the cloud resources required by multiple vehicles at the prediction time. Furthermore, the cloud resources of the vehicle can be configured according to the predicted cloud resource data, and the cloud resources can be elastically expanded or reduced on the premise of meeting user needs, thereby avoiding the waste of cloud resources and ensuring the normal use of vehicle applications. At the same time, it can also facilitate operators to configure operation strategies, reduce carbon emissions, and realize the digitalization and differentiated operation of the smart car platform.
[0128] The following uses the same electronic device as an example to illustrate the technical solution provided in this application by taking the training method of the resource prediction model and the prediction method of cloud resources as examples.
[0129] Figure 4 This is a flow chart of the second embodiment of the cloud resource prediction method provided in the present application. Figure 4 As shown, the cloud resource prediction method provided by the present application is implemented as follows in a practical application:
[0130] S401. Obtain historical resource-related data and historical cloud resource data used by multiple sample vehicles in a historical period before the prediction time.
[0131] S402: Perform model training based on historical resource-related data and historical cloud resource data to obtain a resource prediction model.
[0132] S403. According to the resource-related data of the multiple vehicles at the prediction time, the cloud resources required by the multiple vehicles are predicted by a resource prediction model to obtain predicted cloud resource data corresponding to the multiple vehicles.
[0133] S404: Adjust the oversold coefficient according to the predicted cloud resource data.
[0134] S405. Elastically expand or reduce the capacity of cloud resources according to the oversold coefficient.
[0135] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0136] Figure 5 A schematic diagram of the structure of a training device for a resource prediction model provided in an embodiment of the present application. Figure 5 As shown, the training device of the resource prediction model includes:
[0137] An acquisition module 501 is used to acquire historical resource-related data and historical cloud resource data used by multiple sample vehicles in a historical period before the prediction time, where the historical period includes weekdays and weekends, and the historical resource-related data includes cloud historical performance indicator data and vehicle external environment historical data;
[0138] A judgment module 502, used to judge whether the predicted time is within the week or on the weekend, and generate a judgment result;
[0139] A generation module 503, used to generate a training set according to the judgment result, historical resource-related data and historical cloud resource data;
[0140] The generation module 503 is also used to perform training according to the training set to generate a resource prediction model, where the resource prediction model is used to predict the cloud resources required by multiple vehicles.
[0141] In a possible design of the embodiment of the present application, the generating module 503 is specifically used for:
[0142] According to the judgment result, the weight of each sub-historical resource related data in the historical resource related data is determined, and any sub-historical resource related data is the data in the historical resource related data whose historical time is within the week or on the weekend;
[0143] Assign corresponding weights to each sub-historical resource related data in the historical resource related data, and generate a training set based on the historical cloud resource data.
[0144] In another possible design of an embodiment of the present application, the cloud historical performance indicator data includes instance usage quantity characteristics, CPU characteristics, and instance concurrency characteristics, and the vehicle external environment historical data includes temperature characteristics or weather characteristics. The weather characteristics are determined based on the temperature, wind speed, and rain and snow conditions of the sample vehicle's external environment.
[0145] Optionally, the historical resource related data further includes preset event features and preset date features, and each sub-historical resource related data further includes the mean, maximum, minimum and median of each feature in the sub-historical resource related data;
[0146] Among them, the preset date characteristic value is the pulse factor, and the pulse factor is calculated based on the historical resource-related data and historical cloud resource data of the preset date, as well as the historical resource-related data and historical cloud resource data of the non-preset date.
[0147] In another possible design of the embodiment of the present application, the acquisition module 501 is specifically used to:
[0148] Acquire first historical resource-related data and first historical cloud resource data of multiple sample vehicles in a historical period before a prediction time;
[0149] Eliminate or correct the abnormal values in the first historical resource-related data and the first historical cloud resource data, and normalize the processed data to generate the second historical resource-related data and the second historical cloud resource data;
[0150] A correlation analysis is performed on each feature in the second historical resource related data and the second historical cloud resource data, and features in the second historical resource related data whose correlation obtained through the correlation analysis is lower than a preset correlation are eliminated to generate historical resource related data, and the second historical cloud resource data is determined as the historical cloud resource data.
[0151] The resource prediction model training device provided in the embodiment of the present application can be used to execute the resource prediction model training method in any of the above embodiments. Its implementation principle and technical effects are similar and will not be repeated here.
[0152] Figure 6 This is a schematic diagram of the structure of a cloud resource prediction device provided in an embodiment of the present application. Figure 6 As shown, the cloud resource prediction device includes:
[0153] An acquisition module 601 is used to acquire resource-related data of multiple vehicles at a prediction time, where the resource-related data includes cloud performance indicator data and vehicle external environment data;
[0154] Input module 602 is used to input resource-related data into a resource prediction model, predict the cloud resources required by multiple vehicles, and obtain predicted cloud resource data corresponding to the multiple vehicles; wherein the resource prediction model is determined based on historical resource-related data of multiple sample vehicles in a historical period, historical cloud resource data used, and prediction time, and the historical resource-related data includes historical cloud performance indicator data and historical data of the vehicle's external environment.
[0155] In a possible design of the embodiment of the present application, the acquisition module 601 is specifically used to:
[0156] Obtaining initial resource-related data of multiple vehicles at the prediction time;
[0157] The outliers in the initial resource-related data are eliminated or corrected, and the processed data are normalized to generate resource-related data.
[0158] In another possible design of an embodiment of the present application, the cloud performance indicator data includes instance usage quantity characteristics, CPU characteristics, and instance concurrency characteristics, and the vehicle external environment data includes temperature characteristics or weather characteristics. The weather characteristics are determined based on the temperature, wind speed, and rain and snow conditions of the vehicle's external environment.
[0159] The cloud resource prediction device provided in the embodiment of the present application can be used to execute the cloud resource prediction method in any of the above embodiments. Its implementation principle and technical effects are similar and will not be repeated here.
[0160] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software calling through processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software calling through processing elements, and some modules can be implemented in the form of hardware. In addition, all or part of these modules can be integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0161] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7As shown, 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. When the processor 71 executes the computer program instructions, it implements the resource prediction model training method or cloud resource prediction method provided in any of the aforementioned embodiments.
[0162] Optionally, the above-mentioned components of the electronic device may be connected via a system bus.
[0163] The memory 72 may be a separate storage unit or a storage unit integrated in the processor. The number of processors is one or more.
[0164] Optionally, the electronic device may further include an interface for interacting with other devices.
[0165] It should be understood that the processor 71 can be a CPU, or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the present application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor.
[0166] The system bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage.
[0167] All or part of the steps of the above-mentioned method embodiments can be completed by hardware related to program instructions. The above-mentioned 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 above-mentioned memory (storage medium) includes: read-only memory (ROM), RAM, flash memory, hard disk, solid state drive, magnetic tape, floppy disk, optical disc and any combination thereof.
[0168] The electronic device provided in the embodiment of the present application can be used to execute the resource prediction model training method or cloud resource prediction method provided in any of the above method embodiments. Its implementation principles and technical effects are similar and will not be repeated here.
[0169] An embodiment of the present application provides a computer-readable storage medium, which stores computer execution instructions. When the computer execution instructions are executed on a computer, the computer executes the above-mentioned resource prediction model training method or cloud resource prediction method.
[0170] The computer-readable storage medium mentioned above can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory, electrically erasable programmable read-only memory, erasable programmable read-only memory, programmable read-only memory, read-only memory, magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0171] Optionally, a readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0172] An embodiment of the present application also provides a computer program product, which includes a computer program, which is stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium, and when the at least one processor executes the computer program, it can implement the above-mentioned resource prediction model training method or cloud resource prediction method.
[0173] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A training method for a resource prediction model, characterized in that: include: Acquire historical resource-related data and historical cloud resource data used by multiple sample vehicles in a historical period before the prediction time, wherein the historical period includes weekdays and weekends, and the historical resource-related data includes cloud historical performance indicator data and vehicle external environment historical data; Determine whether the predicted time is within the week or on the weekend, and generate a determination result; Generate a training set according to the judgment result, the historical resource-related data and the historical cloud resource data; Perform training according to the training set to generate a resource prediction model, wherein the resource prediction model is used to predict cloud resources required by multiple vehicles; The obtaining of historical resource-related data and historical cloud resource data used by multiple sample vehicles in a historical period before the prediction time includes: Acquire 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; Eliminate or correct abnormal values in the first historical resource-related data and the first historical cloud resource data, and normalize the processed data to generate second historical resource-related data and second historical cloud resource data; Performing a correlation analysis on each feature in the second historical resource-related data and the second historical cloud resource data, removing features in the second historical resource-related data whose correlations obtained through the correlation analysis are lower than a preset correlation, generating historical resource-related data, and determining the second historical cloud resource data as historical cloud resource data; The generating a training set according to the judgment result, the historical resource-related data and the historical cloud resource data includes: According to the judgment result, the weight of each sub-historical resource related data in the historical resource related data is determined, and any sub-historical resource related data is data in the historical resource related data whose historical moment is within the week or on the weekend; wherein, when the judgment result indicates that the predicted moment is within the week, the weight of the sub-historical resource related data whose historical moment is within the week is determined to be the first weight, and the weight of the sub-historical resource related data whose historical moment is on the weekend is determined to be the second weight; when the judgment result indicates that the predicted moment is on the weekend, the weight of the sub-historical resource related data whose historical moment is on the weekend is determined to be the first weight, and the weight of the sub-historical resource related data whose historical moment is within the week is determined to be the second weight, and the first weight is greater than the second weight; Each sub-historical resource related data in the historical resource related data is assigned a corresponding weight, and the training set is generated according to the historical cloud resource data.
2. The method according to claim 1, characterized in that The cloud historical performance indicator data includes instance usage quantity characteristics, central processing unit CPU characteristics and instance concurrency characteristics. The vehicle external environment historical data includes temperature characteristics and weather characteristics. The weather characteristics are determined based on the temperature, wind speed and rain and snow conditions of the sample vehicle's external environment.
3. The method according to claim 1, characterized in that The historical resource related data also includes preset event features and preset date features, and each sub-historical resource related data also includes the mean, maximum, minimum and 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 based on historical resource related data and historical cloud resource data of the preset date, and historical resource related data and historical cloud resource data of non-preset dates.
4. A cloud resource prediction method, characterized in that: include: Obtain resource-related data of multiple vehicles at a prediction time, wherein the resource-related data includes cloud performance indicator data and vehicle external environment data; The resource-related data is input into a resource prediction model, and cloud resources required by multiple vehicles are predicted to obtain predicted cloud resource data corresponding to the multiple vehicles; the resource prediction model is generated by training based on a training set, and the training set determines the weight of each sub-historical resource-related data in the historical resource-related data based on the judgment result, and each sub-historical resource-related data in the historical resource-related data is assigned a corresponding weight, and is generated based on the historical cloud resource data, wherein the judgment result is generated by judging whether the predicted moment belongs to a week or a weekend, and any sub-historical resource-related data is data in the historical resource-related data whose historical moment is a week or a weekend. When the judgment result indicates that the predicted moment is a week, the weight of the sub-historical resource-related data whose historical moment is a week is determined to be a first weight, and the weight of the sub-historical resource-related data whose historical moment is a weekend is determined to be a second weight. In the judgment result, If the prediction moment is characterized as a weekend, the weight of the sub-historical resource related data when the historical moment is the weekend is determined to be the first weight, and the weight of the sub-historical resource related data when the historical moment is within the week is determined to be the second weight, the first weight is greater than the second weight, and the historical resource related data includes cloud historical performance indicator data and vehicle external environment historical data; the historical resource related data is generated by eliminating or correcting the abnormal values in the first historical resource related data and the first historical cloud resource data of multiple sample vehicles in the historical period before the prediction moment, and normalizing the processed data to generate the second historical resource related data and the 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, and eliminating the features in the second historical resource related data whose correlation obtained by the correlation analysis is lower than the preset correlation.
5. The method according to claim 4, characterized in that The cloud performance indicator data includes instance usage quantity characteristics, central processing unit CPU characteristics and instance concurrency number characteristics, and the vehicle external environment data includes temperature characteristics or weather characteristics, and the weather characteristics are determined based on the temperature, wind force and rain and snow conditions of the vehicle's external environment.
6. A training device for a resource prediction model, characterized in that: include: An acquisition module, used to acquire historical resource-related data and historical cloud resource data used by multiple sample vehicles in a historical period before the prediction time, wherein the historical period includes weekdays and weekends, and the historical resource-related data includes cloud historical performance indicator data and vehicle external environment historical data; A judgment module, used to judge whether the predicted time belongs to the week or the weekend, and generate a judgment result; A generation module, used to generate a training set according to the judgment result, the historical resource-related data and the historical cloud resource data; The generation module is further used to perform training according to the training set to generate a resource prediction model, wherein the resource prediction model is used to predict cloud resources required by multiple vehicles; The acquisition module is specifically used to acquire first historical resource-related data and first historical cloud resource data of multiple sample vehicles in a historical period before the prediction moment; remove or correct the abnormal values in the first historical resource-related data and the first historical cloud resource data, and normalize the processed data to generate second historical resource-related data and second historical cloud resource data; perform correlation analysis on each feature in the second historical resource-related data and the second historical cloud resource data, remove features in the second historical resource-related data whose correlation obtained through the correlation analysis is lower than a preset correlation, generate historical resource-related data, and determine the second historical cloud resource data as historical cloud resource data; The generating module is specifically used for: According to the judgment result, the weight of each sub-historical resource related data in the historical resource related data is determined, and any sub-historical resource related data is data in the historical resource related data whose historical moment is within the week or on the weekend; wherein, when the judgment result indicates that the predicted moment is within the week, the weight of the sub-historical resource related data whose historical moment is within the week is determined to be the first weight, and the weight of the sub-historical resource related data whose historical moment is on the weekend is determined to be the second weight; when the judgment result indicates that the predicted moment is on the weekend, the weight of the sub-historical resource related data whose historical moment is on the weekend is determined to be the first weight, and the weight of the sub-historical resource related data whose historical moment is within the week is determined to be the second weight, and the first weight is greater than the second weight; Each sub-historical resource related data in the historical resource related data is assigned a corresponding weight, and the training set is generated according to the historical cloud resource data.
7. A cloud resource prediction device, characterized in that: include: An acquisition module, used to acquire resource-related data of multiple vehicles at the prediction time, wherein the resource-related data includes cloud performance indicator data and vehicle external environment data; An input module is used to input the resource-related data into a resource prediction model, predict the cloud resources required by multiple vehicles, and obtain predicted cloud resource data corresponding to multiple vehicles; the resource prediction model is generated by training based on a training set, and the training set determines the weight of each sub-historical resource-related data in the historical resource-related data based on the judgment result, and assigns corresponding weights to each sub-historical resource-related data in the historical resource-related data, and is generated based on historical cloud resource data, wherein the judgment result is generated by judging whether the predicted moment belongs to a week or a weekend, and any sub-historical resource-related data is data in the historical resource-related data whose historical moment is within the week or on the weekend. When the judgment result indicates that the predicted moment is within the week, the weight of the sub-historical resource-related data whose historical moment is within the week is determined to be a first weight, and the weight of the sub-historical resource-related data whose historical moment is on the weekend is determined to be a second weight. When the judgment result indicates that the predicted moment is a weekend, the weight of the sub-historical resource related data when the historical moment is the weekend is determined to be the first weight, and the weight of the sub-historical resource related data when the historical moment is within the week is determined to be the second weight, the first weight is greater than the second weight, and the historical resource related data includes cloud historical performance indicator data and vehicle external environment historical data; the historical resource related data is generated by eliminating or correcting the abnormal values in the first historical resource related data and the first historical cloud resource data of multiple sample vehicles in the historical period before the predicted moment, and normalizing the processed data to generate the second historical resource related data and the 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, and eliminating the features in the second historical resource related data whose correlation obtained by the correlation analysis is lower than the preset correlation.
8. An electronic device, comprising: A processor, a memory, and computer program instructions stored in the memory and executable on the processor, wherein the processor is used to implement the method according to any one of claims 1 to 5 when executing the computer program instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 5 when executed by a processor.
Citation Information
Patent Citations
Customizing resources in a shared vehicle environment
WO2019182555A1
Dynamic prediction method and apparatus for cloud native resources, computer device and storage medium
WO2022110444A1
