CN116684330A - Traffic prediction method, device, equipment and storage medium based on artificial intelligence - Google Patents
Traffic prediction method, device, equipment and storage medium based on artificial intelligence Download PDFInfo
- Publication number
- CN116684330A CN116684330A CN202310769159.9A CN202310769159A CN116684330A CN 116684330 A CN116684330 A CN 116684330A CN 202310769159 A CN202310769159 A CN 202310769159A CN 116684330 A CN116684330 A CN 116684330A
- Authority
- CN
- China
- Prior art keywords
- prediction model
- target
- training set
- flow
- testing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 63
- 238000013473 artificial intelligence Methods 0.000 title claims abstract description 52
- 238000003860 storage Methods 0.000 title claims abstract description 25
- 238000012549 training Methods 0.000 claims abstract description 156
- 238000012360 testing method Methods 0.000 claims abstract description 132
- 241000544061 Cuculus canorus Species 0.000 claims abstract description 112
- 238000010845 search algorithm Methods 0.000 claims abstract description 57
- 238000012545 processing Methods 0.000 claims abstract description 46
- 238000005457 optimization Methods 0.000 claims abstract description 32
- 238000013528 artificial neural network Methods 0.000 claims abstract description 31
- 238000007781 pre-processing Methods 0.000 claims abstract description 16
- 238000010276 construction Methods 0.000 claims description 25
- 235000005770 birds nest Nutrition 0.000 claims description 19
- 235000005765 wild carrot Nutrition 0.000 claims description 19
- 230000006870 function Effects 0.000 claims description 12
- 238000004140 cleaning Methods 0.000 claims description 9
- 238000012216 screening Methods 0.000 claims description 6
- 238000005516 engineering process Methods 0.000 abstract description 21
- 230000008569 process Effects 0.000 description 15
- 238000010606 normalization Methods 0.000 description 7
- 238000004891 communication Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000009286 beneficial effect Effects 0.000 description 3
- 230000006872 improvement Effects 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 241000209094 Oryza Species 0.000 description 2
- 235000007164 Oryza sativa Nutrition 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 2
- 230000006835 compression Effects 0.000 description 2
- 238000007906 compression Methods 0.000 description 2
- 238000013135 deep learning Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000009826 distribution Methods 0.000 description 2
- 238000011156 evaluation Methods 0.000 description 2
- 238000012804 iterative process Methods 0.000 description 2
- 238000010801 machine learning Methods 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 238000003058 natural language processing Methods 0.000 description 2
- 230000001902 propagating effect Effects 0.000 description 2
- 235000009566 rice Nutrition 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 235000019800 disodium phosphate Nutrition 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003071 parasitic effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000002945 steepest descent method Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0876—Network utilisation, e.g. volume of load or congestion level
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/14—Network analysis or design
- H04L41/145—Network analysis or design involving simulating, designing, planning or modelling of a network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/16—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks using machine learning or artificial intelligence
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/16—Threshold monitoring
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/50—Testing arrangements
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T10/00—Road transport of goods or passengers
- Y02T10/10—Internal combustion engine [ICE] based vehicles
- Y02T10/40—Engine management systems
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Databases & Information Systems (AREA)
- Evolutionary Computation (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The embodiment of the application belongs to the field of artificial intelligence, and relates to a flow prediction method based on artificial intelligence, which comprises the following steps: acquiring network traffic; constructing a training set and a testing set based on network traffic; preprocessing a training set and a testing set to obtain a target training set and a target testing set; constructing an initial prediction model based on a BP neural network structure; performing weight threshold optimization on the initial prediction model based on a target cuckoo search algorithm to obtain a specified prediction model; training and testing the appointed prediction model by using the training set and the testing set to obtain a trained flow prediction model; and carrying out flow prediction processing on the network flow data based on the flow prediction model. The application also provides a flow prediction device based on artificial intelligence, a computer device and a storage medium. In addition, the application also relates to a blockchain technology, and a traffic prediction model can be stored in the blockchain. The flow prediction method and the flow prediction device can effectively improve the accuracy of flow prediction of the flow prediction model and the iteration efficiency of model training.
Description
Technical Field
The application relates to the technical field of artificial intelligence development and the technical field of finance, in particular to a flow prediction method, a flow prediction device, computer equipment and a storage medium based on artificial intelligence.
Background
With the rapid development of network communication and computer technology, various business systems, such as insurance systems, banking systems, etc., are also diversified in the form of online application services. These applications require stable network support, and place high demands on the quality of service, flow control, and network management of the network. Therefore, analytical predictions of network traffic are necessary. At present, many analysis and prediction models of network traffic exist, but many difficulties still exist: on the one hand, the network traffic is more complex in time and space; on the other hand, the network characteristics in each application scene have larger difference, and the problems can increase the complexity of constructing and training the network prediction model.
BP networks are currently the most widely used predictive model, emerging in dealing with the problem of nonlinear prediction. The service system is required to predict network traffic by using BP network. However, the conventional BP network relies on the back propagation of errors, continuous iteration is required, and the prediction accuracy of the prediction model is not high.
Disclosure of Invention
The embodiment of the application aims to provide a traffic prediction method, a traffic prediction device, computer equipment and a storage medium based on artificial intelligence, so as to solve the technical problems that the existing mode of predicting network traffic by using a BP network depends on the back propagation of errors, continuous iteration is required, and the prediction accuracy of a prediction model is not high.
In order to solve the above technical problems, the embodiment of the present application provides a flow prediction method based on artificial intelligence, which adopts the following technical scheme:
acquiring network traffic in a preset historical time period;
sample construction is carried out on the network traffic based on a preset time period dividing unit, and a corresponding training set and a corresponding testing set are obtained;
performing data preprocessing on the training set and the testing set to obtain a corresponding target training set and a corresponding target testing set;
determining a BP neural network structure, and constructing an initial prediction model based on the BP neural network structure;
performing weight threshold optimization on the initial prediction model based on a target cuckoo search algorithm to obtain an optimized specified prediction model; the target cuckoo searching algorithm is an optimized cuckoo searching algorithm obtained by improving the step length updating mode of the original cuckoo searching algorithm;
Training the appointed prediction model by using the training set, and testing the trained appointed prediction model by using the testing set to obtain a trained flow prediction model;
and carrying out flow prediction processing on the network flow data to be processed based on the flow prediction model.
Further, the step of constructing the sample for the network traffic based on the preset time period dividing unit to obtain the corresponding training set and testing set specifically includes:
acquiring a preset time period dividing unit;
dividing each day in the history time period into a corresponding plurality of unit time periods based on the time period dividing unit;
constructing a training set corresponding to the network traffic by taking the network traffic in the same unit time period as the same sample;
acquiring a preset time value;
randomly screening appointed data corresponding to the time value from the training set based on the time value;
and taking the specified data as the test set.
Further, the step of preprocessing the data of the training set and the test set to obtain a corresponding target training set and a corresponding target test set specifically includes:
Data cleaning is carried out on the training set and the testing set, and a first training set and a first testing set which correspond to each other are obtained;
normalizing the first training set and the first testing set to obtain a corresponding second training set and second testing set;
the second training set is taken as the target training set, and the second testing set is taken as the target testing set.
Further, before the step of optimizing the weight threshold of the initial prediction model based on the target cuckoo search algorithm to obtain the optimized specified prediction model, the method further includes:
acquiring an original cuckoo searching algorithm;
acquiring a step length updating mode in the initial cuckoo searching algorithm;
and improving a step length updating mode of the cuckoo searching algorithm based on a preset formula to obtain the optimized target cuckoo searching algorithm.
Further, the step of optimizing the weight threshold value of the initial prediction model based on the target cuckoo search algorithm to obtain an optimized specified prediction model specifically includes:
initializing parameters of the target cuckoo search algorithm;
randomly generating a plurality of bird nest positions, and encoding an initial weight threshold of the initial prediction model into initial bird nest positions of the target cuckoo search algorithm;
Determining a fitness function of the target cuckoo search algorithm, and calculating fitness of each nest position based on the fitness function;
using the target cuckoo searching algorithm, performing global iterative optimization according to the fitness, and searching out a corresponding global optimal position from all the bird nest positions;
judging whether the current iteration number meets the preset maximum iteration number or not;
if yes, the global optimal position is used as an optimal weight threshold of the initial prediction model, and the optimized appointed prediction model is obtained.
Further, the step of performing flow prediction processing on the network flow data to be processed based on the flow prediction model specifically includes:
acquiring network traffic data to be processed;
inputting the network traffic data into the traffic prediction model;
and carrying out prediction processing on the network traffic data through the traffic prediction model, and outputting a prediction result corresponding to the network traffic data.
Further, after the step of training the specified prediction model by using the training set and testing the trained specified prediction model by using the testing set to obtain a trained traffic prediction model, the method further includes:
Acquiring a preset model identifier;
determining a target memory subarea matched with the model identification from a plurality of memory subareas contained in the blockchain;
and storing the flow prediction model into a target storage subarea.
In order to solve the technical problems, the embodiment of the application also provides a flow prediction device based on artificial intelligence, which adopts the following technical scheme:
the first acquisition module is used for acquiring network traffic in a preset historical time period;
the first construction module is used for carrying out sample construction on the network flow based on a preset time period dividing unit to obtain a corresponding training set and a corresponding testing set;
the processing module is used for carrying out data preprocessing on the training set and the testing set to obtain a corresponding target training set and a corresponding target testing set;
the second construction module is used for determining a BP neural network structure and constructing an initial prediction model based on the BP neural network structure;
the optimization module is used for optimizing the weight threshold value of the initial prediction model based on a target cuckoo search algorithm to obtain an optimized specified prediction model; the target cuckoo searching algorithm is an optimized cuckoo searching algorithm obtained by improving the step length updating mode of the original cuckoo searching algorithm;
The training module is used for training the appointed prediction model by using the training set, and testing the trained appointed prediction model by using the testing set to obtain a trained flow prediction model;
and the prediction module is used for carrying out flow prediction processing on the network flow data to be processed based on the flow prediction model.
In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical schemes:
acquiring network traffic in a preset historical time period;
sample construction is carried out on the network traffic based on a preset time period dividing unit, and a corresponding training set and a corresponding testing set are obtained;
performing data preprocessing on the training set and the testing set to obtain a corresponding target training set and a corresponding target testing set;
determining a BP neural network structure, and constructing an initial prediction model based on the BP neural network structure;
performing weight threshold optimization on the initial prediction model based on a target cuckoo search algorithm to obtain an optimized specified prediction model; the target cuckoo searching algorithm is an optimized cuckoo searching algorithm obtained by improving the step length updating mode of the original cuckoo searching algorithm;
Training the appointed prediction model by using the training set, and testing the trained appointed prediction model by using the testing set to obtain a trained flow prediction model;
and carrying out flow prediction processing on the network flow data to be processed based on the flow prediction model.
In order to solve the above technical problems, an embodiment of the present application further provides a computer readable storage medium, which adopts the following technical schemes:
acquiring network traffic in a preset historical time period;
sample construction is carried out on the network traffic based on a preset time period dividing unit, and a corresponding training set and a corresponding testing set are obtained;
performing data preprocessing on the training set and the testing set to obtain a corresponding target training set and a corresponding target testing set;
determining a BP neural network structure, and constructing an initial prediction model based on the BP neural network structure;
performing weight threshold optimization on the initial prediction model based on a target cuckoo search algorithm to obtain an optimized specified prediction model; the target cuckoo searching algorithm is an optimized cuckoo searching algorithm obtained by improving the step length updating mode of the original cuckoo searching algorithm;
Training the appointed prediction model by using the training set, and testing the trained appointed prediction model by using the testing set to obtain a trained flow prediction model;
and carrying out flow prediction processing on the network flow data to be processed based on the flow prediction model.
Compared with the prior art, the embodiment of the application has the following main beneficial effects:
firstly, acquiring network traffic in a preset historical time period; then, based on a preset time period dividing unit, carrying out sample construction on the network flow to obtain a corresponding training set and a corresponding testing set; performing data preprocessing on the training set and the testing set to obtain a corresponding target training set and a corresponding target testing set; then determining a BP neural network structure, and constructing an initial prediction model based on the BP neural network structure; performing weight threshold optimization on the initial prediction model based on a target cuckoo search algorithm to obtain an optimized specified prediction model; training the appointed prediction model by further using the training set, and testing the trained appointed prediction model through the testing set to obtain a trained flow prediction model; and finally, carrying out flow prediction processing on the network flow data to be processed based on the flow prediction model. According to the embodiment of the application, after the corresponding training set and testing set are constructed based on the acquired network traffic in the historical time period, the initial prediction model is constructed and obtained by optimizing the weight threshold of the target cuckoo search algorithm obtained by improving the step length updating mode of the original cuckoo search algorithm, and then the specific prediction model is trained and tested by using the training set and the testing set, so that the trained traffic prediction model is obtained, and the accuracy of network traffic prediction of the traffic prediction model and the iteration efficiency of model training can be effectively improved.
Drawings
In order to more clearly illustrate the solution of the present application, a brief description will be given below of the drawings required for the description of the embodiments of the present application, it being apparent that the drawings in the following description are some embodiments of the present application, and that other drawings may be obtained from these drawings without the exercise of inventive effort for a person of ordinary skill in the art.
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow chart of one embodiment of an artificial intelligence based flow prediction method in accordance with the present application;
FIG. 3 is a schematic diagram of one embodiment of an artificial intelligence based flow prediction device according to the present application;
FIG. 4 is a schematic structural diagram of one embodiment of a computer device in accordance with the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the applications herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having" and any variations thereof in the description of the application and the claims and the description of the drawings above are intended to cover a non-exclusive inclusion. The terms first, second and the like in the description and in the claims or in the above-described figures, are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
In order to make the person skilled in the art better understand the solution of the present application, the technical solution of the embodiment of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, a system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. Various communication client applications, such as a web browser application, a shopping class application, a search class application, an instant messaging tool, a mailbox client, social platform software, etc., may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablet computers, electronic book readers, MP3 players (Moving Picture Experts Group Audio Layer III, dynamic video expert compression standard audio plane 3), MP4 (Moving Picture Experts Group Audio Layer IV, dynamic video expert compression standard audio plane 4) players, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that, the flow prediction method based on artificial intelligence provided by the embodiment of the present application is generally executed by a server/terminal device, and accordingly, the flow prediction device based on artificial intelligence is generally disposed in the server/terminal device.
The embodiment of the application can acquire and process the related data based on the artificial intelligence technology. Among these, artificial intelligence (Artificial Intelligence, AI) is the theory, method, technique and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend and extend human intelligence, sense the environment, acquire knowledge and use knowledge to obtain optimal results.
Artificial intelligence infrastructure technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and other directions.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow chart of one embodiment of an artificial intelligence based flow prediction method in accordance with the present application is shown. The artificial intelligence-based flow prediction method comprises the following steps:
step S201, obtaining network traffic in a preset historical time period.
In this embodiment, the electronic device (e.g., the server/terminal device shown in fig. 1) on which the traffic prediction method based on artificial intelligence operates may acquire the network traffic in the historical time period through a wired connection manner or a wireless connection manner. It should be noted that the wireless connection may include, but is not limited to, 3G/4G/5G connection, wiFi connection, bluetooth connection, wiMAX connection, zigbee connection, UWB (ultra wideband) connection, and other now known or later developed wireless connection. The traffic prediction method based on artificial intelligence provided by the application can be applied to the service scene of network traffic prediction of the service scene. For example, the service scenario of the insurance system can input the network data of the current time period into the flow prediction model constructed by the application, so as to output the network flow prediction data of the next time period after the current time period through the flow prediction model. The network traffic specifically refers to the network traffic in the service system. The business system may be specifically any of an insurance system, a banking system, a transaction system, an order system, and the like. In addition, the selection of the historical time period is not particularly limited, and the historical time period can be set according to actual service use requirements, for example, the historical time period can be within the previous month from the current time.
Step S202, carrying out sample construction on the network traffic based on a preset time period dividing unit to obtain a corresponding training set and a corresponding testing set.
In this embodiment, the foregoing sample construction is performed on the network traffic based on the preset time period division unit to obtain a specific implementation process of the corresponding training set and the test set, which will be described in further detail in the following specific embodiments, which will not be described herein.
And step S203, carrying out data preprocessing on the training set and the testing set to obtain a corresponding target training set and a target testing set.
In this embodiment, the data preprocessing may specifically include a data cleaning process and a normalization process. The training set and the test set are collectively referred to as a sample set. And removing noise data in the sample set by cleaning the data of the sample set. And (3) carrying out normalization processing on the sample set to convert the sample set to be between [0,1], so that the training speed of a subsequent flow prediction model is improved.
Step S204, determining a BP neural network structure and constructing an initial prediction model based on the BP neural network structure.
In this embodiment, the BP neural network may be divided into two parts, BP and neural network. BP is a shorthand for Back Propagation, meaning Back Propagation. The BP neural network is capable of learning and storing a large number of input-output pattern mappings without prior disclosure of mathematical equations describing such mappings. Its learning rule is to use the steepest descent method to continuously adjust the weight and threshold of the network by back propagation to minimize the sum of squares of errors of the network. The main characteristics are that: the signal is forward propagating and the error is backward propagating. Wherein, BP neural network structure includes: the input layer outputs predicted flow values for each period and corresponding network flow, and initializes parameters such as weight threshold and maximum iteration number of the BP neural network.
And step S205, carrying out weight threshold optimization on the initial prediction model based on a target cuckoo search algorithm to obtain an optimized specified prediction model. The target cuckoo searching algorithm is an optimized cuckoo searching algorithm obtained by improving the step length updating mode of the original cuckoo searching algorithm.
In this embodiment, the target cuckoo search algorithm is an optimized cuckoo search algorithm obtained by improving a step length updating mode of an original cuckoo search algorithm. The cuckoo search algorithm, also called CS algorithm, is a group intelligent optimization algorithm, and solves the optimization problem by simulating parasitic brooding of cuckoo, and is more effective than other optimization algorithms because of adopting a Levy flight search strategy. The path and location update strategy of the conventional CS algorithm is as follows: x is x i (t)=x i (t-1) +a.sup.Levy (λ); in the above formula: x is x i (t) and x i (t-1) is the ith solution at the t-1 th and t-1 th iterations, respectively; a is a step factor, which is used for determining a search scale; the addition is dot product; levy (λ) is a probability distribution obeying the rice. The specific implementation process of the optimized specific prediction model is obtained by optimizing the weight threshold value of the initial prediction model based on the target cuckoo search algorithm, and further details of the specific implementation process will be described in the following specific embodiments, which are not described herein. Initial prediction by using target cuckoo search algorithm The model performs weight threshold optimization, so that the precision and iteration efficiency of parameter optimization of the initial prediction model can be ensured. According to the embodiment, the CS-BP flow prediction model which can be used in a complex network environment is constructed by fusing a group intelligent optimization algorithm and a deep neural network, so that guarantee can be provided for online system network flow monitoring, network performance analysis, network management and the like.
And step S206, training the appointed prediction model by using the training set, and testing the trained appointed prediction model by using the testing set to obtain a trained flow prediction model.
In this embodiment, after the specified prediction model is trained by using the training set, the trained specified prediction model is tested by using the test set, an accuracy index between an actual value (i.e., a predicted value) and a true value is calculated, the accuracy index (for example, whether the evaluation accuracy is greater than a set threshold) is evaluated, and if the evaluation is passed, the evaluated specified prediction model is used as a trained flow prediction model.
And step S207, carrying out flow prediction processing on the network flow data to be processed based on the flow prediction model.
In this embodiment, the specific implementation process of performing the flow prediction processing on the network flow data to be processed based on the flow prediction model will be described in further detail in the following specific embodiments, which will not be described herein.
Firstly, acquiring network traffic in a preset historical time period; then, based on a preset time period dividing unit, carrying out sample construction on the network flow to obtain a corresponding training set and a corresponding testing set; performing data preprocessing on the training set and the testing set to obtain a corresponding target training set and a corresponding target testing set; then determining a BP neural network structure, and constructing an initial prediction model based on the BP neural network structure; performing weight threshold optimization on the initial prediction model based on a target cuckoo search algorithm to obtain an optimized specified prediction model; training the appointed prediction model by further using the training set, and testing the trained appointed prediction model through the testing set to obtain a trained flow prediction model; and finally, carrying out flow prediction processing on the network flow data to be processed based on the flow prediction model. According to the application, after the corresponding training set and test set are constructed based on the acquired network traffic in the historical time period, the initial prediction model is constructed by optimizing the weight threshold of the target cuckoo search algorithm obtained by improving the step length updating mode of the original cuckoo search algorithm, so that the designated prediction model is obtained, the training set is used for training and testing the designated prediction model, the trained traffic prediction model is obtained, and the accuracy of network traffic prediction of the traffic prediction model and the iteration efficiency of model training can be effectively improved.
In some alternative implementations, step S202 includes the steps of:
and acquiring a preset time period dividing unit.
In this embodiment, the value of the time period dividing unit is not limited, and may be set according to the actual use requirement, for example, may be set to 1 hour.
Each day in the history time period is divided into a corresponding plurality of unit time periods based on the time period division unit.
In the present embodiment, if the time period division unit is 1 hour, 24 hours per day may be divided into 24 unit time periods of 1 hour in the corresponding time length.
And constructing a training set corresponding to the network traffic by taking the network traffic in the same unit time period as the same sample.
In this embodiment, if the historical time period is that the service system is in the previous week from the current time, the network traffic of the service system in the week may be selected as the training set, 24 hours a day, and the same unit time period a day is considered as a type, that is, 24 training sets may be divided into one week.
And acquiring a preset time value.
In this embodiment, the value of the time period dividing unit is not limited, and may be set according to the actual use requirement, for example, may be set to 6.
And randomly screening specified data corresponding to the time value from the training set based on the time value.
In this embodiment, referring to the above example, after dividing the network traffic of the service system in the week into 24 training sets, the network traffic corresponding to the unit time period of 6 hours is randomly extracted from the 24 training sets as a test set.
And taking the specified data as the test set.
According to the application, a preset time period dividing unit is obtained, and each day in the historical time period is divided into a plurality of corresponding unit time periods based on the time period dividing unit; then constructing a training set corresponding to the network traffic by taking the network traffic in the same unit time period as the same sample; then obtaining a preset time value; and randomly screening specified data corresponding to the time value from the training set based on the time value, and taking the specified data as the test set. The application divides the network flow in the historical time period based on the use of the time period dividing unit so as to realize the rapid construction of the required training set, and then processes the constructed training set based on the use of the time value so as to realize the rapid construction of the required testing set, thereby improving the intelligence and standardization of the construction of the training set and the testing set and ensuring the randomness of the obtained testing set.
In some alternative implementations of the present embodiment, step S203 includes the steps of:
and cleaning the data of the training set and the testing set to obtain a first training set and a first testing set.
In this embodiment, the data cleansing may include removing noise data in the training set and the test set.
And carrying out normalization processing on the first training set and the first testing set to obtain a corresponding second training set and second testing set.
In this embodiment, the training set and the test set may be normalized by using a normalization formula to convert the training set and the test set to between [0,1 ].
The second training set is taken as the target training set, and the second testing set is taken as the target testing set.
The method comprises the steps of performing data cleaning on the training set and the testing set to obtain a first training set and a first testing set which correspond to each other; then, carrying out normalization processing on the first training set and the first testing set to obtain a corresponding second training set and a second testing set; subsequently, the second training set is taken as the target training set, and the second testing set is taken as the target testing set. According to the application, the training set and the test set are subjected to data cleaning and normalization processing, so that the characteristic data meeting the use requirement of the model can be obtained quickly and accurately, and the training speed of the flow prediction model can be effectively improved when the training set and the test set are used for constructing the flow prediction model in the follow-up process.
In some alternative implementations, before step S205, the electronic device may further perform the following steps:
an original cuckoo search algorithm is obtained.
And acquiring a step length updating mode in the initial cuckoo searching algorithm.
In this embodiment, the path and location update strategy of the conventional cuckoo search algorithm is as follows: x is x i (t)=x i (t-1) +a.sup.Levy (λ); in the above formula: x is x i (t) and x i (t-1) is the ith solution at the t-1 th and t-1 th iterations, respectively; a is a step factor, which is used for determining a search scale; the addition is dot product; levy (λ) is a probability distribution obeying the rice.
And improving a step length updating mode of the cuckoo searching algorithm based on a preset formula to obtain the optimized target cuckoo searching algorithm.
In this embodiment, a cuckoo search is performedThe Levy search strategy is adopted in the cable algorithm, so that the step length of the cable algorithm has strong randomness, and the cable algorithm has strong global search capability but weak local optimization capability. In order to balance global searching and local optimizing capability in the iterative process, the step length updating mode is considered to be improved, so that the step length can be adaptively and dynamically adjusted in the iterative process. The improvement method comprises the following steps:in which x is best Is the current optimum value. According to the improvement of the step factor, the CS algorithm has larger searching step length in the earlier stage and strong global searching capability; along with the approach to the global optimal solution, the step length gradually becomes smaller, and the local optimizing capability is improved. In conclusion, by adaptively adjusting the step length of the CS algorithm, the global searching and local optimizing capabilities of the CS optimizing algorithm are balanced, and the convergence speed is improved. According to the embodiment, the CS algorithm is updated and improved by introducing the dynamic adaptation factor, so that the problem of unbalanced global optimization in the early stage and local optimization in the later stage can be solved. The initial weight and the threshold value of the BP network are optimized by using the improved CS algorithm, and the accuracy of network flow prediction and the iteration efficiency of model training can be further improved.
According to the application, an original cuckoo searching algorithm is obtained; then acquiring a step length updating mode in the initial cuckoo searching algorithm; and subsequently, improving a step length updating mode of the cuckoo searching algorithm based on a preset formula to obtain the optimized target cuckoo searching algorithm. According to the application, the step length updating mode of the traditional cuckoo searching algorithm is improved by using a preset formula, so that the optimized target cuckoo searching algorithm can be obtained quickly, the step length of the traditional cuckoo searching algorithm is adjusted in a self-adaptive manner, the global searching and local optimizing capabilities of the traditional cuckoo searching algorithm are balanced, and the convergence rate is improved effectively. The weight threshold optimization is carried out on the initial prediction model by using a target cuckoo search algorithm to construct a flow prediction model, so that the accuracy of network flow prediction of the flow prediction model and the iteration efficiency of model training can be further improved.
In some alternative implementations, step S205 includes the steps of:
and initializing parameters of the target cuckoo search algorithm.
In this embodiment, the parameters for initializing the target cuckoo search algorithm at least may include parameters such as a bird nest number, an initial step update factor, a maximum iteration number, and an error standard of the target cuckoo search algorithm. The value of the parameter is not limited, and can be set according to actual service requirements.
A plurality of bird nest locations are randomly generated and initial weight thresholds of the initial predictive model are encoded as initial bird nest locations of the target cuckoo search algorithm.
And determining a fitness function of the target cuckoo search algorithm, and calculating the fitness of each nest position based on the fitness function.
In this embodiment, the output error of the initial prediction model may be obtained and used as a fitness function of the target cuckoo search algorithm.
And carrying out global iterative optimization processing according to the fitness by using the target cuckoo searching algorithm, and searching out the corresponding global optimal position from all the bird nest positions.
In this embodiment, by using the target cuckoo search algorithm, the current optimal position is obtained according to the above fitness, and then the position is updated according to an improved position updating manner, so as to obtain a new bird nest position. And comparing the fitness values of the bird nest positions, and discarding the worse position to obtain the current optimal position. Repeating the iteration to find the global optimal position.
Judging whether the current iteration number meets the preset maximum iteration number or not.
In this embodiment, the value of the maximum iteration number is not limited, and may be set according to the actual service requirement.
If yes, the global optimal position is used as an optimal weight threshold of the initial prediction model, and the optimized appointed prediction model is obtained.
In this embodiment, if the current iteration number does not meet the preset maximum iteration number or does not meet the error standard, the global iteration optimizing process is circularly executed, so as to always find the global optimal position meeting the maximum iteration number or the error standard.
According to the application, the target cuckoo search algorithm is subjected to parameter initialization; then randomly generating a plurality of bird nest positions, and encoding an initial weight threshold of the initial prediction model into initial bird nest positions of the target cuckoo searching algorithm; then determining an adaptability function of the target cuckoo searching algorithm, and calculating the adaptability of each nest position based on the adaptability function; subsequently, using the target cuckoo searching algorithm, performing global iterative optimization according to the fitness, and searching out a corresponding global optimal position from all the bird nest positions; finally judging whether the current iteration number meets the preset maximum iteration number or not; if yes, the global optimal position is used as an optimal weight threshold of the initial prediction model, and the optimized appointed prediction model is obtained. According to the application, the weight threshold of the initial prediction model is optimized based on the target cuckoo search algorithm to obtain the optimized specified prediction model, and the target cuckoo search algorithm realizes the self-adaptive adjustment of the step length of the traditional cuckoo search algorithm, balances the global search and local optimization capacity of the traditional cuckoo search algorithm, and effectively improves the convergence rate, so that the iteration efficiency of the flow prediction model training can be effectively improved. And further, the accuracy of network flow prediction processing of the flow prediction model is improved.
In some alternative implementations of the present embodiment, step S207 includes the steps of:
and acquiring network traffic data to be processed.
In this embodiment, the network traffic data to be processed may be network traffic data of the service system in a specified period of time.
And inputting the network traffic data into the traffic prediction model.
And carrying out prediction processing on the network traffic data through the traffic prediction model, and outputting a prediction result corresponding to the network traffic data.
In this embodiment, after the traffic prediction model predicts the network traffic data, a network traffic prediction value of the service system in a target time period is output; wherein the target time period is a time period after the specified time period.
The application obtains the network flow data to be processed; inputting the network traffic data into the traffic prediction model; and then, carrying out prediction processing on the network flow data through the flow prediction model, and outputting a prediction result corresponding to the network flow data. According to the network traffic prediction method and the network traffic prediction device, the network traffic data to be processed is subjected to traffic prediction processing by using the traffic prediction model obtained through training of the target cuckoo search algorithm, so that the accuracy of network traffic prediction of the traffic prediction model can be effectively ensured.
In some optional implementations of this embodiment, after step S206, the electronic device may further perform the following steps:
and acquiring a preset model identifier.
In this embodiment, the blockchain is divided into a plurality of memory subregions in one-to-one correspondence in advance according to a plurality of identifiers. The identification may include a model identification, a data table identification, a file identification, and so on. Each memory subarea is used for storing data corresponding to the identification.
A target memory sub-region that matches the model identification is determined from a plurality of memory sub-regions contained in the blockchain.
And storing the flow prediction model into a target storage subarea.
The method comprises the steps of obtaining a preset model identifier; then determining a target memory subarea matched with the model identifier from a plurality of memory subareas contained in the blockchain; and storing the flow prediction model into a target storage subarea. According to the application, the specified prediction model is trained by using the training set, the trained specified prediction model is tested by the testing set, and after the trained flow prediction model is obtained, the flow prediction model is intelligently transferred to the target memory subarea matched with the model identification in the blockchain according to the model identification corresponding to the flow prediction model, so that the standardization and the intelligence of model storage are effectively improved, and the required model can be quickly taken out from the target memory subarea in the follow-up process, thereby improving the efficiency of model calling.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present application.
It is emphasized that to further guarantee the privacy and security of the traffic prediction model, the traffic prediction model may also be stored in a node of a blockchain.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The embodiment of the application can acquire and process the related data based on the artificial intelligence technology. Among these, artificial intelligence (Artificial Intelligence, AI) is the theory, method, technique and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend and extend human intelligence, sense the environment, acquire knowledge and use knowledge to obtain optimal results.
Artificial intelligence infrastructure technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and other directions.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by computer readable instructions stored in a computer readable storage medium that, when executed, may comprise the steps of the embodiments of the methods described above. The storage medium may be a nonvolatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a random access Memory (Random Access Memory, RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
With further reference to fig. 3, as an implementation of the method shown in fig. 2, the present application provides an embodiment of an artificial intelligence based flow prediction apparatus, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable to various electronic devices.
As shown in fig. 3, the artificial intelligence based flow prediction apparatus 300 according to the present embodiment includes: a first acquisition module 301, a first construction module 302, a processing module 303, a second construction module 304, an optimization module 305, a training module 306, and a prediction module 307. Wherein:
a first obtaining module 301, configured to obtain a network flow in a preset historical time period;
the first construction module 302 is configured to perform sample construction on the network traffic based on a preset time period division unit, so as to obtain a corresponding training set and a corresponding testing set;
the processing module 303 is configured to perform data preprocessing on the training set and the test set to obtain a corresponding target training set and a target test set;
a second construction module 304, configured to determine a BP neural network structure, and construct an initial prediction model based on the BP neural network structure;
the optimization module 305 is configured to perform weight threshold optimization on the initial prediction model based on a target cuckoo search algorithm, so as to obtain an optimized specified prediction model; the target cuckoo searching algorithm is an optimized cuckoo searching algorithm obtained by improving the step length updating mode of the original cuckoo searching algorithm;
The training module 306 is configured to train the specified prediction model by using the training set, and test the trained specified prediction model by using the test set to obtain a trained traffic prediction model;
and the prediction module 307 is configured to perform flow prediction processing on the network flow data to be processed based on the flow prediction model.
In this embodiment, the operations performed by the modules or units respectively correspond to the steps of the artificial intelligence-based flow prediction method in the foregoing embodiment, and are not described herein again.
In some alternative implementations of the present embodiment, the first building block 302 includes:
the first acquisition submodule is used for acquiring a preset time period dividing unit;
dividing the time period dividing unit into a plurality of unit time periods;
the construction submodule is used for constructing a training set corresponding to the network traffic by taking the network traffic in the same unit time period as the same sample;
the second acquisition sub-module is used for acquiring a preset time value;
the screening sub-module is used for randomly screening specified data corresponding to the time value from the training set based on the time value;
And the first determination submodule is used for taking the specified data as the test set.
In this embodiment, the operations performed by the modules or units respectively correspond to the steps of the artificial intelligence-based flow prediction method in the foregoing embodiment, and are not described herein again.
In some alternative implementations of the present embodiment, the processing module 303 includes:
the cleaning submodule is used for cleaning data of the training set and the testing set to obtain a first training set and a first testing set which correspond to the training set and the testing set;
the first processing submodule is used for carrying out normalization processing on the first training set and the first testing set to obtain a corresponding second training set and second testing set;
and the second determining submodule is used for taking the second training set as the target training set and taking the second testing set as the target testing set.
In this embodiment, the operations performed by the modules or units respectively correspond to the steps of the artificial intelligence-based flow prediction method in the foregoing embodiment, and are not described herein again.
In some optional implementations of this embodiment, the artificial intelligence based flow prediction device further includes:
The third acquisition sub-module is used for acquiring an original cuckoo search algorithm;
a fourth obtaining sub-module, configured to obtain a step update mode in the initial cuckoo search algorithm;
and the improvement submodule is used for improving the step length updating mode of the cuckoo searching algorithm based on a preset formula to obtain the optimized target cuckoo searching algorithm.
In this embodiment, the operations performed by the modules or units respectively correspond to the steps of the artificial intelligence-based flow prediction method in the foregoing embodiment, and are not described herein again.
In some alternative implementations of the present embodiment, the optimization module 305 includes:
the second processing submodule is used for initializing parameters of the target cuckoo search algorithm;
the third processing sub-module is used for randomly generating a plurality of bird nest positions and encoding an initial weight threshold value of the initial prediction model into the initial bird nest position of the target cuckoo searching algorithm;
the computing sub-module is used for determining a fitness function of the target cuckoo searching algorithm and computing the fitness of each bird nest position based on the fitness function;
the fourth processing submodule is used for carrying out global iterative optimization processing according to the adaptability by using the target cuckoo search algorithm, and finding out corresponding global optimal positions from all the bird nest positions;
The judging sub-module is used for judging whether the current iteration number meets the preset maximum iteration number or not;
and the third determination submodule is used for obtaining the optimized appointed prediction model by taking the global optimal position as an optimal weight threshold of the initial prediction model if the global optimal position is the optimal weight threshold.
In this embodiment, the operations performed by the modules or units respectively correspond to the steps of the artificial intelligence-based flow prediction method in the foregoing embodiment, and are not described herein again.
In some alternative implementations of the present embodiment, the prediction module 307 includes:
a fifth obtaining sub-module, configured to obtain network traffic data to be processed;
an input sub-module for inputting the network traffic data into the traffic prediction model;
and the prediction sub-module is used for performing prediction processing on the network flow data through the flow prediction model and outputting a prediction result corresponding to the network flow data.
In this embodiment, the operations performed by the modules or units respectively correspond to the steps of the artificial intelligence-based flow prediction method in the foregoing embodiment, and are not described herein again.
In some optional implementations of this embodiment, the artificial intelligence based flow prediction device further includes:
The second acquisition module is used for acquiring a preset model identifier;
the determining module is used for determining a target memory subarea matched with the model identifier from a plurality of memory subareas contained in the blockchain;
and the storage module is used for storing the flow prediction model into a target storage subarea.
In this embodiment, the operations performed by the modules or units respectively correspond to the steps of the artificial intelligence-based flow prediction method in the foregoing embodiment, and are not described herein again.
In order to solve the technical problems, the embodiment of the application also provides computer equipment. Referring specifically to fig. 4, fig. 4 is a basic structural block diagram of a computer device according to the present embodiment.
The computer device 4 comprises a memory 41, a processor 42, a network interface 43 communicatively connected to each other via a system bus. It should be noted that only computer device 4 having components 41-43 is shown in the figures, but it should be understood that not all of the illustrated components are required to be implemented and that more or fewer components may be implemented instead. It will be appreciated by those skilled in the art that the computer device herein is a device capable of automatically performing numerical calculations and/or information processing in accordance with predetermined or stored instructions, the hardware of which includes, but is not limited to, microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASICs), programmable gate arrays (fields-Programmable Gate Array, FPGAs), digital processors (Digital Signal Processor, DSPs), embedded devices, etc.
The computer equipment can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing equipment. The computer equipment can perform man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch pad or voice control equipment and the like.
The memory 41 includes at least one type of readable storage medium including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), programmable Read Only Memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the storage 41 may be an internal storage unit of the computer device 4, such as a hard disk or a memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the computer device 4. Of course, the memory 41 may also comprise both an internal memory unit of the computer device 4 and an external memory device. In this embodiment, the memory 41 is typically used to store an operating system and various application software installed on the computer device 4, such as computer readable instructions based on an artificial intelligence flow prediction method. Further, the memory 41 may be used to temporarily store various types of data that have been output or are to be output.
The processor 42 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is configured to execute computer readable instructions stored in the memory 41 or process data, such as executing computer readable instructions of the artificial intelligence based flow prediction method.
The network interface 43 may comprise a wireless network interface or a wired network interface, which network interface 43 is typically used for establishing a communication connection between the computer device 4 and other electronic devices.
Compared with the prior art, the embodiment of the application has the following main beneficial effects:
in the embodiment of the application, firstly, network flow in a preset historical time period is obtained; then, based on a preset time period dividing unit, carrying out sample construction on the network flow to obtain a corresponding training set and a corresponding testing set; performing data preprocessing on the training set and the testing set to obtain a corresponding target training set and a corresponding target testing set; then determining a BP neural network structure, and constructing an initial prediction model based on the BP neural network structure; performing weight threshold optimization on the initial prediction model based on a target cuckoo search algorithm to obtain an optimized specified prediction model; training the appointed prediction model by further using the training set, and testing the trained appointed prediction model through the testing set to obtain a trained flow prediction model; and finally, carrying out flow prediction processing on the network flow data to be processed based on the flow prediction model. According to the embodiment of the application, after the corresponding training set and testing set are constructed based on the acquired network traffic in the historical time period, the initial prediction model is constructed and obtained by optimizing the weight threshold of the target cuckoo search algorithm obtained by improving the step length updating mode of the original cuckoo search algorithm, and then the specific prediction model is trained and tested by using the training set and the testing set, so that the trained traffic prediction model is obtained, and the accuracy of network traffic prediction of the traffic prediction model and the iteration efficiency of model training can be effectively improved.
The present application also provides another embodiment, namely, a computer-readable storage medium storing computer-readable instructions executable by at least one processor to cause the at least one processor to perform the steps of an artificial intelligence-based flow prediction method as described above.
Compared with the prior art, the embodiment of the application has the following main beneficial effects:
in the embodiment of the application, firstly, network flow in a preset historical time period is obtained; then, based on a preset time period dividing unit, carrying out sample construction on the network flow to obtain a corresponding training set and a corresponding testing set; performing data preprocessing on the training set and the testing set to obtain a corresponding target training set and a corresponding target testing set; then determining a BP neural network structure, and constructing an initial prediction model based on the BP neural network structure; performing weight threshold optimization on the initial prediction model based on a target cuckoo search algorithm to obtain an optimized specified prediction model; training the appointed prediction model by further using the training set, and testing the trained appointed prediction model through the testing set to obtain a trained flow prediction model; and finally, carrying out flow prediction processing on the network flow data to be processed based on the flow prediction model. According to the embodiment of the application, after the corresponding training set and testing set are constructed based on the acquired network traffic in the historical time period, the initial prediction model is constructed and obtained by optimizing the weight threshold of the target cuckoo search algorithm obtained by improving the step length updating mode of the original cuckoo search algorithm, and then the specific prediction model is trained and tested by using the training set and the testing set, so that the trained traffic prediction model is obtained, and the accuracy of network traffic prediction of the traffic prediction model and the iteration efficiency of model training can be effectively improved.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present application.
It is apparent that the above-described embodiments are only some embodiments of the present application, but not all embodiments, and the preferred embodiments of the present application are shown in the drawings, which do not limit the scope of the patent claims. This application may be embodied in many different forms, but rather, embodiments are provided in order to provide a thorough and complete understanding of the present disclosure. Although the application has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications may be made to the embodiments described in the foregoing description, or equivalents may be substituted for elements thereof. All equivalent structures made by the content of the specification and the drawings of the application are directly or indirectly applied to other related technical fields, and are also within the scope of the application.
Claims (10)
1. The artificial intelligence-based flow prediction method is characterized by comprising the following steps of:
acquiring network traffic in a preset historical time period;
sample construction is carried out on the network traffic based on a preset time period dividing unit, and a corresponding training set and a corresponding testing set are obtained;
performing data preprocessing on the training set and the testing set to obtain a corresponding target training set and a corresponding target testing set;
determining a BP neural network structure, and constructing an initial prediction model based on the BP neural network structure;
performing weight threshold optimization on the initial prediction model based on a target cuckoo search algorithm to obtain an optimized specified prediction model; the target cuckoo searching algorithm is an optimized cuckoo searching algorithm obtained by improving the step length updating mode of the original cuckoo searching algorithm;
training the appointed prediction model by using the training set, and testing the trained appointed prediction model by using the testing set to obtain a trained flow prediction model;
and carrying out flow prediction processing on the network flow data to be processed based on the flow prediction model.
2. The artificial intelligence based traffic prediction method according to claim 1, wherein the step of constructing samples of the network traffic based on a preset time period division unit to obtain a corresponding training set and test set specifically includes:
Acquiring a preset time period dividing unit;
dividing each day in the history time period into a corresponding plurality of unit time periods based on the time period dividing unit;
constructing a training set corresponding to the network traffic by taking the network traffic in the same unit time period as the same sample;
acquiring a preset time value;
randomly screening appointed data corresponding to the time value from the training set based on the time value;
and taking the specified data as the test set.
3. The artificial intelligence based flow prediction method according to claim 1, wherein the step of performing data preprocessing on the training set and the test set to obtain a corresponding target training set and a target test set specifically includes:
data cleaning is carried out on the training set and the testing set, and a first training set and a first testing set which correspond to each other are obtained;
normalizing the first training set and the first testing set to obtain a corresponding second training set and second testing set;
the second training set is taken as the target training set, and the second testing set is taken as the target testing set.
4. The artificial intelligence based flow prediction method according to claim 1, further comprising, before the step of optimizing the weight threshold for the initial prediction model based on the target cuckoo search algorithm to obtain an optimized specified prediction model:
acquiring an original cuckoo searching algorithm;
acquiring a step length updating mode in the initial cuckoo searching algorithm;
and improving a step length updating mode of the cuckoo searching algorithm based on a preset formula to obtain the optimized target cuckoo searching algorithm.
5. The artificial intelligence based flow prediction method according to claim 1, wherein the step of optimizing the weight threshold of the initial prediction model based on the target cuckoo search algorithm to obtain an optimized specified prediction model specifically comprises:
initializing parameters of the target cuckoo search algorithm;
randomly generating a plurality of bird nest positions, and encoding an initial weight threshold of the initial prediction model into initial bird nest positions of the target cuckoo search algorithm;
determining a fitness function of the target cuckoo search algorithm, and calculating fitness of each nest position based on the fitness function;
Using the target cuckoo searching algorithm, performing global iterative optimization according to the fitness, and searching out a corresponding global optimal position from all the bird nest positions;
judging whether the current iteration number meets the preset maximum iteration number or not;
if yes, the global optimal position is used as an optimal weight threshold of the initial prediction model, and the optimized appointed prediction model is obtained.
6. The artificial intelligence based traffic prediction method according to claim 1, wherein the step of performing traffic prediction processing on the network traffic data to be processed based on the traffic prediction model specifically comprises:
acquiring network traffic data to be processed;
inputting the network traffic data into the traffic prediction model;
and carrying out prediction processing on the network traffic data through the traffic prediction model, and outputting a prediction result corresponding to the network traffic data.
7. The artificial intelligence based traffic prediction method according to claim 1, further comprising, after the step of training the specified prediction model using the training set and testing the trained specified prediction model by the test set to obtain a trained traffic prediction model:
Acquiring a preset model identifier;
determining a target memory subarea matched with the model identification from a plurality of memory subareas contained in the blockchain;
and storing the flow prediction model into a target storage subarea.
8. An artificial intelligence based flow prediction device, comprising:
the first acquisition module is used for acquiring network traffic in a preset historical time period;
the first construction module is used for carrying out sample construction on the network flow based on a preset time period dividing unit to obtain a corresponding training set and a corresponding testing set;
the processing module is used for carrying out data preprocessing on the training set and the testing set to obtain a corresponding target training set and a corresponding target testing set;
the second construction module is used for determining a BP neural network structure and constructing an initial prediction model based on the BP neural network structure;
the optimization module is used for optimizing the weight threshold value of the initial prediction model based on a target cuckoo search algorithm to obtain an optimized specified prediction model; the target cuckoo searching algorithm is an optimized cuckoo searching algorithm obtained by improving the step length updating mode of the original cuckoo searching algorithm;
The training module is used for training the appointed prediction model by using the training set, and testing the trained appointed prediction model by using the testing set to obtain a trained flow prediction model;
and the prediction module is used for carrying out flow prediction processing on the network flow data to be processed based on the flow prediction model.
9. A computer device comprising a memory having stored therein computer readable instructions which when executed implement the steps of the artificial intelligence based flow prediction method of any of claims 1 to 7.
10. A computer readable storage medium having stored thereon computer readable instructions which when executed by a processor implement the steps of the artificial intelligence based flow prediction method of any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310769159.9A CN116684330A (en) | 2023-06-27 | 2023-06-27 | Traffic prediction method, device, equipment and storage medium based on artificial intelligence |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310769159.9A CN116684330A (en) | 2023-06-27 | 2023-06-27 | Traffic prediction method, device, equipment and storage medium based on artificial intelligence |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116684330A true CN116684330A (en) | 2023-09-01 |
Family
ID=87783736
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310769159.9A Pending CN116684330A (en) | 2023-06-27 | 2023-06-27 | Traffic prediction method, device, equipment and storage medium based on artificial intelligence |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116684330A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116996403A (en) * | 2023-09-26 | 2023-11-03 | 深圳市乙辰科技股份有限公司 | Network traffic diagnosis method and system applying AI model |
CN117647932A (en) * | 2024-01-25 | 2024-03-05 | 上海碳索能源服务股份有限公司 | Method, system, terminal and medium for constructing cooling pump flow prediction model |
CN118504716A (en) * | 2024-07-18 | 2024-08-16 | 长江水利委员会水文局 | Method and device for calibrating flow measurement model parameters |
-
2023
- 2023-06-27 CN CN202310769159.9A patent/CN116684330A/en active Pending
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116996403A (en) * | 2023-09-26 | 2023-11-03 | 深圳市乙辰科技股份有限公司 | Network traffic diagnosis method and system applying AI model |
CN116996403B (en) * | 2023-09-26 | 2023-12-15 | 深圳市乙辰科技股份有限公司 | Network traffic diagnosis method and system applying AI model |
CN117647932A (en) * | 2024-01-25 | 2024-03-05 | 上海碳索能源服务股份有限公司 | Method, system, terminal and medium for constructing cooling pump flow prediction model |
CN117647932B (en) * | 2024-01-25 | 2024-05-07 | 上海碳索能源服务股份有限公司 | Method, system, terminal and medium for constructing cooling pump flow prediction model |
CN118504716A (en) * | 2024-07-18 | 2024-08-16 | 长江水利委员会水文局 | Method and device for calibrating flow measurement model parameters |
CN118504716B (en) * | 2024-07-18 | 2024-10-01 | 长江水利委员会水文局 | Method and device for calibrating flow measurement model parameters |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11694109B2 (en) | Data processing apparatus for accessing shared memory in processing structured data for modifying a parameter vector data structure | |
CN110766142A (en) | Model generation method and device | |
AU2020385264B2 (en) | Fusing multimodal data using recurrent neural networks | |
CN111523640B (en) | Training method and device for neural network model | |
CN112256886B (en) | Probability calculation method and device in atlas, computer equipment and storage medium | |
CN116684330A (en) | Traffic prediction method, device, equipment and storage medium based on artificial intelligence | |
CN110555714A (en) | method and apparatus for outputting information | |
CN112084752B (en) | Sentence marking method, device, equipment and storage medium based on natural language | |
WO2023207411A1 (en) | Traffic determination method and apparatus based on spatio-temporal data, and device and medium | |
CN111353601A (en) | Method and apparatus for predicting delay of model structure | |
CN113961765A (en) | Searching method, device, equipment and medium based on neural network model | |
US20220414689A1 (en) | Method and apparatus for training path representation model | |
CN114241411B (en) | Counting model processing method and device based on target detection and computer equipment | |
CN115936895A (en) | Risk assessment method, device and equipment based on artificial intelligence and storage medium | |
CN115310590A (en) | Graph structure learning method and device | |
CN117235257A (en) | Emotion prediction method, device, equipment and storage medium based on artificial intelligence | |
CN116703466A (en) | System access quantity prediction method based on improved wolf algorithm and related equipment thereof | |
CN116681467A (en) | Sales predicting method based on improved WOA algorithm and related equipment thereof | |
CN117235633A (en) | Mechanism classification method, mechanism classification device, computer equipment and storage medium | |
CN116777646A (en) | Artificial intelligence-based risk identification method, apparatus, device and storage medium | |
CN117236707A (en) | Asset optimization configuration method and device, computer equipment and storage medium | |
CN115169692A (en) | Time series prediction method and related device | |
CN117035038A (en) | Model pruning method, device, equipment and storage medium | |
CN113792342B (en) | Desensitization data reduction method, device, computer equipment and storage medium | |
CN117034114A (en) | Data prediction method, device, equipment and storage medium based on artificial intelligence |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |