API (Application Program Interface) flow control method and device for function calculation service, medium and equipment

Through the ARIMA-BP combination algorithm model and intelligent optimization algorithm, the API traffic of the function calculation service is dynamically adjusted, which solves the problem that the API traffic cannot be adjusted according to the real-time load situation in the existing technology, and realizes efficient utilization and high availability of resources, reducing the Operation and maintenance costs.

CN119232744AInactive Publication Date: 2024-12-31SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411304397.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2024-12-31
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In function computing services, the prior art cannot dynamically adjust API traffic according to real-time load conditions, resulting in waste of resources or service failure.

Method used

The ARIMA-BP combination algorithm model is used to predict the API request load data, dynamically adjust the resources and maximum concurrency number, and optimize the traffic control strategy, traffic prediction is performed through the ARIMA network and the BP network, and resources are combined with genetic algorithms or heuristic algorithms and Concurrency adjustment.

Benefits of technology

Improve the accuracy of resource allocation and the accuracy of maximum concurrency adjustment, achieve optimal resource utilization, avoid resource waste, ensure that the API maintains high performance and high availability under high load conditions, and reduce operation and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119232744A_ABST
    Figure CN119232744A_ABST
Patent Text Reader

Abstract

The invention provides an API (Application Program Interface) flow control method and device for function calculation service, a medium and equipment. The method comprises the following steps: acquiring request load data of a gateway API (Application Program Interface) of a function calculation service in a preset time period; inputting the request load data into the ARIMA-BP combinatorial algorithm model to obtain traffic prediction data of the gateway API at a future preset time point; the ARIMA-BP combined algorithm model is a model formed by combining an ARIMA network and a BP network, the ARIMA network is a differential autoregressive moving average network, and the BP network is a multi-layer feed-forward network trained according to an error back-propagation algorithm; dynamically adjusting resources allocated by the function calculation service according to the request load data and the flow prediction data; dynamically adjusting the maximum concurrency number of the function calculation service according to the request load data and the flow prediction data; and performing optimization processing on a flow control strategy according to the flow prediction data. According to the invention, resource waste can be avoided, and faults can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of function computing services, and in particular to an API flow control method, device, medium, and equipment for function computing services. Background Art

[0002] With the rapid development of Internet technology, cloud computing, as an emerging computing model, has been widely used. Among them, serverless computing, as an innovative cloud computing service, has been favored by developers because it does not require the management or operation of servers. In serverless computing, function computing service, as a horizontally scalable and automatically scalable computing service, has the advantages of high reliability and low latency, and is very suitable for processing instantaneous high-concurrency requests.

[0003] With the rise of the API economy, API, as a bridge connecting different systems and services, has become a pressing issue for traffic control and performance optimization. Currently, in the function computing service, the traffic of the API is initially controlled mainly by manually configuring the flow limiting parameters of the function computing service. Since it cannot be dynamically adjusted according to the real-time load situation, it is easy to cause resource waste or service failure. Summary of the invention

[0004] In response to at least one of the above technical problems, an embodiment of the present invention provides an API traffic control method, device, medium, and equipment for a function computing service.

[0005] According to the first aspect, the API flow control method of the function computing service provided by the embodiment of the present invention includes:

[0006] Get the request load data of the gateway API of the Function Compute service within the preset time period;

[0007] Input the request load data into the ARIMA-BP combined algorithm model to obtain the traffic forecast data of the gateway API at a preset time point in the future; wherein the ARIMA-BP combined algorithm model is a model composed of an ARIMA network and a BP network, the ARIMA network is a differential autoregressive moving average network, and the BP network is a multi-layer feedforward network trained by an error back propagation algorithm;

[0008] Dynamically adjust the resources allocated by the function computing service according to the request load data and the traffic prediction data;

[0009] Dynamically adjust the maximum concurrency of the function computing service according to the request load data and the traffic prediction data;

[0010] The flow control strategy is optimized according to the flow prediction data.

[0011] In one embodiment, the inputting the request load data into the ARIMA-BP combined algorithm model to obtain the traffic forecast data of the gateway API at a preset time point in the future includes:

[0012] Calculate the first traffic forecast data of the gateway API at a preset time point in the future by using the ARIMA network;

[0013] Using the BP network to calculate the second traffic prediction data of the gateway API at a preset time point in the future;

[0014] The first traffic prediction data and the second traffic prediction data are weightedly combined to obtain traffic prediction data of the gateway API at a preset time point in the future.

[0015] In one embodiment, the ARIMA network is used to predict the first flow prediction data at time t using a first calculation formula, where the first calculation formula is:

[0016]

[0017] Among them, Y t is the first traffic forecast data at time t, c is the constant term, p is the order of the autoregressive term, q is the order of the moving average term, is the autoregression coefficient, For Y t-1 The d-order difference of t-1 is the first traffic prediction data at time t-1, θ i is the coefficient of the moving average term, ∈ t-1 is the white noise error term at time t-1, ∈ t is the white noise error term at time t.

[0018] In one embodiment, the BP network is used to calculate the second flow prediction data using a second calculation formula, and the second calculation formula is:

[0019]

[0020] Wherein, f(x) is the second traffic prediction data at a preset time point in the future obtained based on BP network prediction, x is the requested load data, φ is the activation function, and w ij is the weight from the ith neuron in the hidden layer to the ith neuron in the output layer, h i (x) is the output of the i-th neuron in the hidden layer, b j is the bias of the jth neuron in the output layer.

[0021] In one embodiment, the weighted combination of the first traffic prediction data and the second traffic prediction data to obtain the traffic prediction data of the gateway API at a preset time point in the future includes: using a third calculation formula to calculate the traffic prediction data of the gateway API at a preset time point in the future, and the third calculation formula is:

[0022] g(x)=w*Y(x)+(1-w)*f(x)

[0023] Among them, g(x) is the traffic prediction data of the gateway API at a preset time point in the future, w is the weight, Y(x) is the first traffic prediction data at a preset time point in the future, and f(x) is the second predicted traffic data at a future time point.

[0024] In one embodiment, dynamically adjusting the resources allocated by the function computing service according to the request load data and the traffic prediction data includes:

[0025] Based on the request load data and the traffic prediction data, and using a genetic algorithm or a particle swarm optimization algorithm, the resources allocated to the function computing service are calculated.

[0026] In one embodiment, dynamically adjusting the maximum concurrency of the function computing service according to the request load data and the traffic prediction data includes:

[0027] Based on the request load data and the traffic prediction data, and using a heuristic algorithm or a machine learning algorithm, the maximum concurrency number that meets the processing requirements of high-concurrency requests and reduces resource waste is calculated.

[0028] The API flow control device of the function computing service provided according to the second aspect includes:

[0029] The data collection module is used to obtain the request load data of the gateway API of the function computing service within a preset time period;

[0030] A traffic prediction module, used for inputting the request load data into the ARIMA-BP combined algorithm model to obtain traffic prediction data of the gateway API at a preset time point in the future; wherein the ARIMA-BP combined algorithm model is a model formed by combining an ARIMA network and a BP network, the ARIMA network is a differential autoregressive moving average network, and the BP network is a multi-layer feedforward network trained by an error back propagation algorithm;

[0031] A resource adjustment module, configured to dynamically adjust the resources allocated by the function computing service according to the request load data and the traffic prediction data;

[0032] A concurrency adjustment module, used to dynamically adjust the maximum concurrency of the function computing service according to the request load data and the traffic prediction data;

[0033] The strategy optimization module is used to optimize the flow control strategy according to the flow prediction data.

[0034] According to a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, enables the computer to execute the method provided in the first aspect.

[0035] According to a fourth aspect, an embodiment of the present invention provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method provided in the first aspect is implemented.

[0036] The API flow control method, device, medium, and equipment of the function computing service provided in the embodiment of the present invention obtain the request load data of the gateway API of the function computing service within a preset time period, and then input the request load data into the ARIMA-BP combined algorithm model to obtain the flow prediction data of the gateway API at a preset time point in the future, and then dynamically adjust the resources allocated by the function computing service according to the request load data and the flow prediction data, dynamically adjust the maximum concurrency of the function computing service, and optimize the flow control strategy. Since the flow is comprehensively predicted by the ARIMA network and the BP network, the accuracy of the flow prediction can be improved, thereby improving the accuracy of resource allocation and the accuracy of the maximum concurrency adjustment. Moreover, since resources are allocated and the maximum concurrency is adjusted based on the predicted flow, the optimal resource utilization can be achieved, resource waste can be avoided, the efficiency of cloud computing services can be improved, and the gateway API can still maintain high performance and high availability under high load conditions, and the occurrence of failures can be reduced. In addition, the degree of participation of personnel in the whole process is reduced, thereby reducing operation and maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 This is a flow chart of an API flow control method for a function computing service in one embodiment of the present invention;

[0038] Figure 2 A schematic diagram of a data collection process in one embodiment of the present invention;

[0039] Figure 3 This is a structural block diagram of an API flow control device for a function computing service in one embodiment of the present invention. DETAILED DESCRIPTION

[0040] In a first aspect, an embodiment of the present invention provides an API flow control method for a function computing service, see Figure 1 The method comprises the following steps S110 to S150:

[0041] S110, obtaining request load data of the gateway API of the function computing service within a preset time period;

[0042] Specifically, the request load data of the gateway API is monitored in real time, such as request rate, concurrency, response time and other data, and the request load data in the recent period is cleaned and normalized to obtain the request load data of the gateway API in the preset time period, thereby providing an accurate data basis for subsequent intelligent scheduling and control.

[0043] For example, see Figure 2 , use the monitor Monitor to collect data from the tool Kong, and perform data governance on the collected data, for example, after data structure analysis, standardization, extraction, cleaning conversion, and quality control, obtain standard request load data, and store the request load data in the standard library. Kong is an open source API gateway, which is a management tool for APIs.

[0044] S120, inputting the request load data into the ARIMA-BP combined algorithm model to obtain the traffic forecast data of the gateway API at a preset time point in the future; wherein the ARIMA-BP combined algorithm model is a model composed of an ARIMA network and a BP network, the ARIMA network is a differential autoregressive moving average network, and the BP network is a multi-layer feedforward network trained by an error back propagation algorithm;

[0045] In one embodiment, the step of inputting the request load data into the ARIMA-BP combined algorithm model in S120 to obtain traffic forecast data of the gateway API at a preset time point in the future may include:

[0046] S121, using the ARIMA network to calculate the first traffic prediction data of the gateway API at a preset time point in the future;

[0047] The ARIMA network may be used to predict the first flow prediction data at time t using a first calculation formula, wherein the first calculation formula is:

[0048]

[0049] Among them, Y t is the first traffic forecast data at time t, c is the constant term, p is the order of the autoregressive term, q is the order of the moving average term, is the autoregression coefficient, For Y t-1 The d-order difference of t-1 is the first traffic prediction data at time t-1, θ i is the coefficient of the moving average term, ∈ t-1 is the white noise error term at time t-1, ∈ t is the white noise error term at time t.

[0050] Among them, the ARIMA network is a statistical model used to predict and analyze time series data. Its basic form includes three parts: autoregression-AR, difference-I and moving average-MA. The ARIMA model can be expressed as ARIMA(p,d,q). p is the order of the autoregression term; d is the number of differences; q is the order of the moving average term.

[0051] S122, using the BP network to calculate the second traffic prediction data of the gateway API at a future preset time point;

[0052] The BP network can be used to calculate the second flow prediction data using a second calculation formula, and the second calculation formula is:

[0053]

[0054] Wherein, f(x) is the second traffic prediction data at a preset time point in the future obtained based on BP network prediction, x is the requested load data, φ is the activation function, and w ij is the weight from the ith neuron in the hidden layer to the ith neuron in the output layer, h i (x) is the output of the i-th neuron in the hidden layer, b j is the bias of the jth neuron in the output layer.

[0055] Among them, BP network is a feedforward neural network that trains network weights through the back propagation algorithm. A simple BP neural network contains an input layer, a hidden layer, and an output layer. For example, the hidden layer has n neurons and the output layer has m neurons.

[0056] S123. Perform a weighted combination of the first traffic prediction data and the second traffic prediction data to obtain traffic prediction data of the gateway API at a preset time point in the future.

[0057] Among them, a third calculation formula can be used to calculate the traffic prediction data of the gateway API at a preset time point in the future, and the third calculation formula is:

[0058] g(x)=w*Y(x)+(1-w)*f(x)

[0059] Among them, g(x) is the traffic prediction data of the gateway API at a preset time point in the future, w is the weight, Y(x) is the first traffic prediction data at a preset time point in the future, and f(x) is the second predicted traffic data at a future time point.

[0060] It can be seen that the present invention adopts the ARIMA-BP combined algorithm model to predict the future traffic of the API. By predicting the traffic change trend in the future, it provides a basis for intelligent scheduling and control. The ARIMA network is good at mining the linear relationship of stationary sequences, and the BP network can better fit nonlinear relationships. If a single model is used to predict resource usage, the prediction effect is not ideal, and the future resource usage information cannot be extracted well. In order to overcome the shortcomings of a single prediction model, a combined model based on ARIMA and BP is used. The shortcomings of a single model can be solved by combining the advantages of another model to achieve better prediction results.

[0061] Among them, the ARIMA-BP combination algorithm model needs to be trained with historical data in actual applications to determine the model parameters. After the training is completed, when using these models for prediction, input the request load data to obtain the API traffic forecast value at the future time point.

[0062] S130, dynamically adjusting the resources allocated by the function computing service according to the request load data and the traffic prediction data;

[0063] In one embodiment, dynamically adjusting the resources allocated by the function computing service according to the request load data and the traffic prediction data may include:

[0064] Based on the request load data and the traffic prediction data, and using a genetic algorithm or a particle swarm optimization algorithm, the resources allocated to the function computing service are calculated.

[0065] It can be seen that according to the request load data and traffic prediction data, the genetic algorithm or particle swarm optimization algorithm is used to dynamically adjust the resource allocation of the function computing service. Resources include container computing CPU, memory, network bandwidth, etc., aiming to achieve optimal resource utilization and performance.

[0066] S140, dynamically adjusting the maximum concurrency of the function computing service according to the request load data and the traffic prediction data;

[0067] In one embodiment, dynamically adjusting the maximum concurrency of the function computing service according to the request load data and the traffic prediction data may include:

[0068] Based on the request load data and the traffic prediction data, and using a heuristic algorithm or a machine learning algorithm, the maximum concurrency number that meets the processing requirements of high-concurrency requests and reduces resource waste is calculated.

[0069] It can be seen that the embodiment of the present invention dynamically adjusts the maximum concurrency of the function computing service according to the request load data and the traffic prediction data. By setting a reasonable maximum concurrency, it is possible to meet the processing requirements of high-concurrency requests and avoid resource waste and service failures. The maximum concurrency is adjusted using a heuristic algorithm or a machine learning algorithm, and is optimized according to the actual application scenario and requirements.

[0070] S150: Optimize the flow control strategy according to the flow prediction data.

[0071] Specifically, the flow limiting parameters can be adjusted according to the traffic forecast data to optimize the flow control strategy. After that, the previously allocated resources can be optimized, and the scheduling algorithm of the function computing service can be optimized. At the same time, manual intervention and customized strategies can also be supported to meet different scenarios and needs.

[0072] Understandably, serverless computing is a cloud computing service that allows developers to automate operations by writing code and uploading it to the cloud without having to manage or maintain servers. Function computing can be horizontally expanded, automatically scaled, and has the advantages of high reliability and low latency, so it is very suitable for processing instantaneous high-concurrency requests.

