[go: up one dir, main page]

TWI855948B - Monitoring and limiting system of requesting to access system resources and method thereof - Google Patents

Monitoring and limiting system of requesting to access system resources and method thereof Download PDF

Info

Publication number
TWI855948B
TWI855948B TW112150913A TW112150913A TWI855948B TW I855948 B TWI855948 B TW I855948B TW 112150913 A TW112150913 A TW 112150913A TW 112150913 A TW112150913 A TW 112150913A TW I855948 B TWI855948 B TW I855948B
Authority
TW
Taiwan
Prior art keywords
current limiting
application program
request
data
program interface
Prior art date
Application number
TW112150913A
Other languages
Chinese (zh)
Other versions
TW202520071A (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 大陸商鼎捷軟件股份有限公司
Application granted granted Critical
Publication of TWI855948B publication Critical patent/TWI855948B/en
Publication of TW202520071A publication Critical patent/TW202520071A/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/2475Traffic characterised by specific attributes, e.g. priority or QoS for supporting traffic characterised by the type of applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/2425Traffic characterised by specific attributes, e.g. priority or QoS for supporting services specification, e.g. SLA
    • H04L47/2433Allocation of priorities to traffic types

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Debugging And Monitoring (AREA)

Abstract

A monitoring and limiting system of requesting to access system resources and method thereof are provided. The monitoring and limiting system include a storage device and a processor. The storage device stores a traffic limiting and intercepting module, a data analysis module and an execution module. The processor receives request data for executing an application programming interface. The traffic limiting and intercepting module determines whether the requested data is a traffic limiting request based on a traffic limiting configuration table, and generates a judgment result. In response to the judgment result being a traffic limiting request, the traffic limiting and intercepting module rejects access to the requested data and outputs a preset message. In response to the judgment result being a non-traffic-limiting request, the traffic limiting and intercepting module inputs the request data to the execution module. The Execute module executes the request data. The data analysis module adjusts the traffic limiting configuration table based on resource data and application interface request processes.

Description

監控限流系統及其方法Monitoring current limiting system and method thereof

本發明是有關於一種限流應用程式介面的請求數據,且特別是有關於一種監控限流系統及其方法。The present invention relates to a request data of a current limiting application program interface, and in particular to a monitoring current limiting system and method thereof.

用於提供(業務)服務的應用程式通常會提供有具體能力的應用程式介面(Application Programming Interface,API),以此對外提供功能服務。然而,通常為了實現某個業務行為,系統或使用者會調用特定的應用程式介面,來獲得期望的執行服務或輸出結果(業務數據)。然而,當一時間段中有大量的服務資源需求或是流量峰值時,將可能導致提供服務的伺服器或系統發生故障、回應/響應變慢或當機。在系統出現故障時,將導致整個服務系統無法工作,造成使用者體驗差。因此,傳統的連接應用程式介面的專案服務器具有無法處理大量請求數據,以及沒有根據時間段或運算資源進行限流或資源配置的問題。Applications used to provide (business) services usually provide application programming interfaces (APIs) with specific capabilities to provide functional services to the outside world. However, in order to implement a certain business behavior, the system or user will usually call a specific application programming interface to obtain the desired execution service or output result (business data). However, when there is a large demand for service resources or a traffic peak in a period of time, it may cause the server or system providing the service to fail, respond/respond slowly, or crash. When a system fails, the entire service system will not work, resulting in a poor user experience. Therefore, traditional project servers connected to application programming interfaces have the problem of being unable to handle large amounts of request data and not being able to limit traffic or configure resources based on time periods or computing resources.

本發明是針對一種監控限流系統及其方法,可根據請求數據的時間段以及所調用的應用程式介面的等級,以自動判斷是否進行部分請求數據的限流。The present invention is directed to a monitoring and current limiting system and method thereof, which can automatically determine whether to limit the current of part of the requested data according to the time period of the requested data and the level of the called application program interface.

根據本發明的實施例,本發明的監控限流系統包括儲存裝置以及處理器。儲存裝置儲存多個模組以及限流配置表。處理器耦接儲存裝置。處理器執行多個模組,並接收用於執行應用程式介面的請求數據。多個模組包括限流攔截模組、數據分析模組以及執行模組。限流攔截模組根據限流配置表判斷請求數據是否為限流請求,並且產生判斷結果。響應於判斷結果為限流請求,限流攔截模組拒絕請求數據的訪問,並且輸出預設訊息。響應於判斷結果為非限流請求,限流攔截模組將請求數據輸入至執行模組。執行模組執行請求數據。數據分析模組根據資源數據以及應用程式介面請求歷程調整限流配置表。According to an embodiment of the present invention, the monitoring and current limiting system of the present invention includes a storage device and a processor. The storage device stores multiple modules and a current limiting configuration table. The processor is coupled to the storage device. The processor executes multiple modules and receives request data for executing an application programming interface. The multiple modules include a current limiting interception module, a data analysis module, and an execution module. The current limiting interception module determines whether the request data is a current limiting request based on the current limiting configuration table, and generates a judgment result. In response to the judgment result being a current limiting request, the current limiting interception module rejects access to the request data and outputs a default message. In response to the judgment result being a non-current-limited request, the current-limiting interception module inputs the request data to the execution module. The execution module executes the request data. The data analysis module adjusts the current-limiting configuration table based on the resource data and the API request history.

根據本發明的實施例,本發明的監控限流方法包括以下步驟:接收用於執行應用程式介面的請求數據;通過限流攔截模組根據限流配置表判斷請求數據是否為限流請求,並且產生判斷結果;響應於判斷結果為限流請求,通過限流攔截模組拒絕請求數據的訪問,並且輸出預設訊息;響應於判斷結果為非限流請求,通過限流攔截模組將請求數據輸入至執行模組;通過執行模組執行請求數據;通過數據分析模組根據資源數據以及應用程式介面請求歷程調整限流配置表。According to an embodiment of the present invention, the monitoring and current limiting method of the present invention includes the following steps: receiving request data for executing an application program interface; judging whether the request data is a current limiting request according to a current limiting configuration table through a current limiting interception module, and generating a judgment result; in response to the judgment result being a current limiting request, refusing access to the request data through the current limiting interception module, and outputting a preset message; in response to the judgment result being a non-current limiting request, inputting the request data into an execution module through the current limiting interception module; executing the request data through the execution module; adjusting the current limiting configuration table according to resource data and the application program interface request history through a data analysis module.

基於上述,本發明的監控限流系統及其方法,可根據請求數據的時間段以及所調用的應用程式介面的等級,對不同的應用程式介面以及不同時間段的請求數據進行限流設定。Based on the above, the monitoring and current limiting system and method of the present invention can set current limits for different application program interfaces and request data in different time periods according to the time period of the request data and the level of the called application program interface.

為讓本發明的上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明如下。In order to make the above features and advantages of the present invention more clearly understood, embodiments are given below and described in detail with reference to the accompanying drawings.

現將詳細地參考本發明的示範性實施例,示範性實施例的實例說明於附圖中。只要有可能,相同元件符號在圖式和描述中用來表示相同或相似部分。Reference will now be made in detail to exemplary embodiments of the present invention, examples of which are illustrated in the accompanying drawings. Whenever possible, the same reference numerals are used in the drawings and description to represent the same or similar parts.

圖1是本發明的一實施例的監控限流系統的示意圖。參考圖1,監控限流系統100包括處理器110以及儲存裝置120。處理器110耦接儲存裝置120。儲存裝置120儲存有限流攔截模組、數據分析模組以及執行模組。在本實施例中,監控限流系統100可例如是設置在雲端伺服器,以供用戶連線並執行同樣設置在雲端伺服器中的不同的應用程式介面(Application Programming Interface,API)的相關業務服務(Business service)功能。所述雲端伺服器可例如是軟體即服務(Software as a Service,SaaS)伺服器,並且所述應用程式介面對應於軟體即服務應用程式,但本發明並不限於此。或者,在一實施例中,監控限流系統100可設置在企業內部的地端伺服器所運行的企業資源規劃(Enterprise Resource Planning,ERP)系統中,以通過不同的應用程式介面提供相關業務服務功能(例如產生採購單、請購單、報價等諸如此類的業務服務),本案不應以此為限。FIG1 is a schematic diagram of a monitoring and current limiting system of an embodiment of the present invention. Referring to FIG1 , the monitoring and current limiting system 100 includes a processor 110 and a storage device 120. The processor 110 is coupled to the storage device 120. The storage device 120 stores a limited flow interception module, a data analysis module, and an execution module. In this embodiment, the monitoring and current limiting system 100 may, for example, be set in a cloud server so that users can connect and execute related business service functions of different application programming interfaces (APIs) also set in the cloud server. The cloud server may be, for example, a Software as a Service (SaaS) server, and the application program interface corresponds to a Software as a Service application, but the present invention is not limited thereto. Alternatively, in one embodiment, the monitoring and current limiting system 100 may be set in an enterprise resource planning (ERP) system operated by a local server within the enterprise to provide relevant business service functions (such as generating purchase orders, purchase requisitions, quotations, and other such business services) through different application program interfaces, but the present invention should not be limited thereto.

在本實施例中,處理器110可為系統單晶片(System on a Chip,SOC),或可例如包括中央處理單元(Central Processing Unit,CPU)或是其他可程式化之一般用途或特殊用途的微處理器(Microprocessor)、數字信號處理器(Digital Signal Processor,DSP)、可程式化控制器、特殊應用積體電路(Application Specific Integrated Circuits,ASIC)、可程式化邏輯裝置(Programmable Logic Device,PLD)、其他類似處理裝置或這些裝置的組合。儲存裝置120可包括儲存器(Memory)及/或資料庫(database),其中儲存器可例如是動態隨機存取儲存器(Dynamic Random Access Memory,DRAM)、快閃儲存器(Flash memory)或非揮發性隨機存取儲存器(Non-Volatile Random Access Memory,NVRAM)等。儲存裝置120可儲存有用於實現本發明各實施例的相關程式、模組、系統或演算法,以供處理器110存取並執行而實現本發明各實施例所描述的相關功能及操作。在本實施例中,限流攔截模組、數據分析模組、執行模組以及本案中的其他模組可例如是以JSON(JavaScript Object Notation)、可延伸標記式語言(Extensible Markup Language,XML)或YAML等諸如此類的程式語言來實現的,但本發明也不限於此。In the present embodiment, the processor 110 may be a system on a chip (SOC), or may include, for example, a central processing unit (CPU) or other programmable general-purpose or special-purpose microprocessors, digital signal processors (DSP), programmable controllers, application specific integrated circuits (ASIC), programmable logic devices (PLD), other similar processing devices, or a combination of these devices. The storage device 120 may include a memory and/or a database, wherein the memory may be, for example, a dynamic random access memory (DRAM), a flash memory, or a non-volatile random access memory (NVRAM). The storage device 120 may store relevant programs, modules, systems, or algorithms useful for implementing various embodiments of the present invention, so that the processor 110 can access and execute them to implement the relevant functions and operations described in various embodiments of the present invention. In this embodiment, the current limiting interception module, the data analysis module, the execution module and other modules in this case can be implemented in programming languages such as JSON (JavaScript Object Notation), Extensible Markup Language (XML) or YAML, but the present invention is not limited to this.

在本實施例中,使用者可例如通過個人電腦裝置執行監控限流系統100,並且將請求數據輸入至監控限流系統100,以請求執行對應的應用程式介面。在另一實施例中,監控限流系統100與專案服務系統被設置於同一個伺服器中,接著,使用者通過個人終端裝置輸入請求數據至伺服器中,以請求執行專案服務。監控限流系統100可根據請求數據來自動執行限流攔截模組、數據分析模組以及執行模組,以自動產生對應的限流判斷結果以及執行結果(業務數據)。In this embodiment, the user can, for example, execute the monitoring and current limiting system 100 through a personal computer device, and input the request data into the monitoring and current limiting system 100 to request the execution of the corresponding application program interface. In another embodiment, the monitoring and current limiting system 100 and the project service system are set in the same server, and then the user inputs the request data into the server through a personal terminal device to request the execution of the project service. The monitoring and current limiting system 100 can automatically execute the current limiting interception module, the data analysis module and the execution module according to the request data to automatically generate the corresponding current limiting judgment result and the execution result (business data).

在本實施例中,限流攔截模組可根據儲存在儲存裝置120中的限流配置表判斷當前的請求數據是否為限流請求,並且產生判斷結果。當判斷結果為當前請求數據屬於限流請求,則限流攔截模組拒絕當前請求數據的訪問以及應用程式介面的調用,並且限流攔截模組同時輸出預設訊息至對應當前請求數據的終端裝置。另一方面,當判斷結果為非限流請求時,限流攔截模組將請求數據輸入至執行模組。接著,執行模組執行請求數據。值得注意的是,數據分析模組根據資源數據以及應用程式介面請求歷程調整限流配置表。In this embodiment, the current limiting interception module can determine whether the current request data is a current limiting request according to the current limiting configuration table stored in the storage device 120, and generate a judgment result. When the judgment result is that the current request data belongs to a current limiting request, the current limiting interception module rejects the access to the current request data and the call of the application program interface, and the current limiting interception module simultaneously outputs a preset message to the terminal device corresponding to the current request data. On the other hand, when the judgment result is a non-current limiting request, the current limiting interception module inputs the request data to the execution module. Then, the execution module executes the request data. It is worth noting that the data analysis module adjusts the current limiting configuration table based on resource data and application program interface request history.

圖2是本發明的一實施例的監控限流方法的流程圖。參考圖1以及圖2,監控限流系統100可執行以下步驟S210~S260,以自動產生對應的判斷結果,根據請求數據的種類以及時間段執行對應的結果。在本實施例中,用戶可輸入請求數據至監控限流系統100,以欲執行(特定)應用程式介面。在步驟S210,處理器110可接收用於執行應用程式介面的請求數據。具體來說,使用者通過其終端裝置輸出使用專案系統(例如調用特定的應用程式介面)的請求數據至裝設有監控限流系統100的伺服器中。接著,伺服器將請求數據輸入至監控限流系統100中。FIG2 is a flow chart of a monitoring and current limiting method of an embodiment of the present invention. Referring to FIG1 and FIG2, the monitoring and current limiting system 100 may execute the following steps S210 to S260 to automatically generate corresponding judgment results, and execute corresponding results according to the type of request data and the time period. In this embodiment, the user may input request data to the monitoring and current limiting system 100 to execute a (specific) application program interface. In step S210, the processor 110 may receive request data for executing the application program interface. Specifically, the user outputs the request data for using the project system (for example, calling a specific application program interface) through his terminal device to a server equipped with the monitoring and current limiting system 100. Then, the server inputs the request data into the monitoring and current limiting system 100.

在步驟S220,處理器110可通過限流攔截模組根據限流配置表判斷請求數據是否為限流請求,並且產生判斷結果。在本實施例中,限流配置表包括限流時間段、限流時間段中每個應用程式介面等級、以及每個應用程式介面等級所對應的限流比率。如此設置,限流攔截模組比對當前的請求數據與限流配置表,進而判斷當前的請求數據是否屬於限流配置表中需要限制流量的請求(例如服務請求)。並且,限流攔截模組根據比對結果產生判斷結果。In step S220, the processor 110 can determine whether the request data is a current limiting request according to the current limiting configuration table through the current limiting interception module, and generate a judgment result. In this embodiment, the current limiting configuration table includes a current limiting time period, each application program interface level in the current limiting time period, and a current limiting ratio corresponding to each application program interface level. In this way, the current limiting interception module compares the current request data with the current limiting configuration table, and then determines whether the current request data belongs to a request (such as a service request) that needs to limit the flow in the current limiting configuration table. In addition, the current limiting interception module generates a judgment result based on the comparison result.

在步驟S230,響應於判斷結果為限流請求,限流攔截模組拒絕請求數據的訪問。具體來說,當判斷結果為當前的請求數據屬於限流請求之時,限流攔截模組拒絕當前的請求數據,以達到運算資源的控制以及流量的限制。在步驟S240,通過限流攔截模組輸出預設訊息。在一實施例中,限流攔截模組輸出預設訊息至對應當前請求數據的終端裝置。換言之,限流攔截模組將預設訊息輸出至發出當前請求數據的終端裝置,進而告知使用者當前請求數據未能請求成功的原因。預設訊息可以是「當前服務請求過多,請稍後」或是「當前服務塞車中,請稍待」等內容。In step S230, in response to the judgment result being a current limiting request, the current limiting interception module denies access to the request data. Specifically, when the judgment result is that the current request data belongs to a current limiting request, the current limiting interception module denies the current request data to achieve control of computing resources and flow limitation. In step S240, a default message is output through the current limiting interception module. In one embodiment, the current limiting interception module outputs a default message to the terminal device corresponding to the current request data. In other words, the current limiting interception module outputs a default message to the terminal device that issued the current request data, and then informs the user of the reason why the current request data failed to be successfully requested. The default message may be "There are too many service requests at this time, please wait" or "There is a traffic jam at this time, please wait".

在步驟S250,響應於所述判斷結果為非限流請求,通過限流攔截模組將所述請求數據輸入至執行模組。具體來說,當判斷結果為當情的請求數據不屬於限流請求(即屬於非限流請求)之時,限流攔截模組將當前的請求數據輸入至執行模組中。接著,在步驟S260,通過執行模組執行當前的請求數據。舉例而言,執行模組執行請求數據是調用對應請求數據的應用程式介面,或是執行對應請求數據的服務運算。在一實施路中,執行模組可根據請求數據的結構來決定多個應用程式介面物件的調用方式,例如一次調用或多次調用。In step S250, in response to the judgment result being a non-current-limited request, the request data is input into the execution module through the current-limiting interception module. Specifically, when the judgment result is that the current request data does not belong to a current-limited request (i.e., it belongs to a non-current-limited request), the current-limiting interception module inputs the current request data into the execution module. Then, in step S260, the current request data is executed through the execution module. For example, the execution module executes the request data by calling the application programming interface corresponding to the request data, or executing the service operation corresponding to the request data. In one implementation, the execution module can determine the calling method of multiple application programming interface objects according to the structure of the request data, such as one call or multiple calls.

如此一來,本發明的監控限流系統100及其方法可根據限流配置表中的設定以及批註,自動地判斷請求數據是否需要限流,進而達到服務資源的管理以及限流監控。如此設置,監控限流系統100可以通過部分時間段以及部分比率限流的方式,有效地避免服務資源超載以及系統故障的狀況發生。In this way, the monitoring and current limiting system 100 and method of the present invention can automatically determine whether the request data needs to be current limited according to the settings and annotations in the current limiting configuration table, thereby achieving service resource management and current limiting monitoring. In this way, the monitoring and current limiting system 100 can effectively avoid service resource overload and system failure by limiting the current in some time periods and some ratios.

圖3是本發明的一實施例的多個模組的執行示意圖。參考圖3。在一實施例中,多個模組還包括數據採集模組340,並且儲存裝置為資料庫350。數據採集模組340根據預設時間定時地採集資源數據以及應用程式介面請求歷程,並且將資源數據以及應用程式介面請求歷程儲存至儲存裝置120或是資料庫350中。FIG3 is a schematic diagram of the execution of multiple modules of an embodiment of the present invention. Refer to FIG3. In one embodiment, the multiple modules further include a data collection module 340, and the storage device is a database 350. The data collection module 340 collects resource data and application program interface request history regularly according to a preset time, and stores the resource data and application program interface request history in the storage device 120 or the database 350.

在一實施例中,限流配置表包括應用程式介面等級、限流時間段、當前服務執行次數、多個應用程式介面等級的執行上限值、當前應用程式介面等級的執行次數、限流計算設定、可執行率、限流係數的至少其中之一。應用程式介面等級為不同的應用程式介面所被預設的等級,舉例而言,應用程式介面等級根據請求頻次和運算複雜度分成三個等級,分別是一級應用程式介面、二級應用程式介面以及三級應用程式介面。一級應用程式介面的運算複雜度大於三級應用程式介面的運算複雜度。In one embodiment, the current limiting configuration table includes at least one of the following: application program interface level, current limiting time period, current service execution times, execution upper limits of multiple application program interface levels, current application program interface level execution times, current current application program interface level, current limiting calculation settings, executable rate, and current limiting coefficient. The application program interface level is a preset level for different application program interfaces. For example, the application program interface level is divided into three levels according to request frequency and computational complexity, namely, a first-level application program interface, a second-level application program interface, and a third-level application program interface. The computational complexity of a first-level application program interface is greater than that of a third-level application program interface.

換言之,限流配置表中包括每一個應用程式介面所對應的等級(即應用程式介面等級)。限流時間段為多個服務時間段中備批註為需要進行限流的時間段。當前服務執行次數為當前總服務的請求次數。應用程式介面等級的執行上限值為限流階段中每個應用程式介面等級所可以執行的上限值,例如是一級應應用程式介面可執行100次,二級應用程式介面可執行50次。當前應用程式介面等級的執行次數為當前時間段每個應用程式介面等級已經執行的次數。限流計算設定為計算每個應用程式介面等級的執行上限值的設定或是公式。可執行率為每個應用程式介面等級所可以執行的比率,例如一級應應用程式介面的可執行率為90%,二級應用程式介面的可執行率為95%,三級應用程式介面的可執行率為98%。限流係數為限流計算設定中的係數。在一實施例中,限流係數為正整數。In other words, the current limiting configuration table includes the level (i.e., application interface level) corresponding to each application program interface. The current limiting time period is the time period in multiple service time periods that is annotated as requiring current limiting. The current service execution times are the current total service request times. The execution upper limit of the application program interface level is the upper limit of each application program interface level that can be executed in the current limiting stage. For example, the first-level application program interface can be executed 100 times, and the second-level application program interface can be executed 50 times. The current application program interface level execution times are the number of times each application program interface level has been executed in the current time period. The current limiting calculation setting is a setting or formula for calculating the execution upper limit value of each application program interface level. The executable rate is the ratio of each application program interface level that can be executed, for example, the executable rate of the first-level application program interface is 90%, the executable rate of the second-level application program interface is 95%, and the executable rate of the third-level application program interface is 98%. The current limiting coefficient is the coefficient in the current limiting calculation setting. In one embodiment, the current limiting coefficient is a positive integer.

在一實施例中,限流配置表包括應用程式介面等級,應用程式介面等級包括一級應用程式介面、二級應用程式介面以及三級應用程式介面,並且不同的應用程式介面等級具有不同的可執行率。舉例而言,一級應用程式介面的可執行率相關於指數為限流係數的值,二級應用程式介面的可執行率相關於限流係數與常數的積,三級應用程式介面的可執行率相關於限流係數。具體來說,一級應用程式介面的可執行率與指數為限流係數的值成反比。在一實施例中,一級應用程式介面的可執行率為1-1%*2 n,二級應用程式介面的可執行率1-1%*2n,三級應用程式介面的可執行率為1-1%*n,本案不應以此為限。在本實施例中,n為限流係數,並且n不大於5。 In one embodiment, the current limiting configuration table includes application program interface levels, and the application program interface levels include first-level application program interfaces, second-level application program interfaces, and third-level application program interfaces, and different application program interface levels have different executable rates. For example, the executable rate of the first-level application program interface is related to the value of the current limiting coefficient, the executable rate of the second-level application program interface is related to the product of the current limiting coefficient and a constant, and the executable rate of the third-level application program interface is related to the current limiting coefficient. Specifically, the executable rate of the first-level application program interface is inversely proportional to the value of the current limiting coefficient. In one embodiment, the executable rate of the first-level application programming interface is 1-1%*2 n , the executable rate of the second-level application programming interface is 1-1%*2n, and the executable rate of the third-level application programming interface is 1-1%*n. The present invention should not be limited to this. In this embodiment, n is the current limiting coefficient, and n is not greater than 5.

如圖3所示,監控限流系統100可執行以下步驟S311~S314以及步驟S351。使用者透過終端裝置360發出請求數據至監控限流系統300中。在步驟S311中,限流攔截模組310接收到請求數據後,限流攔截模組310判斷當前的請求數據是否需要限流(即是否為限流請求)。步驟S311的判斷可以更細分為步驟S312以及步驟S313。在步驟S312中,限流攔截模組310判斷請求數據是否在限流範圍中,例如是限流時間段內(例如早上9點到早上10點),或是對應特定的應用程式介面。當步驟S312的判斷結果為當前請求數據在限流範圍中,接著執行步驟S313。As shown in FIG3 , the monitoring and current limiting system 100 can execute the following steps S311 to S314 and step S351. The user sends request data to the monitoring and current limiting system 300 through the terminal device 360. In step S311, after the current limiting interception module 310 receives the request data, the current limiting interception module 310 determines whether the current request data needs to be current limited (i.e., whether it is a current limiting request). The determination of step S311 can be further divided into step S312 and step S313. In step S312, the flow limiting interception module 310 determines whether the request data is within the flow limiting range, such as within the flow limiting time period (such as 9 am to 10 am), or corresponds to a specific application programming interface. When the determination result of step S312 is that the current request data is within the flow limiting range, step S313 is then executed.

在步驟S313中,限流攔截模組310判斷對應請求數據的當前限流閾值(例如當前應用程式介面等級的執行次數)是否已經達到限流閾值(例如對應的應用程式介面等級的執行上限值)。當步驟S312的判斷結果為當前請求數據所對應的應用程式介面等級的執行次數已達到上限值,則接著執行步驟S314。在步驟S314中,限流攔截模組310輸出友好訊息至使用者的終端裝置360。友好訊息為預設的系統訊息(即預設訊息)。當步驟S312以及步驟S313的判斷結果為否,則通過執行模組330執行當前的請求數據。In step S313, the current limiting interception module 310 determines whether the current current limiting threshold corresponding to the request data (e.g., the number of executions of the current API level) has reached the current limiting threshold (e.g., the upper limit of the execution of the corresponding API level). When the determination result of step S312 is that the number of executions of the API level corresponding to the current request data has reached the upper limit, step S314 is then executed. In step S314, the current limiting interception module 310 outputs a friendly message to the user's terminal device 360. The friendly message is a default system message (i.e., a default message). When the judgment results of step S312 and step S313 are no, the current request data is executed by the execution module 330.

在一實施例中,限流攔截模組310根據限流配置表以及應用程式介面請求歷程判斷請求數據是否為限流請求。具體來說,通過限流配置表可以得知限流時間段、應用程式介面的等級以及限流閾值等訊息。通過應用程式介面請求歷程可以得知當前限流閾值或是當前應用程式介面等級的執行次數(例如,二級應用程式介面的當前執行次數為20次)。限流請求為請求數據匹配於監控時間段中的服務請求,並且監控時間段的當前應用程式介面等級的執行次數達到對應的所述應用程式介面等級的執行上限值。In one embodiment, the current limiting interception module 310 determines whether the request data is a current limiting request based on the current limiting configuration table and the application program interface request history. Specifically, the current limiting time period, the level of the application program interface, and the current limiting threshold and other information can be obtained through the current limiting configuration table. The current limiting threshold or the number of executions of the current application program interface level (for example, the current number of executions of the second-level application program interface is 20 times) can be obtained through the application program interface request history. The current limiting request is a service request in which the request data matches the monitoring time period, and the number of executions of the current application program interface level in the monitoring time period reaches the corresponding execution upper limit of the application program interface level.

圖4是本發明的一實施例的數據分析模組320調整限流配置表的流程圖。在一實施例中,限流配置表包括當前限流係數以及資源數據閾值。參考圖3以及圖4,監控限流系統300可執行以下步驟S410~S450。在步驟S410,數據分析模組320掃描儲存裝置/資料庫350中的資源數據。具體來說,數據分析模組320可被設置於非高峰流量的時間進行數據掃描,以避免佔用高峰值的運算資源。例如是每晚的晚上12點數據分析模組320進行資源數據的掃描。在步驟S420,數據分析模組320獲得資源數據中超出資源數據閾值的監控時間段。舉例而言,資源數據包括中央處理器(Central Processing Unit, CPU)的使用率以及記憶體使用率,並且資源數據閾值為CPU使用率達到75%以及記憶體使用率達到80%。在步驟S420中,數據分析模組320判斷儲存裝置/資料庫350中所儲存的請求數據歷程,進而逐一判斷每個時間段的資源數據是否有高於資源數據閾值,進而獲得至少一個資源數據超出閾值的監控時間段。FIG4 is a flow chart of the data analysis module 320 adjusting the current limiting configuration table of an embodiment of the present invention. In one embodiment, the current limiting configuration table includes the current limiting coefficient and the resource data threshold. Referring to FIG3 and FIG4, the monitoring current limiting system 300 can execute the following steps S410~S450. In step S410, the data analysis module 320 scans the resource data in the storage device/database 350. Specifically, the data analysis module 320 can be set to perform data scanning during non-peak traffic hours to avoid occupying peak computing resources. For example, the data analysis module 320 scans resource data at 12 o'clock every night. In step S420, the data analysis module 320 obtains the monitoring time period in the resource data that exceeds the resource data threshold. For example, the resource data includes the utilization rate of the central processing unit (CPU) and the memory utilization rate, and the resource data threshold is that the CPU utilization rate reaches 75% and the memory utilization rate reaches 80%. In step S420, the data analysis module 320 determines the request data history stored in the storage device/database 350, and then determines one by one whether the resource data of each time period is higher than the resource data threshold, and then obtains at least one monitoring time period in which the resource data exceeds the threshold.

在步驟S430,數據分析模組320判斷在步驟S420所獲得的監控時間段是否已經有設置限流係數。具體來說,限流計算設定中包括限流係數。因此,數據分析模組320判斷監控時間段是否設置有限流係數,就可以得出當前的監控時間段是否已被監控過。舉例而言,第一天的晚上7點到晚上9點的資源數據高於資源數據閾值,則數據分析模組320將晚上7點到晚上9點設置限流係數為1。接著,第二天的晚上7點到晚上9點的資源數據仍然高於資源數據閾值,則數據分析模組320判斷出晚上7點到晚上9點的時間段已經設置有限流係數。如此設置,響應於晚上7點到晚上9點的時間控已經有限流係數,數據分析模組320執行步驟S450。相反地,當數據分析模組320判斷當前的監控時間段未被設置限流係數,則執行步驟S440。In step S430, the data analysis module 320 determines whether the monitoring time period obtained in step S420 has been set with a current limiting coefficient. Specifically, the current limiting coefficient is included in the current limiting calculation setting. Therefore, by determining whether the monitoring time period has been set with a limited flow coefficient, the data analysis module 320 can determine whether the current monitoring time period has been monitored. For example, if the resource data from 7 pm to 9 pm on the first day is higher than the resource data threshold, the data analysis module 320 sets the current limiting coefficient from 7 pm to 9 pm to 1. Then, if the resource data from 7 pm to 9 pm on the second day is still higher than the resource data threshold, the data analysis module 320 determines that the limited flow coefficient has been set for the time period from 7 pm to 9 pm. In this way, in response to the time period from 7pm to 9pm being controlled with a limited flow coefficient, the data analysis module 320 executes step S450. On the contrary, when the data analysis module 320 determines that the current monitoring time period is not set with a limited flow coefficient, it executes step S440.

在步驟S440,響應於監控時間段沒有設置限流係數,數據分析模組320將監控時間段的限流係數設置為1。在步驟S450,響應於監控時間段有設置限流係數,數據分析模組320將監控時間段的限流係數加上1以作為新限流係數。舉例而言,第三天的晚上7點到晚上9點的當前限流係數為2,則數據分析模組320將3作為當前監控時間段的新限流係數。在本實施例中,限流係數具有係數閾值,係數閾值例如是5。當監控時間段的限流係數到達係數閾值時,數據分析模組320停止增加限流係數的值,而是數據分析模組320輸出監控時間段的訊息以及預設警示訊息。具體來說,當數據分析模組320執行步驟S430之時,判斷到監控時間段已經有設置限流係數,並且監控時間段的限流係數已經到達係數閾值。舉例而言,數據分析模組320將提醒訊息輸出至工作人員的終端裝置。在另一實施例中,數據分析模組320記錄這些時間段的訊息並且儲存於儲存裝置(例如資料庫350)中,以供系統人員的查閱。In step S440, in response to the monitoring time period not having a current limiting coefficient set, the data analysis module 320 sets the current limiting coefficient of the monitoring time period to 1. In step S450, in response to the monitoring time period having a current limiting coefficient set, the data analysis module 320 adds 1 to the current limiting coefficient of the monitoring time period as a new current limiting coefficient. For example, if the current limiting coefficient from 7:00 p.m. to 9:00 p.m. on the third day is 2, the data analysis module 320 sets 3 as the new current limiting coefficient for the current monitoring time period. In this embodiment, the current limiting coefficient has a coefficient threshold, and the coefficient threshold is, for example, 5. When the current limiting coefficient of the monitoring time period reaches the coefficient threshold, the data analysis module 320 stops increasing the value of the current limiting coefficient, and instead the data analysis module 320 outputs the message of the monitoring time period and the preset warning message. Specifically, when the data analysis module 320 executes step S430, it determines that the current limiting coefficient has been set for the monitoring time period, and the current limiting coefficient of the monitoring time period has reached the coefficient threshold. For example, the data analysis module 320 outputs a reminder message to the terminal device of the staff. In another embodiment, the data analysis module 320 records the messages of these time periods and stores them in a storage device (such as a database 350) for system personnel to review.

在一實施例中,數據分析模組320根據限流配置表以獲得具有限流係數的係數時間段。數據分析模組320掃描資源數據,以獲得係數時間段中資源數據(例如CPU使用率以及記憶體使用率)低於資源數據閾值的待調整時間段。接著,數據分析模組320將待調整時間段的限流係數減去1以作為新限流係數。當限流係數為0,則所述限流計算設定為0。也就是說,當限流係數為0,對應的時間段為非監控時間段。In one embodiment, the data analysis module 320 obtains a coefficient time period with a current limiting coefficient according to a current limiting configuration table. The data analysis module 320 scans the resource data to obtain a time period to be adjusted in which the resource data (such as CPU usage and memory usage) in the coefficient time period is lower than the resource data threshold. Then, the data analysis module 320 subtracts 1 from the current limiting coefficient of the time period to be adjusted as a new current limiting coefficient. When the current limiting coefficient is 0, the current limiting calculation is set to 0. That is to say, when the current limiting coefficient is 0, the corresponding time period is a non-monitoring time period.

在一實施例中,限流配置表包括自訂批註表。具體來說,自訂批註表包括應用程式介面的等級、應用程式介面的描述訊息以及應用程式介面的名稱的至少其中之一。舉例而言,監控限流系統300可根據自訂批註表獲得相關於應用程式介面的批註以及訊息,例如應用程式介面的等級。In one embodiment, the current limiting configuration table includes a custom annotation table. Specifically, the custom annotation table includes at least one of the level of the application program interface, the description information of the application program interface, and the name of the application program interface. For example, the monitoring current limiting system 300 can obtain the annotation and information related to the application program interface, such as the level of the application program interface, according to the custom annotation table.

在一實施例中,多個模組還包括非同步攔截模組。非同步攔截模組用以攔截請求數據,進而將請求數據的訊息儲存至儲存裝置/資料庫350中。非同步攔截模組通過非同步的方式將相關於請求數據的應用程式介面、應用程式介面的執行次數、時間段、應用程式介面名稱、應用程式介面的訪問方式、應用程式介面的訪問位址以及/或是應用程式介面的輸入數據結構儲存至請求日誌表中。值得說明的是,非同步攔截模組通過非同步的方式擷取以及儲存有關於請求數據的訊息,是為了不影響專案系統地執行以及不影響業務流程,進而避免影響專案服務的資源數據以及運算效率。在本實施例中,限流係數的最大值為5,並且儲存裝置120儲存請求日誌表。In one embodiment, the plurality of modules further include an asynchronous interception module. The asynchronous interception module is used to intercept request data and store the information of the request data in the storage device/database 350. The asynchronous interception module stores the API, the number of executions of the API, the time period, the API name, the access method of the API, the access address of the API and/or the input data structure of the API related to the request data in the request log table in an asynchronous manner. It is worth noting that the asynchronous interception module captures and stores information about request data in an asynchronous manner in order not to affect the execution of the project system and the business process, thereby avoiding affecting the resource data and computing efficiency of the project service. In this embodiment, the maximum value of the current limiting coefficient is 5, and the storage device 120 stores the request log table.

綜上所述,本發明的監控限流系統(100、300)及其方法可根據執行時間段以及限流計算設定,判斷當前的請求數據的時間段以及應用程式介面等級,進而根據執行的複雜度以及執行時間段進行特定的限流控制。並且,監控限流系統(100、300)根據請求數據歷程得知每一時間段的資源數據,進而根據資源數據的歷程進行限流係數的遞增或遞減,以達到逐步資源數據的控制(即限流),以有效地逐步管理以及控制每個時間段以及每個應用程式介面等級的限流比率。In summary, the monitoring and current limiting system (100, 300) and method of the present invention can determine the time period and application program interface level of the current request data according to the execution time period and the current limiting calculation setting, and then perform specific current limiting control according to the complexity of the execution and the execution time period. In addition, the monitoring and current limiting system (100, 300) obtains the resource data of each time period according to the request data history, and then increases or decreases the current limiting coefficient according to the resource data history to achieve step-by-step resource data control (i.e., current limiting), so as to effectively and step-by-step manage and control the current limiting ratio of each time period and each application program interface level.

最後應說明的是:以上各實施例僅用以說明本發明的技術方案,而非對其限制;儘管參照前述各實施例對本發明進行了詳細的說明,本領域的普通技術人員應當理解:其依然可以對前述各實施例所記載的技術方案進行修改,或者對其中部分或者全部技術特徵進行等同替換;而這些修改或者替換,並不使相應技術方案的本質脫離本發明各實施例技術方案的範圍。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technical personnel in this field should understand that they can still modify the technical solutions described in the above embodiments, or replace part or all of the technical features therein with equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention.

100:監控限流系統100: Monitoring current limiting system

110:處理器110:Processor

120:儲存裝置120: Storage device

101:數據關係求取和解析模組101: Data relationship acquisition and analysis module

102:請求數據分析單元102: Request data analysis unit

300:監控限流系統300: Monitoring current limiting system

310:限流攔截模組310: Current limiting module

320:數據分析模組320:Data Analysis Module

330:執行模組330: Execution module

340:數據採集模組340:Data Collection Module

350:資料庫350: Database

360:終端裝置360: Terminal Device

S210~S260、S311~S314、S351、S410~S450:步驟S210~S260, S311~S314, S351, S410~S450: Steps

圖1是本發明的一實施例的監控限流系統的示意圖。 圖2是本發明的一實施例的監控限流方法的流程圖。 圖3是本發明的一實施例的多個模組的執行示意圖。 圖4是本發明的一實施例的數據分析模組調整限流配置表的流程圖。 FIG1 is a schematic diagram of a monitoring current limiting system of an embodiment of the present invention. FIG2 is a flow chart of a monitoring current limiting method of an embodiment of the present invention. FIG3 is a schematic diagram of the execution of multiple modules of an embodiment of the present invention. FIG4 is a flow chart of a data analysis module adjusting a current limiting configuration table of an embodiment of the present invention.

S210~S260:步驟 S210~S260: Steps

Claims (18)

一種監控限流系統,包括:儲存裝置,儲存多個模組以及限流配置表;以及處理器,耦接所述儲存裝置,執行所述多個模組,並接收用於執行應用程式介面的請求數據,其中所述多個模組包括限流攔截模組、數據分析模組以及執行模組,其中所述限流攔截模組根據所述限流配置表判斷所述請求數據是否為限流請求,並且產生判斷結果,其中響應於所述判斷結果為所述限流請求,所述限流攔截模組拒絕所述請求數據的訪問,並且輸出預設訊息,其中響應於所述判斷結果為非限流請求,所述限流攔截模組將所述請求數據輸入至所述執行模組,其中所述執行模組執行所述請求數據,其中所述數據分析模組根據資源數據以及應用程式介面請求歷程調整所述限流配置表,其中所述限流配置表包括應用程式介面等級,其中所述應用程式介面等級包括一級應用程式介面、二級應用程式介面以及三級應用程式介面,並且不同的所述應用程式介面等級具有不同的可執行率,其中所述一級應用程式介面的所述可執行率相關於指數為限流係數的值,其中所述二級應用程式介面的所述可執行率相關於所述限流係數與常數的積,其中所述三級應用程式介面的所述可 執行率相關於所述限流係數。 A monitoring current limiting system includes: a storage device storing a plurality of modules and a current limiting configuration table; and a processor coupled to the storage device, executing the plurality of modules and receiving request data for executing an application programming interface, wherein the plurality of modules include a current limiting interception module, a data analysis module and an execution module, wherein the current limiting interception module performs a current limiting operation according to the current limiting configuration table. The flow configuration table determines whether the request data is a current limiting request and generates a determination result, wherein in response to the determination result being the current limiting request, the current limiting interception module rejects access to the request data and outputs a preset message, wherein in response to the determination result being a non-current limiting request, the current limiting interception module inputs the request data to the execution module, The execution module executes the request data, the data analysis module adjusts the current limiting configuration table according to the resource data and the application program interface request history, the current limiting configuration table includes application program interface levels, the application program interface levels include first-level application program interfaces, second-level application program interfaces, and third-level application program interfaces, and different application program interface levels have different executable rates, the executable rate of the first-level application program interface is related to the value of the current limiting coefficient, the executable rate of the second-level application program interface is related to the product of the current limiting coefficient and a constant, and the executable rate of the third-level application program interface is related to the current limiting coefficient. 如請求項1所述的監控限流系統,其中所述多個模組還包括:數據採集模組,根據預設時間定時地採集所述資源數據以及所述應用程式介面請求歷程,並且將所述資源數據以及所述應用程式介面請求歷程儲存至所述儲存裝置。 The monitoring and current limiting system as described in claim 1, wherein the multiple modules further include: a data collection module, which collects the resource data and the application program interface request history regularly according to a preset time, and stores the resource data and the application program interface request history in the storage device. 如請求項1所述的監控限流系統,其中所述限流配置表還包括限流時間段、當前服務執行次數、多個應用程式介面等級的執行上限值、當前應用程式介面等級的執行次數、限流計算設定、可執行率、限流係數的至少其中之一。 The monitoring and current limiting system as described in claim 1, wherein the current limiting configuration table further includes at least one of the current limiting time period, the current service execution times, the execution upper limits of multiple application program interface levels, the current application program interface level execution times, the current current application program interface level, the current limiting calculation settings, the executable rate, and the current limiting coefficient. 如請求項1所述的監控限流系統,其中所述限流配置表包括自訂批註表,其中所述自訂批註表包括所述應用程式介面的等級、所述應用程式介面的描述訊息以及所述應用程式介面的名稱的至少其中之一。 A monitoring and current limiting system as described in claim 1, wherein the current limiting configuration table includes a custom annotation table, wherein the custom annotation table includes at least one of the level of the application program interface, the description message of the application program interface, and the name of the application program interface. 如請求項1所述的監控限流系統,其中所述數據分析模組根據所述限流配置表以獲得具有所述限流係數的係數時間段,其中所述數據分析模組掃描所述資源數據,以獲得所述係數時間段中所述資源數據低於資源數據閾值的待調整時間段,其中所述數據分析模組將所述待調整時間段的所述限流係數減去1以作為新限流係數。 A monitoring and current limiting system as described in claim 1, wherein the data analysis module obtains a coefficient time period having the current limiting coefficient according to the current limiting configuration table, wherein the data analysis module scans the resource data to obtain a time period to be adjusted in which the resource data in the coefficient time period is lower than the resource data threshold, wherein the data analysis module subtracts 1 from the current limiting coefficient of the time period to be adjusted as a new current limiting coefficient. 如請求項1所述的監控限流系統,其中所述限流配置表包括當前限流係數以及資源數據閾值,其中所述數據分析模組掃描所述儲存裝置中的所述資源數據,以獲得所述資源數據中超出所述資源數據閾值的監控時間段,其中所述數據分析模組判斷所述監控時間段是否有設置限流係數,其中響應於所述監控時間段沒有設置所述限流係數,所述數據分析模組將所述監控時間段的所述限流係數設置為1,其中響應於所述監控時間段有設置所述限流係數,所述數據分析模組將所述監控時間段的所述限流係數加上1以作為新限流係數。 A monitoring and current limiting system as described in claim 1, wherein the current limiting configuration table includes a current current limiting coefficient and a resource data threshold, wherein the data analysis module scans the resource data in the storage device to obtain a monitoring time period in the resource data that exceeds the resource data threshold, wherein the data analysis module determines whether a current limiting coefficient is set for the monitoring time period, wherein in response to the monitoring time period not having the current limiting coefficient set, the data analysis module sets the current limiting coefficient for the monitoring time period to 1, wherein in response to the monitoring time period having the current limiting coefficient set, the data analysis module adds 1 to the current limiting coefficient for the monitoring time period as a new current limiting coefficient. 如請求項6所述的監控限流系統,其中當所述監控時間段的所述限流係數到達係數閾值時,所述數據分析模組輸出所述監控時間段的訊息以及預設警示訊息。 The monitoring and current limiting system as described in claim 6, wherein when the current limiting coefficient of the monitoring time period reaches the coefficient threshold, the data analysis module outputs the message of the monitoring time period and the preset warning message. 如請求項6所述的監控限流系統,其中所述限流攔截模組根據所述限流配置表以及所述應用程式介面請求歷程判斷所述請求數據是否為所述限流請求,其中所述限流請求為所述請求數據匹配於監控時間段中的服務請求,並且所述監控時間段的當前應用程式介面等級的執行次數達到對應的所述應用程式介面等級的執行上限值。 The monitoring and current limiting system as described in claim 6, wherein the current limiting interception module determines whether the request data is the current limiting request according to the current limiting configuration table and the application program interface request history, wherein the current limiting request is a service request in which the request data matches the monitoring time period, and the execution times of the current application program interface level in the monitoring time period reaches the execution upper limit value of the corresponding application program interface level. 如請求項6所述的監控限流系統,其中還包括:非同步攔截模組,用以攔截所述請求數據,進而將所述請求 數據的訊息儲存至所述儲存裝置中,其中所述非同步攔截模組通過非同步的方式將相關於所述請求數據的應用程式介面、所述應用程式介面的執行次數以及時間段儲存至請求日誌表中,其中所述限流係數的最大值為5,並且所述儲存裝置儲存所述請求日誌表。 The monitoring and current limiting system as described in claim 6 further comprises: an asynchronous interception module for intercepting the request data and storing the information of the request data in the storage device, wherein the asynchronous interception module stores the application program interface related to the request data, the number of executions of the application program interface and the time period in the request log table in an asynchronous manner, wherein the maximum value of the current limiting coefficient is 5, and the storage device stores the request log table. 一種監控限流方法,包括:通過處理器接收用於執行應用程式介面的請求數據;通過所述處理器執行限流攔截模組,以使所述限流攔截模組根據限流配置表判斷所述請求數據是否為限流請求,並且產生判斷結果;響應於所述判斷結果為所述限流請求,通過所述限流攔截模組拒絕所述請求數據的訪問,並且輸出預設訊息;響應於所述判斷結果為非限流請求,通過所述限流攔截模組將所述請求數據輸入至執行模組;通過所述處理器執行所述執行模組,以使所述執行模組執行所述請求數據;以及通過所述處理器執行數據分析模組,以使所述數據分析模組根據資源數據以及應用程式介面請求歷程調整所述限流配置表,其中所述限流配置表包括應用程式介面等級,其中所述應用程式介面等級包括一級應用程式介面、二級應用程式介面以及三級應用程式介面,並且不同的所述應用程式介面等級具有不同的 可執行率,其中所述一級應用程式介面的所述可執行率相關於指數為限流係數的值,其中所述二級應用程式介面的所述可執行率相關於所述限流係數與常數的積,其中所述三級應用程式介面的所述可執行率相關於所述限流係數。 A monitoring current limiting method comprises: receiving request data for executing an application program interface through a processor; executing a current limiting interception module through the processor, so that the current limiting interception module determines whether the request data is a current limiting request according to a current limiting configuration table, and generates a judgment result; in response to the judgment result being the current limiting request, The current limiting interception module rejects access to the request data and outputs a preset message; in response to the judgment result being a non-current limiting request, the request data is input to the execution module through the current limiting interception module; the execution module is executed by the processor so that the execution module executes the request data; and the processor executes the data According to the analysis module, the data analysis module adjusts the current limiting configuration table according to the resource data and the application program interface request history, wherein the current limiting configuration table includes an application program interface level, wherein the application program interface level includes a first-level application program interface, a second-level application program interface, and a third-level application program interface, and different application program interface levels have different executable rates, wherein the executable rate of the first-level application program interface is related to the value of the current limiting coefficient, wherein the executable rate of the second-level application program interface is related to the product of the current limiting coefficient and a constant, wherein the executable rate of the third-level application program interface is related to the current limiting coefficient. 如請求項10所述的監控限流方法,還包括:通過所述處理器執行數據採集模組,以使所述數據採集模組根據預設時間定時地採集所述資源數據以及所述應用程式介面請求歷程;以及通過所述數據採集模組將所述資源數據以及所述應用程式介面請求歷程儲存至儲存裝置。 The monitoring and current limiting method as described in claim 10 further includes: executing a data collection module through the processor so that the data collection module collects the resource data and the application program interface request history regularly according to a preset time; and storing the resource data and the application program interface request history in a storage device through the data collection module. 如請求項10所述的監控限流方法,其中所述限流配置表還包括限流時間段、當前服務執行次數、多個應用程式介面等級的執行上限值、當前應用程式介面等級的執行次數、限流計算設定、可執行率、限流係數的至少其中之一。 The monitoring and limiting method as described in claim 10, wherein the limiting configuration table further includes at least one of the limiting time period, the current service execution times, the execution upper limits of multiple application program interface levels, the current application program interface level execution times, the limiting calculation settings, the executable rate, and the limiting coefficient. 如請求項10所述的監控限流方法,其中所述限流配置表包括自訂批註表,其中所述自訂批註表包括所述應用程式介面的等級、所述應用程式介面的描述訊息以及所述應用程式介面的名稱的至少其中之一。 A monitoring and limiting method as described in claim 10, wherein the limiting configuration table includes a custom annotation table, wherein the custom annotation table includes at least one of the level of the application program interface, the description message of the application program interface, and the name of the application program interface. 如請求項10所述的監控限流方法,其中通過所述數據分析模組根據所述資源數據以及所述應用程式介面請求歷程調整所述限流配置表的步驟包括: 通過所述數據分析模組根據所述限流配置表以獲得具有所述限流係數的係數時間段;通過所述數據分析模組掃描所述資源數據,以獲得所述係數時間段中所述資源數據低於資源數據閾值的待調整時間段;以及通過所述數據分析模組將所述待調整時間段的所述限流係數減去1以作為新限流係數。 The monitoring and limiting method as described in claim 10, wherein the step of adjusting the limiting configuration table according to the resource data and the application program interface request process through the data analysis module includes: Acquiring a coefficient time period having the limiting coefficient according to the limiting configuration table through the data analysis module; scanning the resource data through the data analysis module to obtain a time period to be adjusted in which the resource data in the coefficient time period is lower than the resource data threshold; and subtracting 1 from the limiting coefficient of the time period to be adjusted through the data analysis module as a new limiting coefficient. 如請求項10所述的監控限流方法,其中所述限流配置表包括當前限流係數以及資源數據閾值,其中通所述數據分析模組根據所述資源數據以及所述應用程式介面請求歷程調整所述限流配置表的步驟還包括:通過所述數據分析模組掃描儲存裝置中的所述資源數據,以獲得所述資源數據中超出所述資源數據閾值的監控時間段;通過所述數據分析模組判斷所述監控時間段是否有設置限流係數,響應於所述監控時間段沒有設置所述限流係數,通過所述數據分析模組將所述監控時間段的所述限流係數設置為1;以及響應於所述監控時間段有設置所述限流係數,通過所述數據分析模組將所述監控時間段的所述限流係數加上1以作為新限流係數。 The monitoring and current limiting method as described in claim 10, wherein the current limiting configuration table includes a current current limiting coefficient and a resource data threshold, wherein the step of adjusting the current limiting configuration table according to the resource data and the application program interface request process through the data analysis module further includes: scanning the resource data in the storage device through the data analysis module to obtain the monitoring time of the resource data exceeding the resource data threshold segment; judging whether a current limiting coefficient is set in the monitoring time segment through the data analysis module, in response to the current limiting coefficient not being set in the monitoring time segment, setting the current limiting coefficient of the monitoring time segment to 1 through the data analysis module; and in response to the current limiting coefficient being set in the monitoring time segment, adding 1 to the current limiting coefficient of the monitoring time segment through the data analysis module as a new current limiting coefficient. 如請求項15所述的監控限流方法,其中通過所述數據分析模組根據所述資源數據以及所述應用程式介面請求歷程調整所述限流配置表的步驟還包括: 當所述監控時間段的所述限流係數到達係數閾值時,通過所述數據分析模組輸出所述監控時間段的訊息以及預設警示訊息。 The monitoring and current limiting method as described in claim 15, wherein the step of adjusting the current limiting configuration table according to the resource data and the application program interface request process through the data analysis module further includes: When the current limiting coefficient of the monitoring time period reaches the coefficient threshold, the message of the monitoring time period and the preset warning message are output through the data analysis module. 如請求項15所述的監控限流方法,其中通過所述數據分析模組根據所述資源數據以及所述應用程式介面請求歷程調整所述限流配置表的步驟還包括:通過所述限流攔截模組根據所述限流配置表以及所述應用程式介面請求歷程判斷所述請求數據是否為所述限流請求,其中所述限流請求為所述請求數據匹配於監控時間段中的服務請求,並且所述監控時間段的當前應用程式介面等級的執行次數達到對應的所述應用程式介面等級的執行上限值。 The monitoring and current limiting method as described in claim 15, wherein the step of adjusting the current limiting configuration table according to the resource data and the API request history by the data analysis module further includes: judging whether the request data is the current limiting request according to the current limiting configuration table and the API request history by the current limiting interception module, wherein the current limiting request is a service request in which the request data matches the monitoring time period, and the execution times of the current API level in the monitoring time period reaches the corresponding execution upper limit of the API level. 如請求項15所述的監控限流方法,還包括:通過所述處理器執行非同步攔截模組,以使所述非同步攔截模組攔截所述請求數據,進而將所述請求數據的訊息儲存至所述儲存裝置中,其中所述非同步攔截模組通過非同步的方式將相關於所述請求數據的應用程式介面、所述應用程式介面的執行次數以及時間段儲存至請求日誌表中,其中所述限流係數的最大值為5,並且所述儲存裝置儲存所述請求日誌表。 The monitoring and current limiting method as described in claim 15 further includes: executing an asynchronous interception module through the processor so that the asynchronous interception module intercepts the request data, and then storing the message of the request data in the storage device, wherein the asynchronous interception module stores the application program interface related to the request data, the number of executions of the application program interface, and the time period in the request log table in an asynchronous manner, wherein the maximum value of the current limiting coefficient is 5, and the storage device stores the request log table.
TW112150913A 2023-11-03 2023-12-27 Monitoring and limiting system of requesting to access system resources and method thereof TWI855948B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202311459247.5A CN117459469A (en) 2023-11-03 2023-11-03 Monitoring current limiting systems and methods thereof
CN2023114592475 2023-11-03

Publications (2)

Publication Number Publication Date
TWI855948B true TWI855948B (en) 2024-09-11
TW202520071A TW202520071A (en) 2025-05-16

Family

ID=89590714

Family Applications (1)

Application Number Title Priority Date Filing Date
TW112150913A TWI855948B (en) 2023-11-03 2023-12-27 Monitoring and limiting system of requesting to access system resources and method thereof

Country Status (2)

Country Link
CN (1) CN117459469A (en)
TW (1) TWI855948B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160171071A1 (en) * 2014-12-11 2016-06-16 International Business Machines Corporation Dynamic creation and configuration of partitioned index through analytics based on existing data population
TW201931142A (en) * 2017-10-30 2019-08-01 韓商愛思開海力士有限公司 Converged memory device and operation method thereof
CN113489702A (en) * 2021-06-29 2021-10-08 网易(杭州)网络有限公司 Interface current limiting method and device and electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160171071A1 (en) * 2014-12-11 2016-06-16 International Business Machines Corporation Dynamic creation and configuration of partitioned index through analytics based on existing data population
TW201931142A (en) * 2017-10-30 2019-08-01 韓商愛思開海力士有限公司 Converged memory device and operation method thereof
CN113489702A (en) * 2021-06-29 2021-10-08 网易(杭州)网络有限公司 Interface current limiting method and device and electronic equipment

Also Published As

Publication number Publication date
TW202520071A (en) 2025-05-16
CN117459469A (en) 2024-01-26

Similar Documents

Publication Publication Date Title
CN110489447B (en) Data query method and device, computer equipment and storage medium
CN111367693B (en) Method, system, device and medium for scheduling plug-in tasks based on message queue
CN113285883A (en) Access request current limiting method and device, electronic equipment and storage medium
WO2019169724A1 (en) Server concurrency control method and device, computer device, and storage medium
WO2021159638A1 (en) Method, apparatus and device for scheduling cluster queue resources, and storage medium
JP2023089891A (en) Cluster capacity expansion method and device
CN115766876B (en) Resource scheduling method, device, equipment and storage medium
CN114143327B (en) Cluster resource quota allocation method and device and electronic equipment
CN111913784B (en) Task scheduling method and device, network element and storage medium
CN113419863B (en) A data distribution and processing method and device based on node capability
CN114745278A (en) Method and device for expanding and contracting capacity of business system, electronic equipment and storage medium
WO2023093194A1 (en) Cloud monitoring method and cloud management platform
CN106933673B (en) Method and device for adjusting number of logical threads of component
CN118331751A (en) Computing resource allocation method, computer program, device and medium
CN105404554B (en) Method and device for Storm streaming computing framework
TWI855948B (en) Monitoring and limiting system of requesting to access system resources and method thereof
CN116248473A (en) Information processing method, device and computer readable storage medium
CN111555918B (en) Return source optimization method and device and electronic equipment
WO2020000724A1 (en) Method, electronic device and medium for processing communication load between hosts of cloud platform
CN118626252A (en) Data operation request processing method, device, equipment and storage medium
CN119025514A (en) Data quality detection method, device, equipment and storage medium
CN111782364A (en) Service invocation method, device, electronic device and storage medium
CN117435302A (en) Container capacity adjustment method, device, electronic equipment and storage medium
CN114124757B (en) Parameter adjustment method, device, related equipment and storage medium
TWI735520B (en) Method and device for adjusting the number of component logic threads