Method, device and equipment for predicting call volume of data sharing API (Application Program Interface)
Through variational modal decomposition and improved particle swarm algorithm optimization, the problem of low prediction accuracy of data sharing API calls is solved, and higher prediction accuracy and generalization capabilities are achieved.
Patent Information
- Application Number
- CN202411627514.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-04-25
AI Technical Summary
The prior art predicts the data sharing API call volume, and the prediction accuracy is low, making it difficult to effectively process the instability and volatility of data.
The variational modal decomposition method is used to decompose the sequence of data sharing API call volume data, and combined with the improved particle swarm algorithm to optimize the hyperparameters of the CNN-LSTM model to improve the model's prediction ability.
By reducing data instability and volatility, the prediction accuracy and generalization ability of the model are improved, and are suitable for data sharing API call volume prediction tasks in large sample scenarios.
Smart Images

Figure CN119884730A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of call volume prediction, and in particular to a method, device and equipment for predicting the call volume of a data sharing API. Background Art
[0002] The data sharing API is a medium for the data center to share data with cross-departmental developers within the company and external third-party developers. By calling the data sharing API, the internal information shared by the data center can be obtained, helping different systems, departments, and company organizations to obtain data conveniently and efficiently. The number of data sharing API calls refers to the number of times a data sharing API is called within a specific time range. This indicator is very important for evaluating API usage, performance, and system load. Traditional prediction methods such as ARIMA, SVR, and RF have limitations in accuracy and robustness when faced with highly random and complex sequence data such as the data sharing API call volume sequence.
[0003] Prior art CN117009758A is a method, medium and device for predicting system visit volume based on deep learning. The invention uses a variational modal algorithm optimized by a genetic algorithm to perform modal decomposition on the data, and inputs the decomposed modal components into the CNN network and the GRU network, and adds the results output by the model to obtain the final prediction value. This technology improves the prediction ability of the model by reducing data volatility and instability. However, the empirical setting of the GRU network parameters did not achieve a better effect, resulting in inaccurate prediction results.
[0004] Prior art CN116703466A is a method for predicting system visit volume based on an improved gray wolf algorithm and related equipment. The invention solves the problem that the BP neural network is prone to form local extreme values and cannot timely and accurately predict the target system visit volume by optimizing the BP neural network through the improved gray wolf algorithm. However, the time series of system visit volume has strong volatility and instability, which makes the optimized BP neural network perform poorly when processing the time series of visit volume, resulting in reduced accuracy of prediction results.
[0005] Therefore, in the field of data sharing API call volume prediction, a method for efficiently, robustly, and accurately predicting the data sharing API call volume sequence is needed. Summary of the invention
[0006] In view of this, the purpose of the present invention is to provide a method, device and equipment for predicting the call volume of a data sharing API to overcome the current problem of low prediction accuracy.
[0007] To achieve the above objectives, the present invention adopts the following technical solutions:
[0008] In a first aspect, the present application provides a method for predicting the amount of calls to a data sharing API, including:
[0009] Get data sharing API call volume data;
[0010] Decomposing the sequence of the data sharing API call volume data by using a variational mode decomposition method;
[0011] Dividing the subsequences decomposed by the variational mode decomposition algorithm into training samples and test samples and performing normalization processing;
[0012] Use improved particle swarm algorithm to optimize the hyperparameters of CNN-LSTM model;
[0013] Reconstructing the CNN-LSTM model using optimal hyperparameters, and using the training samples for training, and the test samples for prediction;
[0014] The subsequences decomposed by the variational mode decomposition algorithm are input into the CNN-LSTM model for prediction, and the prediction results of the subsequences decomposed by the variational mode decomposition algorithm are superimposed to obtain the predicted value of the data sharing API call amount.
[0015] Furthermore, in the above method, the step of obtaining the data sharing API call volume data includes:
[0016] According to the access logs of the data center server, the system access volume per unit time within a fixed time interval is obtained;
[0017] The missing values of the system access volume of each unit time are filled in nearby to form preprocessed time series data.
[0018] Furthermore, in the above method, the step of using a variational mode decomposition method to decompose the sequence of the data sharing API call volume data includes:
[0019] Input the time series data into the VMD algorithm, and set the number of modes and their initial modal components and center frequencies;
[0020] Iterate the VMD algorithm and update the modal components and center frequencies. After each iteration, check the VMD algorithm to confirm whether the convergence condition has been met.
[0021] If so, the VMD algorithm will generate updated modal components and frequency outputs, thereby obtaining a subsequence of the data sharing API call volume data sequence.
[0022] Furthermore, in the above method, the subsequences decomposed by the variational mode decomposition algorithm are divided into training samples and test samples and normalized, including:
[0023] The first 70% of the subsequence of the data sharing API call volume data sequence is used as training samples, and the last 30% is used as test samples;
[0024] The training samples and the test samples are normalized by a calculation formula.
[0025] Furthermore, in the above method, the use of the improved particle swarm algorithm to optimize the hyperparameters of the CNN-LSTM model includes:
[0026] Determine the range of parameters to be optimized, including: learning rate, time step, batch size, and number of hidden layer neurons;
[0027] Determine the population size, number of iterations, learning factor, position and speed of the initialized particles of the particle swarm algorithm, and use the mean square error of the CNN-LSTM model as the fitness function;
[0028] Calculate the fitness of each particle and update the speed and position of each particle;
[0029] Update the individual optimal fitness and position of each particle, and the historical optimal fitness and position of the group;
[0030] Determine whether the maximum number of iterations has been reached. If so, output the parameters corresponding to the historical optimal fitness value of the group;
[0031] If not, continue to calculate the fitness of each particle and update the speed and position of each particle.
[0032] Furthermore, the method described above, wherein the CNN-LSTM model is reconstructed using the optimal hyperparameters, and the training samples are used for training, and the test samples are used for prediction, comprises:
[0033] Reconstructing the CNN-LSTM model according to the parameters corresponding to the historical optimal fitness value of the group;
[0034] The CNN-LSTM model is trained using the training samples, and prediction is performed using the test samples.
[0035] Furthermore, the method described above, wherein the subsequences decomposed by the variational mode decomposition algorithm are input into the CNN-LSTM model for prediction, and the prediction results of the subsequences decomposed by the variational mode decomposition algorithm are superimposed to obtain the predicted value of the data sharing API call amount, includes:
[0036] Inputting a subsequence of the data sharing API call volume data sequence into the CNN-LSTM model;
[0037] The spatial features of the subsequences of the data sharing API call volume data sequence are extracted through the CNN layer in the CNN-LSTM model, the flattening process is performed through the flattening layer, and the temporal features of the subsequences of the data sharing API call volume data sequence are extracted through the LSTM layer composed of multiple hidden layers;
[0038] Outputting predicted values of subsequences of the data sharing API call volume data sequence through the fully connected layer in the CNN-LSTM model;
[0039] The predicted values of all subsequences of the data sharing API call volume data sequence are denormalized and summed up to obtain the predicted value of the data sharing API call volume.
[0040] Furthermore, the above method further includes:
[0041] The prediction effect of the CNN-LSTM model was evaluated by using mean square error, mean absolute error, mean absolute percentage error and coefficient of determination as evaluation indicators.
[0042] In a second aspect, the present application provides a data sharing API call volume prediction device, comprising:
[0043] Data acquisition module, used to obtain data sharing API call volume data;
[0044] A sequence decomposition module, used to decompose the sequence of the data sharing API call volume data by using a variational mode decomposition method;
[0045] A preprocessing module, used for dividing the subsequences decomposed by the variational mode decomposition algorithm into training samples and test samples and performing normalization processing;
[0046] Model improvement module, used to optimize the hyperparameters of the CNN-LSTM model using an improved particle swarm algorithm;
[0047] A model training module, used to reconstruct the CNN-LSTM model using optimal hyperparameters, and use the training samples for training and the test samples for prediction;
[0048] The prediction module is used to input the subsequences decomposed by the variational mode decomposition algorithm into the CNN-LSTM model for prediction, and superimpose the prediction results of the subsequences decomposed by the variational mode decomposition algorithm to obtain the predicted value of the data sharing API call amount.
[0049] In a third aspect, the present application provides a data sharing API call volume prediction device, including a processor and a memory, wherein the processor is connected to the memory:
[0050] Wherein, the processor is used to call and execute the program stored in the memory;
[0051] The memory is used to store the program, and the program is at least used to execute any of the data sharing API call volume prediction methods described above.
[0052] The beneficial effects of the present invention are:
[0053] This application first obtains data on the amount of data sharing API calls, uses a variational mode decomposition method to decompose the sequence of the data sharing API call amount data, divides the subsequences decomposed by the variational mode decomposition algorithm into training samples and test samples and normalizes them, then uses an improved particle swarm algorithm to optimize the hyperparameters of the CNN-LSTM model, reconstructs the CNN-LSTM model using the optimal hyperparameters, and uses training samples for training and test samples for prediction. Finally, the subsequences decomposed by the variational mode decomposition algorithm are input into the CNN-LSTM model for prediction, and the prediction results of the subsequences decomposed by the variational mode decomposition algorithm are superimposed to obtain the predicted value of the data sharing API call amount. In this application, the VMD algorithm is used to decompose the time series of the original call volume to reduce the instability of the data, the strong random volatility, and enhance the prediction effect of the model. In the face of the problem of weak feature extraction ability and low prediction accuracy of a single model, the convolutional neural network (CNN) and the long short-term memory (LSTM) are combined to enhance the ability to extract sequence features and improve the sequence prediction accuracy. The improved particle swarm algorithm is used to improve the global and local search capabilities of particles at different stages of the iteration process, and to enhance the ability to search for the best hyperparameters of the CNN-LSTM prediction model, thereby improving the prediction accuracy and generalization, which is suitable for the prediction task of the data sharing API call volume in large sample scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0055] Figure 1 It is a flowchart provided by an embodiment of a method for predicting the call volume of a data sharing API of the present invention;
[0056] Figure 2It is a structural schematic diagram provided by an embodiment of a data sharing API call volume prediction device of the present invention;
[0057] Figure 3 It is a structural diagram provided by an embodiment of a data sharing API call volume prediction device of the present invention. DETAILED DESCRIPTION
[0058] To make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described in detail below. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other implementation methods obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.
[0059] Figure 1 This is a flowchart provided by an embodiment of a method for predicting the amount of calls to a data sharing API in the present invention. Figure 1 , this embodiment may include the following steps:
[0060] S1. Obtain data sharing API call volume data;
[0061] S2, using variational mode decomposition method to decompose the sequence of data sharing API call volume data;
[0062] S3, dividing the subsequences decomposed by the variational mode decomposition algorithm into training samples and test samples and performing normalization processing;
[0063] S4. Use improved particle swarm algorithm to optimize the hyperparameters of CNN-LSTM model;
[0064] S5. Reconstruct the CNN-LSTM model using the optimal hyperparameters, and use the training samples for training and the test samples for prediction;
[0065] S6. Input the subsequence obtained by the variational mode decomposition algorithm into the CNN-LSTM model for prediction, and superimpose the prediction results of the subsequence obtained by the variational mode decomposition algorithm to obtain the predicted value of the data sharing API call volume.
[0066] It can be understood that this embodiment first obtains data on the amount of data sharing API calls, uses a variational mode decomposition method to decompose the sequence of the data sharing API call amount data, divides the subsequences decomposed by the variational mode decomposition algorithm into training samples and test samples and normalizes them, then uses an improved particle swarm algorithm to optimize the hyperparameters of the CNN-LSTM model, reconstructs the CNN-LSTM model using the optimal hyperparameters, and uses training samples for training and test samples for prediction. Finally, the subsequences decomposed by the variational mode decomposition algorithm are input into the CNN-LSTM model for prediction, and the prediction results of the subsequences decomposed by the variational mode decomposition algorithm are superimposed to obtain the predicted value of the data sharing API call amount. In this embodiment, the VMD algorithm is used to decompose the time series of the original call volume to reduce the instability of the data, the strong random volatility, and enhance the prediction effect of the model. In the face of the problem that the single model has weak feature extraction ability and low prediction accuracy, the convolutional neural network (CNN) and the long short-term memory (LSTM) are combined to enhance the ability to extract sequence features and improve the sequence prediction accuracy. The improved particle swarm algorithm is used to improve the global and local search capabilities of particles at different stages of the iteration process, and to enhance the ability to search for the best hyperparameters of the CNN-LSTM prediction model, thereby improving the prediction accuracy and generalization, which is suitable for the prediction task of the data sharing API call volume in large sample scenarios.
[0067] Preferably, step S1 comprises:
[0068] According to the access logs of the data center server, the system access volume per unit time within a fixed time interval is obtained;
[0069] The missing values of the system access volume in each unit time are filled in nearby to form preprocessed time series data.
[0070] It can be understood that, according to the access logs of the data center server, the system access volume of each unit time in a fixed time interval is obtained, and the missing values of the original data are filled in nearby to form a preprocessed time series sample.
[0071] Preferably, step S2 comprises:
[0072] Input the time series data into the VMD algorithm and set the number of modes and their initial modal components and center frequencies;
[0073] Iterate the VMD algorithm and update the modal components and center frequencies. After each iteration, check the VMD algorithm to confirm whether the convergence conditions have been met.
[0074] If so, the VMD algorithm will generate updated modal components and frequency outputs, thereby obtaining a subsequence of the data sharing API call volume data sequence.
[0075] It is understandable that the acquired data-sharing API access data is non-stationary, highly volatile, and indirect. The EMD and EEMD decomposition algorithms cannot effectively handle the modal aliasing phenomenon. In order to reduce the complexity of the model and better fit the prediction model, the VMD algorithm with high-intensity noise reduction characteristics is used to decompose the data sharing API call sequence. VMD can extract multi-scale features in the data, effectively decompose the complexity of the original sequence into multiple sub-sequences to capture components of different frequencies and important modal information, which helps to more comprehensively capture changes and trends on different time scales to obtain relatively stable sub-sequences.
[0076] The process of using the VMD algorithm to process the data sharing API call sequence is as follows:
[0077] First, the original data sharing API call sequence is input, and the number of modes N and its initial modal components and center frequencies are set. In each iteration, the modal components and center frequencies are updated according to a specific formula. After each round of iteration, the algorithm is checked to confirm whether the convergence conditions have been met. Once the algorithm meets the convergence conditions, the variational mode decomposition (VMD) algorithm will generate updated modal components and frequency outputs to obtain N IMFs (sub-modes) of the data sharing API call sequence.
[0078] Among them, the working principle of VMD model is:
[0079] VMD decomposes the signal into a set of local vibration modes through a variational inference method. These modes contain multiple frequency components, each corresponding to a specific center frequency and finite bandwidth. The constrained variational model is:
[0080]
[0081] Where: and are the sets of the kth modal component and center frequency after decomposition; is the pulse function; is an imaginary unit; is the modal function; k is the number of modes obtained by decomposition; t is the number of sampling points.
[0082] When solving the variational problem, the Lagrangian multiplier λ and the quadratic penalty factor α are introduced to make the variational problem an unconstrained problem, which is converted into an augmented Lagrangian function. The constructed augmented Lagrangian function is expressed as follows:
[0083]
[0084] The alternating multiplier method is used to iteratively solve the modal function IMF component and its corresponding center frequency. Through the above steps, the variational mode decomposition of the original signal is completed.
[0085] Preferably, step S3 includes: taking the first 70% of the subsequence of the data sharing API call volume data sequence as training samples, and the last 30% as test samples;
[0086] The training samples and test samples are normalized by calculation formula.
[0087] It is understandable that the first 70% of each modal component data set is used as training samples, and the last 30% is used as test samples. In order to reduce the interference of abnormal data on prediction, accelerate the convergence speed of the prediction model, avoid gradient disappearance and gradient explosion, and further improve the generalization ability of the model, the training set and test set are normalized.
[0088] The calculation formula for normalization is as follows:
[0090] x R is the normalized value; x is the modal component after decomposition of the data sharing API call volume; x max and x min Represent the maximum and minimum values of the corresponding indicators respectively.
[0091] The prediction step of the model is set to 12, and each modal component data set is divided into two parts, one part is the input of the model, and the other part is the output result of the model.
[0092]
[0093] Where X is the model input, and Y is the actual value corresponding to the corresponding model prediction; each row in X represents the data sharing API call volume in the first 12 time units, and each row in Y corresponds to the data sharing API call volume in the 13th time unit, representing the value to be predicted.
[0094] Preferably, step S4 comprises:
[0095] Determine the range of parameters to be optimized, including: learning rate, time step, batch size, and number of hidden layer neurons;
[0096] Determine the population size, number of iterations, learning factor, position and speed of the initial particles of the particle swarm algorithm, and use the mean square error of the CNN-LSTM model as the fitness function;
[0097] Calculate the fitness of each particle and update the speed and position of each particle;
[0098] Update the individual optimal fitness and position of each particle, and the historical optimal fitness and position of the group;
[0099] Determine whether the maximum number of iterations has been reached. If so, output the parameters corresponding to the historical optimal fitness value of the group;
[0100] If not, continue to calculate the fitness of each particle and update the speed and position of each particle.
[0101] It is understandable that the range of parameters to be optimized is first determined. In this application, the objects that need to determine the parameter range are the learning rate, time step, batch size, and number of hidden layer neurons of the prediction model; secondly, the population size, number of iterations, learning factor, and position and speed of the initialized particles of the particle swarm algorithm are determined. The mean square error predicted by the model is used as the fitness function. The fitness of each particle is calculated, and the speed and position of each particle are updated; the individual optimal fitness and position of each particle, and the historical optimal fitness and position of the group are updated. Determine whether the maximum number of iterations has been reached. If not, return to continue calculating the fitness of each particle; if the conditions are met, the optimization process ends and the parameters corresponding to the historical optimal fitness value of the group are output.
[0102] The fitness function δ is defined as follows:
[0103]
[0104] Where n is the test sample size, y i is the actual value, y′ i is the predicted value.
[0105] The update formula for the position and velocity of the i-th particle is as follows:
[0106] in, represents the velocity of the ith particle after t+1 iterations, is the position of the ith particle after t+1 iterations, , They are individual learning factor and group learning factor, , is a random number, is the optimal position of particle i at time t, is the optimal position of the particle population at time t, is the particle position at time t, ω is the inertia factor, and its value is non-negative. A larger ω is conducive to global search and escapes from local extremes; a smaller ω is conducive to local search and allows the algorithm to converge quickly to the optimal solution.
[0108] The improved particle swarm algorithm updates ω so that the particle swarm algorithm has stronger global convergence ability in the early stage and stronger local convergence ability in the later stage.
[0109] The update of ω is performed according to the following formula:
[0110] Where k is a constant, and its value is ; t represents the current number of iterations, T represents the maximum number of iterations, It means that the minimum value of ω is 0.3.
[0112] Preferably, step S5 includes:
[0113] Reconstruct the CNN-LSTM model according to the parameters corresponding to the historical optimal fitness value of the group;
[0114] The CNN-LSTM model is trained using training samples and predicted using test samples.
[0115] Preferably, step S6 comprises:
[0116] Input the subsequence of the data sharing API call volume data sequence into the CNN-LSTM model;
[0117] The spatial features of the subsequences of the data sharing API call volume data sequence are extracted through the CNN layer in the CNN-LSTM model, and the subsequences of the data sharing API call volume data sequence are flattened through the flattening layer. The temporal features of the subsequences of the data sharing API call volume data sequence are extracted through the LSTM layer composed of multiple hidden layers.
[0118] The predicted value of the subsequence of the data sharing API call volume data sequence is output through the fully connected layer in the CNN-LSTM model;
[0119] The predicted values of the subsequences of all data sharing API call volume data sequences are denormalized and summed up to obtain the predicted value of the data sharing API call volume.
[0120] It can be understood that CNN-LSTM is constructed based on the optimal hyperparameters of the output. First, the feature extraction capability of CNN is used to extract the features of the time series, and then the features are input into LSTM to further predict the results. First, the input data passes through the CNN layer composed of a one-dimensional convolution layer to extract the spatial features of the data; then it is flattened through the flattening layer; the temporal features of the data are extracted through the LSTM layer composed of multiple hidden layers, and finally the prediction value is output through the fully connected layer;
[0121] The convolution layer in CNN performs convolution operation by sliding the convolution kernel on the input data to extract high-level features from the input data. The convolution operation formula is as follows:
[0122]
[0123] The core unit of the LSTM model consists of three gates and a memory unit. The flow of information is controlled by weight learning so that the model can remember or forget previous messages.
[0124] Forget gate calculation formula: f t =σ(W fh h t-1 +W fh x t +b f )
[0125] where f t is the forget gate, W fh is the weight matrix of the forget gate, b f Bias for the forget gate
[0126] Input gate calculation formula: i t =σ(W ih h t-1 +W ix x t +b i )
[0127] where i t is the input gate, W ih is the weight matrix of the input gate, b i is the bias of the input gate, It is the update status of time memory cells.
[0128] Cell state update formula:
[0129] where c t is the output of the time memory cell at time t
[0130] Output gate calculation formula: t =σ(W oh h t-1 +W ox x t +b o )h t =o t ·tanh(c t )
[0131] Among them t is the input gate, W oh is the weight matrix of the output gate, b ois the bias of the output gate.
[0132] The CNN-LSTM prediction model outputs the prediction results of each subsequence, denormalizes the prediction results of all modal components, and sums them up to obtain the final result of the data sharing API call volume prediction.
[0133] Preferably, it also includes:
[0134] The prediction effect of the CNN-LSTM model was evaluated by using mean square error, mean absolute error, mean absolute percentage error and determination coefficient as evaluation indicators.
[0135] It can be understood that the mean square error calculation formula is as follows:
[0136]
[0137] The mean absolute error is calculated as follows:
[0138]
[0139] The mean absolute percentage error is calculated as follows:
[0140]
[0141] The formula for calculating the coefficient of determination is as follows:
[0142]
[0143] The present invention also provides a data sharing API call volume prediction device for implementing the above method embodiment. Figure 2 1 is a schematic diagram of a structure provided by an embodiment of a data sharing API call volume prediction device of the present invention. Figure 2 As shown, including:
[0144] Data acquisition module 1, used to obtain data sharing API call volume data;
[0145] The sequence decomposition module 2 is used to decompose the sequence of the data sharing API call volume data by using the variational mode decomposition method;
[0146] A preprocessing module 3 is used to divide the subsequences decomposed by the variational mode decomposition algorithm into training samples and test samples and perform normalization processing;
[0147] Model improvement module 4, used to optimize the hyperparameters of the CNN-LSTM model using an improved particle swarm algorithm;
[0148] Model training module 5, used to reconstruct the CNN-LSTM model using optimal hyperparameters, and use training samples for training and test samples for prediction;
[0149] Prediction module 6 is used to input the subsequence obtained by the variational mode decomposition algorithm into the CNN-LSTM model for prediction, and superimpose the prediction results of the subsequence obtained by the variational mode decomposition algorithm to obtain the predicted value of the data sharing API call volume.
[0150] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0151] The present invention also provides a data sharing API call volume prediction device for implementing the above method embodiment. Figure 3 1 is a schematic diagram of a structure provided by an embodiment of a data sharing API call volume prediction device of the present invention. Figure 3 As shown, the data sharing API call volume prediction device of this embodiment includes a processor 21 and a memory 22, and the processor 21 is connected to the memory 22. The processor 21 is used to call and execute the program stored in the memory 22; the memory 22 is used to store the program, and the program is at least used to execute the data sharing API call volume prediction method in the above embodiment.
[0152] The specific implementation scheme of the data sharing API call volume prediction device provided in the embodiment of the present application can refer to the implementation scheme of the data sharing API call volume prediction method in any of the above embodiments, which will not be repeated here.
[0153] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.
[0154] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" refers to at least two.
[0155] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.
[0156] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0157] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0158] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0159] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0160] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0161] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A method for predicting the amount of calls to a data sharing API, characterized in that: include: Get data sharing API call volume data; Decomposing the sequence of the data sharing API call volume data by using a variational mode decomposition method; Dividing the subsequences decomposed by the variational mode decomposition algorithm into training samples and test samples and performing normalization processing; Use improved particle swarm algorithm to optimize the hyperparameters of CNN-LSTM model; Reconstructing the CNN-LSTM model using optimal hyperparameters, and using the training samples for training, and the test samples for prediction; The subsequences decomposed by the variational mode decomposition algorithm are input into the CNN-LSTM model for prediction, and the prediction results of the subsequences decomposed by the variational mode decomposition algorithm are superimposed to obtain the predicted value of the data sharing API call amount.
2. The method according to claim 1, characterized in that The obtaining of data sharing API call volume data includes: According to the access logs of the data center server, the system access volume per unit time within a fixed time interval is obtained; The missing values of the system access volume of each unit time are filled in nearby to form preprocessed time series data.
3. The method according to claim 2, characterized in that The step of using a variational mode decomposition method to decompose the sequence of the data sharing API call volume data includes: Input the time series data into the VMD algorithm, and set the number of modes and their initial modal components and center frequencies; Iterate the VMD algorithm and update the modal components and center frequencies. After each iteration, check the VMD algorithm to confirm whether the convergence condition has been met. If so, the VMD algorithm will generate updated modal components and frequency outputs, thereby obtaining a subsequence of the data sharing API call volume data sequence.
4. The method according to claim 3, characterized in that The step of dividing the subsequences decomposed by the variational mode decomposition algorithm into training samples and test samples and performing normalization processing includes: The first 70% of the subsequence of the data sharing API call volume data sequence is used as training samples, and the last 30% is used as test samples; The training samples and the test samples are normalized by a calculation formula.
5. The method according to claim 4, characterized in that The use of the improved particle swarm algorithm to optimize the hyperparameters of the CNN-LSTM model includes: Determine the range of parameters to be optimized, including: learning rate, time step, batch size, and number of hidden layer neurons; Determine the population size, number of iterations, learning factor, position and speed of the initialized particles of the particle swarm algorithm, and use the mean square error of the CNN-LSTM model as the fitness function; Calculate the fitness of each particle and update the speed and position of each particle; Update the individual optimal fitness and position of each particle, and the historical optimal fitness and position of the group; Determine whether the maximum number of iterations has been reached. If so, output the parameters corresponding to the historical optimal fitness value of the group; If not, continue to calculate the fitness of each particle and update the speed and position of each particle.
6. The method according to claim 5, characterized in that The step of reconstructing the CNN-LSTM model using the optimal hyperparameters, training using the training samples, and predicting the test samples includes: Reconstructing the CNN-LSTM model according to the parameters corresponding to the historical optimal fitness value of the group; The CNN-LSTM model is trained using the training samples, and prediction is performed using the test samples.
7. The method according to claim 6, characterized in that The subsequences decomposed by the variational mode decomposition algorithm are input into the CNN-LSTM model for prediction, and the prediction results of the subsequences decomposed by the variational mode decomposition algorithm are superimposed to obtain the predicted value of the data sharing API call amount, including: Inputting a subsequence of the data sharing API call volume data sequence into the CNN-LSTM model; The spatial features of the subsequences of the data sharing API call volume data sequence are extracted through the CNN layer in the CNN-LSTM model, the flattening process is performed through the flattening layer, and the temporal features of the subsequences of the data sharing API call volume data sequence are extracted through the LSTM layer composed of multiple hidden layers; Outputting predicted values of subsequences of the data sharing API call volume data sequence through the fully connected layer in the CNN-LSTM model; The predicted values of all subsequences of the data sharing API call volume data sequence are denormalized and summed up to obtain the predicted value of the data sharing API call volume.
8. The method according to claim 7, characterized in that Also includes: The prediction effect of the CNN-LSTM model was evaluated by using mean square error, mean absolute error, mean absolute percentage error and coefficient of determination as evaluation indicators.
9. A data sharing API call volume prediction device, characterized in that: include: Data acquisition module, used to obtain data sharing API call volume data; A sequence decomposition module, used to decompose the sequence of the data sharing API call volume data by using a variational mode decomposition method; A preprocessing module, used for dividing the subsequences decomposed by the variational mode decomposition algorithm into training samples and test samples and performing normalization processing; Model improvement module, used to optimize the hyperparameters of the CNN-LSTM model using an improved particle swarm algorithm; A model training module, used to reconstruct the CNN-LSTM model using optimal hyperparameters, and use the training samples for training and the test samples for prediction; The prediction module is used to input the subsequences decomposed by the variational mode decomposition algorithm into the CNN-LSTM model for prediction, and superimpose the prediction results of the subsequences decomposed by the variational mode decomposition algorithm to obtain the predicted value of the data sharing API call amount.
10. A data sharing API call volume prediction device, characterized in that: The invention comprises a processor and a memory, wherein the processor is connected to the memory: Wherein, the processor is used to call and execute the program stored in the memory; The memory is used to store the program, and the program is at least used to execute the data sharing API call volume prediction method described in any one of claims 1-8.
Citation Information
Patent Citations
Oil well yield prediction method based on PSO-VMD-LSTM
CN117009758A
Software-defined network routing algorithm based on segmented routing strategy and application
CN110417652A
Network flow multi-step prediction method based on VMD and LSTM
CN111277434A
Construction method of short-term electricity price prediction model, short-term electricity price prediction method, computer readable medium and electronic equipment
CN115760213A
Scheduling method and device for power distribution area
CN116911579A