CN103546388A - Flow control method and flow control device - Google Patents

Flow control method and flow control device Download PDF

Info

Publication number
CN103546388A
CN103546388A CN201210238787.6A CN201210238787A CN103546388A CN 103546388 A CN103546388 A CN 103546388A CN 201210238787 A CN201210238787 A CN 201210238787A CN 103546388 A CN103546388 A CN 103546388A
Authority
CN
China
Prior art keywords
main body
flow control
control main
current accessed
threshold
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
Application number
CN201210238787.6A
Other languages
Chinese (zh)
Other versions
CN103546388B (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.)
Advanced New Technologies Co Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201210238787.6A priority Critical patent/CN103546388B/en
Publication of CN103546388A publication Critical patent/CN103546388A/en
Application granted granted Critical
Publication of CN103546388B publication Critical patent/CN103546388B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a flow control method and a flow control device. The flow control method and the flow control device are used for solving problems of high pertinence and low reusability of an existing flow control method. The flow control method includes receiving a flow control request containing a first flow control main body; acquiring configuration information of the first flow control main body; calling a business plug-in unit via a plug-in unit interface, and detecting whether the first flow control main body meets business requirements or not; adding one to a current access quantity on the premise that the first flow control main body meets the business requirements when the current access quantity of the first flow control main body is smaller than an access quantity threshold value, and returning a success mark; returning a failure mark if the first flow control main body does not meet the business requirements or when the current access quantity of the first flow control main body is higher than or equal to the access quantity threshold value. The configuration information contains the access quantity threshold value of the first flow control main body, and the business plug-in unit corresponds to the first flow control main body and is used for storing business requirement strategies. The flow control method and the flow control device have the advantages of applicability to various types of business and extremely high reusability.

Description

A kind of flow control methods and device
Technical field
The application relates to network technology, particularly relates to a kind of flow control methods and device.
Background technology
The object of flow control is the access pressure that restriction external reference amount causes Flow Control main body; thereby realize the protection to Flow Control main body; and guarantee the normal operation of follow-up business; avoid situation excessive by visit capacity and that cause service response slowly even to stop, guarantee the efficient and stable operation of user network.
Along with the development of network, network platform visit capacity to be processed every day is very huge, if do not carry out flow control, just causes possibly network platform collapse, cannot normally access.
In actual treatment, when described principal access server, need to control flow.First need to judge whether described main body meets business demand, meeting under the prerequisite of business demand, then judge that whether the visit capacity of described main body reaches threshold values, if visit capacity does not reach threshold values, can conduct interviews; If visit capacity reaches threshold values, cannot conduct interviews.
But said method has been solidificated in business demand in flow control methods, thereby the specific aim of method is more intense, causes each class business demand, all needs the flow control methods of a kind of uniqueness that Pei Ge is corresponding with it, and flow control methods durability is lower.
Summary of the invention
The application provides a kind of flow control methods and device, more intense to solve existing flow control methods specific aim, the problem that durability is lower.
In order to address the above problem, the application discloses a kind of flow control methods, comprising:
Receive flow control request, wherein, described flow control request comprises first-class control main body;
Obtain described first-class control main body Pei Ge information, wherein, described Pei Ge information comprises the requesting threshold of described first-class control main body;
For all kinds of business demands, by card i/f, call business plug-in unit corresponding to described first-class control main body, whether such meets business demand to detect described first-class control main body, and wherein, described business plug-in unit is used for preserving business demand strategy;
Meeting under the prerequisite of all kinds of business demands, when the current accessed amount of described first-class control main body is less than described requesting threshold, current accessed amount is being added and returns in the lump successfully sign;
When not meeting business demand, or, when the current accessed amount of described first-class control main body is more than or equal to described requesting threshold, return to unsuccessfully sign.
Preferably, in described flow control request, also comprise Flow Control strategy,
Described current accessed amount also comprises after being more than or equal to described requesting threshold:
Flow Control strategy in flow control request is judged;
When Flow Control strategy is refusal, return to unsuccessfully sign;
When Flow Control strategy is when switching, what be switched to the second Flow Control main body and obtain described the second Flow Control main body joins Ge information.
Preferably, in described Pei Ge information, also comprise the classification of first-class control main body, in described flow control request, also comprise switching threshold;
The described step that is switched to the second Flow Control main body comprises:
Joining in Ge information of query caching, under the classification of described first-class control main body, whether there is the second Flow Control main body;
If there is not described the second Flow Control main body, handoff failure, returns to unsuccessfully sign;
If there is described the second Flow Control main body, detect switching times and whether be less than switching threshold;
If switching times is not less than switching threshold, handoff failure, returns to unsuccessfully sign;
If switching times is less than switching threshold, chooses at random the second Flow Control main body under the classification of a described first-class control main body and carry out and switch.
Preferably, described meeting under the prerequisite of all kinds of business demands, when current accessed amount is less than described requesting threshold, current accessed amount is added and returns in the lump successfully sign, comprising:
Meeting under the prerequisite of all kinds of business demands, when requesting threshold is greater than 0, from buffer memory, obtain current accessed amount;
Detect current accessed amount and whether be less than described requesting threshold;
When current accessed amount is less than described requesting threshold, current accessed amount is added to one, and be updated in buffer memory;
Return to successfully sign.
Preferably, also comprise flow method for releasing:
Receive flow releasing request, wherein, described flow releasing request comprises first-class control main body;
Obtain described first-class control main body Pei Ge information, wherein, described Pei Ge information comprises requesting threshold;
When described requesting threshold is greater than 0, from buffer memory, obtain current accessed amount;
When described current accessed amount is greater than 0, current accessed amount is subtracted in the lump and is updated in buffer memory.
Preferably, also comprise the time-out time of described first-class control main body in described Pei Ge information, described method also comprises:
While not receiving flow releasing request in time-out time, empty described current accessed amount.
Accordingly, disclosed herein as well is a kind of volume control device, comprising:
Receiver module, for receiving flow control request, wherein, described flow control request comprises first-class control main body;
Acquisition module, for obtaining described first-class control main body Pei Ge information, wherein, described Pei Ge information comprises the requesting threshold of described first-class control main body;
Call and detection module, for for all kinds of business demands, by card i/f, call business plug-in unit corresponding to described first-class control main body, detect described first-class control main body and whether meet such business demand, wherein, described business plug-in unit is used for preserving business demand strategy;
First returns to module, for meeting under the prerequisite of all kinds of business demands, when the current accessed amount of described first-class control main body is less than described requesting threshold, current accessed amount is added and returns in the lump successfully sign;
Second returns to module, for ought not meeting business demand, or, when the current accessed amount of described first-class control main body is more than or equal to described requesting threshold, return to unsuccessfully sign.
Preferably, in described flow control request, also comprise Flow Control strategy, described device also comprises:
Strategy judge module, judges for the Flow Control strategy to flow control request;
Handover module, for when Flow Control strategy is when switching, what be switched to the second Flow Control main body and obtain described the second Flow Control main body joins Ge information;
Described second returns to module, also for when Flow Control strategy is refusal, returns to unsuccessfully sign.
Preferably, in described Pei Ge information, also comprise the classification of first-class control main body, in described flow control request, also comprise switching threshold;
Described handover module comprises:
Inquiry submodule, for query caching join Ge information, under the classification of described first-class control main body, whether there is the second Flow Control main body;
Described second returns to module, if also for not there is not described the second Flow Control main body, handoff failure, returns to unsuccessfully sign;
Threshold decision submodule, if for there being described the second Flow Control main body, detect switching times and whether be less than switching threshold;
Described second returns to module, if be also not less than switching threshold for switching times, handoff failure, returns to unsuccessfully sign;
Main body switching submodule, if be less than switching threshold for switching times, choose at random the second Flow Control main body under the classification of a described first-class control main body and carries out and switch.
Preferably, described first returns to module, comprising:
Obtain visit capacity submodule, for meeting under the prerequisite of all kinds of business demands, when requesting threshold is greater than 0, from buffer memory, obtain current accessed amount;
Whether threshold test submodule, be less than described requesting threshold for detection of current accessed amount;
Increase visit capacity submodule, for when current accessed amount is less than described requesting threshold, current accessed amount is added to one, and be updated in buffer memory;
Return to submodule, for returning to successfully sign.
Preferably, also comprise flow release module, comprising:
Receive submodule, for receiving flow releasing request, wherein, described flow releasing request comprises first-class control main body;
Obtain Pei Ge information submodule, for obtaining described first-class control main body Pei Ge information, wherein, described Pei Ge information comprises requesting threshold;
Obtain visit capacity submodule, for when described requesting threshold is greater than 0, from buffer memory, obtain current accessed amount;
Reduce visit capacity submodule, for when described current accessed amount is greater than 0, current accessed amount is subtracted in the lump and is updated in buffer memory.
Preferably, also comprise the time-out time of described first-class control main body in described Pei Ge information, described device also comprises:
Empty visit capacity module, when not receiving flow releasing request in time-out time, empty described current accessed amount.
Compared with prior art, the application comprises following advantage:
First, in flow control methods, different business demand corresponding to business, and meeting under the prerequisite of business demand, control method for visit capacity is basically identical, therefore the flow control methods described in the application, independent by unique business demand, and consistent visit capacity control method is integrated.Therefore after receiving flow control request, first obtain first-class control main body Pei Ge information, then for all kinds of business demands, by card i/f, call business plug-in unit corresponding to described first-class control main body, by described business plug-in unit, judge whether described first-class control main body meets such business demand, and then the judgement of the amount of conducting interviews.Therefore, the application can, for different first-class control main bodys, call corresponding with it all kinds of Flow Control plug-in unit judgement business demands, and adopt consistent visit capacity control method, thereby make the flow control methods described in the application be applicable to various business, durability is very high.
Secondly, the application, when the current accessed amount of first-class control main body is more than or equal to described requesting threshold, follow-uply can carry out Flow Control strategy.According to the classification of first-class control main body, search the second Flow Control main body under described classification, be then switched to the second Flow Control main body, and obtain described the second Flow Control main body join Ge information, re-start flow control.The application's flow control methods is more flexible, and Flow Control strategy is various.
Again, the application will join Ge information and current accessed amount is kept in buffer memory, can reduce the call operation to database, thereby reduces the burden in flow control, database being caused.
Again, also there is flow dispose procedure in the application, and, when not receiving flow releasing request in time-out time, can automatically empty described current accessed amount, avoid occurring because flow slowly can not get discharging, and cause the waste of resource.
Accompanying drawing explanation
Fig. 1 is a kind of flow control methods flow chart described in the embodiment of the present application;
Fig. 2 is main body switching flow figure in a kind of flow switch method described in the application's preferred embodiment;
Fig. 3 is the determination methods flow chart of visit capacity in a kind of flow control methods described in the application's preferred embodiment;
Fig. 4 be described in the application's preferred embodiment in a kind of flow control methods flow discharge flow chart;
Fig. 5 is a kind of flow control methods overview flow chart described in the application's preferred embodiment;
Fig. 6 is a kind of volume control device structure chart described in the embodiment of the present application.
Embodiment
For the application's above-mentioned purpose, feature and advantage can be become apparent more, below in conjunction with the drawings and specific embodiments, the application is described in further detail.
Prior art has been solidificated in business demand in flow control methods, thereby the specific aim of method is more intense, causes each business demand, all needs the flow control methods of a kind of uniqueness that Pei Ge is corresponding with it, and flow control methods durability is lower.
The application provides a kind of flow control methods, and business demand is independent, can call different Flow Control plug-in units for different first-class control main bodys, thereby make the flow control methods described in the application be applicable to various business, and durability is very high.
With reference to Fig. 1, provided a kind of flow control methods flow chart described in the embodiment of the present application.
Step 11, receives flow control request, and wherein, described flow control request comprises first-class control main body;
When access services device, need to control flow, therefore can transmitted traffic control request.Correspondence can receive flow control request, and wherein, described flow control request comprises first-class control main body.
Flow Control main body refers to the main body of carrying out flow control, with concrete traffic aided.For example, in banking, described Flow Control main body can be the POS machine paying; In social network-i i-platform, described Flow Control main body can be the user of this platform, or logins the IP address of this platform.
Wherein, described POS(Point Of Sale) machine is point-of-sale terminal, it is a kind of multi-functional terminal end, it is arranged on to the franchised business of credit card and accepts in site and be unified into network with computer, just can realize electronic funds automatic account transfer, it has the functions such as the consumption of support, pre-authorization, inquiry into balance and account transfer, uses safety, quick, reliable.The machine of POS described in the application can be virtual POS machine.
Wherein, there is not the body of physics POS machine in described virtual POS machine, but comprise the various data that POS machine possesses itself, as POS terminal number, and trade company number, key etc.When third party pays Yu bank of company docking and realizes POS and receive single business, bank is considered as Yi Ge trade company by third party's payment company conventionally, distribute a lot of terminal datas (being virtual POS machine) to this trade company, third party pays company and just can carry out with the virtual POS machine that bank distributes the single operation of POS receipts like this.
IP is Internet Protocol, and Internet protocol is computer network and interconnects the agreement that communicates and design.
Step 12, obtains described first-class control main body Pei Ge information, and wherein, described Pei Ge information comprises the requesting threshold of described first-class control main body;
Above-mentionedly in flow control request, get after first-class control main body, that can obtain described first-class control main body joins Ge information, in actual treatment, described in can obtaining, joins Ge information from buffer memory, can from database, obtain described Pei Ge information, the application does not limit this yet.
Wherein, described Pei Ge information comprises the requesting threshold of described first-class control main body, certainly, can also comprise the data such as classification of first-class control main body in described Pei Ge information, and the application does not limit this.
Step 13, for all kinds of business demands, calls business plug-in unit corresponding to described first-class control main body by card i/f, judges whether described first-class control main body meets such business demand, and wherein, described business plug-in unit is used for preserving business demand strategy;
Because different business exists different business demands, prior art has been solidificated in business demand in flow control methods, but in actual treatment, judgement for visit capacity is comparison general character, and be comparison individual character for the judgement of business demand, this has just caused existing flow control methods specific aim more intense, and durability is lower.
Therefore the application is when carrying out flow control, independent by the business demand that compares individual character, and the judgement of comparing the visit capacity of general character is integrated.In specific implementation, can pass through She Ge card i/f, for all kinds of business demands, by described card i/f and concrete traffic aided connection, wherein, described business plug-in unit is used for preserving business demand strategy, and for example, whether POS machine is not frozen.Business demand She Ge is judged in plug-in unit, therefore, when needing business to participate in flow control, call corresponding business plug-in unit and carry out business demand judgement.
Therefore, can call business plug-in unit corresponding to described first-class control main body by card i/f, judge whether described first-class control main body meets business demand.For example, described first-class control main body is POS-A1, and business plug-in unit corresponding to described first-class control main body is financial business plug-in unit, can call described financial business plug-in unit by described card i/f, judge whether POS-A1 meets business demand, whether not frozen etc. such as POS-A1.
If so, meet all kinds of business demands, perform step 14; If not, do not meet certain class business demand, perform step 16.
Step 14, judges whether the current accessed amount of described first-class control main body is less than described requesting threshold;
If meet all kinds of business demands, can further compare the determining step of the visit capacity of general character, can detect first-class control main body and whether reach requesting threshold, if described first-class control main body has reached requesting threshold, described first-class control main body can not conduct interviews; If described first-class control main body does not reach requesting threshold, described first-class control main body can conduct interviews.In concrete enforcement, can judge whether the current accessed amount of described first-class control main body is less than described requesting threshold.
If so, perform step 15; If not, perform step 16.
For example, POS-A1 is not frozen, and the requesting threshold of POS-A1 is 5.If the current accessed amount of POS-A1 is 3<5, follow-up execution step 15, if the current accessed amount of POS-A1 is 5=5, follow-up execution step 16.
Step 15, adds current accessed amount to return in the lump successfully sign;
Meeting under the prerequisite of business demand, if described first-class control main body does not reach requesting threshold, when the current accessed amount of described first-class control main body is less than described requesting threshold, described first-class control main body can conduct interviews, and therefore current accessed amount can be added and return in the lump successfully sign.
In upper example, the current accessed amount of POS-A1 is 3, the current accessed amount of POS-A1 can be added to one, and current accessed amount is 3+1=4, then returns to successfully sign, and POS-A1 can continue follow-up access, carries out corresponding business etc.
Step 16, returns to unsuccessfully sign.
When not meeting business demand, described first-class control main body can not conduct interviews, and returns to unsuccessfully sign.Or described first-class control main body has reached requesting threshold,, when the current accessed amount of described first-class control main body is more than or equal to described requesting threshold, described first-class control main body can not conduct interviews, and returns to unsuccessfully sign.
As above in example, POS-A1 is not frozen, and the current accessed amount of POS-A1 is 5, now will return to unsuccessfully sign, and POS-A1 can not continue candidate's access.And for example, POS-A1 is frozen, now will return to equally unsuccessfully sign, and POS-A1 can not continue candidate's access.
In sum, in flow control methods, different business demand corresponding to business, and meeting under the prerequisite of business demand, control method for visit capacity is basically identical, therefore the flow control methods described in the application, independent by unique business demand, and consistent visit capacity control method is integrated.Therefore after receiving flow control request, first obtain first-class control main body Pei Ge information, then for all kinds of business demands, by card i/f, call business plug-in unit corresponding to described first-class control main body, by described business plug-in unit, judge whether described first-class control main body meets such business demand, and then the judgement of the amount of conducting interviews.Therefore, the application can, for different first-class control main bodys, call corresponding with it all kinds of Flow Control plug-in unit judgement business demands, and adopt consistent visit capacity control method, thereby make the flow control methods described in the application be applicable to various business, durability is very high.
Preferably, in described flow control request, also comprise Flow Control strategy,
Described current accessed amount also comprises after being more than or equal to described requesting threshold:
Flow Control strategy in flow control request is judged; When Flow Control strategy is refusal, return to unsuccessfully sign; When Flow Control strategy is when switching, what be switched to the second Flow Control main body and obtain described the second Flow Control main body joins Ge information.
As above in example, POS-A1 is not frozen, and the current accessed amount of POS-A1 is 5, can also detect the Flow Control strategy in flow control request, if Flow Control strategy is refusal, now will return to unsuccessfully sign, and POS-A1 can not continue candidate's access.If Flow Control strategy, for switching, is switched to the second Flow Control main body as POS-A2, and obtain described the second Flow Control main body join Ge information.Then can re-execute above-mentioned steps 13, described the second Flow Control main body is carried out to flow control.
Preferably, in described Pei Ge information, also comprise the classification of first-class control main body, in described flow control request, also comprise switching threshold.
Described in the application, join the classification that also comprises first-class control main body in Ge information, under described classification, comprise a plurality of Flow Control main bodys, as first-class control main body, the second Flow Control main body etc.If the classification of POS-A1 is user A, user A also has POS-A2 and POS-A3.
With reference to Fig. 2, provided described in the application's preferred embodiment main body switching flow figure in a kind of flow switch method.
The described step that is switched to the second Flow Control main body comprises:
Step 201, whether joining in Ge information of query caching, there is the second Flow Control main body under the classification of described first-class control main body;
If Flow Control strategy is carried out in above-mentioned judgement, follow-uply join Ge information in can query caching, then search under the classification of described first-class control main body whether have the second Flow Control main body.
If so, there is described the second Flow Control main body, perform step 202; If not, there is not described the second Flow Control main body, perform step 204.
For example, the classification of POS-A1 is user A, and user A also has POS-A2 and POS-A3.
Step 202, detects switching times and whether is less than switching threshold;
Wherein, described switching times is for same flow control request, from receiving a certain flow control request, till return to successfully sign or end mark for this flow control request, during the number of times of the Flow Control main body switched of described flow control request.As above in example, user A comprises that 3 Flow Control main bodys are respectively POS-A1, POS-A2 and POS-A3, if initial first-class control main body is POS-A1, when being switched to POS-A2 by POS-A1, switching times is 1, when being switched to POS-A3 by POS-A2 again, switching times is 2, by that analogy, every switching 1 time, switching times+1.
Therefore, be if so, that switching times is less than switching threshold, perform step 203; If not, switching times is not less than switching threshold, performs step 204.
Whether the switching times that detects described classification is less than switching threshold, and for example, switching threshold is 10, if the switching times of user A be 3<10, perform step 203; If the switching times of user A is 10=10, perform step 204.
Step 203, chooses at random the second Flow Control main body under the classification of a described first-class control main body and carries out and switch;
If switching times is less than switching threshold, can chooses at random the second Flow Control main body under the classification of a described first-class control main body and carry out and switch.
For example, the switching times of user A is 3< switching threshold 10, can from POS-A2 and POS-A3, as the second Flow Control main body, then carry out and switch by an optional POS machine, use described second control volume to carry out business, and described second control volume is carried out to flow control.
Step 204, handoff failure, returns to unsuccessfully sign;
If there is not described the second Flow Control main body, or, there is described the second Flow Control main body but switching times is not less than switching threshold, handoff failure, returns to unsuccessfully sign.
In sum, the application, when the current accessed amount of first-class control main body is more than or equal to described requesting threshold, follow-uply can carry out Flow Control strategy.According to the classification of first-class control main body, search the second Flow Control main body under described classification, be then switched to the second Flow Control main body, and obtain described the second Flow Control main body join Ge information, re-start flow control.The application's flow control methods is more flexible, and Flow Control strategy is various.
With reference to Fig. 3, provided described in the application's preferred embodiment the determination methods flow chart of visit capacity in a kind of flow control methods.
Described meeting under the prerequisite of all kinds of business demands, when current accessed amount is less than described requesting threshold, current accessed amount is added and returns in the lump successfully sign, comprising:
Whether step 301, is meeting under the prerequisite of all kinds of business demands, detect current accessed amount and exist;
Meeting under the prerequisite of business demand, detecting current accessed amount and whether exist, in query caching, whether having current accessed amount, if there is not described current accessed amount, performing step 302; If there is described current accessed amount, perform step 303.
Step 302 is 0 by current accessed Liang She Ge;
If there is not described current accessed amount, for the first time described first-class control main body is carried out to flow control, so can be 0 by current accessed Liang She Ge, then follow-up execution step 305.
Step 303 is obtained current accessed amount from buffer memory;
When there being described current accessed amount, can from buffer memory, obtain current accessed amount.
Step 304, detects current accessed amount and whether is less than described requesting threshold;
If so, be that current accessed amount is less than described requesting threshold, perform step 305; If not, perform step 307.
Step 305, adds one by current accessed amount, and is updated in buffer memory;
When current accessed amount is less than described requesting threshold, or, after current accessed Liang She Ge is 0, current accessed amount can be added to one, and be updated in buffer memory;
Step 306, returns to successfully sign;
Step 307, returns to unsuccessfully sign.
In sum, the application will join Ge information and current accessed amount is kept in buffer memory, can reduce the call operation to database, thereby reduces the burden in flow control, database being caused.
With reference to Fig. 4, provided described in the application's preferred embodiment flow in a kind of flow control methods and discharged flow chart.
Preferably, also comprise flow method for releasing:
Step 401, receives flow releasing request, and wherein, described flow releasing request comprises first-class control main body;
In the application, also comprise flow method for releasing, when described first-class control main body executes after business, can transmitted traffic releasing request, after receiving flow releasing request, can carry out flow release, now described flow releasing request comprises first-class control main body.
In actual treatment, after Flow Control is processed successfully, the controlled Flow Control main body of correspondence can be returned, therefore, after business execution finishes, just can know which Flow Control main body to carry out flow to has discharged.
Therefore, Flow Control main body in described flow releasing request is not limited to described first-class control main body, for example, if above-mentioned, carry out in flow control, be switched to the second Flow Control main body, in described the second Flow Control main body, execute after business, equally can transmitted traffic releasing request, discharge the current accessed amount of described the second Flow Control main body.
Step 402, obtains described first-class control main body Pei Ge information, and wherein, described Pei Ge information comprises requesting threshold;
Step 403, whether test access amount threshold value is greater than 0;
If so, be that requesting threshold is greater than 0, perform step 404, if not, requesting threshold is not more than 0, and mistake appears in the request of illustrating, can carry out the operation of end.
Step 404 is obtained current accessed amount from buffer memory;
When described requesting threshold is greater than 0, from buffer memory, obtain current accessed amount;
Step 405, detects current accessed amount and whether is greater than 0;
If so, be that current accessed amount is greater than 0, perform step 406, if not, current accessed amount is not more than 0, and mistake appears in the request of illustrating, can carry out the operation of end.
Step 406, subtracts current accessed amount in the lump and is updated in buffer memory.
When described current accessed amount is greater than 0, current accessed amount is subtracted in the lump and is updated in buffer memory.
Preferably, also comprise the time-out time of described first-class control main body in described Pei Ge information, described method also comprises:
While not receiving flow releasing request in time-out time, empty described current accessed amount.
The application Hai She Ge in Pei Ge information Hai She Ge the time-out time of described first-class control main body, therefore, if do not receive the flow releasing request for described first-class control main body in time-out time, just can empty described current accessed amount, avoid occurring because current accessed amount can not get discharging all the time, and the obstructing problem occurring.
In sum, also there is flow dispose procedure in the application, and, when not receiving flow releasing request in time-out time, can automatically empty described current accessed amount, avoid occurring because flow slowly can not get discharging, and cause the waste of resource.
With reference to Fig. 5, provided a kind of flow control methods overview flow chart described in the application's preferred embodiment.
In actual treatment, can pass through the described flow control methods of the common execution of Service Component, Flow Control assembly and buffer memory assembly.
Wherein, mainly carrying out in Flow Control assembly in flow control methods, when needs carry out business demand judgement, can call the business plug-in unit in Service Component by card i/f, according to the judgement that returns results of plug-in unit, is to carry out follow-up operation.Wherein, because business demand may have multiclass, therefore in order to meet the demand of all kinds of business, business plug-in unit also may have a plurality of, and concrete quantity can be depending on business demand, and the application does not limit this.
The result of flow control, as successfully sign or unsuccessfully sign, can send in the Flow Control result to Service Component, and then Service Component can carry out follow-up business judgement.And, also controlled Flow Control main body can be returned to result, in follow-up Flow Control main body of carrying out can knowing when Flow Control discharges release.
In flow control, current accessed amount can be stored in the cache information of buffer memory assembly, therefore, when needs inquiry or renewal current accessed amount, can call the cache information of buffer memory assembly.
Meanwhile, buffer memory assembly also can be controlled cache information according to the Flow Control time-out time in Pei Ge information, when a certain Flow Control main body surpasses Flow Control time-out time, can remove the current accessed amount of the main body of Flow Control described in buffer memory.
With reference to Fig. 6, provided a kind of volume control device structure chart described in the embodiment of the present application.
Accordingly, the application also provides a kind of volume control device, and comprise receiver module 11, acquisition module 12, call and detection module 13, first returns to module 14 and second and returns to module 15, wherein:
Receiver module 11, for receiving flow control request, wherein, described flow control request comprises first-class control main body;
Acquisition module 12, for obtaining described first-class control main body Pei Ge information, wherein, described Pei Ge information comprises the requesting threshold of described first-class control main body;
Call and detection module 13, for for all kinds of business demands, by card i/f, call business plug-in unit corresponding to described first-class control main body, detect described first-class control main body and whether meet such business demand, wherein, described business plug-in unit is used for preserving business demand strategy;
First returns to module 14, for meeting under the prerequisite of all kinds of business demands, when the current accessed amount of described first-class control main body is less than described requesting threshold, current accessed amount is added and returns in the lump successfully sign;
Second returns to module 15, for ought not meeting business demand, or, when the current accessed amount of described first-class control main body is more than or equal to described requesting threshold, return to unsuccessfully sign.
Preferably, in described flow control request, also comprise Flow Control strategy, described device also comprises:
Strategy judge module, judges for the Flow Control strategy to flow control request;
Handover module, for when Flow Control strategy is when switching, what be switched to the second Flow Control main body and obtain described the second Flow Control main body joins Ge information;
Described second returns to module, also for when Flow Control strategy is refusal, returns to unsuccessfully sign.
Preferably, in described Pei Ge information, also comprise the classification of first-class control main body, in described flow control request, also comprise switching threshold;
Described handover module comprises:
Inquiry submodule, for query caching join Ge information, under the classification of described first-class control main body, whether there is the second Flow Control main body;
Described second returns to module, if also for not there is not described the second Flow Control main body, handoff failure, returns to unsuccessfully sign;
Threshold decision submodule, if for there being described the second Flow Control main body, detect switching times and whether be less than switching threshold;
Described second returns to module, if be also not less than switching threshold for switching times, handoff failure, returns to unsuccessfully sign;
Main body switching submodule, if be less than switching threshold for switching times, choose at random the second Flow Control main body under the classification of a described first-class control main body and carries out and switch.
Preferably, described first returns to module, comprising:
Obtain visit capacity submodule, for meeting under the prerequisite of all kinds of business demands, when requesting threshold is greater than 0, from buffer memory, obtain current accessed amount;
Whether threshold test submodule, be less than described requesting threshold for detection of current accessed amount;
Increase visit capacity submodule, for when current accessed amount is less than described requesting threshold, current accessed amount is added to one, and be updated in buffer memory;
Return to submodule, for returning to successfully sign.
Preferably, described device also comprises flow release module, comprising:
Receive submodule, for receiving flow releasing request, wherein, described flow releasing request comprises first-class control main body;
Obtain Pei Ge information submodule, for obtaining described first-class control main body Pei Ge information, wherein, described Pei Ge information comprises requesting threshold;
Obtain visit capacity submodule, for when described requesting threshold is greater than 0, from buffer memory, obtain current accessed amount;
Reduce visit capacity submodule, for when described current accessed amount is greater than 0, current accessed amount is subtracted in the lump and is updated in buffer memory.
Preferably, also comprise the time-out time of described first-class control main body in described Pei Ge information, described device also comprises:
Empty visit capacity module, when not receiving flow releasing request in time-out time, empty described current accessed amount.
For device embodiment, because it is substantially similar to embodiment of the method, so description is fairly simple, relevant part is referring to the part explanation of embodiment of the method.
Each embodiment in this specification all adopts the mode of going forward one by one to describe, and each embodiment stresses is the difference with other embodiment, between each embodiment identical similar part mutually referring to.
Those skilled in the art should understand, the application's embodiment can be provided as method, system or computer program.Therefore, the application can adopt complete hardware implementation example, implement software example or in conjunction with the form of the embodiment of software and hardware aspect completely.And the application can adopt the form that wherein includes the upper computer program of implementing of computer-usable storage medium (including but not limited to magnetic disc store, CD-ROM, optical memory etc.) of computer usable program code one or more.
Although described the application's preferred embodiment, once those skilled in the art obtain the basic creative concept of cicada, can make other change and modification to these embodiment.So claims are intended to all changes and the modification that are interpreted as comprising preferred embodiment and fall into the application's scope.
The application is with reference to describing according to flow chart and/or the block diagram of the method for the embodiment of the present application, equipment (system) and computer program.Should understand can be in computer program instructions realization flow figure and/or block diagram each flow process and/or the flow process in square frame and flow chart and/or block diagram and/or the combination of square frame.Can provide these computer program instructions to the processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device to produce a machine, the instruction of carrying out by the processor of computer or other programmable data processing device is produced for realizing the device in the function of flow process of flow chart or a plurality of flow process and/or square frame of block diagram or a plurality of square frame appointments.
These computer program instructions also can be stored in energy vectoring computer or the computer-readable memory of other programmable data processing device with ad hoc fashion work, the instruction that makes to be stored in this computer-readable memory produces the manufacture that comprises command device, and this command device is realized the function of appointment in flow process of flow chart or a plurality of flow process and/or square frame of block diagram or a plurality of square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, make to carry out sequence of operations step to produce computer implemented processing on computer or other programmable devices, thereby the instruction of carrying out is provided for realizing the step of the function of appointment in flow process of flow chart or a plurality of flow process and/or square frame of block diagram or a plurality of square frame on computer or other programmable devices.
Finally, also it should be noted that, in this article, relational terms such as the first and second grades is only used for an entity or operation to separate with another entity or operating space, and not necessarily requires or imply and between these entities or operation, have the relation of any this reality or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thereby the process, method, commodity or the equipment that make to comprise a series of key elements not only comprise those key elements, but also comprise other key elements of clearly not listing, or be also included as the intrinsic key element of this process, method, commodity or equipment.The in the situation that of more restrictions not, the key element being limited by statement " comprising ... ", and be not precluded within process, method, commodity or the equipment that comprises described key element and also have other identical element.
A kind of flow control methods and the device that above the application are provided, be described in detail, applied specific case herein the application's principle and execution mode are set forth, the explanation of above embodiment is just for helping to understand the application's method and core concept thereof; Meanwhile, for one of ordinary skill in the art, the thought according to the application, all will change in specific embodiments and applications, and in sum, this description should not be construed as the restriction to the application.

Claims (12)

1. a flow control methods, is characterized in that, comprising:
Receive flow control request, wherein, described flow control request comprises first-class control main body;
Obtain the configuration information of described first-class control main body, wherein, described configuration information comprises the requesting threshold of described first-class control main body;
For all kinds of business demands, by card i/f, call business plug-in unit corresponding to described first-class control main body, detect described first-class control main body and whether meet such business demand, wherein, described business plug-in unit is used for preserving business demand strategy;
Meeting under the prerequisite of all kinds of business demands, when the current accessed amount of described first-class control main body is less than described requesting threshold, current accessed amount is being added and returns in the lump successfully sign;
When not meeting business demand, or, when the current accessed amount of described first-class control main body is more than or equal to described requesting threshold, return to unsuccessfully sign.
2. method according to claim 1, is characterized in that, in described flow control request, also comprises Flow Control strategy,
Described current accessed amount also comprises after being more than or equal to described requesting threshold:
Flow Control strategy in flow control request is judged;
When Flow Control strategy is refusal, return to unsuccessfully sign;
When Flow Control strategy is when switching, be switched to the second Flow Control main body and obtain the configuration information of described the second Flow Control main body.
3. method according to claim 2, is characterized in that, also comprises the classification of first-class control main body in described configuration information, in described flow control request, also comprises switching threshold;
The described step that is switched to the second Flow Control main body comprises:
In the configuration information of query caching, under the classification of described first-class control main body, whether there is the second Flow Control main body;
If there is not described the second Flow Control main body, handoff failure, returns to unsuccessfully sign;
If there is described the second Flow Control main body, detect switching times and whether be less than switching threshold;
If switching times is not less than switching threshold, handoff failure, returns to unsuccessfully sign;
If switching times is less than switching threshold, chooses at random the second Flow Control main body under the classification of a described first-class control main body and carry out and switch.
4. method according to claim 1, is characterized in that, described meeting under the prerequisite of all kinds of business demands, when current accessed amount is less than described requesting threshold, current accessed amount is added and returns in the lump successfully sign, comprising:
Meeting under the prerequisite of all kinds of business demands, when requesting threshold is greater than 0, from buffer memory, obtain current accessed amount;
Detect current accessed amount and whether be less than described requesting threshold;
When current accessed amount is less than described requesting threshold, current accessed amount is added to one, and be updated in buffer memory;
Return to successfully sign.
5. method according to claim 1, is characterized in that, also comprises flow method for releasing:
Receive flow releasing request, wherein, described flow releasing request comprises first-class control main body;
Obtain the configuration information of described first-class control main body, wherein, described configuration information comprises requesting threshold;
When described requesting threshold is greater than 0, from buffer memory, obtain current accessed amount;
When described current accessed amount is greater than 0, current accessed amount is subtracted in the lump and is updated in buffer memory.
6. method according to claim 5, is characterized in that, also comprises the time-out time of described first-class control main body in described configuration information, and described method also comprises:
While not receiving flow releasing request in time-out time, empty described current accessed amount.
7. a flow control dress Ge, is characterized in that, comprising:
Receiver module, for receiving flow control request, wherein, described flow control request comprises first-class control main body;
Acquisition module, for obtaining the configuration information of described first-class control main body, wherein, described configuration information comprises the requesting threshold of described first-class control main body;
Call and detection module, for for all kinds of business demands, by card i/f, call business plug-in unit corresponding to described first-class control main body, detect described first-class control main body and whether meet such business demand, wherein, described business plug-in unit is used for preserving business demand strategy;
First returns to module, for meeting under the prerequisite of all kinds of business demands, when the current accessed amount of described first-class control main body is less than described requesting threshold, current accessed amount is added and returns in the lump successfully sign;
Second returns to module, for ought not meeting business demand, or, when the current accessed amount of described first-class control main body is more than or equal to described requesting threshold, return to unsuccessfully sign.
8. Zhuan Ge according to claim 7, is characterized in that, in described flow control request, also comprises Flow Control strategy, and described Zhuan Ge also comprises:
Strategy judge module, judges for the Flow Control strategy to flow control request;
Handover module, for when Flow Control strategy is when switching, is switched to the second Flow Control main body and obtains the configuration information of described the second Flow Control main body;
Described second returns to module, also for when Flow Control strategy is refusal, returns to unsuccessfully sign.
9. Zhuan Ge according to claim 8, is characterized in that, also comprises the classification of first-class control main body in described configuration information, in described flow control request, also comprises switching threshold;
Described handover module comprises:
Whether inquiry submodule, for the configuration information of query caching, there is the second Flow Control main body under the classification of described first-class control main body;
Described second returns to module, if also for not there is not described the second Flow Control main body, handoff failure, returns to unsuccessfully sign;
Threshold decision submodule, if for there being described the second Flow Control main body, detect switching times and whether be less than switching threshold;
Described second returns to module, if be also not less than switching threshold for switching times, handoff failure, returns to unsuccessfully sign;
Main body switching submodule, if be less than switching threshold for switching times, choose at random the second Flow Control main body under the classification of a described first-class control main body and carries out and switch.
10. Zhuan Ge according to claim 7, is characterized in that, described first returns to module, comprising:
Obtain visit capacity submodule, for meeting under the prerequisite of all kinds of business demands, when requesting threshold is greater than 0, from buffer memory, obtain current accessed amount;
Whether threshold test submodule, be less than described requesting threshold for detection of current accessed amount;
Increase visit capacity submodule, for when current accessed amount is less than described requesting threshold, current accessed amount is added to one, and be updated in buffer memory;
Return to submodule, for returning to successfully sign.
11. Zhuan Ge according to claim 7, is characterized in that, also comprise flow release module, comprising:
Receive submodule, for receiving flow releasing request, wherein, described flow releasing request comprises first-class control main body;
Obtain configuration information submodule, for obtaining the configuration information of described first-class control main body, wherein, described configuration information comprises requesting threshold;
Obtain visit capacity submodule, for when described requesting threshold is greater than 0, from buffer memory, obtain current accessed amount;
Reduce visit capacity submodule, for when described current accessed amount is greater than 0, current accessed amount is subtracted in the lump and is updated in buffer memory.
12. Zhuan Ge according to claim 11, is characterized in that, also comprise the time-out time of described first-class control main body in described configuration information, and described Zhuan Ge also comprises:
Empty visit capacity module, when not receiving flow releasing request in time-out time, empty described current accessed amount.
CN201210238787.6A 2012-07-10 2012-07-10 A kind of flow control methods and device Active CN103546388B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210238787.6A CN103546388B (en) 2012-07-10 2012-07-10 A kind of flow control methods and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210238787.6A CN103546388B (en) 2012-07-10 2012-07-10 A kind of flow control methods and device