[0073] It is understandable that intelligent API traffic control is a method of intelligently scheduling and controlling API traffic through technologies such as machine learning. It can automatically adjust the request processing method and resource allocation based on real-time load conditions, and prevent problems such as traffic overload and service failure. Intelligent API traffic control can improve API availability and performance, and reduce operation and maintenance costs and the need for manual intervention.

[0074] The embodiment of the present invention provides a method for intelligent API traffic control in serverless computing, aiming to solve the problem that the existing technology cannot dynamically adjust according to the real-time load situation when facing instantaneous high-concurrency requests, thus causing resource waste or service failure. By introducing technologies such as machine learning, intelligent scheduling and control of API traffic is achieved to improve the availability and performance of APIs and reduce operation and maintenance costs and the need for manual intervention.

[0075] The key technical points involved in the embodiments of the present invention are: the collection of request load data, data cleaning, data normalization and feature extraction processes; the machine learning algorithms used in the intelligent traffic prediction process include time series analysis, regression analysis, etc.; the intelligent optimization algorithms used in the dynamic resource allocation step include genetic algorithms and particle swarm optimization algorithms; the maximum concurrency adjustment step uses heuristic algorithms or machine learning algorithms; the traffic control strategy optimization step includes adjusting current limiting parameters, optimizing resource allocation, improving scheduling algorithms, etc. Based on the above key points, the availability and performance of the API can be improved, operation and maintenance costs can be reduced, traffic overload and service failures can be prevented, resource utilization can be optimized, the level of automation can be improved, and different scenarios can be flexibly adapted.

[0076] The embodiments of the present invention have the following beneficial effects:

[0077] 1. Improve API availability and performance: Real-time load monitoring and traffic forecasting help dynamically adjust the resource allocation and maximum concurrency of the function computing service to ensure that the API can maintain high performance and high availability under high load conditions.

[0078] 2. Reduce operation and maintenance costs: Traditional flow control methods require manual intervention, while the embodiments of the present invention use intelligent models to predict flow and then perform subsequent processing based on the predicted flow, which reduces the need for manual operation and maintenance, thereby reducing operation and maintenance costs.

[0079] 3. Prevent traffic overload and service failure: The embodiment of the present invention can automatically adjust the traffic control strategy according to the real-time load situation, effectively prevent traffic overload and service failure, and improve the stability and reliability of the system.

[0080] 4. Optimize resource utilization: By dynamically allocating resources and adjusting the maximum number of concurrent connections, optimal resource utilization can be achieved, resource waste can be avoided, and the efficiency of cloud computing services can be improved.

[0081] 5. Improve the level of automation: The present invention adopts machine learning algorithms and intelligent optimization algorithms to realize the automation of API traffic prediction, thereby improving the automation level and intelligence of the overall system.

[0082] 6. Flexible adaptation to different scenarios: The present invention supports customized flow control strategies and manual intervention, can be optimized according to different scenarios and requirements, and has good flexibility and adaptability.

[0083] In a second aspect, an embodiment of the present invention provides an API flow control device for a function computing service, see Figure 3 , the device 100 comprises:

[0084] The data collection module 110 is used to obtain the request load data of the gateway API of the function computing service within a preset time period;

[0085] The traffic prediction module 120 is used to input the request load data into the ARIMA-BP combined algorithm model to obtain the traffic prediction data of the gateway API at a preset time point in the future; wherein the ARIMA-BP combined algorithm model is a model composed of an ARIMA network and a BP network, the ARIMA network is a differential autoregressive moving average network, and the BP network is a multi-layer feedforward network trained by an error back propagation algorithm;

[0086] A resource adjustment module 130, configured to dynamically adjust the resources allocated by the function computing service according to the request load data and the traffic prediction data;

[0087] A concurrency adjustment module 140, configured to dynamically adjust the maximum concurrency of the function computing service according to the request load data and the traffic prediction data;

[0088] The strategy optimization module 150 is used to optimize the flow control strategy according to the flow prediction data.

[0089] In one embodiment, the traffic prediction module is specifically used to: use the ARIMA network to calculate the first traffic prediction data of the gateway API at a preset time point in the future; use the BP network to calculate the second traffic prediction data of the gateway API at a preset time point in the future; and perform weighted combination of the first traffic prediction data and the second traffic prediction data to obtain the traffic prediction data of the gateway API at a preset time point in the future.

[0090] In one embodiment, the ARIMA network is used to predict the first flow prediction data at time t using a first calculation formula, where the first calculation formula is:

[0091]

[0092] Among them, Y t is the first traffic forecast data at time t, c is the constant term, p is the order of the autoregressive term, q is the order of the moving average term, is the autoregression coefficient, For Y t-1 The d-order difference of t-1 is the first traffic prediction data at time t-1, θ i is the coefficient of the moving average term, ∈ t-1 is the white noise error term at time t-1, ∈ t is the white noise error term at time t.

[0093] In one embodiment, the BP network is used to calculate the second flow prediction data using a second calculation formula, and the second calculation formula is:

[0094]

[0095] Wherein, f(x) is the second traffic prediction data at a preset time point in the future obtained based on BP network prediction, x is the requested load data, φ is the activation function, and w ij is the weight from the ith neuron in the hidden layer to the ith neuron in the output layer, h i (x) is the output of the i-th neuron in the hidden layer, b j is the bias of the jth neuron in the output layer.

[0096] In one embodiment, the traffic prediction module performs a weighted combination of the first traffic prediction data and the second traffic prediction data to obtain traffic prediction data of the gateway API at a preset time point in the future, including: using a third calculation formula to calculate the traffic prediction data of the gateway API at a preset time point in the future, and the third calculation formula is:

[0097] g(x)=w*Y(x)+(1-w)*f(x)

[0098] Among them, g(x) is the traffic prediction data of the gateway API at a preset time point in the future, w is the weight, Y(x) is the first traffic prediction data at a preset time point in the future, and f(x) is the second predicted traffic data at a future time point.

[0099] In one embodiment, the resource adjustment module is specifically used to calculate the resources allocated to the function computing service based on the request load data and the traffic prediction data, using a genetic algorithm or a particle swarm optimization algorithm.

[0100] In one embodiment, the concurrency adjustment module is specifically used to: based on the request load data and the traffic prediction data, and using a heuristic algorithm or a machine learning algorithm, calculate the maximum concurrency that meets the processing requirements of high-concurrency requests and reduces resource waste.

[0101] It is understandable that the explanation, specific implementation, beneficial effects, examples, etc. of the relevant contents in the device provided in the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0102] In a third aspect, an embodiment of the present invention provides a computer-readable medium, on which computer instructions are stored. When the computer instructions are executed by a processor, the processor executes the method provided in the first aspect.

[0103] Specifically, a system or device equipped with a storage medium can be provided, on which software program code that implements the functions of any of the above-mentioned embodiments is stored, and a computer (or CPU or MPU) of the system or device can be enabled to read and execute the program code stored in the storage medium.

[0104] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.

[0105] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer by a communication network.

[0106] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.

[0107] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or to a memory provided in an expansion module connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or expansion module is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.

[0108] It is understandable that the explanation, specific implementation methods, beneficial effects, examples, etc. of the relevant contents in the computer-readable medium provided in the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0109] In a fourth aspect, an embodiment of the present specification provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method in any embodiment of the specification.

[0110] It is understandable that the explanation, specific implementation, beneficial effects, examples, etc. of the relevant contents in the computing device provided in the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0111] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0112] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, widgets, or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0113] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for controlling API traffic of a function computing service, characterized in that: include: Get the request load data of the gateway API of the Function Compute service within the preset time period; Input the request load data into the ARIMA-BP combined algorithm model to obtain the traffic forecast data of the gateway API at a preset time point in the future; wherein the ARIMA-BP combined algorithm model is a model composed of an ARIMA network and a BP network, the ARIMA network is a differential autoregressive moving average network, and the BP network is a multi-layer feedforward network trained by an error back propagation algorithm; Dynamically adjust the resources allocated by the function computing service according to the request load data and the traffic prediction data; Dynamically adjust the maximum concurrency of the function computing service according to the request load data and the traffic prediction data; The flow control strategy is optimized according to the flow prediction data.

2. The method according to claim 1, characterized in that The step of inputting the request load data into the ARIMA-BP combined algorithm model to obtain traffic forecast data of the gateway API at a preset time point in the future includes: Calculate the first traffic forecast data of the gateway API at a preset time point in the future by using the ARIMA network; Using the BP network to calculate the second traffic prediction data of the gateway API at a preset time point in the future; The first traffic prediction data and the second traffic prediction data are weightedly combined to obtain traffic prediction data of the gateway API at a preset time point in the future.

3. The method according to claim 2, characterized in that The ARIMA network is used to predict the first flow prediction data at time t using a first calculation formula, where the first calculation formula is: Among them, Y t is the first traffic forecast data at time t, c is the constant term, p is the order of the autoregressive term, q is the order of the moving average term, is the autoregression coefficient, For Y t-1 The d-order difference of t-1 is the first traffic prediction data at time t-1, θ i is the coefficient of the moving average term, ∈ t-1 is the white noise error term at time t-1, ∈ t is the white noise error term at time t.

4. The method according to claim 2, characterized in that: The BP network is used to calculate the second flow prediction data using a second calculation formula, and the second calculation formula is: Wherein, f(x) is the second traffic prediction data at a preset time point in the future obtained based on BP network prediction, x is the requested load data, φ is the activation function, and w ij is the weight from the ith neuron in the hidden layer to the ith neuron in the output layer, h i (x) is the output of the i-th neuron in the hidden layer, b j is the bias of the jth neuron in the output layer.

5. The method according to claim 2, characterized in that: The weighted combination of the first traffic prediction data and the second traffic prediction data to obtain the traffic prediction data of the gateway API at a preset future time point includes: using a third calculation formula to calculate the traffic prediction data of the gateway API at a preset future time point, and the third calculation formula is: g(x)=w*Y(x)+(1-w)*f(x) Among them, g(x) is the traffic prediction data of the gateway API at a preset time point in the future, w is the weight, Y(x) is the first traffic prediction data at a preset time point in the future, and f(x) is the second predicted traffic data at a future time point.

6. The method according to claim 1, characterized in that The dynamically adjusting the resources allocated by the function computing service according to the request load data and the traffic prediction data includes: Based on the request load data and the traffic prediction data, and using a genetic algorithm or a particle swarm optimization algorithm, the resources allocated to the function computing service are calculated.

7. The method according to claim 1, characterized in that The dynamically adjusting the maximum concurrency of the function computing service according to the request load data and the traffic prediction data includes: Based on the request load data and the traffic prediction data, and using a heuristic algorithm or a machine learning algorithm, the maximum concurrency number that meets the processing requirements of high-concurrency requests and reduces resource waste is calculated.

8. An API flow control device for a function computing service, characterized in that: include: The data collection module is used to obtain the request load data of the gateway API of the function computing service within a preset time period; A traffic prediction module, used for inputting the request load data into the ARIMA-BP combined algorithm model to obtain traffic prediction data of the gateway API at a preset time point in the future; wherein the ARIMA-BP combined algorithm model is a model formed by combining an ARIMA network and a BP network, the ARIMA network is a differential autoregressive moving average network, and the BP network is a multi-layer feedforward network trained by an error back propagation algorithm; A resource adjustment module, configured to dynamically adjust the resources allocated by the function computing service according to the request load data and the traffic prediction data; A concurrency adjustment module, used to dynamically adjust the maximum concurrency of the function computing service according to the request load data and the traffic prediction data; The strategy optimization module is used to optimize the flow control strategy according to the flow prediction data.

9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed in a computer, the computer is caused to execute the method according to any one of claims 1 to 7.

10. A computing device, characterized in that: The method comprises a memory and a processor, wherein the memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Power integrated service network flow prediction method

    CN104993966A

  • High-concurrency data request processing method and device, electronic equipment and storage medium

    CN116094945A