Nothing Special   »   [go: up one dir, main page]

TWM600871U - Computer program product and apparatus for arranging and executing jobs - Google Patents

Computer program product and apparatus for arranging and executing jobs Download PDF

Info

Publication number
TWM600871U
TWM600871U TW109206050U TW109206050U TWM600871U TW M600871 U TWM600871 U TW M600871U TW 109206050 U TW109206050 U TW 109206050U TW 109206050 U TW109206050 U TW 109206050U TW M600871 U TWM600871 U TW M600871U
Authority
TW
Taiwan
Prior art keywords
processing
main queue
mentioned
short
scheduling
Prior art date
Application number
TW109206050U
Other languages
Chinese (zh)
Inventor
陳瑞泰
Original Assignee
昕力資訊股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 昕力資訊股份有限公司 filed Critical 昕力資訊股份有限公司
Priority to TW109206050U priority Critical patent/TWM600871U/en
Publication of TWM600871U publication Critical patent/TWM600871U/en

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure discloses a computer program product for arranging and executing jobs being loaded and executed by a processing unit of an application server to include program code to: acquire an object for the top of a primary queue, which is generated by a client to request the application server to execute a service; determine whether the primary queue contains any same object as the acquired object; and if so, drop the object from being processed.

Description

排程和執行工作的電腦程式產品和裝置Computer program products and devices for scheduling and executing tasks

本新型關連於一種工作處理技術,特別是一種排程和執行工作的電腦程式產品和裝置。The present invention relates to a work processing technology, especially a computer program product and device for scheduling and executing work.

應用程式伺服器通常需要處理各種不同類型的工作。有些工作需要執行的工作很短,例如單純的資料庫交易;另一些工作需要執行很長的時間,例如資料庫中資料表的大量總結計算,造成需要執行很長時間的工作會阻礙短時間工作的執行。此外,有些工作的執行需要依照順序並且有條件分支,要在延遲一小段時間後,等待主分支執行完成後才會接續次分支的執行。例如,將多筆資料寫入資料庫,寫入完成後取得最後一筆資料的生成流水號,做為下個步驟的輸入參數。有時候,當資料庫系統忙碌時,無法很快的生成流水號,造成欲取得最後一筆資料的生成流水號的工作不能馬上完成。傳統上,應用程式會啟動一個計時器,反覆偵測資料庫系統是否存在最後一筆資料的生成流水號,造成應用程式伺服器連續收到很多偵測的工作。另有時候,使用者常常在使用者介面上連續按重新整理按鈕來查詢資料,造成應用程式伺服器連續收到很多相同的查詢工作。這些重複的相同工作都會加重應用程式伺服器的工作負載。因此,需要一種電腦程式產品和裝置,用於排程和執行工作,有效率地處理應用程式產生的不同類型的工作。Application servers usually need to handle a variety of different types of tasks. Some tasks need to perform very short tasks, such as simple database transactions; other tasks require a long time to perform, such as a large number of summary calculations in the database tables, resulting in long-term tasks that hinder short-term tasks Implementation. In addition, the execution of some tasks requires sequential and conditional branches. After a short delay, the execution of the secondary branch will be continued after waiting for the completion of the main branch. For example, write multiple pieces of data into the database, and obtain the generation serial number of the last piece of data after the writing is completed, as the input parameter of the next step. Sometimes, when the database system is busy, the serial number cannot be generated quickly, so that the job of generating the serial number for obtaining the last data cannot be completed immediately. Traditionally, the application program will start a timer to repeatedly detect whether the database system has the generation serial number of the last data, causing the application server to continuously receive many detection tasks. Sometimes, users often press the refresh button continuously on the user interface to query data, causing the application server to continuously receive many of the same query tasks. These repeated identical tasks will increase the workload of the application server. Therefore, there is a need for a computer program product and device for scheduling and executing tasks to efficiently process different types of tasks generated by applications.

有鑑於此,如何減輕或消除上述相關領域的缺失,實為有待解決的問題。In view of this, how to reduce or eliminate the deficiencies in the above-mentioned related fields is indeed a problem to be solved.

本說明書涉及一種電腦程式產品,用於排程和執行工作,包含能夠應用程式伺服器的處理單元載入並執行的程式碼,用於:從主要佇列的頂端取出物件,此物件由客戶端產生來請求應用程式伺服器執行服務;判斷主要佇列中是否存在相同於此物件的任何物件;以及當主要佇列中存在相同於此物件的任何物件時,丟棄此物件而不處理。This manual relates to a computer program product used for scheduling and executing tasks. It contains code that can be loaded and executed by the processing unit of the application server. It is used to: fetch an object from the top of the main queue. This object is provided by the client Generated to request the application server to execute the service; determine whether there is any object that is the same as this object in the main queue; and when there is any object that is the same as this object in the main queue, discard this object without processing.

本說明書另涉及一種排程和執行工作的裝置,包含記憶體和處理單元。記憶體配置空間給主要佇列。處理單元耦接記憶體,用於從主要佇列的頂端取出物件,此物件由客戶端產生來請求此裝置執行服務;判斷主要佇列中是否存在相同於此物件的任何物件;以及當主要佇列中存在相同於此物件的任何物件時,丟棄此物件而不處理。This specification also relates to a device for scheduling and executing tasks, including a memory and a processing unit. Memory allocation space is given to the main queue. The processing unit is coupled to the memory and used to retrieve an object from the top of the main queue, which is generated by the client to request the device to perform services; determine whether there is any object in the main queue that is the same as this object; and when the main queue is When there is any object that is the same as this object in the column, discard this object without processing.

本新型的其他優點將搭配以下的說明和圖式進行更詳細的解說。The other advantages of the present invention will be explained in more detail with the following description and drawings.

以下說明為完成新型的較佳實現方式,其目的在於描述本新型的基本精神,但並不用以限定本新型。實際的新型內容必須參考之後的權利要求範圍。The following description is a preferred implementation method for completing the new type, and its purpose is to describe the basic spirit of the new type, but not to limit the new type. The actual new content must refer to the following claims.

必須了解的是,使用於本說明書中的“包含”、“包括”等詞,用以表示存在特定的技術特徵、數值、方法步驟、作業處理、元件以及/或組件,但並不排除可加上更多的技術特徵、數值、方法步驟、作業處理、元件、組件,或以上的任意組合。It must be understood that the words "including" and "including" used in this specification are used to indicate the existence of specific technical features, values, method steps, operations, elements and/or components, but they do not exclude the possibility of adding More technical features, values, method steps, job processing, components, components, or any combination of the above.

於權利要求中使用如“第一”、“第二”、“第三”等詞是用來修飾權利要求中的元件,並非用來表示之間具有優先順序,前置關係,或者是一個元件先於另一個元件,或者是執行方法步驟時的時間先後順序,僅用來區別具有相同名字的元件。Words such as "first", "second", and "third" used in the claims are used to modify the elements in the claims, and are not used to indicate that there is a precedence, prerequisite relationship, or an element Prior to another element, or the chronological order of execution of method steps, is only used to distinguish elements with the same name.

必須了解的是,當元件描述為“連接”或“耦接”至另一元件時,可以是直接連結、或耦接至其他元件,可能出現中間元件。相反地,當元件描述為“直接連接”或“直接耦接”至另一元件時,其中不存在任何中間元件。使用來描述元件之間關係的其他語詞也可類似方式解讀,例如“介於”相對於“直接介於”,或者是“鄰接”相對於“直接鄰接”等等。It must be understood that when an element is described as being “connected” or “coupled” to another element, it can be directly connected or coupled to other elements, and intermediate elements may appear. Conversely, when an element is described as being "directly connected" or "directly coupled" to another element, there are no intervening elements. Other terms used to describe the relationship between elements can also be interpreted in a similar manner, for example, "between" versus "directly between", or "adjacent" versus "directly adjacent" and so on.

本新型實施例提出一種網路系統架構,包含伺服器(servers)與多部客戶端(clients)。圖1係依據本新型實施例的網路系統架構圖。應用程式伺服器110、桌上型電腦151、平板電腦153以及手機155之間可透過網路100彼此通訊,網路100可為網際網路(Internet)、有線區域網路(wired Local Area Network,LAN)、無線區域網路,或以上的任意組合。桌上型電腦151、平板電腦153以及手機155可稱為客戶端,通過網路100將應用程式部署到應用程式伺服器110上,或者是通過網路100執行應用程式伺服器110上運行的服務。應用程式通常由服務提供者(Service Provider)開發並部署到應用程式伺服器110,包含各式各樣的業務邏輯,可涵蓋但不限於數位銀行管理、網路銀行、行動客服、企業內部流程管理、大數據存儲、大數據資料整合、大數據資料檢索等領域。The embodiment of the present invention proposes a network system architecture, including servers and multiple clients. Figure 1 is a diagram of the network system architecture according to an embodiment of the present invention. The application server 110, the desktop computer 151, the tablet computer 153, and the mobile phone 155 can communicate with each other through the network 100. The network 100 can be the Internet or a wired local area network (Wired Local Area Network, LAN), wireless local area network, or any combination of the above. The desktop computer 151, the tablet computer 153, and the mobile phone 155 can be called clients, which deploy applications to the application server 110 through the network 100, or execute services running on the application server 110 through the network 100 . Applications are usually developed by Service Providers and deployed to the application server 110. They contain various business logics, including but not limited to digital bank management, online banking, mobile customer service, and internal enterprise process management , Big data storage, big data data integration, big data data retrieval and other fields.

圖2係依據本新型實施例的運算裝置的系統架構圖。此系統架構可實施於應用程式伺服器110、桌上型電腦151、平板電腦153以及手機155中之任一者,至少包含處理單元210。處理單元210可使用多種方式實施,例如以專用硬體電路或通用硬體(例如,單一處理器、具平行處理能力的多處理器、圖形處理器或其他具運算能力的處理器),並且在執行程式碼或軟體時,提供之後所描述的功能。系統架構另包含記憶體250及儲存單元240,記憶體250儲存程式碼執行過程中需要的資料,例如,變數、資料表(Data Tables)等,儲存單元240儲存各式各樣的電子檔案,例如,網頁、文件、音訊檔、視訊檔等。系統架構另包含通訊介面260,讓處理單元210可藉以跟其他電子裝置進行溝通。通訊介面260可以是無線電信通訊模組(Wireless Telecommunications Module)、區域網路(Local Area Network, LAN)通訊模組或無線區域網路通訊模組(WLAN)。無線電信通訊模組(Wireless Telecommunications Module)可包含支援2G、3G、4G或以上技術世代的任意組合的調變解調器(Modem)。輸入裝置230可包含鍵盤、滑鼠、觸控面板等。使用者可按壓鍵盤上的硬鍵來輸入字元,藉由操作滑鼠來控制鼠標,或者是在觸控面板製造手勢來控制執行中的應用程式。手勢可包含單擊、雙擊、單指拖曳、多指拖曳等,但不限定於此。顯示單元220可包含顯示面板(例如,薄膜液晶顯示面板、有機發光二極體面板或其他具顯示能力的面板),用以顯示輸入的字元、數字、符號、拖曳鼠標的移動軌跡、繪製的圖案或應用程式所提供的畫面,提供給使用者觀看。Figure 2 is a system architecture diagram of a computing device according to an embodiment of the present invention. This system architecture can be implemented in any of the application server 110, the desktop computer 151, the tablet computer 153, and the mobile phone 155, and at least includes the processing unit 210. The processing unit 210 can be implemented in a variety of ways, such as a dedicated hardware circuit or a general-purpose hardware (for example, a single processor, a multi-processor with parallel processing capabilities, a graphics processor, or other processors with computing capabilities). When running code or software, provide the functions described later. The system architecture also includes a memory 250 and a storage unit 240. The memory 250 stores data needed during the execution of the program code, such as variables, data tables, etc. The storage unit 240 stores various electronic files, such as , Web pages, documents, audio files, video files, etc. The system architecture further includes a communication interface 260, so that the processing unit 210 can communicate with other electronic devices. The communication interface 260 may be a wireless telecommunications module (Wireless Telecommunications Module), a local area network (LAN) communication module, or a wireless local area network communication module (WLAN). The wireless telecommunications module (Wireless Telecommunications Module) can include a modem that supports any combination of 2G, 3G, 4G or above technology generations. The input device 230 may include a keyboard, a mouse, a touch panel, etc. The user can press hard keys on the keyboard to input characters, operate the mouse to control the mouse, or make gestures on the touch panel to control the running application. Gestures may include single-click, double-click, single-finger drag, multi-finger drag, etc., but are not limited thereto. The display unit 220 may include a display panel (for example, a thin-film liquid crystal display panel, an organic light-emitting diode panel, or other panels with display capabilities) for displaying input characters, numbers, symbols, moving traces of dragging the mouse, and drawing Patterns or screens provided by applications are provided for users to watch.

應用程式伺服器110提供一個應用程式執行的環境,為每個應用程式提供多樣的服務,例如,請求分派與負載平衡、數位認證中心、應用程式介面(Application Programming Interface,API)授權管理、用戶授權/流量/網際網路通訊協定(Internet Protocol,IP)控制、組織階層管理、資安連線(SSL/TLS)管理、數位簽章驗證、機敏資料加密、單一登入主動目錄(Single Sign-On Active Directory,SSO AD)整合、跨站指令(Cross-Site Scripting,XSS)防駭攻擊、API熱部署、區段故障切換(Session Fail-over)、預防重複交易機制、貴賓API優先、異質部署/多版本運行、API偵錯、API軌跡紀錄、伺服器監控/告警、逐API/用戶報表、(Java)DC主機綁定管理、.NET站台綁定管理、註冊主機管理、API服務註冊、API模組佈署發佈、API組合與設計等。從另一面來說,這些功能也可以被多種不同的應用程式使用,因此,如上所述應用程式執行的環境又稱為共用服務平台(Shared Service Platform)。The application server 110 provides an application execution environment, providing various services for each application, such as request dispatch and load balancing, digital authentication center, application programming interface (API) authorization management, and user authorization /Traffic/Internet Protocol (IP) control, organizational hierarchy management, information security connection (SSL/TLS) management, digital signature verification, smart data encryption, single sign-on active directory (Single Sign-On Active) Directory, SSO AD) integration, cross-site command (Cross-Site Scripting, XSS) anti-hacking attacks, API hot deployment, session fail-over (Session Fail-over), duplicate transaction prevention mechanism, VIP API priority, heterogeneous deployment/multiple Version operation, API debugging, API track record, server monitoring/alarm, report by API/user, (Java)DC host binding management, .NET site binding management, registered host management, API service registration, API module Deployment and release, API combination and design, etc. On the other hand, these functions can also be used by a variety of different applications. Therefore, the environment in which the applications are executed as described above is also called the Shared Service Platform.

為了將需要長時間執行和短時間執行的工作分開處理,應用程式伺服器110可在其記憶體250中提供兩個工作佇列:主要佇列和二級佇列。圖3為依據本新型實施例的佇列配置示意圖。舉例來說,記憶體250分別配置空間給主要佇列310和二級佇列330,主要佇列310用於依照到達應用程式伺服器110的時間順序儲存用戶端發送的物件(包含需要短時間和長時間處理的工作),而二級佇列330用於依照到達應用程式伺服器110的時間順序儲存從主要佇列310遷移來的物件(只包含需要長時間處理的工作)。主要佇列310和二級佇列330各包含多筆項目(Entry)形成的集合(Collection)。主要佇列310和二級佇列330中的每一筆項目可儲存一個物件。主要佇列310和二級佇列330的操作基本原則是由結束位置(如指標T所指的位置)新增物件(可稱為入列),並且由開始位置(如指標H所指的位置)移除物件(可稱為出列)。也就是說,第一個新增至主要佇列310或二級佇列330的物件,也將會是第一個被移出的,符合先進先出(First-In First-Out,FIFO)的原則。In order to separate the tasks that need to be executed for a long time and for a short time, the application server 110 may provide two task queues in its memory 250: a main queue and a secondary queue. Fig. 3 is a schematic diagram of a queue configuration according to an embodiment of the present invention. For example, the memory 250 allocates space to the main queue 310 and the second queue 330 respectively. The main queue 310 is used to store the objects sent by the client (including the short time and Long-time processing tasks), and the secondary queue 330 is used to store objects migrated from the main queue 310 according to the time sequence when they arrive at the application server 110 (including only tasks that require long-term processing). The main queue 310 and the secondary queue 330 each include a collection formed by multiple entries (Entry). Each item in the main queue 310 and the second queue 330 can store one object. The basic principle of the operation of the main queue 310 and the secondary queue 330 is to add an object (which can be called enqueue) from the end position (as indicated by the index T), and from the start position (as indicated by the index H) ) Remove objects (can be called dequeue). In other words, the first object added to the main queue 310 or the second queue 330 will also be the first to be removed, which conforms to the First-In First-Out (FIFO) principle .

為了區分需要長時間處理的工作和短時間處理的工作,客戶端執行的應用程式可產生繼承不同抽象類別(Abstract Class)的物件,並且將產生的物件通過網路100傳送給應用程式伺服器110。圖4A和圖4B係依據本新型實施例的類別圖(Class Diagram)。In order to distinguish between tasks that require long-term processing and tasks that require short-term processing, the client-side application can generate objects that inherit different abstract classes (Abstract Class), and send the generated objects to the application server 110 through the network 100 . 4A and 4B are class diagrams according to the embodiment of the present invention.

圖4A的類別圖包含工作抽象類別“Abstract Job”410,至少包含一個屬性:工作類型“jobType”的長整數;以及一個方法:不傳回值的工作執行“runJob()”。郵件類別“Mail”422和資料庫處理類別“DB_Trans”424擴充(Extends)工作抽象類別“Abstract Job”410,代表它們是短時間處理的工作。郵件類別“Mail”422至少包含幾個屬性:群組識別碼“groupID”的長整數、多個接收地址“To[]”的字串和多個副本地址“CC[]”的字串;以及一個方法:不傳回值的工作執行“runJob()”。資料庫處理類別“DB_Trans”424至少包含幾個屬性:群組識別碼“groupID”的長整數、資料庫名稱“dbName”的字串和SQL命令“sqlQuery”的字串;以及一個方法:不傳回值的工作執行“runJob()”。其中,群組識別碼“groupID”用來區別不同物件之間相同與否。例如,應用程式為反覆偵測資料庫系統是否存在最後一筆資料的生成流水號會產生的多個資料庫處理類別“DB_Trans”424的物件,然而,它們的群組識別碼“groupID”是相同的。The category diagram of FIG. 4A contains a job abstract category "Abstract Job" 410, which contains at least one attribute: a long integer of job type "jobType"; and a method: a job execution "runJob()" that does not return a value. The mail category "Mail" 422 and the database processing category "DB_Trans" 424 extension (Extends) work abstract category "Abstract Job" 410, representing that they are short-time processing jobs. The mail category "Mail" 422 contains at least several attributes: the long integer of the group identification code "groupID", the string of multiple receiving addresses "To[]" and the string of multiple duplicate addresses "CC[]"; and One method: execute "runJob()" for jobs that do not return a value. The database processing category "DB_Trans" 424 contains at least several attributes: the long integer of the group ID "groupID", the string of the database name "dbName" and the string of the SQL command "sqlQuery"; and one method: do not pass The return job executes "runJob()". Among them, the group identification code "groupID" is used to distinguish whether different objects are the same or not. For example, if the application repeatedly detects whether the database system has the last piece of data, the serial number will generate multiple objects of the database processing type "DB_Trans" 424. However, their group ID "groupID" is the same .

圖4B的類別圖包含可延遲工作抽象類別“Abstract DefferableJob”450,至少包含一個屬性:工作類型“jobType”的長整數;以及一個方法:不傳回值的工作執行“runJob()”。群組郵件類別“GroupMail”462和資料庫批次處理類別“DB_BatchTrans”464擴充可延遲工作抽象類別“Abstract DefferableJob”450,代表它們是長時間處理的工作。群組郵件類別“GroupMail”462至少包含幾個屬性:群組識別碼“groupID”的長整數、多個接收地址“To[]”的字串和多個副本地址“CC[]”的字串;以及一個方法:不傳回值的工作執行“runJob()”。 資料庫批次處理類別“DB_BatchTrans”464至少包含幾個屬性:群組識別碼“groupID”的長整數、資料庫名稱“dbName”的字串和SQL命令“sqlQuery”的字串;以及一個方法:不傳回值的工作執行“runJob()”。類似地,群組識別碼“groupID”用來區別不同物件之間相同與否。The category diagram of FIG. 4B includes the deferrable job abstract category "Abstract DefferableJob" 450, which contains at least one attribute: a long integer of the job type "jobType"; and a method: a job execution "runJob()" that does not return a value. The group mail category "GroupMail" 462 and the database batch processing category "DB_BatchTrans" 464 expand the deferable job abstract category "Abstract DefferableJob" 450, representing that they are long-time processing jobs. The group mail category "GroupMail" 462 contains at least several attributes: the long integer of the group identification code "groupID", the string of multiple receiving addresses "To[]" and the string of multiple duplicate addresses "CC[]" ; And a method: "runJob()" is executed without returning a value. The database batch processing category "DB_BatchTrans" 464 contains at least several attributes: the long integer of the group ID "groupID", the string of the database name "dbName" and the string of the SQL command "sqlQuery"; and a method: "RunJob()" is executed for jobs that do not return a value. Similarly, the group ID "groupID" is used to distinguish whether different objects are the same or not.

此外,工作類型“jobType”的長整數可儲存一個物件的類別是擴充自工作抽象類別“Abstract Job”410或可延遲工作抽象類別“Abstract DefferableJob”450的資訊。In addition, a long integer of the job type "jobType" can store the information of an object whose type is extended from the job abstract type "Abstract Job" 410 or the deferable job abstract type "Abstract DefferableJob" 450.

客戶端可在產生郵件類別“Mail”422、資料庫處理類別“DB_Trans”424、群組郵件類別“GroupMail”462、資料庫批次處理類別“DB_BatchTrans”464或其他類別的物件後,將請求應用伺服器110執行的指令放在工作執行方法“runJob()”,用以當應用伺服器110執行這些指令後,完成請求的工作。The client can request applications after generating objects of the mail category "Mail" 422, database processing category "DB_Trans" 424, group mail category "GroupMail" 462, database batch processing category "DB_BatchTrans" 464 or other categories The commands executed by the server 110 are placed in the job execution method "runJob()", which is used to complete the requested job after the application server 110 executes these commands.

圖5係依據本新型實施例的排程和執行工作的方法流程圖,由應用程式伺服器110的處理單元210(以下簡稱處理單元210以求簡明)於載入並執行特定軟體模組時實施,用於完成主要佇列310中儲存的工作。詳細說明如下:FIG. 5 is a flowchart of a method of scheduling and executing tasks according to an embodiment of the present invention, which is implemented by the processing unit 210 of the application server 110 (hereinafter referred to as the processing unit 210 for simplicity) when loading and executing a specific software module , Used to complete the work stored in the main queue 310. The detailed description is as follows:

步驟S510:從主要佇列310的頂端取出一個物件,此物件由客戶端產生來請求應用程式伺服器執行特定的服務。Step S510: Take out an object from the top of the main queue 310. The object is generated by the client to request the application server to perform a specific service.

步驟S520:判斷主要佇列310中是否存在相同於取出物件的任何物件。如果是,則繼續進行步驟S530的處理;否則,繼續進行步驟S550的處理。詳細來說,處理單元210可判斷主要佇列310中是否存在任何一個物件,包含與取出物件的群組識別碼“groupID”相同的群組識別碼。如果是,則代表主要佇列310中是否存在相同的物件。Step S520: Determine whether there are any objects in the main queue 310 that are the same as the retrieved objects. If yes, continue with the processing of step S530; otherwise, continue with the processing of step S550. In detail, the processing unit 210 can determine whether there is any object in the main queue 310, which includes the same group ID as the group ID of the retrieved object. If so, it indicates whether the same object exists in the main queue 310.

步驟S530:丟棄此物件而不處理。由於相同的工作只要執行一次就可以,因此,處理單元210可以先將之前重複的工作丟棄,只執行最後一次的工作,用來避免應用程式伺服器110花費不必要的時間和資源來處理。雖然之前重複的工作被丟棄,使用者依然可以獲得最後一次的工作執行結果。Step S530: Discard the object without processing. Since the same task only needs to be executed once, the processing unit 210 can discard the previous repeated tasks and only execute the last task, so as to avoid the application server 110 from spending unnecessary time and resources for processing. Although the previous repeated work is discarded, the user can still get the results of the last work execution.

步驟S540:等待一段預設時間,例如0.5秒、1秒,或者依據系統需求預先設定大於0秒的時間。Step S540: Wait for a preset period of time, such as 0.5 second, 1 second, or preset time greater than 0 second according to system requirements.

步驟S550:判斷取出的物件是否包含短時間處理工作。如果是,則繼續進行步驟S560的處理;否則,繼續進行步驟S580的處理。詳細來說,處理單元210可判斷取出的物件是擴充自工作抽象類別“Abstract Job”410還是擴充自可延遲工作抽象類別“Abstract DefferableJob”450。如果是擴充自工作抽象類別“Abstract Job”410,則代表判斷成立。Step S550: Determine whether the retrieved object contains short-time processing tasks. If yes, continue with the processing of step S560; otherwise, continue with the processing of step S580. In detail, the processing unit 210 can determine whether the retrieved object is extended from the abstract job category "Abstract Job" 410 or extended from the abstract job category "Abstract DefferableJob" 450. If it is expanded from the job abstract category "Abstract Job" 410, then the representative judgment is established.

步驟S560:執行取出物件的工作。詳細來說,處理單元210可執行取出物件的工作執行方法“runJob()”來完成短時間處理工作。Step S560: Perform the work of taking out the object. In detail, the processing unit 210 can execute the task execution method "runJob()" for taking out the object to complete the short-time processing task.

步驟S570:回覆此工作的執行結果給客戶端。詳細來說,處理單元210可通過通訊介面260經由網路100將此工作的執行結果(例如,執行成功或失敗的訊息、搜索到的資料等)回覆給客戶端。Step S570: Reply the execution result of this task to the client. In detail, the processing unit 210 can reply the execution result of the task (for example, a message of execution success or failure, searched data, etc.) to the client via the network 100 through the communication interface 260.

步驟S580:回覆此工作正在執行的訊息給客戶端。詳細來說,由於此工作需要執行一段較長的時間,處理單元210可通過通訊介面260經由網路100先回覆此工作正在執行的訊息給客戶端。Step S580: Reply to the client that the task is being executed. In detail, since this task needs to be executed for a long time, the processing unit 210 can first reply to the client a message that the task is being executed via the network 100 through the communication interface 260.

步驟S590:將取出的物件遷移到二級佇列330的底端。在這裡需要注意的是,處理單元210將在適當的時間以FIFO的順序取出二級佇列330中的物件並執行。Step S590: Migrate the retrieved objects to the bottom end of the secondary queue 330. It should be noted here that the processing unit 210 will fetch and execute the objects in the secondary queue 330 in FIFO order at an appropriate time.

以下舉出數個使用案例來輔助說明如圖5所示的方法。假設主要佇列310和二級佇列330的初始狀態如圖3所示,其中,物件“X”代表資料庫批次處理類別“DB_BatchTrans”464的物件,物件“Y”代表資料庫處理類別“DB_Trans”424的物件,而物件“Z”代表群組郵件類別“GroupMail”462的物件。Here are a few use cases to help illustrate the method shown in Figure 5. Assume that the initial state of the main queue 310 and the secondary queue 330 is shown in Figure 3, where the object "X" represents the object of the database batch processing category "DB_BatchTrans" 464, and the object "Y" represents the database processing category " The object of "DB_Trans" 424, and the object "Z" represents an object of the group mail category "GroupMail" 462.

圖6是依據本新型實施例在時間點t1執行主要佇列中的工作的示意圖。由於物件“Y”包含需要短時間處理的工作(步驟S550中“是”的路徑),處理單元210直接執行物件“Y”中指示的工作(步驟S560),並且回覆此工作的執行結果給客戶端(步驟S570)。FIG. 6 is a schematic diagram of the work in the main queue being executed at time t1 according to the embodiment of the present invention. Since the object "Y" contains a job that needs to be processed in a short time (the path of "Yes" in step S550), the processing unit 210 directly executes the task indicated in the object "Y" (step S560), and replies the execution result of this job to the client End (step S570).

圖7是依據本新型實施例在時間點t2至t4執行主要佇列中的工作的示意圖。由於主要佇列310中包含了相同的物件“X”(步驟S520中“是”的路徑),處理單元210直接從主要佇列310取出這些重複的物件“X”並丟棄而不執行。FIG. 7 is a schematic diagram of the tasks in the main queue being executed from time points t2 to t4 according to an embodiment of the present invention. Since the main queue 310 contains the same object "X" (the path of "Yes" in step S520), the processing unit 210 directly takes these duplicate objects "X" from the main queue 310 and discards them without executing.

圖8是依據本新型實施例在時間點t5執行主要佇列中的工作的示意圖。由於主要佇列310中已經沒有相同的物件“X”(步驟S520中“否”的路徑)並且物件“X”包含需要長時間處理的工作(步驟S550中“否”的路徑),處理單元210回覆此工作正在執行的訊息給客戶端(步驟S580),並且將從主要佇列310取出的物件“X”遷移到二級佇列330的底端,等候將來被執行(步驟S590)。在這裡需要注意的是,應用程式伺服器110可於載入並執行相關程式碼時執行另一個方法,用於依序從二級佇列330的頂端取出物件並執行此物件所請求的服務。FIG. 8 is a schematic diagram of the work in the main queue being executed at time t5 according to the embodiment of the present invention. Since there is no longer the same object "X" in the main queue 310 (the path of "No" in step S520) and the object "X" contains work that requires a long time to process (the path of "No" in step S550), the processing unit 210 Reply the message that the task is being executed to the client (step S580), and migrate the object "X" retrieved from the main queue 310 to the bottom end of the secondary queue 330, waiting to be executed in the future (step S590). It should be noted here that the application server 110 can execute another method when loading and executing related code, which is used to sequentially retrieve objects from the top of the secondary queue 330 and perform the services requested by the objects.

本新型所述的方法中的全部或部分步驟可以電腦程式實現,例如電腦的作業系統、電腦中特定硬體的驅動程式、或軟體應用程式。此外,也可實現於如上所示的其他類型程式。所屬技術領域具有通常知識者可將本新型實施例的方法撰寫成電腦程式,為求簡潔不再加以描述。依據本新型實施例方法實施的電腦程式,可儲存於適當的電腦可讀取資料載具,例如DVD、CD-ROM、USB碟、硬碟,亦可置於可通過網路(例如,網際網路,或其他適當載具)存取的網路伺服器。All or part of the steps in the method of the present invention can be implemented by computer programs, such as the operating system of the computer, the driver of a specific hardware in the computer, or a software application. In addition, it can also be implemented in other types of programs as shown above. Those with ordinary knowledge in the technical field can write the method of the embodiment of the present invention into a computer program, which will not be described for brevity. The computer program implemented according to the method of the embodiment of the present invention can be stored in a suitable computer readable data carrier, such as DVD, CD-ROM, USB disk, hard disk, and can also be placed on the Internet (for example, Internet Or other appropriate vehicle).

雖然圖2中包含了以上描述的元件,但不排除在不違反新型的精神下,使用更多其他的附加元件,已達成更佳的技術效果。此外,雖然圖5的步驟採用指定的順序來執行,但是在不違反新型精神的情況下,熟習此技藝人士可以在達到相同效果的前提下,修改這些步驟間的順序,所以,本新型並不侷限於僅使用如上所述的順序。此外,熟習此技藝人士亦可以將若干步驟整合為一個步驟,或者是除了這些步驟外,循序或平行地執行更多步驟,本新型亦不因此而侷限。Although FIG. 2 includes the above-described components, it is not ruled out that without violating the spirit of the new type, more other additional components are used to achieve better technical effects. In addition, although the steps in Figure 5 are executed in a specified order, those skilled in the art can modify the order of these steps on the premise of achieving the same effect without violating the spirit of the new style. Therefore, the present invention does not It is limited to using only the sequence described above. In addition, those skilled in the art can also integrate several steps into one step, or perform more steps in addition to these steps sequentially or in parallel, and the present invention is not limited by this.

雖然本新型使用以上實施例進行說明,但需要注意的是,這些描述並非用以限縮本新型。相反地,此新型涵蓋了熟習此技藝人士顯而易見的修改與相似設置。所以,申請權利要求範圍須以最寬廣的方式解釋來包含所有顯而易見的修改與相似設置。Although the present invention is described using the above embodiments, it should be noted that these descriptions are not intended to limit the present invention. On the contrary, this new model covers modifications and similar settings that are obvious to those skilled in the art. Therefore, the scope of applied claims must be interpreted in the broadest way to include all obvious modifications and similar settings.

100:網路 110:應用程式伺服器 151:桌上型電腦 153:平板電腦 155:手機 210:處理單元 220:顯示單元 230:輸入裝置 240:儲存裝置 250:記憶體 260:通訊介面 310:主要佇列 330:二級佇列 410,450:抽象類別 422,424,462,464:類別 S510~S590:方法步驟 X,Y,Z:物件 t1~t5:時間點 100: Internet 110: Application server 151: Desktop Computer 153: Tablet 155: Mobile 210: Processing Unit 220: display unit 230: input device 240: storage device 250: memory 260: Communication interface 310: Main Queue 330: Level 2 Queue 410,450: Abstract category 422,424,462,464: category S510~S590: method steps X, Y, Z: Object t1~t5: time point

圖1係依據本新型實施例的網路系統架構圖。 圖2係依據本新型實施例的運算裝置的系統架構圖。 圖3為依據本新型實施例的佇列配置示意圖。 圖4A和圖4B係依據本新型實施例的類別圖。 圖5係依據本新型實施例的排程和執行工作的方法流程圖。 圖6是依據本新型實施例在時間點t1執行主要佇列中的工作的示意圖。 圖7是依據本新型實施例在時間點t2至t4執行主要佇列中的工作的示意圖。 圖8是依據本新型實施例在時間點t5執行主要佇列中的工作的示意圖。 Figure 1 is a diagram of the network system architecture according to an embodiment of the present invention. Figure 2 is a system architecture diagram of a computing device according to an embodiment of the present invention. Fig. 3 is a schematic diagram of a queue configuration according to an embodiment of the present invention. 4A and 4B are category diagrams according to the embodiment of the present invention. Figure 5 is a flowchart of a method for scheduling and executing tasks according to an embodiment of the present invention. FIG. 6 is a schematic diagram of the work in the main queue being executed at time t1 according to the embodiment of the present invention. FIG. 7 is a schematic diagram of the tasks in the main queue being executed from time points t2 to t4 according to an embodiment of the present invention. FIG. 8 is a schematic diagram of the work in the main queue being executed at time t5 according to the embodiment of the present invention.

110:應用程式伺服器 110: Application server

151:桌上型電腦 151: Desktop Computer

153:平板電腦 153: Tablet

155:手機 155: Mobile

210:處理單元 210: Processing Unit

220:顯示單元 220: display unit

230:輸入裝置 230: input device

240:儲存裝置 240: storage device

250:記憶體 250: memory

260:通訊介面 260: Communication interface

Claims (10)

一種排程和執行工作的電腦程式產品,包含能夠被一應用程式伺服器的一處理單元載入並執行的程式碼,用於: 從一主要佇列的頂端取出一物件,其中上述物件由一客戶端產生來請求上述應用程式伺服器執行一服務; 判斷上述主要佇列中是否存在相同於上述物件的任何物件;以及 當上述主要佇列中存在相同於上述物件的任何物件時,丟棄上述物件而不處理。 A computer program product for scheduling and executing tasks, containing code that can be loaded and executed by a processing unit of an application server, used to: Fetch an object from the top of a main queue, wherein the object is generated by a client to request the application server to perform a service; Determine whether there are any objects in the main queue that are the same as the above objects; and When there is any object that is the same as the above object in the above main queue, the above object is discarded without processing. 如請求項1所述的排程和執行工作的電腦程式產品,其中,通過偵測上述主要佇列中所有物件的一群組識別碼屬性來判斷上述主要佇列中是否存在相同於上述物件的任何物件。The computer program product for scheduling and executing tasks as described in claim 1, wherein, by detecting a group identification code attribute of all objects in the main queue, it is determined whether the main queue is the same as the object Any object. 如請求項1所述的排程和執行工作的電腦程式產品,包含程式碼,用於: 當上述主要佇列中不存在相同於上述物件的任何物件時,判斷上述物件包含一短時間處理工作或者一長時間處理工作; 當上述物件包含上述短時間處理工作時,執行上述短時間處理工作;以及 當上述物件包含上述長時間處理工作時,將上述物件遷移到一二級佇列的底端以等待將來處理。 The computer program product for scheduling and executing tasks as described in claim 1, including code for: When there is no object that is the same as the above-mentioned object in the above-mentioned main queue, it is determined that the above-mentioned object includes a short-term processing task or a long-term processing task; When the above-mentioned object contains the above-mentioned short-time processing work, execute the above-mentioned short-time processing work; and When the above-mentioned object includes the above-mentioned long-term processing work, the above-mentioned object is moved to the bottom end of the first-level and second-level queue for future processing. 如請求項3所述的排程和執行工作的電腦程式產品,其中,通過判斷上述物件是擴充自一第一抽象類別或者一第二抽象類別來判斷上述物件包含上述短時間處理工作或者上述長時間處理工作。The computer program product for scheduling and executing tasks as described in claim 3, wherein, by determining whether the object is extended from a first abstract category or a second abstract category, it is determined that the object includes the short-time processing task or the long-term processing task. Time to deal with work. 如請求項3所述的排程和執行工作的電腦程式產品,其中,通過執行上述物件中的一方法來完成上述短時間處理工作。The computer program product for scheduling and executing tasks according to claim 3, wherein the short-time processing tasks are completed by executing one of the methods in the above objects. 一種排程和執行工作的裝置,包含: 一記憶體,用於配置空間給一主要佇列;以及 一處理單元,耦接上述記憶體,用於從上述主要佇列的頂端取出一物件,其中上述物件由一客戶端產生來請求上述裝置執行一服務;判斷上述主要佇列中是否存在相同於上述物件的任何物件;以及當上述主要佇列中存在相同於上述物件的任何物件時,丟棄上述物件而不處理。 A device for scheduling and executing tasks, including: A memory for allocating space for a main queue; and A processing unit, coupled to the memory, used to retrieve an object from the top of the main queue, wherein the object is generated by a client to request the device to perform a service; and determine whether there is the same in the main queue Any object of the object; and when there is any object that is the same as the above object in the main queue, the above object is discarded without processing. 如請求項6所述的排程和執行工作的裝置,其中,上述處理單元通過偵測上述主要佇列中所有物件的一群組識別碼屬性來判斷上述主要佇列中是否存在相同於上述物件的任何物件。The device for scheduling and executing tasks according to claim 6, wherein the processing unit determines whether there are objects in the main queue that are the same as the above objects by detecting a group identification code attribute of all objects in the main queue Of any object. 如請求項6所述的排程和執行工作的裝置,其中,上述處理單元當上述主要佇列中不存在相同於上述物件的任何物件時,判斷上述物件包含一短時間處理工作或者一長時間處理工作;當上述物件包含上述短時間處理工作時,執行上述短時間處理工作;以及當上述物件包含上述長時間處理工作時,將上述物件遷移到一二級佇列的底端以等待將來處理。The device for scheduling and executing tasks according to claim 6, wherein the processing unit determines that the object includes a short time processing task or a long time when there is no object that is the same as the above object in the main queue Processing work; when the above-mentioned object contains the above-mentioned short-time processing work, execute the above-mentioned short-time processing work; and when the above-mentioned object contains the above-mentioned long-time processing work, move the above-mentioned object to the bottom of the first and second queues for future processing . 如請求項8所述的排程和執行工作的裝置,其中,上述處理單元通過判斷上述物件是擴充自一第一抽象類別或者一第二抽象類別來判斷上述物件包含上述短時間處理工作或者上述長時間處理工作。The device for scheduling and executing tasks according to claim 8, wherein the processing unit determines that the object includes the short-term processing task or the short-term processing task by determining whether the object is extended from a first abstract category or a second abstract category. Processing work for a long time. 如請求項8所述的排程和執行工作的裝置,其中,上述處理單元通過執行上述物件中的一方法來完成上述短時間處理工作。The device for scheduling and executing tasks according to claim 8, wherein the processing unit completes the short-time processing tasks by executing one of the methods in the above objects.
TW109206050U 2020-05-15 2020-05-15 Computer program product and apparatus for arranging and executing jobs TWM600871U (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW109206050U TWM600871U (en) 2020-05-15 2020-05-15 Computer program product and apparatus for arranging and executing jobs

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW109206050U TWM600871U (en) 2020-05-15 2020-05-15 Computer program product and apparatus for arranging and executing jobs

Publications (1)

Publication Number Publication Date
TWM600871U true TWM600871U (en) 2020-09-01

Family

ID=73644812

Family Applications (1)

Application Number Title Priority Date Filing Date
TW109206050U TWM600871U (en) 2020-05-15 2020-05-15 Computer program product and apparatus for arranging and executing jobs

Country Status (1)

Country Link
TW (1) TWM600871U (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI785644B (en) * 2021-06-11 2022-12-01 中國信託商業銀行股份有限公司 Dynamic management system and management host

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI785644B (en) * 2021-06-11 2022-12-01 中國信託商業銀行股份有限公司 Dynamic management system and management host

Similar Documents

Publication Publication Date Title
US10877987B2 (en) Correlating log data with performance measurements using a threshold value
US11782989B1 (en) Correlating data based on user-specified search criteria
US10877986B2 (en) Obtaining performance data via an application programming interface (API) for correlation with log data
US11755390B1 (en) Using keep-alive markers to extend redelivery deadlines
US10614132B2 (en) GUI-triggered processing of performance data and log data from an information technology environment
US10019496B2 (en) Processing of performance data and log data from an information technology environment by using diverse data stores
WO2020220216A1 (en) Search time estimate in data intake and query system
US11119982B2 (en) Correlation of performance data and structure data from an information technology environment
US10997191B2 (en) Query-triggered processing of performance data and log data from an information technology environment
US20180349329A1 (en) Support for non-native file types in web application environment
US20150012815A1 (en) Optimization schemes for controlling user interfaces through gesture or touch
US20140324862A1 (en) Correlation for user-selected time ranges of values for performance metrics of components in an information-technology environment with log data from that information-technology environment
US11503070B2 (en) Techniques for classifying a web page based upon functions used to render the web page
US10878089B2 (en) Identifying malware based on content item identifiers
US11442599B2 (en) Systems and methods for hosting a browser within another browser
EP3497586A1 (en) Discovery of calling application for control of file hydration behavior
TWM600871U (en) Computer program product and apparatus for arranging and executing jobs
TWM599936U (en) Computer program product and apparatus for managing data caches
TWI756685B (en) Computer program product and apparatus for arranging and executing jobs
US20140279926A1 (en) Active archive bridge
TWI745966B (en) Computer program product and apparatus for managing data caches
US20110055816A1 (en) Method to derive software use and software data object use characteristics by analyzing attributes of related files
CN116134428A (en) Interactive signal processing in a distributed computing system
TWI758736B (en) Computer program product and apparatus for scheduling and executing jobs employed in parallel-processing environment
WO2024044612A1 (en) Dynamically updating classifier priority of a classifier model in digital data discovery