Request sending method, device, computer device, readable storage medium and program product

By building a functional relationship to dynamically adjust the number of request sending connections, the problem of receiver overload in CDN is solved, and timely log delivery and improved resource utilization efficiency are achieved.

CN119652971BActive Publication Date: 2025-09-30CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411748081.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-09-30
Estimated Expiration
2044-12-02

AI Technical Summary

Technical Problem

In content distribution networks, insufficient client receiving capabilities can easily lead to overload of the receiving server, resulting in an avalanche effect. Existing technologies cannot effectively prevent receiver overload and ensure timely delivery of logs.

Method used

By building a functional relationship between the total number of requests and the number of successful requests and failed requests, the change rate of the number of requests is determined, and the number of connections sending requests to the receiving server is dynamically adjusted to control the request rate to avoid overload.

Benefits of technology

This ensures the maximum possible throughput while avoiding receiver overload, improving resource utilization efficiency, ensuring timely log delivery, and reducing the probability of request failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119652971B_ABST
    Figure CN119652971B_ABST
Patent Text Reader

Abstract

The present application relates to a request sending method, apparatus, computer device, computer-readable storage medium, and computer program product. The method comprises: obtaining the total number of requests, the number of successful requests, and the number of failed requests sent to a receiving server within multiple sets of preset time intervals; establishing a first functional relationship between the number of requests and the number of successful requests, and a second functional relationship between the number of requests and the number of failed requests; determining a first rate of change in the number of successful requests based on the first functional relationship, and determining a second rate of change in the number of failed requests based on the second functional relationship; and increasing the number of connections used to simultaneously send requests to the receiving server when the first rate of change is greater than zero and greater than the second rate of change. This method can prevent receiving server overload and ensure timely log delivery.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data technology, and in particular to a request sending method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] In a content delivery network (CDN), each user access generates one or more access logs, recording basic request information and other customized information. Some customers prefer that CDN providers return these access logs for internal analysis.

[0003] Because logs are independent and suitable for parallel processing, CDN server providers typically use an automatically scalable thread pool to include logs in requests for sending. As the number of requests increases, new sending threads and TCP (Transmission Control Protocol) connections are dynamically created. However, due to varying customer skill levels and technical architectures, some customers may have insufficient receiving capacity. When business volume increases significantly, receiving overload can easily occur, triggering alarms on the receiving server and even leading to an avalanche effect. Therefore, a request sending method that prevents receiving overload and ensures timely log delivery is urgently needed. Summary of the Invention

[0004] Based on this, it is necessary to provide a request sending method, apparatus, computer device, computer-readable storage medium and computer program product that can prevent the recipient from being overloaded and ensure timely delivery of logs to address the above technical problems.

[0005] In a first aspect, the present application provides a request sending method, comprising:

[0006] Obtain the total number of requests, the number of successful requests, and the number of failed requests sent to the receiving server within multiple preset time intervals;

[0007] Constructing a first functional relationship between the total number of requests and the number of successful requests and a second functional relationship between the total number of requests and the number of failed requests, and determining a first change rate of the number of successful requests based on the first functional relationship, and determining a second change rate of the number of failed requests based on the second functional relationship;

[0008] In a case where the first change rate is greater than zero and greater than the second change rate, the number of connections used to simultaneously send requests to the receiving server is increased.

[0009] In one embodiment, when the first change rate is greater than zero and greater than the second change rate, increasing the number of connections used to simultaneously send requests to the receiving server includes:

[0010] When the first change rate is greater than zero and greater than the second change rate, one connection is added each time for simultaneously sending requests to the receiving server.

[0011] In one embodiment, after determining the first change rate of the number of successful requests based on the first functional relationship and determining the second change rate of the number of failed requests based on the second functional relationship, the method further includes:

[0012] In a case where the second change rate is greater than zero and greater than the first change rate, the number of connections used to simultaneously send requests to the receiving server is reduced.

[0013] In one embodiment, when the second change rate is greater than zero and greater than the first change rate, reducing the number of connections used to simultaneously send requests to the receiving server includes:

[0014] Get the maximum number of requests that can be sent based on a single connection within the current time window;

[0015] Calculating a product of the maximum number and the second change rate, and calculating a ratio of the number of failed requests to the product;

[0016] Rounding down the ratio to obtain a target change value;

[0017] When the second change rate is greater than zero and greater than the first change rate, the number of connections for simultaneously sending requests to the receiving server with a target change value is reduced.

[0018] In one embodiment, obtaining the total number of requests, the number of successful requests, and the number of failed requests sent to the receiving server within the plurality of preset time intervals includes:

[0019] If the state of the connection used to send the request to the receiving server is abnormal, the response to the request is abnormal, or the time taken to send the request exceeds a preset time threshold, the number of failed requests is increased by 1.

[0020] In one embodiment, the constructing a first functional relationship between the total number of requests and the number of successful requests and a second functional relationship between the total number of requests and the number of failed requests includes:

[0021] Based on the least squares method, linear fitting is performed on the change of the number of successful requests with the total number of requests to obtain a first functional relationship;

[0022] Based on the least square method, a linear fit is performed on the change in the number of failed requests as a function of the total number of requests to obtain a second functional relationship.

[0023] In a second aspect, the present application further provides a request sending device, comprising:

[0024] A data acquisition module is used to obtain the total number of requests, the number of successful requests, and the number of failed requests sent to the receiving server within multiple groups of preset time intervals;

[0025] a data processing module, constructing a first functional relationship between the total number of requests and the number of successful requests and a second functional relationship between the total number of requests and the number of failed requests, and determining a first change rate of the number of successful requests based on the first functional relationship, and determining a second change rate of the number of failed requests based on the second functional relationship;

[0026] The connection adjustment module is configured to increase the number of connections used to simultaneously send requests to the receiving server when the first change rate is greater than zero and greater than the second change rate.

[0027] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any of the above methods when executing the computer program.

[0028] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of any of the above-described methods when the computer program is executed by a processor.

[0029] In a fifth aspect, the present application also provides a computer program product, comprising a computer program, which implements the steps of any of the above methods when executed by a processor.

[0030] The above-mentioned request sending method, apparatus, computer equipment, computer-readable storage medium and computer program product do not need to rely on the information of the receiving server. By identifying the situation where increasing the number of requests will lead to an increase in throughput and the benefits outweigh the losses, the number of connections used to simultaneously send requests to the receiving server is increased. This can achieve effective expansion of request sending while ensuring the highest possible throughput, avoid large-scale request failures on the client side, reduce the probability of receiving overload, and avoid wasting connections on invalid requests, thereby improving the sender's resource utilization efficiency and ensuring the timely delivery of logs. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.

[0032] Figure 1 A schematic diagram of a process of sending a request in one embodiment;

[0033] Figure 2 Schematic diagram of the process of step S206 in one embodiment;

[0034] Figure 3 A flowchart of a request sending method according to another embodiment;

[0035] Figure 4 Schematic diagram of the process of step S207 in one embodiment;

[0036] Figure 5 A flowchart of a request sending method in yet another embodiment;

[0037] Figure 6 A flowchart illustrating steps for constructing a first functional relationship between the total number of requests and the number of successful requests and a second functional relationship between the total number of requests and the number of failed requests in one embodiment;

[0038] Figure 7 is a structural block diagram of a request sending device in one embodiment;

[0039] Figure 8 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0041] Currently, large-scale distributed systems often require extensive support systems to aggregate and analyze business metrics for billing and maintenance purposes. For example, with CDN networks, both cloud service providers and customers require real-time visibility into the traffic generated by their businesses. Therefore, some customers require real-time access to logs generated by the CDN network for analysis. However, these customers often also have high usage. For example, some users can experience peak request volumes of up to 2.4 million requests per second. For example, an HTTP (HyperText Transfer Protocol) request containing 5,000 log entries would require 4,800 requests per second to complete the transmission. Assuming a single log entry contains 500 bytes and a compression ratio of 0.5, this would consume 572 MiB / s (4,576 Mbps) of bandwidth, undoubtedly placing significant strain on both the sender and receiver.

[0042] Therefore, both senders and receivers typically increase processing capacity through horizontal scaling. For example, senders typically use an auto-scaling thread pool, creating new send threads and corresponding TCP connections as the number of requests increases. Receivers typically add more servers to handle the increase in requests. However, a higher number of requests does not necessarily result in higher throughput (the amount of data successfully transmitted per unit time). Receivers always have a processing limit, exceeding which they reject some requests, potentially leading to an avalanche. For example, if business volume increases significantly, and the sender has already scaled to increase requests while the receiver has not yet adjusted, an avalanche effect is more likely to occur (the system's processing capacity does not scale linearly with the number of requests, but instead drops sharply after a certain point).

[0043] Some related technologies offer reception control strategies implemented on the receiving server. However, in practice, there are business boundaries between cloud service providers and clients. Cloud service providers cannot interfere with clients' technical architectures, and clients do not expose their processing capabilities to external parties. Other related technologies offer self-limiting methods to prevent external system avalanches, but these methods do not consider throughput issues and instead optimize for a zero call success rate from the perspective of service failure.

[0044] Based on this, the embodiment of the present application provides a request sending method, and this embodiment uses the method applied to the sending server as an example. Figure 1 As shown, the method includes the following steps:

[0045] Step S202: Obtain the total number of requests, the number of successful requests, and the number of failed requests sent to the receiving server within multiple groups of preset time intervals.

[0046] For example, within a series of fixed-length time windows (e.g., 1 second), as the working conditions of the receiver and sender fluctuate (e.g., the amount of data to be transmitted changes), the number of requests will fluctuate. Therefore, the request status within multiple fixed-length time windows can be collected at preset intervals, and the change trend can be used as the basis for decision making. For example, for {0, …, n}, you can preset the duration of each interval Collect n groups Among them, the total number of requests It can be the total number of requests sent per second, the number of successful requests The total number of successful requests sent per second, the number of failed requests It can be the total number of failed requests per second. In one possible implementation, whether a request is successfully sent can be determined based on the response status code of the request. It is understandable that only successfully sent requests are effective throughput.

[0047] Step S204: construct a first functional relationship between the total number of requests and the number of successful requests and a second functional relationship between the total number of requests and the number of failed requests, and determine a first change rate of the number of successful requests based on the first functional relationship, and determine a second change rate of the number of failed requests based on the second functional relationship.

[0048] For example, the response of the server depends on the number of requests sent. Since the server itself can be regarded as unchanged within the preset time interval, the total number of requests can be regarded as the independent variable of the number of successful requests and the number of failed requests. Then, their derivatives can be used to represent the change rate of the number of successful requests and the number of failed requests when the total number of requests changes. For example, the first formula can be used to determine the number of successful requests: With the total number of requests First rate of change , the first formula may include:

[0049] ;

[0050] The second formula can be used to determine the number of failed requests With the total number of requests Second rate of change , the second formula may include:

[0051] ;

[0052] It is understandable that the first rate of change and the second rate of change The sign change of can be used to represent the gains and losses when the total number of requests changes.

[0053] Step S206: When the first change rate is greater than zero and greater than the second change rate, increase the number of connections used to simultaneously send requests to the receiving server.

[0054] Among them, the first change rate is greater than zero, which can be used to indicate that increasing the number of requests will result in more successfully sent requests (that is, an increase in throughput); the first change rate is greater than the second change rate, which can be used to indicate that the change in the number of successful requests caused by increasing the number of requests is greater than the change in the number of failed requests.

[0055] Since the number of connections used to simultaneously send requests to the receiving server and the response time are fixed, the maximum sending capacity of the sender is fixed. Therefore, the rate of sending requests can be controlled by adjusting the number of connections used to simultaneously send requests to the receiving server. For example, a triggering judgment condition can be added to the connection pool scheduling framework in the related art based on the connection utilization and the number of requests to be sent to trigger the increase of the number of connections.

[0056] In one possible implementation, the connections used to simultaneously send requests to the receiving server can be characterized by concurrency. For example, when the connection utilization is 100%, the currently required parallelism p can be determined using the third formula, which may include:

[0057] ;

[0058] Among them, ceil() is a floating rounding function. is the total number of requests the sender wants to send per second, The maximum number of requests that can be sent per connection per second. The fourth formula can be used to determine , the fourth formula may include:

[0059] ;

[0060] in, is the response time. Therefore, by calculating the currently required parallelism p, the number of connections that need to be created can be determined. It can be understood that if Greater than , a second connection (for example, a TCP connection) needs to be created. When p is 2, there will definitely be two requests sent at the same time.

[0061] It's important to note that, unlike concurrent tasks, which emphasize simultaneous execution within a time period, a time period is composed of multiple units of time. Concurrent tasks don't necessarily execute simultaneously within that unit of time. Parallelism refers to the number of tasks executing simultaneously. In the specific business scenario of log transmission, the parallelism metric can be the number of connections in the thread pool.

[0062] In the above request sending method, there is no need to rely on the information of the receiving server. By identifying the situation where increasing the number of requests will lead to an increase in throughput and the benefits outweigh the losses, the number of connections used to simultaneously send requests to the receiving server is increased. This can achieve effective expansion of request sending while ensuring the largest possible throughput, avoid large-scale request failures on the client side, reduce the probability of receiver overload, and avoid wasting connections on invalid requests, thereby improving the sender's resource utilization efficiency and ensuring timely delivery of logs.

[0063] In an exemplary embodiment, Figure 2 As shown, the above step S206 includes:

[0064] Step S2061: When the first change rate is greater than zero and greater than the second change rate, one connection is added each time for simultaneously sending requests to the receiving server.

[0065] For example, the change in the number of connections for simultaneously sending requests to the receiving server can be limited. Equal to 1. In this way, when it is determined that additional connections are allowed, the growth rate of connections can be controlled to control the total number of requests sent in the current time window (between two adjustments).

[0066] Optionally, when the first change rate and the second change rate are less than or equal to zero, the change in the number of connections Can be equal to 0.

[0067] In an exemplary embodiment, Figure 3 As shown, the above method may further include:

[0068] Step S207: When the second change rate is greater than zero and greater than the first change rate, reduce the number of connections used to simultaneously send requests to the receiving server.

[0069] The second rate of change being greater than zero can be used to indicate that increasing the number of requests will result in more failed requests. The second rate of change being greater than the first rate of change can be used to indicate that increasing the number of requests results in a smaller change in the number of successful requests than in the number of failed requests. Therefore, the number of connections used to simultaneously send requests to the receiving server can be reduced to reduce the rate at which requests are sent. In one possible implementation, the execution of step S207 can be triggered in parallel with the operation of the connection pool scheduling framework in the related art to determine the recovery of idle connections based on connection utilization, without affecting each other.

[0070] If a single IP address (Internet Protocol Address) of the receiver uses a reverse proxy to point to multiple processing servers, and one or more of them fails, and there is no reasonable health check mechanism to eliminate the failed servers, a fixed proportion of requests sent to the IP address will be forwarded to the failed servers, resulting in failed requests. The proportion of failed requests is fixed, that is, In this case, since there is no mutual impact between the faulty server and the normal server, it is also effective to continue to increase the number of requests sent.

[0071] In this embodiment, by identifying the situation where increasing the number of requests cannot bring about an increase in throughput and the losses caused are greater than the benefits, the parallelism is reduced, which can avoid the waste of resources caused by too many connections and the memory usage of the server.

[0072] Furthermore, the number of connections that need to be reduced can be determined by performing a linear prediction estimate on the number of failed requests. Figure 4 As shown, the above step S207 may include:

[0073] Step S2071: Obtain the maximum number of requests that can be sent based on a single connection within the current time window.

[0074] Step S2072: Calculate the product of the maximum number and the second change rate, and calculate the ratio of the number of failed requests to the product.

[0075] Step S2073: round down the ratio to obtain the target change value.

[0076] Step S2074: When the second change rate is greater than zero and greater than the first change rate, reduce the number of connections for simultaneously sending requests to the receiving server with the target change value.

[0077] For example, when the number of failed requests needs to be Reduced to 0, the fifth formula can be used to determine the target change value , the fifth formula may include:

[0078] ;

[0079] Among them, the target change value is the change in the number of connections in the current time window, that is, the change in the number of connections adjusted this time, floor() is the rounding function. The number of failed requests that needs to be reduced, The second change in the number of failed requests. The maximum number of requests that can be sent based on a single connection within the current time window. The sixth formula can also be used to determine the target change value. , the sixth formula may include:

[0080] ;

[0081] in, is the response time, The duration of the current time window.

[0082] In this embodiment, based on the proportion of failed requests that will result from the increase in the number of requests, the number of requests that need to be withdrawn can be estimated. Further, based on the number of requests that need to be withdrawn and the number of requests that can be carried by a single connection at full load, the number of connections that need to be reduced can be estimated.

[0083] In an exemplary embodiment, Figure 5 As shown, the above method may further include:

[0084] Step S201: when the state of the connection used to send the request to the receiving server is abnormal, the response to the request is abnormal, or the time taken to send the request exceeds a preset time threshold, the number of failed requests is increased by 1.

[0085] For example, requests that complete the TCP phase normally, do not time out or reset the connection, do not actively close the connection on the server, return a normal HTTP status code of 200, and do not exceed a preset time threshold (e.g., 5 seconds) can be counted as successful requests. Requests that do not meet any of the above conditions can be counted as failed requests.

[0086] Optionally, only the response time of successful requests can be used to calculate the response time. Response time Methods for determining may include calculating a mean or a median.

[0087] In an exemplary embodiment, Figure 6 As shown, the steps of constructing a first functional relationship between the total number of requests and the number of successful requests and a second functional relationship between the total number of requests and the number of failed requests include:

[0088] Step A1: Based on the least square method, a linear fitting is performed on the change of the number of successful requests with the total number of requests to obtain a first functional relationship.

[0089] In step A2, based on the least square method, a linear fit is performed on the variation of the number of failed requests with the total number of requests to obtain a second functional relationship.

[0090] For example, each interval has a preset duration. Collect n groups Since the business scenario does not change suddenly, the first functional relationship between the total number of requests and the number of successful requests can be a linear relationship. The first functional relationship may include:

[0091] ;

[0092] The second functional relationship between the total number of requests and the number of failed requests may be a linear relationship, and the second functional relationship may include:

[0093] ;

[0094] in, and is the linear intercept.

[0095] In one possible implementation, The time taken for the least squares method to fit the data is 10 seconds, and 6 sets of data can be collected every minute for least squares fitting, achieving a good balance between accuracy and response speed (the response time for most requests is within 5 seconds, and twice the response time is long enough). In scenarios with larger data volumes but better network conditions, such as internal systems using intranet transmission, It can be further reduced to 2 times the average response time.

[0096] To sum up, the above request sending method does not need to rely on the information of the receiving server. By identifying the situation where increasing the number of requests will lead to an increase in throughput and the benefits outweigh the losses, the number of connections used to simultaneously send requests to the receiving server is increased. This can achieve effective expansion of request sending while ensuring the largest possible throughput, avoid large-scale request failures on the client side, reduce the probability of receiver overload, and avoid wasting connections on invalid requests, thereby improving the sender's resource utilization efficiency and ensuring timely delivery of logs.

[0097] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0098] Based on the same inventive concept, embodiments of the present application further provide a request sending device for implementing the aforementioned request sending method. The implementation solution provided by this device is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations in one or more of the request sending device embodiments provided below can be found in the above-mentioned limitations on the request sending method and will not be further elaborated here.

[0099] In an exemplary embodiment, Figure 7 As shown, a request sending device 300 is provided, comprising: a data acquisition module 301, a data processing module 302 and a connection adjustment module 303, wherein:

[0100] The data acquisition module 301 is used to acquire the total number of requests, the number of successful requests, and the number of failed requests sent to the receiving server within multiple groups of preset time intervals.

[0101] The data processing module 302 is used to construct a first functional relationship between the total number of requests and the number of successful requests and a second functional relationship between the total number of requests and the number of failed requests, and to determine a first change rate of the number of successful requests based on the first functional relationship and a second change rate of the number of failed requests based on the second functional relationship.

[0102] The connection adjustment module 303 is configured to increase the number of connections used to simultaneously send requests to the receiving server when the first change rate is greater than zero and greater than the second change rate.

[0103] In an exemplary embodiment, the connection adjustment module 303 is further configured to:

[0104] When the first change rate is greater than zero and greater than the second change rate, one connection is added each time for simultaneously sending requests to the receiving server.

[0105] In an exemplary embodiment, the connection adjustment module 303 is further configured to:

[0106] In a case where the second change rate is greater than zero and greater than the first change rate, the number of connections used to simultaneously send requests to the recipient server is reduced.

[0107] In an exemplary embodiment, the connection adjustment module 303 is further configured to:

[0108] Get the maximum number of requests that can be sent based on a single connection within the current time window;

[0109] Calculate the product of the maximum number and the second change rate, and calculate the ratio of the number of failed requests to the product;

[0110] Round the ratio down to get the target change value;

[0111] When the second change rate is greater than zero and greater than the first change rate, the number of connections for simultaneously sending requests to the receiving server with the target change value is reduced.

[0112] In an exemplary embodiment, the request sending device 300 further includes:

[0113] The request judgment module is used to increase the number of failed requests by 1 when the state of the connection used to send the request to the receiving server is abnormal, the response to the request is abnormal, or the time taken to send the request exceeds a preset time threshold.

[0114] In an exemplary embodiment, the data processing module 302 is further configured to:

[0115] Based on the least squares method, a linear fit is performed on the change of the number of successful requests with the total number of requests to obtain the first functional relationship;

[0116] Based on the least squares method, a linear fitting is performed on the change in the number of failed requests with the total number of requests to obtain the second functional relationship.

[0117] Each module in the request sending device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0118] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 8As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a request sending method is implemented.

[0119] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0120] In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.

[0121] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0122] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0123] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0124] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.

[0125] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0126] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A request sending method, characterized in that: The method comprises: Obtain the total number of requests, the number of successful requests, and the number of failed requests sent to the receiving server within multiple preset time intervals; Constructing a first functional relationship between the total number of requests and the number of successful requests and a second functional relationship between the total number of requests and the number of failed requests, and determining a first change rate of the number of successful requests based on the first functional relationship, and determining a second change rate of the number of failed requests based on the second functional relationship; In a case where the first change rate is greater than zero and greater than the second change rate, increasing the number of connections used to simultaneously send requests to the receiving server; When the second change rate is greater than zero and greater than the first change rate, reducing the number of connections used to simultaneously send requests to the receiving server; Wherein, when the second change rate is greater than zero and greater than the first change rate, reducing the number of connections used to simultaneously send requests to the receiving server includes: Get the maximum number of requests that can be sent based on a single connection within the current time window; Calculating a product of the maximum number and the second change rate, and calculating a ratio of the number of failed requests to the product; Rounding down the ratio to obtain a target change value; When the second change rate is greater than zero and greater than the first change rate, the number of connections for simultaneously sending requests to the receiving server with a target change value is reduced.

2. The method according to claim 1, characterized in that When the first change rate is greater than zero and greater than the second change rate, increasing the number of connections for simultaneously sending requests to the receiving server includes: When the first change rate is greater than zero and greater than the second change rate, one connection is added each time for simultaneously sending requests to the receiving server.

3. The method according to claim 1, characterized in that The total number of requests, the number of successful requests, and the number of failed requests sent to the receiving server within the plurality of preset time intervals are obtained, including: If the state of the connection used to send the request to the receiving server is abnormal, the response to the request is abnormal, or the time taken to send the request exceeds a preset time threshold, the number of failed requests is increased by 1.

4. The method according to claim 1, wherein The constructing of a first functional relationship between the total number of requests and the number of successful requests and a second functional relationship between the total number of requests and the number of failed requests includes: Based on the least squares method, linear fitting is performed on the change of the number of successful requests with the total number of requests to obtain a first functional relationship; Based on the least square method, a linear fit is performed on the change in the number of failed requests as a function of the total number of requests to obtain a second functional relationship.

5. A request sending device, characterized in that: The device comprises: A data acquisition module is used to obtain the total number of requests, the number of successful requests, and the number of failed requests sent to the receiving server within multiple groups of preset time intervals; a data processing module, constructing a first functional relationship between the total number of requests and the number of successful requests and a second functional relationship between the total number of requests and the number of failed requests, and determining a first change rate of the number of successful requests based on the first functional relationship, and determining a second change rate of the number of failed requests based on the second functional relationship; a connection adjustment module, configured to increase the number of connections used to simultaneously send requests to the receiving server when the first change rate is greater than zero and greater than the second change rate; The connection adjustment module is further configured to reduce the number of connections used to simultaneously send requests to the receiving server when the second change rate is greater than zero and greater than the first change rate; The connection adjustment module is further configured to obtain a maximum number of requests that can be sent based on a single connection within a current time window; The connection adjustment module is further configured to calculate a product of the maximum number and the second change rate, and calculate a ratio of the number of failed requests to the product; The connection adjustment module is further configured to round down the ratio to obtain a target change value; The connection adjustment module is further configured to reduce the number of connections with target change values ​​for simultaneously sending requests to the receiving server when the second change rate is greater than zero and greater than the first change rate.

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

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

8. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.