Flow control methods, devices, electronic equipment and computer program products

By working together with the traffic management server and the request processing server, the traffic control quota for microservices is dynamically adjusted, solving the problem of inaccurate traffic control in existing technologies and enabling real-time monitoring and stability improvement of microservice traffic.

CN119629117BActive Publication Date: 2025-10-31CHINA MOBILE GROUP DESIGN INST +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411830900.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-10-31
Estimated Expiration
2044-12-12

AI Technical Summary

Technical Problem

In existing technologies, the flow control limits under microservice architecture cannot be dynamically adjusted in real time, resulting in inaccurate flow control. This makes it unable to cope with flow fluctuations in high-concurrency and massive data processing scenarios, which may lead to system crashes.

Method used

Through the collaborative work of the traffic management server and the request processing server, the traffic data of microservices is monitored in real time, the traffic control quota is dynamically adjusted, and the adjustment strategy is determined from the preset strategy by comparing the current communication time interval with the shortest allowed communication time interval, generating quota adjustment instructions, and dynamically controlling the traffic of microservices.

Benefits of technology

It enables real-time dynamic control of microservice traffic, improves the accuracy and stability of traffic management, avoids system crashes, and enhances system availability in high-concurrency and massive data processing scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629117B_ABST
    Figure CN119629117B_ABST
Patent Text Reader

Abstract

This disclosure relates to a flow control method, apparatus, electronic device, and computer program product. The method includes: receiving a quota allocation request sent by a target request processing server; obtaining the current total traffic and total flow control quota of the target microservice; if the current total traffic is less than the total flow control quota, determining a target quota adjustment strategy based on a comparison between the current communication time interval and the shortest allowed communication time interval; adjusting the current flow control quota using the target quota adjustment strategy to obtain an adjusted flow control quota; and sending a quota adjustment instruction generated based on the adjusted flow control quota to the target request processing server; wherein the quota adjustment instruction is used to instruct the target request processing server to perform flow control on the target microservice. This disclosure can dynamically adjust the flow control quota of the target microservice in the target request processing server, improving the communication stability and availability of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to flow control methods, apparatus, electronic devices and computer program products. Background Technology

[0002] In recent years, microservice architecture has been widely used in the industry due to its good independence, isolation and scalability, and more and more systems are built on microservice architecture.

[0003] In related technologies, traffic to individual microservices in a microservice architecture can generally be limited by setting traffic control limits to prevent unavailability of a single microservice or thread blocking in other microservices that depend on it. However, the traffic control limits set for each microservice are usually fixed and cannot be dynamically adjusted in real time, resulting in inaccurate traffic control for that microservice. Summary of the Invention

[0004] In view of the above, exemplary embodiments of this disclosure provide a flow control method, apparatus, electronic device, and computer program product to address the problems existing in the related art.

[0005] A first aspect of the exemplary embodiments of this disclosure provides a flow control method, characterized in that it is applied to a flow management server, the method comprising:

[0006] It receives quota allocation requests from the target request processing server among multiple request processing servers, and obtains the current total traffic and total traffic control quota of the target microservice based on the identifier of the target microservice carried in the quota allocation request; wherein, the target microservice is deployed in each request processing server;

[0007] If the current total traffic is less than the total traffic control limit, obtain the current communication time interval, the shortest allowed communication time interval, and the current traffic control limit of the target microservice in the target request processing server;

[0008] Based on the comparison between the current communication time interval and the shortest allowed communication time interval, a target quota adjustment strategy is determined from multiple preset quota adjustment strategies, and the current traffic control quota is adjusted using the target quota adjustment strategy to obtain the adjusted traffic control quota.

[0009] A quota adjustment instruction is generated based on the adjusted traffic control quota and sent to the target request processing server. The quota adjustment instruction is used to instruct the target request processing server to use the adjusted traffic control quota to perform traffic control on the target microservice.

[0010] A second aspect of the exemplary embodiments of this disclosure provides a flow control method, characterized in that it is applied to a request processing server, the method comprising:

[0011] Receive the user's service call request, and based on the identifier of the target microservice carried in the service call request, obtain the current traffic and current traffic control quota of the target microservice in the request processing server;

[0012] If the current traffic is greater than or equal to the current traffic control quota, a quota allocation request is sent to the traffic management server. The quota allocation request is used to request the traffic management server to adjust the current traffic control quota, obtain the adjusted traffic control quota, and generate a quota adjustment instruction based on the adjusted traffic control quota.

[0013] Receive the quota adjustment instruction sent by the traffic management server, and perform traffic control on the target microservice based on the adjusted traffic control quota determined by the quota adjustment instruction.

[0014] A third aspect of the exemplary embodiments of this disclosure provides a flow control device, characterized in that it is applied to a flow management server, the device comprising:

[0015] The communication module is used to receive quota allocation requests sent by the target request processing server among multiple request processing servers;

[0016] The processing module is used to obtain the current total traffic and total traffic control quota of the target microservice based on the identifier of the target microservice carried in the quota allocation request; wherein, the target microservice is deployed in each request processing server;

[0017] The processing module is also used to obtain the current communication time interval, the shortest allowed communication time interval, and the current traffic control quota of the target microservice in the target request processing server when the current total traffic is less than the total traffic control quota.

[0018] The processing module is also used to determine the target quota adjustment strategy from multiple preset quota adjustment strategies based on the comparison results between the current communication time interval and the shortest allowed communication time interval;

[0019] The adjustment module is used to adjust the current traffic control quota using the target quota adjustment strategy to obtain the adjusted traffic control quota;

[0020] The generation module is used to generate a quota adjustment instruction based on the adjusted flow control quota;

[0021] The communication module is used to send a quota adjustment instruction to the target request processing server; wherein, the quota adjustment instruction is used to instruct the target request processing server to use the adjusted flow control quota to perform flow control on the target microservice.

[0022] A fourth aspect of the exemplary embodiments of this disclosure provides a flow control apparatus, characterized in that it is applied to a request processing server, the apparatus comprising:

[0023] The communication module is used to receive service call requests from users;

[0024] The processing module is used to obtain the current traffic and current traffic control quota of the target microservice in the request processing server based on the identifier of the target microservice carried in the service call request.

[0025] The communication module is used to send a quota allocation request to the traffic management server when the current traffic is greater than or equal to the current traffic control quota. The quota allocation request is used to request the traffic management server to adjust the current traffic control quota, obtain the adjusted traffic control quota, and generate a quota adjustment instruction based on the adjusted traffic control quota.

[0026] The communication module is also used to receive quota adjustment instructions sent by the traffic management server;

[0027] The control module is used to perform traffic control on the target microservice based on the adjusted traffic control quota determined by the quota adjustment instruction.

[0028] A fifth aspect of the exemplary embodiments of this disclosure provides an electronic device, comprising:

[0029] At least one processor;

[0030] Memory used to store at least one processor-executable instruction;

[0031] At least one processor is used to execute instructions to implement the steps of the above method.

[0032] A sixth aspect of the exemplary embodiments of this disclosure provides a computer program product including a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described above.

[0033] The above-described at least one technical solution adopted in the exemplary embodiments of this disclosure can achieve the following beneficial effects: by receiving a quota allocation request sent by a target request processing server among multiple request processing servers, and obtaining the current total traffic and total traffic control quota of the target microservice based on the identifier of the target microservice carried in the quota allocation request; wherein, the target microservice is deployed in each request processing server; when the current total traffic is less than the total traffic control quota, obtaining the current communication time interval, the shortest allowed communication time interval, and the current traffic control quota of the target microservice in the target request processing server; based on the comparison result of the current communication time interval and the shortest allowed communication time interval, determining a target quota adjustment strategy from multiple preset quota adjustment strategies, and adjusting the current traffic control quota using the target quota adjustment strategy to obtain the adjusted traffic control quota; generating a quota based on the adjusted traffic control quota. The system adjusts the traffic control quota and sends a quota adjustment instruction to the target request processing server. This quota adjustment instruction instructs the target request processing server to use the adjusted traffic control quota to control the traffic of the target microservice. During traffic control, it monitors the traffic data of the target microservice across multiple request processing servers in real time. Based on the quota allocation request sent by the target request processing server, it determines the target quota adjustment strategy for the current traffic control quota by comparing the current communication time interval with the shortest allowed communication time interval. This ensures that the adjusted traffic control quota, based on the target quota adjustment strategy, allows the target request processing server to adapt to changes in the traffic of the target microservice in a timely manner, dynamically controlling the traffic of the target microservice within the target request processing server. This prevents the traffic management server from being overwhelmed by massive requests, improving the stability and availability of communication between the traffic management server and the request processing server. Attached Figure Description

[0034] To more clearly illustrate the technical solutions in the exemplary embodiments of this disclosure, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0035] Figure 1 A flowchart illustrating a flow control method provided by an exemplary embodiment of this disclosure is shown.

[0036] Figure 2 A flowchart illustrating another flow control method provided by an exemplary embodiment of this disclosure is shown;

[0037] Figure 3 A schematic diagram of the structure of a flow control device provided in an exemplary embodiment of this disclosure is shown;

[0038] Figure 4 A schematic diagram of another flow control device provided by an exemplary embodiment of this disclosure is shown;

[0039] Figure 5 A schematic diagram of the structure of an electronic device provided in an exemplary embodiment of this disclosure is shown;

[0040] Figure 6 A schematic diagram of the structure of a computer system provided in an exemplary embodiment of this disclosure is shown. Detailed Implementation

[0041] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0042] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0043] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc., used in this disclosure are only used to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.

[0044] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0045] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0046] In recent years, to address complex business needs, software architecture has continuously evolved, from initial monolithic architectures, vertical architectures, and Service-Oriented Architecture (SOA) to microservice architectures. Microservice architectures offer excellent independence, isolation, and scalability, and are widely used in the industry, with an increasing number of systems built upon them. However, since each microservice in a microservice architecture typically has a limited capacity to handle traffic (which could be the number of access requests), exceeding this limit can cause a single microservice to become unavailable, leading to thread blocking in other microservices that depend on it. Therefore, it is necessary to control the traffic of each microservice to prevent a "avalanche effect" in high-concurrency and massive data processing scenarios, which could cause the entire system to crash. Thus, ensuring the availability of microservices in high-concurrency and massive data processing scenarios is particularly important.

[0047] In related technologies, to ensure the availability of microservices in high-concurrency and massive data scenarios, cluster traffic control is generally adopted. This involves monitoring metrics such as the number of queries per second or the number of concurrent threads for microservice access requests. Once the preset traffic control limit is reached, traffic control measures are activated, and the microservice instance refuses to accept microservice access requests that exceed the preset traffic control limit and returns a rate limiting error code.

[0048] In practical applications, since the number of microservice access requests cannot be accurately predicted, and the number of microservice access requests that each microservice instance can handle may not be the same, it is impossible to accurately set the preset traffic control quota for each microservice instance. As a result, when the preset traffic control quota of some microservice instances has been exhausted, the microservice instance is rate-limited, while the preset traffic control quota of other microservice instances remains unused.

[0049] Furthermore, for each microservice, when the preset traffic control quota of a microservice instance is exhausted, the microservice instance requests a fixed value when requesting a new traffic control quota from the traffic control server. However, the number of access requests to a microservice within a unit of time may vary significantly, resulting in some periods of very fast traffic control quota usage and others of very slow usage. This leads to uneven traffic control quota usage across microservice instances, meaning that the traffic control quota for each microservice instance cannot be dynamically adjusted, ultimately resulting in inaccurate traffic control for the microservice instances.

[0050] Therefore, in order to solve the above problems, the exemplary embodiments of this disclosure provide a flow control method that can dynamically adjust the flow control quota of a microservice based on real-time data of microservice calls, thereby improving the real-time performance and accuracy of flow control for the microservice.

[0051] The traffic control method provided in the exemplary embodiments of this disclosure can be executed by a traffic control component, which may include a traffic management server and multiple request processing servers deployed in a distributed manner, and microservices may be deployed in each request processing server.

[0052] For example, the traffic control component can be deployed according to a client / server (C / S) architecture, where the traffic management server can be equivalent to the server in the client / server architecture, and the request processing server can be equivalent to the client in the client / server architecture.

[0053] To avoid congestion of the traffic management server caused by massive service call requests, this exemplary embodiment can pre-allocate an initial traffic control quota for each microservice in the request processing server when traffic control is required, for use by service call requests. The request processing server is deployed on the microservice instance side and is responsible for providing resources for the corresponding microservice to the user based on the user's service call request. After receiving the user's service call request, the request processing server determines whether the current traffic control quota has been exhausted. If the current traffic control quota (which is the initial traffic control quota at the start of traffic control) has been exhausted, the request processing server sends a quota allocation request for the microservice to the traffic management server to request an adjusted traffic control quota. The adjusted traffic control quota is then reallocated by the traffic management server. Based on the return result from the traffic management server, the request processing server determines whether to perform rate limiting operations on the microservice in the request processing server during the current traffic control period.

[0054] A traffic management server is centrally deployed and responsible for recording and monitoring real-time service call data from each request processing server within the business cluster. Combined with the total traffic control limit for a specific microservice within the traffic management server, it determines whether the current total traffic (i.e., current total access volume) of that microservice across multiple request processing servers has reached the total traffic control limit for that microservice within the traffic management server. Within a traffic control period, if the current total traffic of that microservice across multiple request processing servers reaches the total traffic control limit for that microservice within the traffic management server, and if a request processing server initiates a quota allocation request for that microservice, the traffic management server issues a traffic control instruction for that microservice to the request processing server that sent the quota allocation request. Based on this, the exemplary embodiment of this disclosure can achieve dynamic rate limiting through collaboration between the traffic management server and multiple request processing servers.

[0055] First, the traffic management server can configure a total traffic control limit for multiple microservices. The total traffic control limit for different microservices can be the same or different, and this exemplary embodiment does not specifically limit this. Here, the total traffic control limit can be the maximum total traffic that the corresponding microservice can handle within a traffic control cycle.

[0056] Since each microservice can be deployed on multiple request processing servers, the request processing servers can invoke the resources of the corresponding microservice based on the user's service call request, and provide the corresponding microservice to the user. Based on this, in the initial traffic control cycle, after determining the total traffic control quota for each microservice, the traffic management server first reserves a portion of the total traffic control quota for that microservice, and then evenly distributes the remaining total traffic control quota of that microservice deployed on each request processing server as the initial traffic control quota for that microservice on the request processing server for use by service call requests.

[0057] For example, when determining the initial traffic control quota for a microservice in the request processing server, the traffic management server may first reserve a portion of the total traffic control quota for that microservice and then allocate the remaining total traffic control quota for that microservice.

[0058] Assuming the total traffic control quota for a microservice in the traffic management server is Q, the number of request processing servers deploying that microservice is n, and the reserved quota coefficient is m, where m > 1, then the initial traffic control quota for that microservice in each request processing server can be expressed as Q / mn. Here, the size of the reserved quota coefficient can be set by the user, and this exemplary embodiment does not specifically limit it.

[0059] In practical applications, when a request processing server receives a service call request from a user, it determines the target microservice based on the microservice identifier carried in the service call request; it obtains the current traffic (excluding the current service call request from the user) and current traffic control quota of the target microservice; if the current traffic is less than the current traffic control quota, it directly invokes the service resources of the target microservice; if the current traffic is greater than or equal to the current traffic control quota, it sends a quota allocation request to the traffic management server for the target microservice. The quota allocation request is used to request an adjusted traffic control quota for the target microservice from the traffic management server. Here, the target microservice can be one of the aforementioned microservices.

[0060] Upon receiving a quota allocation request, the traffic management server obtains the target microservice's current total traffic (excluding the quota allocation request sent by the current request processing server) and total traffic control quota. If the current total traffic is greater than or equal to the total traffic control quota, it sends a rate-limiting instruction to the request processing server for the target microservice. This instruction instructs the request processing server to stop accessing the target microservice's service resources. If the current total traffic is less than the total traffic control quota, it obtains the target microservice's current communication time interval and minimum allowed communication time interval on the request processing server. Based on the relationship between these two intervals, it decides whether to adjust the target microservice's current traffic control quota on the request processing server. The current communication time interval is the time interval between the two most recent quota allocation requests sent by the same request processing server to the traffic management server. The target microservice's total traffic control quota can be the total traffic allocated to the target microservice by the traffic management server within the current traffic control period.

[0061] For example, if the current communication time interval is less than the minimum allowed communication time interval, the adjusted traffic control quota reallocated by the request processing server is calculated using the ratio of the minimum allowed communication time interval to the current communication time interval; if the current communication time interval is greater than or equal to the minimum allowed communication time interval, the traffic pressure data of the target microservice in the request processing server is obtained, and the adjusted traffic control quota reallocated by the request processing server is calculated using the traffic pressure trend change.

[0062] The exemplary embodiments disclosed herein can predetermine the shortest allowed communication time interval for each microservice in the request processing server.

[0063] For example, the shortest allowed communication time interval for the i-th microservice in the request processing server can be calculated using the following formula:

[0064]

[0065] Among them, T i Let n represent the minimum allowed communication time interval for the i-th microservice in the request processing server, n represent the number of request processing servers deploying the i-th microservice, F represent the maximum number of communications among all microservices in the traffic management server within a traffic control cycle, and g represent the maximum number of communications among all microservices in the traffic management server within a traffic control cycle. i This represents the ratio between the traffic control quota of the i-th microservice in the request processing server and the sum of the total traffic control quotas of all microservices in the traffic management server.

[0066] In formula (1), F×g iIf we can represent the total number of communications for the i-th microservice in the traffic management server, then the average number of communications distributed among the i-th microservices in each request processing server can be expressed as: Its reciprocal This represents the shortest allowed communication time interval for the i-th microservice in the request processing server. Where g... i The larger the value, the more frequently the request processing server communicates with the traffic management server for the i-th microservice compared to other microservices in the request processing server, allowing the i-th microservice to have a shorter allowed communication time interval.

[0067] For example, the traffic management server records the timestamp of each request processing server's quota allocation request for the i-th microservice. Then, it determines the time interval between the two most recent quota allocation requests sent by the same request processing server to the traffic management server for the i-th microservice as the current communication time interval between the request processing server and the traffic management server for the i-th microservice.

[0068] Suppose the current communication time interval between the request processing server and the traffic management server for the i-th microservice is t, if t <T i This indicates that the request processing server needs to communicate frequently with the traffic management server regarding the i-th microservice, and the actual number of communications between the request processing server and the traffic management server regarding the i-th microservice may exceed [the required number of communications]. If the traffic control limit for the i-th microservice in the request processing server is not increased rapidly, the traffic management server may be overwhelmed.

[0069] At this point, it is necessary to increase the traffic control quota for the i-th microservice in the request processing server. The adjusted traffic control quota should ensure that the communication time interval between the request processing server and the traffic management server for the i-th microservice is greater than or equal to the shortest allowed communication time interval for the i-th microservice in the request processing server, i.e., t ≥ T. i .

[0070] Assuming the traffic pressure of the i-th microservice in the request processing server remains unchanged, if the adjusted traffic control quota of the i-th microservice in the request processing server is calculated according to the following formula (2), the communication time interval between the request processing server and the traffic management server for the i-th microservice is equal to the shortest allowed communication time interval for the i-th microservice in the request processing server, i.e., t = T. i .

[0071]

[0072] Where Ln represents the adjusted traffic control quota allocated by the traffic management server to the i-th microservice in the request processing server, Lo represents the current traffic control quota of the i-th microservice in the request processing server, and T i represents the shortest allowed communication time interval for the i-th microservice in the request processing server, and t represents the current communication time interval between the request processing server and the traffic management server for the i-th microservice.

[0073] From formula (2), it can be seen that the smaller t is, the better. The larger it is, the larger Ln is.

[0074] Considering that the traffic management server should not operate continuously under extreme conditions, a certain redundancy should be maintained in the communication time interval between it and the request processing server for the i-th microservice. Therefore, in the method of the exemplary embodiments of this disclosure, when t <T i At that time, the adjusted traffic control quota allocated by the traffic management server to the i-th microservice in the request processing server is calculated according to the following formula (3):

[0075]

[0076] Wherein, α represents the redundancy coefficient, the size of which can be set according to the actual situation of the system and physical devices, and the exemplary embodiments disclosed herein do not specifically limit it.

[0077] Based on this, when the request processing server encounters a massive number of requests, the exemplary embodiment of this disclosure can use the above formula (3) to quickly increase the traffic control quota of the i-th microservice in the request processing server, so that the number of communications between the request processing server and the traffic management server for the i-th microservice can be reduced to an acceptable range as soon as possible.

[0078] For example, if t≥T i The exemplary embodiments of this disclosure can also obtain the traffic pressure data of the i-th microservice in the request processing server; and calculate the adjusted traffic control quota allocated by the traffic management server to the i-th microservice in the request processing server based on the traffic pressure data and the current traffic control quota of the i-th microservice in the request processing server.

[0079] Here, the traffic pressure data includes the traffic pressure at the current moment and the traffic pressure at least two historical moments closest to the current moment. Traffic pressure can be used to characterize the number of service call requests received by the request processing server per unit time.

[0080] The traffic pressure of the i-th microservice in the request processing server during the j-th communication time interval can be calculated using the following formula (4):

[0081]

[0082] Where, p ij Lo represents the traffic pressure of the i-th microservice in the request processing server during the j-th communication time interval. j t represents the flow control quota for the i-th microservice in the request processing server during the j-th communication time interval. ij This represents the time interval between the two nearest quota allocation requests sent by the request processing server to the i-th microservice, received by the traffic management server.

[0083] When t≥T i At that time, the adjusted traffic control quota allocated by the traffic management server to the i-th microservice in the request processing server can also be calculated using the following formula (5):

[0084]

[0085] Where Ln represents the adjusted traffic control quota allocated by the traffic management server to the i-th microservice in the request processing server, Lo represents the current traffic control quota of the i-th microservice in the request processing server, and p i1 p represents the traffic load of the i-th microservice in the request processing server during the first communication time interval. i2 p represents the traffic load of the i-th microservice in the request processing server during the second communication time interval. i3 This represents the traffic pressure of the i-th microservice in the request processing server during the third communication time interval.

[0086] Here, the third communication time interval is the most recent communication time interval, which is the difference between the timestamp of the traffic management server receiving the quota allocation request for the i-th microservice from the target request processing server in the current instance and the timestamp of the last time the traffic management server received the quota allocation request for the i-th microservice from the target request processing server. The second communication time interval is the difference between the timestamp of the traffic management server receiving the quota allocation request for the i-th microservice from the target request processing server in the previous (current - 1) instance and the timestamp of the two-years-older (current - 2) instance. The first communication time interval is the difference between the timestamp of the traffic management server receiving the quota allocation request for the i-th microservice from the target request processing server in the previous (current - 2) instance and the timestamp of the traffic management server receiving the quota allocation request for the i-th microservice from the target request processing server in the (current - 3) instance.

[0087] As can be seen from formula (5), It can be used to characterize the traffic pressure trend of the i-th microservice in the request processing server, reflecting the changes in traffic pressure of the request processing server over the past three communication time intervals. If but This indicates that as the traffic pressure on the i-th microservice in the request processing server increases, its adjusted traffic control quota also increases accordingly; conversely, its adjusted traffic control quota decreases accordingly.

[0088] In other words, the adjusted traffic control quota for the i-th microservice in the request processing server is linearly and positively correlated with the traffic pressure trend of the i-th microservice in the request processing server. This strategy ensures that the adjusted traffic control quota allocated by the traffic management server to the i-th microservice in the request processing server matches its traffic pressure trend as closely as possible, adapting promptly to changes in the traffic pressure of the i-th microservice in the request processing server. This keeps the number of communications between the request processing server and the traffic management server regarding the i-th microservice relatively stable.

[0089] After determining the adjusted traffic control quota allocated to the i-th microservice in the request processing server, the traffic management server issues the adjusted traffic control quota to the request processing server. If the remaining traffic control quota of the i-th microservice in the traffic management server is less than the adjusted traffic control quota to be allocated to the i-th microservice in the request processing server, then the remaining traffic control quota of the i-th microservice in the traffic management server is used as the adjusted traffic control quota and allocated entirely to the request processing server.

[0090] Based on this, an exemplary embodiment of the present disclosure provides a flow control method applied to a flow management server, which can be executed by the flow management server or by a chip applied to the flow management server.

[0091] For example, the traffic management server described above can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. This exemplary embodiment does not limit the scope of the disclosure.

[0092] Figure 1 A flowchart illustrating a flow control method provided by an exemplary embodiment of this disclosure is shown. Figure 1 As shown, the flow control method includes:

[0093] S101, receive a quota allocation request sent by the target request processing server among multiple request processing servers, and obtain the current total traffic and total traffic control quota of the target microservice based on the identifier of the target microservice carried in the quota allocation request; wherein, the target microservice is deployed in each request processing server;

[0094] S102, if the current total traffic is less than the total traffic control limit, obtain the current communication time interval, the shortest allowed communication time interval, and the current traffic control limit of the target microservice in the target request processing server;

[0095] S103, based on the comparison result between the current communication time interval and the shortest allowed communication time interval, determine the target quota adjustment strategy from multiple preset quota adjustment strategies, and adjust the current traffic control quota using the target quota adjustment strategy to obtain the adjusted traffic control quota.

[0096] S104, Generate a quota adjustment instruction based on the adjusted flow control quota, and send the quota adjustment instruction to the target request processing server; wherein, the quota adjustment instruction is used to instruct the target request processing server to use the adjusted flow control quota to perform flow control on the target microservice.

[0097] Specifically, the traffic control component, which consists of a traffic management server and multiple request processing servers, can be found in the relevant content above, and will not be repeated here.

[0098] Microservices can be deployed on each request processing server. A traffic management server can centrally manage the traffic control quotas of a microservice deployed across multiple request processing servers.

[0099] The request processing server can receive service call requests from users, and if the current traffic of the target microservice in the request processing server is less than the current traffic control limit, it can use the microservice identifier carried in the service call request to call the service resources of the corresponding microservice to provide the corresponding microservice to the user.

[0100] Here, the current traffic of the target microservice in the request processing server can be: the current number of visits to the target microservice in the request processing server; the current traffic control quota of the target microservice in the request processing server can be: the traffic control quota configured by the traffic management server for the target microservice in the request processing server in the current traffic control period when traffic control is performed.

[0101] If the current traffic of the target microservice in the request processing server is greater than or equal to the current traffic control quota, the request processing server sends a quota allocation request to the traffic management server.

[0102] In practical applications, when performing traffic control, the traffic management server can receive quota allocation requests sent by the target request processing server among multiple request processing servers, and obtain the current total traffic and total traffic control quota of the target microservice based on the identifier of the target microservice carried in the quota allocation request.

[0103] Here, the current total traffic of the target microservice can be the sum of the current traffic of the target microservice across multiple request processing servers; the total traffic control quota of the target microservice can be the total traffic control quota allocated by the traffic management server to the target microservice across multiple request processing servers within the current traffic control period. As mentioned earlier, since the traffic management server sets a reserved quota coefficient when pre-setting the initial traffic control quota for each microservice in the request processing servers at the beginning of the first traffic control period, the total traffic control quota (Q) here is greater than the sum of the initial traffic control quotas of the target microservice across multiple request processing servers (n×Q / mn).

[0104] If the current total traffic is less than the total traffic control quota, it means that the target microservice still has a remaining total traffic control quota. Therefore, the traffic control quota for the target microservice in the target request processing server can be adjusted. At this point, the current communication time interval, the shortest allowed communication time interval, and the current traffic control quota for the target microservice in the target request processing server can be obtained. Then, based on the comparison between the current communication time interval and the shortest allowed communication time interval, the target quota adjustment strategy is determined from multiple preset quota adjustment strategies.

[0105] Here, the current communication time interval of the target microservice in the target request processing server can be the time interval between the two most recent quota allocation requests sent by the target request processing server to the traffic management server. The minimum allowed communication time interval of the target microservice in the target request processing server can be calculated using formula (1) mentioned above, and will not be repeated here.

[0106] The current traffic control quota can be the traffic control quota allocated by the traffic management server to the target microservice in the target request processing server at the current moment. It should be noted that at the beginning of the first traffic control cycle, the current traffic control quota can be the initial traffic control quota mentioned above. For details on the initial traffic control quota, please refer to the previous text, which will not be repeated here.

[0107] This exemplary embodiment can pre-set multiple preset limit adjustment strategies, so as to select a target limit adjustment strategy based on the comparison result of the current communication time interval and the shortest allowed communication time interval. Multiple preset limit adjustment strategies can be set according to actual application scenarios, and this exemplary embodiment does not specifically limit them.

[0108] The comparison result here can be the comparison result between the difference between the current communication time interval and the minimum allowed communication time interval and the preset difference, or the comparison result between the ratio of the current communication time interval to the minimum allowed communication time interval and the preset ratio, or other comparison results. The exemplary embodiments of this disclosure do not specifically limit this.

[0109] After determining the target traffic control limit adjustment strategy, the current traffic control limit can be adjusted using this strategy to obtain the adjusted traffic control limit. Then, a limit adjustment instruction is generated based on the adjusted traffic control limit and sent to the target request processing server. Here, the limit adjustment instruction can be used to instruct the target request processing server to use the adjusted traffic control limit to perform traffic control on the target microservice.

[0110] Based on this, the exemplary embodiments of this disclosure can utilize a target quota adjustment strategy determined by comparing the current communication time interval with the shortest allowed communication time interval to dynamically adjust the traffic control quota of the target microservice in the target request processing server. This allows the adjusted traffic control quota to enable the target request processing server to adapt to the traffic changes of the target microservice in a timely manner, thereby ensuring that the traffic management server is not overwhelmed by massive requests.

[0111] Meanwhile, the real-time dynamic adjustment of the traffic control quota can greatly reduce the communication volume between the traffic management server and the request processing server, keeping the number of communications between the traffic management server and the request processing server stable, improving the communication stability between the traffic management server and the request processing server, and ensuring the availability of the system.

[0112] According to the technical solution of the example embodiment of this disclosure, a quota allocation request is received from a target request processing server among multiple request processing servers. Based on the identifier of the target microservice carried in the quota allocation request, the current total traffic and total traffic control quota of the target microservice are obtained. The target microservice is deployed in each request processing server. When the current total traffic is less than the total traffic control quota, the current communication time interval, the shortest allowed communication time interval, and the current traffic control quota of the target microservice in the target request processing server are obtained. Based on the comparison result between the current communication time interval and the shortest allowed communication time interval, a target quota adjustment strategy is determined from multiple preset quota adjustment strategies, and the current traffic control quota is adjusted using the target quota adjustment strategy to obtain the adjusted traffic control quota. A quota adjustment instruction is generated based on the adjusted traffic control quota and sent to the target microservice. The request processing server sends a quota adjustment instruction. This instruction instructs the target request processing server to use the adjusted traffic control quota to control the traffic of the target microservice. During traffic control, the server monitors the traffic data of the target microservice across multiple request processing servers in real time. Based on the quota allocation request sent by the target request processing server, the server compares the current communication time interval with the shortest allowed communication time interval to determine the target quota adjustment strategy. This ensures that the adjusted traffic control quota, based on the target quota adjustment strategy, allows the target request processing server to adapt to changes in the traffic of the target microservice in a timely manner, dynamically controlling the traffic of the target microservice within the target request processing server. This prevents the traffic management server from being overwhelmed by massive requests, improving the stability and availability of communication between the traffic management server and the request processing server.

[0113] In some embodiments, multiple preset quota adjustment strategies may include a first quota adjustment strategy and a second quota adjustment strategy. The first quota adjustment strategy is related to the ratio between the current communication time interval and the shortest allowed communication time interval, and the second quota adjustment strategy is related to the traffic pressure data of the target microservice in the target request processing server.

[0114] Based on the comparison between the current communication time interval and the shortest allowed communication time interval, a target credit limit adjustment strategy is determined from multiple preset credit limit adjustment strategies, which may include:

[0115] If the current communication time interval is less than the shortest allowed communication time interval, then the first limit adjustment strategy is determined as the target limit adjustment strategy;

[0116] If the current communication time interval is greater than or equal to the shortest allowed communication time interval, then the second limit adjustment strategy is determined as the target limit adjustment strategy.

[0117] Specifically, multiple preset credit limit adjustment strategies may include a first credit limit adjustment strategy and a second credit limit adjustment strategy, wherein the first credit limit adjustment strategy can be determined by formula (3) mentioned above. As can be seen from formula (3), the first credit limit adjustment strategy is the ratio between the current communication time interval and the shortest allowed communication time interval. Relatedly, the exemplary embodiments of this disclosure can also set a redundancy coefficient. When the request processing server encounters a large number of requests, the flow control quota of the target microservice in the request processing server can be quickly increased using formula (3), so that the number of communications between the request processing server and the flow management server for the target microservice can be reduced to an acceptable range as soon as possible, thereby improving the communication stability between the flow management server and the request processing server and ensuring the availability of the system.

[0118] The second quota adjustment strategy can be determined by formula (5) mentioned above. As can be seen from formula (5), the second quota adjustment strategy is related to the traffic pressure data of the target microservice in the target request processing server. Among them, It can be used to characterize the traffic pressure trend determined by the traffic pressure data, reflecting the changes in traffic pressure of the request processing server over the past three communication time intervals. The second quota adjustment strategy determined by formula (5) can make the adjusted traffic control quota match its traffic pressure trend as much as possible, thereby adapting to the changes in traffic pressure of the target microservice in the target request processing server in a timely manner and maintaining stable communication between the traffic management server and the request processing server.

[0119] If the current communication time interval is less than the minimum allowed communication time interval, it means that the target request processing server needs to communicate frequently with the traffic management server. The communication time interval has a significant impact on the adjusted traffic control quota. In this case, the first quota adjustment strategy, which has a high correlation with the ratio between the current communication time interval and the minimum allowed communication time interval, can be determined as the target quota adjustment strategy.

[0120] If the current communication interval is greater than or equal to the minimum allowed communication interval, it indicates that the number of communications between the target request processing server and the traffic management server is relatively small, and the communication interval factor has little impact on the adjusted traffic control quota. However, the traffic pressure of the target microservice itself in the target request processing server has a greater impact on the adjusted traffic control quota. In this case, the second quota adjustment strategy, which is highly correlated with the traffic pressure data of the target microservice in the target request processing server, can be determined as the target quota adjustment strategy.

[0121] Based on this, the technical solution of the example embodiment of this disclosure can select an appropriate target quota adjustment strategy based on the comparison result of the current communication time interval and the shortest allowed communication time interval, so that the adjusted traffic control quota can maintain stable communication between the traffic management server and the request processing server.

[0122] In some embodiments, adjusting the current traffic control quota using a target quota adjustment strategy to obtain an adjusted traffic control quota may include:

[0123] Get the ratio of the current communication time interval to the shortest allowed communication time interval;

[0124] The adjusted traffic control quota is calculated based on the ratio, the current traffic control quota, and the first quota adjustment strategy.

[0125] Specifically, when the target quota adjustment strategy is the first quota adjustment strategy, the ratio between the current communication time interval and the shortest allowed communication time interval can be calculated; then, the ratio between the current communication time interval and the shortest allowed communication time interval and the current flow control quota are substituted into formula (3) to obtain the adjusted flow control quota of the target microservice in the target request processing server.

[0126] In some embodiments, traffic pressure data may include the traffic pressure of the current communication time interval and the traffic pressure of at least two historical communication time intervals that are closest to the current communication time interval. The traffic pressure is used to characterize the number of service call requests for the target microservice received by the target request processing server per unit time.

[0127] Adjusting the current traffic control limit using a target limit adjustment strategy to obtain the adjusted traffic control limit can include:

[0128] Get the traffic pressure of the current communication time interval, and the traffic pressure of at least two historical communication time intervals that are closest to the current communication time interval;

[0129] Based on the traffic pressure of the current communication interval and the traffic pressure of at least two historical communication intervals that are closest to the current communication interval, determine the traffic pressure trend data of the target microservice in the target request processing server;

[0130] Based on traffic pressure trend data, the current traffic control quota, and the second quota adjustment strategy, the adjusted traffic control quota is calculated.

[0131] Specifically, the traffic pressure data may include the traffic pressure of the current communication time interval and the traffic pressure of at least two historical communication time intervals that are closest to the current communication time interval. The traffic pressure can be used to characterize the number of service call requests for the target microservice received by the target request processing server per unit time. In the method of the exemplary embodiment of this disclosure, the traffic pressure of the target microservice in the target request processing server during a certain communication time interval can be calculated by formula (4) above.

[0132] In the method of the exemplary embodiments of this disclosure, the traffic pressure data may include the traffic pressure of the current communication time interval (p mentioned above). i3 ), and the traffic pressure of the two historical communication time intervals closest to the current communication time interval (p in the previous text). i1 and p i2 Then, through p i1 p i2 and p i3 Calculate the traffic pressure trend data of the target microservice in the target request processing server. The traffic pressure trend data can be from the data mentioned above. Finally, the traffic pressure trend data and the previous traffic control quota are substituted into formula (5) to obtain the adjusted traffic control quota of the target microservice in the target request processing server.

[0133] Taking the target microservice in the target request processing server as the i-th microservice in the request processing server as an example, it can be seen from formula (5) that... It can be used to characterize the traffic pressure trend of the i-th microservice in the request processing server, reflecting the changes in traffic pressure of the request processing server over the past three communication time intervals. If but This indicates that as the traffic pressure on the i-th microservice in the request processing server increases, its adjusted traffic control quota also increases accordingly; conversely, its adjusted traffic control quota decreases accordingly.

[0134] In some embodiments, the method may further include:

[0135] Obtain the remaining traffic control quota for the target microservice;

[0136] If the adjusted flow control quota is less than or equal to the remaining flow control quota, execute the step of generating a quota adjustment instruction based on the adjusted flow control quota;

[0137] If the adjusted traffic control quota is greater than the remaining traffic control quota, the remaining traffic control quota is determined as the adjusted traffic control quota, and the step of generating a quota adjustment instruction based on the adjusted traffic control quota is executed.

[0138] Specifically, as mentioned above, at the start of the first traffic control cycle, the traffic management server allocates an initial traffic control quota of Q / mn to the target microservice within the target request processing server. Therefore, the traffic management server also has reserved traffic control quota for the target microservice. This remaining traffic control quota can include the reserved traffic control quota and the current traffic control quota for the target microservice within the target request processing server. Furthermore, for other traffic control cycles, the unallocated reserved traffic control quota for the target microservice at the end of the previous traffic control cycle is used as the reserved traffic control quota for the target microservice at the start of the next traffic control cycle.

[0139] If the adjusted traffic control quota is less than or equal to the remaining traffic control quota, it means that a portion of the remaining traffic control quota can be taken as the adjusted traffic control quota. The adjusted traffic control quota can then be allocated to the target microservice in the target request processing server. In this case, a quota adjustment instruction can be generated directly based on the adjusted traffic control quota.

[0140] If the adjusted traffic control quota is greater than the remaining traffic control quota, it means that the remaining traffic control quota is insufficient to allocate the adjusted traffic control quota to the target microservice in the target request processing server. In this case, the remaining traffic control quota is determined as the adjusted traffic control quota, and then a quota adjustment instruction is generated based on the adjusted traffic control quota.

[0141] In some embodiments, the method may further include:

[0142] If the current total traffic is greater than or equal to the total traffic control limit, a rate limiting instruction is generated; the rate limiting instruction is used to instruct the target request processing server to stop calling the service resources of the target microservice during the current traffic control period;

[0143] Send a rate limiting instruction to the target request processing server.

[0144] Specifically, if the current total traffic is greater than or equal to the total traffic control limit, it indicates that the total traffic control limit for the target microservice is insufficient to meet the traffic requirements of the target microservice across multiple request processing servers. Therefore, access to the target microservice within the target request processing server needs to be restricted. In this case, a rate limiting instruction can be generated and sent to the target request processing server.

[0145] Among them, the rate limiting instruction can be used to instruct the target request processing server to stop calling the service resources of the target microservice within the current flow control period, so as to avoid the "avalanche effect" and cause the entire system to crash in high-concurrency and massive data processing scenarios.

[0146] This exemplary embodiment also provides a flow control method applied to a request processing server, which can be executed by the request processing server or by a chip applied to the request processing server.

[0147] For example, the request processing server mentioned above can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. This exemplary embodiment does not limit the scope of the present disclosure.

[0148] Figure 2 A flowchart illustrating another flow control method provided by an exemplary embodiment of this disclosure is shown. Figure 2 As shown, the flow control method includes:

[0149] S201, Receive the user's service call request, and based on the identifier of the target microservice carried in the service call request, obtain the current traffic and current traffic control quota of the target microservice in the request processing server;

[0150] S202, if the current traffic is greater than or equal to the current traffic control quota, send a quota allocation request to the traffic management server; wherein, the quota allocation request is used to request the traffic management server to adjust the current traffic control quota, obtain the adjusted traffic control quota, and generate a quota adjustment instruction based on the adjusted traffic control quota.

[0151] S203: Receive the quota adjustment instruction sent by the traffic management server, and perform traffic control on the target microservice based on the adjusted traffic control quota determined by the quota adjustment instruction.

[0152] Specifically, when traffic control is required, the request processing server can receive the user's service call request and, based on the identifier of the target microservice carried in the service call request, obtain the current traffic and current traffic control quota of the target microservice in the request processing server.

[0153] Here, the aforementioned current traffic can refer to the current access volume of the target microservice in the request processing server. The aforementioned current traffic control quota can refer to the traffic control quota allocated by the traffic management server to the target microservice in the request processing server at the current moment; if the current moment is the start moment of the current period, the aforementioned current traffic control quota can refer to the initial traffic control quota mentioned above. For details on the initial traffic control quota, please refer to the previous text, which will not be repeated here.

[0154] If the current traffic is greater than or equal to the current traffic control quota, a quota allocation request is sent to the traffic management server. The quota allocation request is used to request the traffic management server to adjust the current traffic control quota, obtain the adjusted traffic control quota, and generate a quota adjustment instruction based on the adjusted traffic control quota.

[0155] The request processing server receives the quota adjustment instruction sent by the traffic management server, and then performs traffic control on the target microservice based on the adjusted traffic control quota determined by the quota adjustment instruction.

[0156] Based on this, the exemplary embodiments of this disclosure can adjust the current traffic control quota of the target microservice in the request processing server in real time according to the quota adjustment instruction of the traffic management server, so that the adjusted traffic control quota can enable the request processing server to adapt to the traffic changes of the target microservice, dynamically control the traffic of the target microservice in the request processing server, thereby ensuring that the traffic management server will not be overwhelmed by massive requests, and improving the communication stability and availability between the traffic management server and the request processing server.

[0157] The foregoing primarily describes the solutions provided by exemplary embodiments of this disclosure. It is understood that, in order to achieve the above functions, the electronic device includes corresponding hardware structures and / or software modules for performing each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, this disclosure can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.

[0158] The exemplary embodiments of this disclosure can divide the electronic device into functional units according to the above method examples. For example, each function can be divided into a separate functional module, or two or more functions can be integrated into a single processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in the exemplary embodiments of this disclosure is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.

[0159] By dividing each functional module according to its corresponding function, an exemplary embodiment of this disclosure provides a flow control device, which can be a flow management server or a chip applied to a flow management server. Figure 3A schematic diagram of the structure of a flow control device provided in an exemplary embodiment of this disclosure is shown. Figure 3 As shown, the device 300 includes:

[0160] Communication module 301 is used to receive quota allocation requests sent by a target request processing server among multiple request processing servers;

[0161] Processing module 302 is used to obtain the current total traffic and total traffic control quota of the target microservice based on the identifier of the target microservice carried in the quota allocation request; wherein, the target microservice is deployed in each request processing server;

[0162] The processing module 302 is also used to obtain the current communication time interval, the shortest allowed communication time interval, and the current traffic control quota of the target microservice in the target request processing server when the current total traffic is less than the total traffic control quota.

[0163] The processing module 302 is also used to determine the target quota adjustment strategy from multiple preset quota adjustment strategies based on the comparison result between the current communication time interval and the shortest allowed communication time interval;

[0164] The adjustment module 303 is used to adjust the current traffic control quota using the target quota adjustment strategy to obtain the adjusted traffic control quota;

