CN105827543B - A kind of flow control methods and electronic equipment - Google Patents
A kind of flow control methods and electronic equipment Download PDFInfo
- Publication number
- CN105827543B CN105827543B CN201510000992.2A CN201510000992A CN105827543B CN 105827543 B CN105827543 B CN 105827543B CN 201510000992 A CN201510000992 A CN 201510000992A CN 105827543 B CN105827543 B CN 105827543B
- Authority
- CN
- China
- Prior art keywords
- quota
- update
- updating
- queue
- offset
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 27
- 230000005540 biological transmission Effects 0.000 claims description 20
- 230000000977 initiatory effect Effects 0.000 claims description 6
- 238000010586 diagram Methods 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 1
- 238000013523 data management Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
- Computer And Data Communications (AREA)
Abstract
The embodiment of the invention discloses a kind of flow control methods and electronic equipments, when flow, which consumes, meets the first preset condition, initiate quota and update request;It receives the quota and updates request, rule is updated according to pre-stored quota parameter, quota update condition and quota, update quota corresponding with the quota update condition and update queue, obtain updated quota and update queue;The quota data in queue is updated according to the updated quota, feedback quota updates response.
Description
Technical Field
The present invention relates to data management technologies, and in particular, to a flow control method and an electronic device.
Background
At present, the following two methods exist for controlling the flow rate: the first is off-line control, that is, the flow rate limit in unit time is not controlled, but transmission data is analyzed through history records such as a transmission log of flow transmission equipment at regular intervals, whether flow rate needs to be controlled or not is decided, flow rate quota management is realized by means of stopping flow rate transmission and the like when control conditions are found to be met, and flow rate transmission is normally executed in the decision process; the second category is real-time control, namely, the real-time control of the flow rate limit is realized by controlling the available flow rate quota in unit time. However, in the off-line control, the flow rate limit is not controlled timely and accurately; similarly, in real-time control, the difficulty of controlling the granularity of the flow quota is high, which causes the problems of untimely and inaccurate control of the flow quota or too frequent quota control.
In summary, the flow control method is not reasonable enough, so that the flow quota control efficiency is low, and the quality and efficiency of flow transmission are seriously affected.
Disclosure of Invention
In view of this, embodiments of the present invention are intended to provide a flow control method and an electronic device, which can effectively solve the problem of low flow quota control efficiency.
In order to achieve the above purpose, the technical solution of the embodiment of the present invention is realized as follows:
the embodiment of the invention provides a flow control method, which comprises the following steps:
when the flow consumption meets a first preset condition, initiating a quota updating request;
receiving the quota update request, and updating a quota update queue corresponding to a quota update condition according to a prestored quota parameter, a quota update condition and a quota update rule to obtain an updated quota update queue;
and feeding back a quota update response according to the quota data in the updated quota update queue.
In the above scheme, the quota update request carries current traffic quota information;
the receiving the quota update request, updating a quota update queue corresponding to a quota update condition according to a prestored quota parameter, a quota update condition, and a quota update rule, and obtaining an updated quota update queue, includes:
receiving and analyzing the quota updating request to obtain the flow quota information;
when the flow quota information is determined to meet the quota updating condition according to the prestored quota parameter, writing an updating notice into a quota updating queue corresponding to the quota updating condition;
receiving the update notification, and reading quota data from the quota update queue;
and updating the quota data according to a preset quota updating rule, and writing the updated quota data into the quota updating queue to obtain an updated quota updating queue.
In the above scheme, the method further comprises:
during waiting for the feedback quota update response, the traffic transmission is normally executed until the quota forward offset is completely consumed and then enters a full waiting state.
In the above scheme, the method further comprises: and when the duration of the full waiting state exceeds the quota occupying time, reinitiating the quota updating request.
In the above scheme, the method further comprises:
correcting a quota consumption initial value according to the fed back quota update response; and when the quota offset is zero and the corrected quota consumption initial value is greater than or equal to the available quota, ending the flow transmission.
The embodiment of the invention also provides electronic equipment, which comprises an execution controller, a modulator and a quota calculator; wherein,
the execution controller is used for initiating a quota updating request when the flow consumption meets a first preset condition;
the modulator is configured to receive the quota update request, and update a quota update queue corresponding to a quota update condition according to a prestored quota parameter, a quota update condition, and a quota update rule to obtain an updated quota update queue;
and the quota calculator is used for feeding back a quota update response to the execution controller according to the quota data in the updated quota update queue.
In the above scheme, the quota update request carries current traffic quota information;
the regulator comprises a quota back calculator and a parameter adjusting controller; wherein,
the quota back-calculator is used for receiving and analyzing the quota update request to obtain the flow quota information; when the flow quota information is determined to meet the quota updating condition according to the prestored quota parameter, writing an updating notice into a quota updating queue corresponding to the quota updating condition;
the parameter adjustment controller is configured to receive the update notification, and read quota data from the quota update queue; and updating the quota data according to a preset quota updating rule, and writing the updated quota data into the quota updating queue to obtain an updated quota updating queue.
In the above scheme, the execution controller is in a half-waiting state during waiting for the feedback quota update response, and enters a full-waiting state after the quota forward offset is consumed.
In the foregoing solution, the execution controller is further configured to reinitiate the quota update request when the duration of the full wait state exceeds the quota occupying time.
In the above scheme, the execution controller is further configured to correct a quota consumption initial value according to the fed back quota update response; and when the quota offset is zero and the corrected quota consumption initial value is greater than or equal to the available quota, ending the flow transmission.
According to the flow control method and the electronic device provided by the embodiment of the invention, when the flow consumption meets the first preset condition, a quota update request is initiated; receiving the quota update request, and updating a quota update queue corresponding to a quota update condition according to a prestored quota parameter, a quota update condition and a quota update rule to obtain an updated quota update queue; and feeding back a quota update response according to the quota data in the updated quota update queue. Therefore, the problem of low flow quota control efficiency can be effectively solved, the flow transmission quality and efficiency are improved, and the user experience is improved.
Drawings
Fig. 1 is a first schematic flow chart illustrating an implementation of a flow control method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of an implementation flow of updating a quota update queue according to an embodiment of the present invention;
fig. 3 is a schematic flow chart illustrating an implementation of a flow control method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a structure of an electronic device according to an embodiment of the invention;
fig. 5 is a schematic structural diagram of a regulator in an electronic device according to an embodiment of the present invention.
Detailed Description
In the embodiment of the invention, when the flow consumption meets a first preset condition, a quota updating request is initiated; receiving the quota update request, and updating a quota update queue corresponding to a quota update condition according to a prestored quota parameter, a quota update condition and a quota update rule to obtain an updated quota update queue; and feeding back a quota update response according to the quota data in the updated quota update queue.
The present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
Example one
Fig. 1 is a first schematic flow chart illustrating an implementation of a flow control method according to an embodiment of the present invention, as shown in fig. 1, the flow control method according to the embodiment of the present invention includes:
step S101: when the flow consumption meets a first preset condition, initiating a quota updating request;
wherein, the quota update request carries current traffic quota information.
Here, the first preset condition is that the traffic consumption is equal to or greater than the quota offset lower limit Δ t- Δ t 1. The current traffic quota information comprises traffic consumption, wherein the traffic consumption comprises quota delta t consumption, quota positive offset delta t2 consumption, quota negative offset delta t1 consumption and the like; the current traffic quota information may further include information such as an update timestamp and a quota occupancy time.
Specifically, the execution controller monitors traffic transmission in real time, and when traffic consumption is greater than or equal to the quota offset lower limit Δ t- Δ t1, the execution controller initiates a quota update request to the quota recalculator.
Step S102: receiving the quota update request, and updating a quota update queue corresponding to a quota update condition according to a prestored quota parameter, a quota update condition and a quota update rule to obtain an updated quota update queue;
the prestored quota parameters include quota negative deviation delta t1, quota positive deviation delta t2, quota lower limit t1, quota upper limit t2, available quota t, deviation t3 of available quota t, and minimum quota deviation t3 of available quota tmin。
Specifically, the regulator receives the quota update request, and updates a quota update queue corresponding to the quota update condition according to the stored quota parameters, quota update conditions, and quota update rules, to obtain an updated quota update queue; the regulator comprises a parameter adjusting controller and a quota back-calculating device; the parameter adjustment controller may include a quota threshold controller, an available quota offset controller, and a quota offset controller.
Fig. 2 is a schematic view of an implementation flow of updating a quota update queue according to an embodiment of the present invention, in an embodiment, as shown in fig. 2, the receiving, by the director, the quota update request, and updating, according to the stored quota parameter, quota update condition, and quota update rule, a quota update queue corresponding to the quota update condition, to obtain an updated quota update queue includes:
step S1021: receiving and analyzing the quota updating request to obtain the flow quota information;
specifically, after receiving the quota update request, the quota back-calculator analyzes the quota update request to obtain the traffic quota information.
Step S1022: when the flow quota information is determined to meet the quota updating condition according to the prestored quota parameter, writing an updating notice into a quota updating queue corresponding to the quota updating condition;
specifically, when determining that the flow quota information meets the quota update condition according to the pre-stored quota parameter, the quota back-calculator writes an update notification into a quota update queue corresponding to the quota update condition, which includes the following four cases:
A. when the flow quota information is determined to meet a first sub quota updating condition, namely the available quota t-quota delta t consumption-quota forward offset delta t2 consumption is less than the offset t3 of the available quota t, the quota forward offset delta t2 and the quota upper limit t2, or the quota is authenticated for the first time, the quota back-calculator writes an available quota offset updating notice into an available quota offset updating queue corresponding to the first sub quota updating condition;
B. when the flow quota information is determined to meet a second sub-quota updating condition, namely the offset t3 of the available quota t is less than a quota positive offset delta t2+ a quota upper limit t 2-a quota negative offset delta t1 is consumed, the quota back-calculator writes a threshold updating notice into a quota threshold updating queue corresponding to the second sub-quota updating condition;
C. when the flow quota information is determined to meet a third sub-quota update condition, namely available quota t-quota upper limit t 2-quota forward offset delta t 2-available quota offset t3 is less than quota forward offset delta t 2-quota forward offset delta t2 is consumed, the quota back calculator writes an offset update notification into a quota offset update queue corresponding to the third sub-quota update condition;
D. when the flow quota information is determined to meet the fourth sub quota updating condition, the available quota t-quotaDelta t consumption-quota Forward offset Delta t2 consumption is less than or equal to 0, or there is a minimum quota offset t3 that presets available quota tminAnd quota Δ t consumption-quota forward offset Δ t2 consumption is less than or equal to minimum quota offset t3 of available quota tminAnd if so, writing a zero quota update notification into a quota update notification queue corresponding to the fourth sub-quota update condition by the quota back-calculator.
It should be added that, when it is determined that the quota update condition is any one of the conditions a to C, the quota back-calculator writes the update notification into the quota update queue corresponding to the quota update condition, and also writes the update notification to be migrated into the quota update notification queue.
Steps S1023 to S1024: receiving the update notification, and reading quota data from the quota update queue; and updating the quota data according to a preset quota updating rule, and writing the updated quota data into the quota updating queue to obtain an updated quota updating queue.
Specifically, when it is determined in step S1022 as the case a, a quota threshold controller in the parameter adjustment controller receives the update notification, and reads quota data from the quota update queue; further, updating the quota data according to a preset quota update rule, and writing the updated quota data into the quota update queue to obtain an updated quota update queue, including: when the quota update is a non-first authentication notification and the available quota t-quota Δ t consumption-quota forward offset Δ t2 consumption is less than the quota upper limit t2, updating the quota data, namely the offset t3 of the available quota t is 0; otherwise, the offset t3 of the available quota t is equal to the quota positive offset Δ t2+ the quota negative offset Δ t1 — the quota negative offset Δ t1 is consumed, and the updated quota data is written into the quota update queue to obtain the updated quota update queue.
It should be noted that, when the quota update is the first authentication notification, the offset t3 of the available quota t may be assigned according to the available quota offset initial movement rule to obtain quota data after quota update, and the updated quota data is written into the quota update queue to obtain an updated quota update queue.
Specifically, when it is determined in step S1022 as the case B, the available quota offset controller in the parameter adjustment controller receives the update notification, and reads quota data from the quota update queue; further, updating the quota data according to a preset quota update rule, and writing the updated quota data into the quota update queue to obtain an updated quota update queue, including: 1) when quota update is not the first authentication notification, the offset t3 of the available quota t is equal to 0, and the available quota t-quota Δ t consumption-quota forward offset Δ t2 consumption is more than or equal to 0, the quota data is updated, namely the quota lower limit t1 is equal to 0, the quota upper limit t2 is the available quota t-quota Δ t consumption-quota forward offset Δ t2 consumption; 2) when offset t3 of available credit t is 0 and available credit t-quota Δ t consumption-quota forward offset Δ t2 consumption < 0, updating the quota data, that is, quota upper limit t2 is 0 and quota lower limit t1 is available credit t-quota Δ t consumption-quota forward offset Δ t2 consumption; 3) when the offset t3 of the available credit t is greater than 0, the quota data is updated, that is, the quota lower limit t1 is equal to the quota positive offset Δ t2+ the quota negative offset Δ t 1-the quota positive offset Δ t2 consumes-the quota negative offset Δ t1 consumes, and the quota upper limit t2 is equal to the quota lower limit t1+ the available credit t-the quota Δ t consumes-the quota positive offset Δ t2 consumes-the offset t3 of the available credit t. Further, the updated quota data is written into the quota update queue, so that an updated quota update queue is obtained.
It should be noted that, when the quota update is the first authentication notification, the quota lower limit t1 and the quota upper limit t2 may be assigned according to the quota threshold initial movement rule to obtain quota data after the quota update, and the updated quota data is written into the quota update queue to obtain the updated quota update queue.
Specifically, when it is determined in step S1022 to be the case C, the quota offset controller in the parameter adjustment controller receives the update notification, and reads quota data from the quota update queue; further, updating the quota data according to a preset quota update rule, and writing the updated quota data into the quota update queue to obtain an updated quota update queue, including: 1) when the quota is updated to be the non-initial authentication notification and the quota upper limit t2 is 0 or the quota lower limit t1 is 0, updating the quota data, that is, the quota negative offset Δ t1 is the quota positive offset Δ t2 is 0; 2) when quota lower limit t1 > offset t3 of available quota t is 0, updating quota data, that is, quota positive offset Δ t2 is available quota t-quota upper limit t 2-quota Δ t consumption-quota positive offset Δ t2 consumption, quota negative offset Δ t1 is quota positive offset Δ t 2-quota positive offset Δ t2 consumption; 3) when offset t3 of available credit t is greater than 0, the quota data is updated, that is, quota positive offset Δ t2 is quota upper limit t 2-quota Δ t consumption-quota positive offset Δ t2 consumption-offset t3 of available credit t, quota negative offset Δ t1 is latest quota positive offset Δ t 2-quota positive offset Δ t2 consumption. Further, the updated quota data is written into the quota update queue, so that an updated quota update queue is obtained.
It should be noted that, when the quota update is the first authentication notification, the quota negative offset Δ t1 and the quota positive offset Δ t2 may be assigned according to the quota offset initial movement rule to obtain quota data after quota update, and the updated quota data is written into the quota update queue to obtain an updated quota update queue.
Step S103: and feeding back a quota update response according to the quota data in the updated quota update queue.
Specifically, the quota calculation controller obtains an updated quota update queue from the parameter adjustment controller, and feeds a quota update response back to the execution controller according to quota data in the updated quota update queue.
Here, the execution controller is in a half-wait state during waiting for the feedback quota update response, and traffic transmission is normally executed until the quota forward offset Δ t2 is consumed and then enters a full-wait state. Further, the execution controller re-initiates the quota update request when the duration of the full wait state exceeds the quota utilization time.
Therefore, the flow control method provided by the embodiment of the invention can effectively solve the problem of low flow quota control efficiency, thereby improving the flow transmission quality and efficiency and improving the user experience.
Example two
Fig. 3 is a schematic diagram of a second implementation flow of the flow control method according to the embodiment of the present invention, and as shown in fig. 3, the flow control method according to the embodiment of the present invention includes:
step S101: when the flow consumption meets a first preset condition, initiating a quota updating request, wherein the quota updating request carries current flow quota information;
step S102: receiving the quota update request, and updating a quota update queue corresponding to a quota update condition according to a prestored quota parameter, a quota update condition and a quota update rule to obtain an updated quota update queue;
step S103: feeding back a quota update response according to the quota data in the updated quota update queue;
steps S101 to S103 in the second embodiment of the present invention may respectively refer to steps S101 to S103 in the first embodiment, and for brevity, are not described herein again.
Steps S201 to S202: correcting a quota consumption initial value according to the fed back quota update response; and when the quota offset is zero and the corrected quota consumption initial value is greater than or equal to the available quota, ending the flow transmission.
Specifically, the execution controller receives a quota update response fed back from the quota normalizer, and corrects a quota consumption initial value according to the fed-back quota update response; further, when the quota offset is zero and the corrected quota consumption initial value is greater than or equal to the available quota t, ending the flow transmission; wherein the quota offset comprises a quota positive offset Δ t2 and a quota negative offset Δ t 1. It should be noted that, the process of correcting the initial value of quota consumption may refer to the prior art to perform correction processing, and is not described herein again.
Therefore, the flow control method provided by the embodiment of the invention can effectively solve the problem of low flow quota control efficiency, thereby improving the flow transmission quality and efficiency and improving the user experience.
EXAMPLE III
Fig. 4 is an electronic device including an execution controller 401, a modulator 402, and a quota normalizer 403; wherein,
the execution controller 401 is configured to initiate a quota update request when traffic consumption meets a first preset condition;
wherein, the quota update request carries current traffic quota information.
The modulator 402 is configured to receive the quota update request, and update a quota update queue corresponding to a quota update condition according to a prestored quota parameter, a quota update condition, and a quota update rule, to obtain an updated quota update queue;
the quota calculator 403 is configured to feed back a quota update response to the execution controller 401 according to the quota data in the updated quota update queue.
Here, the execution controller 401 is in a half-wait state during waiting for the feedback quota update response, and enters a full-wait state after the quota forward offset is consumed.
In an embodiment, the execution controller 401 is further configured to reinitiate the quota update request when the duration of the full wait state exceeds the quota occupying time.
In an embodiment, the execution controller 401 is further configured to correct a quota consumption initial value according to the fed back quota update response; and when the quota offset is zero and the corrected quota consumption initial value is greater than or equal to the available quota, ending the flow transmission.
In one embodiment, as shown in fig. 5, the regulator 402 includes a quota back calculator 4021 and a parameter adjustment controller 4022; the parameter adjustment controller may include a quota threshold controller 4022a, an available quota offset controller 4022b, and a quota offset controller 4022 c; wherein,
the quota back calculator 4021 is configured to receive and analyze the quota update request, and obtain the traffic quota information; when the flow quota information is determined to meet the quota updating condition according to the prestored quota parameter, writing an updating notice into a quota updating queue corresponding to the quota updating condition;
specifically, when determining that the traffic quota information meets the quota update condition according to the pre-stored quota parameter, the quota back calculator 4021 writes an update notification into the quota update queue corresponding to the quota update condition, which includes the following four cases:
A. when the flow quota information is determined to meet a first sub quota updating condition, namely the available quota t-quota delta t consumption-quota forward offset delta t2 consumption is less than the offset t3 of the available quota t, the quota forward offset delta t2 and the quota upper limit t2, or the quota is authenticated for the first time, the quota back-calculator writes an available quota offset updating notice into an available quota offset updating queue corresponding to the first sub quota updating condition;
B. when the flow quota information is determined to meet a second sub-quota updating condition, namely the offset t3 of the available quota t is less than a quota positive offset delta t2+ a quota upper limit t 2-a quota negative offset delta t1 is consumed, the quota back-calculator writes a threshold updating notice into a quota threshold updating queue corresponding to the second sub-quota updating condition;
C. when the flow quota information is determined to meet a third sub-quota update condition, namely available quota t-quota upper limit t 2-quota forward offset delta t 2-available quota offset t3 is less than quota forward offset delta t 2-quota forward offset delta t2 is consumed, the quota back calculator writes an offset update notification into a quota offset update queue corresponding to the third sub-quota update condition;
D. when the flow quota information is determined to meet the fourth sub quota updating condition, that is, the available quota t-quota delta t consumption-quota forward offset delta t2 consumption is less than or equal to 0, or the minimum quota offset t3 of the preset available quota t existsminAnd quota Δ t consumption-quota forward offset Δ t2 consumption is less than or equal to minimum quota offset t3 of available quota tminAnd if so, writing a zero quota update notification into a quota update notification queue corresponding to the fourth sub-quota update condition by the quota back-calculator.
It should be added that, when it is determined that the quota update condition is any one of the conditions a to C, the quota back-calculator writes the update notification into the quota update queue corresponding to the quota update condition, and also writes the update notification to be migrated into the quota update notification queue.
The parameter adjustment controller 4022 is configured to receive the update notification, and read quota data from the quota update queue; and updating the quota data according to a preset quota updating rule, and writing the updated quota data into the quota updating queue to obtain an updated quota updating queue.
Specifically, when the quota counter 4021 determines that the situation is a condition a, a quota threshold controller 4022a in the parameter adjustment controller 4022 receives the update notification, and reads quota data from the quota update queue; further, updating the quota data according to a preset quota update rule, and writing the updated quota data into the quota update queue to obtain an updated quota update queue, including: when the quota update is a non-first authentication notification and the available quota t-quota Δ t consumption-quota forward offset Δ t2 consumption is less than the quota upper limit t2, updating the quota data, namely the offset t3 of the available quota t is 0; otherwise, the offset t3 of the available quota t is equal to the quota positive offset Δ t2+ the quota negative offset Δ t1 — the quota negative offset Δ t1 is consumed, and the updated quota data is written into the quota update queue to obtain the updated quota update queue.
It should be noted that, when the quota update is the first authentication notification, the offset t3 of the available quota t may be assigned according to the available quota offset initial movement rule to obtain quota data after quota update, and the updated quota data is written into the quota update queue to obtain an updated quota update queue.
Specifically, when the quota counter 4021 determines that the situation is the case B, the available quota offset controller 4022B in the parameter adjustment controller 4022 receives the update notification, and reads quota data from the quota update queue; further, updating the quota data according to a preset quota update rule, and writing the updated quota data into the quota update queue to obtain an updated quota update queue, including: 1) when quota update is not the first authentication notification, the offset t3 of the available quota t is equal to 0, and the available quota t-quota Δ t consumption-quota forward offset Δ t2 consumption is more than or equal to 0, the quota data is updated, namely the quota lower limit t1 is equal to 0, the quota upper limit t2 is the available quota t-quota Δ t consumption-quota forward offset Δ t2 consumption; 2) when offset t3 of available credit t is 0 and available credit t-quota Δ t consumption-quota forward offset Δ t2 consumption < 0, updating the quota data, that is, quota upper limit t2 is 0 and quota lower limit t1 is available credit t-quota Δ t consumption-quota forward offset Δ t2 consumption; 3) when the offset t3 of the available credit t is greater than 0, the quota data is updated, that is, the quota lower limit t1 is equal to the quota positive offset Δ t2+ the quota negative offset Δ t 1-the quota positive offset Δ t2 consumes-the quota negative offset Δ t1 consumes, and the quota upper limit t2 is equal to the quota lower limit t1+ the available credit t-the quota Δ t consumes-the quota positive offset Δ t2 consumes-the offset t3 of the available credit t. Further, the updated quota data is written into the quota update queue, so that an updated quota update queue is obtained.
It should be noted that, when the quota update is the first authentication notification, the quota lower limit t1 and the quota upper limit t2 may be assigned according to the quota threshold initial movement rule to obtain quota data after the quota update, and the updated quota data is written into the quota update queue to obtain the updated quota update queue.
Specifically, when it is determined as the case C by the quota back-calculator 4021, the quota offset controller 4022C in the parameter adjustment controller 4022 receives the update notification, and reads quota data from the quota update queue; further, updating the quota data according to a preset quota update rule, and writing the updated quota data into the quota update queue to obtain an updated quota update queue, including: 1) when the quota is updated to be the non-initial authentication notification and the quota upper limit t2 is 0 or the quota lower limit t1 is 0, updating the quota data, that is, the quota negative offset Δ t1 is the quota positive offset Δ t2 is 0; 2) when quota lower limit t1 > offset t3 of available quota t is 0, updating quota data, that is, quota positive offset Δ t2 is available quota t-quota upper limit t 2-quota Δ t consumption-quota positive offset Δ t2 consumption, quota negative offset Δ t1 is quota positive offset Δ t 2-quota positive offset Δ t2 consumption; 3) when offset t3 of available credit t is greater than 0, the quota data is updated, that is, quota positive offset Δ t2 is quota upper limit t 2-quota Δ t consumption-quota positive offset Δ t2 consumption-offset t3 of available credit t, quota negative offset Δ t1 is latest quota positive offset Δ t 2-quota positive offset Δ t2 consumption. Further, the updated quota data is written into the quota update queue, so that an updated quota update queue is obtained.
It should be noted that, when the quota update is the first authentication notification, the quota negative offset Δ t1 and the quota positive offset Δ t2 may be assigned according to the quota offset initial movement rule to obtain quota data after quota update, and the updated quota data is written into the quota update queue to obtain an updated quota update queue.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention.
Claims (8)
1. A method of flow control, the method comprising:
when the flow consumption meets a first preset condition, initiating a quota updating request; wherein, the quota update request carries current traffic quota information;
receiving the quota update request, and updating a quota update queue corresponding to a quota update condition according to a prestored quota parameter, a quota update condition, and a quota update rule to obtain an updated quota update queue, specifically:
receiving and analyzing the quota updating request to obtain the flow quota information;
when the flow quota information is determined to meet the quota updating condition according to the prestored quota parameter, writing an updating notice into a quota updating queue corresponding to the quota updating condition;
receiving the update notification, and reading quota data from the quota update queue;
updating the quota data according to a preset quota updating rule, and writing the updated quota data into the quota updating queue to obtain an updated quota updating queue;
and feeding back a quota update response according to the quota data in the updated quota update queue.
2. The method of claim 1, further comprising:
during waiting for the feedback quota update response, the traffic transmission is normally executed until the quota forward offset is completely consumed and then enters a full waiting state.
3. The method of claim 2, further comprising: and when the duration of the full waiting state exceeds the quota occupying time, reinitiating the quota updating request.
4. The method according to any one of claims 1 to 3, further comprising:
correcting a quota consumption initial value according to the fed back quota update response; and when the quota offset is zero and the corrected quota consumption initial value is greater than or equal to the available quota, ending the flow transmission.
5. An electronic device, comprising an execution controller, a modulator, and a quota normalizer; wherein,
the execution controller is used for initiating a quota updating request when the flow consumption meets a first preset condition; wherein, the quota update request carries current traffic quota information;
the modulator comprises a quota back-calculator and a parameter adjusting controller; wherein,
the quota back-calculator is used for receiving and analyzing the quota update request to obtain the flow quota information; when the flow quota information is determined to meet the quota updating condition according to the prestored quota parameter, writing an updating notice into a quota updating queue corresponding to the quota updating condition;
the parameter adjustment controller is configured to receive the update notification, and read quota data from the quota update queue; updating the quota data according to a preset quota updating rule, and writing the updated quota data into the quota updating queue to obtain an updated quota updating queue;
and the quota calculator is used for feeding back a quota update response to the execution controller according to the quota data in the updated quota update queue.
6. The electronic device of claim 5, wherein the execution controller is in a semi-wait state while waiting for a feedback quota update response until a quota forward offset is consumed before entering a full wait state.
7. The electronic device of claim 6,
the execution controller is further configured to reinitiate the quota update request when the duration of the full wait state exceeds the quota occupying time.
8. The electronic device of any of claims 5 to 7,
the execution controller is further used for updating a response correction quota consumption initial value according to the fed back quota; and when the quota offset is zero and the corrected quota consumption initial value is greater than or equal to the available quota, ending the flow transmission.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510000992.2A CN105827543B (en) | 2015-01-04 | 2015-01-04 | A kind of flow control methods and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510000992.2A CN105827543B (en) | 2015-01-04 | 2015-01-04 | A kind of flow control methods and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105827543A CN105827543A (en) | 2016-08-03 |
CN105827543B true CN105827543B (en) | 2019-02-26 |
Family
ID=56986794
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510000992.2A Active CN105827543B (en) | 2015-01-04 | 2015-01-04 | A kind of flow control methods and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105827543B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109901923B (en) * | 2017-12-07 | 2022-10-21 | 财付通支付科技有限公司 | Frequency limiting method, frequency limiting device and readable storage medium |
CN114390058B (en) * | 2022-02-24 | 2024-03-08 | 百果园技术(新加坡)有限公司 | Service management system, method, device and storage medium |
CN116074135B (en) * | 2023-01-31 | 2024-05-03 | 中国联合网络通信集团有限公司 | Quota configuration method and quota configuration device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101330391A (en) * | 2007-07-24 | 2008-12-24 | 中兴通讯股份有限公司 | Method for switching prepayment rate based on flux point |
US8705062B2 (en) * | 2012-02-27 | 2014-04-22 | Ricoh Company, Ltd. | Quotas in distributed scan management systems |
CN103929316A (en) * | 2013-01-11 | 2014-07-16 | 阿尔卡特朗讯 | Communication quota distribution method and corresponding on-line billing system |
CN103974221A (en) * | 2013-01-25 | 2014-08-06 | 中国移动通信集团广东有限公司 | Method and device for distributing packet domain real-time charging flow quotas |
-
2015
- 2015-01-04 CN CN201510000992.2A patent/CN105827543B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101330391A (en) * | 2007-07-24 | 2008-12-24 | 中兴通讯股份有限公司 | Method for switching prepayment rate based on flux point |
US8705062B2 (en) * | 2012-02-27 | 2014-04-22 | Ricoh Company, Ltd. | Quotas in distributed scan management systems |
CN103929316A (en) * | 2013-01-11 | 2014-07-16 | 阿尔卡特朗讯 | Communication quota distribution method and corresponding on-line billing system |
CN103974221A (en) * | 2013-01-25 | 2014-08-06 | 中国移动通信集团广东有限公司 | Method and device for distributing packet domain real-time charging flow quotas |
Also Published As
Publication number | Publication date |
---|---|
CN105827543A (en) | 2016-08-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105827543B (en) | A kind of flow control methods and electronic equipment | |
CN107920031B (en) | Adaptive adjustment method and device for access bandwidth | |
US10296234B2 (en) | Method and apparatus for adjusting throughput of storage device | |
WO2022257366A1 (en) | Network slice self-optimization method, base station, and storage medium | |
US10306083B2 (en) | Image processing system, image processing device, non-transitory computer readable recording medium, and processing device for wireless communication with a portable terminal | |
CN107222412B (en) | SDN mixed mode flow table issuing method and device based on network topology judgment | |
US20210058859A1 (en) | Automated power-aware green radio resource management (rrm) | |
US9304965B2 (en) | Scheduling apparatus and method for load balancing when performing multiple transcoding operations | |
CN105721901A (en) | Video transcoder adaption method, device and system | |
EP3190749A1 (en) | Traffic control method and system | |
RU2010144530A (en) | VIDEO BIT TRANSFER SPEED CONTROL METHOD, VIDEO BIT SPEED CONTROL DEVICE, VIDEO BIT SPEED CONTROL PROGRAM, VIDEO AND AUTOMATICALLY RESPECTED CARRIER | |
CN109819172B (en) | Automatic exposure method and system | |
EP3678340A1 (en) | Software-defined network setting method, controller, switch, and storage medium | |
US11902167B2 (en) | Communication apparatus having delay guarantee shaping function | |
CN108121426B (en) | Chip voltage adjusting method, device and system | |
CN110182578B (en) | Method, device and equipment for correcting material deviation by calculating material deviation in segmentation mode | |
CN109059219B (en) | Control method of WIFI module of air conditioner, air conditioner and storage medium | |
CN110650206A (en) | IO flow control method and device in distributed storage system and storage medium | |
CN109426170B (en) | Method for updating display real-time data and system for updating display real-time data | |
US10091068B1 (en) | System for modeling distributed systems | |
JP2023052726A (en) | Download control in multi-server communication system | |
CN103685071A (en) | Network source distributing method and device | |
CN114769817A (en) | Submerged arc welding control method, device, equipment and storage medium | |
US8751774B2 (en) | Method and system for controlling message traffic between two processors | |
SE1751190A1 (en) | Control System, Method and Computer Program for a Milking Machine |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |