Summary of the invention
In view of this, main purpose of the present invention is to provide a kind of flow control methods that is used for pipeline distributing system, can not rely on the outside and carries out Flow-rate adjustment, and avoid system processor abnormality processing to occur.
For achieving the above object, technical scheme of the present invention is achieved in that
The invention discloses a kind of flow control methods that is used for pipeline distributing system, this method may further comprise the steps:
A. inquiry system processor state when default system mode polling cycle arrival judges whether the system processor when this system mode is inquired about transships, if overload, then execution in step b; Otherwise execution in step c;
Whether the system processor before b. judging during the primary system status poll is overload, if, the overload level of the system processor when then determining this system mode inquiry, and according to determined overload level adjustment interface overload Flow Control threshold values, otherwise calculate interface overload Flow Control threshold values; Type that inserts according to interface requests and flow and determined interface overload Flow Control threshold values allow or refuse the each access request of this system mode in polling cycle and insert then;
C. type and the pre-overload threshhold of flow and system that inserts according to interface requests allows or refuses the each access request access of this system mode in polling cycle.
Wherein, the method of described calculating interface overload Flow Control threshold values is: add up and preserve each system mode allows access in polling cycle access request flow, calculate each system mode of being preserved allows the access request traffic statistics value of access in polling cycle class mathematical expectation, as interface overload Flow Control threshold values.
The method of described adjustment interface overload Flow Control threshold values is:, then increase when front port overload Flow Control threshold values according to current overload level and default step-length when being high in overload level; , then reduce when front port overload Flow Control threshold values when low in overload level according to current overload level and default step-length.
Among the such scheme step b, described type and the flow that inserts according to interface requests and interface overload Flow Control threshold values allows or refusal inserts request and inserts and specifically may further comprise the steps:
B1. judge that this time inserts request flow weighted value and this interface and whether transship the Flow Control threshold values greater than interface when the sum of access total flow of front port, if greater than, execution in step b2 then; Otherwise execution in step b3;
Whether the priority of b2. judging this access request type is the predetermined priority-level that allows access, if then execution in step b3 inserts otherwise refuse this time access request;
B3. allow this time access request to insert, and the front port of working as of this time access request traffic statistics to this interface inserted in the total flow.
Among the step b3, describedly will insert the request traffic statistics and to the method that has inserted total flow when front port of this interface be: weight and this time access that will predefined described this interface ask flow to multiply each other, and, stack result has been inserted total flow as this new interface when front port with having inserted total flow and superpose when front port of multiplied result and described this interface.
Before execution in step c, this method further comprises:
When the system processor when preceding primary system status poll is the nonoverload state, whether occur refusing to insert the situation that request inserts during the primary system status poll before judging, if then the pre-overload threshhold of system is adjusted; Otherwise the pre-overload threshhold of system is not adjusted.
Among the such scheme step c, described type and the pre-overload threshhold of flow and system according to the interface requests access allows or refuses to insert and ask access specifically to may further comprise the steps:
C1. judge that this time inserts request flow weighted value and current system has inserted the total flow sum whether greater than the pre-overload threshhold of system, if, execution in step c2 then; If not, execution in step c3 then;
C2. judge that whether priority that this time inserts request type be the predetermined priority-level that inserts of allowing, if, execution in step c3 then; Otherwise refuse this time and insert request;
C3. allow this time to insert request and insert, and this time inserted the request traffic statistics insert in the total flow to current system.
Among the step c3, described will the access asks traffic statistics to the method that current system has inserted total flow to be: weight and this time access request flow of predefined described this interface are multiplied each other, and multiplied result and described current system have been inserted total flow superpose, stack result has been inserted total flow as new current system.
By such scheme as can be seen, key of the present invention is: system processor is every default system mode polling cycle inquiry primary system processor state, judge whether system processor transships, if overload, the state of the system processor during then according to preceding primary system status poll is determined interface overload Flow Control threshold values, allows according to the type that inserts request and flow and interface overload Flow Control threshold values in polling cycle or refuses this time and insert request and insert in each system mode then; If nonoverload then allows or refuses this time access request access at type and the pre-overload threshhold of flow and system that each system mode inserted according to interface requests in polling cycle.
Therefore, this flow control methods provided by the present invention need not to transmit overload messages to the outside managing signaling that sends of network entity, can not rely on the outside and carries out Flow-rate adjustment, realizes the function of self-protection.In addition, the present invention has carried out classification to the processor overload situations of the network entity in the communication network, can make the network entity processor can farthest utilize system resource, and avoid system processor to be overload up to the scope of system's cisco unity malfunction simultaneously.
Embodiment
The present invention is further described in more detail below in conjunction with drawings and the specific embodiments.
Basic principle of the present invention is: system processor is every default system mode polling cycle inquiry primary system processor state, judge whether system processor transships, if overload, the state of the system processor during then according to preceding primary system status poll is determined interface overload Flow Control threshold values, allows according to the type that inserts request and flow and interface overload Flow Control threshold values in polling cycle or refuses this time and insert request and insert in each system mode then; If nonoverload then is provided with system's nonoverload Flow Control, type and the pre-overload threshhold of flow and system that inserts according to interface requests in polling cycle in each system mode allows or refuses this time access request access then.
Describe the implementation procedure that the present invention is used for the flow control methods of pipeline distributing system below in detail.
In general, before carrying out flow control, need at first set the interface that needs flow control on the communication network entity.If it is influential that the request flow that certain external interface flows into is handled the load of system processor, then need this external interface is carried out flow control.
The present invention is provided with system mode polling cycle, like this, system will every system mode polling cycle to the status poll of system processor once, and judge whether system processor transships, and the overload level when determining overload.Can carry out flow control according to the overload situations that is inquired then,, be called for short the overload Flow Control if i.e.: system processor overload is then transshipped flow control; Otherwise carry out the nonoverload flow control, be called for short the nonoverload Flow Control.
The basic principle of overload flow control is: in system mode in polling cycle, system adds up respectively the flow of the access request of each external interface, judge whether the request of access satisfies the maximum access flow of interface permission or the condition restriction of priority-level, if satisfy, then allow this access request to insert; Otherwise refusing this access request inserts.
The basic principle of overload flow control is: in system mode in polling cycle, system adds up the flow of the access request of all external interfaces, judge whether the request of access satisfies the maximum access flow of system's permission or the condition restriction of priority-level, if satisfy, then allow this access request to insert; Otherwise refusing this access request inserts.
Fig. 1 is used for the realization flow figure of the flow control methods of pipeline distributing system for the present invention.As shown in Figure 1, the detailed process of such scheme may further comprise the steps:
Step 101~102, the current state of inquiry system processor judge whether current system processor transships, if overload then continues execution in step 103; Otherwise continue execution in step 114.
Step 103, system judge whether the interface that need carry out flow control is overload Flow Control state, if, execution in step 104; Otherwise execution in step 105.
In the present embodiment, in order to adjust interface overload Flow Control threshold values according to the system processor overload in the adjacent system status poll cycle, when promptly the system processor when this system mode inquiry is overload, if the system processor during preceding primary system status poll also is an overload, then need to adjust interface overload Flow Control threshold values, otherwise directly calculate interface overload Flow Control threshold values, be provided with the overload Flow Control sign of system.When system start-up, the overload Flow Control sign of current system can be initialized as nonoverload Flow Control state; When system was in the nonoverload Flow Control, if the overload Flow Control of current system is masked as overload Flow Control state, then the overload Flow Control sign of current system was set to nonoverload Flow Control state; When overload appearred in system processor, if the overload Flow Control of current system is masked as nonoverload Flow Control state, then it was set to transship the Flow Control state.Like this, just can determine whether to adjust interface overload Flow Control threshold values according to overload Flow Control sign.
Step 104, the overload Flow Control that system is set are masked as overload Flow Control state, and calculate the interface overload Flow Control threshold values of this interface.
The present invention guarantees system's operate as normal or guarantees that system overload can further not worsen by interface overload Flow Control threshold values is set.Each interface all has an interface overload Flow Control threshold values when being in overload flow control state, the flow that each interface has inserted in polling cycle in system mode can not be greater than the interface overload Flow Control threshold values of this interface.That is to say that interface overload Flow Control threshold values is that to be used for the access request flow of each interface in the restriction system status poll cycle peaked.
Interface overload Flow Control threshold values can obtain according to the historical flow rate calculation that each interface has inserted.System processor is added up respectively the flow that each interface requests inserts in polling cycle in system mode, and the flow value that statistics obtains preserved, only suppose to preserve wherein n numerical value of close current time, and the flow number that n the interface requests of preserving inserted is kept at Ci respectively, 1~Ci, among the n, wherein i is an interface index.Like this, when system overload, after each interface is received the notice of the current system processor overload that system sends, each interface calculates the interface overload Flow Control threshold values of this interface according to add up n the numerical value that obtains, if Mi is the interface overload Flow Control threshold values of i interface, and start the overload flow control, i.e. only allow size to insert i interface in the unit interval for the flow of Mi.And when inquiring system processor when no longer transshipping, system's notification interface once more removes flow control, i.e. only allow the restriction of i interface Mi flow access in the deactivation system status poll cycle.The computational methods of interface overload Flow Control threshold value Mi are:
Mi=(Ci,1×1+Ci,2×2+......Ci,n×n)/(1+2+......+n)。
Top formula is similar a bit to the formula of computational mathematics expectation, therefore, this result of calculation is called each system mode allows the access request traffic statistics value of access in polling cycle class mathematical expectation.
Step 105, determine the overload level of current system processor, and adjust the interface overload Flow Control threshold values of this interface according to determined overload level.
System processor can according to own resource utilize situation to judge self whether to transship, still, in order to make full use of system resource and to avoid system processor seriously to transship, the present invention carries out classification to the overload situations of system processor.Present embodiment is to determine overload level according to the overload situations of system processor.Such as, present embodiment is divided into level Four according to the system processor overload situations with overload level: one-level, secondary, three grades, level Four.When system processor is in overload during the initial stage, system resource or disposal ability still have certain free time, can be set to one-level, secondary overload according to the system processor state of overload situations this moment.When system processor is in overload during the later stage, the inlet flow rate of system takies too much, causes system processing power to descend, and system resource also exhausts substantially, at this moment, can be set to three grades, level Four according to overload situations system processor state at this moment and transship.
For example, through test, when the occupancy of system processor greater than 95% the time, system handles very slow to new access flow response, and can cause abandoning of components of system as directed inside story, at this time system processor has been in serious overload.One of purpose of the present invention will avoid occurring the situation of above-mentioned serious overload exactly.Simultaneously, can test out, when the occupancy of system processor less than 90% the time, system processor can farthest handle all access flows and the unusual of message can not appear abandoning in internal system.Based on above-mentioned test result: can define four overload levels, specific as follows:
The one-level overload: the occupancy of system processor is more than or equal to 80% and less than 85%;
The secondary overload: the occupancy of system processor is more than or equal to 85% and less than 90%;
Three grades of overloads: the occupancy of system processor is more than or equal to 90% and less than 95%;
The level Four overload: the occupancy of system processor is more than or equal to 95%.
Correspondingly, interface overload Flow Control threshold values is not a fixing value, can adjust according to the overload level of system processor.After each interface module entered overload flow control state, every system mode polling cycle inquiry primary system processor state, if system processor is one-level or secondary overload, interface overload Flow Control threshold values can increase gradually.Such as M=M+N, wherein, M is an interface overload Flow Control threshold values, N is the step-length that M increases, step-length N can be provided with by system testing and in conjunction with weight, and the step-length of adjusting M during the firsts and seconds overload can be different, and the step-length the when step-length when transshipping such as one-level can be transshipped than secondary is big.If system processor is in three grades or level Four overload, then can adjust M=M-N, wherein, M>N.Like this, when bigger access request flow inserts, both can guarantee that system processor can fluctuate more satisfactoryly, can utilize the surplus resources of overload back system processor again fully between secondary overload and three grades of overloads.
Step 107, respectively each interface is initialized as zero when front port has inserted total flow, the limit of system exhales sign to be set to not limit the state of exhaling.
Present embodiment is that system is provided with a limit and exhales sign, after restarting in each system mode polling cycle, when transshipping Flow Control all are initialized as in zero when front port has inserted total flow, also the limit of system exhales sign to be set to not limit the state of exhaling.
Step 108~109, judge whether this interface has the request of inserting, if do not have, then execution in step 113; If have, then judge when front port has inserted total flow and this time and insert request flow weighted value sum and whether transship the Flow Control threshold values, if then execution in step 110 greater than the interface of this interface; Otherwise execution in step 112.
Wherein, inserting request flow weighted value is exactly to insert the product of the weight of request flow and this interface.Because each external interface request access flow may be different to the influence of system processor, therefore, the weight of each interface requests access flow need be set.Can determine the weight of the request access flow of interface by system testing.
During without any access flow, statistical system processor occupancy is A such as, system; When independent test interface 1, the per second request of interface 1 is 10 times, and the occupancy of statistical system processor is B1; When independent test interface 2, the per second request of interface 2 is 10 times, and the occupancy of statistical system processor is B2; When independent test interface 3, the per second request of interface 3 is 10 times, and the occupancy of statistical system processor is B3; If the weight of interface 1 is (B1-A)/(B1-A)=1, then the weight of interface 2 and interface 3 is respectively: (B2-A)/(B1-A) and (B3-A)/(B1-A).
Step 110~111, judge that whether priority that this time inserts the type of request be the predetermined priority-level that inserts of allowing, if then execution in step 112; Otherwise refuse this time and insert the request access, continue execution in step 113.
In the access request of the external interface of communication network entity, it is extremely important to exist certain to insert request, and therefore, this communication network entity can not be refused this time and insert request, even the processor of this communication network entity has transshipped, also should allow this time to insert request and insert.Therefore, need set in advance priority-level for different access request types, and which priority-level is set for high, which priority-level is low.When to insert Request Priority be high, then allow the access request of this high priority to insert.Such as, the priority-level of the access request of call alerts telephone number 110 is very high, must connect this access request and continuation and handle.
Step 112, allow this time to insert request to insert, and the traffic statistics that this time inserted request have inserted in the total flow to this interface when front port, that is: this time inserted the flow of request and the multiplied by weight of this interface, and with having inserted total flow and superposeed when front port of this interface, stack result has been inserted total flow as this new interface when front port; Continue execution in step 113 then.
Step 113, judge whether to reach system mode polling cycle, if return step 101; Otherwise return step 108.
Above-mentioned steps 103~113 is exactly the process of foregoing overload flow control.
Step 114~116, the system overload Flow Control is set is masked as nonoverload Flow Control state; Judge that limit exhales sign whether to exceed and exhale state, if, the pre-overload threshhold of Adjustment System then, otherwise the pre-overload threshhold of Adjustment System not.
The present invention is provided with the pre-overloading threshold of system, in case the locking system processor in course of normal operation since Business Stream increase sharply suddenly and cause that system processor is instantaneous to be reached at full capacity.The pre-overloading threshold of system is for whole system, the flow control when being applicable to system's operate as normal.The pre-overload threshhold of system can obtain an initial value by system testing, can adjust according to the actual treatment situation of system later on.Usually, if in the adjacent system status poll cycle, system is double to enter nonoverload Flow Control state, and has occurred refusal during preceding primary system status poll and insert the situation that request inserts, then the pre-overload threshhold of system just may be provided with less than normally, should adjust it.
Present embodiment is to judge whether the pre-overload threshhold of Adjustment System by the limit that system the is set state of exhaling.When carrying out the nonoverload Flow Control, when current system had been inserted total flow and is initialized as zero, also the limit of system exhaled sign to be set to not limit the state of exhaling; When carrying out the nonoverload Flow Control, if inserting request, certain is rejected, then the limit of system is exhaled sign setting to exceed and exhale state.And when transshipping Flow Control, when front port has inserted total flow when being initialized as zero, also the limit of system exhales sign to be set to not limit the state of exhaling with all.If during the nonoverload Flow Control, system's limit is exhaled sign to exceed and is exhaled state, then the pre-overload threshhold of system is adjusted.
Wherein, carry out amplitude that the pre-overload threshhold of system adjusts for more by a small margin, such as being the pre-overload threshhold of mode Adjustment System that adjusting range increases progressively gradually with 3% of the pre-overload threshhold of system.But be not suitable for the pre-overload threshhold of system is adjusted to above-mentioned three grades more than the overload.
Step 117, the current total flow that inserted of initialization system are zero, and limit exhales sign to be set to not limit the state of exhaling.
Step 118~119, judged whether to insert request, if do not have, then execution in step 123; If have, judge that then current system has inserted total flow and this time inserts request flow weighted value sum whether greater than the pre-overload threshhold of system, if then execution in step 120; Otherwise execution in step 122.
Whether step 120~121, the priority-level of judging this time request access style are the predetermined high priority level that inserts of allowing, if then execution in step 122, insert the request access otherwise refuse this time, and limit is set exhales sign to exceed and exhale state, continue execution in step 123.
Step 122, allow this time to insert request to insert, and this time inserted the traffic statistics of asking inserted in the total flow to current system, that is: this time inserted the flow of request and the multiplied by weight of this interface, and inserted total flow with current system and superpose, stack result has been inserted total flow as new current system; Continue execution in step 123.
Step 123, judge whether to reach system mode polling cycle, if return step 101; Otherwise return step 118.
Above-mentioned steps 114~123 is exactly the process of nonoverload flow control noted earlier.
By such scheme as can be seen: flow control methods provided by the invention can not rely on the outside and carries out flow control, and both can avoid system processor seriously to transship, and abnormality processing occurs, can farthest utilize system resource again.
In a word, the above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being done, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.