[0165] The generation module 304 is used to generate a quota adjustment instruction based on the adjusted flow control quota;

[0166] The communication module 301 is used to send a quota adjustment instruction to the target request processing server; wherein, the quota adjustment instruction is used to instruct the target request processing server to use the adjusted flow control quota to perform flow control on the target microservice.

[0167] In some embodiments, the multiple preset quota adjustment strategies include a first quota adjustment strategy and a second quota adjustment strategy, wherein the first quota adjustment strategy is related to the ratio between the current communication time interval and the shortest allowed communication time interval, and the second quota adjustment strategy is related to the traffic pressure data of the target microservice in the target request processing server;

[0168] The processing module 302 is further configured to determine the first quota adjustment strategy as the target quota adjustment strategy if the current communication time interval is less than the shortest allowed communication time interval; and to determine the second quota adjustment strategy as the target quota adjustment strategy if the current communication time interval is greater than or equal to the shortest allowed communication time interval.

[0169] In some embodiments, the adjustment module 303 is further configured to obtain the ratio between the current communication time interval and the shortest allowed communication time interval; and calculate the adjusted flow control quota based on the ratio, the current flow control quota, and the first quota adjustment strategy.

[0170] In some embodiments, traffic pressure data includes the traffic pressure at the current moment and the traffic pressure at least two historical moments that are closest to the current moment. The traffic pressure is used to characterize the number of service call requests for the target microservice received by the target request processing server per unit time.

[0171] The adjustment module 303 is also used to obtain the traffic pressure at the current moment and the traffic pressure at least two historical moments closest to the current moment; based on the traffic pressure at the current moment and the traffic pressure at least two historical moments closest to the current moment, determine the traffic pressure trend data of the target microservice in the target request processing server; and calculate the adjusted traffic control quota based on the traffic pressure trend data, the current traffic control quota, and the second quota adjustment strategy.

[0172] In some embodiments, the processing module 302 is further configured to obtain the remaining traffic control quota of the target microservice; if the adjusted traffic control quota is less than or equal to the remaining traffic control quota, execute the step of generating a quota adjustment instruction based on the adjusted traffic control quota; if the adjusted traffic control quota is greater than the remaining traffic control quota, determine the remaining traffic control quota as the adjusted traffic control quota, and execute the step of generating a quota adjustment instruction based on the adjusted traffic control quota.

[0173] In some embodiments, the device 300 further includes: a generation module 304, configured to generate a rate limiting instruction when the current total traffic is greater than or equal to the total traffic control limit; wherein the rate limiting instruction is configured to instruct the target request processing server to stop calling the service resources of the target microservice during the current traffic control period;

[0174] The communication module 301 is used to send a rate limiting instruction to the target request processing server.

[0175] An exemplary embodiment of this disclosure also provides a flow control device, which may be a request processing server or a chip applied to a request processing server. Figure 4 A schematic diagram of another flow control device provided by an exemplary embodiment of this disclosure is shown. Figure 4 As shown, the device 400 includes:

[0176] Communication module 401 is used to receive service call requests from users;

[0177] Processing module 402 is used to obtain the current traffic and current traffic control quota of the target microservice in the request processing server based on the identifier of the target microservice carried in the service call request;

[0178] The communication module 401 is used to send a quota allocation request to the traffic management server when the current traffic is greater than or equal to the current traffic control quota; wherein, the quota allocation request is used to request the traffic management server to adjust the current traffic control quota, obtain the adjusted traffic control quota, and generate a quota adjustment instruction based on the adjusted traffic control quota.

[0179] Communication module 401 is also used to receive quota adjustment instructions sent by the traffic management server;

[0180] The control module 403 is used to perform traffic control on the target microservice based on the adjusted traffic control quota determined by the quota adjustment instruction.

[0181] An exemplary embodiment of this disclosure also provides an electronic device, including: at least one processor; a memory for storing at least one processor-executable instruction; wherein the at least one processor is configured to execute the instruction to implement the steps of the method disclosed in the exemplary embodiment of this disclosure.

[0182] Figure 5 A schematic diagram of the structure of an electronic device provided in an exemplary embodiment of this disclosure is shown. For example... Figure 5 As shown, the electronic device 500 includes at least one processor 501 and a memory 502 coupled to the processor 501, which can perform the corresponding steps in the methods disclosed in the exemplary embodiments of this disclosure.

[0183] The processor 501 described above can also be referred to as a Central Processing Unit (CPU), which can be an integrated circuit chip with signal processing capabilities. Each step in the method disclosed in the exemplary embodiments of this disclosure can be implemented by the integrated logic circuitry in the hardware of the processor 501 or by instructions in software form. The processor 501 described above can be a general-purpose processor, a digital signal processor (DSP), an ASIC, a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in conjunction with the exemplary embodiments of this disclosure can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules can be located in the memory 502, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The processor 501 reads information from the memory 502 and, in conjunction with its hardware, completes the steps of the above method.

[0184] Furthermore, various operations / processes according to this disclosure, implemented via software and / or firmware, can be transmitted from a storage medium or network to a computer system with a dedicated hardware architecture, for example, Figure 6 The computer system 600 shown is equipped with the programs that constitute the software. When various programs are installed, the computer system is able to perform various functions, including functions such as those described above. Figure 6 A schematic diagram of the structure of a computer system provided in an exemplary embodiment of this disclosure is shown.

[0185] Computer system 600 is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0186] like Figure 6As shown, the computer system 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. The RAM 603 may also store various programs and data required for the operation of the computer system 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0187] Multiple components in the computer system 600 are connected to the I / O interface 605, including: an input unit 606, an output unit 607, a storage unit 608, and a communication unit 609. The input unit 606 can be any type of device capable of inputting information into the computer system 600. The input unit 606 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of the electronic device. The output unit 607 can be any type of device capable of presenting information and may include, but is not limited to, a monitor, speaker, video / audio output terminal, vibrator, and / or printer. The storage unit 608 may include, but is not limited to, a hard disk and an optical disk. The communication unit 609 allows the computer system 600 to exchange information / data with other devices via a network such as the Internet, and may include, but is not limited to, a modem, network card, infrared communication device, wireless communication transceiver, and / or chipset, such as Bluetooth™ devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.

[0188] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above. For example, in some embodiments, the methods disclosed in the exemplary embodiments of this disclosure can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on an electronic device via ROM 602 and / or communication unit 609. In some embodiments, the computing unit 601 can be configured to perform the methods disclosed in the exemplary embodiments of this disclosure by any other suitable means (e.g., by means of firmware).

[0189] This exemplary embodiment also provides a computer-readable storage medium, wherein when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the methods disclosed in this exemplary embodiment.

[0190] The computer-readable storage medium in the exemplary embodiments of this disclosure may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. The aforementioned computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specifically, the aforementioned computer-readable storage medium may include electrical connections based on one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0191] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0192] This disclosure also provides an exemplary embodiment of a computer program product, including a computer program, wherein the computer program, when executed by a processor, implements the methods disclosed in the exemplary embodiments of this disclosure.

[0193] In embodiments of this disclosure, computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof. These programming languages ​​include, but are not limited to, object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network (including a local area network (LAN) or a wide area network (WAN)), or it can be connected to an external computer.

[0194] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0195] The modules, components, or units described in the exemplary embodiments of this disclosure may be implemented in software or hardware. The names of the modules, components, or units do not, in some cases, constitute a limitation on the module, component, or unit itself.

[0196] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary hardware logic components that can be used include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.

[0197] The above description is merely an embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0198] While specific embodiments of this disclosure have been described in detail by way of example, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of this disclosure. Those skilled in the art should understand that modifications can be made to the above embodiments without departing from the scope and spirit of this disclosure. The scope of this disclosure is defined by the appended claims.

Claims

1. A flow control method, characterized in that, Applied to a traffic management server, the method includes: The system receives a quota allocation request from a target request processing server among multiple request processing servers, and obtains the current total traffic and total traffic control quota of the target microservice based on the identifier of the target microservice carried in the quota allocation request; wherein the target microservice is deployed in each of the request processing servers. If the current total traffic is less than the total traffic control limit, obtain the current communication time interval, the shortest allowed communication time interval, and the current traffic control limit of the target microservice in the target request processing server; Based on the comparison between the current communication time interval and the shortest allowed communication time interval, a target quota adjustment strategy is determined from multiple preset quota adjustment strategies, and the current traffic control quota is adjusted using the target quota adjustment strategy to obtain the adjusted traffic control quota. A quota adjustment instruction is generated based on the adjusted traffic control quota, and the quota adjustment instruction is sent to the target request processing server; wherein, the quota adjustment instruction is used to instruct the target request processing server to use the adjusted traffic control quota to perform traffic control on the target microservice; The multiple preset quota adjustment strategies include a first quota adjustment strategy and a second quota adjustment strategy. The first quota adjustment strategy is related to the ratio between the current communication time interval and the shortest allowed communication time interval, and the second quota adjustment strategy is related to the traffic pressure data of the target microservice in the target request processing server. The step of determining a target quota adjustment strategy from multiple preset quota adjustment strategies based on the comparison result between the current communication time interval and the shortest allowed communication time interval includes: If the current communication time interval is less than the shortest allowed communication time interval, then the first quota adjustment strategy is determined to be the target quota adjustment strategy; If the current communication time interval is greater than or equal to the shortest allowed communication time interval, then the second quota adjustment strategy is determined to be the target quota adjustment strategy.

2. The method according to claim 1, characterized in that, The step of adjusting the current traffic control quota using the target quota adjustment strategy to obtain the adjusted traffic control quota includes: Obtain the ratio between the current communication time interval and the shortest allowed communication time interval; Based on the ratio, the current traffic control quota, and the first quota adjustment strategy, the adjusted traffic control quota is calculated.

3. The method according to claim 1, characterized in that, The traffic pressure data includes the traffic pressure of the current communication time interval and the traffic pressure of at least two historical communication time intervals that are closest to the current communication time interval. The traffic pressure is used to characterize the number of service call requests for the target microservice received by the target request processing server per unit time. The step of adjusting the current traffic control quota using the target quota adjustment strategy to obtain the adjusted traffic control quota includes: Obtain the traffic pressure of the current communication time interval, and the traffic pressure of at least two historical communication time intervals that are closest to the current communication time interval; Based on the traffic pressure of the current communication time interval and the traffic pressure of at least two historical communication time intervals that are closest to the current communication time interval, determine the traffic pressure trend data of the target microservice in the target request processing server; Based on the traffic pressure trend data, the current traffic control quota, and the second quota adjustment strategy, the adjusted traffic control quota is calculated.

4. The method according to claim 1, characterized in that, The method further includes: Obtain the remaining traffic control quota for the target microservice; If the adjusted flow control quota is less than or equal to the remaining flow control quota, the step of generating a quota adjustment instruction based on the adjusted flow control quota is executed; If the adjusted traffic control quota is greater than the remaining traffic control quota, the remaining traffic control quota is determined as the adjusted traffic control quota, and the step of generating a quota adjustment instruction based on the adjusted traffic control quota is executed.

5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: If the current total traffic is greater than or equal to the total traffic control limit, a rate limiting instruction is generated; wherein, the rate limiting instruction is used to instruct the target request processing server to stop calling the service resources of the target microservice during the current traffic control period; Send the rate limiting instruction to the target request processing server.

6. A flow control method, characterized in that, A request processing server applied in the flow control method as described in any one of claims 1 to 5, the method comprising: Receive a user's service call request, and based on the identifier of the target microservice carried in the service call request, obtain the current traffic and current traffic control quota of the target microservice in the request processing server; If the current traffic is greater than or equal to the current traffic control quota, a quota allocation request is sent to the traffic management server; wherein, the quota allocation request is used to request the traffic management server to adjust the current traffic control quota, obtain the adjusted traffic control quota, and generate a quota adjustment instruction based on the adjusted traffic control quota; The system receives the quota adjustment instruction sent by the traffic management server and performs traffic control on the target microservice based on the adjusted traffic control quota determined by the quota adjustment instruction.

7. A flow control device, characterized in that, A traffic management server applied in the traffic control method as described in any one of claims 1 to 5, the apparatus comprising: The communication module is used to receive quota allocation requests sent by the target request processing server among multiple request processing servers; The processing module is used to obtain the current total traffic and total traffic control quota of the target microservice based on the identifier of the target microservice carried in the quota allocation request; wherein the target microservice is deployed in each of the request processing servers; The processing module is also used to obtain the current communication time interval, the shortest allowed communication time interval, and the current traffic control quota of the target microservice in the target request processing server when the current total traffic is less than the total traffic control quota. The processing module is also used to determine a target quota adjustment strategy from multiple preset quota adjustment strategies based on the comparison result between the current communication time interval and the shortest allowed communication time interval; The adjustment module is used to adjust the current traffic control quota using the target quota adjustment strategy to obtain the adjusted traffic control quota; The generation module is used to generate a quota adjustment instruction based on the adjusted flow control quota; The communication module is used to send the quota adjustment instruction to the target request processing server; wherein, the quota adjustment instruction is used to instruct the target request processing server to use the adjusted traffic control quota to perform traffic control on the target microservice; The multiple preset quota adjustment strategies include a first quota adjustment strategy and a second quota adjustment strategy. The first quota adjustment strategy is related to the ratio between the current communication time interval and the shortest allowed communication time interval, and the second quota adjustment strategy is related to the traffic pressure data of the target microservice in the target request processing server. The adjustment module is further configured to determine the first quota adjustment strategy as the target quota adjustment strategy if the current communication time interval is less than the minimum allowed communication time interval; and to determine the second quota adjustment strategy as the target quota adjustment strategy if the current communication time interval is greater than or equal to the minimum allowed communication time interval.

8. A flow control device, characterized in that, The request processing server applied in the flow control method as described in any one of claims 1 to 5, the apparatus comprising: The communication module is used to receive service call requests from users; The processing module is used to obtain the current traffic and current traffic control quota of the target microservice in the request processing server based on the identifier of the target microservice carried in the service call request; A communication module is configured to send a quota allocation request to a traffic management server when the current traffic is greater than or equal to the current traffic control quota; wherein the quota allocation request is configured to request the traffic management server to adjust the current traffic control quota, obtain an adjusted traffic control quota, and generate a quota adjustment instruction based on the adjusted traffic control quota; The communication module is also used to receive the quota adjustment instruction sent by the traffic management server; The control module is used to perform traffic control on the target microservice based on the adjusted traffic control quota determined by the quota adjustment instruction.

9. An electronic device, characterized in that, include: At least one processor; Memory for storing the at least one processor-executable instruction; The at least one processor is configured to execute the instructions to implement the steps of the method as described in any one of claims 1 to 5 or 6.

10. A computer program product, characterized in that, Includes a computer program, wherein when the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 5 or 6.

Citation Information

Patent Citations

  • Micro-service distributed current limiting method and device, storage medium and electronic equipment

    CN110753131A

  • Flow control system, method and device

    CN117014346A