Resource allocation method and device, electronic equipment and nonvolatile storage medium
The historical workload data of the Internet of Things system is decomposed and predicted through variational modal decomposition and antlion optimization algorithm, which solves the problem of insufficient prediction accuracy in the existing technology and achieves more accurate resource allocation and utilization.
Patent Information
- Application Number
- CN202411000262.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-10-15
AI Technical Summary
Existing resource prediction methods cannot make full use of historical workload data and differences in workload types in IoT systems, resulting in insufficient prediction accuracy and inability to effectively capture the unique behaviors and deep information of different types of workloads.
The historical workload data is divided into multiple intrinsic mode function IMF components through the variational mode decomposition algorithm, and the ant lion optimization algorithm is used to train the prediction model to perform resource prediction for each IMF component, combined with elastic expansion and reserved resources. Strategies for resource allocation.
It significantly improves the precision and accuracy of resource prediction, can more effectively handle complex and dynamically changing resource requirements of IoT systems, and improves resource utilization.
Smart Images

Figure CN118779111A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet of Things systems, and more specifically, to a resource allocation method, device, electronic device, and non-volatile storage medium. Background Art
[0002] In the IoT environment, due to the large number of devices and diverse application scenarios, cloud resource requirements are extremely dynamic and complex. Many existing prediction methods are mainly based on classical regression theory, heuristic methods, and traditional neural networks, but these methods have obvious limitations in application. First, they usually fail to fully pay attention to and utilize the differences in workload types and divide different workload types. These methods assume that all workloads follow similar patterns, which makes it impossible to effectively capture and predict the unique behaviors of different types of workloads.
[0003] In addition, these methods often fail to fully explore and utilize the deep information in the data when processing a single data column. The original data contains rich potential information, but traditional methods can usually only extract and utilize surface features, resulting in insufficient prediction accuracy. At the same time, existing technologies also have some limitations in model training and optimization.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present application provide a resource allocation method, device, electronic device and non-volatile storage medium to at least solve the technical problem of insufficient prediction accuracy caused by the inability of existing resource prediction methods to fully utilize the differences in original data and workload types.
[0006] According to one aspect of an embodiment of the present application, a resource allocation method is provided, including: obtaining historical workload data of an Internet of Things system; dividing the historical workload data into a plurality of different intrinsic mode function IMF components, wherein different intrinsic mode function (IMF) components correspond to different workload types; using a first prediction model to perform resource prediction on the plurality of IMF components respectively to obtain a plurality of sub-prediction results, wherein the sub-prediction results are used to indicate the amount of resources required for the workload type corresponding to the IMF component; and the amount of resources corresponding to the plurality of sub-prediction results are used to jointly determine resource allocation strategies for different workload types in the Internet of Things system.
[0007] In some embodiments of the present application, historical workload data is divided into multiple different IMF components, including: using a variational mode decomposition (VMD) algorithm to divide the historical workload data into multiple different initial IMF components, and setting a center frequency for each initial IMF component, wherein the center frequency is set based on the frequency domain of the historical workload data; constructing a Lagrangian function with Lagrangian multiplier constraints, initializing the Lagrangian multipliers, and setting a first convergence threshold; using an alternating direction multiplier method to iteratively update the initial IMF component based on the center frequency of the initial IMF component and the Lagrangian function with Lagrangian multiplier constraints, the iteration ends when the change in the IMF component during two iterations is less than the first convergence threshold, and multiple different IMF components are obtained.
[0008] In some embodiments of the present application, before using the first prediction model to perform resource prediction for multiple components, the first prediction model is trained in the following manner: obtaining standardized historical time series data, and dividing the standardized historical time series data into a training set and a validation set according to a preset ratio; optimizing the second prediction model using the training set and the validation set based on the antlion optimization algorithm to obtain the first prediction model.
[0009] In some embodiments of the present application, the second prediction model is optimized using a training set and a validation set based on an antlion optimization algorithm to obtain a first prediction model, including: initializing the following parameters of the antlion optimization algorithm: the number of antlions, the number of iterations, the pheromone volatility coefficient, the heuristic factor, and the pheromone importance factor; determining a list of hyperparameters that need to be optimized for the second prediction model, randomly generating antlion individuals based on the antlion optimization algorithm in the training set, and each antlion individual represents a hyperparameter combination in the hyperparameter list; initializing a pheromone matrix, wherein the pheromone matrix is used to store the hyperparameter combination and performance index corresponding to each antlion individual, and the same pheromone value is assigned to each hyperparameter combination during initialization; iteratively executing the following steps until the pheromone matrix completes convergence, and the convergence condition is that the change in the pheromone matrix between two consecutive iterations is less than a second convergence threshold: using the hyperparameter combination represented by each antlion individual in the pheromone matrix to train the second prediction model, and using the validation set to evaluate the second prediction model to obtain a first evaluation result, and updating the pheromone matrix based on the first evaluation result; using the hyperparameter combination represented by each antlion individual in the converged pheromone matrix to train the second prediction model to obtain the first prediction model.
[0010] In some embodiments of the present application, the first prediction model is used to perform resource prediction on multiple components respectively to obtain multiple sub-prediction results, including: using the first prediction model to predict the amount of resources required for multiple IMF components in the same time step to obtain multiple sub-prediction results; or: using the first prediction model to predict the amount of resources required for multiple IMF components in multiple different time steps to obtain multiple different sub-prediction results corresponding to each IMF component in multiple different time steps.
[0011] In some embodiments of the present application, the resource supply strategy includes at least one of the following: elastic expansion and reserved resource strategy, wherein the elastic expansion strategy is used to adjust resource configuration, and the reserved resource strategy is used to regularly adjust reserved resources.
[0012] In some embodiments of the present application, after obtaining multiple sub-prediction results, the method also includes: evaluating the multiple sub-prediction results in the following manner: obtaining a test data set; using the test data set to test the multiple sub-prediction results respectively, and obtaining prediction result indicators for the sub-prediction results corresponding to each workload type; using multiple preset evaluation indicators to evaluate the multiple sub-prediction results respectively, and obtaining multiple evaluation result indicators for each sub-prediction result, wherein the multiple preset evaluation indicators are used to evaluate the multiple sub-prediction results, and the calculation methods of the multiple preset evaluation indicators are different; sorting the multiple evaluation result indicators and prediction result indicators corresponding to each workload type, and when the prediction result indicator is in the front preset number of digits in the sorted result, it is determined that the sub-prediction result corresponding to the workload type is accurate.
[0013] According to another aspect of an embodiment of the present application, a resource allocation device is also provided, including: an acquisition module, used to acquire historical workload data of an Internet of Things system; a division module, used to divide the historical workload data into multiple different intrinsic mode function IMF components, wherein different IMF components correspond to different workload types; a prediction module, used to use a first prediction model to perform resource prediction on multiple IMF components respectively, and obtain multiple sub-prediction results, wherein the sub-prediction results are used to indicate the amount of resources required for the workload type corresponding to the IMF component; the resource amounts corresponding to the multiple sub-prediction results are used to jointly determine the resource allocation strategies for different workload types in the Internet of Things system.
[0014] According to another aspect of an embodiment of the present application, a non-volatile storage medium is provided, in which a program is stored, wherein when the program is running, a device where the non-volatile storage medium is located is controlled to execute the above-mentioned resource allocation method.
[0015] According to another aspect of an embodiment of the present application, an electronic device is further provided, including: a memory and a processor, the processor being configured to run a program stored in the memory, wherein the above-mentioned resource allocation method is executed when the program is run.
[0016] According to another aspect of an embodiment of the present application, a computer program product is also provided, including computer instructions, and when the computer instructions are executed by a processor, the above-mentioned resource allocation method is implemented.
[0017] In an embodiment of the present application, the historical workload data of the Internet of Things system is obtained; the historical workload data is divided into multiple different intrinsic mode function IMF components, wherein different IMF components correspond to different workload types; a first prediction model is used to perform resource prediction on the multiple IMF components respectively to obtain multiple sub-prediction results, wherein the sub-prediction results are used to indicate the amount of resources required for the workload type corresponding to the IMF component; the amount of resources corresponding to the multiple sub-prediction results are used to jointly determine the resource allocation strategy for different workload types in the Internet of Things system. By dividing the historical workload data into different components and predicting the results separately, the historical workload data is fully utilized and divided according to different workload types and the results are predicted separately, thereby achieving the technical effect of improving the prediction accuracy, thereby solving the technical problem of insufficient prediction accuracy caused by the inability of existing resource prediction methods to fully utilize the differences between original data and workload types. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0019] Figure 1 It is a hardware structure block diagram of a computer terminal for implementing a resource allocation method provided in an embodiment of the present application;
[0020] Figure 2 is a flow chart of a resource allocation method provided according to an embodiment of the present application;
[0021] Figure 3 It is a flow chart of a VMD-ALO-GRU model of a resource allocation method provided in an embodiment of the present application;
[0022] Figure 4 It is a schematic diagram of resource utilization of a resource allocation method provided according to an embodiment of the present application;
[0023] Figure 5 It is a comparison diagram of the actual value and the predicted value of resource utilization rate of a resource allocation method provided in an embodiment of the present application;
[0024] Figure 6 It is a comparison chart of evaluation indicators of multi-step prediction results of CPU utilization of a resource allocation method provided in an embodiment of the present application;
[0025] Figure 7 It is a structural diagram of a resource allocation device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the solution of the present application, 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 only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] In order to better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are explained as follows:
[0029] Variational Mode Decomposition (VMD) is an advanced signal processing technology. The core of the VMD algorithm is to decompose the signal into a series of sub-signals with specific center frequencies and limited bandwidths. These sub-signals are called Intrinsic Mode Functions (IMFs). VMD provides a more adaptive and non-recursive decomposition strategy that can effectively avoid modal aliasing and has better noise resistance. The basic principle of the VMD algorithm is to decompose the signal into K modal components by constructing a variational problem, each with its own specific center frequency. The algorithm iteratively searches for the optimal solution to determine the center frequency and bandwidth of each component, while ensuring that the sum of all components is equal to the original signal.
[0030] Ant Lion Optimizer (ALO) is a heuristic optimization algorithm that simulates the predation behavior of ant lions in nature. It is also used in the field of Internet of Things. The ALO algorithm finds the optimal solution to the problem by simulating the process of ant lions digging holes to prey on ants. In the field of Internet of Things, the ALO algorithm can be used for a variety of optimization problems, such as signal processing, pattern recognition, etc. Specifically for signal decomposition algorithms, the ALO algorithm has the advantages of strong global search capabilities, fast convergence speed, and simple parameter setting. Therefore, it has a high application value in the field of Internet of Things. The application of the ALO algorithm in the field of Internet of Things demonstrates its effectiveness in solving complex optimization problems, especially in signal processing and pattern recognition.
[0031] The Gated Recurrent Unit (GRU) model is a variant of a recurrent neural network for processing sequence data. It aims to solve the gradient vanishing or gradient exploding problems encountered by traditional recurrent neural networks when processing long sequence data. GRU is particularly suitable for time series analysis, natural language processing, and other tasks that need to capture long-term dependent information. The GRU model contains two key components: the reset gate, which allows the model to ignore previous information when processing different parts of the sequence. It determines the extent to which the hidden state of the previous time step affects the current time step, and the update gate, which controls the amount of information passed from the previous time step to the current time step. It determines the extent to which the current input updates the state. These two gating mechanisms allow the model to selectively remember or forget past information more effectively.
[0032] In the related art, existing resource demand allocation prediction methods often rely on simple statistical models or rule-based methods. Although these methods can provide certain prediction capabilities in some simple scenarios, they lack the ability to handle complex and dynamically changing environments. In the Internet of Things system, the workload of devices and applications often exhibits high dynamics and complex change patterns, which makes it difficult for simple models to capture these changes, resulting in inaccurate prediction results and unable to meet the refined requirements of the Internet of Things system for resource allocation. Secondly, the existing methods have significant limitations in data processing and feature extraction. The Internet of Things system usually generates a large amount of real-time data, which is highly diverse and complex. Traditional data processing methods cannot fully mine the potential information in the data when processing such a large and complex data set, resulting in insufficient information utilization. Therefore, there is a technical problem that the existing resource prediction method cannot fully utilize the differences in raw data and workload types, resulting in insufficient prediction accuracy. In order to solve this problem, a relevant solution is provided in the embodiment of the present application, which is described in detail below.
[0033] According to an embodiment of the present application, a method embodiment of a resource allocation method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0034] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal for implementing a resource allocation method. Figure 1 As shown, the computer terminal 10 may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0035] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0036] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the resource allocation method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the above-mentioned resource allocation method is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0037] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0038] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0039] In the above operating environment, the embodiment of the present application provides a flow chart of a resource allocation method, such as Figure 2 As shown, the following steps are included:
[0040] Step S202: Obtain historical workload data of the Internet of Things system.
[0041] In the technical solution provided in step S202, the historical workload data of the Internet of Things system obtained may be data obtained in the form of a signal.
[0042] Step S204: divide the historical workload data into a plurality of different intrinsic mode function IMF components, wherein different IMF components correspond to different workload types.
[0043] In the technical solution provided in step S204, there are many ways to divide the historical workload data into a plurality of different intrinsic mode function (IMF) components. For example, the historical workload data can be divided into a plurality of different intrinsic mode function IMF components in the following manner:
[0044] The variational mode decomposition (VMD) algorithm is used to divide the historical workload data into multiple different initial IMF components, and a center frequency is set for each initial IMF component, wherein the center frequency is set based on the frequency domain of the historical workload data; a Lagrangian function with Lagrangian multiplier constraints is constructed, the Lagrangian multipliers are initialized, and a first convergence threshold is set; the alternating direction multiplier method is used to iteratively update the initial IMF components based on the center frequencies of the initial IMF components and the Lagrangian function with Lagrangian multiplier constraints, and the iteration ends when the change of the IMF components during two iterations is less than the first convergence threshold, thereby obtaining multiple different IMF components.
[0045] The following is a specific embodiment:
[0046] The relationship between the historical workload data and the center frequency in the variational mode decomposition (VMD) is established through frequency domain optimization in the VMD process. The historical workload data is decomposed into multiple IMF components, each of which corresponds to a specific center frequency. The center frequency can be set based on the frequency domain of the historical workload data.
[0047] Assume that the original signal (i.e. the above historical workload data) is x(t), and decompose it into K modal functions (i.e. the above IMF components) u through VMD k (t) and:
[0048]
[0049] Where x(t) is the original signal (i.e. the above historical workload data), u k (t) is the mode function (i.e. the IMF component mentioned above), are K mode functions (i.e., the above-mentioned IMF components) u k (t) and.
[0050] Mode function (i.e. the above IMF component) u k The initial frequency domain representation of (t) is Through Fourier transform, we get:
[0051]
[0052] in, is the modal function (i.e. the above IMF component) uk The initial frequency domain representation of (t), for u k Fourier transform result of (t).
[0053] Construct the Lagrangian function:
[0054]
[0055] Among them, α is the penalty parameter, represents the Lagrangian function, w is the center frequency initially set for the IMF component, and w k is the center frequency of the IMF component corresponding to each iteration update, λ k (t) represents the Lagrange multiplier, μ is an auxiliary variable used for convergence judgment, ∑ i u i (t) represents the sum of the IMF components updated in each iteration, and the other symbols have been explained in the above formula.
[0056] Use the alternating direction multiplier method to perform the following iterative updates until the convergence condition is met, stop the iteration, and obtain multiple different IMF components: take the initial frequency domain representation as an input parameter, update the center frequency of the IMF component based on the initial frequency domain representation, update the IMF component frequency domain representation based on the updated center frequency, Lagrange multipliers, and the signal difference between the historical workload data and the frequency domain representation of all modal functions (that is, the above-mentioned IMF components), update the Lagrange multipliers based on the signal difference between the historical workload data and the frequency domain representation of all modal functions (that is, the above-mentioned IMF components), and update the Lagrange multipliers in the Lagrangian function.
[0057] The above convergence condition is that the change amount of the IMF component during the continuous iteration process is less than a first preset convergence threshold (for example, the first preset convergence threshold may be 0.01).
[0058] For example, the above-mentioned updating of the center frequency of the IMF component based on the initial frequency domain representation can be implemented by the following formula: in each iteration, the center frequency of each IMF component is optimized by optimizing the frequency domain characteristics:
[0059]
[0060] in, represents the center frequency of the updated IMF component, and w is the center frequency initially set for the IMF component; is the modal function (i.e. the above IMF component) u k (t) is the frequency domain representation, and n is the number of iterations.
[0061] For example, the above-mentioned updating of the IMF component frequency domain representation based on the updated center frequency, Lagrange multiplier, the signal difference of the historical workload data and the sum of the frequency domain representations of all modal functions (i.e., the above-mentioned IMF components) can be implemented by the following formula:
[0062]
[0063] in, is the frequency domain representation of the updated IMF component, is the frequency domain representation of the input signal (i.e. the above historical workload data) (the calculation method is the same as the calculation method of the frequency domain representation of the modal function, which will not be repeated here), is the sum of the frequency domain representations of all modal functions (i.e., the above-mentioned IMF components); represents the Lagrange multiplier of the kth mode (i.e., the above-mentioned IMF component); α represents the penalty parameter; represents the updated center frequency of the kth mode (i.e. the above IMF component), The signal representing the difference between the historical workload data and the sum of the frequency domain representations of all modal functions (i.e., the IMF components mentioned above).
[0064] Updating the Lagrange multiplier based on the signal difference between the historical workload data and the sum of the frequency domain representations of all modal functions (i.e., the above-mentioned IMF components) can be achieved by the following formula:
[0065]
[0066] in, is the updated Lagrange multiplier, Lagrange multiplier after the last iteration, μ is an auxiliary variable (for example, it can be set to a constant) used for convergence judgment, Represents the signal difference between the historical workload data after the last iteration and the sum of the frequency domain representations of all modal functions (i.e., the IMF components mentioned above).
[0067] The above convergence condition can be expressed by the following formula:
[0068]
[0069] in, is the change of the modal function (ie, the above-mentioned IMF component) during the two iterations, ∈ is the first preset threshold, for example, it can be 0,01.
[0070] Step S206: Use the first prediction model to perform resource prediction on multiple IMF components respectively to obtain multiple sub-prediction results, wherein the sub-prediction results are used to indicate the amount of resources required for the workload type corresponding to the IMF component.
[0071] In the technical solution provided in step S206, before using the first prediction model to perform resource prediction for multiple components, the first prediction model needs to be trained. There are many ways to train the first prediction model, for example: obtaining standardized historical time series data, and dividing the standardized historical time series data into a training set and a validation set according to a preset ratio (for example, 80%:20%); optimizing the second prediction model (for example, the second prediction model is a GRU model) using the training set and the validation set based on the ant lion optimization algorithm to obtain the first prediction model (the GRU model optimized by the ant lion optimization algorithm).
[0072] It should be noted that there are multiple forms of optimizing the second prediction model (for example, the second prediction model is a GRU model) using the training set and the validation set based on the antlion optimization algorithm. The following is an optional implementation method: initialize the following parameters of the antlion optimization algorithm: the number of antlions, the number of iterations, the pheromone volatility coefficient, the heuristic factor, and the pheromone importance factor; determine the hyperparameter list that needs to be optimized for the second prediction model, randomly generate antlion individuals in the training set based on the antlion optimization algorithm, and each antlion individual represents a hyperparameter combination in the hyperparameter list; initialize the pheromone matrix, where the pheromone matrix is used to store each The hyperparameter combination and performance index corresponding to each antlion individual are assigned the same pheromone value during initialization; the following steps are iteratively performed until the pheromone matrix converges, and the convergence condition is that the change of the pheromone matrix between two consecutive iterations is less than the second convergence threshold: the hyperparameter combination represented by each antlion individual in the pheromone matrix is used to train the second prediction model, and the second prediction model is evaluated using the validation set to obtain a first evaluation result, and the pheromone matrix is updated based on the first evaluation result; the hyperparameter combination represented by each antlion individual in the converged pheromone matrix is used to train the second prediction model to obtain the first prediction model.
[0073] The following is a specific embodiment:
[0074] Initialize the following parameters of the antlion optimization algorithm: the number of antlions (e.g., set to 50), the number of iterations (e.g., set to 100), the pheromone volatility coefficient, the heuristic factor, and the pheromone importance factor;
[0075] Determine the list of hyperparameters that need to be optimized for the second prediction model (such as learning rate, number of hidden layer units, batch size, etc.);
[0076] Using the data in the training set, antlion individuals are randomly generated based on the antlion optimization algorithm, and the pheromone matrix is initialized. The pheromone matrix is used to store the hyperparameter combination and performance indicators corresponding to each antlion individual. The same pheromone value is assigned to each hyperparameter combination during initialization. The following steps are iteratively performed until the pheromone matrix converges. The convergence condition is that the change of the pheromone matrix between two consecutive iterations is less than a second convergence threshold (for example, set to 0.02): using the hyperparameter combination represented by each antlion individual in the pheromone matrix, train the second prediction model, and use the validation set to evaluate the second prediction model to obtain a first evaluation result, and update the pheromone matrix based on the first evaluation result; using the hyperparameter combination represented by each antlion individual in the converged pheromone matrix to train the second prediction model to obtain the first prediction model.
[0077] The second prediction model is trained using the hyperparameter combination represented by each ant lion individual in the pheromone matrix, and the second prediction model is evaluated using the validation set to obtain the first evaluation result. The pheromone matrix is updated based on the first evaluation result, and the second prediction model is trained using the hyperparameter combination represented by each ant lion individual in the converged pheromone matrix. There are many ways to obtain the first prediction model, such as:
[0078] Configure a GRU model instance for each ant lion individual;
[0079] Repeat the following process until the change in the pheromone matrix (the change in the hyperparameter combination of the antlion individuals) between two consecutive iterations is less than the second convergence threshold:
[0080] The GRU model of each configuration is trained using the hyperparameter combination of each antlion individual, and its performance is evaluated on the validation set. The fitness of each antlion individual (i.e., the first evaluation result mentioned above) is calculated, and then the ALO algorithm is executed: the ant position is updated to simulate the movement of ants in the search space; the antlion position is updated to simulate the antlion preying on the closest ant; local search is applied to fine-tune the antlion position to find a better solution; based on the results of the ALO algorithm, the hyperparameter combination of each antlion individual is updated (i.e., the pheromone matrix is updated as mentioned above).
[0081] The individual with the highest fitness is selected in all iterations, and its corresponding hyperparameter combination is considered to be the optimal solution. The GRU model (i.e., the second prediction model mentioned above) is retrained on the training set using the selected optimal hyperparameter combination to obtain the trained GRU model (i.e., the first prediction model mentioned above).
[0082] In the technical solution provided in step S206, there are multiple ways to use the first prediction model to perform resource prediction on multiple components respectively, and obtain multiple sub-prediction results, for example: use the first prediction model to predict the amount of resources required by multiple IMF components in the same time step to obtain multiple sub-prediction results; or: use the first prediction model to predict the amount of resources required by multiple IMF components in multiple different time steps to obtain multiple different sub-prediction results corresponding to each IMF component in multiple different time steps. The above multiple sub-prediction results can also be selected to be added to obtain the final total prediction result, which is used to predict the amount of resources required by the entire Internet of Things system.
[0083] The following is a specific embodiment:
[0084] The first prediction model is used to predict the amount of resources required by multiple IMF components in the same time step, and the obtained multiple sub-prediction results can be called single-step prediction. For example, the same time step can be selected as 3 steps, and each time step is set to 10s. Then, when the time step is 3 steps, the first prediction model is used to predict the amount of resources required by different workload types corresponding to the multiple IMF components in the next 30s (that is, the above-mentioned multiple sub-prediction results);
[0085] The first prediction model is used to predict the amount of resources required by multiple IMF components in multiple different time steps, and the multiple different sub-prediction results corresponding to each IMF component in multiple different time steps can be multi-step predictions. For example, multiple different time steps can be selected as 3, 6, and 9 steps, and each time step is set to 10s. Then, the first prediction model is used to predict the amount of resources required by multiple IMF components in multiple different time steps, and the amount of resources required for different workload types corresponding to multiple IMF components in the next 30s, 60s, and 90s is obtained (that is, the multiple different sub-prediction results corresponding to each IMF component in multiple different time steps). By setting the step size, future short-term workload prediction can be achieved.
[0086] In the technical solution provided in step S206, the resource amounts corresponding to the multiple sub-prediction results are used to jointly determine the resource allocation strategy and resource supply strategy for different workload types in the Internet of Things system, including at least one of the following: elastic expansion and reserved resource strategy, wherein the elastic expansion strategy is used to adjust resource configuration, detect the health status of each server, and ensure cross-regional load balancing. Specifically: historical data and prediction models, arrange resource expansion and reduction in advance. For example, automatic expansion or reduction is performed during a specific time period of each day, and resource configuration is dynamically adjusted according to real-time monitoring data. For example, when the CPU utilization rate exceeds 80%, instances are automatically added; the health status of each server or instance is regularly checked: if some instances are found to be faulty or performance degraded, they are removed from the load balancing pool, and requests are reallocated to healthy instances, and traffic is distributed between resource pools in multiple geographical locations to ensure cross-regional load balancing and improve system reliability and response speed; the reserved resource strategy is used to regularly adjust the reserved resources. Specifically: Based on long-term forecasts and historical data of the IoT system, a certain number of instances are reserved to cope with possible future load peaks, which usually have certain cost benefits. The number and configuration of reserved resources are adjusted according to the forecast data and business needs to ensure a rapid response in emergency situations.
[0087] The above resource supply strategy can be obtained in the following ways: based on multiple sub-prediction results, the cloud service provider performs resource demand analysis: analyzing the demand for computing resources, storage and network bandwidth, as well as the demand in different time periods and geographical locations. Subsequently, the cloud service provider formulates a resource supply strategy, including elastic expansion, load balancing and reserved resource strategies, to ensure dynamic adjustment of resource allocation during peak and trough periods; after implementing these strategies, the cloud service provider monitors the workload and resource usage in real time, makes necessary adjustments, ensures load balancing and maximizes resource utilization, and continuously optimizes the prediction algorithm and resource supply strategy through a feedback mechanism, and performs load balancing with the cloud data center to improve prediction accuracy and resource allocation efficiency.
[0088] After completing the above steps S202-S206, the method also includes: evaluating multiple sub-prediction results in the following manner: obtaining a test data set; using the test data set to test the multiple sub-prediction results respectively, to obtain prediction result indicators of the sub-prediction results corresponding to each workload type, and using multiple preset evaluation indicators to evaluate the multiple sub-prediction results respectively, to obtain multiple evaluation result indicators for each sub-prediction result, wherein the multiple preset evaluation indicators are used to evaluate the multiple sub-prediction results, and the calculation methods of the multiple preset evaluation indicators are different; sorting the multiple evaluation result indicators and prediction result indicators corresponding to each workload type, and when the prediction result indicator is in the first preset position (for example, the top 2) in the sorting result, it is determined that the sub-prediction result corresponding to the workload type is accurate.
[0089] The following is a specific embodiment:
[0090] First, the test set obtained by the IoT system is used to test multiple sub-prediction results respectively to obtain the prediction result indicators of the sub-prediction results corresponding to each workload type. Then, multiple evaluation indicators are selected, such as Mean Squared Error (MSE), Root Mean Square Error (RMSE), and Mean Absolute Percentage Error (MAPE) as three different evaluation indicators. The calculation methods of the three evaluation indicators are as follows:
[0091]
[0092] Among them, MSE represents mean square error, RMSE represents root mean square error, MAPE represents mean absolute error percentage, n represents the number of samples, and y i represents the true value of the sample, Represents the predicted value.
[0093] The above three different evaluation indicators and prediction result indicators are sorted according to the workload type. When the prediction result ranks in the top two, it is determined that the sub-prediction result corresponding to the workload type is accurate.
[0094] In addition, in order to further verify the accuracy of the VMD-ALO-GRU prediction model used in this method (i.e., the first prediction model), the first set of data sets is the usage data of the first cloud cluster, which includes the CPU and memory resource usage of four thousand computers for eight days; the second set of data sets is the usage data of the second cluster, which records the CPU utilization of more than two million virtual machines every five minutes within 30 days, and uses the two workload types of CPU utilization and memory utilization as the main performance indicators of the workload. Specifically: a computer is randomly selected from the first set of data sets and the second set of data sets respectively, where the sampling interval of the first set of data sets is 10 seconds, and the sampling points of one day are selected, with a total of 8640 data; the centralized sampling interval of the second set of data sets is 5 minutes, and the sampling data of 29 days are selected, with a total of 8352 data. The three evaluation indicators are compared with multiple models other than the VMD-ALO-GRU prediction model of this solution. First, the traditional classic models: AutoRegressive Integrated Moving Average (ARIMA), Support Vector Regression (SVR), Backpropagation Neural Network (BPNN) and GRU are used to experiment with the original data. Then, the combined prediction models VMD-GRU and VMD-ALO-Long Short-Term Memory (LSTM) are used for experiments. VMD-GRU directly uses the GRU algorithm to predict the components after VMD decomposition. The second combined model replaces the GRU algorithm with the LSTM algorithm and still uses the ALO algorithm for parameter tuning. Tables 1 and 2 respectively show the comparison results of the two workload types, the CPU utilization of the first cloud cluster (high randomness) and the memory utilization of the first cloud cluster (high randomness). The prediction results are measured by RMSE, MAPE and R2 (i.e., the above-mentioned MSE).
[0095] Table 1
[0096]
[0097] Table 2
[0098]
[0099] As can be seen from Tables 1 and 2, the accuracy of the VMD-ALO-GRU prediction model (i.e., the first prediction model) used in this method is the best in terms of the three evaluation indicators. More specifically, in the highly random CPU and memory utilization data set in the first cloud cluster, the prediction accuracy of the four methods of ARIMA, SVR, BPNN and GRU is not much different in terms of RMSE and R2 evaluation indicators. The MAPE evaluation index of the ARIMA method is significantly greater than that of the other three methods, which indirectly reflects that the traditional ARIMA linear model is difficult to accurately predict nonlinear and non-stationary time series. In the various combined models with the VMD decomposition algorithm, the three evaluation indicators are significantly better than the above single models. In the CPU utilization prediction results of the first cloud cluster, the VMD-GRU model is 47.23% lower than the GRU model in RMSE indicators, 44.55% lower than the GRU model in MAPE indicators, and 14.73% higher than the GRU model in R2 indicators. Observing and comparing the last three combined models, there is little difference in the evaluation indicators, but the model with the ALO parameter optimization algorithm is still better than the model without the optimization algorithm.
[0100] For Table 2, in the memory utilization prediction results of the first cloud cluster, the VAG model is 4.76% lower than the VMD-GRU model in the RMSE indicator, 3.02% lower in the MAPE indicator, and 0.26% higher in the R2 indicator. Therefore, in the case of highly random workloads, the model of this method can also have good prediction accuracy. This is because the VAG model can not only solve the problem of not being able to fully mine the information of a single-dimensional sequence, but also solve the problem of gradient disappearance and capture long-term memory dependencies from historical workloads. The results show that under cloud workloads with less data information content and high variability, the model of this method is more effective for workload prediction than other traditional classic models and other similar combination models.
[0101] Through the above steps, the method implemented in the present application significantly reduces the prediction error, thereby achieving more effective and accurate resource usage prediction. In addition, these improved prediction methods can also provide useful reference and reference for resource demand prediction in other similar fields, and can effectively solve the problem of dynamic changes in resource demand in the long-term operation of the Internet of Things system, improve resource utilization, provide more stable and efficient support for Internet of Things applications, and can be applied to various Internet of Things scenarios, including but not limited to smart homes, smart transportation, smart factories, etc.
[0102] The embodiment of the present application also provides a VMD-ALO-GRU model flow chart of a resource allocation method, such as Figure 3As shown, the historical workload data of the IoT system is first obtained, and the workload processor uses the VMD algorithm to preprocess the historical workload data and divide the historical workload data into multiple different IMF components (division method and Figure 2 The division method of the IMF components in the embodiment is the same and will not be repeated here);
[0103] The prediction processor then uses the ALO-GRU model (i.e., the first prediction model) to predict different types of workloads corresponding to different IMF components, and obtains multiple sub-prediction results (and Figure 2 The prediction method in the embodiment is the same and will not be repeated here): use the first prediction model to predict the amount of resources required by multiple IMF components in the same time step to obtain multiple sub-prediction results; or: use the first prediction model to predict the amount of resources required by multiple IMF components in multiple different time steps to obtain multiple different sub-prediction results corresponding to each IMF component in multiple different time steps; when predicting, single-step or multi-step prediction can be selected;
[0104] Finally, the prediction results are sent to the cloud service provider to formulate resource provisioning strategies (and Figure 2 The resource supply strategy formulation method in the embodiment is the same and will not be repeated here) and the cloud data center performs load balancing to achieve reasonable allocation of resources.
[0105] The embodiment of the present application also provides a resource utilization diagram of a resource allocation method, such as Figure 4 Show, Figure 4 for Figure 2 In the embodiment, the workload of a machine in the first cloud cluster fluctuates and the workload of a machine in the second cluster fluctuates. As shown in the figure, the workload data (CPU utilization and memory utilization) of the first cloud cluster are highly random and unstable, while the workload data (CPU utilization) of the second cluster is highly periodic, wherein, from top to bottom, they are respectively the CPU utilization change data of the first cloud cluster, the memory utilization change data of the first cloud cluster, and the CPU utilization change data of the second cluster.
[0106] The embodiment of the present application also provides a comparison chart of the actual value and predicted value of resource utilization of a resource allocation method, such as Figure 5 As shown, Figure 5 Specific display Figure 4The comparison chart of the true value and predicted value of the three data sets shows that the true value and the predicted value are highly overlapped, and the method of the present application can accurately predict the future trend of high random and high periodic workloads. Therefore, the above results show that the method of the present application has strong applicability and high efficiency.
[0107] The embodiment of the present application also provides a CPU utilization multi-step prediction result evaluation index comparison diagram of a resource allocation method, such as Figure 6 Show, Figure 6 for Figure 2 The CPU utilization of the first cloud cluster in the embodiment is based on the comparison results of the multi-step prediction result evaluation indicators obtained after the multi-step prediction results are obtained by multi-step prediction, and compared with several classic prediction methods such as SVR, BPNN, GRU, and VAG. The number of steps of the multi-step prediction is set to 3, 6, and 9 steps, and each time step represents 10 seconds. It can be seen that with the increase of the number of steps, the two indicators of RMSE and MAPE will increase, and the R2 (i.e., MSE) indicator will also decrease. However, compared with the change range of SVR, BPNN and GRU, the fluctuation of various indicators of the VAG prediction method with the increase of the number of steps is not very large, especially the VAG method from a single step R2 = 0.95 to a step number of 9 R2 = 0.87, only a decrease of 0.08. (a) The multi-step prediction result representing RMSE shows the RMSE value of each model on the test data. It can be seen that the RMSE value of the VAG method within 9 steps is kept below 0.03, while the RMSE values of the other three methods have exceeded 0.03 in single-step prediction. Similarly, (b) represents the multi-step prediction result of MAPE. (b) also shows the same trend as (a). The MAPE of the VAG method is always kept below 4, while the MAPE value of the SVR method exceeds 10 at the 9th step. (c) represents the multi-step prediction result of R2, showing the R2 value of each model on the test data. The closer the R2 evaluation index is to 1, the better the prediction effect. The R2 values of the other three prediction methods in the figure are also decreasing rapidly with the increase of the number of steps, and some are even lower than 0.2, which shows that the other methods are not ideal in multi-step prediction; and the R2 value of the method of the present application is also satisfactory in multi-step prediction. The results show that when considering multi-step prediction, the method of the present application can also accurately and efficiently obtain prediction results.
[0108] The embodiment of the present application also provides a structural diagram of a resource allocation device, such as Figure 7 As shown, it includes: an acquisition module 70, a division module 72, and a prediction module 74.
[0109] An acquisition module 70, used to acquire historical workload data of the Internet of Things system;
[0110] The partitioning module 72 is used to partition the historical workload data into a plurality of different intrinsic mode function IMF components, wherein different IMF components correspond to different workload types: using a variational mode decomposition (VMD) algorithm to partition the historical workload data into a plurality of different initial IMF components, and setting a center frequency for each initial IMF component, wherein the center frequency is set based on the frequency domain of the historical workload data; constructing a Lagrangian function with Lagrangian multiplier constraints, initializing the Lagrangian multipliers, and setting a first convergence threshold; using an alternating direction multiplier method to iteratively update the initial IMF component based on the initial IMF component and the Lagrangian function with Lagrangian multiplier constraints, the iteration ends when the change in the IMF component during two iterations is less than the first convergence threshold, and a plurality of different IMF components are obtained.
[0111] The partitioning module 72 is also used to train the first prediction model before using the first prediction model to perform resource prediction on multiple components in the following manner: obtain standardized historical time series data, and divide the standardized historical time series data into a training set and a validation set according to a preset ratio; optimize the second prediction model using the training set and the validation set based on the ant lion optimization algorithm to obtain the first prediction model: optimize the second prediction model using the training set and the validation set based on the ant lion optimization algorithm to obtain the first prediction model, including: initialize the following parameters of the ant lion optimization algorithm: the number of ant lions, the number of iterations, the pheromone volatility coefficient, the heuristic factor, and the pheromone importance factor; determine the list of hyperparameters that need to be optimized for the second prediction model, and randomly generate them based on the ant lion optimization algorithm in the training set. Antlion individuals, each antlion individual represents a hyperparameter combination in a hyperparameter list; initialize a pheromone matrix, wherein the pheromone matrix is used to store the hyperparameter combination and performance indicators corresponding to each antlion individual, and the same pheromone value is assigned to each hyperparameter combination during initialization; iteratively perform the following steps until the pheromone matrix completes convergence, and the convergence condition is that the change of the pheromone matrix between two consecutive iterations is less than a second convergence threshold: use the hyperparameter combination represented by each antlion individual in the pheromone matrix to train a second prediction model, and use the validation set to evaluate the second prediction model to obtain a first evaluation result, and update the pheromone matrix based on the first evaluation result; use the hyperparameter combination represented by each antlion individual in the converged pheromone matrix to train the second prediction model to obtain a first prediction model.
[0112] The prediction module 74 is used to use the first prediction model to perform resource prediction on multiple IMF components respectively, and obtain multiple sub-prediction results, wherein the sub-prediction results are used to indicate the amount of resources required for the workload type corresponding to the IMF component; the resource amounts corresponding to the multiple sub-prediction results are used to jointly determine the resource allocation strategy for different workload types in the Internet of Things system, and the resource supply strategy includes at least one of the following: elastic expansion and reserved resource strategy, wherein the elastic expansion strategy is used to adjust resource configuration, and the reserved resource strategy is used to regularly adjust reserved resources.
[0113] The prediction module 74 is also used to use the first prediction model to predict the amount of resources required by multiple IMF components in the same time step to obtain multiple sub-prediction results; or: use the first prediction model to predict the amount of resources required by multiple IMF components in multiple different time steps to obtain multiple different sub-prediction results corresponding to each IMF component in multiple different time steps.
[0114] It should be noted that the various modules in the above-mentioned resource allocation method can be program modules (for example, a set of program instructions that implement a certain specific function) or hardware modules. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above-mentioned modules is a processor, or the functions of each of the above-mentioned modules are implemented by a processor.
[0115] The embodiment of the present application also provides a non-volatile storage medium, the non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the above resource allocation method. For example, historical workload data of the Internet of Things system is obtained; the historical workload data is divided into multiple different intrinsic mode function IMF components, wherein different IMF components correspond to different workload types; a first prediction model is used to perform resource prediction on multiple IMF components respectively, and multiple sub-prediction results are obtained, wherein the sub-prediction results are used to indicate the amount of resources required for the workload type corresponding to the IMF component; the amount of resources corresponding to the multiple sub-prediction results are used to jointly determine the resource allocation strategy for different workload types in the Internet of Things system.
[0116] The embodiment of the present application also provides an electronic device, the electronic device includes a processor, the processor is used to run a program, wherein the above resource allocation method is executed when the program is running. For example, historical workload data of the Internet of Things system is obtained; the historical workload data is divided into multiple different intrinsic mode function IMF components, wherein different IMF components correspond to different workload types; a first prediction model is used to perform resource prediction on multiple IMF components respectively, and multiple sub-prediction results are obtained, wherein the sub-prediction results are used to indicate the amount of resources required for the workload type corresponding to the IMF component; the amount of resources corresponding to the multiple sub-prediction results are used to jointly determine the resource allocation strategy for different workload types in the Internet of Things system.
[0117] According to another aspect of the embodiment of the present application, a computer program product is also provided, including a computer program, which implements the above resource allocation method when executed by a processor. For example, historical workload data of the Internet of Things system is obtained; the historical workload data is divided into multiple different intrinsic mode function IMF components, wherein different IMF components correspond to different workload types; a first prediction model is used to perform resource prediction on multiple IMF components respectively, and multiple sub-prediction results are obtained, wherein the sub-prediction results are used to indicate the amount of resources required for the workload type corresponding to the IMF component; the amount of resources corresponding to the multiple sub-prediction results are used to jointly determine the resource allocation strategy for different workload types in the Internet of Things system.
[0118] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0119] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0120] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0121] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0122] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.
[0123] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A resource allocation method, characterized in that: include: Obtain historical workload data for IoT systems; Dividing the historical workload data into a plurality of different intrinsic mode function (IMF) components, wherein the different IMF components correspond to different workload types; Use the first prediction model to perform resource prediction on the multiple IMF components respectively to obtain multiple sub-prediction results, wherein the sub-prediction results are used to indicate the amount of resources required for the workload type corresponding to the IMF component; the resource amounts corresponding to the multiple sub-prediction results are used to jointly determine the resource allocation strategies for the different workload types in the Internet of Things system.
2. The method according to claim 1, characterized in that The historical workload data is divided into a plurality of different IMF components, including: Using a variational mode decomposition (VMD) algorithm to divide the historical workload data into a plurality of different initial IMF components, and setting a center frequency for each of the initial IMF components, wherein the center frequency is set based on a frequency domain of the historical workload data; Constructing a Lagrangian function with Lagrangian multiplier constraints, initializing the Lagrangian multipliers, and setting the first convergence threshold; The initial IMF component is iteratively updated based on the center frequency of the initial IMF component and the Lagrangian function with Lagrangian multiplier constraint using an alternating direction multiplier method, and the iteration ends when the change of the IMF component during two iterations is less than the first convergence threshold, thereby obtaining the multiple different IMF components.
3. The method according to claim 1, characterized in that Before using the first prediction model to perform resource prediction on the plurality of components, the first prediction model is trained in the following manner: Obtaining standardized historical time series data, and dividing the standardized historical time series data into a training set and a validation set according to a preset ratio; The second prediction model is optimized using the training set and the validation set based on the ant lion optimization algorithm to obtain the first prediction model.
4. The method according to claim 3, characterized in that Optimizing the second prediction model using the training set and the validation set based on the ant lion optimization algorithm to obtain the first prediction model includes: Initializing the following parameters of the antlion optimization algorithm: number of antlions, number of iterations, pheromone volatility coefficient, heuristic factor, and pheromone importance factor; Determine a hyperparameter list that needs to be optimized for the second prediction model, randomly generate antlion individuals in the training set based on the antlion optimization algorithm, each of the antlion individuals represents a hyperparameter combination in the hyperparameter list; Initializing a pheromone matrix, wherein the pheromone matrix is used to store the hyperparameter combination and performance index corresponding to each antlion individual, and assigning the same pheromone value to each hyperparameter combination during initialization; Iteratively perform the following steps until the pheromone matrix completes convergence, and the convergence condition is that the change of the pheromone matrix between two consecutive iterations is less than a second convergence threshold: use the hyperparameter combination represented by each ant lion individual in the pheromone matrix to train the second prediction model, and use the validation set to evaluate the second prediction model to obtain a first evaluation result, and update the pheromone matrix based on the first evaluation result; The second prediction model is trained using the hyperparameter combination represented by each ant lion individual in the converged pheromone matrix to obtain the first prediction model.
5. The method according to claim 1, characterized in that Using the first prediction model to perform resource prediction on the plurality of components respectively to obtain the plurality of sub-prediction results includes: Use the first prediction model to predict the amount of resources required by the multiple IMF components in the same time step to obtain the multiple sub-prediction results; or: The first prediction model is used to predict the amount of resources required by the multiple IMF components in the multiple different time steps, and a plurality of different sub-prediction results corresponding to each IMF component in the multiple different time steps are obtained.
6. The method according to claim 1, characterized in that The resource supply strategy includes at least one of the following: Elastic expansion and reserved resource strategies, wherein the elastic expansion strategy is used to adjust resource configuration, and the reserved resource strategy is used to regularly adjust reserved resources.
7. The method according to claim 1, characterized in that After obtaining the multiple sub-prediction results, the method further includes: evaluating the multiple sub-prediction results in the following manner: Get the test dataset; Using the test data set to test the multiple sub-prediction results respectively, to obtain prediction result indicators of the sub-prediction results corresponding to each workload type; Each of the plurality of sub-prediction results is evaluated using a plurality of preset evaluation indicators to obtain a plurality of evaluation result indicators for each of the sub-prediction results, wherein the plurality of preset evaluation indicators are used to evaluate the plurality of sub-prediction results, and the plurality of preset evaluation indicators are calculated in different ways; The multiple evaluation result indicators and the prediction result indicators corresponding to each workload type are sorted, and when the prediction result indicator is in the front preset position in the sorting result, it is determined that the sub-prediction result corresponding to the workload type is accurate.
8. A resource allocation device, characterized in that: include: An acquisition module, used to obtain historical workload data of the IoT system; A partitioning module, used for partitioning the historical workload data into a plurality of different intrinsic mode function IMF components, wherein the different IMF components correspond to different workload types; A prediction module is used to use a first prediction model to perform resource prediction on the multiple IMF components respectively to obtain multiple sub-prediction results, wherein the sub-prediction results are used to indicate the amount of resources required for the workload type corresponding to the IMF component; the resource amounts corresponding to the multiple sub-prediction results are used to jointly determine the resource allocation strategy for the different workload types in the Internet of Things system.
9. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the resource allocation method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the program executes the resource allocation method according to any one of claims 1 to 7 when running.
11. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the resource allocation method described in any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Optimization method and system of AI large model, terminal equipment and storage medium
CN119005363A
Data division and weather prediction method and device, equipment, medium and product
CN120335971A
Data partitioning and weather forecasting methods, devices, equipment, media and products
CN120335971B
