Flow control method and device, equipment, program product and storage medium

By calculating available traffic based on the interfaces and current limiting rules of service requests and performing refined flow control, the problem of insufficient current limiting in the prior art is solved, and the stability and user experience of the service system are improved.

CN119766740APending Publication Date: 2025-04-04INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411882257.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

Existing current flow-limiting methods cannot accurately control distributed system traffic, resulting in resources being underutilized in some time periods and overloading in other time periods, affecting user experience.

Method used

By receiving service requests, the target current limit rules are determined based on the request interface, the preset interface current limit rules and the object current limit rules, the available traffic is calculated, and the current limit is performed based on the request traffic and available traffic.

Benefits of technology

It realizes more flexible, accurate and fine-grained flow control, and can accurately limit the current for different services and interfaces, improving the stability and user experience of the business system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119766740A_ABST
    Figure CN119766740A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a flow control method, device and equipment, a program product and a storage medium, and relates to the technical field of distribution.The method comprises the steps that a service request sent by a user at the current moment is received; determining a target flow limiting rule of the service request according to the request interface of the service request, preset flow limiting rules of each interface and preset flow limiting rules of each object; wherein the target flow limiting rule comprises a target interface flow limiting rule and a target object flow limiting rule; determining the available flow of the service request at the current moment based on the request interface, the current moment and the target flow limiting rule; and limiting the flow of the service request based on the request flow of the service request and the available flow at the current moment. According to the method provided by the invention, the flow of the request interface can be finely controlled, and the accuracy and flexibility of flow limiting are improved, so that a service system can accurately carry out flow limiting on different services and different interfaces, and the stability of the service system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of distributed technology, and in particular, to a flow control method, apparatus, device, program product, and storage medium. Background Art

[0002] In distributed technology, a rate limiter is a mechanism for controlling the flow of a distributed system, which can prevent the system from being overloaded and crashing due to high load pressure.

[0003] The current flow limiting method is generally to limit the flow of business requests through a fixed flow limiting threshold, such as setting a limit on the total concurrency, and determining whether to limit the flow of business requests based on the concurrency of the database connection pool and thread pool of the business system. Although this method can control the flow to a certain extent, it may cause resources to be underutilized in certain time periods and overloaded in other time periods. In addition, this method can only limit the flow of the overall concurrency of the business system, resulting in inaccurate flow limiting and affecting user experience. Summary of the invention

[0004] The embodiments of the present invention provide a flow control method, apparatus, device, program product and storage medium, which can provide a more flexible, more accurate and more fine-grained flow control mechanism, so that the business system can accurately limit the flow of different businesses and different interfaces, thereby improving the stability of the business system and further improving the user experience.

[0005] In a first aspect, an embodiment of the present invention provides a flow control method, including:

[0006] Receive the service request sent by the user at the current moment;

[0007] Determine the target flow limiting rule of the service request according to the request interface of the service request, the preset flow limiting rules of each interface and the preset flow limiting rules of each object; wherein the target flow limiting rule includes the target interface flow limiting rule and the target object flow limiting rule;

[0008] Determine the available flow of the service request at the current time based on the request interface, the current time and the target flow limiting rule;

[0009] The service request is limited based on the request flow of the service request and the available flow at the current moment.

[0010] In a second aspect, an embodiment of the present invention provides a flow control device, the device comprising:

[0011] An information receiving module is used to receive a service request sent by a user at the current moment;

[0012] A rule determination module, used to determine the target flow limiting rule of the business request according to the request interface of the business request, the preset flow limiting rules of each interface and the preset flow limiting rules of each object; wherein the target flow limiting rule includes the target interface flow limiting rule and the target object flow limiting rule;

[0013] A flow determination module, used to determine the available flow of the service request at the current moment based on the request interface, the current moment and the target flow limiting rule;

[0014] The flow control module is used to limit the flow of the service request based on the request flow of the service request and the available flow at the current moment.

[0015] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a flow control method as described in any one of the embodiments of the present invention is implemented.

[0016] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a flow control method as described in any one of the embodiments of the present invention.

[0017] In a fifth aspect, an embodiment of the present invention provides a computer program product, including a computer program, which, when executed by a processor, implements a flow control method as described in any one of the embodiments of the present invention.

[0018] In an embodiment of the present invention, a service request sent by a user at the current moment is received; a target flow limiting rule for the service request is determined according to a request interface of the service request, pre-set flow limiting rules for each interface, and pre-set flow limiting rules for each object; wherein the target flow limiting rule includes a target interface flow limiting rule and a target object flow limiting rule; based on the request interface, the current moment, and the target flow limiting rule, the available flow of the service request at the current moment is determined; and the service request is flow limited based on the request flow of the service request and the available flow at the current moment. The method of the embodiment of the present invention limits the flow of the service request according to different interface flow limiting rules and object flow limiting rules, can finely control the flow of the request interface, improve the accuracy and flexibility of the flow limiting, enable the service system to accurately limit the flow of different services and different interfaces, improve the stability of the service system, and further improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0020] Figure 1 A first flow chart of a flow control method provided by an embodiment of the present invention;

[0021] Figure 2 A second flow chart of a flow control method provided by an embodiment of the present invention;

[0022] Figure 3 A flow chart of a method for adjusting the flow limiting rules of each business object provided by an embodiment of the present invention;

[0023] Figure 4 A schematic structural diagram of a flow control device provided by an embodiment of the present invention;

[0024] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0025] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0026] Figure 1 This is the first flow chart of a flow control method provided in an embodiment of the present invention. The method in the embodiment of the present invention can provide a more flexible, more accurate and more fine-grained flow control mechanism, so that the business system can accurately limit the flow of different businesses and different interfaces, thereby improving the stability of the business system and further improving the user experience. The information collected in the method in the embodiment of the present invention is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse. The method can be executed by a flow control device provided in an embodiment of the present invention, and the device can be implemented in software and / or hardware. The following embodiments will be described by taking the device integrated in an electronic device as an example. The electronic device can be a server or a computer device, etc., with reference to Figure 1 , the method may specifically include the following steps:

[0027] Step 101: Receive a service request sent by a user at the current moment.

[0028] Among them, a business request is a request sent by a user when interacting with a business system through a request interface when handling a business. For example, when a user uses the intelligent question-and-answer service of a business system, he sends a question to the business system. The business system can receive the question request sent by the user through the interface provided by the intelligent question-and-answer service. Specifically, by receiving the request sent by the user, the business system can interact with the user, understand the user's needs and provide instant feedback. The business system receives a large number of requests at all times. Limiting the flow of requests can ensure that all users can use system resources within a reasonable range, and prevent some users from occupying too many resources and affecting the experience of other users.

[0029] Step 102: Determine the target flow limiting rule of the business request according to the request interface of the business request, the preset flow limiting rules of each interface, and the preset flow limiting rules of each object.

[0030] Among them, the target flow limiting rules include target interface flow limiting rules and target object flow limiting rules. Business objects are specific entities that interact with the business system. Business objects can be enterprises, organizations, partners or individual users, etc. A business object can correspond to multiple request interfaces, and a request interface can be used by multiple business objects. Different business objects correspond to different object flow limiting rules. Object flow limiting rules include object unit time and object unit time total flow. The object unit time total flow is the total cumulative flow that all interfaces of the business object can use within the object unit time. The object unit time is a time interval predetermined by the business system based on the characteristics of domain big data and business objects. Different business objects correspond to different object unit times, and the object unit time can be one second, one minute or five minutes, etc. If the cumulative flow used by all interfaces of a business object within an object unit time exceeds the object unit time total flow specified in the flow limiting rules of the business object, it is necessary to limit the flow of the request interface of the business object within the object unit time.

[0031] Different request interfaces also correspond to different interface flow limiting rules. The interface flow limiting rules include the total interface flow per unit time of each interface and the total interface flow per unit time that can be provided for each business object. Different interfaces can correspond to different interface unit times, and the total interface flow per unit time is all the flow that the interface can provide per unit time. The flow that an interface can provide to different business objects per unit time can also be different. Exemplarily, the interface unit time of interface A is 5 minutes, there are 3 business objects, and the total interface flow per unit time of interface A is 10 megabytes. Interface A can be used by all objects, and the flow that can be provided to each business object per unit time is the total interface flow per unit time of the interface. It can be determined that within each 5 minutes, interface A can provide flow for all business objects, but the total accumulated flow cannot exceed 10 megabytes. Exemplarily, the interface unit time of interface A is 5 minutes, there are 3 business objects, and the total interface flow per unit time of interface A is 10 megabytes. Interface A can provide 8 megabytes of flow for business object 1, 1 megabyte of flow for business object 2, and 1 megabyte of flow for business object 3. If a service request 3 corresponding to a service object requests more than 1 megabyte of traffic within 5 minutes, the service request needs to be limited. Specifically, after receiving the service request sent by the user, the target interface limiting rule is determined according to the request interface used by the service request, and the target object limiting rule is determined according to the service object to which the service request belongs.

[0032] Step 103: Determine the available flow of the service request at the current time based on the request interface, the current time and the target flow limiting rule.

[0033] Among them, the target flow limiting rules include target interface flow limiting rules and target object flow limiting rules; the target object flow limiting rules include the object unit time of the business object and the total flow per object unit time. According to the target object flow limiting rules, the service available flow of the service request can be determined, and the object unit time available flow is the flow that can be used by the request interface within the object unit time at the current moment. According to the target interface flow limiting rules, the interface available flow of the service request can be determined. The interface available flow of the service request is the flow that the service request can still use on the request interface at the current moment. Specifically, after determining the service available flow of the service request and the interface available flow of the service request, the flow with the smaller flow value of the two flows can be determined as the available flow of the service request at the current moment. That is, if the interface available flow is greater than or equal to the service available flow, the service available flow is determined to be the available flow of the service request at the current moment; if the interface available flow is less than the service available flow, the interface available flow is determined to be the available flow of the service request at the current moment.

[0034] Exemplarily, business object 1 can use interface A and interface B. The flow limiting rule corresponding to business object 1 is: the total flow per minute does not exceed 30 megabytes. At 3 minutes and 00 seconds, it is determined that interface A uses 25 megabytes of flow, interface B uses 5 megabytes of flow, and at 3 minutes and 42 seconds, the service request sent by interface A is received, then the service available flow of the service request is determined to be: 30-25-5=0 megabytes. Interface A can provide 50 megabytes of flow for business object 1 every 10 minutes. At 1 minute and 00 seconds, interface A provides 25 megabytes of flow for business object 1, then the interface available flow of the service request corresponding to business object 1 is 25 megabytes. Further, according to the service available flow of the service request (0 megabytes) and the interface available flow of the service request (25 megabytes), it is determined that the available flow of the service request at the current moment is 0 megabytes.

[0035] Step 104: Limit the flow of the service request based on the request flow of the service request and the available flow at the current moment.

[0036] Among them, the request flow of the business request is the flow that the business system needs to use to respond to the business request. Specifically, after determining the business available flow of the business request, the business system calculates the request flow of the business request according to relevant parameters such as the complexity of the business request. The business request is limited according to the request flow and the available flow of the business request at the current moment. In this scheme, optionally, the business request is limited based on the request flow of the business request and the available flow at the current moment, including: if the request flow is greater than the available flow, the business importance level of the business request is obtained; if the business importance level belongs to the preset level, the business request is sent to a pre-established request queue; based on the request queue, the business request is responded to in the next unit time.

[0037] Among them, the business importance level is pre-defined by the business system according to the importance of different businesses. The higher the importance level of a business, the more important the business is. The preset level is pre-set by the business system and is used to determine the importance level of how to limit the flow of business requests. Specifically, when the business request flow exceeds the available flow at the current moment, it means that the business request needs to be limited. However, for some very important businesses, directly rejecting the request may lead to poor user experience. In this solution, when the business request flow exceeds the available flow at the current moment, the business importance level corresponding to the business request is determined. If the business importance level belongs to the preset level, it means that the importance of the business is high, and the business request can be temporarily stored in the request queue. For the business request placed in the queue, a confirmation message can be returned to the user to inform him that the business request has been accepted and will be processed later. If the business importance level does not belong to the preset level, the business request can be directly rejected. If the request flow is less than the available flow at the current moment, it does not need to be limited, and the business request can be directly responded to.

[0038] For example, suppose there is an e-commerce service (business object), in which interface A is used to process user requests such as shopping cart operations, order submission and payment. The business importance levels are: shopping cart operations: medium; order submission: high; payment: urgent. According to the target flow limiting rules, the e-commerce service can still use 5 megabytes of traffic through interface A at the current moment. At this time, a new order submission request is received, and its expected traffic is 6 megabytes. After receiving the request, the system determines that the request traffic is 6 megabytes, and after comparing it with the available traffic at the current moment (5 megabytes), it determines that it needs to be limited. Furthermore, the business system obtains that the business importance level of the business request is high and belongs to the preset level. The request is then placed in the pre-established request queue for processing.

[0039] Adopting different processing strategies for different business importance levels can improve user experience while ensuring system stability.

[0040] The technical solution of this embodiment receives a service request sent by a user at the current moment; determines the target flow limiting rule of the service request according to the request interface of the service request, the pre-set flow limiting rules of each interface and the pre-set flow limiting rules of each object; wherein the target flow limiting rule includes the unit time and the total flow per unit time; determines the available flow of the service request at the current moment based on the request interface, the current moment and the target flow limiting rule; and limits the flow of the service request based on the request flow of the service request and the available flow at the current moment. The technical solution of this embodiment limits the flow of different request interfaces according to different flow limiting rules based on unit time, can finely control the flow of the request interface, improve the accuracy and flexibility of the flow limiting, enable the business system to accurately limit the flow of different services and different interfaces, improve the stability of the business system, and further improve the user experience.

[0041] Figure 2 The second flow chart of a flow control method provided by an embodiment of the present invention is a refinement of the above embodiment. The specific method can be as follows Figure 2 As shown, the method may include the following steps:

[0042] Step 201: Receive a service request sent by a user at the current moment.

[0043] Step 202: Obtain the interface identifier of the request interface, and determine the target interface current limiting rule according to the interface identifier and the current limiting rules of each interface.

[0044] Among them, the interface identifier is used to mark different interfaces, and one interface identifier corresponds to one interface. Different request interfaces also correspond to different interface current limiting rules, and the interface current limiting rules include the total interface flow per unit time and the interface flow per unit time that can be provided for each business object. Different interfaces can correspond to different interface unit times. Specifically, after receiving the service request sent by the user, determine the interface identifier of the request interface through which the user sends the service request, determine the interface current limiting rule corresponding to the interface identifier in each predetermined interface current limiting rule, and determine it as the target interface current limiting rule.

[0045] Step 203: Determine the target business object to which the business request belongs, and determine the target object current limiting rule according to the current limiting rules of each object of the target business object.

[0046] Specifically, the flow limiting rules for each object are pre-defined by the business system according to the characteristics of different business objects. The object flow limiting rules include the object unit time and the total flow per object unit time. Different business objects correspond to different flow limiting rules. The total flow per object unit time of some business objects with higher business importance may be slightly larger, while the total flow per object unit time of some business objects with lower business importance may be slightly smaller. After receiving the business request, the target business object to which the business request belongs is determined according to the content of the business request. After determining the target business object, the flow limiting rule for the target business object is determined in each object flow limiting rule, and it is determined as the target object flow limiting rule corresponding to the business request.

[0047] Step 204: Calculate the service available flow of the service request based on the target object flow limiting rule.

[0048] Specifically, after determining the target object flow limiting rule, the object unit time at the current moment is determined according to the object unit time specified in the target object flow limiting rule. For example, if the unit time is per minute, the current moment needs to be converted into minutes. After determining the object unit time, the traffic used by the business object through all interfaces in the object unit time at the current moment is obtained. Exemplarily, the business object is an "order processing system", which includes two interfaces: interface 1 and interface 2. The unit time is 1 minute, and the current moment is 10:02:30. Assuming that the start time is 00:00, the object unit time at the current moment is determined to be the 21st minute. Interface 1 used 5 megabytes of traffic in the 21st minute, and interface 2 used 3 megabytes of traffic in the 21st minute. It is determined that the traffic usage of all interfaces of the target business object in the current object unit time is 8 megabytes. After obtaining the traffic usage of the current unit time, the difference between the traffic usage of the object unit time at the current moment and the total traffic of the object unit time of the target flow limiting rule can be determined as the service available traffic of the service request. Exemplarily, the traffic usage per unit time of all interfaces of the target business object at the current moment is 8 megabytes, and the total traffic per unit time of the object in the target flow limiting rule is 10 megabytes, then the business available traffic for the business request at the current moment is determined to be 2 megabytes.

[0049] Step 205: Determine the available flow of the service request at the current moment according to the target interface current limiting rule, the service request and the service available flow.

[0050] Among them, the interface current limiting rules include the total interface flow per unit time and the interface flow per unit time that can be provided to each business object. Specifically, after determining the service available flow of the business request, determine how much flow (interface available flow) the business request can still use through the request interface according to the target interface current limiting rules, and determine the available flow of the business request at the current moment according to the interface available flow and the service available flow. In this scheme, optionally, the available flow of the business request at the current moment is determined according to the target interface current limiting rules, the business request and the service available flow, including: calculating the interface available flow of the business request based on the target interface current limiting rules; if the interface available flow is greater than or equal to the service available flow, determining the service available flow as the available flow of the business request at the current moment; if the interface available flow is less than the service available flow, determining the interface available flow as the available flow of the business request at the current moment.

[0051] Specifically, after determining the target interface current limiting rule, obtain the used traffic used by the business object on the request interface (target interface) within the interface unit time at the current moment, and determine the difference between the total interface unit time traffic of the business request fixed in the target interface current limiting rule and the used traffic as the interface available traffic of the business request on the request interface at the current moment. Compare the interface available traffic with the available business traffic. If the interface available traffic is greater than or equal to the business available traffic, determine the business available traffic as the available traffic of the business request at the current moment; if the interface available traffic is less than the business available traffic, determine the interface available traffic as the available traffic of the business request at the current moment.

[0052] Step 206: Limit the flow of the service request based on the request flow of the service request and the available flow at the current moment.

[0053] In the technical solution of this embodiment, a service request sent by a user at the current moment is received. The interface identifier of the request interface is obtained, and the target interface current limiting rule is determined according to the interface identifier. The target business object to which the service request belongs is determined, and the target object current limiting rule is determined according to the target business object. The service available flow of the service request is calculated based on the target object current limiting rule. The available flow of the service request at the current moment is determined according to the target interface current limiting rule, the service request, and the service available flow. The service request is current limited based on the request flow of the service request and the available flow at the current moment. The technical solution of this embodiment can accurately determine the interface current limiting rule according to the interface identifier, and determine the object current limiting rule according to the service request, so as to perform multi-dimensional current limiting on the service request according to the interface current limiting rule and the object current limiting rule corresponding to the service request, thereby realizing refined control of the flow of the request interface, improving the accuracy and flexibility of current limiting, enabling the service system to accurately limit the flow of different services and different interfaces, improving the stability of the service system, and further improving the user experience.

[0054] Figure 3 Flow chart of a method for adjusting the flow limiting rules of each business object provided by an embodiment of the present invention. The specific method can be as follows Figure 3 As shown, the method may include the following steps:

[0055] Step 301: Obtain the traffic usage of each business object according to the preset time interval corresponding to each business object.

[0056] Among them, the traffic usage includes the number of flow restrictions and the traffic usage information of each object per unit time within the preset time interval. The preset time interval is determined by the business system based on the domain big data and the specific application environment. The preset time interval is used to instruct the business system to regularly collect and analyze traffic usage. The business system can collect the traffic usage data of all business objects in each time interval according to the preset time interval. The traffic usage data of each object per unit time of each business object in the time interval is counted to obtain the traffic usage information of each business object at each point time. For example, the preset time interval is one week, and the unit time of each object includes 1 minute, 30 minutes, 1 hour and 1 day. Then the business system can count the number of flow restrictions and traffic usage corresponding to the business object every 1 minute, 30 minutes, 1 hour and 1 day in each week.

[0057] Step 302: For each business object, analyze the traffic usage of the current business object to obtain an analysis result, and adjust the object flow limiting rule of the current business object based on the analysis result.

[0058] Specifically, after obtaining the traffic usage of each business object, the business system can perform a detailed analysis of the traffic usage of each business object to obtain the analysis results. The analysis results include the average traffic, peak traffic, and current limiting triggering frequency of the business object. Based on the analysis results, the business system can determine the characteristics of each business object, such as which business objects consume more traffic and which business objects frequently trigger current limiting, so as to adjust the current limiting rules of the business objects according to the characteristics of the business objects. For example, if a business object frequently triggers current limiting, the total traffic limit per unit time of the object can be appropriately increased; conversely, if a business object rarely triggers current limiting, the total traffic limit per unit time of the object can be appropriately reduced.

[0059] The technical solution of this embodiment obtains the traffic usage of each business object according to the preset time interval corresponding to each business object; wherein the traffic usage includes the number of flow limiting times and the traffic usage information of each unit time within the preset time interval; for each business object, the traffic usage of the current business object is analyzed to obtain the analysis result; based on the analysis result, the flow limiting rules of the current business object are adjusted. The technical solution of this embodiment can effectively manage and optimize the traffic usage of each business object. It not only helps to ensure the stability and performance of the system, but also improves the utilization rate of resources. By dynamically adjusting the flow limiting rules, it can better adapt to the changing business needs and ensure the smooth operation of key businesses.

[0060] Figure 4 FIG. 1 is a schematic diagram of the structure of a flow control device provided in an embodiment of the present invention, and the device is suitable for executing the flow control method provided in an embodiment of the present invention. Figure 4As shown, the device may specifically include:

[0061] The information receiving module 401 is used to receive the service request sent by the user at the current moment;

[0062] A rule determination module 402 is used to determine a target flow limiting rule for the service request according to the request interface of the service request, preset flow limiting rules for each interface, and preset flow limiting rules for each object; wherein the target flow limiting rule includes a target interface flow limiting rule and a target object flow limiting rule;

[0063] A flow determination module 403, configured to determine the available flow of the service request at the current moment based on the request interface, the current moment and the target flow limiting rule;

[0064] The flow control module 404 is used to limit the flow of the service request based on the request flow of the service request and the available flow at the current moment.

[0065] Optionally, the rule determination module 402 is specifically used to: obtain the interface identifier of the request interface, and determine the target interface current limiting rule according to the interface identifier;

[0066] Determine the target business object to which the business request belongs, and determine the target object current limiting rule according to the target business object.

[0067] Optionally, the traffic determination module 403 is specifically configured to: calculate the service available traffic of the service request based on the target object traffic limiting rule;

[0068] The available flow of the service request at the current moment is determined according to the target interface current limiting rule, the service request and the service available flow.

[0069] Optionally, the flow determination module 403 is further used to: calculate the interface available flow of the service request based on the target interface flow limiting rule;

[0070] If the available traffic of the interface is greater than or equal to the available traffic of the service, the available traffic of the service is determined to be the available traffic of the service request at the current moment; if the available traffic of the interface is less than the available traffic of the service, the available traffic of the interface is determined to be the available traffic of the service request at the current moment.

[0071] Optionally, the traffic control module 404 is specifically configured to: if the requested traffic is greater than the available traffic at the current moment, obtain a service importance level of the service request; if the service importance level belongs to a preset level, send the service request to a pre-established request queue;

[0072] The service request is responded to in a next unit time based on the request queue.

[0073] Optionally, the rule determination module 402 is further used to: obtain the traffic usage of each business object according to the preset time interval corresponding to each business object; wherein the traffic usage includes the number of flow limiting times and the traffic usage information of each object per unit time within the preset time interval;

[0074] For each business object, analyze the traffic usage of the current business object and obtain the analysis results;

[0075] The object flow limiting rule of the current business object is adjusted based on the analysis result.

[0076] The flow control device provided in the embodiment of the present invention can execute the flow control method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For the contents not described in detail in this embodiment, reference can be made to the description in any method embodiment of the present invention.

[0077] An embodiment of the present invention also provides a computer program product.

[0078] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer program products, which can include one or more computer programs, which can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor, which can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0079] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, referring to Figure 5 , Figure 5 The electronic device 12 shown is only an example and should not limit the functions and scope of use of the embodiments of the present application. Figure 5As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).

[0080] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0081] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.

[0082] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, usually called a "hard drive"). Although Figure 5 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical medium) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present application.

[0083] A program / utility 40 having a set (at least one) of program modules 46 may be stored, for example, in the memory 28, such program modules 46 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 46 generally perform the functions and / or methods of the embodiments described herein.

[0084] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 12, and / or may communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the electronic device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via the bus 18. It should be understood that although Figure 5 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0085] The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, for example, implementing a flow control method provided in an embodiment of the present invention: receiving a service request sent by a user at the current moment; determining a target flow limiting rule for the service request according to a request interface of the service request, preset flow limiting rules for each interface, and preset flow limiting rules for each object; wherein the target flow limiting rule includes a target interface flow limiting rule and a target object flow limiting rule; determining the available flow of the service request at the current moment based on the request interface, the current moment, and the target flow limiting rule; and limiting the flow of the service request based on the request flow of the service request and the available flow at the current moment.

[0086] An embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, a flow control method as provided in all the embodiments of the present invention is implemented: receiving a service request sent by a user at the current moment; determining a target flow limiting rule for the service request according to a request interface of the service request, preset flow limiting rules for each interface, and preset flow limiting rules for each object; wherein the target flow limiting rule includes a target interface flow limiting rule and a target object flow limiting rule; determining the available flow of the service request at the current moment based on the request interface, the current moment, and the target flow limiting rule; and limiting the flow of the service request based on the request flow of the service request and the available flow at the current moment. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electronic device, device, or device of electrical, magnetic, optical, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction-executing electronic device, apparatus, or device.

[0087] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction-executing electronic device, apparatus, or device.

[0088] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0089] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0090] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A flow control method, characterized in that: The method comprises: Receive the service request sent by the user at the current moment; Determine the target flow limiting rule of the service request according to the request interface of the service request, the preset flow limiting rules of each interface and the preset flow limiting rules of each object; wherein the target flow limiting rule includes the target interface flow limiting rule and the target object flow limiting rule; Determine the available flow of the service request at the current time based on the request interface, the current time and the target flow limiting rule; The service request is limited based on the request flow of the service request and the available flow at the current moment.

2. The method according to claim 1, characterized in that Determining a target flow limiting rule for the business request according to the request interface of the business request, preset flow limiting rules for each interface, and preset flow limiting rules for each object, including: Obtaining the interface identifier of the request interface, and determining the target interface current limiting rule according to the interface identifier and each interface current limiting rule; Determine the target business object to which the business request belongs, and determine the target object current limiting rule according to the target business object and each object current limiting rule.

3. The method according to claim 1, characterized in that Determining the available flow of the service request at the current time based on the request interface, the current time and the target flow limiting rule includes: Calculate the available service flow of the service request based on the target object flow limiting rule; The available flow of the service request at the current moment is determined according to the target interface current limiting rule, the service request and the service available flow.

4. The method according to claim 3, characterized in that Determining the available flow of the service request at the current moment according to the target interface current limiting rule, the service request, and the service available flow includes: Calculate the available interface flow of the service request based on the target interface flow limiting rule; If the available traffic of the interface is greater than or equal to the available traffic of the service, the available traffic of the service is determined to be the available traffic of the service request at the current moment; if the available traffic of the interface is less than the available traffic of the service, the available traffic of the interface is determined to be the available traffic of the service request at the current moment.

5. The method according to claim 1, characterized in that: Limiting the service request based on the request flow of the service request and the available flow at the current moment includes: If the requested traffic is greater than the available traffic at the current moment, the service importance level of the service request is obtained; if the service importance level belongs to a preset level, the service request is sent to a pre-established request queue; The service request is responded to in a next unit time based on the request queue.

6. The method according to claim 1, characterized in that The method further comprises: Obtaining the traffic usage of each business object according to the preset time interval corresponding to each business object; wherein the traffic usage includes the number of flow limits and the traffic usage information per unit time of each object within the preset time interval; For each business object, analyze the traffic usage of the current business object and obtain the analysis results; The object flow limiting rule of the current business object is adjusted based on the analysis result.

7. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements a flow control method according to any one of claims 1 to 6.

8. A flow control device, characterized in that: include: An information receiving module is used to receive a service request sent by a user at the current moment; A rule determination module, used to determine the target flow limiting rule of the business request according to the request interface of the business request, the preset flow limiting rules of each interface and the preset flow limiting rules of each object; wherein the target flow limiting rule includes the target interface flow limiting rule and the target object flow limiting rule; A flow determination module, used to determine the available flow of the service request at the current moment based on the request interface, the current moment and the target flow limiting rule; The flow control module is used to limit the flow of the service request based on the request flow of the service request and the available flow at the current moment.

9. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the flow control method according to any one of claims 1 to 6 is implemented.

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