CN106533961A - Flow control method and device - Google Patents
Flow control method and device Download PDFInfo
- Publication number
- CN106533961A CN106533961A CN201611264947.9A CN201611264947A CN106533961A CN 106533961 A CN106533961 A CN 106533961A CN 201611264947 A CN201611264947 A CN 201611264947A CN 106533961 A CN106533961 A CN 106533961A
- Authority
- CN
- China
- Prior art keywords
- flow cell
- request
- acquisition
- user
- flow
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/12—Avoiding congestion; Recovering from congestion
- H04L47/125—Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/50—Queue scheduling
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The embodiment of the invention discloses a flow control method, applied to a server. The method comprises the following steps: receiving an execution request triggered by a user, wherein the execution request carries an identifier of the user; acquiring a flow pool corresponding to the user according to the identifier of the user, wherein the flow pool comprises an execution queue and a waiting queue; when the execution request is in the execution queue, processing the execution request; checking whether the execution queue in the acquired flow pool is full; and when the execution queue in the acquired flow pool is full, adding the execution request to the waiting queue in the acquired flow pool. According to the flow control method provided by the embodiment of the invention, independent flow pools corresponding to different application systems are respectively set for the same, so the flow of the different application systems to access platform systems can be controlled directionally, which is conducive to balancing cluster load.
Description
Technical field
The present invention relates to field of computer technology, more particularly to a kind of flow control methods and device.
Background technology
Flow, refers to the number of requests that user at a time accesses certain system by network.And to flow-control master
Refer to that working business angle is limited and counted to the request maximum quantity that can access the system.The main body of flow-control is flat
Platform class system, and the user for accessing is often referred to the other application system of access platform system, such as file management platform is predominantly each
The file for planting application system provides the operations such as storage, inquiry, modification and deletion.Now, then need according to different application systems
Access-hours, portfolio, priority etc. enters in the maximum stream flow that some moment accesses flat file management platform to application system
Row is limited, and can real-time statistics flow information.
Existing flow control methods, are usually limited while accessing system using the mode such as connection pool of server middleware
The number of requests of system.For example, for the plateform system being deployed in the way of web application on WebSphere servers,
A certain degree of flow-control management can be reached by the thread connection pool of WebSphere servers.The characteristics of its function is
In JVM (Java Virtual Machine, virtual machine) level by controlling number of request of the number of threads to access application
Amount is managed, and when meeting or exceeding number of request restriction, just refuses follow-up access request.Because the service of its flow-control is right
It is as being actually WebSphere servers itself rather than plateform system, unrelated with the business of access platform system, it is impossible to according to connecing
The role and identity for entering to ask user carries out more flexible control and statistics, i.e., cannot need with regard to the business inside different application systems
Ask.Therefore existing flow control methods tend not to meet the flow-control of plateform system
Demand.
The content of the invention
In view of this, the invention provides a kind of flow control methods and device, cannot be just in can solve the problem that prior art
Business demand inside different application systems targetedly carries out the problem of flow-control.
Flow control methods provided in an embodiment of the present invention, are applied to server;Methods described, including:
What receive user was triggered performs request, described to perform the mark that request carries the user;
According to the mark of the user, flow cell corresponding with the user is obtained;
Wherein, the flow cell includes performing queue and waiting list, when the execution request is in the execution queue,
Process this and perform request;
Check whether the execution queue in the flow cell for obtaining is full;
When the execution queue in the flow cell of the acquisition is expired, the flow that request adds the acquisition is performed by described
Waiting list in pond.
Optionally, the mark according to the user, obtains flow cell corresponding with the user, specifically includes:
According to the mark of the user, search whether there is flow cell corresponding with the user;
If it is, directly obtaining flow cell corresponding with the user;
If it is not, then according to the flow restriction being pre-configured with, being the corresponding flow cell of the pending service creation.
Optionally, the waiting list by the flow cell for performing the request addition acquisition, specifically includes:
Check whether the waiting list in the flow cell of the acquisition is full;
When the waiting list in the flow cell of the acquisition less than when, perform the flow that request adds the acquisition by described
Waiting list in pond;
When the waiting list in the flow cell of the acquisition is expired, described in rejection, request is performed.
Optionally, the waiting list by the flow cell for performing the request addition acquisition, also includes afterwards:
Check the team's head for performing waiting list in the flow cell whether request is the acquisition;
When the execution request is team's head of waiting list in the flow cell of the acquisition, the flow of the acquisition is checked
Whether the execution queue in pond is full;
When the execution queue in the flow cell of the acquisition less than when, perform the flow that request adds the acquisition by described
Execution queue in pond.
Optionally, also include:
Traffic statistics request is received, the traffic statistics request carries at least one mark to be measured;
It is determined that with the corresponding flow cell of the mark to be measured, obtain flow cell to be measured;
The team of waiting list in the queue length and the flow cell to be measured of queue is performed in obtaining the flow cell to be measured
Row length.
Volume control device provided in an embodiment of the present invention, is applied to server;Described device, including:Receiver module, obtain
Delivery block, inspection module and processing module;
The receiver module, for the request that performs of receive user triggering, described execution asks to carry the user's
Mark;
The acquisition module, for the mark according to the user, obtains flow cell corresponding with the user;
Wherein, the flow cell includes performing queue and waiting list, when the execution request is in the execution queue,
Process this and perform request;
The inspection module, for checking whether the execution queue in the flow cell for obtaining is full;
When described, the processing module, for checking that module check is full to the execution queue in the flow cell of the acquisition
When, by the waiting list in the flow cell for performing the request addition acquisition.
Optionally, the acquisition module, specifically includes:Search submodule, acquisition submodule and create submodule;
The lookup submodule, for the mark according to the user, searches whether there is stream corresponding with the user
Amount pond;
The acquisition submodule, for when it is described lookup submodule find flow cell corresponding with the user when, directly
Obtain to obtain flow cell corresponding with the user;
The establishment submodule, for not finding flow cell corresponding with the user when the lookup submodule
When, according to the flow restriction being pre-configured with, it is the corresponding flow cell of the pending service creation.
Optionally, the processing module, specifically includes:Check submodule and process submodule;
The inspection submodule, for checking whether the waiting list in the flow cell of the acquisition is full;
The process submodule, for checking the waiting list in the flow cell of the acquisition when the inspection submodule
Less than when, perform described request and add the waiting list in the flow cell of the acquisition;It is additionally operable to when the inspection submodule
Check waiting list in the flow cell of the acquisition completely when, perform request described in rejection.
Optionally,
The inspection module, is additionally operable to check and described performs waiting list in the flow cell whether request is the acquisition
Team's head;When being additionally operable to team's head of waiting list in the flow cell that the execution request is the acquisition is checked, check described
Whether the execution queue in the flow cell of acquisition is full;
The processing module, is additionally operable to check module check to the execution queue in the flow cell of the acquisition not when described
Man Shi, by the execution queue in the flow cell for performing the request addition acquisition.
Optionally, also include:Determining module and statistical module;
The receiver module, is additionally operable to receive traffic statistics request, and the traffic statistics request carries at least one and treats
Mark is known;
The determining module, for determining and the corresponding flow cell of the mark to be measured, obtains flow cell to be measured;
The statistical module, perform the queue length of queue and described treat measurement of discharge for is obtained in the flow cell to be measured
The queue length of waiting list in pond.
Compared with prior art, the present invention at least has advantages below:
Flow control methods provided in an embodiment of the present invention, after the execution request for receiving application system triggering, according to
The mark of the application system carried in performing request, obtains flow cell corresponding with user.Then, check the flow cell for obtaining
In execution queue it is whether full.When the target performs queue to expire, execution request is added in the flow cell of acquisition
Waiting list in.Only obtain flow cell in execution queue less than when, the execute instruction is added into the execution team
In row, and perform application system triggering perform request.Flow control methods provided in an embodiment of the present invention, are different answering
Its corresponding independent flow cell is respectively provided with system, can targetedly to different application systems access platform class system
The flow of system is controlled, and is conducive to cluster load balance.
Description of the drawings
In order to be illustrated more clearly that the embodiment of the present application or technical scheme of the prior art, below will be to embodiment or existing
Accompanying drawing to be used needed for having technology description is briefly described, it should be apparent that, drawings in the following description are only this
Some embodiments described in application, for those of ordinary skill in the art, on the premise of not paying creative work,
Can be with according to these other accompanying drawings of accompanying drawings acquisition.
The schematic flow sheet of the flow control methods embodiment that Fig. 1 is provided for the present invention;
Fig. 2 is that between application system and flow cell, corresponding relation shows in flow control methods provided in an embodiment of the present invention
It is intended to;
The structural representation of the volume control device embodiment that Fig. 3 is provided for the present invention.
Specific embodiment
In order that those skilled in the art more fully understand the present invention program, below in conjunction with the embodiment of the present invention
Accompanying drawing, is clearly and completely described to the technical scheme in the embodiment of the present invention, it is clear that described embodiment is only this
Invent a part of embodiment, rather than the embodiment of whole.Based on the embodiment in the present invention, those of ordinary skill in the art exist
The every other embodiment obtained under the premise of not making creative work, belongs to the scope of protection of the invention.
In order to make it easy to understand, below to the present embodiments relate to technical term illustrate.
Flow:User at a time accesses the quantity of the request of certain system by network.
Flow-control:Finger system realized by certain technology, accesses the number of requests of the system for limiting certain moment
Function, in general emphasis need pay close attention to flow rate upper limit setting.
Application system:The other systems of enterprises are generally referred to actually in the user conducted interviews to plateform system,
The such as system such as archives class, financial category, operational control class.
Plateform system:Refer to the system that enterprises provide certain service for other application system, such as file management, single-point is stepped on
Record etc., is the main body of flow control methods provided in an embodiment of the present invention.
Distributed Application coordination service device:It is mainly used in solving the highly reliable coordination problem of large-scale distributed system, typically
It is required that more than three server groups are run into the mode of cluster, the application scenarios that usually distributed system is provided include unifying life
Name server, load balancing, distributed lock, configuration management, fault restoration.Common at present can be used for Distributed Application coordination
Product have ZooKeeper and Redis etc..Wherein being most widely used with ZooKeeper, while the product is also Hadoop
One of significant components of big data ecological environment.
In enterprises, various application systems are generally there are, these application systems correspond to different processing business, person in servitude respectively
Belong to different departments.Functionally often there is general character, the such as storage and management of file and single-point at some in these application systems
Login feature etc..In order to avoid the cost of the repeated construction, reduction exploitation and O&M of different application systems, Jing often will be with general character
Function propose to give the process of common platform system, other application system is by interacting to realize with altogether with plateform system
The function of property.
However, access platform systematic difference type is varied, respective demand is also not quite similar.For example, A applications can
Can be more frequent in the service request of a certain period, need plateform system to provide more Service Sources, and B was applied at the moment
Resources requirement is not high.Accordingly, it would be desirable to the access flow to A applications and B applications not in the same time is coordinated.Again for example, A should
Request is at a time required for compared with multiple resource with C applications, but the priority of A applications is higher.Therefore plateform system is at this
Moment should the flow of limited guarantee A application support.In view of more than, different demand scenes, has in plateform system disposal ability
In the case of limit, plateform system should have the ability to be controlled the flow for accessing according to the situation of application system, reach optimization
The purpose of the disposal ability of plateform system.
Existing HttpClient connection pools, are a kind of connection control technologies based on transport layer Transmission Control Protocol, and which is substantially former
Manage and be:Multiple connection pools are set up according to the mapping of network route, each pond includes pending, available, leased etc. three
Individual connection queue.After request is accessed, connection pool management device will ask distribution to corresponding connection according to the route mapping of request
Pond.If having available connection in the available queues in connection pool, connection is returned to and is asked and is continued executing with;If
Without available connection in available queues, then request is injected towards after pending queues wait has available connection and performs again.When
After request is finished, whether the type according to connection is reuse, can be by Connection Release to available or leased teams
Row.HttpClient connection pools are relatively common Http connection management technologies, are more focused on the angle from underlying protocol
Management connection.
Additionally, existing WebSphere servers provide the function of the number of threads that control JVM is created, can be used for
Control accesses maximum concurrent user's quantity of WebSphere servers, it is also possible to play a part of certain control flow.From skill
Art angle sees that, from unlike HttpClient connection pools, WebSphere is realized using the mode of control JVM thread quantity
Management to maximum number of concurrent.
It is understood that the object that above two prior art is directed to is single node server rank rather than cluster level
Not, it is impossible to accomplish to carry out overall control to the flow of whole cluster.It is basic in view of current platform class systematic difference environment
Be cluster environment, if carrying out flow system flow control using above two prior art, can only by those skilled in the art according to
The situation of cluster calculates the connection quantity of each node in simultaneously static configuration cluster, is so unable to the control cluster of dynamic flexible
Overall traffic conditions, are also unfavorable for cluster load balance.Also, prior art more emphasize it is unrelated with accessing user, for connecing
The information of access customer is not relevant for, it is impossible to enough flow to be managed from the angle of user's level.
For this purpose, a kind of flow control methods and device is embodiments provided, in application system access platform system
Afterwards, by plateform system according to the flow restriction being pre-configured with, it is that application system creates corresponding independent flow cell, in flow cell
Comprising execution queue and waiting list, and (allowed according to the corresponding execution queue length restriction of different application systems configuration
Largest request number).After application system sends request to plateform system, plateform system first checks for corresponding flow cell institute
Including execution queue in it is whether full, perform request if this is responded less than if;Waiting list is entered if full, wait is held
OK.In queue is performed, there is request to be finished after exit, then the request in waiting list is added into execution queue in order
In perform one by one.If waiting list is full, what plateform system directly refused application system performs request.Matched somebody with somebody by modification in advance
The flow restriction put, it becomes possible to the carrying out of its flow dynamics is limited for different application systems.So, additionally it is possible to be directed to
The flow to different application systems access platform class system of property is controlled.
It is based on above-mentioned thought, understandable for enabling the above objects, features and advantages of the present invention to become apparent from, with reference to
Accompanying drawing is described in detail to the specific embodiment of the present invention.
Embodiment of the method:
The schematic flow sheet of the flow control methods embodiment provided for the present invention referring to Fig. 1, the figure.
Firstly the need of explanation, flow control methods provided in an embodiment of the present invention are applied to server, the server
For controlling the data interaction between above-mentioned plateform system and application system.
The flow control methods that the present embodiment is provided, including:
S101:What receive user was triggered performs request, described to perform the mark that request carries the user.
It is understood that for plateform system, the user should for other outsides that can access the plateform system
With system, the execution request is the request sent to plateform system of application system triggering.For example, to file management platform system
For system, user is the other application system for having access to this document management platform system and being operated to wherein file, is held
Row request is the request related to file management of the application system triggering.
When being embodied as, can be when the execution request be received, first according to the ID carried in execution request
To verify the authority of user, determine whether that the user accesses, respond this and perform request.If user is not over checking,
Then directly refuse described to perform request.If user is performed subsequent step, is judged whether more than to the user's by checking
Flow restriction.
S102:According to the mark of the user, flow cell corresponding with the user is obtained.
Wherein, the flow cell includes performing queue and waiting list, when the execution request is in the execution queue,
Process this and perform request.
Referring to Fig. 2, the one-to-one relationship of application system and flow cell is the figure shows.By different flow cells to every
The flow of the application system (i.e. user) of individual access is limited, it becomes possible to targetedly to different application systems access platform
The flow of class system is controlled.
Explanation is needed exist for, the queue length for performing queue is that the maximum of the application system that plateform system is allowed please
Quantity is sought, the execution request more than the queue length for performing queue wouldn't then be processed or directly be refused.
It is understood that when the execution request that the user sends is located at the execution team that corresponding flow cell includes
The request that performs of the user when in row, is then responded, user can just complete the various functions of plateform system offer, be finished
Afterwards the execution request is exited from execution queue.When the execution request that the user sends is located at corresponding flow cell bag
When in the waiting list for including, then during user need to wait until to perform queue, the appearance free time is the response that can just obtain plateform system.
In the present embodiment preferred embodiment, step S102 is specifically included:According to the mark of the user, search
With the presence or absence of flow cell corresponding with the user;If it is, directly obtaining flow cell corresponding with the user;If
It is no, then according to the flow restriction being pre-configured with, it is the corresponding flow cell of the pending service creation.
Explanation is needed exist for, when being embodied as, the flow restriction being pre-configured with can be write in allocation list.For use
When family creates flow cell, directly according to obtaining the execution team that the flow restriction that is pre-configured with is which creates corresponding length in allocation list
Row and waiting list.It is understood that those skilled in the art can specifically set the user institute right according to practical situation
The flow restriction answered, to realize targetedly being controlled flow, specific maximum stream flow number is no longer repeated here one by one.
Additionally, those skilled in the art can be with according to practical situation, the flow restriction in adjustment allocation list, dynamic flexible
The flow to different application systems limit, be conducive to the load balancing of cluster.
S103:Check whether the execution queue in the flow cell for obtaining is full.
S104:When the execution queue in the flow cell of the acquisition is expired, the request addition acquisition is performed by described
Flow cell in waiting list.
It is understood that when the execution queue is expired, then illustrating that plateform system has reached the maximum to the user and asked
Process quantity is sought, the flow of the user need to be limited.At this moment, the execution request is added to into waiting list, when performing
In queue it is available free after, then execution request added perform queue, so that plateform system responds this performs request.
In some possible implementations of the present embodiment, step S104 is specifically included:Check the flow of the acquisition
Whether the waiting list in pond is full;When the waiting list in the flow cell of the acquisition less than when, by it is described perform request plus
Enter the waiting list in the flow cell of the acquisition;When the waiting list in the flow cell of the acquisition is expired, described in rejection
Perform request.
It is understood that for the overlong time for avoiding the waiting for server of user from responding, a wait team can be arranged
Row.When the waiting list is expired, refuse this and perform request.Those skilled in the art can be according to practical situation, concrete setting etc.
The length of queue is treated, is repeated no more here.
In the present embodiment preferred embodiment, the flow control methods also include after step s 104:Check
The team's head for performing waiting list in the flow cell whether request is the acquisition;When described execution asks to be the acquisition
In flow cell during team's head of waiting list, check whether the execution queue in the flow cell of the acquisition is full;When the acquisition
Flow cell in execution queue less than when, perform described request and add the execution queue in the flow cell of the acquisition.
As an example, when being embodied as, can be by the observer that provided according to Distributed Application coordination service device
Mechanism, to the execution queue registration observer in the flow cell for obtaining, and waits the execution queue to send notice, to check that this is held
Whether row queue is full.
Receive the execution queue send notify when, that is, check execution queue in the flow cell of the acquisition not
It is full.Now, you can by the execution queue in the flow cell for performing the request addition acquisition.
In the present embodiment preferred embodiment, the flow control methods, also including traffic statistics step, specifically such as
Under:Traffic statistics request is received, the traffic statistics request carries at least one mark to be measured;It is determined that with the mark to be measured
Corresponding flow cell, obtains flow cell to be measured;Obtain
The queue length of waiting list in flow cell.
In one example, if needing statistics application system A and the flow of application system B to be counted.First, receive and carry
There is the traffic statistics request of the mark (mark i.e. to be measured) of application system A and application system B.Then, ask according to traffic statistics
The mark of carrying obtains flow cell to be measured, i.e. corresponding flow cell A of application system A and corresponding flow cell B of application system B.Again
The flow information of flow cell A and flow cell B is counted successively.By taking flow cell A as an example, specifically, first judge the execution team of flow cell A
Whether row A is empty, if not empty, then counts the quantity (performing the queue length of queue A) asked in performing queue A;Sentence again
Whether the waiting list A of disconnected flow cell A is empty, if not empty, then counts quantity (the i.e. waiting list A asked in waiting list A
Queue length).It is understood that can also first count waiting list A counts execution queue A again, the present invention is not to this
Do any restriction.The flow statistical method of flow cell B is similar to, and repeats no more here.
Preferably, the length for performing queue or waiting list can also be selectively counted, is no longer repeated one by one here.
Also, it should be noted that in the specific implementation, the flow control methods that the present embodiment is provided, can be with distributed system
Form be deployed in Distributed Application coordination service device, with very good process performance, fully can ensure under high capacity
Systematic function.Also, take full advantage of Distributed Application coordination service device it is high fault-tolerant the characteristics of, ensured by server cluster
Flow control system it is complete.Even if by one or multiple servers hostdown, as long as ensureing to meet cluster minimum service
Device quantity main frame requires (general to require no less than three), it becomes possible to ensure the normal operation of flow control system.
By taking ZooKeeper as an example, those skilled in the art can be realized using the znode file structures of ZooKeeper
Flow control methods and traffic statistics step described in above-mentioned steps.
ZooKeeper server clusters mainly include leader nodes (main controlled node), follower nodes (from node)
With observer nodes (observer's node), three be all responsible for process cluster read-write requests.Difference is:Leader nodes are used
In the control of server cluster, typically voluntarily elected by follower nodes, if after leader node failures, as long as there is foot
The follower nodes (no less than three) of enough amounts, it is possible to elect new leader nodes immediately;Follower nodes
For electing leader nodes and participating in the ballot work of cluster write request;Observer nodes are not involved in ballot, only receive
Information after ballot, is mainly used in the extension of read request.
The flow control methods that the present embodiment is provided, after the execution request for receiving application system triggering, according to execution
The mark of the application system carried in request, obtains flow cell corresponding with user.Then, in checking the flow cell for obtaining
Queue is performed whether full.When the target perform queue completely when, by execution request be added in the flow cell of acquisition etc.
In treating queue.Only obtain flow cell in execution queue less than when, just the execute instruction is added in the execution queue,
And perform application system triggering perform request.The flow control methods that the present embodiment is provided, are different application systems point
Its corresponding independent flow cell is not set, flow that can targetedly to different application systems access platform class system
It is controlled, is conducive to cluster load balance.
Based on the flow control methods that above-described embodiment is provided, the embodiment of the present invention additionally provides a kind of flow-control dress
Put.
Device embodiment:
The structural representation of the volume control device embodiment provided for the present invention referring to Fig. 3, the figure.
Firstly the need of explanation, volume control device provided in an embodiment of the present invention is applied to server, the server
For controlling the data interaction between above-mentioned plateform system and application system.
The volume control device that the present embodiment is provided, including:Receiver module 100, acquisition module 200, inspection 300 and of module
Processing module 400;
The receiver module 100, for the request that performs of receive user triggering, the execution request carries the user
Mark.
The acquisition module 200, for the mark according to the user, obtains flow cell corresponding with the user.
Wherein, the flow cell includes performing queue and waiting list, when the execution request is in the execution queue,
Process this and perform request.
In the present embodiment preferred embodiment, the acquisition module 200 is specifically included:Search submodule, obtain son
Module and establishment submodule (being not shown);
The lookup submodule, for the mark according to the user, searches whether there is stream corresponding with the user
Amount pond.
The acquisition submodule, for when it is described lookup submodule find flow cell corresponding with the user when, directly
Obtain to obtain flow cell corresponding with the user.
The establishment submodule, for not finding flow cell corresponding with the user when the lookup submodule
When, according to the flow restriction being pre-configured with, it is the corresponding flow cell of the pending service creation.
The inspection module 300, for checking whether the execution queue in the flow cell for obtaining is full.
The processing module 400, for checking the execution team in the flow cell of the acquisition when the inspection module 300
When row are expired, by the waiting list in the flow cell for performing the request addition acquisition.
In some possible implementations of the present embodiment, the processing module 400 is specifically included:Check submodule
With process submodule (being not shown);
The inspection submodule, for checking whether the waiting list in the flow cell of the acquisition is full.
The process submodule, for checking the waiting list in the flow cell of the acquisition when the inspection submodule
Less than when, perform described request and add the waiting list in the flow cell of the acquisition;It is additionally operable to when the inspection submodule
Check waiting list in the flow cell of the acquisition completely when, perform request described in rejection.
In some possible implementations of the present embodiment, the inspection module 300 is additionally operable to check that the execution please
Team's head of waiting list in the no flow cell for the acquisition of Seeking Truth;It is the acquisition to be additionally operable to when the execution request is checked
Flow cell in waiting list team's head when, check whether the execution queue in the flow cell of the acquisition full;
The processing module 400, is additionally operable to check the execution in the flow cell of the acquisition when the inspection module 300
Queue less than when, perform described request and add the execution queue in the flow cell of the acquisition.
In the present embodiment preferred embodiment, the amount control device also includes:Determining module and statistical module
(being not shown);
The receiver module, is additionally operable to receive traffic statistics request, and the traffic statistics request carries at least one and treats
Mark is known.
The determining module, for determining and the corresponding flow cell of the mark to be measured, obtains flow cell to be measured.
The statistical module, perform the queue length of queue and described treat measurement of discharge for is obtained in the flow cell to be measured
The queue length of waiting list in pond.
The volume control device that the present embodiment is provided, after the execution request that receiver module receives application system triggering,
Acquisition module obtains flow cell corresponding with user according to the mark for performing the application system carried in request.Then, check
Whether the execution queue in the flow cell that module check is obtained is full.When the target performs queue to expire, processing module should
Perform request to be added in the waiting list in the flow cell of acquisition.Only obtain flow cell in execution queue less than
When, processing module just adds the execute instruction in the execution queue, and perform application system triggering perform request.This reality
The volume control device of example offer is provided, is that different application systems is respectively provided with its corresponding independent flow cell, Neng Gouyou
Targetedly the flow of different application systems access platform class system is controlled, is conducive to cluster load balance.
It should be noted that each embodiment is described by the way of progressive in this specification, each embodiment emphasis is said
Bright is all the difference with other embodiment, between each embodiment identical similar portion mutually referring to.For reality
For applying device disclosed in example, as which corresponds to the method disclosed in Example, so description is fairly simple, related part
Referring to method part illustration.
The step of method described with reference to the embodiments described herein or algorithm, directly can be held with hardware, processor
Capable software module, or the combination of the two is implementing.Software module can be placed in random access memory (RAM), internal memory, read-only deposit
Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, depositor, hard disk, moveable magnetic disc, CD-ROM or technology
In any other form of storage medium well known in field.
The above, is only presently preferred embodiments of the present invention, not makees any pro forma restriction to the present invention.Though
So the present invention is disclosed above with preferred embodiment, but is not limited to the present invention.It is any to be familiar with those skilled in the art
Member, under without departing from technical solution of the present invention ambit, using the methods and techniques content of the disclosure above to the present invention
Technical scheme makes many possible variations and modification, or the Equivalent embodiments for being revised as equivalent variations.Therefore, it is every without departing from
The content of technical solution of the present invention, according to the technical spirit of the present invention to any simple modification made for any of the above embodiments, equivalent
Change and modification, still fall within the range of technical solution of the present invention protection.
Claims (10)
1. a kind of flow control methods, it is characterised in that be applied to server;Methods described, including:
What receive user was triggered performs request, described to perform the mark that request carries the user;
According to the mark of the user, flow cell corresponding with the user is obtained;
Wherein, the flow cell includes performing queue and waiting list, when the execution request is in the execution queue, processes
This performs request;
Check whether the execution queue in the flow cell for obtaining is full;
When the execution queue in the flow cell of the acquisition is expired, perform described in the flow cell that request adds the acquisition
Waiting list.
2. flow control methods according to claim 1, it is characterised in that the mark according to the user, obtain
Flow cell corresponding with the user, specifically includes:
According to the mark of the user, search whether there is flow cell corresponding with the user;
If it is, directly obtaining flow cell corresponding with the user;
If it is not, then according to the flow restriction being pre-configured with, being the corresponding flow cell of the pending service creation.
3. flow control methods according to claim 1, it is characterised in that it is described by it is described perform request add described in obtain
Waiting list in the flow cell for obtaining, specifically includes:
Check whether the waiting list in the flow cell of the acquisition is full;
When the waiting list in the flow cell of the acquisition less than when, perform described in the flow cell that request adds the acquisition
Waiting list;
When the waiting list in the flow cell of the acquisition is expired, described in rejection, request is performed.
4. flow control methods according to claim 1, it is characterised in that it is described by it is described perform request add described in obtain
Waiting list in the flow cell for obtaining, also includes afterwards:
Check the team's head for performing waiting list in the flow cell whether request is the acquisition;
When the execution request is team's head of waiting list in the flow cell of the acquisition, in checking the flow cell of the acquisition
Execution queue it is whether full;
When the execution queue in the flow cell of the acquisition less than when, perform described in the flow cell that request adds the acquisition
Execution queue.
5. flow control methods according to Claims 1-4 any one, it is characterised in that also include:
Traffic statistics request is received, the traffic statistics request carries at least one mark to be measured;
It is determined that with the corresponding flow cell of the mark to be measured, obtain flow cell to be measured;
The queue for performing waiting list in the queue length and the flow cell to be measured of queue in obtaining the flow cell to be measured is long
Degree.
6. a kind of volume control device, it is characterised in that be applied to server;Described device, including:Receiver module, acquisition mould
Block, inspection module and processing module;
The receiver module, it is for the request that performs of receive user triggering, described to perform the mark that request carries the user;
The acquisition module, for the mark according to the user, obtains flow cell corresponding with the user;
Wherein, the flow cell includes performing queue and waiting list, when the execution request is in the execution queue, processes
This performs request;
The inspection module, for checking whether the execution queue in the flow cell for obtaining is full;
The processing module, for when the inspection module check to the execution queue in the flow cell of the acquisition completely when,
By the waiting list in the flow cell for performing the request addition acquisition.
7. volume control device according to claim 6, it is characterised in that the acquisition module, specifically includes:Search son
Module, acquisition submodule and establishment submodule;
The lookup submodule, for the mark according to the user, searches whether there is flow cell corresponding with the user;
The acquisition submodule, for when the lookup submodule finds flow cell corresponding with the user, directly obtaining
Obtain flow cell corresponding with the user;
The establishment submodule, for when it is described lookup submodule do not find flow cell corresponding with the user when, root
According to the flow restriction being pre-configured with, it is the corresponding flow cell of the pending service creation.
8. volume control device according to claim 6, it is characterised in that the processing module, specifically includes:Check son
Module and process submodule;
The inspection submodule, for checking whether the waiting list in the flow cell of the acquisition is full;
The process submodule, for when it is described check submodule check waiting list in the flow cell of the acquisition less than
When, by the waiting list in the flow cell for performing the request addition acquisition;It is additionally operable to when the inspection submodule inspection
When expiring to the waiting list in the flow cell of the acquisition, described in rejection, request is performed.
9. volume control device according to claim 6, it is characterised in that
The inspection module, is additionally operable to check the team for performing waiting list in the flow cell whether request is the acquisition
Head;When being additionally operable to team's head of waiting list in the flow cell that the execution request is the acquisition is checked, obtain described in inspection
Whether the execution queue in the flow cell for obtaining is full;
The processing module, be additionally operable to when it is described inspection module check to the execution queue in the flow cell of the acquisition less than
When, by the execution queue in the flow cell for performing the request addition acquisition.
10. the volume control device according to claim 6 to 9 any one, it is characterised in that also include:Determining module
And statistical module;
The receiver module, is additionally operable to receive traffic statistics request, and the traffic statistics request carries at least one and treats mark
Know;
The determining module, for determining and the corresponding flow cell of the mark to be measured, obtains flow cell to be measured;
The statistical module, for obtaining in the queue length and the flow cell to be measured that perform queue in the flow cell to be measured
The queue length of waiting list.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611264947.9A CN106533961B (en) | 2016-12-30 | 2016-12-30 | Flow control method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611264947.9A CN106533961B (en) | 2016-12-30 | 2016-12-30 | Flow control method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106533961A true CN106533961A (en) | 2017-03-22 |
CN106533961B CN106533961B (en) | 2020-08-28 |
Family
ID=58336395
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611264947.9A Active CN106533961B (en) | 2016-12-30 | 2016-12-30 | Flow control method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106533961B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109788450A (en) * | 2019-01-15 | 2019-05-21 | 深圳市中天网景科技有限公司 | A kind of flow sharing method, system and the terminal of Internet of Things network interface card |
CN109947562A (en) * | 2019-03-01 | 2019-06-28 | 上海七印信息科技有限公司 | A kind of task distribution current limiting system and its method for allocating tasks |
CN110097268A (en) * | 2019-04-19 | 2019-08-06 | 北京金山安全软件有限公司 | Task allocation method and device, electronic equipment and storage medium |
CN113992587A (en) * | 2021-12-27 | 2022-01-28 | 广东睿江云计算股份有限公司 | Flow control method and device, computer equipment and storage medium |
CN117827497A (en) * | 2024-03-05 | 2024-04-05 | 中国电子科技集团公司第三十研究所 | Method and device for flow statistics and real-time sequencing based on domestic multi-core processor |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020156897A1 (en) * | 2001-02-23 | 2002-10-24 | Murthy Chintalapati | Mechanism for servicing connections by disassociating processing resources from idle connections and monitoring the idle connections for activity |
CN101959236A (en) * | 2009-07-13 | 2011-01-26 | 大唐移动通信设备有限公司 | Traffic control method and device |
CN102035880A (en) * | 2010-11-02 | 2011-04-27 | 中兴通讯股份有限公司 | Method and device for maintaining connection |
CN103259743A (en) * | 2012-02-15 | 2013-08-21 | 中兴通讯股份有限公司 | Method and device for controlling output flow based on token bucket |
CN103583022A (en) * | 2011-03-28 | 2014-02-12 | 思杰***有限公司 | Systems and methods for handling NIC congestion via NIC aware application |
CN104572290A (en) * | 2013-10-11 | 2015-04-29 | 中兴通讯股份有限公司 | Method and device for controlling message processing threads |
CN105681217A (en) * | 2016-04-27 | 2016-06-15 | 深圳市中润四方信息技术有限公司 | Dynamic load balancing method and system for container cluster |
-
2016
- 2016-12-30 CN CN201611264947.9A patent/CN106533961B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020156897A1 (en) * | 2001-02-23 | 2002-10-24 | Murthy Chintalapati | Mechanism for servicing connections by disassociating processing resources from idle connections and monitoring the idle connections for activity |
CN101959236A (en) * | 2009-07-13 | 2011-01-26 | 大唐移动通信设备有限公司 | Traffic control method and device |
CN102035880A (en) * | 2010-11-02 | 2011-04-27 | 中兴通讯股份有限公司 | Method and device for maintaining connection |
CN103583022A (en) * | 2011-03-28 | 2014-02-12 | 思杰***有限公司 | Systems and methods for handling NIC congestion via NIC aware application |
CN103259743A (en) * | 2012-02-15 | 2013-08-21 | 中兴通讯股份有限公司 | Method and device for controlling output flow based on token bucket |
CN104572290A (en) * | 2013-10-11 | 2015-04-29 | 中兴通讯股份有限公司 | Method and device for controlling message processing threads |
CN105681217A (en) * | 2016-04-27 | 2016-06-15 | 深圳市中润四方信息技术有限公司 | Dynamic load balancing method and system for container cluster |
Non-Patent Citations (1)
Title |
---|
HUDAN2714: "《阿里云,https://yq.aliyun.com/articles/11893》", 24 February 2014 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109788450A (en) * | 2019-01-15 | 2019-05-21 | 深圳市中天网景科技有限公司 | A kind of flow sharing method, system and the terminal of Internet of Things network interface card |
CN109947562A (en) * | 2019-03-01 | 2019-06-28 | 上海七印信息科技有限公司 | A kind of task distribution current limiting system and its method for allocating tasks |
CN110097268A (en) * | 2019-04-19 | 2019-08-06 | 北京金山安全软件有限公司 | Task allocation method and device, electronic equipment and storage medium |
CN113992587A (en) * | 2021-12-27 | 2022-01-28 | 广东睿江云计算股份有限公司 | Flow control method and device, computer equipment and storage medium |
CN113992587B (en) * | 2021-12-27 | 2022-03-22 | 广东睿江云计算股份有限公司 | Flow control method and device, computer equipment and storage medium |
CN117827497A (en) * | 2024-03-05 | 2024-04-05 | 中国电子科技集团公司第三十研究所 | Method and device for flow statistics and real-time sequencing based on domestic multi-core processor |
Also Published As
Publication number | Publication date |
---|---|
CN106533961B (en) | 2020-08-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11561841B2 (en) | Managing partitions in a scalable environment | |
US10635500B2 (en) | Decoupling partitioning for scalability | |
CN112214293B (en) | Service deployment method under server-free architecture and function management platform | |
US9497139B2 (en) | Client-allocatable bandwidth pools | |
CN106533961A (en) | Flow control method and device | |
US8868711B2 (en) | Dynamic load balancing in a scalable environment | |
CN106936899B (en) | Configuration method of distributed statistical analysis system and distributed statistical analysis system | |
CN105094997B (en) | Physical memory sharing method and system between a kind of cloud computing host node | |
EP2652594B1 (en) | Multi-tenant, high-density container service for hosting stateful and stateless middleware components | |
US9306870B1 (en) | Emulating circuit switching in cloud networking environments | |
CN109542611A (en) | Database, that is, service system, database dispatching method, equipment and storage medium | |
CN103744719B (en) | Lock management method and system, the collocation method and device of lock administration system | |
CN105159736B (en) | A kind of construction method for the SaaS software deployment schemes for supporting performance evaluation | |
CN103324487B (en) | Method for achieving SaaS for workflow engine | |
CN110661842B (en) | Resource scheduling management method, electronic equipment and storage medium | |
CN104679594B (en) | A kind of middleware distributed computing method | |
CN104040486A (en) | Decoupling PAAS resources, jobs, and scheduling | |
CN102594861A (en) | Cloud storage system with balanced multi-server load | |
CN107864211B (en) | Cluster resource dispatching method and system | |
CN112052068A (en) | Method and device for binding CPU (central processing unit) of Kubernetes container platform | |
JP5969340B2 (en) | Resource management system, resource management method, and resource management program | |
CN100547585C (en) | Being included as entity provides the method and apparatus of the level formula management at least one territory | |
CN111339202A (en) | Data access method, device, equipment and storage medium | |
CN115063282A (en) | GPU resource scheduling method, device, equipment and storage medium | |
CN102929605A (en) | Cloud-computing-based open interface of data mining system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |