Request data flow limiting method, device and equipment and readable storage medium

By time series prediction of historical traffic request data, predicting the traffic request volume of the target server and limiting the current flow, the problem of inflexible flow limit in the existing technology is solved, and the automatic adaptation to traffic changes is achieved, ensuring the stability of the server.

CN119030885AActive Publication Date: 2024-11-26CHINA MOBILE INFORMATION TECHNOLOGY CO LTD +1

Patent Information

Application Number
CN202410912419.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-09
Publication Date
2024-11-26
Estimated Expiration
2044-07-09

AI Technical Summary

Technical Problem

In the prior art, the current limit of network requests is usually based on a preset fixed threshold, lacks flexibility and cannot adapt to actual request changes, resulting in a server that may fail when the traffic is hit.

Method used

By obtaining the historical traffic request data of multiple servers, training the time series prediction model, predicting the traffic request volume of the target server at the target time, and limiting the flow based on the predicted traffic volume, avoiding artificially setting a fixed threshold, and achieving automatic adaptation to traffic changes.

Benefits of technology

It realizes traffic control without manual intervention, can adapt to actual request changes, avoid server failures, and the system automatically balances traffic, improving the stability of network requests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119030885A_ABST
    Figure CN119030885A_ABST
Patent Text Reader

Abstract

The invention discloses a request data flow limiting method, device and equipment and a readable storage medium. The request data flow limiting method comprises the following steps: acquiring historical flow request data of a plurality of servers, wherein the historical flow request data comprises a server identifier, a flow request quantity and time; training a time sequence prediction algorithm according to the historical traffic request data to obtain a trained time sequence prediction model; on the basis of a trained time sequence prediction model, the predicted traffic request quantity of the target server identifier at the target time is determined, and the time sequence prediction model comprises the corresponding relation among the server identifier, the time and the traffic request quantity; and performing request data flow limiting on a target server corresponding to the target server identifier based on the predicted flow request quantity. According to the embodiment of the invention, the method can adapt to the actual request data change, and carries out the current limiting of the target server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network traffic management, and in particular to a method, device, equipment and readable storage medium for requesting data flow limiting. Background Art

[0002] In the field of Internet communications, many scenarios require limiting the rate of network requests to prevent server failures caused by the impact of large traffic.

[0003] In the related art, traffic flow limiting is usually performed based on a preset fixed threshold. However, this method lacks flexibility and may not adapt to actual request changes. Summary of the invention

[0004] The embodiments of the present application provide a method, apparatus, device and readable storage medium for limiting the flow of request data, which can adapt to actual changes in request data and limit the flow of a target server.

[0005] In a first aspect, an embodiment of the present application provides a method for limiting the flow of request data, and the method for limiting the flow of request data includes: obtaining historical traffic request data of multiple servers, the historical traffic request data including server identifier, traffic request amount and time; training a time series prediction algorithm according to the historical traffic request data to obtain a trained time series prediction model; based on the trained time series prediction model, determining the predicted traffic request amount of the target server identifier at the target time, the time series prediction model including the correspondence between the server identifier, time and traffic request amount; and limiting the flow of request data on the target server corresponding to the target server identifier based on the predicted traffic request amount.

[0006] According to the implementation scheme of the first aspect of the present application, before training the time series prediction algorithm based on the historical traffic request data to obtain the trained time series prediction model, the method also includes: determining whether the historical traffic request data includes a resource locator; if the historical traffic request data includes a resource locator, training the time series prediction algorithm based on the historical traffic request data.

[0007] According to any of the aforementioned implementations of the first aspect of the present application, a time series prediction algorithm is trained based on historical traffic request data to obtain a trained time series prediction model, including: calculating the change in the traffic request volume between any time t and time t-1 in the historical traffic request data; calculating the sum of the change in the traffic request volume between any time t and time ti in the historical traffic request data to obtain a moving average; calculating the sum of the moving averages at time ti to obtain an autoregressive model; obtaining a trained time series prediction model based on the change in the traffic request volume, the moving average and the autoregressive model.

[0008] According to any of the aforementioned implementations of the first aspect of the present application, the sum of the changes in the traffic request volume at any time t and the time ti in the historical traffic request data is calculated to obtain a moving average, which satisfies the following relationship: MA(q)=∑(ρ i *ΔY(ti)) where MA(q) represents the moving average, ρ i is the first model parameter, ΔY(ti) is the change in the flow request amount between any time t and the time ti.

[0009] According to any of the aforementioned implementations of the first aspect of the present application, the sum of the moving average values ​​at time ti is calculated to obtain an autoregressive model that satisfies the following relationship: Among them, AR(p) represents the autoregressive model, is the second model parameter, and MA(q)(ti) represents the moving average at the ti-th moment.

[0010] According to any of the aforementioned implementations of the first aspect of the present application, request data flow limitation is performed on a target server corresponding to a target server identifier based on a predicted traffic request volume, including: obtaining current traffic request data of multiple servers, the current traffic request data including a server identifier, a traffic request volume and a time; calculating an average request volume and a standard deviation of the traffic request volume in the current traffic request data; determining a threshold value based on the average request volume, the standard deviation and a preset traffic request volume; and according to the threshold value, performing request data flow limitation on the target server corresponding to the target server identifier; wherein the threshold value determined based on the average request volume, the standard deviation and the preset traffic request volume satisfies the following relationship: R=Q+σ*μ*Y(t+k) / (1+Y(t+k)), wherein R represents the threshold value, Q represents the average request volume, σ represents the standard deviation, μ represents the adjustment factor, and Y(t+k) represents the predicted traffic request volume.

[0011] According to any of the aforementioned implementations of the first aspect of the present application, request data flow limiting is performed on the target server corresponding to the target server identifier based on the threshold, including: sending the traffic of the target server that exceeds the threshold to a backup server based on the type of historical traffic request data and the priority of the routing configuration corresponding to the server.

[0012] According to any of the aforementioned implementations of the first aspect of the present application, request data flow limiting is performed on the target server corresponding to the target server identifier based on the threshold, including: when the threshold minus the current flow is less than the preset threshold, sending an alarm message to the target system; when the current flow exceeds the threshold, intercepting the flow exceeding the threshold and returning to the target page.

[0013] In the second aspect, the present embodiment provides a device for limiting the flow of request data, and the device for limiting the flow of request data includes: an acquisition module, which is used to obtain historical traffic request data of multiple servers, and the historical traffic request data includes server identification, traffic request amount and time; a training module, which is used to train the time series prediction algorithm according to the historical traffic request data to obtain a trained time series prediction model; a determination module, which is used to determine the predicted traffic request amount of the target server identification at the target time based on the trained time series prediction model, and the time series prediction model includes the correspondence between the server identification, time and traffic request amount; a flow limiting module, which is used to limit the flow of request data to the target server corresponding to the target server identification based on the predicted traffic request amount.

[0014] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the method for requesting data current limiting as claimed in any one of claims 1-8 is implemented.

[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, a method for requesting data flow limiting as described in any one of the first aspects is implemented.

[0016] In a fifth aspect, an embodiment of the present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the method for requesting data flow limiting as in the first aspect.

[0017] A method, device, equipment and readable storage medium for limiting the flow of request data in an embodiment of the present application can predict the flow request volume of a target server at a target time based on existing historical flow request data through a time series prediction model to obtain a predicted flow request volume. The flow of the target server is then limited based on the predicted flow request volume. This process does not require manual setting of a fixed threshold for flow limiting, and since the predicted flow request volume is based on historical flow request data, the predicted request volume is more reasonable and can adapt to actual request changes; it achieves automatic balance flow control by the system without manual intervention. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0019] Figure 1 It is a flowchart of a method for requesting data flow limiting provided in an embodiment of the present application;

[0020] Figure 2 It is a flowchart of another method for requesting data flow limiting provided in an embodiment of the present application;

[0021] Figure 3 This is a flowchart of another method for requesting data flow limiting provided in an embodiment of the present application.

[0022] Figure 4 It is a structural schematic diagram of a device for requesting data flow limiting provided in an embodiment of the present application;

[0023] Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0025] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0026] As described in the background art, in the related art, flow limiting is usually performed based on a preset fixed threshold value. However, this method lacks flexibility and may not adapt to actual request changes.

[0027] In order to solve the above technical problems, the embodiments of the present application provide a method, device, equipment, readable storage medium and computer program product for requesting data flow limiting. The method for requesting data flow limiting provided by the embodiments of the present application is first introduced below.

[0028] Figure 1 FIG. 1 is a flow chart of a method for requesting data flow limiting provided by an embodiment of the present application. Figure 1 As shown, the method for requesting data flow limiting provided in the embodiment of the present application may include: S110-S140.

[0029] S110: Obtain historical traffic request data of multiple servers.

[0030] Among them, the historical traffic request data includes server identification, traffic request volume and time.

[0031] The time may be the time when the request data is sent, and the traffic request amount may include the size of the request amount within a certain period. For example, the traffic request amount includes the number of requests and the size of the request per second, per minute, and per hour.

[0032] In some embodiments, when acquiring and processing historical traffic request data, data desensitization and encryption may be used to ensure data security and privacy.

[0033] In some embodiments, it is also possible to consider using a high-performance and low-latency database or cache system, such as Redis, to store data.

[0034] S120: Train the time series prediction algorithm according to the historical traffic request data to obtain a trained time series prediction model.

[0035] For example, the time series prediction algorithm may include the ARIMA algorithm. The ARIMA algorithm generally captures the inherent laws of the data through operations such as difference, moving average and autoregression, so as to perform prediction training. For the specific training process, see Figure 2 Part of the detailed explanation.

[0036] S130: Determine the predicted traffic request volume of the target server identifier at the target time based on the trained time series prediction model.

[0037] Among them, the time series prediction model includes the correspondence between server identification, time and traffic request volume.

[0038] Since the predicted traffic request volume is based on the trained time series prediction model, which is trained based on historical traffic request data, the predicted traffic request volume can adapt to actual request changes without manually setting fixed thresholds for flow control. And as historical traffic request data is updated, that is, as new data continues to enter, the time series prediction model will also be updated periodically to adapt to changes in traffic.

[0039] S140: Limit the flow of request data to the target server corresponding to the target server identifier based on the predicted traffic request volume.

[0040] In some embodiments, the predicted traffic request volume is the maximum request volume value within one or more window times, for example: the maximum request volume in the last 5 minutes, 1 hour, 24 hours or a week.

[0041] For the specific current limiting process, please refer to Figure 3 Part of the detailed explanation.

[0042] A method for limiting the flow of request data in an embodiment of the present application can predict the flow request volume of a target server at a target time based on existing historical flow request data through a time series prediction model to obtain a predicted flow request volume. The flow of the target server is then limited based on the predicted flow request volume. This process does not require manual setting of a fixed threshold for flow limiting, and since the predicted flow request volume is obtained based on historical flow request data, the predicted request volume is more reasonable and can adapt to actual request changes; achieving automatic balance flow control by the system without manual intervention.

[0043] In some embodiments, before S120, training the time series prediction algorithm according to the historical traffic request data to obtain the trained time series prediction model, the method for requesting data flow limiting may further include: step one and step two.

[0044] Step 1: Determine whether the historical traffic request data includes a resource locator.

[0045] The resource locator may be a Uniform Resource Locator (URL). A URL is an address for locating a specific resource through the Internet, and is commonly found in web page traffic and HTTP requests.

[0046] Step 2: When the historical traffic request data includes a resource locator, the time series prediction algorithm is trained according to the historical traffic request data.

[0047] In the embodiment of the present application, the processing efficiency can be improved by judging whether the historical traffic request data includes a resource locator, and then judging whether the corresponding historical traffic request data is valid data. If the historical traffic request data does not include a resource locator, the historical traffic request data that does not include a resource locator is initialized.

[0048] In some embodiments, to ensure high availability and fast update of the time series prediction model, the time series prediction model should support multiple deployment forms, such as containerized deployment or bare metal deployment.

[0049] In some embodiments, Figure 2 As shown, S120, training the time series prediction algorithm according to the historical traffic request data to obtain a trained time series prediction model may include: S121-S124

[0050] S121. Calculate the change in the traffic request volume between any time t and time t-1 in the historical traffic request data.

[0051] In some embodiments, S121, calculate the change in the traffic request volume between any time t and time t-1 in the historical traffic request data, and satisfy the following relationship:

[0052] ΔYt=Yt-Y(t-1) (1)

[0053] Where ΔYt represents the change in the traffic request, Yt represents the traffic request at any time t, and Y(t-1) represents the traffic request at the t-1th time.

[0054] S122: Calculate the sum of the changes in the traffic request volume between any time t and the time ti in the historical traffic request data to obtain a moving average.

[0055] In some embodiments, S122, the sum of the changes in the traffic request volume between any time t and the time ti in the historical traffic request data is calculated to obtain a moving average value, which satisfies the following relationship:

[0056] MA(q)=∑(ρ i *ΔY(ti)) (2)

[0057] Where MA(q) represents the moving average, ρ i is the first model parameter, ΔY(ti) is the change in the flow request amount between any time t and the time ti.

[0058] S123. Calculate the sum of the moving averages at time ti to obtain an autoregressive model.

[0059] In some embodiments, S123, the sum of the moving average values ​​at time ti is calculated to obtain an autoregressive model, which satisfies the following relationship:

[0060]

[0061] Among them, AR(p) represents the autoregressive model, is the second model parameter, and MA(q)(ti) represents the moving average at the ti-th moment.

[0062] ρ i and are two parameters of the time series prediction model, which can be estimated by optimization methods such as the least squares method.

[0063] S124. Obtain a trained time series prediction model according to the change in traffic request volume, the moving average, and the autoregressive model.

[0064] Combining the above formulas (1)-(3), we can get:

[0065]

[0066] Where ARIMA(p,d,q) is the model calculation formula of the ARIMA algorithm.

[0067] Finally, the model calculation formula corresponding to the time series prediction model can be obtained as follows:

[0068]

[0069] Among them, Y(t+k) represents the traffic request at the t+kth time, ΔY(t+ki) is the change in the traffic request between any time t and the tith time, and MA(q)(t+k) represents the moving average at the t+kth time.

[0070] It should be noted that the traffic request amount calculated based on the time series prediction model is the predicted traffic request amount. In some embodiments, the predicted traffic request amount needs to be adjusted. Figure 3 As shown, S140 may include S141 - S144 .

[0071] S141. Obtain current traffic request data of multiple servers, where the current traffic request data includes server identification, traffic request amount, and time.

[0072] S142: Calculate the average request volume and standard deviation of the traffic request volume in the current traffic request data.

[0073] S143. Determine a threshold value according to the average request volume, the standard deviation, and the preset traffic request volume.

[0074] S144. According to the threshold, limit the flow of request data to the target server corresponding to the target server identifier.

[0075] The threshold is determined based on the average request volume, standard deviation and preset traffic request volume to satisfy the following relationship:

[0076] R=Q+σ*μ*Y(t+k) / (1+Y(t+k))

[0077] Among them, R represents the threshold, Q represents the average request volume, σ represents the standard deviation, μ represents the adjustment factor, and Y(t+k) represents the predicted traffic request volume.

[0078] In some embodiments, the threshold can be fine-tuned according to actual conditions (holidays, promotional activities or other specific events) to set different alarm thresholds and interception thresholds. For example, if the threshold is 100G, 100G*0.8=80G, 80G is set as the alarm threshold, and when the current traffic is equal to or greater than 80G, an alarm signal is sent to the relevant system.

[0079] In some embodiments, S144, limiting the flow of request data to the target server corresponding to the target server identifier according to the threshold, may include: step three.

[0080] Step 3: According to the type of historical traffic request data and the priority of the routing configuration corresponding to the server, the traffic of the target server exceeding the threshold is sent to the backup server.

[0081] It should be understood that one gateway corresponds to multiple servers, different servers correspond to different routes, and different routes have different priorities. The gateway delegates traffic to the server through the route. For example, one gateway corresponds to 3 servers, one is the target server, and the others are backup servers. The route corresponding to the target server has the highest priority. When the current traffic request volume of the target server is greater than the predicted traffic request volume, the overflow traffic is sent to the backup server through a route with a lower priority. In this way, the smooth processing of key requests can be ensured.

[0082] In some embodiments, S144, limiting the flow of request data to the target server corresponding to the target server identifier according to the threshold, may include: step four and step five.

[0083] Step 4: When the threshold minus the current flow is less than the preset threshold, an alarm message is sent to the target system.

[0084] Exemplarily, the threshold is 100, the preset threshold is 10, and when the difference between the current flow rate and the threshold is less than 10, an alarm signal is triggered.

[0085] Step 5: When the current traffic exceeds the threshold, the traffic exceeding the threshold is intercepted and the target page is returned.

[0086] In some embodiments, consider using traffic control tools and middleware, such as excellent open source API gateways Apisix, Kong, or Istio, to intercept and route traffic.

[0087] To ensure the stability and effectiveness of the system, in some embodiments, the performance and accuracy of the system corresponding to the request data flow limiting may be regularly evaluated, for example, through AB testing and grayscale release testing.

[0088] Training only on the traffic request volume may be relatively simple, and the learning results are not optimal. In some embodiments, in addition to learning the maximum request volume, other indicators such as request success rate, response time, status code ratio, etc. can be considered to further optimize the flow control strategy. In addition, for traffic overflow, other processing methods can be considered, such as automatic expansion and dynamic scheduling.

[0089] Some emergencies may cause a short-term surge in traffic, but this may not represent the future norm. In some embodiments, smoothing techniques or weighted averages can be used to ensure that short-term traffic fluctuations do not excessively affect the learning results.

[0090] Continuously recording the amount of requests within each window time may require a large amount of storage resources. In some embodiments, data compression, sampling or aggregation strategies can be used to reduce storage requirements.

[0091] When the traffic request volume suddenly increases, the time series prediction model may need time to adapt and relearn. In some embodiments, a fast response mechanism can be implemented, such as using a sliding window or a fast reaction algorithm, to shorten the adjustment time.

[0092] When the system generates false alarms or false interceptions due to some accidental traffic fluctuations or learning errors, a fault tolerance threshold can be set and an opportunity for manual intervention can be provided. At the same time, some verification mechanisms, such as verification codes, can be used to distinguish between real users and malicious traffic.

[0093] Based on the same inventive concept as the method for requesting data flow limiting provided in the embodiment, the embodiment of the present application further provides a device 400 for requesting data flow limiting. Please see the following embodiment.

[0094] like Figure 4 As shown, the device 400 for requesting data flow limiting may include: an acquisition module 401, a training module 402, a determination module 403 and a flow limiting module 404.

[0095] The acquisition module 401 is used to acquire historical traffic request data of multiple servers, where the historical traffic request data includes server identification, traffic request amount and time.

[0096] The training module 402 is used to train the time series prediction algorithm according to the historical traffic request data to obtain a trained time series prediction model.

[0097] The determination module 403 is used to determine the predicted traffic request amount of the target server identifier at the target time based on the trained time series prediction model. The time series prediction model includes the correspondence between the server identifier, time and traffic request amount.

[0098] The flow limiting module 404 is used to limit the flow of request data to the target server corresponding to the target server identifier based on the predicted flow request volume.

[0099] As an implementation method of the present application, the above-mentioned device may also include a judgment module, which is specifically used to judge whether the historical traffic request data includes a resource locator. The training module 402 is specifically used to train the time series prediction algorithm according to the historical traffic request data when the historical traffic request data includes a resource locator.

[0100] As another implementation method of the present application, the training module 402 is specifically used to calculate the change in the traffic request amount between any time t and time t-1 in the historical traffic request data; calculate the sum of the change in the traffic request amount between any time t and time ti in the historical traffic request data to obtain a moving average; calculate the sum of the moving averages at time ti to obtain an autoregressive model; and obtain a trained time series prediction model based on the change in the traffic request amount, the moving average and the autoregressive model.

[0101] As another implementation of the present application, the sum of the changes in the traffic request volume between any time t and the time ti in the historical traffic request data is calculated to obtain a moving average, which satisfies the following relationship: MA(q)=∑(ρ i *ΔY(ti)) where MA(q) represents the moving average, ρ i is the first model parameter, ΔY(ti) is the change in the flow request amount between any time t and the time ti.

[0102] As another implementation of the present application, the sum of the moving average values ​​at time ti is calculated to obtain an autoregressive model that satisfies the following relationship: Among them, AR(p) represents the autoregressive model, is the second model parameter, and MA(q)(ti) represents the moving average at the ti-th moment.

[0103] As another implementation method of the present application, the flow limiting module 404 is specifically used to obtain current flow request data of multiple servers, the current flow request data including server identifier, flow request amount and time; calculate the average request amount and standard deviation of the flow request amount in the current flow request data; determine the threshold value based on the average request amount, standard deviation and preset flow request amount; according to the threshold value, limit the flow of request data of the target server corresponding to the target server identifier; wherein, the threshold value determined based on the average request amount, standard deviation and preset flow request amount satisfies the following relationship: R=Q+σ*μ*Y(t+k) / (1+Y(t+k)) wherein R represents the threshold value, Q represents the average request amount, σ represents the standard deviation, μ represents the adjustment factor, and Y(t+k) represents the predicted flow request amount.

[0104] As another implementation of the present application, the flow limiting module 404 is specifically used to send the flow of the target server exceeding the threshold to the backup server according to the type of historical flow request data and the priority of the routing configuration corresponding to the server.

[0105] As another implementation method of the present application, the flow limiting module 404 is specifically used to send an alarm message to the target system when the threshold minus the current flow is less than the preset threshold; when the current flow exceeds the threshold, the flow exceeding the threshold is intercepted and the target page is returned.

[0106] A device for limiting the flow of request data in an embodiment of the present application can predict the flow request volume of a target server at a target time based on existing historical flow request data through a time series prediction model to obtain a predicted flow request volume. The flow of the target server is then limited based on the predicted flow request volume. This process does not require manual setting of a fixed threshold for flow limiting, and since the predicted flow request volume is obtained based on historical flow request data, the predicted request volume is more reasonable and can adapt to actual request changes; achieving automatic balance flow control by the system without manual intervention.

[0107] If the training module 402 fails, the device requesting data flow limiting may lose the dynamic adjustment capability. Therefore, in some embodiments, a backup mechanism or redundant system may be implemented to ensure that the device requesting data flow limiting can still operate normally when a problem occurs in a key module.

[0108] When malicious users may try to deceive the device requesting data flow restriction by simulating traffic patterns, causing it to make incorrect judgments, other security strategies such as IP blacklists and user behavior analysis can be combined to detect and block malicious behavior.

[0109] Figure 5 A schematic diagram of an electronic device provided in an embodiment of the present application, such as Figure 5 As shown, the electronic device includes: a processor 501 and a memory 502 storing computer program instructions.

[0110] Specifically, the processor 501 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0111] The memory 502 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 502 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 502 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 502 may be inside or outside the electronic device. In a particular embodiment, the memory 502 is a non-volatile solid-state memory.

[0112] The memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to the first aspect of the present application.

[0113] The processor 501 implements any one of the methods for requesting data flow limiting in the above embodiments by reading and executing computer program instructions stored in the memory 502 .

[0114] In one example, an electronic device may further include a communication interface 503 and a bus 510. Figure 5 As shown, the processor 501, the memory 502, and the communication interface 503 are connected via a bus 510 and communicate with each other.

[0115] The communication interface 503 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0116] The bus 510 includes hardware, software or both, coupling the components of the terminal service device to each other. For example, but not limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Linear Predictive Coding (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (Peripheral Component Interconnect-X, PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VESA Local Bus, VLB) bus or other suitable buses or a combination of two or more of these. Where appropriate, the bus 510 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.

[0117] The device can execute the method for requesting data flow limiting in the embodiment of the present application based on each unit / component in the device for requesting data flow limiting, thereby realizing the combination Figures 1 to 3 Described data processing methods

[0118] In addition, in combination with the method for requesting data flow limiting in the above embodiment, the embodiment of the present application can provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the methods for requesting data flow limiting in the above embodiment is implemented.

[0119] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed, implements any one of the methods for requesting data flow limiting in the above embodiments.

[0120] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0121] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), appropriate firmware, plug-in, function card, etc. When implemented in software, the elements of the present application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or communication link by a data signal carried in a carrier. "Machine-readable medium" may include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (Read-Only Memory, ROM), flash memory, erasable read-only memory (Erasable Read Only Memory, EROM), floppy disks, compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical discs, hard disks, optical fiber media, radio frequency (Radio Frequency, RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0122] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0123] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0124] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A method for requesting data flow limiting, characterized in that: include: Acquire historical traffic request data of multiple servers, wherein the historical traffic request data includes server identification, traffic request amount and time; Training a time series prediction algorithm according to the historical traffic request data to obtain a trained time series prediction model; Determine the predicted traffic request volume of the target server identifier at the target time based on the trained time series prediction model, wherein the time series prediction model includes the corresponding relationship between the server identifier, time and traffic request volume; Based on the predicted traffic request amount, request data flow is limited for the target server corresponding to the target server identifier.

2. The method for requesting data flow limiting according to claim 1, characterized in that: Before training the time series prediction algorithm according to the historical traffic request data to obtain a trained time series prediction model, the method further includes: Determining whether the historical traffic request data includes a resource locator; In a case where the historical traffic request data includes the resource locator, a time series prediction algorithm is trained according to the historical traffic request data.

3. The method for requesting data flow limiting according to claim 1, characterized in that: The step of training the time series prediction algorithm according to the historical traffic request data to obtain a trained time series prediction model includes: Calculate the change in the traffic request volume between any time t and time t-1 in the historical traffic request data; Calculate the sum of the changes in the traffic request volume between any time t and the time ti in the historical traffic request data to obtain a moving average; Calculate the sum of the moving averages at time ti to obtain the autoregressive model; A trained time series prediction model is obtained according to the change in the traffic request volume, the moving average and the autoregressive model.

4. The method for requesting data flow limiting according to claim 3, characterized in that: The calculation of the sum of the changes in the traffic request volume between any time t and the time ti in the historical traffic request data to obtain a moving average satisfies the following relationship: MA(q)=∑(ρ i *ΔY(ti)) Where MA(q) represents the moving average, ρ i is the first model parameter, ΔY(ti) is the change in the flow request amount between any time t and the time ti.

5. The method for requesting data flow limiting according to claim 3 or 4, characterized in that: The sum of the moving average values ​​at time ti is calculated to obtain an autoregressive model that satisfies the following relationship: Among them, AR(p) represents the autoregressive model, is the second model parameter, and MA(q)(ti) represents the moving average at the ti-th moment.

6. The method for requesting data flow limiting according to claim 1, characterized in that: The request data flow limiting for the target server corresponding to the target server identifier based on the predicted traffic request amount includes: Acquire current traffic request data of multiple servers, wherein the current traffic request data includes server identification, traffic request amount and time; Calculate the average request amount and standard deviation of the traffic request amount in the current traffic request data; Determine a threshold value according to the average request amount, the standard deviation and a preset traffic request amount; According to the threshold, limiting the flow of request data to the target server corresponding to the target server identifier; The threshold value determined according to the average request amount, the standard deviation and the preset traffic request amount satisfies the following relationship: R=Q+σ*μ*Y(t+k) / (1+Y(t+k)) Among them, R represents the threshold, Q represents the average request volume, σ represents the standard deviation, μ represents the adjustment factor, and Y(t+k) represents the predicted traffic request volume.

7. The method for requesting data flow limiting according to claim 6, characterized in that: The step of limiting the flow of request data to the target server corresponding to the target server identifier according to the threshold value includes: According to the type of the historical traffic request data and the priority of the routing configuration corresponding to the server, the traffic of the target server exceeding the threshold is sent to the backup server.

8. The method for requesting data flow limiting according to claim 6, characterized in that: The step of limiting the flow of request data to the target server corresponding to the target server identifier according to the threshold value includes: When the threshold minus the current flow is less than a preset threshold, sending an alarm message to the target system; In the case where the current traffic exceeds the threshold, the traffic exceeding the threshold is intercepted and the target page is returned.

9. A device for requesting data flow limiting, characterized in that: The device comprises: An acquisition module, used to acquire historical traffic request data of multiple servers, wherein the historical traffic request data includes server identification, traffic request amount and time; A training module, used to train a time series prediction algorithm according to the historical traffic request data to obtain a trained time series prediction model; A determination module, used to determine the predicted traffic request amount of the target server identifier at the target time based on a trained time series prediction model, wherein the time series prediction model includes a correspondence between the server identifier, time and traffic request amount; A flow limiting module is used to limit the flow of request data to the target server corresponding to the target server identifier based on the predicted flow request amount.

10. An electronic device, characterized in that: The electronic device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the method for requesting data flow limiting as described in any one of claims 1-8 is implemented.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method for requesting data flow limiting according to any one of claims 1 to 8 is implemented.

12. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the method for requesting data flow limiting as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Current limiting method and device, electronic equipment and storage medium

    CN118233392A

  • System service processing method and device, storage medium and electronic equipment

    CN118282956A

  • Customizing authorization request schedules with machine learning models

    US20190392441A1

  • Method for message push request flow control based on service rules, device and medium

    WO2020082733A1

Cited By

  • Flow limiting method and system based on distributed cache strategy

    CN119629116A

  • Accurate current limiting method and device suitable for Kubernetes Ingress and electronic equipment

    CN120980029A