TW201828059A - Message flow rate control method, apparatus and related system capable of reducing the amount of message discarding and increasing stability and processing efficiency of the overall data processing system - Google Patents

Message flow rate control method, apparatus and related system capable of reducing the amount of message discarding and increasing stability and processing efficiency of the overall data processing system Download PDF

Info

Publication number
TW201828059A
TW201828059A TW106102709A TW106102709A TW201828059A TW 201828059 A TW201828059 A TW 201828059A TW 106102709 A TW106102709 A TW 106102709A TW 106102709 A TW106102709 A TW 106102709A TW 201828059 A TW201828059 A TW 201828059A
Authority
TW
Taiwan
Prior art keywords
node
message
processing node
flow control
processing
Prior art date
Application number
TW106102709A
Other languages
Chinese (zh)
Other versions
TWI777938B (en
Inventor
劉鍵
封仲淹
方孝健
王逸
伍翀
Original Assignee
阿里巴巴集團服務有限公司
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 阿里巴巴集團服務有限公司 filed Critical 阿里巴巴集團服務有限公司
Priority to TW106102709A priority Critical patent/TWI777938B/en
Publication of TW201828059A publication Critical patent/TW201828059A/en
Application granted granted Critical
Publication of TWI777938B publication Critical patent/TWI777938B/en

Links

Abstract

The present invention discloses a message flow rate control method, an apparatus and a related system. The present invention performs sampling according to message receiving amount of each processing node. Once the actual message receiving amount of a processing node is not within a range of the corresponding predetermined flow rate threshold value, a corresponding flow rate control request is generated, and the message transmitting speed of an upstream data node corresponding to the processing node is adjusted according to the flow rate control request, so as to realize dynamic control of message flow rate between any two adjacent upstream and downstream data nodes. Compared with the prior art, the information transmitting rate of the data source is adjusted in particular according to the number of unprocessed messages of the last processing node, the present invention has higher control accuracy, and no message backlog or message idle occurs in any processing node, thereby reducing the amount of message discarding and improving the stability and processing efficiency of the overall data processing system.

Description

訊息流量控制方法、裝置及相關系統  Message flow control method, device and related system  

本發明關於分散式即時計算技術領域,特別是關於訊息流量控制方法、裝置及相關系統。 The invention relates to the field of distributed real-time computing technology, in particular to a message flow control method, device and related system.

現有資料處理系統大多採用流水線式處理方式,如圖1所示拓撲圖,訊息從資料來源S發出後,依照各個處理節點之間的邏輯關係逐步向下游流動;處理節點的總個數及每條流水線上的節點個數根據實際資料處理邏輯而定,圖1僅以A、B和C的三個處理節點為例,箭頭表示訊息流動方向。 Most of the existing data processing systems adopt a pipelined processing method. As shown in the topology diagram shown in Figure 1, after the message is sent from the data source S, it flows gradually downstream according to the logical relationship between the processing nodes; the total number of processing nodes and each The number of nodes on the pipeline depends on the actual data processing logic. Figure 1 only takes the three processing nodes A, B, and C as an example. The arrows indicate the direction of the message flow.

正常情況下,處於上游的資料來源或處理節點的訊息發送速率應當與相鄰的下游處理節點的訊息處理速率相匹配;如果因上游節點出現訊息流量高峰和/或下游處理節點的處理能力不夠,導致上游的訊息發送速率大於下游的訊息處理速率,則會造成大量的訊息積壓、處理器壓力增加,甚至導致部分訊息因處理超時而被丟棄,系統實際有效處理能力下降。特別是Storm、Jstorm、Spark streaming等即時計算系統,訊息流量不斷變化,在流量 高峰到來時,要求每個節點都能都能儘快有效的處理接收到的訊息,否則將影響其他正常運行的節點或計算任務。 Under normal circumstances, the message sending rate of the upstream source or processing node should match the message processing rate of the adjacent downstream processing node; if the upstream node has a message traffic peak and/or the downstream processing node has insufficient processing capacity, As a result, the upstream message transmission rate is greater than the downstream message processing rate, which causes a large amount of message backlog, processor pressure increase, and even some messages are discarded due to processing timeout, and the actual effective processing capability of the system is degraded. In particular, real-time computing systems such as Storm, Jstorm, and Spark streaming, the message traffic is constantly changing. When the traffic peaks, each node is required to process the received message as quickly as possible. Otherwise, it will affect other normal running nodes or Calculation task.

相關技術中採用如下流量控制策略:在資料來源配置一個流控值R0,表徵系統允許的未完成訊息數量,在系統運行過程中,根據流水線中最後一個處理節點的訊息處理情況確定實際未完成訊息數量R,如果R>R0,說明訊息流量過大,則控制資料來源減少訊息發送數量;反之,如果R<R0,說明訊息流量過小,則控制資料來源增加訊息發送數量。上述流量控制策略在實際應用中存在較嚴重的弊端;例如:如果上述流控值配置的太高,訊息丟棄量過高,仍然會造成系統的不穩定,但是流控值配置的太低時,又會造成計算資源的空閒。 In the related art, the following flow control strategy is adopted: a flow control value R0 is configured in the data source to represent the number of outstanding messages allowed by the system, and during the operation of the system, the actual uncompleted message is determined according to the message processing condition of the last processing node in the pipeline. The quantity R, if R>R0, indicates that the message traffic is too large, then the control data source reduces the number of message transmissions; conversely, if R<R0, indicating that the message traffic is too small, the control data source increases the number of message transmissions. The above traffic control policy has serious drawbacks in practical applications; for example, if the flow control value is configured too high and the message discarding amount is too high, the system instability will still occur, but when the flow control value is configured too low, It also causes the computing resources to be idle.

為了解決上述技術問題,本發明公開了一種訊息流量控制方法、裝置及相關系統。 In order to solve the above technical problem, the present invention discloses a message flow control method, apparatus and related system.

本發明第一態樣提供了一種訊息流量控制方法,所述方法應用於資料處理系統,所述資料處理系統包括資料來源和多個處理節點;所述方法包括:分別對每個處理節點的訊息接收量進行採樣,並根據採樣結果判斷對應處理節點的實際訊息接收量是否在其預設流量閾值區間內;在根據第一處理節點對應的採樣結果判定所述第一處理節點的實際訊息接收量不在其預設流量閾值區 間內時,產生對應的流量控制請求;根據所述流量控制請求調整與所述第一處理節點相鄰的上游資料節點的訊息發送速率;其中,所述上游資料節點可以為所述資料來源或者處理節點。 A first aspect of the present invention provides a message flow control method, the method being applied to a data processing system, the data processing system including a data source and a plurality of processing nodes; the method comprising: separately processing a message for each processing node Receiving, sampling, and determining, according to the sampling result, whether the actual message receiving amount of the corresponding processing node is within a preset traffic threshold interval; determining the actual message receiving amount of the first processing node according to the sampling result corresponding to the first processing node When not in the preset traffic threshold interval, the corresponding flow control request is generated; and the message sending rate of the upstream data node adjacent to the first processing node is adjusted according to the flow control request; wherein the upstream data node may For the data source or processing node.

結合第一態樣,在第一態樣第一種可行的實施方式中,在根據第一處理節點對應的採樣結果判定所述第一處理節點的實際訊息接收量不在預設流量閾值區間內時,產生對應的流量控制請求,包括:在根據第一處理節點對應的採樣結果判定所述第一處理節點的實際訊息接收量大於預設最高流量閾值時,產生流量降低請求;在根據第一處理節點對應的採樣結果判定所述第一處理節點的實際訊息接收量小於預設最低流量閾值時,產生流量升高請求。 In combination with the first aspect, in a first feasible implementation manner of the first aspect, when determining, according to the sampling result corresponding to the first processing node, that the actual message receiving amount of the first processing node is not within a preset traffic threshold interval And generating a corresponding flow control request, including: generating a traffic reduction request when determining that the actual message receiving amount of the first processing node is greater than a preset maximum traffic threshold according to the sampling result corresponding to the first processing node; When the sampling result corresponding to the node determines that the actual message receiving amount of the first processing node is less than the preset minimum traffic threshold, a traffic increase request is generated.

結合第一態樣第一種可行的實施方式,在第一態樣第二種可行的實施方式中,根據所述流量控制請求調整與所述第一處理節點相鄰的上游資料節點的訊息發送速率,包括:在所述流量控制請求為所述流量降低請求時,根據所述第一處理節點的訊息處理速率和所述上游資料節點的原始訊息發送速率確定訊息發送延遲時間;將所述訊息發送延遲時間與所述原始訊息發送速率進行疊加,得到所述上游資料節點的目標訊息發送速率。 In conjunction with the first possible implementation of the first aspect, in a second possible implementation manner of the first aspect, the sending of the information of the upstream data node adjacent to the first processing node is adjusted according to the flow control request The rate includes: when the flow control request is the traffic reduction request, determining a message sending delay time according to a message processing rate of the first processing node and an original message sending rate of the upstream data node; The sending delay time is superimposed with the original message sending rate to obtain a target message sending rate of the upstream data node.

結合第一態樣第一種可行的實施方式,在第一態樣第三種可行的實施方式中,根據所述流量控制請求調整與所述第一處理節點相鄰的上游資料節點的訊息發送速率,包括:在所述流量控制請求為所述流量升高請求時,根據預設速率調整步長逐步提高所述上游資料節點的訊息發送速率至預設正常速率。 In combination with the first possible implementation manner of the first aspect, in a third feasible implementation manner of the first aspect, the sending of the information of the upstream data node adjacent to the first processing node is adjusted according to the flow control request The rate includes: when the flow control request is the traffic increase request, gradually increasing the message sending rate of the upstream data node to a preset normal rate according to the preset rate adjustment step.

結合第一態樣,或者第一態樣第一種可行的實施方式,或者第一態樣第二種可行的實施方式,或者第一態樣第三種可行的實施方式,在第一態樣第四種可行的實施方式中,在根據所述流量控制請求調整與所述第一處理節點相鄰的上游資料節點的訊息發送速率之前,所述方法還包括:如果在預設時段內所述上游資料節點對應的多個下游處理節點均產生對應的流量控制請求,則確定每個下游處理節點對應的流量控制請求對所述上游資料節點造成的訊息發送速率變化量;確定訊息發送速率變化量最大值對應的目標流量控制請求,以根據所述目標流量控制請求調整所述上游資料節點的訊息發送速率。 Combining the first aspect, or the first feasible embodiment of the first aspect, or the second feasible implementation of the first aspect, or the third feasible implementation of the first aspect, in the first aspect In a fourth feasible implementation manner, 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 the And determining, by the plurality of downstream processing nodes corresponding to the upstream data node, a corresponding flow control request, determining a change rate of the message sending rate caused by the flow control request corresponding to each downstream processing node to the upstream data node; determining a change rate of the message sending rate The target flow control request corresponding to the maximum value is used to adjust the message sending rate of the upstream data node according to the target flow control request.

結合第一態樣,或者第一態樣第一種可行的實施方式,或者第一態樣第二種可行的實施方式,或者第一態樣第三種可行的實施方式,在第一態樣第五種可行的實施方式中,所述方法還包括: 將各個處理節點的流量控制狀態儲存至預設儲存模組;根據預設週期將所述預設儲存模組儲存的所述流量控制狀態同步至對應的處理節點。 Combining the first aspect, or the first feasible embodiment of the first aspect, or the second feasible implementation of the first aspect, or the third feasible implementation of the first aspect, in the first aspect In a fifth possible implementation, the method further includes: storing a flow control state of each processing node to a preset storage module; and storing the flow control state stored by the preset storage module according to a preset period Synchronize to the corresponding processing node.

結合第一態樣,或者第一態樣第一種可行的實施方式,或者第一態樣第二種可行的實施方式,或者第一態樣第三種可行的實施方式,在第一態樣第六種可行的實施方式中,根據採樣結果判斷對應處理節點的實際訊息接收量是否滿足在其預設流量閾值區間內,包括:對於任一處理節點,計算預設採樣週期內採集到的不在其預設流量閾值區間內的採樣值個數與所述預設採樣週期內的採樣值總個數之間的比值;如果所述比值大於預設閾值,則判定對應處理節點的實際訊息接收量不在其預設流量閾值區間內。 Combining the first aspect, or the first feasible embodiment of the first aspect, or the second feasible implementation of the first aspect, or the third feasible implementation of the first aspect, in the first aspect In the sixth feasible implementation manner, determining, according to the sampling result, whether the actual message receiving amount of the corresponding processing node is within the preset traffic threshold interval, including: calculating, for any processing node, the absent collected in the preset sampling period. The ratio between the number of sampled values in the preset flow threshold interval and the total number of sampled values in the preset sampling period; if the ratio is greater than the preset threshold, determining the actual message receiving amount of the corresponding processing node Not within its preset traffic threshold interval.

本發明第二態樣提供了一種訊息流量控制裝置,所述裝置應用於資料處理系統,所述資料處理系統包括資料來源和多個處理節點;所述裝置包括:觸發器和控制器;所述觸發器設置於每個處理節點中,用於對自身所在處理節點的訊息接收量進行採樣,並根據採樣結果判斷自身所在處理節點的實際訊息接收量是否在其預設流量閾值區間內,並在自身所在處理節點的實際訊息接收量不在其預設流量閾值區間內時,產生對應的流量控制請求; 所述控制器設置於每個具有下游處理節點的資料節點中,用於根據自身所在資料節點對應的下游處理節點的流量控制請求,調整自身所在資料節點的訊息發送速率;其中,所述資料節點可以為所述資料來源或者處理節點。 A second aspect of the present invention provides a message flow control apparatus, the apparatus being applied to a data processing system, the data processing system including a data source and a plurality of processing nodes; the apparatus comprising: a trigger and a controller; The trigger is set in each processing node, and is used for sampling the message receiving amount of the processing node where it is located, and determining whether the actual message receiving amount of the processing node where the processing node is located is within the preset traffic threshold interval according to the sampling result, and When the actual message receiving amount of the processing node is not within the preset traffic threshold interval, a corresponding flow control request is generated; the controller is disposed in each data node having a downstream processing node, and is used according to the data node where the processing node is located The flow control request of the corresponding downstream processing node adjusts the message sending rate of the data node where the data is located; wherein the data node may be the data source or the processing node.

結合第二態樣,在第二態樣第一種可行的實施方式中,為實現在自身所在處理節點的實際訊息接收量不在其預設流量閾值區間內時,產生對應的流量控制請求,所述觸發器被配置為:在自身所在處理節點的實際訊息接收量大於預設最高流量閾值時,產生流量降低請求;在自身所在處理節點的實際訊息接收量大於預設最低流量閾值時,產生流量升高請求。 In combination with the second aspect, in the first feasible implementation manner of the second aspect, the corresponding flow control request is generated when the actual message receiving amount of the processing node at the processing node is not within the preset traffic threshold interval. The trigger is configured to generate a traffic reduction request when the actual message receiving amount of the processing node at the processing node is greater than the preset maximum traffic threshold; and generate traffic when the actual message receiving amount of the processing node at the processing node is greater than the preset minimum traffic threshold. Raise the request.

結合第二態樣第一種可行的實施方式,在第二態樣第二種可行的實施方式中,為實現根據自身所在資料節點對應的下游處理節點的流量控制請求,調整自身所在資料節點的訊息發送速率,所述控制器被配置為:在所述流量控制請求為所述流量降低請求時,根據所述下游處理節點的訊息處理速率,以及自身所在資料節點的原始訊息發送速率確定訊息發送延遲時間,並將所述訊息發送延遲時間與所述原始訊息發送速率進行疊加,得到自身所在資料節點的目標訊息發送速率。 In combination with the first feasible implementation manner of the second aspect, in the second feasible implementation manner of the second aspect, in order to implement the flow control request according to the downstream processing node corresponding to the data node where the data node is located, the data node where the data node is located is adjusted. a message sending rate, the controller is configured to: when the flow control request is the traffic reduction request, determine a message according to a message processing rate of the downstream processing node, and an original message sending rate of the data node where the data node is located Delaying the time, and superimposing the message sending delay time and the original message sending rate to obtain a target message sending rate of the data node where the data node is located.

結合第二態樣第一種可行的實施方式,在第二態樣第三種可行的實施方式中,為實現根據自身所在資 料節點對應的下游處理節點的流量控制請求,調整自身所在資料節點的訊息發送速率,所述控制器被配置為:在所述流量控制請求為所述流量升高請求時,根據預設速率調整步長逐步提高自身所在資料節點的訊息發送速率至預設正常速率。 In combination with the first feasible implementation manner of the second aspect, in the third feasible implementation manner of the second aspect, in order to implement the flow control request according to the downstream processing node corresponding to the data node where the data node is located, the data node of the data node is adjusted. The message sending rate, the controller is configured to: when the flow control request is the traffic increase request, gradually increase the message sending rate of the data node where the data node is located to a preset normal rate according to the preset rate adjustment step.

結合第二態樣,或者第二態樣第一種可行的實施方式,或者第二態樣第二種可行的實施方式,或者第二態樣第三種可行的實施方式,在第二態樣第四種可行的實施方式中,所述裝置還包括:第一協調器;所述第一協調器與各個處理節點並列設置於所述資料處理系統中,用於獲取所述觸發器發送的流量控制請求,並將所述流量控制請求轉發至對應上游資料節點的控制器;其中,如果所述第一協調器在預設時段內獲取到多條向同一上游資料節點的控制器發送的流量控制請求,則所述第一協調器確定每條流量控制請求對所述同一上游資料節點造成的訊息發送速率變化量,並將訊息發送速率變化量最大值對應的流量控制請求發送至所述同一上游資料節點的控制器。 In combination with the second aspect, or the second aspect of the first feasible implementation, or the second aspect of the second possible implementation, or the second aspect of the third possible implementation, in the second aspect In a fourth possible implementation, the device further includes: a first coordinator; the first coordinator is disposed in parallel with each processing node in the data processing system, and configured to acquire the traffic sent by the trigger Controlling the request, and forwarding the flow control request to a controller corresponding to the upstream data node; wherein, if the first coordinator acquires multiple flow control sent to a controller of the same upstream data node within a preset time period And the first coordinator determines, by each flow control request, a message transmission rate change caused by the same upstream data node, and sends a flow control request corresponding to the maximum value of the message transmission rate change to the same upstream The controller of the data node.

結合第二態樣,或者第二態樣第一種可行的實施方式,或者第二態樣第二種可行的實施方式,或者第二態樣第三種可行的實施方式,在第二態樣第五種可行的實施方式中,所述裝置還包括:第二協調器;所述第二協調器與各個處理節點並列設置於 所述資料處理系統中,用於將各個處理節點的流量控制狀態儲存至預設儲存模組,並根據預設週期將所述預設儲存模組儲存的所述流量控制狀態同步至對應的處理節點。 In combination with the second aspect, or the second aspect of the first feasible implementation, or the second aspect of the second possible implementation, or the second aspect of the third possible implementation, in the second aspect In a fifth possible implementation, the apparatus further includes: a second coordinator; the second coordinator is disposed in parallel with each processing node in the data processing system, and is configured to control a flow control state of each processing node. And storing the flow control state stored by the preset storage module to a corresponding processing node according to a preset period.

結合第二態樣,或者第二態樣第一種可行的實施方式,或者第二態樣第二種可行的實施方式,或者第二態樣第三種可行的實施方式,在第二態樣第六種可行的實施方式中,為實現根據採樣結果判斷自身所在處理節點的實際訊息接收量是否滿足在其預設流量閾值區間內,所述觸發器被配置為:計算預設採樣週期內採集到的不在其預設流量閾值範圍內的採樣值個數與所述預設採樣週期內的採樣值總個數之間的比值,並在所述比值大於預設閾值時,判定自身所在處理節點的實際訊息接收量不在其預設流量閾值區間內。 In combination with the second aspect, or the second aspect of the first feasible implementation, or the second aspect of the second possible implementation, or the second aspect of the third possible implementation, in the second aspect In the sixth feasible implementation manner, in order to determine whether the actual message receiving amount of the processing node where the processing node is located is within the preset traffic threshold interval according to the sampling result, the trigger is configured to: calculate the preset sampling period and collect The ratio of the number of sampled values that are not within the preset flow threshold range to the total number of sampled values in the preset sampling period, and determines that the processing node is located when the ratio is greater than a preset threshold. The actual message received is not within its preset traffic threshold interval.

本發明協力廠商面提供一種資料處理系統,該系統包括資料來源、多個處理節點,以及上述任一種訊息流量控制裝置。 The third party of the present invention provides a data processing system including a data source, a plurality of processing nodes, and any of the above-described message flow control devices.

由以上技術方案可知,本發明實施例透過對每個處理節點的訊息接收量進行採樣,一旦某個處理節點的實際訊息接收量不在其對應的預設流量閾值區間內,則產生對應的流量控制請求,並根據該流量控制請求調整該處理節點對應的上游資料節點的訊息發送速率,從而可以實現對任意兩個相鄰上下游資料節點之間的訊息流量的動態控制,相對於現有技術只根據最後一個處理節點的未處 理訊息數量來調整資料來源的訊息發送速率的方式,本發明控制精度更高,任意一個處理節點都不會出現訊息積壓或空閒的現象,從而可以減少訊息丟棄量,提高整個資料處理系統的穩定性及處理效率。 According to the above technical solution, the embodiment of the present invention samples the received message amount of each processing node, and generates a corresponding flow control once the actual message receiving amount of a processing node is not within the corresponding preset traffic threshold interval. And requesting, according to the flow control request, adjusting a message sending rate of the upstream data node corresponding to the processing node, so that dynamic control of message traffic between any two adjacent upstream and downstream data nodes can be implemented, which is based on the prior art only The last method of processing the number of unprocessed messages of the node to adjust the message sending rate of the data source, the control precision of the present invention is higher, and any processing node does not have a message backlog or idle phenomenon, thereby reducing the amount of message discarding and improving The stability and processing efficiency of the entire data processing system.

510‧‧‧上游資料節點 510‧‧‧ upstream data node

512‧‧‧控制器 512‧‧‧ controller

520‧‧‧下游資料節點 520‧‧‧ downstream data node

521‧‧‧觸發器 521‧‧‧ Trigger

A‧‧‧處理節點 A‧‧‧ Processing node

B‧‧‧處理節點 B‧‧‧ Processing node

C‧‧‧處理節點 C‧‧‧ Processing node

C_A‧‧‧控制器 C_A‧‧‧ controller

C_S‧‧‧控制器 C_S‧‧‧ controller

K‧‧‧協調器 K‧‧‧ Coordinator

S‧‧‧資料來源 S‧‧‧Source

T_A‧‧‧觸發器 T_A‧‧‧ trigger

T_B‧‧‧觸發器 T_B‧‧‧ trigger

T_C‧‧‧協調服務模組 T_C‧‧‧ Coordination Service Module

為了更清楚地說明本發明實施例或現有技術中的技術方案,下面將對實施例或現有技術描述中所需要使用的附圖作簡單地介紹,顯而易見地,對於本領域普通技術人員而言,在不付出創造性勞動性的前提下,還可以根據這些附圖獲得其他的附圖。 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 embodiments or the description of the prior art will be briefly described below. Obviously, for those skilled in the art, Other drawings may also be obtained from these drawings without paying for inventive labor.

圖1為現有資料處理系統的一種拓撲結構圖;圖2為本發明實施例提供的一種訊息流量控制方法的流程圖;圖3為本發明實施例提供的一種資料處理系統的拓撲結構圖;圖4為本發明實施例提供的基於圖3所示拓撲結構的訊息流量控制方法的信號流圖;圖5為本發明實施例提供的訊息流量控制裝置的工作原理示意圖;圖6為本發明實施例提供的另一種資料處理系統的拓撲結構圖。 1 is a topological structural diagram 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 invention; FIG. 3 is a topological structural diagram of a data processing system according to an embodiment of the present invention; 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 invention; FIG. 5 is a schematic diagram of a working principle of a message flow control apparatus according to an embodiment of the present invention; A topology diagram of another data processing system provided.

這裡將詳細地對示例性實施例進行說明,其示例表示在附圖中。下面的描述關於附圖時,除非另有表示,不同附圖中的相同數字表示相同或相似的要素。以下示例性實施例中所描述的實施方式並不代表與本發明相一致的所有實施方式。相反,它們僅是與如所附申請專利範圍中所詳述的、本發明的一些態樣相一致的裝置和方法的例子。 Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. The following description of the drawings refers to 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 devices and methods consistent with aspects of the invention as detailed in the appended claims.

首先對本發明提供的訊息流量控制方法的實施例進行說明。該方法可以應用於任一包括資料來源和多個處理節點的流水線式資料處理系統,例如Storm、Jstorm、Spark streaming等即時計算系統,以調節流水線中各個節點之間的訊息流量,實現資料來源及任一處理節點的訊息發送速率與對應下游處理節點的訊息處理速率相匹配。 First, an embodiment of the message flow control method provided by the present invention will be described. The method can be applied to any pipelined data processing system including a data source and a plurality of processing nodes, such as an instant computing system such as Storm, Jstorm, Spark streaming, etc., to adjust the message flow between nodes in the pipeline to realize the data source and The message transmission rate of any processing node matches the message processing rate of the corresponding downstream processing node.

圖2為本發明一個實施例提供的訊息流.量控制方法的流程圖;參照圖2,該方法包括如下步驟。 2 is a flowchart of a message flow and quantity control method according to an embodiment of the present invention; referring to FIG. 2, the method includes the following steps.

S11、分別對每個處理節點的訊息接收量進行採樣,並根據採樣結果判斷對應處理節點的實際訊息接收量是否在其預設流量閾值區間內。 S11. Sampling the message receiving amount of each processing node separately, and determining, according to the sampling result, whether the actual message receiving amount of the corresponding processing node is within a preset traffic threshold threshold interval.

由於資料處理流水線中各個處理節點的處理能力及需要處理的訊息數量(即該處理節點的負載)不盡相同,本實施例預先針對每個處理節點分別設置對應的預設流量閾值區間;以圖1所示拓撲圖為例,需要採樣的節 點包括所有的三個處理節點,根據節點的處理能力及其負載,設置處理節點A對應的預設流量閾值區間為[A1,B1],處理節點B對應的預設流量閾值區間為[A2,B2],處理節點C對應的預設流量閾值區間為[A3,B3]。 Because the processing capability of each processing node in the data processing pipeline and the number of messages to be processed (that is, the load of the processing node) are different, the embodiment sets a corresponding preset traffic threshold interval for each processing node in advance; The topology diagram shown in 1 is taken as an example. The node to be sampled includes all three processing nodes. According to the processing capability of the node and its load, the preset traffic threshold interval corresponding to the processing node A is set to [A1, B1], and the processing node B is processed. The corresponding preset traffic threshold interval is [A2, B2], and the preset traffic threshold interval corresponding to the processing node C is [A3, B3].

在系統運行過程中,分別採樣每個處理節點的訊息接收量,即對應處理節點的負載,並分別根據各個處理節點的採樣結果判斷該處理節點的實際訊息接收量是否在其預設流量閾值區間內。仍以圖1為例,根據處理節點A的採樣結果判斷處理節點A的實際訊息接收量是否在處理節點A的對應的區間[A1,B1]內,對應的,根據處理節點B的採樣結果判斷處理節點B的實際訊息接收量是否在區間[A2,B2]內,依此類推。也即,透過步驟S11檢測每個處理節點的負載和其處理能力是否相匹配。 During the running of the system, the message receiving amount of each processing node is respectively sampled, that is, the load of the processing node is corresponding, and the actual message receiving amount of the processing node is determined according to the sampling result of each processing node according to the preset traffic threshold interval. Inside. Still taking FIG. 1 as an example, according to the sampling result of the processing node A, it is determined whether the actual message receiving amount of the processing node A is within the corresponding interval [A1, B1] of the processing node A, correspondingly, according to the sampling result of the processing node B. Whether the actual message reception amount of the processing node B is within the interval [A2, B2], and so on. That is, it is detected in step S11 whether the load of each processing node and its processing capability match.

S12、在根據第一處理節點對應的採樣結果判定所述第一處理節點的實際訊息接收量不在其預設流量閾值區間內時,產生對應的流量控制請求。 S12. Generate a corresponding flow control request when determining that the actual message receiving amount of the first processing node is not within the preset traffic threshold interval according to the sampling result corresponding to the first processing node.

S13、根據所述流量控制請求調整與所述第一處理節點相鄰的上游資料節點的訊息發送速率。 S13. Adjust a 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 its corresponding preset traffic threshold interval, that is, when the load of the processing node does not match its processing capability, a corresponding flow control request is generated, and according to the The flow control request adjusts the message sending rate of the upstream data node corresponding to the processing node.

其中,根據各個處理節點在流水線中所處的 位置不同,所述上游資料節點可能為資料來源,也可能為處理節點。以圖1為例,對於資料來源和處理節點A兩個節點,處理節點A相當於上述第一處理節點,資料來源S相當於上述上游資料節點;而對於處理節點A和處理節點B兩個節點,處理節點B相當於上述第一處理節點,處理節點A相當於上述上游資料節點。 The upstream data node may be a data source or a processing node according to different locations of the processing nodes in the pipeline. Taking FIG. 1 as an example, for two nodes of the data source and the processing node A, the processing node A is equivalent to the first processing node, the data source S is equivalent to the upstream data node, and the processing node A and the processing node B are two nodes. The processing node B corresponds to the first processing node, and the processing node A corresponds to the upstream data node.

由以上技術方案可知,本發明實施例透過對每個處理節點的訊息接收量進行採樣,一旦某個處理節點的實際訊息接收量不在其對應的預設流量閾值區間內,則產生對應的流量控制請求,並根據該流量控制請求調整該處理節點對應的上游資料節點的訊息發送速率,從而可以實現對任意兩個相鄰上下游資料節點之間的訊息流量的動態控制,相對於現有技術只根據最後一個處理節點的未處理訊息數量來調整資料來源的訊息發送速率的方式,本發明控制精度更高,任意一個處理節點都不會出現訊息積壓或空閒的現象,減少訊息丟棄量,提高整個資料處理系統的穩定性及處理效率。 According to the above technical solution, the embodiment of the present invention samples the received message amount of each processing node, and generates a corresponding flow control once the actual message receiving amount of a processing node is not within the corresponding preset traffic threshold interval. And requesting, according to the flow control request, adjusting a message sending rate of the upstream data node corresponding to the processing node, so that dynamic control of message traffic between any two adjacent upstream and downstream data nodes can be implemented, which is based on the prior art only The last method of processing the number of unprocessed messages of the node to adjust the message sending rate of the data source, the control precision of the present invention is higher, and any processing node does not have a message backlog or idle phenomenon, reducing the amount of message discarding and improving the entire data. Handling system stability and processing efficiency.

在本發明一個可行的實施例中,可以在資料處理系統的各個處理節點分別設置觸發器,透過該觸發器執行上述步驟S11和S12,同時,在資料來源及各個處理節點中設置控制器,透過該控制器執行上述步驟S13。仍以圖1為例,在本發明實施例中,在資料來源S中設置控制器C_S,在處理節點A中設置觸發器T_A和控制器C_A,在處理節點B中設置觸發器T_B,在處理節點C中 設置觸發器T_C,如圖3所示。圖3中實線箭頭表示各個節點之間的訊息傳輸方向,虛線箭頭表示各個節點之間的流量控制請求傳輸方向。需要說明的是,在圖3所示系統中,由於處理節點B和C的下游無其他處理節點,不需要發送訊息,故處理節點B和C中可以不設置對應的控制器,在其他實施例中,如果處理節點B和C的下游還存在其他處理節點,則可以在處理節點B和C中增設對應的控制器。基於圖3所示系統,各節點間訊息流量控制過程如圖4所示。 In a feasible embodiment of the present invention, a trigger may be separately disposed at each processing node of the data processing system, and the steps S11 and S12 are performed through the trigger, and at the same time, the controller is set in the data source and each processing node. The controller performs the above step S13. Still taking FIG. 1 as an example, in the embodiment of the present invention, the controller C_S is set in the data source S, the trigger T_A and the controller C_A are set in the processing node A, and the trigger T_B is set in the processing node B. The trigger T_C is set in node C, as shown in FIG. The solid arrows in Fig. 3 indicate the direction of message transmission between the nodes, and the dashed arrows indicate the direction of flow control request transmission between the nodes. It should be noted that, in the system shown in FIG. 3, since there are no other processing nodes downstream of the processing nodes B and C, there is no need to send a message, so the corresponding controllers may not be set in the processing nodes B and C, in other embodiments. If there are other processing nodes downstream of the processing nodes B and C, a corresponding controller may be added to the processing nodes B and C. Based on the system shown in Figure 3, the message flow control process between nodes is shown in Figure 4.

參照圖3和4,對於資料來源和處理節點A兩個節點,處理節點A相當於上述第一處理節點,資料來源S相當於上述上游資料節點,則:在步驟S111中,觸發器T_A對處理節點A的訊息接收量進行採樣,並根據採樣結果判斷其實際訊息接收量是否在對應的預設流量閾值區間[A1,B1]內;在步驟S121中,觸發器T_A在判定處理節點A的實際訊息接收量不在[A1,B1]內(大於B1,或者小於A1)時,也即處理節點A的負載和處理能力不匹配,則產生流量控制請求,並將其發送至資料來源S;在步驟S131中,控制器C_S根據觸發器T_A發送的流量控制請求調整資料來源S的訊息發送速率。透過上述步驟S111、S121和S131使得單位時間內發送至處理節點A的訊息數量,也即單位時間內處理節點A的實際訊息接收量,可以與處理節點A的訊息處理數量相匹 配,既可以避免資料來源S的訊息發送速率過大時,訊息在處理節點A中積壓,也可以避免資料來源S的訊息發送速率過小時,處理節點A空閒。 Referring to FIG. 3 and FIG. 4, for the two nodes of the data source and the processing node A, the processing node A is equivalent to the first processing node, and the data source S is equivalent to the upstream data node, then: in step S111, the trigger T_A is processed. The message receiving amount of the node A is sampled, and it is determined according to the sampling result whether the actual message receiving amount is within the corresponding preset traffic threshold threshold interval [A1, B1]; in step S121, the trigger T_A is determined to be the actual processing node A. When the message reception amount is not in [A1, B1] (greater than B1, or less than A1), that is, the load and processing capability of the processing node A do not match, a flow control request is generated and sent to the data source S; In 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 per unit time, that is, the actual message receiving amount of the processing node A per unit time, can be matched with the number of message processing of the processing node A, which can avoid When the message sending rate of the source S is too large, the message is accumulated in the processing node A, and the message sending rate of the data source S is too small, and the processing node A is idle.

對應的,對於處理節點A和處理節點B兩個節點,處理節點B相當於上述第一處理節點,處理節點A相當於上述上游資料節點,則:在步驟S112中,觸發器T_B對處理節點B的訊息接收量進行採樣,並根據採樣結果判斷其實際訊息接收量是否在對應的預設流量閾值區間[A2,B2]內;在步驟S122中,觸發器T_B在判定處理節點B的實際訊息接收量不在[A2,B2]內時,則產生流量控制請求,並將其發送至處理節點A;在步驟S132中,控制器C_A根據觸發器T_B發送的流量控制請求調整處理節點A向處理節點B發送訊息時的訊息發送速率。即,透過上述步驟S112、S122和S132使得單位時間內處理節點B的實際訊息接收量與訊息處理數量相匹配。 Correspondingly, for the two nodes of the processing node A and the processing node B, the processing node B is equivalent to the first processing node, and the processing node A is equivalent to the upstream data node, then: in step S112, the trigger T_B is paired with the processing node B. The received message amount is sampled, and it is judged according to the sampling result whether the actual message receiving amount is within the corresponding preset traffic threshold threshold interval [A2, B2]; in step S122, the trigger T_B is determined to process the actual message receiving of the processing node B. When the quantity is not in [A2, B2], a flow control request is generated and sent to the processing node A; in step S132, the controller C_A adjusts the processing node A to the processing node B according to the flow control request sent by the trigger T_B. The rate at which the message is sent when the message is sent. That is, the actual message reception amount of the processing node B per unit time is matched with the number of message processing through the above-described steps S112, S122, and S132.

對於處理節點A和處理節點C兩個節點,其訊息流量控制過程與上述步驟S112、S122和S132類似,本文不再贅述。 For the processing node A and the processing node C, the message flow control process is similar to the above steps S112, S122 and S132, and will not be described again herein.

在本發明一個可行的實施例中,上述步驟S11所述的根據採樣結果判斷對應處理節點的實際訊息接收量是否滿足在其預設流量閾值區間內,具體包括以下步驟:對於任一處理節點,計算預設採樣週期內採 集到的不在其預設流量閾值區間內的採樣值個數與所述預設採樣週期內的採樣值總個數之間的比值;如果所述比值大於預設閾值,則判定對應處理節點的實際訊息接收量不在其預設流量閾值區間內。 In a possible embodiment of the present invention, 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 according to the sampling result, specifically includes the following steps: for any processing node, Calculating a ratio between the number of sampled values that are not in the preset flow threshold range and the total number of sampled values in the preset sampling period that are collected in the preset sampling period; if the ratio is greater than the preset threshold, Then, it is determined that the actual message receiving amount of the corresponding processing node is not within the preset traffic threshold interval.

相對於針對每個不在其預設流量閾值區間內的採樣值產生一條流量控制請求,上述實施例在一個預設採樣週期內超出預設流量閾值區間的採樣值所占的比例大於預設閾值時,才產生流量控制請求,啟動對上游資料節點的訊息發送速率的調整,可以避免頻繁調整導致系統抖動、處理能力下降等問題。 A flow control request is generated for each sampling value that is not within the preset traffic threshold interval. In the above embodiment, when the proportion of the sample value exceeding the preset traffic threshold interval in a preset sampling period is greater than a 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 problems such as frequent system jitter and processing capability degradation.

在本發明一個可行的實施例中,上述步驟S12所述的根據第一處理節點對應的採樣結果判定所述第一處理節點的實際訊息接收量不在預設流量閾值區間內時,產生對應的流量控制請求,具體可以包括以下兩種情況:在根據第一處理節點對應的採樣結果判定所述第一處理節點的實際訊息接收量大於預設最高流量閾值時,產生流量降低請求;在根據第一處理節點對應的採樣結果判定所述第一處理節點的實際訊息接收量小於預設最低流量閾值時,產生流量升高請求。 In a feasible embodiment of the present invention, when the actual message receiving amount of the first processing node is not within the preset traffic threshold interval, the corresponding traffic is generated according to the sampling result corresponding to the first processing node. The control request may include the following two situations: when it is determined that the actual message receiving amount of the first processing node is greater than a preset maximum traffic threshold according to the sampling result corresponding to the first processing node, generating a traffic reduction request; When the sampling result corresponding to the processing node determines that the actual message receiving amount of the first processing node is less than the preset minimum traffic threshold, a traffic increase request is generated.

即,在系統流量高峰時段內,某個處理節點的實際訊息接收量大於預設最高流量閾值,則產生流量降低請求,以控制其上游資料節點降低訊息發送速率;隨著上游資料節點的訊息發送速率的降低,該處理節點的實際 訊息接收量也降低,當其降低至預設最低流量閾值以下時,產生流量升高請求,以停止對上游資料節點的訊息發送速率的降低控制,使其訊息發送速率逐步升高,直到恢復至正常值。 That is, during the peak traffic period of the system, when the actual message receiving amount of a 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 the message is sent along with the upstream data node. When the rate is decreased, the actual message receiving amount of the processing node is also decreased. When it is lower than the preset minimum traffic threshold, a traffic increase request is generated to stop the lowering of the message sending rate of the upstream data node, so that the message is changed. The send rate is gradually increased until it returns to normal.

在本發明一個可行的實施例中,上述流量控制請求中不僅包括用於指示上游資料節點升高或降低訊息發送速率的資訊,還包括產生該流量控制請求的處理節點的訊息處理速率;對應的,當流量控制請求為上述流量降低請求時,上述步驟S13所述的調整上游資料節點的訊息發送速率的方法為:在所述流量控制請求為所述流量降低請求時,根據所述第一處理節點的訊息處理速率和所述上游資料節點的原始訊息發送速率確定訊息發送延遲時間;將所述訊息發送延遲時間與所述原始訊息發送速率進行疊加,得到所述上游資料節點的目標訊息發送速率。 In a feasible embodiment of the present invention, the foregoing flow control request includes not only information for indicating that the upstream data node raises or lowers the message sending rate, but also a message processing rate of the processing node that generates the flow control request; When the flow control request is the traffic reduction request, the method for adjusting the message sending rate of the upstream data node in the foregoing step S13 is: when the flow control request is the traffic reduction request, according to the first processing The message processing rate of the node and the original message sending rate of the upstream data node determine a message sending delay time; superimposing the message sending delay time and the original message sending rate to obtain a target message sending rate of the upstream data node .

具體的,假設上述流量降低請求中包含第一處理節點的訊息處理速率為TPS_DownStream,對應上游資料節點的原始訊息發送速率為TPS_UpStream,由於流量控制請求為流量降低請求,可以推斷UpStream_TPS>TPS_DownStream,故需要在上游節點發送訊息時延遲一段時間T_delay(即上述訊息發送延遲時間),以降低UpStream_TPS;可以採用如下公式計算訊息發送延遲時間T_delay: T_delay=1/TPS_DownStream-1/UpStream_TPS。 Specifically, it is assumed that the message processing rate of the first processing node is TPS_DownStream, and the original message sending rate of the upstream data node is TPS_UpStream. The traffic control request is a traffic reduction request, and the UpStream_TPS>TPS_DownStream can be inferred. The upstream node sends a message with a delay of T_delay (that is, the above message transmission delay time) to reduce UpStream_TPS; the message transmission delay time T_delay can be calculated by the following formula: T_delay=1/TPS_DownStream-1/UpStream_TPS.

將上述T_delay與UpStream_TPS疊加可以得到調整後的訊息發送速率,也即上述目標訊息發送速率UpStream_TPS’;疊加計算公式可以為:UpStream_TPS’=1/[(1/UpStream_TPS)+T_delay]。 The above T_delay and UpStream_TPS are superimposed to obtain an adjusted message sending rate, that is, the target message sending rate UpStream_TPS'; the superposition calculation formula may be: UpStream_TPS'=1/[(1/UpStream_TPS)+T_delay].

另外,在實際的應用中,由於網路或者其他中間環節對訊息發送速率或者訊息處理速率有一定的影響,導致上游資料節點在應用調整後的訊息發送速率後,仍然收到下游處理節點的流量控制請求,故在本發明其他實施例中,還可以對在訊息發送延遲時間進行微調,即在T_delay的基礎上增加最小延遲單位T_min_adjust(可以為1毫秒)的微調,即:T_delay=1/TPS_DownStream-1/UpStream_TPS+T_min_adjust。 In addition, in the actual application, because the network or other intermediate links have a certain influence on the message sending rate or the message processing rate, the upstream data node still receives the traffic of the downstream processing node after applying the adjusted message sending rate. The request is controlled, so in other embodiments of the present invention, the fine adjustment of the message transmission delay time may be performed, that is, the fine adjustment of the minimum delay unit T_min_adjust (which may be 1 millisecond) is added on the basis of T_delay, that is, T_delay=1/TPS_DownStream -1/UpStream_TPS+T_min_adjust.

在本發明另一個可行的實施例中,當所述流量控制請求為所述流量升高請求時,上述步驟S13所述的調整上游資料節點的訊息發送速率的方法為:根據預設速率調整步長逐步提高所述上游資料節點的訊息發送速率至預設正常速率。 In another possible embodiment of the present invention, when the flow control request is the traffic increase request, the method for adjusting the message sending rate of the upstream data node in step S13 is: adjusting the step according to the preset rate. The message rate of the upstream data node is gradually increased to a preset normal rate.

即在收到流量升高請求時,逐步提高上游資料節點的訊息發送速率,而不是一次性恢復至預設正常速率;相對於上述基於訊息發送延遲時間T_delay的調整方式,在收到流量升高請求時,逐步減小T_delay的取值直至0,UpStream_TPS’也隨之逐步提高至UpStream_TPS。採用這種逐步提高訊息發送速率的方式,可以避免訊息積 壓,保證系統的穩定。 That is, when the traffic increase request is received, the message sending rate of the upstream data node is gradually increased, instead of being restored to the preset normal rate at one time; compared to the above-mentioned adjustment method based on the message sending delay time T_delay, the received traffic is increased. When requesting, gradually reduce the value of T_delay until 0, and UpStream_TPS' is gradually increased to UpStream_TPS. By adopting this method of gradually increasing the message transmission rate, the message backlog can be avoided and the system can be stabilized.

另外,在根據所述流量升高請求將上游資料節點的的訊息發送速率恢復至預設正常速率時,可以向對應的下游處理節點回饋回應資訊,以通知下游處理節點控制結束;對應的,下游處理節點在接收到該回應資訊後,不再發送請求,但仍然透過採樣檢測自身的實際訊息接收量是否在預設流量閾值區間內。 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, the response information may be returned to the corresponding downstream processing node to notify the downstream processing node that the control ends; correspondingly, downstream After receiving the response information, the processing node does not send the request, but still checks whether the actual message receiving amount of itself is within the preset traffic threshold interval.

在本發明一個可行的實施例中,步驟S12產生的流量控制請求可以直接由第一處理節點發送至對應的上游資料節點;在本發明另一個可行的實施例中,所述流量控制請求還可以透過一個獨立節點對流量控制請求進行轉發,該獨立節點接收各個處理節點的流量控制請求,確定其對應的上游資料節點,並將該流量控制請求轉發至該上游資料節點。可選的,基於上文實施例所述的在節點中設置觸發器及控制器,本實施例所述的獨立節點可以為設置於系統中的協調器。 In a feasible embodiment of the present invention, 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 feasible embodiment of the present invention, the flow control request may also be The flow control request is forwarded through an independent node, and the independent node receives the flow control request of each processing node, determines its corresponding upstream data node, and forwards the flow control request to the upstream data node. Optionally, the trigger and the controller are set in the node according to the foregoing embodiment, and the independent node in this embodiment may be a coordinator disposed in the system.

實際應用中,某個上游資料節點可能存在多個下游處理節點,則透過上述獨立節點接收並轉發流量控制請求的過程中,在同一檢測時段內,可能多個下游處理節點都檢測到自身的實際訊息接收量不在預設流量閾值區間內,從而都對應產生流量控制請求,如果分別依據每個下游處理節點的流量控制請求對該上游資料節點的訊息發送速率進行調整,則需要調整多次,不僅工作量大,還可能因頻繁調整導致系統不穩地。 In actual application, if there is a plurality of downstream processing nodes in an upstream data node, in the process of receiving and forwarding the flow control request through the independent node, in the same detection period, multiple downstream processing nodes may detect their actual conditions. The message receiving amount is not within the preset traffic threshold interval, so that the flow control request is 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, it needs to be adjusted multiple times, not only The workload is large, and the system may be unstable due to frequent adjustments.

有鑑於此,,在本發明一個可行的實施例中可以對發向同一上游資料節點的多條流量控制請求進行篩選,即,在根據所述流量控制請求調整與所述第一處理節點相鄰的上游資料節點的訊息發送速率(步驟S13)之前,上述訊息流量控制方法還可以包括如下步驟:S14、如果在預設時段內所述上游資料節點對應的多個下游處理節點均產生對應的流量控制請求,則確定每個下游處理節點對應的流量控制請求對所述上游資料節點造成的訊息發送速率變化量;S15、確定訊息發送速率變化量最大值對應的目標流量控制請求,以根據所述目標流量控制請求調整所述上游資料節點的訊息發送速率。 In view of the above, in a feasible embodiment of the present invention, a plurality of flow control requests sent to the same upstream data node may be filtered, that is, adjusted to be adjacent to the first processing node according to the flow control request. Before the message sending rate of the upstream data node (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 traffic within a preset time period Controlling the request, determining a message transmission rate change amount caused by the flow control request corresponding to each downstream processing node to the upstream data node; S15, determining a target flow control request corresponding to a maximum value of the message transmission rate change, according to the The target flow control request adjusts the message sending rate of the upstream data node.

參照圖1或圖3所示系統,處理節點A存在兩個下游處理節點,即處理節點B和處理節點C,則可能出現在同一個檢測時段內,處理節點B和處理節點C都檢測到自身的實際訊息接收量不在預設流量閾值區間內,都產生流量控制請求;對於這兩條流量控制請求,透過計算比較,選出對處理節點A造成的訊息發送速率變化量最大的一條流量控制請求,並根據選出的流量控制請求來調整處理節點A的訊息發送速率。 Referring to the system shown in FIG. 1 or FIG. 3, the processing node A has two downstream processing nodes, that is, the processing node B and the processing node C, which may occur in the same detection period, and both the processing node B and the processing node C detect themselves. The actual message receiving amount is not within the preset traffic threshold interval, and the flow control request is generated. For the two flow control requests, a flow control request that maximizes the change rate of the message transmission rate caused by the processing node A is selected through calculation and comparison. And adjusting the message sending rate of the processing node A according to the selected flow control request.

較佳的,可以透過上文所述的訊息發送延遲時間T_delay衡量流量控制請求對對應處理節點造成的訊息發送速率變化量大小。 Preferably, the message transmission delay rate T_delay described above can be used to measure the amount of change of the message transmission rate caused by the flow control request to the corresponding processing node.

上述實施例在同一上游資料節點收到多條流 量控制請求,根據各條流量控制請求對該上游資料節點的訊息發送速率造成的變化量大小進行篩選出一條流量控制請求,用於調整上游資料節點的訊息發送速率,從而可以減少調整次數,既可以減少流量控制的工作量,又可以避免短時間內頻繁調整導致的系統抖動,提高系統的穩定性。 In the above embodiment, the same upstream data node receives multiple flow control requests, and selects a flow control request for adjusting the amount of change caused by the message sending rate of the upstream data node according to each flow control request, and is used to adjust the upstream data node. The message transmission rate can reduce the number of adjustments, which can reduce the workload of flow control, avoid system jitter caused by frequent adjustments in a short period of time, and improve system stability.

較佳的,可以透過上文實施例所述的協調器執行上述步驟S14和S15,並將步驟S15確定的目標流量控制請求發送至對應上游資料節點的控制器,以避免篩選過程對上游資料節點的記憶體等資源的佔用。 Preferably, the foregoing steps S14 and S15 can be performed through the coordinator described in the foregoing embodiment, and the target flow control request determined in step S15 is sent to the controller corresponding to the upstream data node, so as to avoid the screening process on the upstream data node. The occupation of resources such as memory.

在本發明一個可行的實施例中,上述訊息流量控制方法還可以包括如下步驟:S16、將各個處理節點的流量控制狀態儲存至預設儲存模組;S17、根據預設週期將所述預設儲存模組儲存的所述流量控制狀態同步至對應的處理節點。 In a feasible embodiment of the present invention, the message flow control method may further include the following steps: S16: storing a flow control state of each processing node to a preset storage module; and S17, setting the preset according to a preset period. The flow control state stored by the storage module is synchronized to the corresponding processing node.

以Storm、Jstorm等即時計算系統為例,上述預設儲存模組可以為即時計算系統外部的協調伺服器,如ZooKeeper。對應於上文所述的兩種流量控制請求,即流量降低請求和流量升高請求,所述流量控制狀態至少包括兩種:對於任一處理節點,如果其接收到流量降低請求,則其對應的流量控制狀態為降流控制狀態(即該處理節點以低於預設值的訊息發送速率向下游處理節點發送訊息);如果其接收到流量升高請求或未接收到任何流量控 制請求,則其對應的流量控制狀態為無控制狀態(即該處理節點以預設的訊息發送速率向下游處理節點發送訊息)。 Taking an instant computing system such as Storm and Jstorm as an example, the preset storage module may be a coordination server external to the instant computing system, such as ZooKeeper. Corresponding to the two flow control requests described above, that is, the traffic reduction request and the traffic increase request, the flow control state includes at least two types: for any processing node, if it receives the traffic reduction request, it corresponds to The flow control state is the downflow control state (ie, the processing node sends a message to the downstream processing node at a message sending rate lower than a preset value); if it receives the traffic increase request or does not receive any flow control request, then The corresponding flow control state is an uncontrolled state (ie, the processing node sends a message to the downstream processing node at a preset message sending rate).

以上技術方案中,透過對各個處理節點的流量控制狀態的即時儲存並定期同步,可以保證處理節點在失效重啟後,仍然可以處於正確的流量控制狀態下,進而保證系統的穩定性。 In the above technical solution, the instant storage and periodic synchronization of the flow control state of each processing node can ensure that the processing node can still be in the correct flow control state after the failure restart, thereby ensuring the stability of the system.

較佳的,上述步驟S16和S17也可以透過上文所述的協調器執行。 Preferably, the above steps S16 and S17 can also be performed by the coordinator described above.

與上述訊息流量控制方法的實施例相對應,本發明實施例還提供了一種應用於流水線式資料處理系統的訊息流量控制裝置,且該流水線式資料處理系統包括資料來源和多個處理節點;為便於描述,下文將所述資料來源和各個處理節點統稱為資料節點。所述訊息流量控制裝置包括:分別設置於所述每個處理節點中的觸發器,和分別設置於每個具有下游處理節點的資料節點中的控制器。設置有上述訊息流量控制裝置的資料處理系統的拓撲結構可參照圖3。 Corresponding to the foregoing embodiment of the message flow control method, the embodiment of the present invention further provides a message flow control device 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 each processing node will be collectively referred to as a data node hereinafter. The message flow control device includes: triggers respectively disposed in each of the processing nodes, and controllers respectively disposed in each of the data nodes having the downstream processing nodes. The topology of the data processing system provided with the above message flow control device can be referred to FIG.

其中,所述觸發器用於,對自身所在處理節點的訊息接收量進行採樣,並根據採樣結果判斷自身所在處理節點的實際訊息接收量是否在其預設流量閾值區間內,並在自身所在處理節點的實際訊息接收量不在其預設流量閾值區間內時,產生對應的流量控制請求。 The trigger is configured to sample the received message amount of the processing node where the processing node is located, and determine whether the actual message receiving amount of the processing node where the processing node is located is within the preset traffic threshold interval according to the sampling result, and is at the processing node where the processing node is located. When the actual message receiving amount is not within the preset traffic threshold interval, a corresponding flow control request is generated.

所述控制器用於,根據自身所在資料節點對 應的下游處理節點的流量控制請求,調整自身所在資料節點的訊息發送速率。 The controller is configured to adjust a message sending rate of the data node where the data node is located according to the flow control request of the downstream processing node corresponding to the data node where the data node is located.

具體的,如圖5所示的設置有訊息流量控制裝置的資料處理系統中任意一個上游資料節點510和與其相鄰的一個下游資料節點520結構方塊圖;其中,一種具體情況下,該上游資料節點510和下游資料節點520都為處理節點,另一種具體情況下,該上游資料節點510為資料來源,下游資料節點520為處理節點。圖5中的虛線方塊及虛線箭頭表示在一種情況下存在,另一種情況下不存在的結構及資訊流向。 Specifically, as shown in FIG. 5, a block diagram of any one of the upstream data node 510 and a downstream data node 520 adjacent to the data processing system provided with the message flow control device; wherein, in a specific case, the upstream data Both the node 510 and the downstream data node 520 are processing nodes. 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 and dashed arrows in Fig. 5 indicate the structure and information flow that exist in one case and not exist in the other.

基於該上游資料節點510和下游資料節點520,上述訊息流量控制裝置的工作過程如下:下游資料節點520的觸發器521對該下游資料節點520的訊息接收量進行採樣,並根據採樣結果判斷下游資料節點520的實際訊息接收量是否在下游資料節點520的預設流量閾值區間內,如果不在,則產生對應的流量控制請求,並將該流量控制請求發送至上游資料節點510的控制器512;控制器512在接收到觸發器521發送的流量控制請求後,根據該流量控制請求調整上游資料節點510的訊息發送速率,從而可以將下游資料節點520的實際訊息接收量控制在下游資料節點520的預設流量閾值區間內。 Based on the upstream data node 510 and the downstream data node 520, the operation process of the message flow control device is as follows: the trigger 521 of the downstream data node 520 samples the message receiving amount of the downstream data node 520, and determines the downstream data according to the sampling result. Whether the actual message reception amount of the node 520 is within the preset traffic threshold interval of the downstream data node 520, if not, generating a corresponding flow control request, and transmitting the flow control request to the controller 512 of the upstream data node 510; After receiving the flow control request sent by the trigger 521, the device 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 by the downstream data node 520. Set the flow threshold within the interval.

由以上技術方案可知,本發明實施例透過對每個處理節點的訊息接收量進行採樣,一旦某個處理節點的實際訊息接收量不在其對應的預設流量閾值區間內,則 產生對應的流量控制請求,並根據該流量控制請求調整該處理節點對應的上游資料節點的訊息發送速率,從而可以實現對任意兩個相鄰上下游資料節點之間的訊息流量的動態控制,相對於現有技術只根據最後一個處理節點的未處理訊息數量來調整資料來源的訊息發送速率的方式,本發明控制精度更高,任意一個處理節點都不會出現訊息積壓或空閒的現象,減少訊息丟棄量,提高整個資料處理系統的穩定性及處理效率。 According to the above technical solution, the embodiment of the present invention samples the received message amount of each processing node, and generates a corresponding flow control once the actual message receiving amount of a processing node is not within the corresponding preset traffic threshold interval. And requesting, according to the flow control request, adjusting a message sending rate of the upstream data node corresponding to the processing node, so that dynamic control of message traffic between any two adjacent upstream and downstream data nodes can be implemented, which is based on the prior art only The last method of processing the number of unprocessed messages of the node to adjust the message sending rate of the data source, the control precision of the present invention is higher, and any processing node does not have a message backlog or idle phenomenon, reducing the amount of message discarding and improving the entire data. Handling system stability and processing efficiency.

在本發明一個可行的實施例中,為實現根據採樣結果判斷自身所在處理節點的實際訊息接收量是否滿足在其預設流量閾值區間內,上述觸發器可以被配置為:計算預設採樣週期內採集到的不在其預設流量閾值範圍內的採樣值個數與所述預設採樣週期內的採樣值總個數之間的比值,並在所述比值大於預設閾值時,判定自身所在處理節點的實際訊息接收量不在其預設流量閾值區間內。 In a feasible embodiment of the present invention, in order to determine whether the actual message receiving amount of the processing node where the processing node is located is within the preset traffic threshold interval according to the sampling result, the trigger may be configured to: calculate the preset sampling period. The ratio between the number of sampled values that are not within the preset flow threshold range and the total number of sampled values in the preset sampling period, and determines that the processing is performed when the ratio is greater than a preset threshold. The actual message reception of the node is not within its preset traffic threshold interval.

基於以上技術方案,相對於針對每個不在其預設流量閾值區間內的採樣值產生一條流量控制請求,上述實施例在一個預設採樣週期內超出預設流量閾值區間的採樣值所占的比例大於預設閾值時,才產生流量控制請求,啟動對上游資料節點的訊息發送速率的調整,可以避免頻繁調整導致系統抖動、處理能力下降等問題。 Based on the foregoing technical solution, a proportion of the sample value exceeding the preset traffic threshold interval in a preset sampling period is generated with respect to generating a flow control request for each sample value that is not within the preset traffic threshold interval. When the threshold is greater than the preset threshold, the traffic control request is generated, and the message sending rate of the upstream data node is adjusted to avoid frequent adjustments, such as system jitter and processing capability.

在本發明一個可行的實施例中,為實現在自身所在處理節點的實際訊息接收量不在其預設流量閾值區間內時,產生對應的流量控制請求,上述觸發器可以被配 置為:在自身所在處理節點的實際訊息接收量大於預設最高流量閾值時,產生流量降低請求;在自身所在處理節點的實際訊息接收量大於預設最低流量閾值時,產生流量升高請求。 In a feasible embodiment of the present invention, in order to implement a corresponding flow control request when the actual message receiving amount of the processing node at the processing node is not within the preset traffic threshold interval, the trigger may be configured to: When the actual message receiving amount of the processing node is greater than the preset maximum traffic threshold, a traffic reduction request is generated; when the actual message receiving amount of the processing node at the processing node is greater than the preset minimum traffic threshold, a traffic increase request is generated.

在本發明一個可行的實施例中,為實現根據自身所在資料節點對應的下游處理節點的流量控制請求,調整自身所在資料節點的訊息發送速率,上述控制器可以被配置為:在所述流量控制請求為所述流量降低請求時,根據所述下游處理節點的訊息處理速率,以及自身所在資料節點的原始訊息發送速率確定訊息發送延遲時間,並將所述訊息發送延遲時間與所述原始訊息發送速率進行疊加,得到自身所在資料節點的目標訊息發送速率。 In a feasible embodiment of the present invention, in order to implement a flow control request of a downstream processing node corresponding to the data node where the data node is located, and adjust a message sending rate of the data node where the data node is located, the controller may be configured to: When the request is the traffic reduction request, determining a 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 data node is located, and sending the message sending delay time and the original message The rate is superimposed to obtain the target message transmission rate of the data node where it is located.

在本發明另一個可行的實施例中,為實現根據自身所在資料節點對應的下游處理節點的流量控制請求,調整自身所在資料節點的訊息發送速率,上述控制器可以被配置為:在所述流量控制請求為所述流量升高請求時,根據預設速率調整步長逐步提高自身所在資料節點的訊息發送速率至預設正常速率。 In another possible embodiment of the present invention, in order to implement a flow control request of a downstream processing node corresponding to the data node where the data node is located, and adjust a message sending rate of the data node where the data node is located, the controller may be configured to: When the control request is the traffic increase request, the step size is adjusted according to the preset rate to gradually increase the message sending rate of the data node where the data node is located to a preset normal rate.

除上述觸發器和控制器外,本發明提供的訊息流量控制裝置還可以包括協調器,該協調器與各個處理節點並列設置於所述資料處理系統中,該協調器用於獲取各個觸發器產生的流量控制請求,並將所述流量控制請求 轉發至對應的上游資料節點。 In addition to the trigger and the controller, the message flow control apparatus provided by the present invention may further include a coordinator, which is disposed in parallel with each processing node in the data processing system, and the coordinator is configured to acquire the generated by each trigger. A flow control request forwards the flow control request to a corresponding upstream data node.

圖6為在圖3所示設置有訊息流量控制裝置的系統拓撲結構上增設協調器後的拓撲結構圖。參照圖6,協調器K分別獲取觸發器T_A、觸發器T_B和觸發器T_C的流量控制請求,並將觸發器T_A的流量控制請求轉發至資料來源S的控制器C_S,將觸發器T_B和觸發器T_C的流量控制請求分別轉發至處理節點A的控制器C_A。 FIG. 6 is a topological structural diagram of the system topology structure provided with the message flow control device shown in FIG. 3 after adding a coordinator. Referring to FIG. 6, the coordinator K acquires the flow control request of the trigger T_A, the trigger T_B, and the trigger T_C, respectively, and forwards the flow control request of the trigger T_A to the controller C_S of the data source S, and triggers the trigger T_B and the trigger. The flow control request of the T_C is forwarded to the controller C_A of the processing node A, respectively.

在本發明一個可行的實施例中,上述協調器具體可以被配置為:在預設時段內獲取到多條向同一上游資料節點的控制器發送的流量控制請求,則所述第一協調器確定每條流量控制請求對所述同一上游資料節點造成的訊息發送速率變化量,並將訊息發送速率變化量最大值對應的流量控制請求發送至所述同一上游資料節點的控制器。 In a possible embodiment of the present invention, the coordinator may be configured to: obtain a plurality of flow control requests sent to a controller of the same upstream data node within a preset time period, where the first coordinator determines Each flow control request sends a rate change of the message to the same upstream data node, and sends a flow control request corresponding to the maximum value of the message transmission rate change to the controller of the same upstream data node.

仍參照上圖6,在預設時段內協調器K既獲取到觸發器T_B的流量控制請求Q_B,又獲取到觸發器T_C的流量控制請求Q_C,為減少對其共同的上游處理節點A的訊息發送速率調整次數,保證系統的穩定,協調器K分別確定流量控制請求Q_B和Q_C對處理節點A造成的訊息發送速率變化量,並選出訊息發送速率變化量較大的流量控制請求,假設為流量控制請求Q_B,則協調器K只將流量控制請求Q_B轉發至控制器C_A,將流量控制請求Q_C丟棄;對應的,控制器C_A只需根據流量控制 請求Q_B調整處理節點A的訊息發送速率。 Still referring to FIG. 6, in the 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, in order to reduce the message of the common upstream processing node A. The number of transmission rate adjustments ensures the stability of the system. The coordinator K determines the amount of change in the message transmission rate caused by the flow control request Q_B and Q_C to the processing node A, and selects a flow control request with a large change in the message transmission rate, which is assumed to be traffic. The control request Q_B, 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 invention, the coordinator is further configured to: store the flow control state of each processing node to the preset storage module, and store the preset storage module according to a preset period. The flow control state is synchronized to the corresponding processing node; thus, the processing node can still be in the correct flow control state after the failure restart, thereby ensuring the stability of the system.

另外,本發明實施例還提供了一種資料處理系統,該系統包括包括資料來源、多個處理節點,以及上文任一實施例所述的訊息流量控制裝置。該系統的結構圖可以參照圖3和圖6所示,其流量控制過程可參照上文方法及裝置實施例,本文不再贅述。 In addition, an embodiment of the present invention further provides a data processing system, including a data source, a plurality of processing nodes, and the message flow control device described in any of the above embodiments. The structure of the system can be referred to FIG. 3 and FIG. 6. For the flow control process, reference may be made to the above method and device embodiment, and details are not described herein.

本說明書中的各個實施例均採用漸進的方式描述,各個實施例之間相同相似的部分互相參見即可,每個實施例重點說明的都是與其他實施例的不同之處。尤其,對於裝置和系統實施例而言,由於其基本相似於方法實施例,所以描述的比較簡單,相關之處參見方法實施例的部分說明即可。 The various embodiments in the present specification are described in a gradual manner, and the same or similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the device and system embodiments, the description is relatively simple, since it is substantially similar to the method embodiment, and the relevant portions of the method embodiments can be referred to.

以上所述的本發明實施方式,並不構成對本發明保護範圍的限定。任何在本發明的精神和原則之內所作的修改、等同替換和改進等,均應包含在本發明的保護範圍之內。 The embodiments of the invention described above are not intended to limit the scope of the invention. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the invention are intended to be included within the scope of the invention.

Claims (15)

一種訊息流量控制方法,其特徵在於,應用於資料處理系統,該資料處理系統包括資料來源和多個處理節點;該方法包括:分別對每個處理節點的訊息接收量進行採樣,並根據採樣結果判斷對應處理節點的實際訊息接收量是否在其預設流量閾值區間內;在根據第一處理節點對應的採樣結果判定該第一處理節點的實際訊息接收量不在其預設流量閾值區間內時,產生對應的流量控制請求;根據該流量控制請求調整與該第一處理節點相鄰的上游資料節點的訊息發送速率;其中,該上游資料節點可以為該資料來源或者處理節點。  A message flow control method is characterized in that it is applied to a data processing system, the data processing system includes a data source and a plurality of processing nodes; the method comprises: separately sampling the message receiving amount of each processing node, and according to the sampling result Determining whether the actual message receiving amount of the corresponding processing node is within the preset traffic threshold interval; when determining that the actual message receiving amount of the first processing node is not within the preset traffic threshold interval according to the sampling result corresponding to the first processing node, Generating a corresponding flow control request; adjusting a message sending rate of the 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 the processing node.   根據申請專利範圍第1項所述的方法,其中,在根據該第一處理節點對應的採樣結果判定該第一處理節點的實際訊息接收量不在其預設流量閾值區間內時,產生對應的流量控制請求,包括:在根據第一處理節點對應的採樣結果判定該第一處理節點的實際訊息接收量大於預設最高流量閾值時,產生流量降低請求;在根據第一處理節點對應的採樣結果判定該第一處理節點的實際訊息接收量小於預設最低流量閾值時,產生流量升高請求。  The method of claim 1, wherein the corresponding traffic is generated when the actual message receiving amount of the first processing node is not within the preset traffic threshold interval according to the sampling result corresponding to the first processing node. The control request includes: when determining that the actual message receiving amount of the first processing node is greater than a preset maximum traffic threshold according to the sampling result corresponding to the first processing node, generating a traffic reduction request; determining, according to the sampling result corresponding to the first processing node When the actual message receiving amount of the first processing node is less than the preset minimum traffic threshold, a traffic increase request is generated.   根據申請專利範圍第2項所述的方法,其中,根據該流量控制請求調整與該第一處理節點相鄰的上游資料節點的該訊息發送速率,包括:在該流量控制請求為該流量降低請求時,根據該第一處理節點的訊息處理速率和該上游資料節點的原始訊息發送速率確定訊息發送延遲時間;將該訊息發送延遲時間與該原始訊息發送速率進行疊加,得到該上游資料節點的目標訊息發送速率。  The method of claim 2, wherein adjusting the message transmission rate of the upstream data node adjacent to the first processing node according to the flow control request comprises: the flow control request is the traffic reduction request Determining a message transmission delay time according to the message processing rate of the first processing node and the original message sending rate of the upstream data node; superimposing the message sending delay time and the original message sending rate to obtain the target of the upstream data node The rate at which the message is sent.   根據申請專利範圍第2項所述的方法,其中,根據該流量控制請求調整與該第一處理節點相鄰的上游資料節點的訊息發送速率,包括:在該流量控制請求為該流量升高請求時,根據預設速率調整步長逐步提高該上游資料節點的訊息發送速率至預設正常速率。  The method of claim 2, wherein the message transmission rate of the upstream data node adjacent to the first processing node is adjusted according to the flow control request, including: the flow control request is the traffic increase request The step of adjusting the step size according to the preset rate gradually increases the message sending rate of the upstream data node to a preset normal rate.   根據申請專利範圍第1至4項之任一項所述的方法,其中,在根據該流量控制請求調整與該第一處理節點相鄰的上游資料節點的訊息發送速率之前,該方法還包括:如果在預設時段內該上游資料節點對應的多個下游處理節點均產生對應的流量控制請求,則確定每個下游處理節點對應的流量控制請求對該上游資料節點造成的訊息發送速率變化量;確定訊息發送速率變化量最大值對應的目標流量控制 請求,以根據該目標流量控制請求調整該上游資料節點的訊息發送速率。  The method of any one of claims 1 to 4, wherein before the adjusting the message transmission rate of the upstream data node adjacent to the first processing node according to 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 within a preset time period, determining a message transmission rate change amount caused by the flow control request corresponding to each downstream processing node to the upstream data node; Determining a target flow control request corresponding to a maximum value of the message transmission rate change, to adjust a message sending rate of the upstream data node according to the target flow control request.   根據申請專利範圍第1至4項之任一項所述的方法,其中,還包括:將各個處理節點的流量控制狀態儲存至預設儲存模組;根據預設週期將該預設儲存模組儲存的該流量控制狀態同步至對應的處理節點。  The method of any one of claims 1 to 4, further comprising: storing a flow control state of each processing node to a preset storage module; and the preset storage module according to a preset period The stored flow control state is synchronized to the corresponding processing node.   根據申請專利範圍第1至4項之任一項所述的方法,其中,根據採樣結果判斷對應處理節點的實際訊息接收量是否滿足在其預設流量閾值區間內,包括:對於任一處理節點,計算預設採樣週期內採集到的不在其預設流量閾值區間內的採樣值個數與實際預設採樣週期內的採樣值總個數之間的比值;如果實際比值大於預設閾值,則判定對應處理節點的實際訊息接收量不在其預設流量閾值區間內。  The method according to any one of claims 1 to 4, wherein, according to the sampling result, it is determined whether the actual message receiving amount of the corresponding processing node is within the preset traffic threshold interval, including: for any processing node And calculating a ratio between the number of sample values that are not in the preset flow threshold range and the total number of sample values in the actual preset sampling period, and if the actual ratio is greater than the preset threshold, It is determined that the actual message receiving amount of the corresponding processing node is not within the preset traffic threshold interval.   一種訊息流量控制裝置,其特徵在於,應用於資料處理系統,該資料處理系統包括資料來源和多個處理節點;該裝置包括:觸發器和控制器;該觸發器設置於每個處理節點中,用於對自身所在處理節點的訊息接收量進行採樣,並根據採樣結果判斷自身所在處理節點的實際訊息接收量是否在其預設流量閾值區間內,並在自身所在處理節點的實際訊息接收量不在其預 設流量閾值區間內時,產生對應的流量控制請求;該控制器設置於每個具有下游處理節點的資料節點中,用於根據自身所在資料節點對應的下游處理節點的流量控制請求,調整自身所在資料節點的訊息發送速率;其中,該資料節點可以為該資料來源或者處理節點。  A message flow control device is characterized in that it is applied to a data processing system, the data processing system includes a data source and a plurality of processing nodes; the device includes: a trigger and a controller; the trigger is disposed in each processing node, It is used to sample the received message amount of the processing node where it is located, and judge whether the actual message receiving amount of the processing node where it is located is within the preset traffic threshold interval according to the sampling result, and the actual message receiving amount at the processing node where it is located is not When the preset traffic threshold is within the preset interval, a corresponding flow control request is generated; the controller is disposed in each data node having a downstream processing node, and is configured to adjust according to the flow control request of the downstream processing node corresponding to the data node where the data node is located The message sending rate of the data node where it is located; wherein the data node can be the data source or the processing node.   根據申請專利範圍第8項所述的裝置,其中,為實現在自身所在處理節點的實際訊息接收量不在其預設流量閾值區間內時,產生對應的流量控制請求,該觸發器被配置為:在自身所在處理節點的實際訊息接收量大於預設最高流量閾值時,產生流量降低請求;在自身所在處理節點的實際訊息接收量大於預設最低流量閾值時,產生流量升高請求。  The device according to claim 8, wherein the trigger is configured to: when the actual message receiving amount of the processing node at the processing node is not within the preset traffic threshold interval, the trigger is configured to: When the actual message receiving amount of the processing node is greater than the preset maximum traffic threshold, a traffic reduction request is generated; when the actual message receiving amount of the processing node at the processing node is greater than the preset minimum traffic threshold, a traffic increase request is generated.   根據申請專利範圍第9項所述的裝置,其中,為實現根據自身所在資料節點對應的下游處理節點的流量控制請求,調整自身所在資料節點的訊息發送速率,該控制器被配置為:在該流量控制請求為該流量降低請求時,根據該下游處理節點的訊息處理速率,以及自身所在資料節點的原始訊息發送速率確定訊息發送延遲時間,並將該訊息發送延遲時間與該原始訊息發送速率進行疊加,得到自身所在資料節點的目標訊息發送速率。  The device according to claim 9, wherein the controller is configured to: adjust the message sending rate of the data node where the data node is located according to the flow control request of the downstream processing node corresponding to the data node where the data node is located, and the controller is configured to: When the flow control request is the traffic reduction request, determining a 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 data node is located, and performing the message sending delay time and the original message sending rate. Superimpose to get the target message sending rate of the data node where it is located.   根據申請專利範圍第9項所述的系統,其中,為 實現根據自身所在資料節點對應的下游處理節點的流量控制請求,調整自身所在資料節點的訊息發送速率,該控制器被配置為:在該流量控制請求為該流量升高請求時,根據預設速率調整步長逐步提高自身所在資料節點的訊息發送速率至預設正常速率。  The system of claim 9, wherein the controller is configured to: adjust the message transmission rate of the data node according to the data processing node corresponding to the data node to which the data node is located, and the controller is configured to: When the flow control request is the traffic increase request, the step size is adjusted according to the preset rate to gradually increase the message sending rate of the data node where the data node is located to a preset normal rate.   根據申請專利範圍第8至11項之任一項所述的系統,其中,還包括:第一協調器;該第一協調器與各個處理節點並列設置於該資料處理系統中,用於獲取該觸發器發送的流量控制請求,並將該流量控制請求轉發至對應上游資料節點的控制器;其中,如果該第一協調器在預設時段內獲取到多條向同一上游資料節點的控制器發送的流量控制請求,則該第一協調器確定每條流量控制請求對該同一上游資料節點造成的訊息發送速率變化量,並將訊息發送速率變化量最大值對應的流量控制請求發送至該同一上游資料節點的控制器。  The system of any one of clauses 8 to 11, wherein the method further includes: a first coordinator; the first coordinator is disposed in parallel with each processing node in the data processing system for acquiring the a flow control request sent by the trigger, and forwarding the flow control request to a controller corresponding to the upstream data node; wherein, if the first coordinator acquires multiple controllers that send to the same upstream data node within a preset time period The flow control request, the first coordinator determines a message transmission rate change caused by each flow control request to the same upstream data node, and sends a flow control request corresponding to the maximum value of the message transmission rate change to the same upstream The controller of the data node.   根據申請專利範圍第8至11項之任一項所述的系統,其中,還包括:第二協調器;該第二協調器與各個處理節點並列設置於該資料處理系統中,用於將各個處理節點的流量控制狀態儲存至預設儲存模組,並根據預設週期將該預設儲存模組儲存的該流 量控制狀態同步至對應的處理節點。  The system according to any one of claims 8 to 11, further comprising: a second coordinator; the second coordinator is disposed in parallel with each processing node in the data processing system for The flow control state of the processing node is stored in the preset storage module, and the flow control state stored by the preset storage module is synchronized to the corresponding processing node according to a preset period.   根據申請專利範圍第8至11項之任一項所述的系統,其中,為實現根據採樣結果判斷自身所在處理節點的實際訊息接收量是否滿足在其預設流量閾值區間內,該觸發器被配置為:計算預設採樣週期內採集到的不在其預設流量閾值範圍內的採樣值個數與該預設採樣週期內的採樣值總個數之間的比值,並在該比值大於預設閾值時,判定自身所在處理節點的實際訊息接收量不在其預設流量閾值區間內。  The system according to any one of claims 8 to 11, wherein the trigger is determined to determine whether the actual message reception amount of the processing node in which the processing node is located is within the preset traffic threshold interval according to the sampling result. The configuration is: calculating a ratio between the number of sampled values that are not within the preset flow threshold range and the total number of sampled values in the preset sampling period, and the ratio is greater than the preset. At the threshold, it is determined that the actual message received by the processing node at which it is located is not within its preset traffic threshold interval.   一種資料處理系統,包括資料來源和多個處理節點,其特徵在於,該系統還包括申請專利範圍第8項所述的訊息流量控制裝置。  A data processing system comprising a data source and a plurality of processing nodes, wherein the system further comprises the message flow control device according to claim 8 of the patent application.  
TW106102709A 2017-01-24 2017-01-24 Information flow control method, device and related system TWI777938B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW106102709A TWI777938B (en) 2017-01-24 2017-01-24 Information flow control method, device and related system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW106102709A TWI777938B (en) 2017-01-24 2017-01-24 Information flow control method, device and related system

Publications (2)

Publication Number Publication Date
TW201828059A true TW201828059A (en) 2018-08-01
TWI777938B TWI777938B (en) 2022-09-21

Family

ID=63960245

Family Applications (1)

Application Number Title Priority Date Filing Date
TW106102709A TWI777938B (en) 2017-01-24 2017-01-24 Information flow control method, device and related system

Country Status (1)

Country Link
TW (1) TWI777938B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111245732A (en) * 2018-11-29 2020-06-05 阿里巴巴集团控股有限公司 Flow control method, device and equipment

Family Cites Families (5)

* 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
US8130649B2 (en) * 2007-10-18 2012-03-06 Alcatel Lucent Ingress traffic flow control in a data communications system
GB2461244A (en) * 2008-02-29 2009-12-30 Francis P Kelly Network congestion control with feedback to adjust flow rates of source nodes.
US7961741B2 (en) * 2008-10-23 2011-06-14 Silver Spring Networks, Inc. Rapid dissemination of bulk information to widely dispersed network nodes

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111245732A (en) * 2018-11-29 2020-06-05 阿里巴巴集团控股有限公司 Flow control method, device and equipment
CN111245732B (en) * 2018-11-29 2024-04-19 阿里巴巴集团控股有限公司 Flow control method, device and equipment

Also Published As

Publication number Publication date
TWI777938B (en) 2022-09-21

Similar Documents

Publication Publication Date Title
WO2017114165A1 (en) Message traffic control method, apparatus, and related system
US9596281B2 (en) Transport accelerator implementing request manager and connection manager functionality
JP6672340B2 (en) System and method for regulating data flow
US7929436B2 (en) Network communication control methods and systems
CN106301684B (en) Media data transmission method and device
JP5010739B2 (en) Method and system for aggregate bandwidth control
US10200432B2 (en) HTTP streaming client adaptation algorithm based on proportional-integral control
KR20220007698A (en) Speed-optimized congestion management
EP2456142A1 (en) Methods and apparatus for detecting and limiting focused server overload in a network
US20150195162A1 (en) Multi-Master Selection in a Software Defined Network
US9930097B2 (en) Transport accelerator systems and methods
JP2004266840A (en) Controlling admission of data stream onto network based on end-to-end measurement
WO2017000719A1 (en) Congestion control method and device based on queue delay
WO2009073312A2 (en) Network bandwidth detection, distribution and traffic prioritization
WO2015096149A1 (en) Tcp link configuration method, apparatus and device
US11102273B2 (en) Uplink performance management
WO2022121469A1 (en) Flow control method, apparatus, and device, and readable storage medium
US9350669B2 (en) Network apparatus, performance control method, and network system
US20210399960A1 (en) Optimized data streaming detection and prioritization
US8095228B2 (en) Data distribution apparatus, its control method, program, and storage medium
TW201828059A (en) Message flow rate control method, apparatus and related system capable of reducing the amount of message discarding and increasing stability and processing efficiency of the overall data processing system
JP5308364B2 (en) Transmission device, transmission method, and program
US20130311668A1 (en) Methods And Systems For Providing Fairness And Stability To Video Streams
JP6885463B2 (en) Transmitter, bandwidth estimation device, bandwidth estimation system, method
CN115801639A (en) Bandwidth detection method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
GD4A Issue of patent certificate for granted invention patent