Publications (2)

Publication Number Publication Date
CN103546388A true CN103546388A (en) 2014-01-29
CN103546388B CN103546388B (en) 2017-06-30

Family

ID=49969452

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210238787.6A Active CN103546388B (en) 2012-07-10 2012-07-10 A kind of flow control methods and device

Country Status (1)

Country Link
CN (1) CN103546388B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105389729A (en) * 2015-12-15 2016-03-09 中国建设银行股份有限公司 Precise control system and method for transaction flow
CN105578531A (en) * 2014-10-17 2016-05-11 中兴通讯股份有限公司 Multimedia messaging service gateway flow control method and apparatus thereof
CN105847169A (en) * 2015-01-13 2016-08-10 阿里巴巴集团控股有限公司 Method and device for traffic control
CN108512768A (en) * 2017-02-23 2018-09-07 苏宁云商集团股份有限公司 A kind of control method and device of visit capacity
CN109614425A (en) * 2018-09-25 2019-04-12 阿里巴巴集团控股有限公司 A kind of method and system for the business access amount adjusting database
CN109922043A (en) * 2019-01-22 2019-06-21 口碑(上海)信息技术有限公司 Control, acquisition methods and the device and electronic device of flow access right
CN111343240A (en) * 2020-02-12 2020-06-26 北京字节跳动网络技术有限公司 Service request processing method and device, electronic equipment and storage medium
CN111815466A (en) * 2020-07-15 2020-10-23 前海人寿保险股份有限公司 Transaction flow control method, device, equipment and readable storage medium
CN111817972A (en) * 2020-06-16 2020-10-23 上海中通吉网络技术有限公司 Flow limiting method for flow interface of logistics service system and related equipment
CN114745329A (en) * 2022-03-30 2022-07-12 青岛海尔科技有限公司 Flow control method and apparatus, storage medium, and electronic apparatus

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1477823A (en) * 2003-07-31 2004-02-25 CPU message flow control method of distributed exchange router system
US20100067430A1 (en) * 2007-05-21 2010-03-18 Fujitsu Limited Relay apparatus and relay method
CN102256313A (en) * 2010-05-21 2011-11-23 鼎桥通信技术有限公司 Method for controlling data domain service speed
CN102281150A (en) * 2010-06-08 2011-12-14 中兴通讯股份有限公司 Multi-module gateway and flow control method thereof
CN102479076A (en) * 2010-11-26 2012-05-30 金蝶软件(中国)有限公司 Method and device for recording audit log, and service system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1477823A (en) * 2003-07-31 2004-02-25 CPU message flow control method of distributed exchange router system
US20100067430A1 (en) * 2007-05-21 2010-03-18 Fujitsu Limited Relay apparatus and relay method
CN102256313A (en) * 2010-05-21 2011-11-23 鼎桥通信技术有限公司 Method for controlling data domain service speed
CN102281150A (en) * 2010-06-08 2011-12-14 中兴通讯股份有限公司 Multi-module gateway and flow control method thereof
CN102479076A (en) * 2010-11-26 2012-05-30 金蝶软件(中国)有限公司 Method and device for recording audit log, and service system

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105578531A (en) * 2014-10-17 2016-05-11 中兴通讯股份有限公司 Multimedia messaging service gateway flow control method and apparatus thereof
CN105578531B (en) * 2014-10-17 2020-01-03 中兴通讯股份有限公司 Multimedia message gateway flow control method and device
CN105847169A (en) * 2015-01-13 2016-08-10 阿里巴巴集团控股有限公司 Method and device for traffic control
CN105847169B (en) * 2015-01-13 2019-07-05 阿里巴巴集团控股有限公司 A kind of method and device for flow control
CN105389729A (en) * 2015-12-15 2016-03-09 中国建设银行股份有限公司 Precise control system and method for transaction flow
CN108512768B (en) * 2017-02-23 2021-12-10 苏宁易购集团股份有限公司 Access amount control method and device
CN108512768A (en) * 2017-02-23 2018-09-07 苏宁云商集团股份有限公司 A kind of control method and device of visit capacity
CN109614425A (en) * 2018-09-25 2019-04-12 阿里巴巴集团控股有限公司 A kind of method and system for the business access amount adjusting database
CN109614425B (en) * 2018-09-25 2023-04-11 创新先进技术有限公司 Method and system for adjusting service access volume of database
CN109922043A (en) * 2019-01-22 2019-06-21 口碑(上海)信息技术有限公司 Control, acquisition methods and the device and electronic device of flow access right
CN111343240A (en) * 2020-02-12 2020-06-26 北京字节跳动网络技术有限公司 Service request processing method and device, electronic equipment and storage medium
CN111343240B (en) * 2020-02-12 2022-08-16 北京字节跳动网络技术有限公司 Service request processing method and device, electronic equipment and storage medium
CN111817972A (en) * 2020-06-16 2020-10-23 上海中通吉网络技术有限公司 Flow limiting method for flow interface of logistics service system and related equipment
CN111817972B (en) * 2020-06-16 2023-08-11 上海中通吉网络技术有限公司 Flow limiting method and related equipment for flow interface of logistics service system
CN111815466A (en) * 2020-07-15 2020-10-23 前海人寿保险股份有限公司 Transaction flow control method, device, equipment and readable storage medium
CN114745329A (en) * 2022-03-30 2022-07-12 青岛海尔科技有限公司 Flow control method and apparatus, storage medium, and electronic apparatus
CN114745329B (en) * 2022-03-30 2024-03-22 青岛海尔科技有限公司 Flow control method and device, storage medium and electronic device

