TW202129516A - A method and a system for a data transmission method based on asynchronous response - Google Patents
A method and a system for a data transmission method based on asynchronous response Download PDFInfo
- Publication number
- TW202129516A TW202129516A TW109127142A TW109127142A TW202129516A TW 202129516 A TW202129516 A TW 202129516A TW 109127142 A TW109127142 A TW 109127142A TW 109127142 A TW109127142 A TW 109127142A TW 202129516 A TW202129516 A TW 202129516A
- Authority
- TW
- Taiwan
- Prior art keywords
- flow rate
- data
- loading
- rate
- module
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
- G06F16/254—Extract, transform and load [ETL] procedures, e.g. ETL data flows in data warehouses
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/26—Flow control; Congestion control using explicit feedback to the source, e.g. choke packets
- H04L47/263—Rate modification at the source after receiving feedback
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Communication Control (AREA)
Abstract
Description
本發明涉及數據傳輸領域,尤其涉及一種基於非同步應答的傳輸數據的方法及系統 。The present invention relates to the field of data transmission, in particular to a method and system for transmitting data based on an asynchronous response.
在將數據從數據源傳輸至的數據目的端的過程中,通常使用能夠抽取數據、轉換數據的格式並將數據裝載到數據目的端的ETL(Extract-Transform-Load)系統。由於ETL 系統需要按照固定週期運行的經常發生的任務(例如,處理批量數據)並且ETL 系統對數據實時性要求不高,因此在對數據實時性要求很高的場景下難以使用傳統的ETL 系統。在傳輸數據的過程中,存在調節數據傳輸的流速的需求。一種常用的調節流速的方法是使用數據傳輸系統的系統負載作為硬指標進行調節,例如當系統負載高於某個閾值時,即禁止或降低流速,當系統負載開始降低時,則恢復流速。另一種常用的調節流速的方法是自適應限流保護方法,該方法使用數據傳輸系統的系統負載作為所控制的流速的啟動值,通過數 據傳輸系統的當前請求響應時間以及處理的請求速率來決定當前允許的流速,從而在數據傳輸系統不被拖垮的情況下提高流速,而不是一定要低於某個閾值。In the process of transferring data from the data source to the data destination, an ETL (Extract-Transform-Load) system that can extract data, convert the format of the data, and load the data to the data destination is usually used. Since the ETL system needs to run frequently occurring tasks (for example, processing batch data) in a fixed cycle and the ETL system does not require high real-time data, it is difficult to use the traditional ETL system in scenarios that require high real-time data. In the process of data transmission, there is a need to adjust the flow rate of data transmission. A commonly used method of adjusting the flow rate is to use the system load of the data transmission system as a hard indicator for adjustment. For example, when the system load is higher than a certain threshold, the flow rate is prohibited or reduced, and when the system load starts to decrease, the flow rate is restored. Another commonly used method of adjusting the flow rate is the adaptive current limiting protection method, which uses the system load of the data transmission system as the starting value of the controlled flow rate, which is determined by the current request response time of the data transmission system and the processing request rate The current flow rate allowed, so as to increase the flow rate without the data transmission system being worn down, rather than having to fall below a certain threshold.
為了盡可能地提高流速,還可以使用非同步應答的模式,即數據傳輸系統中的負責數據裝載的模組僅將數據發送至下游的數據目的端,無需等待具體的裝載結果,數據傳輸系統可以通過另外的模組對數據裝載的執行結果進行處理。換言之,在一個週期內裝載的數據不一定在當前週期內就能獲知該數據是否裝載成功。In order to increase the flow rate as much as possible, the asynchronous response mode can also be used, that is, the module responsible for data loading in the data transmission system only sends the data to the downstream data destination without waiting for the specific loading result. The data transmission system can The execution result of data loading is processed by another module. In other words, the data loaded in a cycle may not be able to know whether the data is successfully loaded in the current cycle.
然而,在使用非同步應答的模式的情況下,上述第一種方法由於將數據傳輸系統的系統負載作為硬指標,超過系統負載則不允許傳輸數據,因此限制了數據傳輸系統和數據目的端的處理能力,降低了數據傳輸系統的的數據傳輸量;此外,當下游的數據目的端發生故障或擴容等影響處理能力的事件時,該方法無法及時地感知並調整流速,可能導致數據傳輸系統的空閒或大批量數據丟失等異常情況。另外,對於上述第二種方法,該方法 根據數據傳輸系統的處理能力來調節流速,無法根據下游的數據目的端的處理能力來動態地控制流速,不適用數據目的端處理能力弱於數據傳輸系統處理能力的情況。However, in the case of using the asynchronous response mode, the first method mentioned above takes the system load of the data transmission system as a hard indicator, and data transmission is not allowed if the system load exceeds the system load, thus limiting the processing capacity of the data transmission system and the data destination. , Which reduces the data transmission volume of the data transmission system; in addition, when the downstream data destination fails or expands and other events that affect processing capabilities, this method cannot detect and adjust the flow rate in time, which may result in idle or idle data transmission systems. Abnormal situations such as loss of large quantities of data. In addition, for the second method mentioned above, the method adjusts the flow rate according to the processing capacity of the data transmission system, and cannot dynamically control the flow rate according to the processing capacity of the downstream data destination. It is not applicable to the data destination. The processing capacity is weaker than that of the data transmission system. Ability situation.
本發明的一方面提供一種基於非同步應答的傳輸數據的方法,包括:抽取步驟:在一週期中從第一數據端抽取並存儲所述數據;流速調節步驟:基於在所述週期的上一週期中由第二數據端反饋的裝載結果和在所述上一週期中傳輸所述數據的第一流速確定在所述週期中傳輸所述數據的第二流速;以及裝載步驟:在所述週期中根據所述第二流速將所述數據裝載到所述第二數據端。An aspect of the present invention provides a method for transmitting data based on an asynchronous response, which includes: an extraction step: extracting and storing the data from a first data terminal in a period; and a flow rate adjustment step: based on the previous period of the period The loading result fed back by the second data terminal in the cycle and the first flow rate at which the data was transmitted in the previous cycle determine the second flow rate at which the data is transmitted in the cycle; and the loading step: in the cycle Load the data to the second data terminal according to the second flow rate.
本發明的另一方面提供一種基於非同步應答的傳輸數據的方法,包括:抽取步驟:在一週期中從第一數據端抽取第一數據,將所述第一數據存儲在第一隊列中;流速調節步驟:基於在所述週期的上一週期中由第二數據端反饋的第一裝載結果和在所述上一週期傳輸所述數據的第一流速確定在所述週期中傳輸所述數據的第二流速;以及裝載步驟:在所述週期中根據所述第二流速將所述第一隊列內的所述第一數據和第二隊列內的第二數據裝載到所述第二數據端。Another aspect of the present invention provides a method for transmitting data based on an asynchronous response, including: an extraction step: extracting first data from a first data terminal in a cycle, and storing the first data in a first queue; Flow rate adjustment step: determining to transmit the data in the cycle based on the first loading result fed back by the second data terminal in the previous cycle of the cycle and the first flow rate at which the data was transmitted in the previous cycle And the loading step: load the first data in the first queue and the second data in the second queue to the second data terminal in the cycle according to the second flow rate .
本發明的又一方面提供一種基於非同步應答的傳輸數據的系統,包括:數據抽取模組,其用於在一週期中從第一數據端抽取並存儲所述數據;流速調節模組,其用於基於在所述週期的上一週期中由第二數據端反饋的裝載結果和在所述上一週期中傳輸所述數據的第一流速確定在所述週期中傳輸所述數據的第二流速;和數據裝載模組,其用於在所述週期中根據所述第二流速將所述數據裝載到所述第二數據端。Another aspect of the present invention provides a system for transmitting data based on an asynchronous response, including: a data extraction module for extracting and storing the data from a first data terminal in a cycle; and a flow rate adjustment module, which It is used to determine the second data transmission in the cycle based on the loading result fed back by the second data terminal in the previous cycle of the cycle and the first flow rate at which the data was transmitted in the previous cycle Flow rate; and a data loading module for loading the data to the second data terminal according to the second flow rate in the cycle.
本發明的又一方面提供一種基於非同步應答的傳輸數據的系統,包括:數據抽取模組,其用於在一週期中從第一數據端抽取第一數據,將所述第一數據存儲在第一隊列中;流速調節模組,其用於基於在所述週期的上一週期中由第二數據端反饋的第一裝載結果和在所述上一週期傳輸所述數據的第一流速確定在所述週期中傳輸所述數據的第二流速;以及數據裝載模組,其用於在所述週期中根據所述第二流速將所述第一隊列內的所述第一數據和第二隊列內的第二數據裝載到所述第二數據端。Another aspect of the present invention provides a system for transmitting data based on an asynchronous response, including: a data extraction module for extracting first data from a first data terminal in a cycle, and storing the first data in In the first queue; a flow rate adjustment module, which is used to determine based on the first loading result fed back by the second data terminal in the previous cycle of the cycle and the first flow rate at which the data was transmitted in the previous cycle The second flow rate for transmitting the data in the period; and a data loading module for storing the first data and the second data in the first queue according to the second flow rate in the period The second data in the queue is loaded to the second data terminal.
本發明的又一方面提供了一種計算機可讀介質,其上存儲有計算機可讀指令,所述計算機可讀指令被計算機執行時能夠執行根據本發明實施例所述的方法。Another aspect of the present invention provides a computer-readable medium having computer-readable instructions stored thereon, and the computer-readable instructions can execute the method according to the embodiments of the present invention when the computer-readable instructions are executed by a computer.
本發明的實施例能夠在非同步應答的情況下、根據反饋的裝載結果自動調節數據傳輸系統的流速,從而在保證數據目的端不被壓垮且減少數據丟失的前提條件下盡可能地提高數據傳輸系統的吞吐量。The embodiment of the present invention can automatically adjust the flow rate of the data transmission system according to the feedback loading result in the case of asynchronous response, thereby increasing the data as much as possible under the precondition of ensuring that the data destination is not overwhelmed and reducing data loss. The throughput of the transmission system.
上述說明僅是本發明技術方案的概述,為了能夠更清楚瞭解本發明的技術手段,而可依照說明書的內容予以實施,並且為了讓本發明的上述和其它 目的、特徵和優點能夠更明顯易懂,以下特舉本發明的具體實施方式。The above description is only an overview of the technical solution of the present invention. In order to understand the technical means of the present invention more clearly, it can be implemented in accordance with the content of the specification, and in order to make the above and other objectives, features and advantages of the present invention more obvious and understandable. In the following, specific embodiments of the present invention are specifically cited.
下面將參考若干示例性實施方式來描述本發明的原理和精神。應當理解,給出這些實施方式僅僅是為了使本領域技術人員能夠更好地理解進而實現本發明,而並非以任何方式限制本發明的範圍。相反,提供這些實施方式是為了使本公開更加透徹和完整,並且能夠將本公開的範圍完整地傳達給本領域的技術人員。The principle and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are given only to enable those skilled in the art to better understand and then implement the present invention, but not to limit the scope of the present invention in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
下面結合附圖對本發明的具體實施方式進行詳細描述。The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
圖1 示出了根據本發明的實施例的數據傳輸系統的示意圖。Fig. 1 shows a schematic diagram of a data transmission system according to an embodiment of the present invention.
如圖1 所示,該系統包括五個模組:數據抽取模組、數據裝載模組、非同步應答處理模組、定時掃描模組以及流速調節模組。該系統還包括待裝載數據隊列、待重載數據隊列和待確認數據 Map。As shown in Figure 1, the system includes five modules: a data extraction module, a data loading module, an asynchronous response processing module, a timing scan module, and a flow rate adjustment module. The system also includes a data queue to be loaded, a data queue to be reloaded, and a data map to be confirmed.
數據抽取模組可以從數據源抽取數據,將數據轉換格式後存入待裝載數據隊列,若隊列已滿則等待。在本文中,一個數據能夠代表一個業務,每個數據的大小可以不同。The data extraction module can extract data from the data source, convert the format of the data and store it in the data queue to be loaded, and wait if the queue is full. In this article, one piece of data can represent one piece of business, and the size of each piece of data can be different.
數據裝載模組可以從待裝載數據隊列中取出數據,並通過流速調節模組判斷當前是否可以向數據目的端裝載數據。數據裝載模組還可以包括正常數據裝載模組和失敗數據裝載模組,其分別用於裝載待裝載數據隊列和待重載數據隊列中的數據。在每次裝載數據時,數據裝載模組可以同時將數據存儲在待確認數據Map 中。在一些實施例中,待確認數據Map 是一種數據存儲結構,其可以用於臨時存儲從數據裝載模組轉存的數據。待確認數據Map中的Key字段存儲數據的身份標識,Value字段存儲數據的值。The data loading module can take out the data from the data queue to be loaded, and judge whether the data can be loaded to the data destination through the flow rate adjustment module. The data loading module may also include a normal data loading module and a failed data loading module, which are respectively used to load the data in the data queue to be loaded and the data queue to be reloaded. Each time data is loaded, the data loading module can simultaneously store the data in the to-be-confirmed data map. In some embodiments, the data map to be confirmed is a data storage structure that can be used to temporarily store data dumped from the data loading module. The Key field in the data map to be confirmed stores the identity of the data, and the Value field stores the value of the data.
非同步應答處理模組可以處理數據目的端反饋的處理結果(即被裝載的數據的裝載結果,該結果為成功或失敗),並統計成功或失敗的數據的量。對於處理結果為成功的數據,非同步應答處理模組可以直接從待確認數據Map 刪除該數據。對於處理結果為失敗的數據,非同步應答處理模組可以將 裝載失敗的數據從待確認數據 Map 發送到待重載數據隊列,以待被數據裝載模組裝載。如果某數據裝載失敗的次數超過預定次數(即,重裝載次數上限),則丟棄該數據。The asynchronous response processing module can process the processing result (that is, the loading result of the loaded data, which is success or failure) fed back by the data destination, and count the amount of successful or failed data. For the data whose processing result is successful, the asynchronous response processing module can directly delete the data from the to-be-confirmed data Map. For the data whose processing result is failure, the asynchronous response processing module can send the failed data from the data map to be confirmed to the data queue to be reloaded to be loaded by the data loading module. If the number of failures to load certain data exceeds the predetermined number (ie, the upper limit of the number of reloads), the data is discarded.
定時掃描模組可以通過掃描待確認數據Map 來統計超過一定時長仍未收到數據目的端的處理結果的數據(即未收到應答的超時數據),並將該數據從待確認數據 Map 發送到待重載數據隊列。定時掃描模組還可以通過掃描非同步應答處理模組中保存的、來自數據目的端的處理結果來計算當前週期內所統計的數據裝載的成功率,並將成功率發送到流速調節模組。The timing scan module can count the data that has not received the processing result of the data destination after a certain period of time by scanning the to-be-confirmed data map (that is, the timeout data that has not received the response), and send the data from the to-be-confirmed data map To the data queue to be reloaded. The timing scanning module can also calculate the statistical data loading success rate in the current cycle by scanning the processing results from the data destination stored in the asynchronous response processing module, and send the success rate to the flow rate adjustment module.
流速調節模組可以通過調整數據傳輸系統的TPS(Transaction Per Second,每秒業務處理量,例如每秒處理的交易的筆數)來實現流速控制。首先,可以設置一個最理想情況下的最大 TPS 值作為流速上限值,根據當前週期內數據裝載的成功率提高或降低數據傳輸系統的流速(TPS 值),從而實現系統的流速調節。The flow rate adjustment module can achieve flow rate control by adjusting the TPS (Transaction Per Second, transaction volume per second, such as the number of transactions processed per second) of the data transmission system. First, you can set an ideal maximum TPS value as the upper limit of the flow rate, and increase or decrease the flow rate (TPS value) of the data transmission system according to the success rate of data loading in the current cycle, so as to realize the flow rate adjustment of the system.
在圖2 中示出了數據抽取模組可以採用的用於抽取數據的方法。如圖2 所示,該方法包括如下步驟:Figure 2 shows the data extraction method that can be used by the data extraction module. As shown in Figure 2, the method includes the following steps:
(1)數據抽取模組從數據源抽取數據,並將數據按統一格式進行轉換;(1) The data extraction module extracts data from the data source and converts the data in a unified format;
(2)若此時待裝載隊列未滿,則將轉換完格式的數據直接存入其中,然後繼續執行步驟(1),否則執行步驟(3);(2) If the queue to be loaded is not full at this time, store the converted format data directly into it, and then continue to perform step (1), otherwise perform step (3);
(3)若待裝載隊列此時已滿,針對當前數據累加一次發送失敗次數, 如發送失敗次數未超過發送失敗次數的上限,則數據抽取模組休眠預定時間後重新執行步驟(2),否則將數據丟棄,開始重新執行步驟(1)。(3) If the queue to be loaded is full at this time, accumulate the number of transmission failures for the current data. If the number of transmission failures does not exceed the upper limit of the number of transmission failures, the data extraction module sleeps for a predetermined time and re-executes step (2), otherwise The data is discarded, and step (1) is executed again.
在圖3 中示出了數據裝載模組可以採用的裝載數據的方法的時序圖。如圖3 所示,數據裝載模組可以從待裝載數據隊列中獲取轉換完格式的數據。在獲取到待裝載的數據後,為保證當前數據傳輸系統的流速不超過允 許的流速上限值,數據裝載模組需要向流速調節模組申請允許裝載數據的令牌,只有獲取到令牌後,才能夠向數據目的端發送待被裝載的數據。Figure 3 shows a timing diagram of the method of loading data that the data loading module can use. As shown in Figure 3, the data loading module can obtain the converted format data from the data queue to be loaded. After obtaining the data to be loaded, in order to ensure that the current flow rate of the data transmission system does not exceed the allowable flow rate upper limit, the data loading module needs to apply to the flow rate adjustment module for a token that allows data to be loaded, only after the token is obtained , Can send the data to be loaded to the data destination.
流速調節模組在接收到關於令牌的申請時,檢查當前是否仍有可用的令牌,若暫無可用令牌則掛起該申請,等待新令牌生成。流速調節模組可以週期性地生成或清除令牌,例如,在每個週期結束時清空剩餘令牌,同 時生成數量與當前系統允許的流速上限值對應的令牌(例如,流速上限值是1000,這例如意味著每秒最多可以處理1000 個數據(例如,1000 筆交易),則流速調節模組可以生成1000 個令牌以允許處理1000 個數據)。該流速上限值會根據數據目的端的數據裝載的狀態進行更新。通過修改一個週期內允許的令牌數,可以實現系統流速的動態調整。When the flow rate adjustment module receives an application for a token, it checks whether there are still available tokens, and if there is no available token temporarily, the application is suspended and waits for a new token to be generated. The flow rate adjustment module can periodically generate or clear tokens, for example, empty the remaining tokens at the end of each cycle, and generate a number of tokens corresponding to the upper limit of the current system allowable flow rate (for example, the upper limit of the flow rate) It is 1000, which means, for example, that it can process up to 1000 data per second (for example, 1000 transactions), then the flow rate adjustment module can generate 1000 tokens to allow processing of 1000 data). The upper limit of the flow rate will be updated according to the data loading status of the data destination. By modifying the number of tokens allowed in a cycle, dynamic adjustment of the system flow rate can be achieved.
圖 4 示出了根據本發明的實施例的用於調節流速的方法的時序圖。該方法涉及非同步應答處理模組、定時掃描模組以及流速調節模組。該方法可以執行的操作包括統計數據目的端的處理結果、統計超時未應答的數據、計算當前週期內裝載成功率以及更新系統允許的流速上限。Fig. 4 shows a timing diagram of a method for adjusting a flow rate according to an embodiment of the present invention. The method involves an asynchronous response processing module, a timing scanning module, and a flow rate adjustment module. The operations that can be performed by the method include counting the processing results of the data destination, counting the data that has not responded to timeout, calculating the loading success rate in the current cycle, and updating the upper limit of the flow rate allowed by the system.
非同步應答處理模組用於接收數據目的端反饋的裝載結果,對相應的數 據進行處理(即,將裝載成功的數據從待確認數據 Map 中刪除,或將裝載失敗的數據或未收到應答的超時數據發送到待重載數據隊列中),同時根據反饋的裝載結果更新裝載成功計數器或裝載失敗計數器的值。The asynchronous response processing module is used to receive the loading result fed back by the data destination, and process the corresponding data (that is, delete the successfully loaded data from the data map to be confirmed, or delete the failed data or the unreceived response The timeout data is sent to the data queue to be reloaded), and the value of the loading success counter or loading failure counter is updated according to the feedback loading result.
定時掃描模組可以在每個週期進行掃描,計算當前週期內數據目的端裝載數據(該數據是在之前的週期中應當由數據目的端裝載的數據,也可 以稱為歷史數據)的成功率,以此觸發流速調節模組來調節流速。對於計算成功率,定時掃描模組可以首先統計當前週期內所有未收到應答的超時數據量(例如存儲在超時數據計數器中),然後獲取當前時刻數據裝載成功計數器與裝載失敗計數器的值,根據如下公式來計算成功率:The timing scan module can scan in each cycle to calculate the success rate of data loading at the data destination in the current cycle (this data is the data that should be loaded by the data destination in the previous cycle, which can also be called historical data). This triggers the flow rate adjustment module to adjust the flow rate. For calculating the success rate, the timing scan module can first count the amount of timeout data that has not received a response in the current period (for example, stored in the timeout data counter), and then obtain the current time data load success counter and load failure counter values , Calculate the success rate according to the following formula:
其中,S 為當前週期內數據裝載的成功率,Cs 與Cf 分別為當前裝載成功計數器和裝載失敗計數器的值,Ct 為當前未收到應答的超時數據計數器的值。在S 計算完成後立刻清空各計數器的值,以確保不會對下個週期的計算產生干擾。Among them, S is the success rate of data loading in the current cycle, Cs and Cf are the values of the current load success counter and load failure counter, respectively, and Ct is the value of the timeout data counter for which no response is currently received. The value of each counter is cleared immediately after the calculation of S is completed to ensure that it will not interfere with the calculation of the next cycle.
該調節流速的方法可以歸納如下:The method of adjusting the flow rate can be summarized as follows:
(1)根據數據目的端的處理能力,配置可接受的流速上限Tmax;(1) Configure the upper limit Tmax of acceptable flow rate according to the processing capacity of the data destination;
(2)如果在當前週期內、從數據目的端反饋的數據裝載的成功率低於可接受的成功率下限值,則根據固定步長下調數據傳輸系統的流速,如果流速低於流速下限,則將流速下限作為實際的流速(根據確定的流速值生成與其對應的令牌的數量),若下調前的流速已達到可接受的流速下限, 不再下調系統流速,需人工介入排查;(2) If the success rate of data loading fed back from the data destination in the current cycle is lower than the lower limit of acceptable success rate, the flow rate of the data transmission system is lowered according to a fixed step. If the flow rate is lower than the lower limit of the flow rate, The lower limit of the flow rate is taken as the actual flow rate (the number of tokens corresponding to the determined flow rate value is generated). If the flow rate before the reduction has reached the acceptable lower limit of the flow rate, the system flow rate is no longer lowered, and manual intervention is required;
(3)如果在當前週期內的數據裝載的成功率大於成功率調整閾值(其大於成功率下限值)且當前系統流速小於Tmax,那麼可以根據固定步長上調流速,如果流速高於流速上限,則將流速上限作為實際的流速(根據確定的流速值生成與其對應的令牌的數量),若上調前的流速已達到Tmax,不再上調系統流速值;(3) If the success rate of data loading in the current cycle is greater than the success rate adjustment threshold (which is greater than the lower limit of the success rate) and the current system flow rate is less than Tmax, then the flow rate can be increased according to a fixed step, if the flow rate is higher than the upper limit of the flow rate , The upper limit of the flow rate is taken as the actual flow rate (the number of tokens corresponding to it is generated according to the determined flow rate value). If the flow rate before the increase has reached Tmax, the system flow rate value will not be increased;
(4)如果成功率大於成功率下限值且小於成功率調整閾值,並且流速小於Tmax,則認為數據傳輸系統與下游系統(即數據目的端)均處於穩定狀態,無需調整數據傳輸系統的流速;(4) If the success rate is greater than the lower limit of the success rate and less than the success rate adjustment threshold, and the flow rate is less than Tmax, the data transmission system and the downstream system (that is, the data destination) are considered to be in a stable state, and there is no need to adjust the flow rate of the data transmission system ;
(5)若數據傳輸系統的流速維持在Tmax ,且計算出的成功率始終大於等於成功率調整閾值,嘗試上調Tmax;若上調Tmax 後成功率立刻下降,則恢復先前的Tmax 值,在一定週期內(例如,當天)不再嘗試上調Tmax;(5) If the flow rate of the data transmission system is maintained at Tmax, and the calculated success rate is always greater than or equal to the success rate adjustment threshold, try to increase Tmax; if the success rate drops immediately after increasing Tmax, the previous Tmax value will be restored. No more attempts to increase Tmax within (for example, the same day);
(6)若數據目的端發生擴容時,可以通過人工將Tmax 修改為與擴容後的處理能力相適應的流速上限值;(6) If the data destination is expanded, Tmax can be manually modified to the upper limit of the flow rate that is compatible with the expanded processing capacity;
(7)若計算出的成功率大於等於成功率調整閾值並且數據傳輸系統上調流速後,計算出的成功率又低於成功率下限值,使得數據傳輸系統下調流速,而且先上調流速又下調流速的過程又持續多次,那麼這可能代表計算得出的Tmax 不符合當前現狀,需人工介入排查,例如可以人工降低Tmax 的值。(7) If the calculated success rate is greater than or equal to the success rate adjustment threshold and the data transmission system increases the flow rate, the calculated success rate is lower than the lower limit of the success rate, causing the data transmission system to lower the flow rate, and first adjust the flow rate and then lower it The flow rate process continues many times, so this may mean that the calculated Tmax does not meet the current status quo, and manual intervention is required. For example, the value of Tmax can be manually reduced.
下面將描述實現上述調節流速的方法的一個實施例。首先,定義各參數,其含義如下:An embodiment of the method for realizing the above-mentioned adjusting flow rate will be described below. First, define each parameter, and its meaning is as follows:
Tmax:理想狀態下,數據目的端可承載的最大TPS(即流速上限),其可由系統運維人員手動配置與修改;Tmax: In an ideal state, the maximum TPS that the data destination can carry (that is, the upper limit of the flow rate), which can be manually configured and modified by the system operation and maintenance personnel;
Tmin:數據目的端可接受的最低TPS,低於此值時需人工介入排查;Tmin: The lowest TPS acceptable to the data destination, if it is lower than this value, manual intervention is required for investigation;
Smin:數據目的端允許的數據裝載的最小成功率;Smin: The minimum success rate of data loading allowed by the data destination;
Sadp:TPS 上調時可接受的最低成功率(即成功率調整閾值),僅當前成功率大於或等於該值時可嘗試上調TPS 的值;Sadp: The lowest acceptable success rate when TPS is increased (that is, the success rate adjustment threshold). Only when the current success rate is greater than or equal to this value, you can try to increase the value of TPS;
st:TPS 調節步長,即單次上調或下調TPS 的值;st: TPS adjustment step length, that is, the value of TPS is adjusted up or down in a single time;
Tcur:數據目的端當前允許的TPS 值,其數據傳輸系統啟動時可以任意配置Tcur,使得Tcur 不大於Tmax 。Tcur: The currently allowed TPS value of the data destination. When the data transmission system is started, Tcur can be arbitrarily configured so that Tcur is not greater than Tmax.
此外,本文將一次連續的TPS 上調和下調或一次連續的TPS 下調和上調定義為一次震盪過程,若持續地發生震盪,說明Tmax 取值與數據目的端的當前狀態不符合,需提醒運維人員進行排查和確認,必要時需要修改Tmax的取值。In addition, this article defines a continuous TPS up-regulation and down-regulation or a continuous TPS down-regulation and up-regulation as an oscillation process. If oscillations occur continuously, it means that the value of Tmax does not match the current state of the data destination, and the operation and maintenance personnel need to be reminded to do so. Check and confirm, if necessary, modify the value of Tmax.
基於此,可以例如使用標誌位 UD 記錄各個調節操作:Based on this, for example, the flag bit UD can be used to record each adjustment operation:
UD=00:未調節;UD=10:上調TPS;UD=01:下調TPSUD=00: no adjustment; UD=10: increase TPS; UD=01: decrease TPS
另外使用UDp 記錄上一次流速調節操作。例如,可以通過計算UD|UDp(或運算)來表示是否發生震盪現象(比如UD|UDp=11,表示發生了一次震盪),使用Ccon 記錄連續震盪次數,使用Mcon 表示可接受的最大連續震盪次數。In addition, use UDp to record the last flow rate adjustment operation. For example, you can calculate UD|UDp (or operation) to indicate whether oscillations have occurred (for example, UD|UDp=11, indicating that an oscillation has occurred), use Ccon to record the number of continuous oscillations, and use Mcon to indicate the maximum acceptable number of continuous oscillations .
基於上述定義,調節流速的方法的具體實現方式如下:Based on the above definition, the specific implementation of the method of adjusting the flow rate is as follows:
● 當S≥Sadp 且Tcur <Tmax 時,此時UD=10,那麼更新Tcur+=st,計算UD|UDp:● When S≥Sadp and Tcur <Tmax, UD=10 at this time, then update Tcur+=st and calculate UD|UDp:
若UD|UDp=11,修改Ccon+=1,UDp=10;If UD|UDp=11, modify Ccon+=1, UDp=10;
若 UD|UDp!=11,修改 Ccon=0,UDp=10。If UD|UDp!=11, modify Ccon=0, UDp=10.
●當S≥Sadp 且Tcur =Tmax 時,Tcur 保持不變,修改Ccon=0,UDp=00●When S≥Sadp and Tcur=Tmax, Tcur remains unchanged, modify Ccon=0, UDp=00
●當S≤Smin 且Tcur >Tmin 時,此時UD=01,更新Tcur-=st,計算UD|UDp:●When S≤Smin and Tcur >Tmin, UD=01 at this time, update Tcur-=st, calculate UD|UDp:
若UD|UDp=11,修改Ccon+=1,UDp=01;If UD|UDp=11, modify Ccon+=1, UDp=01;
若UD|UDp!=11,修改Ccon=0,UDp=01。If UD|UDp!=11, modify Ccon=0, UDp=01.
●當S≤Smin 且Tcur =Tmin 時,Tcur 保持不變,修改 Ccon=0,UDp=00,需發出告警,以提示人工介入排查;●When S≤Smin and Tcur=Tmin, Tcur remains unchanged, modify Ccon=0, UDp=00, and an alarm is required to prompt manual intervention;
●當Smin<S<Sadp 時,Tcur 保持不變,修改Ccon=0,UDp=00。●When Smin<S<Sadp, Tcur remains unchanged, modify Ccon=0, UDp=00.
每次調節流速的算法執行完成時,首先根據更新後的數據目的端允許的TPS 值生成對應的令牌數,同時檢查Ccon。若Ccon≥Mcon,則說明數據傳輸系統連續震盪次數超過上限值,即Tmax 的取值不適合當前的數據目的端,因此數據傳輸系統會發出告警以提醒運維人員介入排查。Each time the algorithm for adjusting the flow rate is executed, the corresponding token number is first generated according to the updated TPS value allowed by the data destination, and Ccon is checked at the same time. If Ccon≥Mcon, it means that the number of consecutive oscillations of the data transmission system exceeds the upper limit, that is, the value of Tmax is not suitable for the current data destination. Therefore, the data transmission system will issue an alarm to remind operation and maintenance personnel to intervene in the investigation.
為了減少異常數據(其包括裝載失敗的數據和未收到應答的超時數據),非同步應答處理模組或定時掃描模組會將異常數據發送至待重載數據隊列中,並通過數據裝載模組中的失敗數據重裝模組重新裝載該異常數據。In order to reduce abnormal data (including data that failed to load and timeout data that did not receive a response), the asynchronous response processing module or the timed scanning module will send the abnormal data to the data queue to be reloaded, and load it through the data Failed data in the module. Reload the module to reload the abnormal data.
圖 5 示出了根據本發明的實施例的用於處理異常數據的方法的流程圖。用於處理異常數據的方法如下:Fig. 5 shows a flowchart of a method for processing abnormal data according to an embodiment of the present invention. The methods used to handle abnormal data are as follows:
(1)非同步應答處理模組在接收到處理結果後進行判斷,結果為成功時,直接從待確認數據Map 中移除該數據,流程結束;否則進入步驟(2);(1) The asynchronous response processing module judges after receiving the processing result. When the result is successful, it directly removes the data from the data map to be confirmed, and the process ends; otherwise, it proceeds to step (2);
(2)結果不為成功時,更新失敗次數,如果失敗次數超過上限值,直接從待確認數據 Map 中移除該數據,並報出異常(例如發出告警),否則進入步驟(3);(2) If the result is not successful, update the number of failures. If the number of failures exceeds the upper limit, directly remove the data from the to-be-confirmed data Map and report an exception (such as an alarm), otherwise go to step (3);
(3)如果此時待重載數據隊列不滿,則將數據直接轉存入待重載數據隊列中,否則記作轉存失敗,直接更新其失敗次數,繼續執行步驟(4);(3) If the data queue to be reloaded is not full at this time, transfer the data directly to the data queue to be reloaded, otherwise it will be recorded as a transfer failure, directly update the number of failures, and continue to step (4);
(4)如果數據失敗次數超過失敗上限,直接丟棄該數據並報出異常。(4) If the number of data failures exceeds the upper limit of failure, the data is directly discarded and an exception is reported.
否則將其繼續存放在待確認數據 Map 中,等待一段時間後進入步驟(3)。Otherwise, it will continue to be stored in the to-be-confirmed data Map, and then go to step (3) after waiting for a period of time.
從圖1 和圖5 可以看出,處理異常數據的方法還可以通過裝載隔離來降低異常數據對系統的影響性,即使用正常數據裝載模組負責待裝載數據隊列中的數據的處理,使用失敗數據裝載模組負責待重載數據隊列中的數據的處理,兩個模組並行執行。基於此,可以將流速調節模組計算出的當前系統或數據目的端允許的TPS 值Tcur 細分成正常數據裝載TPS(記為Tnor)和異常數據裝載TPS(記為Tuno),不同的裝載模組請求各自的裝載令牌,從而實現正常數據和異常數據的裝載隔離,具體的方法如下:It can be seen from Figure 1 and Figure 5 that the method of handling abnormal data can also reduce the impact of abnormal data on the system by loading isolation, that is, using the normal data loading module to be responsible for processing the data in the data queue to be loaded, and the use fails. The data loading module is responsible for processing the data in the data queue to be reloaded, and the two modules are executed in parallel. Based on this, the TPS value Tcur allowed by the current system or data destination calculated by the flow rate adjustment module can be subdivided into normal data loading TPS (denoted as Tnor) and abnormal data loading TPS (denoted as Tuno). Different loading modules Request the respective load tokens to realize the load isolation of normal data and abnormal data. The specific method is as follows:
(1)如果成功率不為100%,則將成功率與當前流速相乘以作為正常數據裝載的流速,將當前流速的剩餘部分作為異常數據裝載的流速,並更新異常數據的流速在當前流速中的佔比,以供數據傳輸系統在後續週期中使用。具體實現方法可以例如是:(1) If the success rate is not 100%, multiply the success rate by the current flow rate by the flow rate loaded as normal data, use the remaining part of the current flow rate as the flow rate loaded with abnormal data, and update the flow rate of the abnormal data at the current flow rate The proportion in the data transmission system will be used in subsequent cycles. The specific implementation method can be, for example:
S≠100%時,Tnor= Tcur*S,Tuno=Tcur*(1-S);更新RP = Tuno/ Tcur。When S≠100%, Tnor= Tcur*S, Tuno=Tcur*(1-S); update R P = Tuno/ Tcur.
(2)如果成功率為100%,則異常數據裝載的流速是待重載數據隊列中的數據的個數、和上述佔比與當前流速的乘積中的最小值。因此,正常 數據裝載的流速是當前流速與異常數據裝載的流速的差。可以更新異常數據的流速在當前流速中的佔比,以供數據傳輸系統在後續週期中使用。具體實現方法可以例如是:(2) If the success rate is 100%, the flow rate of abnormal data loading is the minimum value of the number of data in the data queue to be reloaded, and the product of the above proportion and the current flow rate. Therefore, the flow rate of the normal data load is the difference between the current flow rate and the flow rate of the abnormal data load. The percentage of the flow rate of abnormal data in the current flow rate can be updated for the data transmission system to use in subsequent cycles. The specific implementation method can be, for example:
S=100%時,Tuno=min(Lw RP * Tcur) ,Tnor= Tcur-Tuno,更新RP = Tuno/ Tcur。When S=100%, Tuno=min(L w R P * Tcur), Tnor= Tcur-Tuno, update R P = Tuno/ Tcur.
其中,S 為當前週期內數據裝載成功率,Rp 為上一週期內異常數據裝載TPS 在系統總TPS 中的佔比,Lu 為待重載數據隊列中數據的個數(例如,交易的筆數)。Among them, S is the success rate of data loading in the current cycle, Rp is the proportion of abnormal data loading TPS in the total TPS of the system during the previous week, and Lu is the number of data in the data queue to be reloaded (for example, the number of transactions) ).
可以以一種或多種程序設計語言的任意組合來編寫用於執行本發明操作的程序代碼,所述程序設計語言包括面向對象的程序設計語言—諸如Java、C++等,還包括常規的過程式程序設計語言—諸如“C”語言或類似的程序設計語言。程序代碼可以完全地在用戶計算設備上執行、部分地在用戶設備上執行、部分在用戶計算設備上執行、或者完全在遠程計算設備或服務器上執行。在涉及遠程計算設備的情形中,遠程計算設備可以通過任 意種類的網絡——包括局域網(LAN)或廣域網(WAN)—連接到用戶計算設備,或者,可以連接到外部計算設備(例如利用因特網服務提供商來通過因特網連接)。The program code used to perform the operations of the present invention can be written in any combination of one or more programming languages. The programming languages include object-oriented programming languages—such as Java, C++, etc., as well as conventional procedural programming. Language-such as "C" language or similar programming language. The program code can be executed entirely on the user's computing device, partly executed on the user's equipment, partly executed on the user's computing device, or entirely executed on the remote computing device or server. In the case of remote computing devices, the remote computing device can be connected to the user's computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (for example, using Internet services) Provider to connect via the Internet).
此外,儘管在附圖中以特定順序描述了本發明方法的操作,但是,這並非要求或者暗示必須按照該特定順序來執行這些操作,或是必須執行全部所示的操作才能實現期望的結果。附加地或備選地,可以省略某些步驟,將多個步驟合併為一個步驟執行,和/或將一個步驟分解為多個步驟執行。In addition, although the operations of the method of the present invention are described in a specific order in the drawings, this does not require or imply that these operations must be performed in the specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step for execution, and/or one step may be decomposed into multiple steps for execution.
應當注意,儘管在上文的詳細描述中提及了實現上述方法的若干軟件裝置/模組及子裝置/模組,但是這種劃分並非強制性的。實際上,根據本發明的實施方式,上文描述的兩個或更多裝置的特徵和功能可以在一個裝置/模組中具體化。反之,上文描述的一個裝置/模組的特徵和功能可以進一步劃分為由多個裝置/模組來具體化。It should be noted that although several software devices/modules and sub-devices/modules that implement the above methods are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present invention, the features and functions of two or more devices described above can be embodied in one device/module. Conversely, the features and functions of one device/module described above can be further divided into multiple devices/modules to be embodied.
雖然已經參考若干具體實施方式描述了本發明的精神和原理,但是應該理解,本發明並不限於所公開的具體實施方式,對各方面的劃分也不意味著這些方面中的特徵不能組合以進行受益,這種劃分僅是為了表述的方20 便。本發明旨在涵蓋所附權利要求的精神和範圍內所包括的各種修改和等同佈置。Although the spirit and principle of the present invention have been described with reference to several specific embodiments, it should be understood that the present invention is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined for performance. Benefit, this division is only for ease of presentation. The present invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
無。without.
[圖1]示出了根據本發明的實施例的數據傳輸系統的示意圖。 [圖2]示出了根據本發明的實施例的用於抽取數據的方法的流程圖。 [圖3]示出了根據本發明的實施例的用於裝載數據的方法的時序圖。 [圖4]示出了根據本發明的實施例的用於調節流速的方法的時序圖。 [圖5]示出了根據本發明的實施例的用於處理異常數據的方法的流程圖。[Fig. 1] A schematic diagram showing a data transmission system according to an embodiment of the present invention. [Fig. 2] A flowchart showing a method for extracting data according to an embodiment of the present invention. [Fig. 3] A timing chart showing a method for loading data according to an embodiment of the present invention. [Fig. 4] A timing chart showing a method for adjusting a flow rate according to an embodiment of the present invention. [Fig. 5] A flowchart showing a method for processing abnormal data according to an embodiment of the present invention.
Claims (39)
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010065609.2A CN111291104B (en) | 2020-01-20 | 2020-01-20 | Method and system for transmitting data based on asynchronous response |
CN202010065609.2 | 2020-01-20 |
Publications (2)
Publication Number | Publication Date |
---|---|
TW202129516A true TW202129516A (en) | 2021-08-01 |
TWI818188B TWI818188B (en) | 2023-10-11 |
Family
ID=71025480
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW109127142A TWI818188B (en) | 2020-01-20 | 2020-08-11 | A method and a system for a data transmission method based on asynchronous response |
Country Status (4)
Country | Link |
---|---|
CN (1) | CN111291104B (en) |
SG (1) | SG11202113121TA (en) |
TW (1) | TWI818188B (en) |
WO (1) | WO2021147304A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111291104B (en) * | 2020-01-20 | 2023-07-28 | 中国银联股份有限公司 | Method and system for transmitting data based on asynchronous response |
Family Cites Families (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3309020B2 (en) * | 1994-06-20 | 2002-07-29 | 富士通株式会社 | Transmission throughput control apparatus and method |
KR980700762A (en) * | 1994-12-09 | 1998-03-30 | 브래들리 데이빗 윌리엄 | How to transmit data packets in a multiprocessor environment (MULTI-PROCESSOR ENVIRONMENTS) |
TW200537314A (en) * | 2004-05-03 | 2005-11-16 | Acer Inc | Transmission rate auto-adjusted bus system and method |
JP4499162B2 (en) * | 2004-12-30 | 2010-07-07 | メッシュネットワークス インコーポレイテッド | System and method for managing communication links between nodes in a wireless communication network |
CN1917413A (en) * | 2005-08-18 | 2007-02-21 | 英业达股份有限公司 | Automatic method for adjusting transmission rate |
CN101174986A (en) * | 2007-11-07 | 2008-05-07 | 中兴通讯股份有限公司 | Method and apparatus for dynamic feedback of load distribution |
CN105900061B (en) * | 2014-10-22 | 2018-01-16 | 华为技术有限公司 | Business method of flow control, controller and system in object storage system |
US20170324642A1 (en) * | 2016-05-04 | 2017-11-09 | Microsoft Technology Licensing, Llc | Initial and periodic slowdowns for background connections |
CN107920027B (en) * | 2016-10-08 | 2019-03-15 | 腾讯科技(深圳)有限公司 | A kind of flow control methods and device |
US10284480B2 (en) * | 2016-12-27 | 2019-05-07 | Netflix, Inc. | Packet loss tolerant transmission control protocol congestion control |
CN106850153B (en) * | 2017-03-27 | 2020-05-22 | 网宿科技股份有限公司 | Data retransmission method and system |
CN110191060A (en) * | 2018-02-22 | 2019-08-30 | 中兴通讯股份有限公司 | A kind of adjustment data packet sends method, apparatus, equipment and the system of code rate |
CN111291104B (en) * | 2020-01-20 | 2023-07-28 | 中国银联股份有限公司 | Method and system for transmitting data based on asynchronous response |
-
2020
- 2020-01-20 CN CN202010065609.2A patent/CN111291104B/en active Active
- 2020-08-11 TW TW109127142A patent/TWI818188B/en active
- 2020-08-14 SG SG11202113121TA patent/SG11202113121TA/en unknown
- 2020-08-14 WO PCT/CN2020/109083 patent/WO2021147304A1/en active Application Filing
Also Published As
Publication number | Publication date |
---|---|
TWI818188B (en) | 2023-10-11 |
CN111291104A (en) | 2020-06-16 |
WO2021147304A1 (en) | 2021-07-29 |
CN111291104B (en) | 2023-07-28 |
SG11202113121TA (en) | 2021-12-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109951546B (en) | Transaction request processing method, device, equipment and medium based on intelligent contract | |
CN110460534B (en) | Method, device, equipment and storage medium for reporting request message | |
JP2006166439A (en) | Efficient transfer of message using reliable messaging protocol for web service | |
CN111245630B (en) | Method for simultaneously upgrading multiple devices in local area network | |
CN111158878B (en) | Resource transfer request thread control method, device and storage medium | |
CN110502364A (en) | Across the cloud back-up restoring method of big data sandbox cluster under a kind of OpenStack platform | |
CN114915593B (en) | Redis-based flow control method and device, electronic equipment and storage medium | |
CN106878197A (en) | A kind of management system and method for the transmission of cloud platform message | |
CN115883077B (en) | Request processing method and device and electronic equipment | |
CN114095438B (en) | Data transmission method, apparatus, device, storage medium and computer program product | |
TW202129516A (en) | A method and a system for a data transmission method based on asynchronous response | |
CN110708234B (en) | Message transmission processing method, message transmission processing device and storage medium | |
CN110597920A (en) | Information processing method and device | |
CN114640703A (en) | Data communication method and device, electronic equipment and storage medium | |
US11444882B2 (en) | Methods for dynamically controlling transmission control protocol push functionality and devices thereof | |
JP2009025971A (en) | Information processor and log data collection system | |
WO2019153482A1 (en) | Method for generating data packets in anti-money laundering operation, storage medium and server | |
JP2011182115A (en) | Communication method, communication system and server | |
CN108737460B (en) | Connection processing method and client | |
CN113612624B (en) | Method and device for processing heartbeat between nodes | |
CN113079065A (en) | Heartbeat detection method, device, equipment and medium based on Ambari | |
JP2006018376A (en) | Network communication system | |
JP5378847B2 (en) | Monitoring device | |
CN116933269A (en) | Request forwarding method and device, storage medium and computer equipment | |
CN113296982B (en) | Interface calling method and device |