Resource usage amount prediction method, model creation method, device, equipment and medium
By building a resource usage prediction model using a generative adversarial network, we solved the problem of existing technologies being unable to achieve predictions at specified time points, achieved accurate predictions of network resource usage and the ability to respond to emergencies, and improved the robustness and accuracy of the predictions.
Patent Information
- Application Number
- CN202111306399.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-05
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2041-11-05
AI Technical Summary
Existing technologies cannot effectively predict network resource usage based on a specified time point, lack the ability to respond to emergencies, and result in poor robustness.
A generative adversarial network is used to construct a resource usage prediction model. By converting the time to be predicted into a label and combining it with historical resource usage for training, the prediction model is optimized by the mutual game between the generator and the discriminator to achieve resource usage prediction at a specified time point.
It achieves accurate prediction of network resource usage based on specified time points, has the ability to respond to emergencies, and improves the robustness and accuracy of predictions.
Smart Images

Figure CN114154302B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a network resource usage prediction method, a prediction model creation method, an apparatus, a device, and a medium. Background Art
[0002] Currently, with the rapid development of technologies like the internet and 5G, a growing number of applications and internet users are rapidly expanding. The network has reached unprecedented scale, placing higher demands on the control and management of network resource usage. For example, for cloud platforms, the growth and sudden changes in network traffic have a significant impact on their stability. Therefore, traffic monitoring and prediction are particularly important in large-scale traffic usage. By monitoring and predicting network resource usage, timely measures can be taken to expand or reduce resource allocation, thereby avoiding system crashes and maximizing network equipment utilization.
[0003] However, current predictions of network resource usage still fall short of user expectations. For example, traditional traffic monitoring typically uses various algorithms to collect and visualize traffic in real time. These algorithms then make predictions based on data sequence learning algorithms, such as seq2seq variants of recurrent neural networks (RNNs) and long short-term memory networks (LSTMs). These algorithms summarize the regularities of large amounts of data and output predictions. However, traditional prediction technologies often fail to achieve the desired prediction results based on a specific time point and lack the ability to predict network resource usage in response to emergencies, resulting in poor robustness. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a network resource usage prediction method, prediction model creation method, device, equipment, and medium that can achieve the purpose of predicting network resource usage based on a specified time point, thereby having the ability to make predictions in response to emergencies. The specific solution is as follows:
[0005] In a first aspect, the present application discloses a method for predicting network resource usage, comprising:
[0006] Converting the time to be predicted into a corresponding label to obtain a time label to be predicted, and obtaining the network resource usage corresponding to the historical time before the time to be predicted to obtain the previous resource usage;
[0007] Obtain a resource usage prediction model pre-built based on a generative adversarial network;
[0008] Inputting the previous resource usage and the to-be-predicted time tag into the resource usage prediction model;
[0009] The resource usage prediction data corresponding to the time to be predicted outputted by the resource usage prediction model based on the previous resource usage and the time tag to be predicted is obtained, so as to perform corresponding resource scheduling operations based on the resource usage prediction data.
[0010] Optionally, converting the time to be predicted into a corresponding label to obtain the time label to be predicted includes:
[0011] Obtain the time to be predicted through the preset time input interface;
[0012] The time to be predicted is encoded using a one-hot encoding algorithm to convert the time to be predicted into a corresponding label to obtain the time label to be predicted.
[0013] Optionally, before obtaining the resource usage prediction model pre-built based on the generative adversarial network, the method further includes:
[0014] Collect historical data including historical resource usage and corresponding historical time;
[0015] Encoding the historical data using a pre-created encoder to extract corresponding high-level feature information from the historical resource usage, and converting the historical time corresponding to the historical resource usage into a corresponding historical time label;
[0016] The prediction model constructed based on the generative adversarial network is trained using the high-level feature information of the historical resource usage and the corresponding historical time labels to obtain the resource usage prediction model.
[0017] Optionally, before training the prediction model based on the generative adversarial network, the method further includes:
[0018] A prediction model including a generator, a first discriminator and a second discriminator is constructed based on a generative adversarial network; wherein the first discriminator is used to determine the uniform distribution of resource usage data, and the second discriminator is used to determine the authenticity of the resource usage data.
[0019] Optionally, the using the high-level feature information of the historical resource usage and the corresponding historical time labels to train a prediction model built based on a generative adversarial network includes:
[0020] Superimposing the high-level feature information of the historical resource usage and the corresponding historical time tags, and transmitting the superimposed data to the input end of the generator, so as to output resource usage prediction data corresponding to the superimposed data through the output end of the generator;
[0021] transmitting the resource usage prediction data to an input end of the first discriminator, so as to use the first discriminator to determine whether the resource usage prediction data is evenly distributed, and feeding back the determination result of the first discriminator to the encoder through an output end of the first discriminator, so that the encoder can adjust its own parameters accordingly according to the determination result of the first discriminator;
[0022] The resource usage prediction data and the actual resource usage data are transmitted to the input end of the second discriminator, so that the second discriminator can be used to determine the authenticity of the resource usage data received at its own input end, and the judgment result of the second discriminator is fed back to the generator through the output end of the second discriminator, so that the generator can adjust its own parameters accordingly according to the judgment result of the second discriminator.
[0023] Optionally, the process of training a prediction model constructed based on a generative adversarial network by using the high-level feature information of the historical resource usage and the corresponding historical time labels further includes:
[0024] Determine whether the current generator reaches Nash equilibrium;
[0025] If Nash equilibrium is not reached, the data difference between the resource usage prediction data and the corresponding resource usage actual data is input into the generator, so that the generator updates its own parameters according to the data difference;
[0026] If a Nash equilibrium is reached, the training ends.
[0027] In a second aspect, the present application discloses a method for creating a network resource usage prediction model, comprising:
[0028] Collect historical data including historical resource usage and corresponding historical time;
[0029] Performing encoding processing on the historical data to extract corresponding high-level feature information from the historical resource usage, and converting the historical time corresponding to the historical resource usage into a corresponding historical time tag;
[0030] The high-level feature information of the historical resource usage and the corresponding historical time labels are used to train a prediction model constructed based on a generative adversarial network to obtain a trained resource usage prediction model.
[0031] In a third aspect, the present application discloses a network resource usage prediction device, comprising:
[0032] A time label generation module, used for converting the time to be predicted into a corresponding label to obtain the time label to be predicted;
[0033] a preceding resource usage acquisition module, configured to acquire network resource usage corresponding to a historical time preceding the time to be predicted, so as to obtain preceding resource usage;
[0034] A prediction model acquisition module is used to obtain a resource usage prediction model pre-built based on a generative adversarial network;
[0035] A resource usage prediction module is used to input the previous resource usage and the time label to be predicted into the resource usage prediction model, and obtain the resource usage prediction data corresponding to the time to be predicted output by the resource usage prediction model based on the previous resource usage and the time label to be predicted, so as to perform corresponding resource scheduling operations based on the resource usage prediction data.
[0036] In a fourth aspect, the present application discloses an electronic device, comprising:
[0037] Memory, used to store computer programs;
[0038] The processor is configured to execute the computer program to implement the aforementioned method.
[0039] In a fifth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, the computer program implements the aforementioned method after being executed by a processor.
[0040] In this application, the time to be predicted is converted into a corresponding label to obtain the label of the time to be predicted, and the network resource usage corresponding to the historical time before the time to be predicted is obtained to obtain the preceding resource usage; a resource usage prediction model pre-constructed based on a generative adversarial network is obtained; the preceding resource usage and the label of the time to be predicted are input into the resource usage prediction model; the resource usage prediction data corresponding to the time to be predicted output by the resource usage prediction model based on the preceding resource usage and the label of the time to be predicted is obtained, so as to perform corresponding resource scheduling operations based on the resource usage prediction data. It can be seen that this application constructs a resource usage prediction model based on a generative adversarial network, and when making a prediction, the label of the time to be predicted and the corresponding preceding resource usage are input into the above-mentioned resource usage prediction model to obtain the resource usage prediction data corresponding to the time to be predicted, thereby achieving the purpose of predicting the network resource usage according to a specified time point, thereby having the ability to make predictions in response to emergencies. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0042] Figure 1 This is a flow chart of a network resource usage prediction method disclosed in this application;
[0043] Figure 2 A flowchart of a method for creating a network resource usage prediction model disclosed in this application;
[0044] Figure 3 A flowchart of a specific method for creating a network resource usage prediction model disclosed in this application;
[0045] Figure 4 A flowchart of a method for creating a prediction model for network traffic resource usage disclosed in this application;
[0046] Figure 5 A network structure diagram of a prediction model for network traffic resource usage disclosed in this application;
[0047] Figure 6 This is a schematic diagram of the structure of a network resource usage prediction device disclosed in this application;
[0048] Figure 7 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0050] At present, when predicting the usage of network resources, there is still a certain gap between the prediction effect and the user's expectation. For example, traditional traffic monitoring usually uses various algorithms to collect and graph the traffic in real time, and then predicts based on the learning algorithm of the data sequence, such as seq2seq and other variants of recurrent neural networks, long short-term memory networks, etc., and outputs the prediction results through the regularity summary of a large amount of data. However, traditional prediction technology often cannot achieve the effect of predicting according to a specified time point, lacks the ability to predict network resource usage in response to emergencies, resulting in poor robustness. To this end, the present application provides a network resource usage prediction solution that can achieve the purpose of predicting network resource usage according to a specified time point, thereby having the ability to make predictions in response to emergencies.
[0051] See also Figure 1 As shown, the embodiment of the present application discloses a method for predicting network resource usage, including:
[0052] Step S11: converting the time to be predicted into a corresponding label to obtain the time label to be predicted, and obtaining the network resource usage corresponding to the historical time before the time to be predicted to obtain the previous resource usage.
[0053] In this embodiment, the conversion of the time to be predicted into the corresponding label to obtain the time label to be predicted may specifically include: obtaining the time to be predicted through a preset time input interface; encoding the time to be predicted using a one-hot encoding algorithm to convert the time to be predicted into the corresponding label to obtain the time label to be predicted. It is understandable that in this embodiment, a time input interface can be provided to the user in advance so that the background can obtain the user's input of the future time point or time period information that the user desires to predict according to his own needs through the above-mentioned time input interface, and then convert the obtained time to be predicted into the corresponding time label. In this embodiment, a one-hot encoding algorithm (One-Hot encoding) can be used to encode the above-mentioned time to be predicted, so that the encoding result can be used as the corresponding time label.
[0054] In this embodiment, before performing resource usage prediction, in addition to obtaining the time tag to be predicted, it is also necessary to obtain the historical network resource usage corresponding to the historical time preceding the time to be predicted, that is, to obtain the previous resource usage corresponding to the time to be predicted. Subsequent resource usage prediction is specifically performed based on the time tag to be predicted and the previous resource usage to obtain resource usage prediction data corresponding to the time to be predicted.
[0055] Step S12: Obtain a resource usage prediction model pre-built based on a generative adversarial network.
[0056] The prediction model in this embodiment is constructed based on GAN (Generative Adversarial Networks). The prediction model includes a generator for generating prediction data and a discriminator for discriminating the prediction data generated by the generator. The generator and the discriminator are repeatedly trained and optimized in the game between each other to obtain better prediction results.
[0057] Step S13: inputting the previous resource usage and the time tag to be predicted into the resource usage prediction model.
[0058] Step S14: Obtain resource usage prediction data corresponding to the time to be predicted output by the resource usage prediction model based on the previous resource usage and the time tag to be predicted, so as to perform corresponding resource scheduling operations based on the resource usage prediction data.
[0059] It is understandable that after the resource usage prediction model constructed based on the above-mentioned generative adversarial network is used to output resource usage prediction data, the present application can further use the above-mentioned resource usage prediction data to perform adaptive resource expansion or resource reduction and other resource scheduling operations. For example, if the resource usage prediction data indicates that the resource usage of a certain device in a certain time period in the future is relatively large, more network resources can be reserved for the device in the time period in advance. Conversely, if the resource usage prediction data indicates that the resource usage of a certain device in a certain time period in the future is relatively small, the network resources already allocated to the device in the time period can be transferred to other devices for use in advance.
[0060] It should be further pointed out that the duration of the above-mentioned predicted time in this embodiment can be flexibly adjusted based on actual application needs. Compared with the situation in which the existing technology can usually only obtain resource usage prediction data within a very short period of time, this embodiment can predict resource usage data for a longer time period, meeting the different needs of different users for prediction duration.
[0061] In an embodiment of the present application, the time to be predicted is converted into a corresponding label to obtain the label of the time to be predicted, and the network resource usage corresponding to the historical time before the time to be predicted is obtained to obtain the preceding resource usage; a resource usage prediction model pre-constructed based on a generative adversarial network is obtained; the preceding resource usage and the label of the time to be predicted are input into the resource usage prediction model; the resource usage prediction data corresponding to the time to be predicted output by the resource usage prediction model based on the preceding resource usage and the label of the time to be predicted is obtained, so as to perform corresponding resource scheduling operations based on the resource usage prediction data. It can be seen that the embodiment of the present application constructs a resource usage prediction model based on a generative adversarial network, and when making a prediction, the label of the time to be predicted and the corresponding preceding resource usage are input into the above-mentioned resource usage prediction model to obtain the resource usage prediction data corresponding to the time to be predicted, thereby achieving the purpose of predicting the network resource usage according to a specified time point, thereby having the ability to make predictions in response to emergencies.
[0062] See also Figure 2 As shown, the embodiment of the present application also discloses a method for creating a network resource usage prediction model, including:
[0063] Step S21: Collect historical data including historical resource usage and corresponding historical time.
[0064] In this embodiment, after obtaining the above-mentioned historical data containing historical resource usage and corresponding historical time, these historical data need to be sorted to organize the historical resource usage and the corresponding historical time into information pairs, that is, saved in the form of historical resource usage-historical time information records, so as to facilitate subsequent model training.
[0065] Step S22: using a pre-created encoder to encode the historical data, so as to extract corresponding high-level feature information from the historical resource usage, and convert the historical time corresponding to the historical resource usage into a corresponding historical time tag.
[0066] It should be noted that the encoder in this embodiment primarily performs two processing steps: one is to extract high-level feature information from resource usage, that is, to extract the hidden layer vector; the other is to convert time information into corresponding time tags using a one-hot encoding algorithm. Furthermore, the time in this embodiment can be specifically measured in seconds.
[0067] Step S23: Using the high-level feature information of the historical resource usage and the corresponding historical time labels, the prediction model constructed based on the generative adversarial network is trained to obtain the resource usage prediction model.
[0068] In this embodiment, before training the prediction model constructed based on the generative adversarial network, the method may further specifically include: constructing a prediction model based on the generative adversarial network, including a generator, a first discriminator, and a second discriminator; wherein the first discriminator is used to determine the uniform distribution of resource usage data, and the second discriminator is used to determine the authenticity of the resource usage data. That is, in the prediction model constructed based on the generative adversarial network in this embodiment, in addition to setting the generator, two discriminators are also set, one is a discriminator for determining the uniform distribution of resource usage data, and the other is a discriminator for determining the authenticity of resource usage data. By having these two discriminators compete with the generator at the same time, the prediction model finally generated can predict resource usage data that is more accurate, reliable, and closer to the real data, and based on the above-mentioned first discriminator, it can effectively prevent the occurrence of data gaps.
[0069] Furthermore, in this embodiment, the process of training the prediction model constructed based on the generative adversarial network using the high-level feature information of the historical resource usage and the corresponding historical time tags may also include: determining whether the current generator has reached Nash equilibrium; if Nash equilibrium has not been reached, inputting the data difference between the resource usage prediction data and the corresponding actual resource usage data into the generator so that the generator updates its own parameters based on the data difference; if Nash equilibrium is reached, terminating the training. That is, this embodiment uses whether Nash equilibrium has been reached as the termination condition for model training, and repeatedly optimizes and adjusts the parameters of the generator accordingly, so that the final generated prediction model can have higher prediction accuracy.
[0070] See also Figure 3 As shown, based on the above embodiments, the present embodiment discloses a more specific method for creating a resource usage prediction model, including:
[0071] Step S31: Collect historical data including historical resource usage and corresponding historical time.
[0072] Step S32: using a pre-created encoder to encode the historical data, so as to extract corresponding high-level feature information from the historical resource usage, and convert the historical time corresponding to the historical resource usage into a corresponding historical time tag.
[0073] For the above steps S31 and S32 , reference may be made to the corresponding contents in the aforementioned embodiment, which will not be described in detail here.
[0074] Step S33: Superimpose the high-level feature information of the historical resource usage and the corresponding historical time label, and transmit the superimposed data to the input end of the generator in the prediction model constructed based on the generative adversarial network, so as to output the resource usage prediction data corresponding to the superimposed data through the output end of the generator.
[0075] Step S34: Transmit the resource usage prediction data to the input end of the first discriminator in the prediction model, so as to use the first discriminator to determine the uniform distribution of the resource usage prediction data, and feed back the judgment result of the first discriminator to the encoder through the output end of the first discriminator, so that the encoder can adjust its own parameters accordingly according to the judgment result of the first discriminator.
[0076] Step S35: Transmit the resource usage prediction data and the actual resource usage data to the input end of the second discriminator in the prediction model, so that the second discriminator can be used to discriminate the authenticity of the resource usage data received at its own input end, and feed back the discrimination result of the second discriminator to the generator through the output end of the second discriminator, so that the generator can adjust its own parameters accordingly according to the discrimination result of the second discriminator.
[0077] It can be seen that in this embodiment, the first discriminator is used to discriminate the uniform distribution of the resource usage prediction data, and the discrimination result of the first discriminator is fed back to the encoder through the output end of the first discriminator, so that the encoder adjusts its own parameters accordingly according to the discrimination result of the first discriminator; and the second discriminator is used to discriminate the authenticity of the resource usage data received at its own input end, and the discrimination result of the second discriminator is fed back to the generator through the output end of the second discriminator, so that the generator adjusts its own parameters accordingly according to the discrimination result of the second discriminator. Through the above two types of feedback, the parameters inside the generator and encoder can be continuously optimized and adjusted, which is beneficial to improving the prediction accuracy and reliability of the entire prediction model.
[0078] See also Figure 4 and Figure 5 As shown, the embodiment of the present application further discloses a method for creating a prediction model for network traffic resource usage, including:
[0079] Step S41: Collect historical data including historical traffic resource usage and corresponding historical time.
[0080] Step S42: Encode the historical data using a pre-created encoder to extract corresponding high-level feature information from the historical traffic resource usage, and convert the historical time corresponding to the historical traffic resource usage into a corresponding historical time tag.
[0081] Step S43: Superimpose the high-level feature information of the historical traffic resource usage and the corresponding historical time label, and transmit the superimposed data to the input end of the generator in the prediction model constructed based on the generative adversarial network, so as to output the traffic resource usage prediction data corresponding to the superimposed data through the output end of the generator.
[0082] Step S44: Transmit the traffic resource usage prediction data to the input end of the first discriminator in the prediction model, so as to use the first discriminator to determine the uniform distribution of the traffic resource usage prediction data, and feed back the judgment result of the first discriminator to the encoder through the output end of the first discriminator, so that the encoder can adjust its own parameters accordingly according to the judgment result of the first discriminator.
[0083] In this embodiment, the purpose of the first discriminator is to use a priori uniform distribution to smooth the superimposed flow data so that the data does not have jumps and gaps. The first discriminator can better simulate the data distribution, so that the final predicted data is closer to the actual data.
[0084] Step S45: The traffic resource usage prediction data and the actual traffic resource usage data are transmitted to the input end of the second discriminator in the prediction model, so that the second discriminator can be used to discriminate the authenticity of the traffic resource usage data received at its own input end, and the discrimination result of the second discriminator is fed back to the generator through the output end of the second discriminator, so that the generator can adjust its own parameters accordingly according to the discrimination result of the second discriminator.
[0085] In this embodiment, the purpose of the second discriminator is to distinguish, as far as possible, whether the traffic data obtained at its input is real traffic data or fabricated data generated by the generator. The second discriminator can make the generated predicted traffic data closer to the real data, thereby improving the prediction accuracy.
[0086] Step S46: Determine whether the current generator has reached Nash equilibrium;
[0087] Step S47: If Nash equilibrium is not reached, the data difference between the traffic resource usage prediction data and the corresponding traffic resource usage real data is input into the generator so that the generator updates its own parameters according to the data difference; if Nash equilibrium is reached, the training is terminated.
[0088] In this embodiment, the goal of the first discriminator is to use a priori uniform distribution to smooth the superimposed traffic, eliminating gaps in the data. The goal of the second discriminator is to distinguish, as closely as possible, whether the traffic input to the second discriminator is real data or fake data generated by the generator. Therefore, two loss functions are involved in the training process in this embodiment.
[0089] In this embodiment, let the distribution of real data x be q(x), the prior distribution of the discriminator be p(x), the high-level feature vector be z, and z with time annotation be z * , the data generated by the generator G is x and The two are input to the second discriminator D2. There are three key points in the training process: (1) The first is that the encoder E needs to generate a distribution closer to q(x) to generate a better hidden vector; (2) The first discriminator D1 needs to be able to identify whether its input comes from E(x) (distribution close to q(x)) or a deceptive vector generated based on the regular uniform distribution p(x); (3) The third is to train the generator G so that it can generate a more deceptive G(z), which needs to generate prediction data.
[0090] In this embodiment, the objective function of the generative adversarial network can be specifically a maximum-minimum function, that is:
[0091]
[0092] In this embodiment, the second discriminator D2 generates the data And input the real data x to find the Euclidean distance between the two to minimize it, so as to force Close to x.
[0093] In addition, in terms of structure, the encoder E in this embodiment adopts a 4-layer convolutional neural network. The vector obtained is taken from a certain high layer and reshaped into a 1*1*4096 vector. The One-Hot encoding vector of the splicing time is generated. * ; The generator G performs deconvolution to output traffic data; the first discriminator D1 uses 4-layer full convolution processing to prevent data blank jumps; the second discriminator D2 uses pre-trained 6-layer convolution to output true or false judgments.
[0094] As can be seen above, this application improves the accuracy of network traffic resource prediction data by improving the traditional generative adversarial network and adding an additional discriminator. Through the technical solution of this embodiment, it is possible to simulate the current system traffic usage habits based on the actual traffic trends, thereby improving the prediction accuracy.
[0095] Accordingly, see Figure 6 As shown, the embodiment of the present application further discloses a network resource usage prediction device, comprising:
[0096] A time label generation module 11 is used to convert the time to be predicted into a corresponding label to obtain a time label to be predicted;
[0097] The preceding resource usage acquisition module 12 is configured to acquire the network resource usage corresponding to the historical time before the time to be predicted, so as to obtain the preceding resource usage;
[0098] The prediction model acquisition module 13 is used to obtain a resource usage prediction model pre-built based on a generative adversarial network;
[0099] The resource usage prediction module 14 is used to input the previous resource usage and the time label to be predicted into the resource usage prediction model, and obtain the resource usage prediction data corresponding to the time to be predicted output by the resource usage prediction model based on the previous resource usage and the time label to be predicted, so as to perform corresponding resource scheduling operations based on the resource usage prediction data.
[0100] For more specific workflow details of each of the above modules, please refer to the corresponding content disclosed in the aforementioned embodiments, which will not be repeated here.
[0101] It can be seen that the embodiment of the present application constructs a resource usage prediction model based on a generative adversarial network. When making a prediction, the time label to be predicted and the corresponding previous resource usage are input into the above-mentioned resource usage prediction model to obtain resource usage prediction data corresponding to the time to be predicted. This can achieve the purpose of predicting network resource usage according to a specified time point, thereby having the ability to make predictions in response to emergencies.
[0102] Furthermore, an embodiment of the present application also provides an electronic device. Figure 7 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram should not be considered as any limitation to the scope of application of the present application.
[0103] Figure 7This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a display screen 23, an input / output interface 24, a communication interface 25, a power supply 26, and a communication bus 27. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the network resource usage prediction method or network resource usage prediction model creation method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0104] In this embodiment, the power supply 26 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 25 can create a data transmission channel between the electronic device 20 and the external device. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 24 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0105] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, a magnetic disk, or an optical disk, etc. The resources stored thereon can include a computer program 221, which can be stored in a temporary or permanent manner. In addition to including a computer program capable of implementing the network resource usage prediction method or the network resource usage prediction model creation method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 221 can further include a computer program capable of implementing other specific tasks.
[0106] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned disclosed network resource usage prediction method or network resource usage prediction model creation method.
[0107] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.
[0108] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0109] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0110] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0111] The above is a detailed introduction to a network resource usage prediction method, prediction model creation method, device, equipment and medium provided by this application. Specific examples are used in this article to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method of this application and its core idea; at the same time, for general technical personnel in this field, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on this application.
Claims
1. A method for predicting network resource usage, characterized in that: include: Converting the time to be predicted into a corresponding label to obtain a time label to be predicted, and obtaining the network resource usage corresponding to the historical time before the time to be predicted to obtain the previous resource usage; Obtain a resource usage prediction model pre-built based on a generative adversarial network; Inputting the previous resource usage and the to-be-predicted time tag into the resource usage prediction model; Obtaining resource usage prediction data corresponding to the to-be-predicted time output by the resource usage prediction model based on the previous resource usage and the to-be-predicted time tag, so as to perform corresponding resource scheduling operations based on the resource usage prediction data; The steps of creating the resource usage prediction model include: Collect historical data including historical resource usage and corresponding historical time; Encoding the historical data using a pre-created encoder to extract corresponding high-level feature information from the historical resource usage, and converting the historical time corresponding to the historical resource usage into a corresponding historical time label; Constructing a prediction model including a generator, a first discriminator, and a second discriminator based on a generative adversarial network; Using the high-level feature information of the historical resource usage and the corresponding historical time labels, a prediction model constructed based on a generative adversarial network is trained to obtain the resource usage prediction model; The method of using the high-level feature information of the historical resource usage and the corresponding historical time labels to train a prediction model based on a generative adversarial network includes: Superimposing the high-level feature information of the historical resource usage and the corresponding historical time tags, and transmitting the superimposed data to the input end of the generator, so as to output resource usage prediction data corresponding to the superimposed data through the output end of the generator; transmitting the resource usage prediction data to an input end of the first discriminator, so as to use the first discriminator to determine whether the resource usage prediction data is evenly distributed, and feeding back the determination result of the first discriminator to the encoder through an output end of the first discriminator, so that the encoder can adjust its own parameters accordingly according to the determination result of the first discriminator; The resource usage prediction data and the actual resource usage data are transmitted to the input end of the second discriminator, so that the second discriminator can be used to determine the authenticity of the resource usage data received at its own input end, and the judgment result of the second discriminator is fed back to the generator through the output end of the second discriminator, so that the generator can adjust its own parameters accordingly according to the judgment result of the second discriminator.
2. The network resource usage prediction method according to claim 1, characterized in that: Converting the to-be-predicted time into a corresponding label to obtain the to-be-predicted time label includes: Obtain the time to be predicted through the preset time input interface; The time to be predicted is encoded using a one-hot encoding algorithm to convert the time to be predicted into a corresponding label to obtain the time label to be predicted.
3. The network resource usage prediction method according to claim 1, wherein: The process of training the prediction model constructed based on the generative adversarial network by using the high-level feature information of the historical resource usage and the corresponding historical time labels further includes: Determine whether the current generator reaches Nash equilibrium; If Nash equilibrium is not reached, the data difference between the resource usage prediction data and the corresponding resource usage actual data is input into the generator, so that the generator updates its own parameters according to the data difference; If a Nash equilibrium is reached, the training ends.
4. A method for creating a network resource usage prediction model, characterized in that: include: Collect historical data including historical resource usage and corresponding historical time; Encoding the historical data using a pre-created encoder to extract corresponding high-level feature information from the historical resource usage, and converting the historical time corresponding to the historical resource usage into a corresponding historical time label; Constructing a prediction model including a generator, a first discriminator, and a second discriminator based on a generative adversarial network; Using the high-level feature information of the historical resource usage and the corresponding historical time labels, a prediction model constructed based on a generative adversarial network is trained to obtain a trained resource usage prediction model; The method of using the high-level feature information of the historical resource usage and the corresponding historical time labels to train a prediction model based on a generative adversarial network includes: Superimposing the high-level feature information of the historical resource usage and the corresponding historical time tags, and transmitting the superimposed data to the input end of the generator, so as to output resource usage prediction data corresponding to the superimposed data through the output end of the generator; transmitting the resource usage prediction data to an input end of the first discriminator, so as to use the first discriminator to determine whether the resource usage prediction data is evenly distributed, and feeding back the determination result of the first discriminator to the encoder through an output end of the first discriminator, so that the encoder can adjust its own parameters accordingly according to the determination result of the first discriminator; The resource usage prediction data and the actual resource usage data are transmitted to the input end of the second discriminator, so that the second discriminator can be used to determine the authenticity of the resource usage data received at its own input end, and the judgment result of the second discriminator is fed back to the generator through the output end of the second discriminator, so that the generator can adjust its own parameters accordingly according to the judgment result of the second discriminator.
5. A network resource usage prediction device, characterized in that: include: A time label generation module, used for converting the time to be predicted into a corresponding label to obtain the time label to be predicted; a preceding resource usage acquisition module, configured to acquire network resource usage corresponding to a historical time preceding the time to be predicted, so as to obtain preceding resource usage; A prediction model acquisition module is used to obtain a resource usage prediction model pre-built based on a generative adversarial network; a resource usage prediction module, configured to input the preceding resource usage and the time tag to be predicted into the resource usage prediction model, and obtain resource usage prediction data corresponding to the time to be predicted output by the resource usage prediction model based on the preceding resource usage and the time tag to be predicted, so as to perform corresponding resource scheduling operations based on the resource usage prediction data; The steps of creating the resource usage prediction model include: Collect historical data including historical resource usage and corresponding historical time; Encoding the historical data using a pre-created encoder to extract corresponding high-level feature information from the historical resource usage, and converting the historical time corresponding to the historical resource usage into a corresponding historical time label; Constructing a prediction model including a generator, a first discriminator, and a second discriminator based on a generative adversarial network; Using the high-level feature information of the historical resource usage and the corresponding historical time labels, a prediction model constructed based on a generative adversarial network is trained to obtain the resource usage prediction model; The method of using the high-level feature information of the historical resource usage and the corresponding historical time labels to train a prediction model based on a generative adversarial network includes: Superimposing the high-level feature information of the historical resource usage and the corresponding historical time tags, and transmitting the superimposed data to the input end of the generator, so as to output resource usage prediction data corresponding to the superimposed data through the output end of the generator; transmitting the resource usage prediction data to an input end of the first discriminator, so as to use the first discriminator to determine whether the resource usage prediction data is evenly distributed, and feeding back the determination result of the first discriminator to the encoder through an output end of the first discriminator, so that the encoder can adjust its own parameters accordingly according to the determination result of the first discriminator; The resource usage prediction data and the actual resource usage data are transmitted to the input end of the second discriminator, so that the second discriminator can be used to determine the authenticity of the resource usage data received at its own input end, and the judgment result of the second discriminator is fed back to the generator through the output end of the second discriminator, so that the generator can adjust its own parameters accordingly according to the judgment result of the second discriminator.
6. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that Used to store a computer program; wherein, after the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Flow prediction model training method and device, flow prediction method and device, equipment and medium
CN112118143A
Network traffic prediction method based on generative adversarial network
CN112801411A