Also Published As

Publication number Publication date
CN103546388B (en) 2017-06-30

Similar Documents

Publication Publication Date Title
CN103546388A (en) Flow control method and flow control device
JP6860067B2 (en) Resource management systems, management equipment, methods and programs
CN102799485B (en) Historical data migration method and device
CN106656839A (en) Resource transfer method and apparatus
CN104065636B (en) Data processing method and system
CN106204217A (en) The methods, devices and systems of resource numerical value transfer, the method and apparatus of resource numerical value transfer request
CN110728519B (en) Processing method and device for repudiation task and server
CN111027975B (en) Network payment method, device, equipment and system
CN109003069A (en) A kind of resource backing method and device
CN107392582B (en) Method and device for realizing resource transfer and method and device for realizing collection and payment
CN109614263B (en) Disaster tolerance data processing method, device and system
CN114070847B (en) Method, device, equipment and storage medium for limiting current of server
CN102750187B (en) A kind of striding course exchange method and device
CN105354190A (en) Numerical information transfer method and apparatus
CN112950171A (en) Bank business processing system and method
CN105787791A (en) Service request processing method and apparatus
CN108932284B (en) General logic scheduling method, electronic device and readable storage medium
CN102346889B (en) POS (Point of Sale) terminal-based off-line transaction method, POS terminal-based off-line transaction system and related devices
CN110782310B (en) Method, device and system for asynchronously acquiring user attribute information from third-party platform
CN112488700B (en) Dual signature transaction account method and system for blockchain
CN112732413B (en) Exception handling method, exception handling device, computer equipment and computer readable storage medium
CN113055401B (en) Enterprise business authorization processing method and device
CN114205639B (en) Video processing method and device, electronic equipment and storage medium
CN117829939A (en) Method, device, equipment and storage medium for processing return request
CN106558155A (en) A kind of intelligent POS terminal of detection application program

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20191210

Address after: P.O. Box 31119, grand exhibition hall, hibiscus street, 802 West Bay Road, Grand Cayman, Cayman Islands

Patentee after: Innovative advanced technology Co., Ltd

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, Cayman Islands

Patentee before: Alibaba Group Holding Co., Ltd.