Resource allocation method and device, computer equipment and storage medium

By obtaining traffic prediction results and historical data of each service, determining the traffic trigger type and formulating resource allocation plans, the problem of poor flexibility in business resource allocation in the existing technology is solved, and business stability and resource utilization are improved.

CN120045909APending Publication Date: 2025-05-27INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410452685.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-16
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

The existing technology has poor flexibility in allocating business resources and is unable to adapt to instantaneous changes in traffic, resulting in business instability or waste of resources.

Method used

By obtaining the traffic prediction results of each service, determining the traffic trigger type, and determining the target resource allocation plan based on the type, achieving flexible allocation of business resources.

Benefits of technology

Improve the flexibility and accuracy of business resource allocation, and enhance business stability and resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045909A_ABST
    Figure CN120045909A_ABST
Patent Text Reader

Abstract

The invention relates to a resource allocation method and device, computer equipment and a storage medium, belongs to the technical field of artificial intelligence, and relates to the field of financial science and technology or other related fields. The method comprises the following steps: acquiring a traffic prediction result of each service; for any service, if the traffic prediction result of the service meets a resource allocation condition of the service, acquiring historical traffic data of the service, and determining a traffic triggering type according to the historical traffic data and the traffic prediction result of the service; and determining a target resource allocation scheme according to the traffic trigger type, and performing resource allocation of each service based on the target resource allocation scheme. By adopting the method, the flexibility and accuracy of resource allocation can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and particularly to a resource allocation method, apparatus, computer device, storage medium, and computer program product. Background Art

[0002] With the rapid development of the mobile Internet, traditional business forms have changed quietly, and original businesses such as sales, channels, and customer service have gradually shifted online. Allocating business resources according to user needs has become a popular trend.

[0003] Currently, the way to allocate business resources is to obtain the business type corresponding to the business and directly determine the resource allocation method according to the business type. For example, if the business type is A, the business resources to be allocated are fixed as a, and if the business type is B, the business resources to be allocated are fixed as b. When the business has an instantaneous influx or reduction in traffic due to specific reasons, it cannot be adjusted accordingly, and the flexibility of business resource allocation is poor, resulting in problems such as business instability or resource waste. Summary of the Invention

[0004] Based on this, in view of the above technical problems, it is necessary to provide a resource allocation method, apparatus, computer device, and storage medium that can improve the flexibility of business resource allocation.

[0005] In a first aspect, the present application provides a resource allocation method, and the method includes:

[0006] Obtain the traffic prediction results of each business;

[0007] For any one of the businesses, if the traffic prediction result of the business meets the resource allocation condition of the business, obtain the historical traffic data of the business, and determine the traffic trigger type according to the historical traffic data and the traffic prediction result of the business;

[0008] Determine the target resource allocation plan according to the traffic trigger type, and perform resource allocation for each business based on the target resource allocation plan.

[0009] In one embodiment, the determining the traffic trigger type according to the historical traffic prediction result and the traffic prediction result of the business includes:

[0010] When the historical traffic data and the traffic prediction result of the business have a periodic pattern, determine that the traffic trigger type is a periodic type; or,

[0011] When the historical traffic data and the traffic prediction result of the business do not have a periodic pattern, determine that the traffic trigger type is a burst type.

[0012] In one embodiment, the determining the target resource allocation scheme according to the traffic trigger type includes:

[0013] If the traffic trigger type is the periodic type, obtain the historical resource allocation scheme of the previous period;

[0014] Determine the target resource allocation scheme according to the historical resource allocation scheme.

[0015] In one embodiment, the determining the target resource allocation scheme according to the traffic trigger type includes:

[0016] If the traffic trigger type is the burst type, determine the target resource allocation scheme based on the service priorities of each service and the traffic prediction results of each service.

[0017] In one embodiment, the determining the target resource allocation scheme based on the service priorities of each service and the traffic prediction results of each service includes:

[0018] Take the services whose traffic prediction results meet the resource allocation conditions of the service as the first target services, and determine the traffic change trend based on the traffic prediction results of the first target services;

[0019] Determine the second target services from each service according to the priorities of each service;

[0020] Generate a target resource allocation scheme according to the traffic prediction results of the first target services, the traffic prediction results of each second target service, the first resources corresponding to the first target services, the second resources corresponding to each second target service, and the traffic change trend.

[0021] In one embodiment, the obtaining the traffic prediction results of each service includes:

[0022] For any service, obtain the network traffic time series data of the service, and use the modal decomposition algorithm to extract features from the network traffic time series data to obtain multiple network traffic subsequences;

[0023] After normalizing each network traffic subsequence of each service, input them into the network traffic prediction models corresponding to each service for traffic prediction processing to obtain the traffic prediction results of each service.

[0024] In one embodiment, the using the modal decomposition algorithm to extract features from the network traffic time series data to obtain multiple network traffic subsequences includes:

[0025] Determine a plurality of extreme points from the network traffic time series data, where the extreme points include maximum points and minimum points;

[0026] Fit a first envelope line according to the plurality of maximum points, and fit a second envelope line according to the plurality of minimum points, and determine a one-dimensional mean function according to the network traffic time series data, the first envelope line, and the second envelope line;

[0027] Determine a one-dimensional residual function according to the network traffic time series data and the one-dimensional mean function;

[0028] If the one-dimensional residual function does not meet the conditions to become an intrinsic mode function, then use the one-dimensional residual function as the new network traffic time series data, and jump to the step of determining a plurality of extreme points from the network traffic time series data. Otherwise, use the one-dimensional residual function as the network traffic subsequence, remove the one-dimensional residual function from the network traffic time series data, and jump to the step of determining a plurality of extreme points from the network traffic time series data until the network traffic time series data meets the stop condition, and obtain a plurality of network traffic subsequences.

[0029] In one embodiment, the method further includes:

[0030] During the training process of the network traffic prediction model, use the Tianying optimization algorithm to optimize the hyperparameters of the network traffic prediction model.

[0031] In a second aspect, the present application also provides a resource allocation device, and the device includes:

[0032] An acquisition module, configured to acquire the traffic prediction results of each service;

[0033] A determination module, configured to, for any one of the services, if the traffic prediction result of the service meets the resource allocation condition of the service, then acquire the historical traffic data of the service, and determine the traffic trigger type according to the historical traffic data and the traffic prediction result of the service;

[0034] A resource allocation module, configured to determine a target resource allocation scheme according to the traffic trigger type, and perform resource allocation for each service based on the target resource allocation scheme.

[0035] In one embodiment, the determination module is further configured to:

[0036] When the historical traffic data of the service and the traffic prediction result of the service have a periodic pattern, determine that the traffic trigger type is a periodic type; or,

[0037] When the historical traffic data of the service and the traffic prediction result of the service do not have a periodic pattern, determine that the traffic trigger type is the burst type.

[0038] In one embodiment, the resource allocation module is further configured to:

[0039] If the traffic trigger type is the periodic type, obtain the historical resource allocation plan of the previous period;

[0040] Determine the target resource allocation plan according to the historical resource allocation plan.

[0041] In one embodiment, the resource allocation module is further configured to:

[0042] If the traffic trigger type is the burst type, determine the target resource allocation plan based on the service priorities of the services and the traffic prediction results of the services.

[0043] In one embodiment, the resource allocation module is further configured to:

[0044] Take the service whose traffic prediction result meets the resource allocation condition of the service as the first target service, and determine the traffic change trend based on the traffic prediction result of the first target service;

[0045] Determine the second target service from the services according to the priorities of the services;

[0046] Generate a target resource allocation plan according to the traffic prediction result of the first target service, the traffic prediction results of the second target services, the first resources corresponding to the first target service, the second resources corresponding to the second target services, and the traffic change trend.

[0047] In one embodiment, the acquisition module is further configured to:

[0048] For any service, obtain the network traffic time series data of the service, and use the modal decomposition algorithm to extract features from the network traffic time series data to obtain multiple network traffic subsequences;

[0049] After normalizing the network traffic subsequences of the services, input them into the network traffic prediction models corresponding to the services respectively for traffic prediction processing to obtain the traffic prediction results of the services.

[0050] In one embodiment, the acquisition module is further configured to:

[0051] Determine multiple extreme points from the network traffic time series data, where the extreme points include maximum points and minimum points;

[0052] A first envelope line is fitted based on the multiple maximum points, a second envelope line is fitted based on the multiple minimum points, and a one-dimensional mean function is determined based on the network traffic time series data, the first envelope line, and the second envelope line.

[0053] A one-dimensional residual function is determined based on the network traffic time series data and the one-dimensional mean function.

[0054] If the one-dimensional residual function does not meet the conditions for becoming an intrinsic mode function, the one-dimensional residual function is used as the new network traffic time series data, and the process jumps to the step of determining multiple extreme points from the network traffic time series data. Otherwise, the one-dimensional residual function is used as a network traffic subsequence, the one-dimensional residual function is removed from the network traffic time series data, and the process jumps to the step of determining multiple extreme points from the network traffic time series data until the network traffic time series data meets the stop condition, and multiple network traffic subsequences are obtained.

[0055] In one embodiment, the device further includes:

[0056] An optimization module, configured to optimize the hyperparameters of the network traffic prediction model by using the Tianying optimization algorithm during the training process of the network traffic prediction model.

[0057] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements any one of the above resource allocation methods.

[0058] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements any one of the above resource allocation methods.

[0059] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, it implements any one of the above resource allocation methods.

[0060] The above resource allocation method, device, computer device, and storage medium can obtain the traffic prediction results of each service. For any service, if the traffic prediction result of the service meets the resource allocation condition of the service, the historical traffic data of the service is obtained, and based on the historical traffic data and the traffic prediction result of the service, the traffic trigger type is determined. Then, based on the traffic trigger type, the target resource allocation scheme is determined, and the resource allocation of each service is performed based on the target resource allocation scheme. Based on the resource allocation method, device, computer device, and storage medium provided in the embodiments of the present disclosure, by predicting the traffic of each service and performing the resource allocation of the service based on the traffic prediction result, the resource allocation of the service traffic can be flexibly performed, and based on the traffic trigger type corresponding to the traffic prediction result, the target resource allocation scheme can be further improved, the flexibility and accuracy of the service traffic allocation can be improved, thereby improving the service stability and resource utilization rate. Description of the Drawings

[0061] Figure 1 It is a schematic flowchart of the resource allocation method in an embodiment;

[0062] Figure 2 It is a schematic flowchart of step 106 in an embodiment;

[0063] Figure 3 It is a schematic flowchart of the resource allocation method in an embodiment;

[0064] Figure 4 It is a schematic flowchart of step 102 in another embodiment;

[0065] Figure 5 It is a schematic flowchart of step 402 in an embodiment;

[0066] Figure 6 It is a schematic structural diagram of the BiGRU network structure in an embodiment;

[0067] Figure 7 It is a schematic diagram of the resource allocation method in an embodiment;

[0068] Figure 8 It is a schematic diagram of the resource allocation method in an embodiment;

[0069] Figure 9 It is a schematic diagram of the resource allocation method in an embodiment;

[0070] Figure 10 It is a schematic diagram of the resource allocation method in an embodiment;

[0071] Figure 11 It is a schematic block diagram of the resource allocation device in an embodiment;

[0072] Figure 12Internal structure diagram of a computer device in an embodiment. Detailed implementation manners

[0073] To make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0074] In one embodiment, as Figure 1 shown, a resource allocation method is provided. In the embodiment, the method is described by taking the application of the method to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0075] Step 102, obtain the traffic prediction results of each service.

[0076] In the embodiments of the present disclosure, the traffic prediction of each service can be performed through a pre-trained traffic prediction model. Exemplarily, corresponding traffic prediction models can be trained for each service respectively. For any service, the service data and / or traffic data of the service can be obtained, and the service data and / or traffic data of the service can be predicted by using the traffic prediction model corresponding to the service to obtain the traffic prediction results of each service.

[0077] It should be noted that in the embodiments of the present disclosure, no specific limitation is imposed on the traffic prediction method for services, and any prediction method can be applicable to the embodiments of the present disclosure.

[0078] Step 104, for any service, if the traffic prediction result of the service meets the resource allocation condition of the service, obtain the historical traffic data of the service, and determine the traffic trigger type according to the historical traffic data and the traffic prediction result of the service;

[0079] In the embodiments of the present disclosure, taking one service as an example, when the traffic prediction result of the service meets the resource allocation condition of the service, the historical traffic data of the service can be obtained, and the traffic trigger type can be determined according to the historical traffic data and the traffic prediction result of the service, where the traffic trigger type can include a burst type and a periodic type.

[0080] Exemplarily, the resource allocation condition of the service can include a first condition and a second condition. The first condition can include that the traffic prediction result of the service is less than the first traffic threshold corresponding to the service, and the second condition can include that the traffic prediction result is greater than the second traffic threshold corresponding to the service, where the first traffic threshold is less than the second traffic threshold.

[0081] In an exemplary embodiment, in step 104, determining a traffic trigger type according to the historical traffic prediction result and the traffic prediction result of the service includes:

[0082] When the historical traffic data of the service and the traffic prediction result of the service have a periodic pattern, determining that the traffic trigger type is a periodic type; or, when the historical traffic data of the service and the traffic prediction result of the service do not have a periodic pattern, determining that the traffic trigger type is a burst type.

[0083] In the embodiments of the present disclosure, when it is determined that the traffic prediction result of the service meets the resource allocation condition, the historical traffic data of the service within a historical specified time period (for example, within one month from the current time) is obtained, and whether the traffic prediction result of the current service has a periodic pattern is analyzed based on the historical traffic data. When it is determined that the traffic prediction result of the service has a periodic pattern, determining that the traffic trigger type is a periodic type, that is, the current traffic change is due to a periodic event brought about by the service attribute; conversely, if it is determined that the traffic prediction result of the service does not have a periodic pattern, determining that the traffic trigger type is a burst type, that is, the current traffic change is not a periodic event brought about by the service attribute and belongs to an accidental burst event.

[0084] Step 106, determining a target resource allocation plan according to the traffic trigger type, and performing resource allocation for each service based on the target resource allocation plan.

[0085] In the embodiments of the present disclosure, different traffic trigger types correspond to different service situations, and the determination methods of the corresponding target resource allocation plans are different, and the obtained target resource allocation plans are also different. Therefore, the target resource allocation plan can be determined based on the traffic trigger type, and the corresponding target resource allocation plan can be used to perform resource allocation for the service.

[0086] The resource allocation method provided by the embodiments of the present disclosure can obtain the traffic prediction results of each service. For any service, if the traffic prediction result of the service meets the resource allocation condition of the service, the historical traffic data of the service is obtained, and the traffic trigger type is determined according to the historical traffic data and the traffic prediction result of the service. Then, the target resource allocation plan is determined according to the traffic trigger type, and resource allocation for each service is performed based on the target resource allocation plan. Based on the resource allocation method provided by the embodiments of the present disclosure, by performing traffic prediction on each service and performing resource allocation for the service based on the traffic prediction result, the resource allocation of service traffic can be flexibly performed, and the target resource allocation plan can be based on the traffic trigger type corresponding to the traffic prediction result, which can further improve the flexibility and accuracy of service traffic allocation, thereby improving service stability and resource utilization rate.

[0087] In an exemplary embodiment, referring toFigure 2 As shown in Figure 2 , in step 106, determining the target resource allocation scheme according to the traffic trigger type may include:

[0088] Step 202, if the traffic trigger type is a periodic type, obtain the historical resource allocation scheme of the previous period;

[0089] Step 204, determine the target resource allocation scheme according to the historical resource allocation scheme.

[0090] In the embodiments of the present disclosure, since the periodic events brought about by the service attributes are known, corresponding resource allocation schemes can be preset for the periodic events. If the traffic trigger type is a periodic type, it can not only indicate that the current prediction result has a high credibility, but also plan the target resource allocation scheme based on the resource allocation scheme preset for the periodic event by this service.

[0091] Since there may be more than one periodic event of the service, when the traffic trigger type is a periodic type, it is impossible to determine which periodic event the current belongs to, so it is impossible to obtain its corresponding resource allocation scheme. Therefore, in the embodiments of the present disclosure, through the analysis result of this periodic event, the historical resource allocation scheme of the current periodic event occurring in the previous period is obtained, and the target resource allocation scheme of this time is determined based on this historical resource allocation scheme.

[0092] Among them, the historical resource allocation scheme of the previous period may be the historical resource allocation scheme adjusted based on the traffic prediction result and the actual traffic prediction result of the previous period. Exemplarily, the difference between the current traffic prediction result and the service traffic of the previous period can be determined, and the historical resource allocation scheme can be fine-tuned based on this difference (current traffic prediction result) to obtain the target resource allocation scheme. After resource allocation based on the target resource allocation scheme, the target resource allocation scheme can be adjusted based on the actual traffic subsequently to guide the resource allocation of the next period.

[0093] Adopting the resource allocation scheme provided by the embodiments of the present disclosure, when it is determined that the traffic trigger type is a periodic type, the current resource allocation scheme can be determined based on the historical resource allocation scheme, which can reduce the calculation amount in the resource allocation process, reduce the computing power consumption, and improve the resource allocation efficiency.

[0094] In an exemplary embodiment, determining the target resource allocation scheme according to the traffic trigger type may include:

[0095] If the traffic trigger type is a burst type, determine the target resource allocation scheme based on the service priorities of each service and the traffic prediction results of each service.

[0096] In the embodiments of the present disclosure, when the traffic trigger type is a burst type, the priorities of each service can be determined, and based on the service priorities of each service and the traffic prediction results of each service, a target resource allocation plan can be planned. The core of the plan is to prioritize the division of high-priority services to improve the service stability of high-priority services.

[0097] In an exemplary embodiment, referring to Figure 3 as shown, determining the target resource allocation plan based on the service priorities of each service and the traffic prediction results of each service may include:

[0098] Step 302, regarding the service whose traffic prediction result meets the resource allocation condition of the service as the first target service, and determining the traffic change trend based on the traffic prediction result of the first target service;

[0099] Step 304, determining the second target service from each service according to the priority of each service;

[0100] Step 306, generating a target resource allocation plan according to the traffic prediction result of the first target service, the traffic prediction results of each second target service, the first resource corresponding to the first target service, the second resources corresponding to each second target service, and the traffic change trend.

[0101] In the embodiments of the present disclosure, the service whose current traffic prediction result meets the resource allocation condition of the service can be regarded as the first target service, and the second target service can be determined from each service based on the high or low priority of each service relative to the priority of the first target service and the traffic change trend corresponding to the traffic prediction result. Exemplarily, when the traffic change trend of the first target service is an instantaneous influx, at this time, the first target service probably needs to borrow resources from the resources that can be borrowed by other services. The borrowing principle is to give priority to borrowing resources from services with low priorities. Therefore, at this time, the service with a priority lower than the priority of the first target service can be regarded as the second target service. Or, when the traffic change trend of the first target service is an instantaneous decrease, at this time, the first target service probably has idle resources and can be borrowed to other services in need to improve the utilization rate of resources. The borrowing principle is to give priority to allowing services with high priorities to borrow resources. Therefore, at this time, the service with a priority higher than the priority of the first target service can be regarded as the second target service.

[0102] Further, when the traffic change trend of the first target service is an instantaneous influx, the number of resources to be borrowed for the first target service can be determined according to the traffic prediction result of the first target service and the current resource occupancy of the first target service, and based on the traffic prediction result of the second target service and the current resource occupancy of the second target service, the resources that can be borrowed can be determined from each second target service according to the number of resources to be borrowed, and the resources that can be borrowed from each second target service are borrowed to the first target service to obtain the corresponding target resource allocation plan.

[0103] Exemplarily, when the total idle resources of each second target service reach the number of resources to be borrowed, the idle resources with the number of resources to be borrowed can be borrowed to the first target service as the resources that can be borrowed; or, when the total idle resources of each second target service do not reach the number of resources to be borrowed, the difference between the total idle resources and the number of resources to be borrowed can be determined, and the resources to be allocated are determined from each second target service in turn according to a preset ratio in the order of increasing priority. For example, the resources to be allocated are determined from the second target service at a ratio of 1 / 10 in turn until the total amount of the resources to be allocated reaches the difference or the total amount of the resources to be allocated in all second target services does not reach the difference, and the idle resources and the resources to be allocated are borrowed to the first target service as the resources that can be borrowed.

[0104] Further, when the traffic change trend of the first target service is an instantaneous decrease, the resources that can be borrowed for the first target service can be determined according to the traffic prediction result of the first target service and the current resource occupancy of the first target service, and based on the traffic prediction result of the second target service and the current resource occupancy of the second target service, the resource requirements of each second target service can be determined, and the resources that can be borrowed from the first target service are borrowed to each second target service according to the resource requirements of the second target service to obtain the corresponding target resource allocation plan.

[0105] Exemplarily, the resource requirements of each second target service can be determined, and the resources that can be borrowed from the first target service are borrowed to each second target service in turn in the order of decreasing priority until all the resources that can be borrowed are borrowed to each second target service or there is no resource requirement for each second target service.

[0106] By using the resource allocation method provided in the embodiments of the present disclosure, the resources of high-priority services can be guaranteed preferentially, thereby improving the stability of high-priority services.

[0107] In an exemplary embodiment, referring to Figure 4 as shown, in step 102, obtaining the traffic prediction results of each service includes:

[0108] Step 402: For any service, obtain the network traffic time series data of the service, and use the mode decomposition algorithm to extract features from the network traffic time series data to obtain multiple network traffic subsequences;

[0109] Step 404: After normalizing the network traffic subsequences of each service, input them into the network traffic prediction model corresponding to each service for traffic prediction processing to obtain the traffic prediction results of each service.

[0110] In the embodiments of the present disclosure, a corresponding network traffic prediction model is trained in advance for each service. The network traffic time series data of the service (sequence data representing the network traffic at different time nodes) can be obtained, and the mode decomposition algorithm is used to extract features from the network traffic time series data, thereby obtaining multiple network traffic subsequences.

[0111] In an exemplary embodiment, referring to Figure 5 As shown in, in step 402, using the mode decomposition algorithm to extract features from the network traffic time series data to obtain multiple network traffic subsequences includes:

[0112] Step 502: Determine multiple extreme points from the network traffic time series data. The extreme points include maximum points and minimum points;

[0113] Step 504: Fit a first envelope line according to multiple maximum points, and fit a second envelope line according to multiple minimum points, and determine a one-dimensional mean function according to the network traffic time series data, the first envelope line and the second envelope line;

[0114] Step 506: Determine a one-dimensional residual function according to the network traffic time series data and the one-dimensional mean function;

[0115] Step 508: If the one-dimensional residual function does not meet the conditions for becoming an intrinsic mode function, then use the one-dimensional residual function as the new network traffic time series data, and jump to the step of determining multiple extreme points from the network traffic time series data. Otherwise, use the one-dimensional residual function as the network traffic subsequence, and remove the one-dimensional residual function from the network traffic time series data, and jump to the step of determining multiple extreme points from the network traffic time series data until the network traffic time series data meets the stop condition, and obtain multiple network traffic subsequences.

[0116] In the embodiments of the present disclosure, first, extreme points are determined from the network traffic time series data, and local maximum points and local minimum points are found from the network traffic time series data. By interpolating the data between the extreme points, upper and lower envelope lines are obtained, including obtaining a first envelope line by interpolating the maximum points and obtaining a second envelope line by interpolating the minimum points. The average value of the network traffic time series data and the first envelope line and the second envelope line is calculated to obtain a one-dimensional mean function, and the network traffic time series data is subtracted from the one-dimensional mean function to extract local extreme points, obtaining a one-dimensional residual function.

[0117] If the one-dimensional residual function meets the conditions to become an Intrinsic Mode Function (IMF), that is, within the entire data interval, the number of maximum points and minimum points is equal or differs by at most 1, then the one-dimensional residual function is used as a network traffic subsequence, and after removing this network traffic subsequence from the network traffic time series data, the operations in steps 502 to 506 are continued. Conversely, if the one-dimensional residual function does not meet the conditions to become an IMF, then the one-dimensional residual function is used as the new network traffic time series data, and the operations in steps 502 to 506 are repeated. When the new network traffic time series data is a monotonic sequence or less than a threshold, it can be determined that the current stopping condition is met, and thus multiple network traffic subsequences are obtained.

[0118] Since network traffic data has periodicity, seasonality, randomness, and suddenness. Modal decomposition can decompose the network traffic time series into multiple IMFs, and each IMF represents a vibration mode at different scales and frequencies. By using the network traffic subsequences for traffic prediction of services, it is possible to discover and analyze the changing trends of network traffic data, and also capture sudden detailed features, thereby accurately identifying periodic and sudden events of services, improving the accuracy of network traffic prediction, and further improving the accuracy of resource allocation.

[0119] Data normalization is performed on the network traffic subsequences after modal decomposition, and the network traffic subsequences are mapped to the interval [0, 1]. Data normalization can reduce the weight differences between data features and improve the stability and robustness of the prediction model, as shown in formula (1) specifically.

[0120] Formula (1)

[0121] Where X represents the network traffic subsequence, Xmax is the maximum value in the network traffic subsequence, Xmin is the minimum value in the network traffic subsequence, and Xnormalized is the normalized data value.

[0122] In an exemplary embodiment, the method further includes: during the training process of the network traffic prediction model, the Tianying optimization algorithm is used to optimize the hyperparameters of the network traffic prediction model.

[0123] In the embodiments of the present disclosure, the training process of the network traffic prediction model includes:

[0124] The sample traffic time series data is cut into an input sequence and an output target value according to the sliding window method. Initialize the model parameters, including the weight matrix and bias term, etc. Select MSE (mean-square error) as the loss function of the model. Send the input sequence into the BiGRU model through forward propagation, process the input sequence in the forward and reverse directions respectively, obtain the hidden state sequences in two directions, and splice the forward and reverse hidden state sequences together to obtain the bidirectional hidden state at each time step. In the embodiments of the present disclosure, the BiGRU network structure is as Figure 6 shown. The BiGRU unit calculation is shown in Formulas (2) to (5).

[0125] Formula (2)

[0126] Formula (3)

[0127] Formula (4)

[0128] Formula (5)

[0129] Wherein, 、 、 and are the update gate, reset gate, candidate hidden state, and current hidden state respectively, 、 、 are the corresponding weight matrices respectively, and tanh are activation functions, is the input at the current moment, represents element-wise multiplication. For each sequence in the training set, forward propagation is performed at each time step. For each time step, calculate the candidate hidden state 、update gate and reset gate , and update the hidden state at the current time step through the information of these gates.

[0130] Calculate the loss value of the current model according to the loss function; through the backpropagation algorithm, adjust the parameters of the model according to the loss value to minimize the loss value, update the parameters of the model by the gradient descent method to gradually reduce the loss value, and iterate repeatedly until the model training reaches the expectation to obtain the network traffic prediction model.

[0131] In the embodiments of the present disclosure, the Tianying optimization algorithm can be used to optimize the hyperparameters of the BiGRU model. The process is as Figure 7 shown, including: determining that the hyperparameters to be optimized in the BiGRU model are the time window and the number of hidden layer nodes, and then initializing the parameters, including the population size, the maximum number of iterations, the range of hyperparameters, the learning rate, etc. Initialize the positions of the Tianying in the population, and each position contains a set of hyperparameters. Establish and train the BiGRU model according to this position. Take the mean square error function as the fitness function, and calculate the fitness value of each individual. Take the Tianying with the minimum fitness as the optimal individual in the current population. Start iteratively updating the population. Each time an iteration generates a random number rand. When the iteration number t and the maximum iteration number T satisfy t ≤ 2T / 3 and rand < 0.5, update the Tianying position using the high-altitude flight operation in the Tianying optimization algorithm; when the iteration number t and the maximum iteration number T satisfy t ≤ 2T / 3 and rand ≥ 0.5, update the Tianying position using the contour flight operation; when the iteration number t and the maximum iteration number T satisfy t > 2T / 3 and rand < 0.5, update the Tianying position using the low-altitude flight operation; when the iteration number t and the maximum iteration number T satisfy t > 2T / 3 and rand ≥ 0.5, update the Tianying position using the prey capture operation. After the algorithm iteration ends, select the optimal hyperparameters according to the fitness value, and establish the BiGRU model according to the hyperparameters. In the embodiments of the present disclosure, the mean square error function is used as the fitness function, that is, calculate the mean square error of the model as its fitness value, and the lower the error, the lower its fitness value.

[0132] After training the network traffic prediction model, it is possible to predict the network traffic prediction model based on the test set, and denormalize the prediction results of each network traffic subsequence. The denormalization is shown in formula (six).

[0133] Formula (six)

[0134] Among them, Xmax and Xmin are the maximum and minimum values during normalization in formula (one), Xoriginal is the prediction result of the subsequence before denormalization, and X is the prediction result of the subsequence after denormalization. Finally, add up the prediction results of each subsequence to obtain the final prediction result of the network traffic time series data.

[0135] The embodiments of the present disclosure adopt an open traffic dataset, which is collected every five minutes and the unit is Mb. The sample network traffic time series data is as Figure 8 shown. The prediction results of the embodiments of the present disclosure in the test set of this network traffic dataset are as Figure 9 shown. MAE (Mean Absolute Error), RMSE (root-mean-square error), and MAPE (Mean Absolute Percentage Error) are respectively used as evaluation indicators, as shown in Formula (VII), Formula (VIII), and Formula (IX). N is the number of data samples, is the predicted value, is the actual value.

[0136] Formula (VII)

[0137] Formula (VIII)

[0138] Formula (IX).

[0139] Among them, the error comparisons of different models are shown in Table 1.

[0140] Table 1

[0141]

[0142] To enable those skilled in the art to better understand the embodiments of the present disclosure, the following will illustrate the embodiments of the present disclosure through a specific process. Exemplarily, referring to Figure 10 shown, collect network traffic time series data, preprocess the obtained network traffic time series data to obtain multiple network traffic subsequences, use the BiGRU model to model and predict the network traffic subsequences, use the Tianying optimization algorithm to optimize the BiGRU model, use the optimized BiGRU model to predict future network traffic, and perform reconstruction to obtain the final network traffic prediction result.

[0143] In the embodiments of the present disclosure, first, modal decomposition is used for feature extraction to obtain multiple groups of network traffic subsequences. Then, a BiGRU network traffic prediction model is established, and the Tianying optimization algorithm is used to optimize the hyperparameters of the BiGRU model to obtain an EMD-AO-BiGRU prediction model. Finally, this model is used to predict network traffic data. This overcomes the problem of low accuracy in the prediction process of traditional prediction methods. Moreover, modal decomposition is used to extract features from network traffic data, and the Tianying optimization algorithm is used to optimize the hyperparameters of the BiGRU model, avoiding the problem of the model falling into a local optimal solution, improving the prediction convergence speed and accuracy, and finally achieving high-precision prediction of network traffic data.

[0144] It should be understood that although the steps in the flowcharts involved in the above-mentioned embodiments are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the above-mentioned embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least some of the steps or stages in other steps or other steps.

[0145] Based on the same inventive concept, the embodiments of the present application also provide a resource allocation device for implementing the above-mentioned resource allocation method. The implementation solutions provided by this device to solve problems are similar to the implementation solutions recorded in the above method. Therefore, the specific limitations in one or more embodiments of the resource allocation device provided below can refer to the limitations on the resource allocation method in the above text, and will not be repeated here.

[0146] In one embodiment, as Figure 11 shown, a resource allocation device is provided, including: an acquisition module 1102, a determination module 1104, and a resource allocation module 1106, where:

[0147] The acquisition module 1102 is configured to acquire the traffic prediction results of each service;

[0148] The determination module 1104 is configured to, for any one of the services, if the traffic prediction result of the service meets the resource allocation condition of the service, acquire the historical traffic data of the service, and determine the traffic trigger type according to the historical traffic data and the traffic prediction result of the service;

[0149] A resource allocation module 1106, configured to determine a target resource allocation scheme according to the traffic trigger type, and perform resource allocation for each of the services based on the target resource allocation scheme.

[0150] Based on the resource allocation device provided by the embodiments of the present disclosure, by predicting the traffic of each service and performing resource allocation for the service based on the traffic prediction result, the resource allocation of the service traffic can be flexibly performed, and the target resource allocation scheme can be determined based on the traffic trigger type corresponding to the traffic prediction result, which can further improve the flexibility and accuracy of the service traffic allocation, thereby improving the service stability and resource utilization rate.

[0151] In one embodiment, the determining module 1104 is further configured to:

[0152] When the historical traffic data of the service and the traffic prediction result of the service have a periodic pattern, determine that the traffic trigger type is a periodic type; or,

[0153] When the historical traffic data of the service and the traffic prediction result of the service do not have a periodic pattern, determine that the traffic trigger type is a burst type.

[0154] In one embodiment, the resource allocation module 1106 is further configured to:

[0155] If the traffic trigger type is the periodic type, obtain the historical resource allocation scheme of the previous period;

[0156] Determine the target resource allocation scheme according to the historical resource allocation scheme.

[0157] In one embodiment, the resource allocation module 1106 is further configured to:

[0158] If the traffic trigger type is the burst type, determine a target resource allocation scheme based on the service priorities of each service and the traffic prediction results of each service.

[0159] In one embodiment, the resource allocation module 1106 is further configured to:

[0160] Use the services whose traffic prediction results meet the resource allocation conditions of the service as first target services, and determine the traffic change trend based on the traffic prediction results of the first target services;

[0161] Determine second target services from each of the services according to the priorities of each of the services;

[0162] Generate a target resource allocation plan according to the traffic prediction results of the first target service, the traffic prediction results of each second target service, the first resources corresponding to the first target service, the second resources corresponding to each second target service, and the traffic change trend.

[0163] In one embodiment, the obtaining module 1102 is further configured to:

[0164] For any service, obtain the network traffic time series data of the service, and use a modal decomposition algorithm to extract features from the network traffic time series data to obtain multiple network traffic subsequences;

[0165] After normalizing each network traffic subsequence of each service, input them into the network traffic prediction models corresponding to each service for traffic prediction processing to obtain the traffic prediction results of each service.

[0166] In one embodiment, the obtaining module 1102 is further configured to:

[0167] Determine multiple extreme points from the network traffic time series data, where the extreme points include maximum points and minimum points;

[0168] Fit a first envelope line according to the multiple maximum points, and fit a second envelope line according to the multiple minimum points, and determine a one-dimensional mean function according to the network traffic time series data, the first envelope line, and the second envelope line;

[0169] Determine a one-dimensional residual function according to the network traffic time series data and the one-dimensional mean function;

[0170] If the one-dimensional residual function does not meet the condition of becoming an intrinsic mode function, use the one-dimensional residual function as the new network traffic time series data, and jump to the step of determining multiple extreme points from the network traffic time series data. Otherwise, use the one-dimensional residual function as a network traffic subsequence, remove the one-dimensional residual function from the network traffic time series data, and jump to the step of determining multiple extreme points from the network traffic time series data until the network traffic time series data meets the stop condition, and obtain multiple network traffic subsequences.

[0171] In one embodiment, the device further includes:

[0172] An optimization module, configured to use an eagle optimization algorithm to optimize the hyperparameters of the network traffic prediction model during the training process of the network traffic prediction model.

[0173] Each module in the above code standardization detection device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.

[0174] In one embodiment, a computer device is provided. The computer device can be a terminal, and its internal structure diagram can be as Figure 12 shown. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner. The wireless manner can be implemented through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a resource allocation method.

[0175] Those skilled in the art can understand that Figure 12 the structure shown in

[0176] is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0177] In one embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, it implements the steps of any one of the above resource allocation methods.

[0178] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, it implements the steps of any one of the above resource allocation methods.

[0179] The resource allocation method and device provided by this application can be used in the financial field, and can also be used in any field other than the financial field, such as big data, cloud computing, blockchain, artificial intelligence, information security, the Internet of Things, and the 5G technology field. This application does not limit the application fields of the resource allocation method and device.

[0180] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tapes, floppy disks, flash memories, optical memories, high-density embedded non-volatile memories, resistive random access memories (ReRAM), magnetoresistive random access memories (MRAM), ferroelectric random access memories (FRAM), phase change memories (PCM), graphene memories, etc. Volatile memories can include random access memory (RAM) or external cache memories, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.

[0181] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.

[0182] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A resource allocation method, characterized in that: The method comprises: Obtain traffic forecast results for each business; For any of the services, if the traffic prediction result of the service meets the resource allocation condition of the service, historical traffic data of the service is obtained, and the traffic trigger type is determined according to the historical traffic data and the traffic prediction result of the service; A target resource allocation scheme is determined according to the traffic trigger type, and resource allocation for each of the services is performed based on the target resource allocation scheme.

2. The method according to claim 1, characterized in that: The determining of the traffic trigger type according to the historical traffic prediction result and the traffic prediction result of the service includes: When the historical traffic data of the service and the traffic prediction result of the service have a periodic pattern, determining the traffic trigger type as a periodic type; or, When the historical traffic data of the service and the traffic prediction result of the service do not have a periodic pattern, it is determined that the traffic trigger type is a burst type.

3. The method according to claim 2, characterized in that The determining of the target resource allocation scheme according to the traffic trigger type includes: If the traffic trigger type is the periodic type, obtaining a historical resource allocation plan for the previous period; The target resource allocation scheme is determined according to the historical resource allocation scheme.

4. The method according to claim 3, characterized in that: The determining of the target resource allocation scheme according to the traffic trigger type includes: If the traffic trigger type is the burst type, a target resource allocation scheme is determined based on the service priority of each of the services and the traffic prediction result of each of the services.

5. The method according to claim 4, characterized in that The determining of the target resource allocation scheme based on the service priority of each service and the traffic prediction result of each service includes: The service whose traffic prediction result satisfies the resource allocation condition of the service is taken as the first target service, and the traffic change trend is determined based on the traffic prediction result of the first target service; Determining a second target business from among the businesses according to the priorities of the businesses; A target resource allocation plan is generated according to the traffic prediction result of the first target service, the traffic prediction results of each of the second target services, the first resource corresponding to the first target service, the second resource corresponding to each of the second target services, and the traffic change trend.

6. The method according to claim 1, characterized in that The obtaining of the traffic prediction result of each service includes: For any business, obtain network traffic time series data of the business, use a modal decomposition algorithm to extract features from the network traffic time series data, and obtain multiple network traffic subsequences; After the network traffic subsequences of each of the services are normalized, they are respectively input into the network traffic prediction models corresponding to the services to perform traffic prediction processing, so as to obtain traffic prediction results for each of the services.

7. The method according to claim 6, characterized in that The network traffic time series data is subjected to feature extraction using a modal decomposition algorithm to obtain a plurality of network traffic subsequences, including: Determine a plurality of extreme value points from the network traffic time series data, wherein the extreme value points include maximum value points and minimum value points; A first envelope is obtained by fitting the plurality of maximum value points, and a second envelope is obtained by fitting the plurality of minimum value points, and a one-dimensional mean function is determined according to the network traffic time series data, the first envelope and the second envelope; Determining a one-dimensional residual function according to the network traffic time series data and the one-dimensional mean function; If the one-dimensional residual function does not meet the conditions for becoming an intrinsic mode function, the one-dimensional residual function is used as new network traffic time series data, and the process jumps to the step of determining multiple extreme points from the network traffic time series data; otherwise, the one-dimensional residual function is used as a network traffic subsequence, and the one-dimensional residual function is removed from the network traffic time series data, and the process jumps to the step of determining multiple extreme points from the network traffic time series data, until the network traffic time series data meets the stopping conditions, and multiple network traffic subsequences are obtained.

8. The method according to claim 6, characterized in that The method further comprises: During the training process of the network traffic prediction model, the Sky Eagle optimization algorithm is used to optimize the hyperparameters of the network traffic prediction model.

9. A resource allocation device, characterized in that: The device comprises: The acquisition module is used to obtain the traffic prediction results of each business; A determination module, for obtaining, for any of the services, historical traffic data of the service if the traffic prediction result of the service meets the resource allocation condition of the service, and determining a traffic trigger type according to the historical traffic data and the traffic prediction result of the service; The resource allocation module is used to determine a target resource allocation scheme according to the traffic trigger type, and perform resource allocation for each of the services based on the target resource allocation scheme.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.