CN108512768B - Access amount control method and device - Google Patents

Access amount control method and device Download PDF

Info

Publication number
CN108512768B
CN108512768B CN201710099259.XA CN201710099259A CN108512768B CN 108512768 B CN108512768 B CN 108512768B CN 201710099259 A CN201710099259 A CN 201710099259A CN 108512768 B CN108512768 B CN 108512768B
Authority
CN
China
Prior art keywords
service interface
flow control
hot spot
key value
service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710099259.XA
Other languages
Chinese (zh)
Other versions
CN108512768A (en
Inventor
孙迁
李文
白炜
叶国华
司孝波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SuningCom Co ltd
Original Assignee
SuningCom Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SuningCom Co ltd filed Critical SuningCom Co ltd
Priority to CN201710099259.XA priority Critical patent/CN108512768B/en
Publication of CN108512768A publication Critical patent/CN108512768A/en
Application granted granted Critical
Publication of CN108512768B publication Critical patent/CN108512768B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/10Flow control between communication endpoints

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the invention discloses a method and a device for controlling access volume, relates to the technical field of Internet, and can relieve the phenomenon that the protection of a system is realized by taking sacrifice of non-high concurrent services as a precondition in the existing scheme. The invention comprises the following steps: obtaining a key value of a currently operated business interface, and reading the quantity of concurrent requests pointing to the business interface, wherein the key value is used for identifying the business level of the currently operated business interface; detecting whether the service interface corresponding to the key value is a hot spot or not according to the quantity of the concurrent requests pointing to the service interface; if so, intercepting a part of the concurrent request pointing to the service interface according to the hot spot passing rate corresponding to the service interface; and detecting whether to execute flow control on the service interface according to the hotspot passing rate corresponding to the service interface. The method is suitable for flow control in a high concurrency scene.

Description

Access amount control method and device
Technical Field
The invention relates to the technical field of internet, in particular to a method and a device for controlling access amount.
Background
With the development of internet technology, online shopping platforms have been explosively increased in recent years and gradually become a main shopping means in people's life. Operators of large online shopping platforms are also constantly optimizing platform performance to facilitate carrying more visits.
The high concurrent services such as promotion and rush purchase, which easily cause peak access amount, often greatly increase the operation load of the online shopping platform, and the flow control is performed at present in order to maintain the stable operation of the system. However, in business systems such as a commodity display system and a detail page display system, various services are often assumed, and due to the flow control performed by the high-concurrency service, the normal execution of the non-high-concurrency service assumed by the business systems is affected, for example: after the business system enters the flow control mode, adopting a preemptive processing mode: firstly processing the first service and simultaneously controlling the requests of other services; and after the completed service is released, accessing the requests of other services and allocating corresponding computing resources for the requests.
And the phenomenon that the system is protected by sacrificing the non-high-concurrency service as a precondition is caused, so that the normal operation of the non-high-concurrency service is influenced, and finally, the sales volume is reduced.
Disclosure of Invention
Embodiments of the present invention provide a method and an apparatus for controlling an access volume, which can alleviate a phenomenon that a system is protected by sacrificing a non-high-concurrency service in an existing scheme.
In order to achieve the above purpose, the embodiment of the invention adopts the following technical scheme:
in a first aspect, an embodiment of the present invention provides a method, including:
obtaining a key value of a currently operated business interface, and reading the quantity of concurrent requests pointing to the business interface, wherein the key value is used for identifying the business level of the currently operated business interface;
detecting whether the service interface corresponding to the key value is a hot spot or not according to the quantity of the concurrent requests pointing to the service interface;
if so, intercepting a part of the concurrent request pointing to the service interface according to the hot spot passing rate corresponding to the service interface;
and detecting whether to execute flow control on the service interface according to the hotspot passing rate corresponding to the service interface.
With reference to the first aspect, in a first possible implementation manner of the first aspect, the detecting, according to the number of the concurrent requests directed to the service interface, whether the service interface corresponding to the key value is a hotspot includes:
detecting the quantity of concurrent requests pointing to the service interface in unit time, and whether the quantity reaches a preset threshold;
and if so, determining that the service corresponding to the key value is a hot spot.
With reference to the first aspect, in a second possible implementation manner of the first aspect, the detecting whether to perform flow control on the service interface according to the hotspot passing rate corresponding to the service interface includes:
determining a flow control threshold value of the service interface according to the hot spot passing rate corresponding to the service interface and the currently read random number;
and detecting whether to execute flow control on the service interface according to the flow control threshold aiming at the intercepted concurrent request pointing to the service interface.
With reference to the second possible implementation manner of the first aspect, in a third possible implementation manner, the method further includes:
acquiring the effective duration of a service interface which is a hotspot, and dividing the effective duration into at least 2 time nodes, wherein if the effective duration is exceeded, the service interface fails to be a non-hotspot;
and determining the hot spot passing rate of the next time node according to the ratio of the passing number and the flow control number of the concurrent requests in the current time node.
With reference to the third possible implementation manner of the first aspect, in a fourth possible implementation manner, the method further includes:
when one service interface is used as an effective hotspot, allocating a cache according to a key value of the service interface, wherein the cache is used for storing a concurrent request pointing to the service interface;
when one service interface is converted from a valid hotspot to an invalid hotspot, the cache allocated by the key value of the service interface is deleted.
With reference to the fourth possible implementation manner of the first aspect, in a fifth possible implementation manner, the method further includes:
when the service interface is judged to be an effective hotspot, establishing a timer corresponding to the key value of the service interface;
and when the timer is overtime, judging that the service interface is converted into an invalid hotspot.
In a second aspect, an embodiment of the present invention provides an apparatus, including:
the reading module is used for acquiring a key value of a currently operated business interface and reading the quantity of concurrent requests pointing to the business interface, wherein the key value is used for identifying the business grade of the currently operated business interface;
the hot spot management module is used for detecting whether the service interface corresponding to the key value is a hot spot or not according to the quantity of the concurrent requests pointing to the service interface;
the first layer flow control module is used for intercepting a part of concurrent requests pointing to the service interface according to the hot spot passing rate corresponding to the service interface;
and the second layer flow control module is used for detecting whether to execute flow control on the service interface according to the hot spot passing rate corresponding to the service interface.
With reference to the second aspect, in a first possible implementation manner of the second aspect, the hotspot management module is specifically configured to detect whether the number of concurrent requests directed to the service interface reaches a preset threshold in unit time; and if so, determining that the service corresponding to the key value is a hot spot.
With reference to the second aspect, in a second possible implementation manner of the second aspect, the second layer flow control module is specifically configured to determine a flow control threshold of the service interface according to the hot spot passing rate corresponding to the service interface and the currently read random number; and detecting whether to execute flow control on the service interface according to the flow control threshold aiming at the intercepted concurrent request pointing to the service interface.
With reference to the second possible implementation manner of the second aspect, in a third possible implementation manner, the method further includes:
the system comprises a pass rate adjusting module, a time node setting module and a time node setting module, wherein the pass rate adjusting module is used for acquiring the effective duration of a service interface which is a hot spot and dividing the effective duration into at least 2 time nodes, and if the effective duration is exceeded, the service interface is invalid and is a non-hot spot; and determining the hot spot passing rate of the next time node according to the ratio of the passing number of the concurrent requests in the current time node to the flow control number.
According to the access amount control method and device provided by the embodiment of the invention, a part of concurrent requests pointing to the service interface is intercepted according to the hot spot passing rate corresponding to the service interface; and detecting whether to execute flow control on the service interface according to the hot spot passing rate corresponding to the service interface. Intercepting a large number of high-concurrency requests (namely, first-layer flow control) through the hot spot passing rate corresponding to the service interface, and continuing the second-layer flow control through the requests of the hot spot algorithm, so that the flow control of the high-concurrency service and the non-high-concurrency service is decoupled, and the condition that the flow control of the concurrency service influences the non-high-concurrency service is relieved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic diagram of a possible system architecture according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a method provided by an embodiment of the present invention;
FIG. 3 is a schematic flow chart of an embodiment of the present invention;
fig. 4 and 5 are schematic structural diagrams of the apparatus according to the embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the present invention will be described in further detail with reference to the accompanying drawings and specific embodiments. Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention. As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or coupled. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items. It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
The method flow in this embodiment may be specifically executed on a system as shown in fig. 1, where the system includes: a server and a user device. Wherein, the server is mainly used for: receiving a request sent by user equipment, such as: and the smart phone sends an access message to the website server and performs flow control processing on the received request under the condition of higher load. In this embodiment, the request includes: a request for triggering service execution, a message for accessing a certain page or logging in a website, or other "messages", "data", or "information" for the user equipment to send to the server for executing service operation, which are collectively referred to as "requests" in this embodiment.
The server disclosed in this embodiment may be specifically a server, a workstation, a super computer, or a server cluster system for data processing, which is composed of a plurality of servers. It should be noted that, in practical applications, the server and the background server may be generally integrated in the same server cluster, that is, the same server cluster simultaneously assumes the functions of the server and the background server, and is used to execute the process provided in this embodiment.
In practical applications, the request sent by the user equipment is mainly sent by the user through the input device of the user equipment such as: input user equipment such as a keyboard, a touch screen, a mouse and the like; the server can send operation interfaces such as a publishing webpage and a login interface to the user equipment so as to input the request through the operation interfaces.
The user equipment disclosed in this embodiment may be implemented as a single Device, or integrated into various media data playing devices, such as a set-top box, a Mobile phone, a Tablet Personal Computer (Tablet Personal Computer), a Laptop Computer (Laptop Computer), a multimedia player, a digital camera, a Personal Digital Assistant (PDA), a Mobile Internet Device (MID), or a Wearable Device (Wearable Device).
Wherein, the user equipment sends a request to a service interface running on the server, such as: the server is a server of an online shopping platform, and is configured to run and display a goods display interface of the platform to the user equipment, and the currently running service interface may include: the system comprises an interface for receiving a ordering operation request sent by user equipment, a search request sent by the user equipment, a request sent by the user equipment for participating in a promotion activity and the like.
In practical applications, a service interface currently running on a server may be carried by a process, and a process may include multiple threads, where multiple virtual machines may be established on the server, and a computing resource allocated by a virtual machine includes at least one thread. Specifically, the plurality of virtual machines may simultaneously undertake the receiving work of the request of one service interface, that is, massive requests (many requests pointing to the same service interface, which may be referred to as massive requests) sent by a plurality of user devices to the server are processed in parallel by the plurality of virtual machines corresponding to the key value of the service interface, where the key value is used to identify the service level of the currently running service interface. The service level under the service interface may be divided according to a specific service dimension, for example: a member dimension (e.g., a member ID), a commodity dimension (e.g., a commodity code).
An embodiment of the present invention provides a method for controlling an access amount, as shown in fig. 2, including:
s1, obtaining the key value of the current operation business interface, and reading the quantity of the concurrent requests pointing to the business interface.
The key value is used for identifying the service level of the currently operated service interface. And the virtual machine corresponding to the key value is used for processing the request pointing to the service interface. The number of requests currently assumed may be understood as the total number of requests assumed by all virtual machines corresponding to the key value. The flow control threshold value can be understood as the flow control threshold value of a single virtual machine. For example: jvm (Java Virtual Machine) can be adopted for decentralized caching, a plurality of Jvm caches manage the flow control of the whole service cluster together, and compared with the flow control mode of a distributed cache system, the Jvm decentralized caching flow control mode has the characteristics of high performance, quick response and small pressure on the service cluster. Since the flow control threshold of the individual station Jvm is 1, for example: in a distributed cluster deployment scenario in which the number of service clusters is extremely large and the number of allowed access requests is extremely small, the number of Jvm clusters is 100, and the flow control threshold of a single station Jvm is 1, so that the number of allowed concurrencies of the whole Jvm cluster reaches 100. Wherein Jvm cluster can be understood as a collection of virtual machines running on a server.
S2, detecting whether the service interface corresponding to the key value is a hot spot according to the quantity of the concurrent requests pointing to the service interface.
And if so, determining that the service interface is the hotspot. And when the service interface is judged to be the effective hotspot, establishing a timer corresponding to the key value of the service interface. And when the timer is overtime, judging that the service interface is converted into an invalid hotspot.
In this embodiment, when one service interface is used as a valid hotspot, a cache is allocated according to the key value of the service interface. When one service interface is converted from a valid hotspot to an invalid hotspot, the cache allocated by the key value of the service interface is deleted. In this embodiment, the cache may be pre-allocated to Jvm, and is used by Jvm to store a request directed to a service interface, where the request targeted by the flow control process in this embodiment is a request stored in the cache.
And S3, if yes, intercepting a part of the concurrent request pointing to the service interface according to the hot spot passing rate corresponding to the service interface.
If not, a common flow control scheme can be adopted to process the flow control of the service interface of the non-hot spot.
In this embodiment, the detecting, according to the number of the concurrent requests directed to the service interface, whether the service interface corresponding to the key value is a hotspot includes:
and detecting whether the quantity of the concurrent requests pointing to the service interface reaches a preset threshold in a unit time T (T configurable). And if so, determining that the service corresponding to the key value is a hot spot.
S4, detecting whether to execute flow control to the service interface according to the hot spot passing rate corresponding to the service interface.
In this embodiment, a large number of high concurrent requests (i.e. first-layer flow control) are intercepted by the hot spot passing rate corresponding to the service interface, and the request passing through the hot spot algorithm continues to the second-layer flow control, for example: and whether the number of the services currently executed is greater than or equal to a preset threshold value or not is judged, and if so, flow control is executed. The threshold value for flow control determination for the hot spot and the non-hot spot can be configured independently, that is, by dividing the hot spot, the flow control of the high concurrent service and the non-high concurrent service is decoupled, and the condition that the flow control of the concurrent service affects the non-high concurrent service is alleviated. And the limit that a single minimum flow control threshold value is 1 is broken through a random numerical value, so that Jvm clusters adopt smaller cluster allowable concurrent numbers in unit time, the cluster allowable concurrent numbers are not limited by controllable minimum strength of a single Jvm, and a more flexible flow control effect is realized.
According to the flow control method for the distributed system, the flow control effect of the distributed cluster is achieved through the Jvm technology, compared with the flow control mode of the distributed cache system, the flow control is performed through the Jvm cluster, the flow control process is executed through the device bearing the Jvm cluster, the parallel processing requests are processed in a centralized mode through the device bearing the Jvm cluster, the interaction process in the system is reduced, dependence on an interaction interface in a service system is reduced, the influence caused by the problems that the interface of the device is blocked or crashed is small, and the influence caused by non-high concurrent services in a service scene where the high concurrent services and the non-high concurrent services exist simultaneously is reduced.
In this embodiment, the detecting whether to perform flow control on the service interface according to the hotspot passing rate corresponding to the service interface includes:
and determining a flow control threshold value of the service interface according to the hot spot passing rate corresponding to the service interface and the currently read random number. And detecting whether to execute flow control on the service interface according to the flow control threshold aiming at the intercepted concurrent request pointing to the service interface.
In this embodiment, the flow control strategy mentioned in the present scheme may specifically adopt two modes: one is that the flow control threshold of each virtual machine corresponding to the key value is equal to 1, or the flow control threshold of each virtual machine corresponding to the key value is equal to a positive integer, such as: for positive integer configuration with a flow control threshold greater than or equal to 1 (i.e. service cluster processing capability > -Jvm cluster number), for example: the first mode may use a common response mode, that is, the request processing or the flow control is determined according to the comparison between the current service concurrency number of the single station Jvm and the flow control threshold. For example: and (3) setting the allocable flow control threshold value as 1, and judging Jvm whether the current accumulated service concurrency number reaches the flow control threshold value when the request is made: if the flow control threshold value is not reached, the request can be processed, meanwhile, the accumulated service concurrency number is increased, and the accumulated value is released after the service processing is finished (accumulated service concurrency number-operation). If the flow control threshold is reached, the request is flow controlled.
The other is that the flow control threshold of each virtual machine corresponding to the key value is greater than 0 and less than 1, for example: and configuration for any value of flow control ratio 0-1 (i.e. service cluster processing capability < Jvm cluster number).
For example: and determining the number of the intercepted business interfaces according to the number of the virtual machines corresponding to the key value and the flow control threshold value of each virtual machine corresponding to the key value.
And intercepting the requests pointing to the service interface according to the intercepted quantity.
For example: in a practical usage scenario, for Jvm cluster, the allowed request concurrency may be 50 or less, so a scheme is provided in which a single station Jvm can control the minimum strength to be less than 1, and the probability-based + sliding window mode double-layer process is adopted for processing. That is, the random value generated by the Java random function can be compared with the configurable flow control rate, for example: as shown in fig. 3, assuming that Jvm cluster receives a total of 100 requests, random values are generated by the Java random function for 100 requests respectively, the generated random values are greater than 0 and less than 1, wherein the random values generated by the employed Java random function are theoretically uniformly distributed between 0 and 1. If the configurable flow control rate is 0.8, the requests with random values between 0 and 0.2 can be passed through, and the requests with random values between 0.2 and 1 are intercepted, then theoretically 100 requests will be intercepted 80, the other 20 requests will pass through the first layer flow control, and the requests passing through the first layer flow control will be subjected to the second sliding window flow control: the maximum number of service concurrencies allowed in a unit time, for example: jvm cluster TPS (TransactionSperSecond, system throughput-is an index of network protocol layer, and refers to the number of successfully completed transactions in one second) capability is 10, Jvm cluster number is 100, then the single Jvm processing capability requirement is 0.1, and the practical application can be converted into the number of requests allowed by the single Jvm in unit time (converted into an integer by multiplying the unit time), such as: the number of requests allowed by a single station Jvm in 10s is required to be 1. Therefore, the flow control is further carried out on the requests which are not intercepted by the first layer under a large number of concurrent scenes.
Further, the method also comprises the following steps: when one service interface is used as a valid hotspot, a cache is allocated according to the key value of the service interface, and the cache is used for storing concurrent requests pointing to the service interface. When one service interface is converted from a valid hotspot to an invalid hotspot, the cache allocated by the key value of the service interface is deleted.
And when the service interface is judged to be an effective hotspot, establishing a timer corresponding to the key value of the service interface. And when the timer is overtime, judging that the service interface is converted into an invalid hotspot.
The hot spot passing rate in this embodiment may be dynamically calculated by a ratio of a traffic passing rate and a flow control rate in a unit time T (T configurable), and when the current T fails, the passing rate obtained in the current T may be used as the hot spot passing rate of the next unit time T to perform flow control, so that the hot spot passing rate is dynamically updated over time, for example, the method further includes:
the method comprises the steps of obtaining effective duration of a service interface which is a hot spot, and dividing the effective duration into at least 2 time nodes. And if the effective duration is exceeded, the service interface fails to be a non-hotspot. For example: the effective time of the timer is 10 minutes, 20 time nodes are averagely divided, and each time node is 30 seconds.
And determining the hot spot passing rate of the next time node according to the ratio of the passing number of the request in the current time node to the flow control number.
An embodiment of the present invention further provides a device for controlling an access amount as shown in fig. 4, where the device includes:
the reading module is used for acquiring a key value of a currently operated business interface and reading the quantity of concurrent requests pointing to the business interface, wherein the key value is used for identifying the business grade of the currently operated business interface;
the hot spot management module is used for detecting whether the service interface corresponding to the key value is a hot spot or not according to the quantity of the concurrent requests pointing to the service interface;
the first layer flow control module is used for intercepting a part of concurrent requests pointing to the service interface according to the hot spot passing rate corresponding to the service interface;
and the second layer flow control module is used for detecting whether to execute flow control on the service interface according to the hot spot passing rate corresponding to the service interface.
The hot spot management module is specifically configured to detect, in a unit time, whether the number of concurrent requests directed to the service interface reaches a preset threshold; and if so, determining that the service corresponding to the key value is a hot spot.
The second layer flow control module is specifically configured to determine a flow control threshold of the service interface according to the hot spot passing rate corresponding to the service interface and the currently read random number; and detecting whether to execute flow control on the service interface according to the flow control threshold aiming at the intercepted concurrent request pointing to the service interface.
Further, as shown in fig. 5, the method further includes:
the system comprises a pass rate adjusting module, a time node setting module and a time node setting module, wherein the pass rate adjusting module is used for acquiring the effective duration of a service interface which is a hot spot and dividing the effective duration into at least 2 time nodes, and if the effective duration is exceeded, the service interface is invalid and is a non-hot spot; and determining the hot spot passing rate of the next time node according to the ratio of the passing number of the concurrent requests in the current time node to the flow control number.
When one service interface is used as an effective hotspot, a cache is distributed according to the key value of the service interface, and the cache is used for storing a concurrent request pointing to the service interface; when one service interface is converted from a valid hotspot to an invalid hotspot, the cache allocated by the key value of the service interface is deleted.
Specifically, when the service interface is determined to be an effective hotspot, a timer corresponding to a key value of the service interface is established; and when the timer is overtime, judging that the service interface is converted into an invalid hotspot.
The access control device provided by the embodiment of the invention intercepts a part of concurrent requests pointing to the service interface according to the hot spot passing rate corresponding to the service interface; and detecting whether to execute flow control on the service interface according to the hot spot passing rate corresponding to the service interface. Intercepting a large number of high-concurrency requests (namely, first-layer flow control) through the hot spot passing rate corresponding to the service interface, and continuing the second-layer flow control through the requests of the hot spot algorithm, so that the flow control of the high-concurrency service and the non-high-concurrency service is decoupled, and the condition that the flow control of the concurrency service influences the non-high-concurrency service is relieved.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus embodiment, since it is substantially similar to the method embodiment, it is relatively simple to describe, and reference may be made to some descriptions of the method embodiment for relevant points. The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A method for controlling access amount, comprising:
obtaining a key value of a currently operated business interface, and reading the quantity of concurrent requests pointing to the business interface, wherein the key value is used for identifying the business level of the currently operated business interface;
detecting whether the service interface corresponding to the key value is a hot spot or not according to the quantity of the concurrent requests pointing to the service interface;
if so, intercepting a part of the concurrent request pointing to the service interface according to the hot spot passing rate corresponding to the service interface;
and detecting whether to execute flow control on the service interface according to the hotspot passing rate corresponding to the service interface.
2. The method of claim 1, wherein the detecting whether the service interface corresponding to the key value is a hotspot according to the number of the concurrent requests directed to the service interface comprises:
detecting the quantity of concurrent requests pointing to the service interface in unit time, and whether the quantity reaches a preset threshold;
and if so, determining that the service corresponding to the key value is a hot spot.
3. The method of claim 1, wherein the detecting whether to perform flow control on the service interface according to the hot spot passing rate corresponding to the service interface comprises:
determining a flow control threshold value of the service interface according to the hot spot passing rate corresponding to the service interface and the currently read random number;
and detecting whether to execute flow control on the service interface according to the flow control threshold aiming at the intercepted concurrent request pointing to the service interface.
4. The method of claim 2, further comprising:
acquiring the effective duration of a service interface which is a hotspot, and dividing the effective duration into at least 2 time nodes, wherein if the effective duration is exceeded, the service interface fails to be a non-hotspot;
and determining the hot spot passing rate of the next time node according to the ratio of the passing number and the flow control number of the concurrent requests in the current time node.
5. The method of claim 4, further comprising:
when one service interface is used as an effective hotspot, allocating a cache according to a key value of the service interface, wherein the cache is used for storing a concurrent request pointing to the service interface;
when one service interface is converted from a valid hotspot to an invalid hotspot, the cache allocated by the key value of the service interface is deleted.
6. The method of claim 5, further comprising:
when the service interface is judged to be an effective hotspot, establishing a timer corresponding to the key value of the service interface;
and when the timer is overtime, judging that the service interface is converted into an invalid hotspot.
7. An access amount control device, comprising:
the reading module is used for acquiring a key value of a currently operated business interface and reading the quantity of concurrent requests pointing to the business interface, wherein the key value is used for identifying the business grade of the currently operated business interface;
the hot spot management module is used for detecting whether the service interface corresponding to the key value is a hot spot or not according to the quantity of the concurrent requests pointing to the service interface;
the first layer flow control module is used for intercepting a part of concurrent requests pointing to the service interface according to the hot spot passing rate corresponding to the service interface;
and the second layer flow control module is used for detecting whether to execute flow control on the service interface according to the hot spot passing rate corresponding to the service interface.
8. The apparatus according to claim 7, wherein the hotspot management module is specifically configured to detect whether a number of concurrent requests directed to the service interface reaches a preset threshold in a unit time; and if so, determining that the service corresponding to the key value is a hot spot.
9. The apparatus according to claim 7, wherein the second-layer flow control module is specifically configured to determine a flow control threshold of the service interface according to the hot spot passing rate corresponding to the service interface and a currently read random number; and detecting whether to execute flow control on the service interface according to the flow control threshold aiming at the intercepted concurrent request pointing to the service interface.
10. The apparatus of claim 8, further comprising:
the system comprises a pass rate adjusting module, a time node setting module and a time node setting module, wherein the pass rate adjusting module is used for acquiring the effective duration of a service interface which is a hot spot and dividing the effective duration into at least 2 time nodes, and if the effective duration is exceeded, the service interface is invalid and is a non-hot spot; and determining the hot spot passing rate of the next time node according to the ratio of the passing number of the concurrent requests in the current time node to the flow control number.
CN201710099259.XA 2017-02-23 2017-02-23 Access amount control method and device Active CN108512768B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710099259.XA CN108512768B (en) 2017-02-23 2017-02-23 Access amount control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710099259.XA CN108512768B (en) 2017-02-23 2017-02-23 Access amount control method and device

Publications (2)

Publication Number Publication Date
CN108512768A CN108512768A (en) 2018-09-07
CN108512768B true CN108512768B (en) 2021-12-10

Family

ID=63373566

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710099259.XA Active CN108512768B (en) 2017-02-23 2017-02-23 Access amount control method and device

Country Status (1)

Country Link
CN (1) CN108512768B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110336757A (en) * 2019-05-27 2019-10-15 平安科技(深圳)有限公司 Connection pool concurrency control method, device and computer readable storage medium
CN110474850A (en) * 2019-08-23 2019-11-19 苏宁云计算有限公司 Flow control methods, device, computer equipment and the storage medium of business interface
CN112749174B (en) * 2019-10-30 2024-05-10 中国移动通信集团安徽有限公司 High concurrency processing method, device, processing equipment and computer storage medium
CN114710447B (en) * 2020-12-16 2024-05-03 百寻信息科技(上海)有限公司 Balanced advertisement flow control method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002197327A (en) * 2000-12-27 2002-07-12 Olympus Optical Co Ltd Individual order management system
EP1845468A1 (en) * 2006-04-12 2007-10-17 Deutsche Telekom AG Method, computer network system and gate for identifying and controlling unsolicited traffic
CN101123587A (en) * 2007-09-13 2008-02-13 杭州华三通信技术有限公司 Traffic control method and device for switch service flow
CN103546388A (en) * 2012-07-10 2014-01-29 阿里巴巴集团控股有限公司 Flow control method and flow control device
CN106354719A (en) * 2015-07-13 2017-01-25 阿里巴巴集团控股有限公司 Method for providing POI service , method and apparatus for POI data processing

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002197327A (en) * 2000-12-27 2002-07-12 Olympus Optical Co Ltd Individual order management system
EP1845468A1 (en) * 2006-04-12 2007-10-17 Deutsche Telekom AG Method, computer network system and gate for identifying and controlling unsolicited traffic
CN101123587A (en) * 2007-09-13 2008-02-13 杭州华三通信技术有限公司 Traffic control method and device for switch service flow
CN103546388A (en) * 2012-07-10 2014-01-29 阿里巴巴集团控股有限公司 Flow control method and flow control device
CN106354719A (en) * 2015-07-13 2017-01-25 阿里巴巴集团控股有限公司 Method for providing POI service , method and apparatus for POI data processing

Also Published As

Publication number Publication date
CN108512768A (en) 2018-09-07

Similar Documents

Publication Publication Date Title
CN108471385B (en) Flow control method and device for distributed system
US11146502B2 (en) Method and apparatus for allocating resource
CN108512768B (en) Access amount control method and device
US11057490B2 (en) Systems and methods for utilizing unused network capacity for prefetch requests
CN100527090C (en) Method for dynamically distributing computer resource
US9858124B1 (en) Dynamic management of data stream processing
US9292448B2 (en) Dynamic sizing of memory caches
US20170160965A1 (en) Optimization of in-memory data grid placement
JP5664098B2 (en) Composite event distribution apparatus, composite event distribution method, and composite event distribution program
US10091126B2 (en) Cloud system, control method thereof, management server and control method thereof
CN107070709B (en) NFV (network function virtualization) implementation method based on bottom NUMA (non uniform memory Access) perception
CN101753380A (en) Monitoring memory consumption
CN106899643A (en) A kind of user journal storage method and equipment
CN103095824A (en) File uploading control method and system
CN106802772A (en) The method of data record, device and solid state hard disc
CN112764948A (en) Data transmission method, data transmission device, computer device, and storage medium
WO2020094064A1 (en) Performance optimization method, device, apparatus, and computer readable storage medium
CN104202349B (en) The method of scheduling distributed buffer resources, Apparatus and system
US9380126B2 (en) Data collection and distribution management
CN105589919A (en) Method and device for processing webpage resource
US10963311B2 (en) Techniques and architectures for protection of efficiently allocated under-utilized resources
CN116955271A (en) Method and device for storing data copy, electronic equipment and storage medium
CN109669882B (en) Bandwidth-aware dynamic cache replacement method, apparatus, system, and medium
CN110719306B (en) Network request limiting method, computer equipment and storage medium
CN107273188B (en) Virtual machine Central Processing Unit (CPU) binding method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 210000, 1-5 story, Jinshan building, 8 Shanxi Road, Nanjing, Jiangsu.

Applicant after: SUNING.COM Co.,Ltd.

Address before: 210042 Suning Headquarters, No. 1 Suning Avenue, Xuanwu District, Nanjing City, Jiangsu Province

Applicant before: SUNING COMMERCE GROUP Co.,Ltd.

GR01 Patent grant
GR01 Patent grant