CN106921587B - Message flow control method, device and related system - Google Patents

Message flow control method, device and related system Download PDF

Info

Publication number
CN106921587B
CN106921587B CN201510999121.6A CN201510999121A CN106921587B CN 106921587 B CN106921587 B CN 106921587B CN 201510999121 A CN201510999121 A CN 201510999121A CN 106921587 B CN106921587 B CN 106921587B
Authority
CN
China
Prior art keywords
processing node
node
flow control
preset
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510999121.6A
Other languages
Chinese (zh)
Other versions
CN106921587A (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.)
Alibaba Group Holding 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 CN201510999121.6A priority Critical patent/CN106921587B/en
Priority to PCT/CN2016/110051 priority patent/WO2017114165A1/en
Publication of CN106921587A publication Critical patent/CN106921587A/en
Application granted granted Critical
Publication of CN106921587B publication Critical patent/CN106921587B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/26Flow control; Congestion control using explicit feedback to the source, e.g. choke packets
    • H04L47/263Rate modification at the source after receiving feedback

Abstract

The application discloses a method, a device and a related system for controlling message flow, which are characterized in that the message receiving quantity of each processing node is sampled, once the actual message receiving quantity of a certain processing node is not in the corresponding preset flow threshold interval, generating a corresponding flow control request, and adjusting the message sending rate of the upstream data node corresponding to the processing node according to the flow control request, thereby realizing dynamic control of message flow between any two adjacent upstream and downstream data nodes, and compared with the prior art that the message sending rate of the data source is adjusted only according to the unprocessed message quantity of the last processing node, the method has higher control precision, and any processing node can not generate message backlog or idle phenomenon, therefore, the message discarding amount can be reduced, and the stability and the processing efficiency of the whole data processing system are improved.

Description

Message flow control method, device and related system
Technical Field
The present invention relates to the field of distributed real-time computing technologies, and in particular, to a method, an apparatus, and a related system for controlling message flow.
Background
Most of the existing data processing systems adopt a pipeline processing mode, such as a topological graph shown in fig. 1, after a message is sent from a data source S, the message flows downstream step by step according to the logical relationship among processing nodes; the total number of processing nodes and the number of nodes per pipeline depends on the actual data processing logic, and fig. 1 only takes A, B and C as examples of three processing nodes, with arrows indicating the direction of message flow.
Normally, the message sending rate of the data source or processing node at the upstream should match the message processing rate of the adjacent downstream processing node; if the message sending rate at the upstream is greater than the message processing rate at the downstream due to the occurrence of a message traffic peak at the upstream node and/or insufficient processing capability at the downstream processing node, a large amount of message backlog and increased processor pressure can be caused, even a part of messages are discarded due to processing time-out, and the actual effective processing capability of the system is reduced. Especially in real-time computing systems such as Storm, Jstorm, Spark streaming and the like, the message flow is constantly changed, when the flow peak arrives, each node is required to effectively process the received message as soon as possible, otherwise, other nodes which normally run or computing tasks are influenced.
The following flow control strategies are adopted in the related art: configuring a flow control value R0 at a data source to represent the number of uncompleted messages allowed by the system, determining the actual number R of the uncompleted messages according to the message processing condition of the last processing node in the pipeline in the running process of the system, and controlling the data source to reduce the message sending number if R > R0 indicates that the message flow is overlarge; conversely, if R < R0, indicating that the message flow is too small, the control data source increases the number of messages sent. The flow control strategy has serious defects in practical application; for example: if the flow control value configuration is too high, the message discarding amount is too high, which still causes instability of the system, but if the flow control value configuration is too low, which results in idle computing resources.
Disclosure of Invention
In order to solve the technical problem, the application discloses a message flow control method, a message flow control device and a related system.
A first aspect of the present application provides a message flow control method, which is applied to a data processing system, where the data processing system includes a data source and a plurality of processing nodes; the method comprises the following steps:
respectively sampling the message receiving quantity of each processing node, and judging whether the actual message receiving quantity of the corresponding processing node is within a preset flow threshold interval according to the sampling result;
when the actual message receiving quantity of the first processing node is judged not to be within the preset flow threshold interval according to the sampling result corresponding to the first processing node, generating a corresponding flow control request;
adjusting the message sending rate of an upstream data node adjacent to the first processing node according to the flow control request; wherein the upstream data node may be the data source or a processing node.
With reference to the first aspect, in a first possible implementation manner of the first aspect, when it is determined, according to a sampling result corresponding to a first processing node, that an actual message receiving amount of the first processing node is not within a preset flow threshold interval, generating a corresponding flow control request includes:
when the actual message receiving quantity of a first processing node is judged to be larger than a preset highest flow threshold value according to a sampling result corresponding to the first processing node, a flow reduction request is generated;
and generating a flow increasing request when the actual message receiving quantity of the first processing node is judged to be smaller than a preset minimum flow threshold value according to the sampling result corresponding to the first processing node.
With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the adjusting a message sending rate of an upstream data node adjacent to the first processing node according to the flow control request includes:
when the flow control request is the flow reduction request, determining message sending delay time according to the message processing rate of the first processing node and the original message sending rate of the upstream data node;
and superposing the message sending delay time and the original message sending rate to obtain the target message sending rate of the upstream data node.
With reference to the first possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the adjusting, according to the flow control request, a message sending rate of an upstream data node adjacent to the first processing node includes:
and when the flow control request is the flow increasing request, gradually increasing the message sending rate of the upstream data node to a preset normal rate according to a preset rate adjustment step length.
With reference to the first aspect, or the first possible implementation manner of the first aspect, or the second possible implementation manner of the first aspect, or the third possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, before adjusting a message sending rate of an upstream data node adjacent to the first processing node according to the flow control request, the method further includes:
if a plurality of downstream processing nodes corresponding to the upstream data node generate corresponding flow control requests in a preset time period, determining the message sending rate variable quantity of the upstream data node caused by the flow control request corresponding to each downstream processing node;
and determining a target flow control request corresponding to the maximum value of the message sending rate variation, so as to adjust the message sending rate of the upstream data node according to the target flow control request.
With reference to the first aspect, or the first possible implementation manner of the first aspect, or the second possible implementation manner of the first aspect, or the third possible implementation manner of the first aspect, in a fifth possible implementation manner of the first aspect, the method further includes:
storing the flow control state of each processing node to a preset storage module;
and synchronizing the flow control state stored in the preset storage module to the corresponding processing node according to a preset period.
With reference to the first aspect, or the first possible implementation manner of the first aspect, or the second possible implementation manner of the first aspect, or the third possible implementation manner of the first aspect, in a sixth possible implementation manner of the first aspect, the determining, according to the sampling result, whether the actual message receiving amount of the corresponding processing node is within the preset traffic threshold interval includes:
for any processing node, calculating the ratio of the number of sampling values which are acquired in a preset sampling period and are not in a preset flow threshold interval to the total number of the sampling values in the preset sampling period;
and if the ratio is larger than a preset threshold, judging that the actual message receiving quantity of the corresponding processing node is not in the preset flow threshold interval.
A second aspect of the present application provides a message flow control apparatus for use in a data processing system comprising a data source and a plurality of processing nodes; the device comprises: a trigger and a controller;
the trigger is arranged in each processing node and is used for sampling the message receiving quantity of the processing node where the trigger is positioned, judging whether the actual message receiving quantity of the processing node where the trigger is positioned is within the preset flow threshold interval or not according to the sampling result, and generating a corresponding flow control request when the actual message receiving quantity of the processing node where the trigger is positioned is not within the preset flow threshold interval;
the controller is arranged in each data node with a downstream processing node and used for adjusting the message sending rate of the data node where the controller is located according to the flow control request of the downstream processing node corresponding to the data node where the controller is located; wherein the data node may be the data source or a processing node.
With reference to the second aspect, in a first possible implementation manner of the second aspect, to implement that when an actual message receiving amount of a processing node where the processing node is located is not within a preset flow threshold interval, the trigger is configured to:
when the actual message receiving quantity of the processing node where the processing node is located is larger than a preset highest flow threshold value, generating a flow reduction request;
and when the actual message receiving quantity of the processing node where the processing node is located is larger than a preset minimum flow threshold value, generating a flow increasing request.
With reference to the first feasible implementation manner of the second aspect, in the second feasible implementation manner of the second aspect, to implement adjusting the message sending rate of the data node where the controller is located according to the flow control request of the downstream processing node corresponding to the data node where the controller is located, the controller is configured to:
and when the flow control request is the flow reduction request, determining message sending delay time according to the message processing rate of the downstream processing node and the original message sending rate of the data node where the downstream processing node is located, and overlapping the message sending delay time and the original message sending rate to obtain the target message sending rate of the data node where the downstream processing node is located.
With reference to the first feasible implementation manner of the second aspect, in a third feasible implementation manner of the second aspect, to implement adjusting the message sending rate of the data node where the controller is located according to the flow control request of the downstream processing node corresponding to the data node where the controller is located, the controller is configured to:
and when the flow control request is the flow increasing request, gradually increasing the message sending rate of the data node where the flow control request is located to a preset normal rate according to a preset rate adjusting step length.
With reference to the second aspect, or the first possible implementation manner of the second aspect, or the second possible implementation manner of the second aspect, or the third possible implementation manner of the second aspect, in a fourth possible implementation manner of the second aspect, the apparatus further includes: a first coordinator;
the first coordinator and each processing node are arranged in the data processing system in parallel, and are used for acquiring the flow control request sent by the trigger and forwarding the flow control request to the controller of the corresponding upstream data node;
if the first coordinator obtains a plurality of flow control requests sent to the controller of the same upstream data node within a preset time period, the first coordinator determines the message sending rate variation caused by each flow control request to the same upstream data node, and sends the flow control request corresponding to the maximum value of the message sending rate variation to the controller of the same upstream data node.
With reference to the second aspect, or the first possible implementation manner of the second aspect, or the second possible implementation manner of the second aspect, or the third possible implementation manner of the second aspect, in a fifth possible implementation manner of the second aspect, the apparatus further includes: a second coordinator;
the second coordinator and each processing node are arranged in the data processing system in parallel, and are configured to store the flow control state of each processing node to a preset storage module, and synchronize the flow control state stored in the preset storage module to the corresponding processing node according to a preset period.
With reference to the second aspect, or the first possible implementation manner of the second aspect, or the second possible implementation manner of the second aspect, or the third possible implementation manner of the second aspect, in a sixth possible implementation manner of the second aspect, to determine whether an actual message receiving amount of a processing node where the trigger is located meets a preset traffic threshold interval according to a sampling result, the trigger is configured to:
and calculating the ratio of the number of the sampling values which are acquired in a preset sampling period and are not in the preset flow threshold range to the total number of the sampling values in the preset sampling period, and judging that the actual message receiving quantity of the processing node is not in the preset flow threshold interval when the ratio is greater than a preset threshold.
A third aspect of the present application provides a data processing system comprising a data source, a plurality of processing nodes, and any of the message flow control devices described above.
According to the technical scheme, the message receiving quantity of each processing node is sampled, once the actual message receiving quantity of a certain processing node is not in the corresponding preset flow threshold interval, generating a corresponding flow control request, and adjusting the message sending rate of the upstream data node corresponding to the processing node according to the flow control request, therefore, the dynamic control of the message flow between any two adjacent upstream and downstream data nodes can be realized, compared with the prior art that the message sending rate of the data source is adjusted only according to the unprocessed message quantity of the last processing node, the method has higher control precision, and any processing node can not generate the phenomenon of message backlog or idleness, therefore, the message discarding amount can be reduced, and the stability and the processing efficiency of the whole data processing system are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1 is a block diagram of a topology of a prior art data processing system;
fig. 2 is a flowchart of a message flow control method according to an embodiment of the present application;
fig. 3 is a topology structure diagram of a data processing system according to an embodiment of the present application;
fig. 4 is a signal flow diagram of a message flow control method based on the topology shown in fig. 3 according to an embodiment of the present application;
fig. 5 is a schematic diagram illustrating an operation principle of a message flow control device according to an embodiment of the present application;
fig. 6 is a topology block diagram of another data processing system according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
First, an embodiment of a message traffic control method provided in the present application is described. The method can be applied to any pipelined data processing system comprising a data source and a plurality of processing nodes, such as Storm, Jstorm, spark timing and other real-time computing systems, so as to adjust the message flow among the nodes in the pipeline and realize that the message sending rate of the data source and any processing node is matched with the message processing rate of the corresponding downstream processing node.
Fig. 2 is a flowchart of a message traffic control method according to an embodiment of the present application; referring to fig. 2, the method includes the following steps.
And S11, respectively sampling the message receiving quantity of each processing node, and judging whether the actual message receiving quantity of the corresponding processing node is within the preset flow threshold interval according to the sampling result.
Because the processing capacity of each processing node in the data processing pipeline and the number of messages to be processed (i.e., the load of the processing node) are different, the embodiment sets a corresponding preset traffic threshold interval for each processing node in advance; taking the topology shown in fig. 1 as an example, the nodes to be sampled include all three processing nodes, and according to the processing capacity and the load of the nodes, the preset traffic threshold intervals corresponding to the processing node a are set to be [ a1, B1], the preset traffic threshold intervals corresponding to the processing node B are set to be [ a2, B2], and the preset traffic threshold intervals corresponding to the processing node C are set to be [ A3, B3 ].
In the system operation process, the message receiving quantity of each processing node, namely the load of the corresponding processing node, is respectively sampled, and whether the actual message receiving quantity of the processing node is within the preset flow threshold interval or not is judged according to the sampling result of each processing node. Still taking fig. 1 as an example, whether the actual message receiving amount of processing node a is in the corresponding interval [ a1, B1] of processing node a is determined according to the sampling result of processing node a, and correspondingly, whether the actual message receiving amount of processing node B is in the interval [ a2, B2] is determined according to the sampling result of processing node B, and so on. That is, it is detected by step S11 whether the load of each processing node and its processing capability match.
And S12, generating a corresponding flow control request when the actual message receiving quantity of the first processing node is judged not to be in the preset flow threshold interval according to the sampling result corresponding to the first processing node.
And S13, adjusting the message sending rate of the upstream data node adjacent to the first processing node according to the flow control request.
In this embodiment, when it is detected that the actual message receiving amount of any processing node is not within the preset flow threshold interval corresponding to the processing node, that is, the load of the processing node is not matched with the processing capability of the processing node, a corresponding flow control request is generated, and the message sending rate of the upstream data node corresponding to the processing node is adjusted according to the flow control request.
The upstream data node may be a data source or a processing node according to different positions of the processing nodes in the pipeline. Taking fig. 1 as an example, for two nodes, a data source and a processing node a, the processing node a corresponds to the first processing node, and the data source S corresponds to the upstream data node; and for both processing node a and processing node B, processing node B corresponds to the first processing node and processing node a corresponds to the upstream data node.
According to the technical scheme, the message receiving quantity of each processing node is sampled, once the actual message receiving quantity of a certain processing node is not within the corresponding preset flow threshold interval, the corresponding flow control request is generated, and the message sending rate of the upstream data node corresponding to the processing node is adjusted according to the flow control request, so that the dynamic control of the message flow between any two adjacent upstream and downstream data nodes can be realized.
In one possible embodiment of the present application, a trigger may be respectively set in each processing node of the data processing system, and the steps S11 and S12 are executed by the trigger, and a controller may be set in the data source and each processing node, and the step S13 is executed by the controller. Still taking fig. 1 as an example, in the embodiment of the present application, a controller C _ S is disposed in a data source S, a flip-flop T _ a and a controller C _ a are disposed in a processing node a, a flip-flop T _ B is disposed in a processing node B, and a flip-flop T _ C is disposed in a processing node C, as shown in fig. 3. The solid arrows in fig. 3 indicate the message transmission direction between the respective nodes, and the dashed arrows indicate the flow control request transmission direction between the respective nodes. It should be noted that, in the system shown in fig. 3, since there is no other processing node downstream of the processing nodes B and C, and there is no need to send a message, there may not be a corresponding controller in the processing nodes B and C, and in other embodiments, if there is another processing node downstream of the processing nodes B and C, a corresponding controller may be added in the processing nodes B and C. Based on the system shown in fig. 3, the message flow control process between nodes is shown in fig. 4.
Referring to fig. 3 and 4, for both nodes, a data source and a processing node a, the processing node a corresponding to said first processing node and the data source S corresponding to said upstream data node, then:
in step S111, the trigger T _ a samples the message receiving amount of the processing node a, and determines whether the actual message receiving amount is within the corresponding preset flow threshold interval [ a1, B1] according to the sampling result;
in step S121, when the trigger T _ a determines that the actual message receiving amount of the processing node a is not within [ a1, B1] (greater than B1 or less than a1), that is, the load and the processing capability of the processing node a are not matched, a flow control request is generated and sent to the data source S;
in step S131, the controller C _ S adjusts the message sending rate of the data source S according to the flow control request sent by the trigger T _ a. Through the above steps S111, S121, and S131, the number of messages sent to the processing node a in unit time, that is, the actual message receiving amount of the processing node a in unit time, may be matched with the message processing number of the processing node a, which may avoid that the messages are overstocked in the processing node a when the message sending rate of the data source S is too large, or may avoid that the processing node a is idle when the message sending rate of the data source S is too small.
Accordingly, for both processing node a and processing node B, processing node B corresponds to the first processing node and processing node a corresponds to the upstream data node, then:
in step S112, the trigger T _ B samples the message receiving amount of the processing node B, and determines whether the actual message receiving amount is within the corresponding preset traffic threshold interval [ a2, B2] according to the sampling result;
in step S122, when determining that the actual message reception amount of the processing node B is not within [ a2, B2], the trigger T _ B generates a flow control request and transmits it to the processing node a;
in step S132, the controller C _ a adjusts the message sending rate when the processing node a sends a message to the processing node B according to the flow control request sent by the trigger T _ B. That is, the actual message reception amount processed by the node B per unit time is matched with the message processing amount by the above-described steps S112, S122, and S132.
For the two nodes of processing node a and processing node C, the message flow control process is similar to the steps S112, S122, and S132 described above, and is not described herein again.
In a feasible embodiment of the present application, the determining, according to the sampling result, whether the actual message receiving amount of the corresponding processing node is within the preset flow threshold interval in step S11 specifically includes the following steps:
for any processing node, calculating the ratio of the number of sampling values which are acquired in a preset sampling period and are not in a preset flow threshold interval to the total number of the sampling values in the preset sampling period; and if the ratio is larger than a preset threshold, judging that the actual message receiving quantity of the corresponding processing node is not in the preset flow threshold interval.
Compared with the method for generating a flow control request aiming at each sampling value which is not in the preset flow threshold interval, the embodiment generates the flow control request only when the proportion of the sampling values which exceed the preset flow threshold interval in a preset sampling period is greater than the preset threshold, starts the adjustment of the message sending rate of the upstream data node, and can avoid the problems of system jitter, processing capacity reduction and the like caused by frequent adjustment.
In a possible embodiment of the present application, when it is determined that the actual message receiving amount of the first processing node is not within the preset flow threshold interval according to the sampling result corresponding to the first processing node in step S12, the generating of the corresponding flow control request may specifically include the following two cases:
when the actual message receiving quantity of a first processing node is judged to be larger than a preset highest flow threshold value according to a sampling result corresponding to the first processing node, a flow reduction request is generated;
and generating a flow increasing request when the actual message receiving quantity of the first processing node is judged to be smaller than a preset minimum flow threshold value according to the sampling result corresponding to the first processing node.
That is, in the peak time of the system traffic, if the actual message receiving amount of a certain processing node is greater than the preset maximum traffic threshold, a traffic reduction request is generated to control the upstream data node to reduce the message sending rate; and when the actual message receiving quantity of the processing node is reduced to be below a preset minimum flow threshold value, generating a flow increasing request to stop the reduction control of the message sending rate of the upstream data node and gradually increase the message sending rate of the upstream data node until the message sending rate is restored to a normal value.
In a possible embodiment of the present application, the flow control request includes not only information for instructing the upstream data node to increase or decrease the message sending rate, but also a message processing rate of the processing node that generated the flow control request; accordingly, when the flow control request is the flow rate reduction request, the method for adjusting the message sending rate of the upstream data node in step S13 includes:
when the flow control request is the flow reduction request, determining message sending delay time according to the message processing rate of the first processing node and the original message sending rate of the upstream data node;
and superposing the message sending delay time and the original message sending rate to obtain the target message sending rate of the upstream data node.
Specifically, assuming that the flow rate reduction request includes a message processing rate of the first processing node is TPS _ downlink _ stream and an original message transmission rate of the corresponding UpStream data node is TPS _ UpStream, since the flow control request is a flow rate reduction request, it can be inferred that UpStream _ TPS > TPS _ downlink _ stream, and therefore, it is necessary to delay transmission of a message at the UpStream node by a time period T _ delay (i.e., the message transmission delay time) to reduce UpStream _ TPS; the message transmission delay time T _ delay may be calculated using the following formula:
T_delay=1/TPS_DownStream-1/UpStream_TPS。
the adjusted message sending rate, that is, the target message sending rate, namely, the uppream _ TPS', can be obtained by superimposing the T _ delay and the uppream _ TPS; the superposition calculation formula may be:
UpStream_TPS’=1/[(1/UpStream_TPS)+T_delay]。
in addition, in practical applications, since a network or other intermediate links have a certain influence on a message sending rate or a message processing rate, and an upstream data node still receives a flow control request of a downstream processing node after applying the adjusted message sending rate, in other embodiments of the present application, fine adjustment may be performed on a message sending delay time, that is, fine adjustment of a minimum delay unit T _ min _ adjust (which may be 1 millisecond) is added on the basis of T _ delay, that is: t _ delay is 1/TPS _ DownStream-1/UpStream _ TPS + T _ min _ adjust.
In another possible embodiment of the present application, when the flow control request is the flow increasing request, the method for adjusting the message sending rate of the upstream data node in step S13 includes: and gradually increasing the message sending rate of the upstream data node to a preset normal rate according to a preset rate adjustment step length.
When receiving a flow increasing request, gradually increasing the message sending rate of the upstream data node instead of once restoring to the preset normal rate; compared with the above adjustment mode based on the message sending delay time T _ delay, when receiving the traffic increase request, the value of T _ delay is gradually decreased to 0, and the UpStream _ TPS' is also gradually increased to the UpStream _ TPS. By adopting the mode of gradually increasing the message sending rate, the message backlog can be avoided, and the stability of the system is ensured.
In addition, when the message sending rate of the upstream data node is restored to the preset normal rate according to the traffic increase request, response information can be fed back to the corresponding downstream processing node to inform the downstream processing node of the control end; correspondingly, after receiving the response message, the downstream processing node does not send a request any more, but still detects whether the actual message receiving quantity of the downstream processing node is within the preset flow threshold interval through sampling.
In a possible embodiment of the present application, the flow control request generated in step S12 may be directly sent by the first processing node to the corresponding upstream data node; in another possible embodiment of the present application, the flow control request may also be forwarded by an independent node, where the independent node receives the flow control request of each processing node, determines the corresponding upstream data node, and forwards the flow control request to the upstream data node. Optionally, based on the setting of the trigger and the controller in the node described in the above embodiment, the independent node described in this embodiment may be a coordinator provided in the system.
In practical applications, a plurality of downstream processing nodes may exist in a certain upstream data node, and in the process of receiving and forwarding the flow control request through the above independent node, in the same detection period, a plurality of downstream processing nodes may all detect that their actual message receiving amount is not within a preset flow threshold interval, so that the flow control requests are all generated correspondingly, if the message sending rate of the upstream data node is adjusted according to the flow control request of each downstream processing node, the adjustment needs to be performed multiple times, and not only is the workload large, but also the system may be unstable due to frequent adjustment.
In view of this, in a possible embodiment of the present application, multiple flow control requests sent to the same upstream data node may be filtered, that is, before adjusting the message sending rate of an upstream data node adjacent to the first processing node according to the flow control requests (step S13), the message flow control method may further include the following steps:
s14, if a plurality of downstream processing nodes corresponding to the upstream data node generate corresponding flow control requests in a preset time period, determining the message sending rate variable quantity of the flow control request corresponding to each downstream processing node to the upstream data node;
and S15, determining a target flow control request corresponding to the maximum value of the message sending rate variation, and adjusting the message sending rate of the upstream data node according to the target flow control request.
Referring to the system shown in fig. 1 or fig. 3, if two downstream processing nodes, i.e., a processing node B and a processing node C, exist in a processing node a, it may occur that, in the same detection period, both the processing node B and the processing node C detect that their own actual message receiving amount is not within a preset flow threshold interval, and both generate a flow control request; and selecting one flow control request with the largest message sending rate variation caused to the processing node A by calculating and comparing the two flow control requests, and adjusting the message sending rate of the processing node A according to the selected flow control request.
Preferably, the message sending rate variation caused by the flow control request to the corresponding processing node can be measured by the message sending delay time T _ delay described above.
In the above embodiment, a plurality of flow control requests are received at the same upstream data node, and one flow control request is screened out according to the magnitude of the variation caused by the message sending rate of the upstream data node by each flow control request, so as to adjust the message sending rate of the upstream data node, thereby reducing the number of adjustment times, reducing the workload of flow control, avoiding system jitter caused by frequent adjustment in a short time, and improving the stability of the system.
Preferably, the coordinator described in the above embodiment may execute the above steps S14 and S15, and send the target flow control request determined in step S15 to the controller of the corresponding upstream data node, so as to avoid the resource occupation of the memory and the like of the upstream data node by the screening process.
In a possible embodiment of the present application, the message traffic control method may further include the following steps:
s16, storing the flow control state of each processing node to a preset storage module;
and S17, synchronizing the flow control state stored in the preset storage module to the corresponding processing node according to a preset period.
Taking Storm, Jstorm, and other real-time computing systems as examples, the preset storage module may be a coordination server external to the real-time computing system, such as ZooKeeper. Corresponding to the two flow control requests described above, i.e., the flow reduction request and the flow increase request, the flow control state includes at least two types: for any processing node, if it receives the flow reduction request, the corresponding flow control state is a flow reduction control state (that is, the processing node sends a message to a downstream processing node at a message sending rate lower than a default value); if it receives a flow-up request or does not receive any flow control request, its corresponding flow control state is a no control state (i.e., the processing node sends messages to downstream processing nodes at a default message sending rate).
In the above technical solution, the flow control states of the processing nodes are stored in real time and synchronized periodically, so that the processing nodes can still be in a correct flow control state after being restarted due to failure, and the stability of the system is further ensured.
Preferably, the above steps S16 and S17 may also be performed by the coordinator described above.
Corresponding to the embodiment of the message flow control method, the embodiment of the present application further provides a message flow control apparatus applied to a pipelined data processing system, and the pipelined data processing system includes a data source and a plurality of processing nodes; for convenience of description, the data source and the respective processing nodes will be collectively referred to as data nodes hereinafter. The message flow control device comprises: a trigger, disposed respectively in each of the processing nodes, and a controller, disposed respectively in each of the data nodes having downstream processing nodes. The topology of a data processing system provided with the above-described message flow control means can be seen in fig. 3.
The trigger is used for sampling the message receiving quantity of the processing node where the trigger is located, judging whether the actual message receiving quantity of the processing node where the trigger is located is within the preset flow threshold interval according to the sampling result, and generating a corresponding flow control request when the actual message receiving quantity of the processing node where the trigger is located is not within the preset flow threshold interval.
And the controller is used for adjusting the message sending rate of the data node where the controller is located according to the flow control request of the downstream processing node corresponding to the data node where the controller is located.
Specifically, as shown in fig. 5, a block diagram of a structure of any upstream data node 510 and a downstream data node 520 adjacent thereto in a data processing system provided with a message flow control device; in one specific case, the upstream data node 510 and the downstream data node 520 are processing nodes, and in another specific case, the upstream data node 510 is a data source and the downstream data node 520 is a processing node. The dashed boxes and arrows in fig. 5 indicate the structure and information flow that are present in one case and absent in another case.
Based on the upstream data node 510 and the downstream data node 520, the message flow control device works as follows: the trigger 521 of the downstream data node 520 samples the message receiving quantity of the downstream data node 520, and judges whether the actual message receiving quantity of the downstream data node 520 is within a preset flow threshold interval of the downstream data node 520 according to the sampling result, if not, a corresponding flow control request is generated, and the flow control request is sent to the controller 512 of the upstream data node 510; after receiving the flow control request sent by the trigger 521, the controller 512 adjusts the message sending rate of the upstream data node 510 according to the flow control request, so that the actual message receiving amount of the downstream data node 520 can be controlled within the preset flow threshold interval of the downstream data node 520.
According to the technical scheme, the message receiving quantity of each processing node is sampled, once the actual message receiving quantity of a certain processing node is not within the corresponding preset flow threshold interval, the corresponding flow control request is generated, and the message sending rate of the upstream data node corresponding to the processing node is adjusted according to the flow control request, so that the dynamic control of the message flow between any two adjacent upstream and downstream data nodes can be realized.
In a feasible embodiment of the present application, to determine whether the actual message receiving amount of the processing node where the trigger is located meets a preset flow threshold interval according to the sampling result, the trigger may be configured to: and calculating the ratio of the number of the sampling values which are acquired in a preset sampling period and are not in the preset flow threshold range to the total number of the sampling values in the preset sampling period, and judging that the actual message receiving quantity of the processing node is not in the preset flow threshold interval when the ratio is greater than a preset threshold.
Based on the above technical solution, as compared with the case where a flow control request is generated for each sampling value that is not within the preset flow threshold interval, in the above embodiment, when the proportion of the sampling values that exceed the preset flow threshold interval within a preset sampling period is greater than the preset threshold, the flow control request is generated, and the adjustment of the message sending rate of the upstream data node is started, which can avoid the problems of system jitter, reduced processing capability, and the like caused by frequent adjustment.
In a possible embodiment of the present application, to generate a corresponding flow control request when an actual message receiving amount of a processing node where the processing node is located is not within a preset flow threshold interval, the trigger may be configured to:
when the actual message receiving quantity of the processing node where the processing node is located is larger than a preset highest flow threshold value, generating a flow reduction request;
and when the actual message receiving quantity of the processing node where the processing node is located is larger than a preset minimum flow threshold value, generating a flow increasing request.
In a feasible embodiment of the present application, in order to adjust the message sending rate of the data node where the controller is located according to the flow control request of the downstream processing node corresponding to the data node where the controller is located, the controller may be configured to: and when the flow control request is the flow reduction request, determining message sending delay time according to the message processing rate of the downstream processing node and the original message sending rate of the data node where the downstream processing node is located, and overlapping the message sending delay time and the original message sending rate to obtain the target message sending rate of the data node where the downstream processing node is located.
In another possible embodiment of the present application, to adjust the message sending rate of the data node where the controller is located according to the flow control request of the downstream processing node corresponding to the data node where the controller is located, the controller may be configured to:
and when the flow control request is the flow increasing request, gradually increasing the message sending rate of the data node where the flow control request is located to a preset normal rate according to a preset rate adjusting step length.
In addition to the above triggers and controllers, the message flow control apparatus provided in the present application may further include a coordinator, where the coordinator is disposed in the data processing system in parallel with each processing node, and the coordinator is configured to obtain the flow control request generated by each trigger, and forward the flow control request to the corresponding upstream data node.
Fig. 6 is a topology diagram in which a coordinator is added to the system topology shown in fig. 3 and in which the message flow control device is installed. Referring to fig. 6, the coordinator K obtains the flow control requests of the trigger T _ a, the trigger T _ B, and the trigger T _ C, respectively, forwards the flow control request of the trigger T _ a to the controller C _ S of the data source S, and forwards the flow control requests of the trigger T _ B and the trigger T _ C to the controller C _ a of the processing node a, respectively.
In a possible embodiment of the present application, the coordinator may be specifically configured to: and if a plurality of flow control requests sent to the controller of the same upstream data node are obtained within a preset time period, the first coordinator determines the message sending rate variation caused by each flow control request to the same upstream data node, and sends the flow control request corresponding to the maximum value of the message sending rate variation to the controller of the same upstream data node.
Still referring to fig. 6, in a preset time period, the coordinator K obtains both the flow control request Q _ B of the trigger T _ B and the flow control request Q _ C of the trigger T _ C, and in order to reduce the number of times of adjusting the message sending rate of the upstream processing node a common to the flow control requests Q _ B and Q _ C and ensure the stability of the system, the coordinator K determines the message sending rate variation caused by the flow control requests Q _ B and Q _ C to the processing node a, and selects a flow control request with a large message sending rate variation, and if the flow control request Q _ B is assumed, the coordinator K only forwards the flow control request Q _ B to the controller C _ a and discards the flow control request Q _ C; correspondingly, the controller C _ a only needs to adjust the message sending rate of the processing node a according to the flow control request Q _ B.
In another possible embodiment of the present application, the coordinator is further configured to: storing the flow control state of each processing node to a preset storage module, and synchronizing the flow control state stored in the preset storage module to the corresponding processing node according to a preset period; therefore, the processing node can still be in a correct flow control state after being restarted in a failure mode, and the stability of the system is further ensured.
In addition, the present application further provides a data processing system, which includes a data source, a plurality of processing nodes, and the message flow control device described in any of the above embodiments. The structure diagram of the system can be shown in fig. 3 and fig. 6, and the flow control process can refer to the above method and apparatus embodiments, which are not described herein again.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus and system embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
The above-described embodiments of the present invention do not limit the scope of the present invention. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (11)

1. The message flow control method is applied to a data processing system, wherein the data processing system comprises a data source and a plurality of processing nodes; the method comprises the following steps:
respectively sampling the message receiving quantity of each processing node, and judging whether the actual message receiving quantity of the corresponding processing node is within a preset flow threshold interval according to the sampling result;
when the actual message receiving quantity of the first processing node is judged not to be within the preset flow threshold interval according to the sampling result corresponding to the first processing node, generating a corresponding flow control request;
adjusting the message sending rate of an upstream data node adjacent to the first processing node according to the flow control request; wherein the upstream data node may be the data source or a processing node;
when the actual message receiving quantity of the first processing node is judged not to be within a preset flow threshold interval according to the sampling result corresponding to the first processing node, generating a corresponding flow control request, wherein the flow control request comprises the following steps:
when the actual message receiving quantity of a first processing node is judged to be larger than a preset highest flow threshold value according to a sampling result corresponding to the first processing node, a flow reduction request is generated;
when the actual message receiving quantity of a first processing node is judged to be smaller than a preset minimum flow threshold value according to a sampling result corresponding to the first processing node, a flow increasing request is generated;
adjusting a message sending rate of an upstream data node adjacent to the first processing node according to the flow control request, including:
when the flow control request is the flow reduction request, determining message sending delay time according to the message processing rate of the first processing node and the original message sending rate of the upstream data node;
superposing the message sending delay time and the original message sending rate to obtain a target message sending rate of the upstream data node;
and when the flow control request is the flow increasing request, gradually reducing the message sending delay time so as to gradually increase the target message sending rate to the original message sending rate of the upstream data node.
2. The method of claim 1, wherein adjusting a message sending rate of an upstream data node adjacent to the first processing node based on the flow control request comprises:
and when the flow control request is the flow increasing request, gradually increasing the message sending rate of the upstream data node to a preset normal rate according to a preset rate adjustment step length.
3. The method of any of claims 1-2, wherein prior to adjusting a message sending rate of an upstream data node adjacent to the first processing node in accordance with the flow control request, the method further comprises:
if a plurality of downstream processing nodes corresponding to the upstream data node generate corresponding flow control requests in a preset time period, determining the message sending rate variable quantity of the upstream data node caused by the flow control request corresponding to each downstream processing node;
and determining a target flow control request corresponding to the maximum value of the message sending rate variation, so as to adjust the message sending rate of the upstream data node according to the target flow control request.
4. The method of any of claims 1 to 2, further comprising:
storing the flow control state of each processing node to a preset storage module;
and synchronizing the flow control state stored in the preset storage module to the corresponding processing node according to a preset period.
5. The method according to any one of claims 1 to 2, wherein determining whether the actual message receiving amount of the corresponding processing node is within the preset flow threshold interval according to the sampling result comprises:
for any processing node, calculating the ratio of the number of sampling values which are acquired in a preset sampling period and are not in a preset flow threshold interval to the total number of the sampling values in the preset sampling period;
and if the ratio is larger than a preset threshold, judging that the actual message receiving quantity of the corresponding processing node is not in the preset flow threshold interval.
6. The message flow control device is applied to a data processing system, wherein the data processing system comprises a data source and a plurality of processing nodes; the device comprises: a trigger and a controller;
the trigger is arranged in each processing node and is used for sampling the message receiving quantity of the processing node where the trigger is positioned, judging whether the actual message receiving quantity of the processing node where the trigger is positioned is within the preset flow threshold interval or not according to the sampling result, and generating a corresponding flow control request when the actual message receiving quantity of the processing node where the trigger is positioned is not within the preset flow threshold interval;
the controller is arranged in each data node with a downstream processing node and used for adjusting the message sending rate of the data node where the controller is located according to the flow control request of the downstream processing node corresponding to the data node where the controller is located; wherein the data node may be the data source or a processing node;
in order to generate a corresponding flow control request when the actual message receiving quantity of the processing node where the processing node is located is not within the preset flow threshold interval, the trigger is configured to:
when the actual message receiving quantity of the processing node where the processing node is located is larger than a preset highest flow threshold value, generating a flow reduction request;
when the actual message receiving quantity of the processing node where the processing node is located is larger than a preset minimum flow threshold value, generating a flow increasing request;
in order to realize that the message sending rate of the data node where the controller is located is adjusted according to the flow control request of the downstream processing node corresponding to the data node where the controller is located, the controller is configured to:
when the flow control request is the flow reduction request, determining message sending delay time according to the message processing rate of the downstream processing node and the original message sending rate of the data node where the downstream processing node is located, and overlapping the message sending delay time with the original message sending rate to obtain the target message sending rate of the data node where the downstream processing node is located;
and when the flow control request is the flow increasing request, gradually reducing the message sending delay time so as to gradually increase the target message sending rate to the original message sending rate of the upstream data node.
7. The apparatus according to claim 6, wherein to adjust the message sending rate of the data node where the controller is located according to the flow control request of the downstream processing node corresponding to the data node where the controller is located, the controller is configured to:
and when the flow control request is the flow increasing request, gradually increasing the message sending rate of the data node where the flow control request is located to a preset normal rate according to a preset rate adjusting step length.
8. The apparatus of any one of claims 6 to 7, further comprising: a first coordinator;
the first coordinator and each processing node are arranged in the data processing system in parallel, and are used for acquiring the flow control request sent by the trigger and forwarding the flow control request to the controller of the corresponding upstream data node;
if the first coordinator obtains a plurality of flow control requests sent to the controller of the same upstream data node within a preset time period, the first coordinator determines the message sending rate variation caused by each flow control request to the same upstream data node, and sends the flow control request corresponding to the maximum value of the message sending rate variation to the controller of the same upstream data node.
9. The apparatus of any one of claims 6 to 7, further comprising: a second coordinator;
the second coordinator and each processing node are arranged in the data processing system in parallel, and are configured to store the flow control state of each processing node to a preset storage module, and synchronize the flow control state stored in the preset storage module to the corresponding processing node according to a preset period.
10. The apparatus according to any one of claims 6 to 7, wherein to determine whether the actual message receiving amount of the processing node is within the preset flow threshold interval according to the sampling result, the trigger is configured to:
and calculating the ratio of the number of the sampling values which are acquired in a preset sampling period and are not in the preset flow threshold range to the total number of the sampling values in the preset sampling period, and judging that the actual message receiving quantity of the processing node is not in the preset flow threshold interval when the ratio is greater than a preset threshold.
11. A data processing system comprising a data source and a plurality of processing nodes, characterized in that the system further comprises a message flow control device according to any of claims 6 to 10.
CN201510999121.6A 2015-12-28 2015-12-28 Message flow control method, device and related system Active CN106921587B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201510999121.6A CN106921587B (en) 2015-12-28 2015-12-28 Message flow control method, device and related system
PCT/CN2016/110051 WO2017114165A1 (en) 2015-12-28 2016-12-15 Message traffic control method, apparatus, and related system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510999121.6A CN106921587B (en) 2015-12-28 2015-12-28 Message flow control method, device and related system

Publications (2)

Publication Number Publication Date
CN106921587A CN106921587A (en) 2017-07-04
CN106921587B true CN106921587B (en) 2020-07-10

Family

ID=59224508

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510999121.6A Active CN106921587B (en) 2015-12-28 2015-12-28 Message flow control method, device and related system

Country Status (2)

Country Link
CN (1) CN106921587B (en)
WO (1) WO2017114165A1 (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109428901B (en) * 2017-08-22 2021-07-30 中国电信股份有限公司 Message processing method and message processing device
CN108900477B (en) * 2018-06-08 2020-10-30 北京安控科技股份有限公司 Method for suppressing external network interference based on gateway
CN110858844A (en) * 2018-08-22 2020-03-03 阿里巴巴集团控股有限公司 Service request processing method, control method, device, system and electronic equipment
CN111385214B (en) * 2018-12-27 2023-11-17 阿里巴巴集团控股有限公司 Flow control method, device and equipment
CN111988348B (en) * 2019-05-22 2023-06-20 深圳顺丰泰森控股(集团)有限公司 Data acquisition method and Internet of vehicles control system
CN110377508A (en) * 2019-06-28 2019-10-25 北京威努特技术有限公司 A kind of the scanning speed method, apparatus and electronic equipment of improve data transfer port
CN110213137A (en) * 2019-06-28 2019-09-06 北京威努特技术有限公司 A kind of transmission speed limit detection method, device and the electronic equipment of the network equipment
CN110572299B (en) * 2019-08-30 2021-10-22 北京奇艺世纪科技有限公司 Equipment testing method, system, device, network node, terminal and storage medium
CN111355664A (en) * 2020-02-19 2020-06-30 中国农业银行股份有限公司 Flow control method and device
CN111343100B (en) * 2020-03-07 2023-07-25 深圳市中天网景科技有限公司 Speed limiting method, system and equipment for card-month flow package based on Internet of things
CN114553792A (en) * 2020-11-25 2022-05-27 华为技术有限公司 Method, device and equipment for adjusting scheduling parameters and computer readable storage medium
CN113364648B (en) * 2021-06-04 2024-02-13 百果园技术(新加坡)有限公司 Flow control method, system, device, service equipment and storage medium
CN114928572A (en) * 2022-02-28 2022-08-19 中国农业银行股份有限公司 Flow control method, device, medium and equipment of distributed system
CN115664951B (en) * 2022-12-08 2023-05-16 中冶南方(武汉)自动化有限公司 Self-adaptive industrial data acquisition method, system and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010130545A1 (en) * 2009-05-12 2010-11-18 Alcatel Lucent Traffic-load dependent power reduction in high-speed packet switching systems

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1290295C (en) * 2003-12-10 2006-12-13 北京邮电大学 Method for ensuring fair sharing of bandwidth among sites on resilient packet ring
CN101340358B (en) * 2007-07-04 2011-04-20 鼎桥通信技术有限公司 Flow control method, system and flow control entity
CN103944833A (en) * 2013-01-21 2014-07-23 中兴通讯股份有限公司 Method and device for flow control, and flow shaping system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010130545A1 (en) * 2009-05-12 2010-11-18 Alcatel Lucent Traffic-load dependent power reduction in high-speed packet switching systems

Also Published As

Publication number Publication date
WO2017114165A1 (en) 2017-07-06
CN106921587A (en) 2017-07-04

Similar Documents

Publication Publication Date Title
CN106921587B (en) Message flow control method, device and related system
CN109391557B (en) Congestion avoidance in network switch devices
KR101881409B1 (en) Multi-master selection in a software defined network
CN109905259B (en) Communication connection maintaining method, system and related equipment
US10462707B2 (en) Data transmission method and apparatus
CN107615709B (en) Forwarding unit and controller unit of SDN
WO2010100859A1 (en) Distributed system
US20060203855A1 (en) Communication control system and communication control method
CN107682279B (en) Time delay control method, time delay control device, storage medium and program product
CN113810304A (en) Load balancing method, device, equipment and computer storage medium
CN106797330B (en) Method, Traffic Monitor (TM), Request Router (RR) and system for monitoring a Content Delivery Network (CDN)
EP3190749B1 (en) Traffic control method and system
US8095228B2 (en) Data distribution apparatus, its control method, program, and storage medium
CN111078386A (en) Control method and control device of distributed scheduling system
EP3148130A1 (en) Traffic flow switching method and device
CN115378955A (en) Data processing method and related equipment
TWI777938B (en) Information flow control method, device and related system
KR100716170B1 (en) Apparatus and method for retrying function
US20050223056A1 (en) Method and system for controlling dataflow to a central system from distributed systems
CN113810383B (en) WEB application firewall, congestion control method, medium and electronic device
JP2014112779A (en) Data transmission controller, data transmission control method, and computer program
JP5747280B2 (en) Communication control system and communication control method
US20200136989A1 (en) Ring interconnect bandwidth allocation
CN111107016B (en) Network congestion control method, device, chip and storage medium
CN100571100C (en) A kind of method of smoothing burst frame radio of IP media stream

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant