Service request processing method, system and equipment and storage medium

By evaluating the processor load information in real time, calculating the capacity of concurrent requests, and comparing the capacity based on the real-time concurrency number and the average concurrency number, deciding whether to receive service requests, solving the problem of overloading of the back-end service processor and improving the stability and reliability of service request processing.

CN120034678APending Publication Date: 2025-05-23BIGO TECH PTE LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510023495.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

In live broadcast scenarios, backend services may overload the processor due to failure to accurately configure the overload protection logic, affecting the stability and reliability of service request processing.

Method used

By evaluating the processor load information in real time, the real-time concurrent request capacity is calculated, and the capacity is compared with the real-time concurrent number and the average concurrent number to determine whether to receive and process service requests, thereby realizing overload protection of back-end services.

Benefits of technology

Accurately determine the maximum number of concurrent requests that the backend service can withstand, avoid processor overload, and improve the stability and reliability of service request processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120034678A_ABST
    Figure CN120034678A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a service request processing method, system and device and a storage medium. According to the technical scheme provided by the embodiment of the invention, the real-time concurrent request capacity is calculated based on the processor load information, the processor load information represents the real-time load condition of the current processor, and the real-time concurrent request capacity represents the maximum number of concurrent service requests bearable by the processor load information corresponding to the current processor; determining the real-time concurrency number of the currently processed service requests, and determining the average concurrency number of the service requests processed in a set time period; and comparing the real-time concurrent request capacity based on the real-time concurrent quantity and the average concurrent quantity, and performing corresponding processing on the service requests received in real time according to a comparison result. By adopting the technical means, whether the current service request is received for processing or not can be accurately judged, and overload protection of back-end service is realized, so that the stability and reliability of service request processing are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular, to a service request processing method, system, device and storage medium. Background Art

[0002] Currently, in live broadcast scenarios, different live broadcast activities will generate a large number of service requests. When the activity is refreshed, the service requests will become more concentrated. For a large number of service requests, if the backend service is not configured with the corresponding overload protection logic, the request may fail or the service may be stuck. For this reason, the backend service is usually stress-tested to determine the number of requests per second it can withstand, and then the number of requests per second of the backend service is controlled to achieve overload protection of the backend service and avoid the risk of overload of the backend service processor.

[0003] However, since the number of requests per second that the backend service can withstand is usually conducted in a dedicated stress testing environment, the stress testing results are significantly different from the actual online environment, resulting in errors in the calculated number of requests per second that can be sustained. If the number of requests per second that the backend service can withstand is set too high, there may still be a risk of processor overload, affecting the stability and reliability of backend service request processing. Summary of the invention

[0004] The embodiments of the present application provide a service request processing method, system, device and storage medium, which can accurately determine the maximum number of concurrent requests that a backend service can bear, and process service requests based on the maximum number of concurrent requests that the backend service can bear, thereby solving the technical problem of processor overload risk caused by service request processing errors of the backend service.

[0005] In a first aspect, an embodiment of the present application provides a service request processing method, including:

[0006] Calculate the real-time concurrent request capacity based on the processor load information, where the processor load information indicates the real-time load of the current processor, and the real-time concurrent request capacity indicates the maximum number of concurrent service requests that the current processor can bear corresponding to the processor load information;

[0007] Determine the real-time concurrent number of service requests currently being processed and determine the average concurrent number of service requests processed within a set period of time;

[0008] The real-time concurrent request capacity is compared with the average concurrent number, and the service requests received in real time are processed accordingly according to the comparison results.

[0009] In a second aspect, an embodiment of the present application provides a service request processing system, including:

[0010] A first calculation module is configured to calculate the real-time concurrent request capacity based on the processor load information, where the processor load information indicates the real-time load of the current processor, and the real-time concurrent request capacity indicates the maximum number of concurrent service requests that the current processor can bear corresponding to the processor load information;

[0011] A second calculation module is configured to determine the real-time concurrent number of service requests currently being processed, and determine the average concurrent number of service requests processed within a set period of time;

[0012] The processing module is configured to compare the real-time concurrent request capacity based on the real-time concurrent number and the average concurrent number, and perform corresponding processing on the service requests received in real time according to the comparison result.

[0013] In a third aspect, an embodiment of the present application provides a service request processing device, including:

[0014] memory and one or more processors;

[0015] The memory is configured to store one or more programs;

[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the service request processing method as described in the first aspect.

[0017] In a fourth aspect, an embodiment of the present application provides a non-volatile computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are configured to execute the service request processing method described in the first aspect when executed by a computer processor.

[0018] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed on a computer or a processor, the computer or the processor executes the service request processing method as described in the first aspect.

[0019] The embodiment of the present application calculates the real-time concurrent request capacity based on the processor load information, the processor load information indicates the real-time load of the current processor, and the real-time concurrent request capacity indicates the maximum number of concurrent service requests that the current processor can bear corresponding to the processor load information; determines the real-time concurrent number of service requests currently being processed, and determines the average concurrent number of service requests processed within a set period of time; compares the real-time concurrent request capacity based on the real-time concurrent number and the average concurrent number, and performs corresponding processing on the service requests received in real time according to the comparison results. The above-mentioned technical means are adopted to determine the real-time concurrent request capacity that the processor can bear by evaluating the processor load in real time, and compare the real-time concurrent request capacity based on the real-time concurrent number and the average concurrent number, so as to accurately determine whether to receive the current service request for processing, realize overload protection of the back-end service, and thus improve the stability and reliability of service request processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 is a flow chart of a service request processing method provided by an embodiment of the present application;

[0021] Figure 2 is a flow chart of service request processing judgment in an embodiment of the present application;

[0022] Figure 3 is a schematic diagram of the historical average concurrent request capacity information in an embodiment of the present application;

[0023] Figure 4 It is a structural diagram of a service request processing system provided in an embodiment of the present application;

[0024] Figure 5 It is a structural diagram of a service request processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.

[0026] The service request processing method provided in this application aims to determine the real-time concurrent request capacity that the processor can withstand by evaluating the processor load in real time, and compare the real-time concurrent request capacity based on the real-time concurrent number and the average concurrent number, so as to accurately determine whether to receive the current service request for processing and realize overload protection of the back-end service.

[0027] During live events, the backend server of the live application needs to carry different event content at different times. Since the live application has a large user base, the number of requests for the carousel entrance has also surged. As an event service, it is necessary to ensure that the anchor and users can smoothly participate in the event during the live broadcast, and display relevant event tasks and gameplay data in real time. Especially in events, common PK gameplay usually takes 30 minutes per round. After a round, the system needs to unify the request interface to refresh the status. At this time, the requests will become more concentrated. If the backend service does not have appropriate overload protection, it may cause the service to hang or freeze at any time. Therefore, ensuring the stability of the event service has become a vital issue.

[0028] The current mainstream flow control method is mainly to control the QPS (number of requests per second) and concurrency of each interface, as well as the QPS of the entire system entrance. However, this method has some limitations. It is necessary to perform stress testing on each interface and the entire system in advance to estimate the QPS it can withstand. Stress testing is usually performed in a dedicated stress testing environment, and the actual online environment may be significantly different from it, resulting in inaccurate estimated QPS values. If the estimated flow control QPS is set too high, the system may be at risk of CPU overload. Since the automatic expansion and contraction module of the backend service cannot expand quickly when facing instantaneous high QPS, the service may be overwhelmed by the instantaneous high request volume. Although the backend service also provides a request rejection strategy based on a fixed CPU threshold, in the case of continuous high QPS, although some requests are rejected, the CPU load of the service may still be close to the threshold. In this case, the interface performance and response time of the system may still be affected. Therefore, when the CPU load increases, a strategy is needed to increase the number of rejected requests accordingly to avoid further CPU load increase to ensure that the requests entering the system are returned to the user normally.

[0029] Based on this, a service request processing method according to an embodiment of the present application is provided to solve the technical problem of processor overload risk caused by service request processing errors of backend services.

[0030] Example:

[0031] Figure 1A flow chart of a service request processing method provided in an embodiment of the present application is given. The service request processing method provided in this embodiment can be executed by a service request processing device, which can be implemented by software and / or hardware. The service request processing device can be composed of two or more physical entities, or can be composed of one physical entity. Generally speaking, the service request processing device can be a processing device such as a back-end server, a service host, etc. of a live broadcast application.

[0032] The following description is made by taking the backend server as the subject of the service request processing method as an example. Figure 1 , the service request processing method specifically includes:

[0033] S110. Calculate the real-time concurrent request capacity based on the processor load information, where the processor load information indicates the real-time load of the current processor, and the real-time concurrent request capacity indicates the maximum number of concurrent service requests that the current processor can bear corresponding to the processor load information.

[0034] When processing service requests, this application determines the real-time load of the current processor, which is defined as the processor load information, and calculates the maximum number of concurrent service requests that the current processor can withstand based on the processor load information, which is defined as the real-time concurrent request capacity. The real-time concurrent request capacity is used to determine whether the current backend service can receive and process new service requests without the risk of overload.

[0035] Among them, the processor load information can be key performance indicators such as CPU usage, memory occupancy, disk I / O, network bandwidth usage, etc. This information can be obtained through the operating system's monitoring tools, third-party performance monitoring software, or custom scripts and programs. Based on the collected processor load information, a model that can reflect the current load status of the processor can be established. The model can take into account multiple factors, such as the correlation between different performance indicators, the trend of historical load data, etc. Using the established load model, combined with the characteristics of the backend service (such as the amount of resources required to process each request, the response time requirements of the request, etc.), linear regression, machine learning prediction, etc. are used to calculate the maximum number of concurrent service requests that the processor can stably process under the current load level, that is, the maximum number of concurrent service requests.

[0036] For example, refer to Figure 2 , providing a flow chart of the service request processing judgment of this application, for the service request received by the backend service, before calculating the real-time concurrent request capacity based on the processor load information, it also includes:

[0037] The processor load state is detected, and when the processor load state is in a specified high load state, real-time concurrent request capacity calculation is triggered; when the processor load state is not in the specified high load state, service requests received in real time are processed.

[0038] In the process of calculating the real-time concurrent request capacity based on the processor load information, a pre-step of processor load status detection is introduced. This pre-step ensures that the calculation of the real-time concurrent request capacity is triggered only when the processor is actually facing high load pressure, thereby avoiding unnecessary computing overhead and ensuring the efficient operation of the system under low load conditions.

[0039] Among them, the processor load status can be detected in real time or periodically through monitoring tools or custom scripts. The load status can be measured by multiple indicators, such as CPU usage, memory occupancy, disk I / O waiting time, etc. One or more thresholds are set. When the processor load exceeds these thresholds, the processor is considered to be in a high load state. If the processor load status detection result shows that the processor is in a specified high load state, the calculation process of the real-time concurrent request capacity is triggered, and the reception and processing judgment of the service request processing method is performed. If the processor load status is not in the specified high load state, the system can normally process the service requests received in real time. At this time, no additional load management policy adjustment is required because the processor has sufficient resources to handle the current request load. By detecting the processor load status and triggering calculations when the load is high, unnecessary computing overhead is avoided and the overall efficiency of the system is improved.

[0040] Optionally, detecting a processor load state includes:

[0041] When it is detected that the processor usage is higher than the processor usage threshold, it is determined that the processor load state is in a specified high load state; or,

[0042] When it is detected that the current window time is in the set high-load window period, it is determined that the processor load state is in the specified high-load state.

[0043] This application determines whether the CPU usage exceeds the pre-configured usage threshold, or determines whether the current window time is still in the window period of high load state determination. When any of the above two status bars are met, it is determined that the processor load state is in the specified high load state, thereby triggering the service request reception processing judgment logic.

[0044] A processor usage threshold is set, which represents the upper limit of the processor usage under normal working load. The processor usage is monitored in real time, and the monitored processor usage is compared with the set threshold. If the processor usage is higher than the set threshold, it is determined that the processor load state is in a specified high load state, thereby triggering the calculation process of the real-time concurrent request capacity.

[0045] By collecting relevant information such as CPU usage rate representing the processor load at multiple collection time nodes of the current window time, when the number of times the relevant information reaches the corresponding threshold reaches the set number of times, it is determined that the current window time is in a high-load window period. Alternatively, a high-load window period is directly set, which indicates that the processor is in a high-load state due to a specific task or user behavior during a specific time period of a day or a week. Then, the current window time is obtained in real time to determine whether the current window time is in the set high-load window period. If the current window time is in the set high-load window period, it is determined that the processor load state is in the specified high-load state, thereby triggering the calculation process of the real-time concurrent request capacity.

[0046] Optionally, the processor load information includes a processor load threshold and historical average concurrent request capacity information of the processor;

[0047] Before calculating the real-time concurrent request capacity based on processor load information, including:

[0048] Calculating an initial load threshold according to the processor usage and a preconfigured processor usage threshold, and selecting a maximum value as the processor load threshold based on a pre-set minimum load threshold and the initial load threshold;

[0049] Calculate the historical average concurrent request capacity information based on the number of successfully processed service requests and the minimum response time within a set period of time;

[0050] Calculates real-time concurrent request capacity based on processor load information, including:

[0051] The real-time concurrent request capacity is calculated based on the product of the processor load threshold and the historical average concurrent request capacity information.

[0052] When calculating the processor usage of the backend service, the average of the processor usage of the first M time periods is taken to avoid the impact of instantaneous CPU fluctuations on subsequent judgment logic. For short-term CPU jitters, overload protection should not be triggered.

[0053] The CPU is further dynamically adjusted based on the pre-configured processor usage threshold to obtain a real-time processor load threshold. The processor load threshold calculation formula is as follows:

[0054]

[0055] Where use is the currently calculated processor usage, and cputhreshold is the configured processor usage threshold. The processor load threshold calculation formula ensures that when the CPU load increases, the lower the feedback value, the more dynamic the rejection ratio of requests can be adjusted. 0.2 is the preset minimum load threshold, which is used to ensure that no matter how high the CPU usage is, at least 20% of the estimated system capacity service requests will be released to ensure the basic availability of the entire service.

[0056] On the other hand, Figure 3 As shown in the figure, for the historical average concurrent request capacity information, the concurrent request capacity of the system is calculated by recording the number of successfully processed requests (successRequest) and the minimum response time (minimumResponseTime) in the window time before the current time, that is, the historical average concurrent request capacity information. By setting the number of windows per second (perBuckets), for example, if the statistical period is 5 seconds and there are 50 windows in total, there will be 10 windows per second, and the time range of each window is 100 milliseconds. Finally, the calculated historical average concurrent request capacity information is:

[0057]

[0058] Based on the processor load threshold and the historical average concurrent request capacity information determined above, the real-time concurrent request capacity is obtained by multiplying the above two values, that is, the real-time concurrent request capacity k is:

[0059]

[0060] S120: Determine the real-time concurrent number of service requests currently being processed, and determine the average concurrent number of service requests processed within a set period of time.

[0061] Furthermore, based on the real-time concurrent request capacity k determined above, the present application determines the real-time concurrent number currentCurrency of the service requests currently being processed and the average concurrent number averageCurrency of the service requests processed within a set time period for comparison with the real-time concurrent request capacity k to determine whether to receive and process the service request.

[0062] Among them, the real-time concurrent number refers to the number of service requests that the system is processing simultaneously at the current moment. The real-time concurrent number can be determined by monitoring and counting the internal state of the system. For example, use commands such as top, htop, or ps to view the number of threads or processes in the current system, thereby indirectly judging the number of concurrent requests. Or use a task manager or performance monitor to view the usage of resources such as CPU and memory, and indirectly judge the concurrent load of the system by observing the usage of these resources. In addition, you can also use a programming language (such as Python) to write scripts to execute system commands and obtain output results, thereby calculating the current concurrent number of service requests. This application does not impose fixed restrictions on the method of determining the real-time concurrent number, and will not be elaborated here.

[0063] The average number of concurrent requests refers to the average number of service requests processed simultaneously by the system over a period of time. The average number of concurrent requests can be determined by statistics and analysis of historical data. For example, by analyzing the access logs of the server, the number of service requests in different time periods can be determined, and the average number of concurrent requests can be calculated. This application does not impose fixed restrictions on the method of determining the average number of concurrent requests, and will not be elaborated on here.

[0064] Optionally, determine the average concurrent number of service requests processed during a set period of time, including:

[0065] The initial average concurrent number is calculated based on the number of concurrent service requests counted in multiple window times within a set period, and the average concurrent number is updated based on the real-time concurrent number.

[0066] By setting the number of concurrent service requests counted in multiple window times within a set period, combined with the statistical times, the average number of concurrent service requests in multiple window times can be calculated, which is defined as the initial average concurrent number. Then, combined with the real-time concurrent number of service requests processed by the processor collected at the current time, the average concurrent number can be updated.

[0067] Optionally, update the average concurrency based on the real-time concurrency, including:

[0068] Based on the real-time concurrent number, the first weighted coefficient of the real-time concurrent number, the initial average concurrent number and the second weighted coefficient of the initial average concurrent number, weighted summation is performed to obtain the updated average concurrent number, and the sum of the first weighted coefficient and the second weighted coefficient is 1.

[0069] Different from the above method of updating the average concurrent number directly based on the real-time concurrent number collected at the current time, this application combines the real-time concurrent number and the initial average concurrent number for weighted summation to obtain the updated average concurrent number. The update formula is:

[0070] averageCurrency=averageCurrency_0×factor+currenetCurrency×(1-factor)

[0071] Among them, averageCurrency is the updated average concurrency, averageCurrency_0 is the initial average concurrency, currentCurrency is the real-time concurrency, 1-factor is the first weighted coefficient, factor is the second weighted coefficient, and the commonly used value of factor is 0.9. Its main purpose is to make the impact of the real-time concurrency currentCurrency slightly delayed, so that the system can react more smoothly to changes in the number of requests. Therefore, when service requests increase rapidly, the increase of the average concurrency averageCurrency is slightly slower, allowing more requests to enter the system. When requests decrease rapidly, the average concurrency averageCurrency decreases slowly, which can maintain the stability of the system and avoid excessive reduction of backend service processing capabilities.

[0072] S130 , comparing the real-time concurrent request capacity based on the real-time concurrent number and the average concurrent number, and performing corresponding processing on the service request received in real time according to the comparison result.

[0073] Furthermore, based on the above-determined real-time concurrent number currenetCurrency and average concurrent number averageCurrency, the present application compares the above-mentioned real-time concurrent request capacity k by comparing the real-time concurrent number currenetCurrency and the average concurrent number averageCurrency respectively, and then determines whether to receive and process the new service request introduced by the backend service. When both the real-time concurrent number currenetCurrency and the average concurrent number averageCurrency exceed the real-time concurrent request capacity k, the newly added service request will be rejected. Otherwise, the service request will be received and processed.

[0074] By recording relevant operation data during the service line operation, the maximum number of concurrent service requests that the current system can withstand can be directly calculated without the need for pre-stress testing to evaluate the system's QPS, which saves some of the capacity evaluation time before the service goes online and also increases the bottom-line protection. Through an adaptive formula, the number of rejected requests is dynamically controlled when the CPU is overloaded. When the CPU is too high, more requests are rejected, ensuring that when the number of concurrent requests is too large, the backend service can still respond stably to service requests entering the service system.

[0075] Specifically, the judgment logic for whether a request needs to be rejected is as follows:

[0076] After each service request is introduced, the real-time concurrent request capacity k is compared with the real-time concurrent number currenetCurrency and the average concurrent number averageCurrency to determine whether the current processor is overloaded. If the load is not exceeded, the real-time concurrent number currentCurrency+1 is executed before the actual execution of the business logic (a new service request is added for processing), and then the business logic is executed to process the service request. After the execution of this service request is completed, currentCurrency-1 is updated. At the same time, the average concurrent number averageCurrency is maintained as described above for subsequent service request processing judgment logic.

[0077] In actual applications, the automatic expansion and contraction method of the k8s system can also be used to process service requests. And the processor usage threshold cpuThreshold configured in the service of this application must be greater than the automatic expansion cpu threshold. That is, the service request is first processed by automatic expansion and contraction. When the load increases further, the service request is processed based on the service request processing method of this application to achieve disaster recovery processing of the service request.

[0078] In the above, by calculating the real-time concurrent request capacity based on the processor load information, the processor load information indicates the real-time load of the current processor, and the real-time concurrent request capacity indicates the maximum number of concurrent service requests that the current processor can bear corresponding to the processor load information; determining the real-time concurrent number of service requests currently being processed, and determining the average concurrent number of service requests processed within a set period; comparing the real-time concurrent request capacity based on the real-time concurrent number and the average concurrent number, and processing the service requests received in real time accordingly according to the comparison results. By adopting the above technical means, the real-time concurrent request capacity that the processor can bear is determined by evaluating the processor load in real time, and the real-time concurrent request capacity is compared based on the real-time concurrent number and the average concurrent number, so as to accurately determine whether to receive the current service request for processing, realize overload protection of the back-end service, and thus improve the stability and reliability of service request processing.

[0079] Based on the above embodiments, Figure 4 A schematic diagram of the structure of a service request processing system provided by this application. Figure 4 The service request processing system provided in this embodiment specifically includes: a first calculation module 21, a second calculation module 22 and a processing module 23.

[0080] The first calculation module 21 is configured to calculate the real-time concurrent request capacity based on the processor load information, the processor load information indicates the real-time load of the current processor, and the real-time concurrent request capacity indicates the maximum number of concurrent service requests that the current processor can bear corresponding to the processor load information;

[0081] A second calculation module 22 is configured to determine the real-time concurrent number of service requests currently being processed, and determine the average concurrent number of service requests processed within a set period of time;

[0082] The processing module 23 is configured to compare the real-time concurrent request capacity based on the real-time concurrent number and the average concurrent number, and perform corresponding processing on the service request received in real time according to the comparison result.

[0083] Specifically, before calculating the real-time concurrent request capacity based on the processor load information, the method further includes:

[0084] The processor load state is detected, and when the processor load state is in a specified high load state, real-time concurrent request capacity calculation is triggered; when the processor load state is not in the specified high load state, service requests received in real time are processed.

[0085] The detecting of the processor load state includes:

[0086] When it is detected that the processor usage is higher than the processor usage threshold, it is determined that the processor load state is in a specified high load state; or,

[0087] When it is detected that the current window time is in the set high-load window period, it is determined that the processor load state is in the specified high-load state.

[0088] Specifically, the processor load information includes a processor load threshold and historical average concurrent request capacity information of the processor;

[0089] Before calculating the real-time concurrent request capacity based on processor load information, including:

[0090] Calculating an initial load threshold according to the processor usage and a preconfigured processor usage threshold, and selecting a maximum value as the processor load threshold based on a pre-set minimum load threshold and the initial load threshold;

[0091] Calculate the historical average concurrent request capacity information based on the number of successfully processed service requests and the minimum response time within a set period of time;

[0092] Calculates real-time concurrent request capacity based on processor load information, including:

[0093] The real-time concurrent request capacity is calculated based on the product of the processor load threshold and the historical average concurrent request capacity information.

[0094] Specifically, determine the average concurrent number of service requests processed within a set period, including:

[0095] The initial average concurrent number is calculated based on the number of concurrent service requests counted in multiple window times within a set period, and the average concurrent number is updated based on the real-time concurrent number.

[0096] Update the average concurrent number based on the real-time concurrent number, including:

[0097] Based on the real-time concurrent number, the first weighted coefficient of the real-time concurrent number, the initial average concurrent number and the second weighted coefficient of the initial average concurrent number, weighted summation is performed to obtain the updated average concurrent number, and the sum of the first weighted coefficient and the second weighted coefficient is 1.

[0098] In the above, by calculating the real-time concurrent request capacity based on the processor load information, the processor load information indicates the real-time load of the current processor, and the real-time concurrent request capacity indicates the maximum number of concurrent service requests that the current processor can bear corresponding to the processor load information; determining the real-time concurrent number of service requests currently being processed, and determining the average concurrent number of service requests processed within a set period; comparing the real-time concurrent request capacity based on the real-time concurrent number and the average concurrent number, and processing the service requests received in real time accordingly according to the comparison results. By adopting the above technical means, the real-time concurrent request capacity that the processor can bear is determined by evaluating the processor load in real time, and the real-time concurrent request capacity is compared based on the real-time concurrent number and the average concurrent number, so as to accurately determine whether to receive the current service request for processing, realize overload protection of the back-end service, and thus improve the stability and reliability of service request processing.

[0099] The service request processing system provided in the embodiment of the present application can be configured to execute the service request processing method provided in the above embodiment, and has corresponding functions and beneficial effects.

[0100] Based on the above practical example, the present application embodiment also provides a service request processing device, referring to Figure 5, the service request processing device includes: a processor 31, a memory 32, a communication module 33, an input device 34 and an output device 35. The memory, as a computer-readable storage medium, can be configured to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the service request processing method described in any embodiment of the present application (for example, the first computing module, the second computing module and the processing module in the service request processing system). The communication module is configured to perform data transmission. The processor executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory, that is, realizes the above-mentioned service request processing method. The input device can be configured to receive input digital or character information, and generate key signal input related to the user settings and function control of the device. The output device may include a display device such as a display screen. The service request processing device provided above can be configured to execute the service request processing method provided in the above-mentioned embodiment, and has corresponding functions and beneficial effects.

[0101] On the basis of the above embodiments, the embodiments of the present application further provide a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores computer-executable instructions, wherein the computer-executable instructions are configured to execute a service request processing method when executed by a computer processor, and the storage medium may be any of various types of memory devices or storage devices. Of course, the non-volatile computer-readable storage medium provided in the embodiments of the present application, whose computer-executable instructions are not limited to the service request processing method described above, may also execute related operations in the service request processing method provided in any embodiment of the present application.

[0102] On the basis of the above embodiments, the embodiments of the present application also provide a computer program product. The essence of the technical solution of the present application or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer program product is stored in a storage medium, including a number of instructions for enabling a computer device, a mobile terminal or a processor therein to execute all or part of the steps of the service request processing method described in each embodiment of the present application.

Claims

1. A service request processing method, characterized in that: include: Calculating the real-time concurrent request capacity based on the processor load information, wherein the processor load information indicates the real-time load of the current processor, and the real-time concurrent request capacity indicates the maximum number of concurrent service requests that the current processor can bear corresponding to the processor load information; Determine the real-time concurrent number of service requests currently being processed and determine the average concurrent number of service requests processed within a set period of time; The real-time concurrent request capacity is compared based on the real-time concurrent number and the average concurrent number, and the service requests received in real time are processed accordingly according to the comparison result.

2. The service request processing method according to claim 1, characterized in that: The processor load information includes a processor load threshold and historical average concurrent request capacity information of the processor; Before calculating the real-time concurrent request capacity based on the processor load information, the method includes: Calculating an initial load threshold according to a processor usage rate and a preconfigured processor usage rate threshold, and selecting a maximum value as the processor load threshold based on a pre-set minimum load threshold and the initial load threshold; Calculate the historical average concurrent request capacity information based on the number of successfully processed service requests and the minimum response time within a set period of time; The calculating of real-time concurrent request capacity based on processor load information includes: The real-time concurrent request capacity is determined based on the product of the processor load threshold and the historical average concurrent request capacity information.

3. The service request processing method according to claim 1, characterized in that: Determining the average concurrent number of service requests processed within a set period includes: An initial average concurrent number is calculated based on the number of concurrent service requests counted in multiple window times within a set period of time, and the average concurrent number is updated based on the real-time concurrent number.

4. The service request processing method according to claim 3, characterized in that: The updating of the average concurrent number based on the real-time concurrent number includes: Based on the real-time concurrent number, the first weighted coefficient of the real-time concurrent number, the initial average concurrent number and the second weighted coefficient of the initial average concurrent number, the updated average concurrent number is obtained by weighted summation, and the sum of the first weighted coefficient and the second weighted coefficient is 1.

5. The service request processing method according to claim 1, characterized in that: The corresponding processing of the service request received in real time according to the comparison result includes: When both the real-time concurrent number and the average concurrent number exceed the real-time concurrent request capacity, reject the service request received in real time; In a case where the real-time concurrent number and / or the average concurrent number does not exceed the real-time concurrent request capacity, the service requests received in real time are processed and the real-time concurrent number is updated.

6. The service request processing method according to any one of claims 1 to 5, characterized in that: Before calculating the real-time concurrent request capacity based on the processor load information, the method further includes: Detect the processor load state, and when the processor load state is in a specified high load state, trigger the real-time concurrent request capacity calculation, and when the processor load state is not in the specified high load state, process the service request received in real time.

7. The service request processing method according to claim 6, characterized in that: The detecting of the processor load state comprises: When it is detected that the processor usage rate is higher than the processor usage rate threshold, determining that the processor load state is in a specified high load state; or, When it is detected that the current window time is in a set high-load window period, it is determined that the processor load state is in a specified high-load state.

8. A service request processing system, characterized in that: include: A first calculation module is configured to calculate the real-time concurrent request capacity based on the processor load information, wherein the processor load information indicates the real-time load of the current processor, and the real-time concurrent request capacity indicates the maximum number of concurrent service requests that the current processor can bear corresponding to the processor load information; A second calculation module is configured to determine the real-time concurrent number of service requests currently being processed, and determine the average concurrent number of service requests processed within a set period of time; The processing module is configured to compare the real-time concurrent request capacity based on the real-time concurrent number and the average concurrent number, and perform corresponding processing on the service request received in real time according to the comparison result.

9. A service request processing device, characterized in that: include: memory and one or more processors; The memory is configured to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the service request processing method according to any one of claims 1 to 7.

10. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a computer processor, they are configured to execute the service request processing method according to any one of claims 1 to 7.

11. A computer program product, characterized in that The computer program product includes instructions, and when the instructions are executed on a computer or a processor, the computer or the processor executes the service request processing method according to any one of claims 1 to 7.