TW201944232A - Method and system of obtaining resources using unified composite query language - Google Patents

Method and system of obtaining resources using unified composite query language

Info

Publication number
TW201944232A
TW201944232A TW107112884A TW107112884A TW201944232A TW 201944232 A TW201944232 A TW 201944232A TW 107112884 A TW107112884 A TW 107112884A TW 107112884 A TW107112884 A TW 107112884A TW 201944232 A TW201944232 A TW 201944232A
Authority
TW
Taiwan
Prior art keywords
resources
application
query language
group
aggregation query
Prior art date
Application number
TW107112884A
Other languages
Chinese (zh)
Other versions
TWI707273B (en
Inventor
曾志翔
Original Assignee
中華電信股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中華電信股份有限公司 filed Critical 中華電信股份有限公司
Priority to TW107112884A priority Critical patent/TWI707273B/en
Publication of TW201944232A publication Critical patent/TW201944232A/en
Application granted granted Critical
Publication of TWI707273B publication Critical patent/TWI707273B/en

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

A method and a system of obtaining resources using unified composite query language are provided. In at least some embodiments, an intermediary module of CQL execution receives a unified composite query language document describing a resource structure of multiple resources to determine whether the whole resources are analyzed. According to the result of analysis, the intermediary module calls related applications to offer the resources, and then sends the resource to users, thereby improving the efficiency of access to resources.

Description

使用統一聚合查詢語言獲取資源的方法及系統    Method and system for obtaining resources using unified aggregation query language   

本發明係關於一種獲取應用程式資源的技術,特別是一種使用統一聚合查詢語言來獲取微服務式應用程式資源的方法及系統。 The invention relates to a technology for obtaining application program resources, in particular to a method and system for obtaining microservice-type application program resources using a unified aggregation query language.

傳統上,當使用者想要存取伺服器後端應用程式(如:微服務式應用程式)的資源時,使用者必須先瞭解伺服器後端有哪些應用程式、應用程式的API(Application Programming Interface)規格、和應用程式的API使用方式。 Traditionally, when a user wants to access the resources of a server back-end application (such as a micro-service-type application), the user must first understand what applications are on the server back-end and the application programming API (Application Programming Interface) specifications and application API usage.

接著,使用者可以依不同應用程式API的呼叫(通訊)方式來向伺服器提出存取應用程式資源(複合資源)的請求,待服務伺服器接收請求後,再透過個別的命令式語法呼叫相對應應用程式API來提供應用程式資源。 Then, the user can make a request to the server to access the application resource (composite resource) according to the calling (communication) methods of different application APIs. After the service server receives the request, it can call the corresponding through an individual imperative syntax. Application API to provide application resources.

爾後,等伺服器接收到所有相對應應用程式API回傳的應用程式資源後,再將所有應用程式資源組合成使用者所需的複合資源,並傳送給使用者。 After that, after the server receives all the application resources returned by the corresponding application API, it combines all the application resources into a composite resource required by the user and sends it to the user.

這樣複合資源的產生方式,需要使用者瞭解伺服器後端應用程式的API規格與使用方式,使得使用者不能只把 心力關注在複合資源的呈現方式(即,資源結構)上。 In this way, the generation of composite resources requires users to understand the API specifications and usage methods of the server's back-end applications, so that users cannot focus on the presentation of composite resources (that is, the resource structure).

此外,一旦伺服器後端應用程式的API規格有變,與複合資源相關的一系列命令式語法都要重新設計及編譯,導致前述產生方式的重用性很低。 In addition, once the API specification of the server back-end application changes, a series of imperative syntax related to composite resources must be redesigned and compiled, resulting in low reusability of the aforementioned generation method.

鑑於前述問題,著實有必要提供一有效獲取使用者所需複合資源的方法及系統,來解決使用者所面臨的難題。 In view of the foregoing problems, it is really necessary to provide a method and system for effectively obtaining the composite resources required by users to solve the problems faced by users.

鑑於先前技術所存在的問題,本發明揭示了使用統一聚合查詢語言獲取資源的方法及系統。相較於先前技術是採用一個個指令式(Imperative)語法來組合出所需的複合資源,本發明一實施例揭示了使用統一聚合查詢語言文件來描述所需複合性資源的結構,再透過解析這份文件以達到相同的目的,使用者不需了解各服務API使用上的細節,從而提升服務系統的執行效率。 In view of the problems existing in the prior art, the present invention discloses a method and system for obtaining resources using a unified aggregation query language. Compared with the prior art, which uses an imperative syntax to combine the required composite resources, an embodiment of the present invention discloses the use of a unified aggregation query language file to describe the structure of the required composite resources, and then analyzes This document achieves the same purpose, users do not need to understand the details of the use of each service API, thereby improving the execution efficiency of the service system.

本發明之一實施例提供了一種使用統一聚合查詢語言獲取資源的方法,包含以下步驟:(1)接收一統一聚合查詢語言文件,其描述複數資源之資源結構;(2)基於該等資源結構,判斷該統一聚合查詢語言文件中的該複數資源是否都解析完成;(3)若該複數資源已全部解析完成,從一CQL文件資料庫中取得一第一解析結果,以呼叫與該第一解析結果相關的一第一應用程式群組,進而提供複數第一資源,反之,若該複數資源未全部解析完成,解析該複數資源來產生一第二解析結果,以呼叫與該第二解析結果相關的一第二應用程式群組,進而提供複數第二資源。 An embodiment of the present invention provides a method for obtaining resources using a unified aggregation query language, including the following steps: (1) receiving a unified aggregation query language file, which describes a resource structure of a plurality of resources; (2) based on the resource structure To determine whether the plurality of resources in the unified aggregation query language file are all resolved; (3) if the plurality of resources have been completely resolved, obtain a first analysis result from a CQL file database to call the first A first application program group related to the analysis result, thereby providing a plurality of first resources. Conversely, if the plurality of resources are not completely parsed, the plurality of resources are parsed to generate a second analysis result, and the second analysis result is called. A related second application group provides multiple second resources.

在另一實施例中,將該複數第一資源或該複數第二資源組合成一複合式資源。 In another embodiment, the plurality of first resources or the plurality of second resources are combined into a composite resource.

在另一實施例中,該步驟(3)包含以下步驟:(i)轉譯該統一聚合查詢語言文件為一抽象語法樹(Abstract Syntax Tree);及(ii)根據該抽象語法樹,判斷該複數資源是否已解析完成以呼叫該第二應用程式群組,進而提供該複數第二資源。 In another embodiment, step (3) includes the following steps: (i) translating the unified aggregation query language file into an abstract syntax tree (Abstract Syntax Tree); and (ii) judging the complex number based on the abstract syntax tree Whether the resource has been resolved to call the second application group, thereby providing the plurality of second resources.

在另一實施例中,在該步驟(ii)中,係以迭代(iteratively)方式或平行(in parallel)方式來判斷該複數資源是否已解析完成。 In another embodiment, in step (ii), it is determined whether the complex resource has been parsed in an iterative manner or in a parallel manner.

在另一實施例中,使用與該第一應用程式群組之API(Application Programming Interface)通訊的方式以呼叫該第一應用程式群組;及/或使用與該第二應用程式群組之API通訊的方式以呼叫該第二應用程式群組。 In another embodiment, an API (Application Programming Interface) communication with the first application group is used to call the first application group; and / or an API with the second application group is used The communication method is to call the second application group.

在另一實施例中,採用迭代方式以呼叫該第一應用程式群組及/或該第二應用程式群組。 In another embodiment, the first application group and / or the second application group are called in an iterative manner.

在另一實施例中,採用平行方式以呼叫該第一應用程式群組及/或該第二應用程式群組。 In another embodiment, the first application group and / or the second application group are called in a parallel manner.

在另一實施例中,該第一應用程式群組及/或該第二應用程式群組係由複數個微服務式應用程式所組成。 In another embodiment, the first application group and / or the second application group are composed of a plurality of microservices applications.

在另一實施例中,該統一聚合查詢語言文件係為一基於JSON(JavaScript Object Notation)的宣告式描述語言文件。 In another embodiment, the unified aggregation query language file is a declarative description language file based on JSON (JavaScript Object Notation).

本發明之又一實施例提供了一種一種使用統一聚合查 詢語言獲取資源的系統,包含:一統一聚合查詢語言文件執行模組,其接收描述複數資源之資源結構的一統一聚合查詢語言文件,其中,若該統一聚合查詢語言文件執行模組曾經解析過該統一聚合查詢語言文件,該統一聚合查詢語言文件執行模組自一CQL文件資料庫中取得一第一解析結果,以呼叫與該第一解析結果相關的一第一應用程式群組,進而提供複數第一資源,反之,若該統一聚合查詢語言文件執行模組並未解析過該統一聚合查詢語言文件,該統一聚合查詢語言文件執行模組解析該複數資源來產生一第二解析結果,以呼叫與該第二解析結果相關的一第二應用程式群組,進而提供複數第二資源。 Another embodiment of the present invention provides a system for obtaining resources using a unified aggregation query language, including: a unified aggregation query language file execution module that receives a unified aggregation query language file describing a resource structure of a plurality of resources, wherein If the unified aggregation query language file execution module has ever parsed the unified aggregation query language file, the unified aggregation query language file execution module obtains a first parsing result from a CQL file database to call and the first A first application group related to the analysis result, thereby providing a plurality of first resources. Conversely, if the unified aggregation query language file execution module has not parsed the unified aggregation query language file, the unified aggregation query language file execution module The group parses the plurality of resources to generate a second analysis result, and calls a second application program group related to the second analysis result to provide a plurality of second resources.

在另一實施例中,該統一聚合查詢語言文件執行模組將該複數第一資源或該複數第二資源組合成一複合式資源。 In another embodiment, the unified aggregation query language file execution module combines the plurality of first resources or the plurality of second resources into a composite resource.

在另一實施例中,該統一聚合查詢語言文件執行模組係與該第一應用程式群組之API通訊以呼叫該第一應用程式群組,且該統一聚合查詢語言文件執行模組係與該第二應用程式群組之API通訊以呼叫該第二應用程式群組。 In another embodiment, the unified aggregation query language file execution module communicates with the API of the first application program group to call the first application program group, and the unified aggregation query language file execution module is related to API communication of the second application group to call the second application group.

在另一實施例中,該統一聚合查詢語言文件執行模組係採用迭代方式或平行方式以呼叫該第一應用程式群組及/或該第二應用程式群組。 In another embodiment, the unified aggregation query language document execution module uses an iterative method or a parallel method to call the first application group and / or the second application group.

在另一實施例中,該第一應用程式群組及/或該第二應用程式群組係由複數個微服務式應用程式所組成。 In another embodiment, the first application group and / or the second application group are composed of a plurality of microservices applications.

在另一實施例中,該統一聚合查詢語言文件係為一基 於JSON的宣告式描述語言文件。 In another embodiment, the unified aggregation query language file is a JSON-based declarative description language file.

應理解,以上描述的標的可實施為電腦控制的設備、電腦程式、計算系統,或作為製品,諸如,電腦可讀取儲存媒體。 It should be understood that the subject matter described above may be implemented as a computer-controlled device, computer program, computing system, or as a product, such as a computer-readable storage medium.

為讓本發明之上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明。在以下描述內容中將部分闡述本發明之額外特徵及優點,且此等特徵及優點將部分自所述描述內容顯而易見,或可藉由對本發明之實踐習得。本發明之特徵及優點借助於在申請專利範圍中特別指出的元件及組合來認識到並達到。應理解,前文一般描述與以下詳細描述兩者均僅為例示性及解釋性的,且不欲約束本發明所主張之範圍。 In order to make the above features and advantages of the present invention more comprehensible, embodiments are described below in detail with reference to the accompanying drawings. Additional features and advantages of the present invention will be partially explained in the following description, and these features and advantages will be partially obvious from the description, or may be learned through practice of the present invention. The features and advantages of the invention are realized and achieved by means of elements and combinations specifically pointed out in the scope of the patent application. It should be understood that both the foregoing general description and the following detailed description are merely exemplary and explanatory and are not intended to limit the scope of the invention as claimed.

101‧‧‧CQL文件 101‧‧‧CQL file

102‧‧‧訂單資源結構 102‧‧‧Order resource structure

103‧‧‧顧客資源結構 103‧‧‧Customer resource structure

104‧‧‧產品資源結構 104‧‧‧Product Resource Structure

105‧‧‧信用資源結構 105‧‧‧Credit resource structure

106‧‧‧CQL文件 106‧‧‧CQL file

107‧‧‧CQL文件 107‧‧‧CQL file

108‧‧‧CQL執行中介模組 108‧‧‧CQL execution mediation module

109~111‧‧‧微服務應用程式 109 ~ 111‧‧‧ microservice application

S112~S119‧‧‧步驟 S112 ~ S119‧‧‧step

第1圖係為根據本發明之一實施例的統一聚合查詢語言文件、及文件中的各複合式資源結構;第2圖係為根據本發明之一實施例的具條件語句的複合式資源結構之統一聚合查詢語言文件;第3圖係為根據本發明之一實施例的CQL執行環境示意圖;及第4圖係為根據本發明之一實施例的產生複合式資源的流程圖。 FIG. 1 is a unified aggregate query language file and various composite resource structures in the file according to an embodiment of the present invention; FIG. 2 is a composite resource structure with conditional statements according to an embodiment of the present invention FIG. 3 is a schematic diagram of a CQL execution environment according to an embodiment of the present invention; and FIG. 4 is a flowchart of generating a composite resource according to an embodiment of the present invention.

以下藉由特定的具體實施形態說明本發明之實施方式,熟悉此技術之人士可由本說明書所揭示之內容輕易地 了解本發明之其他優點與功效,亦可藉由其他不同的具體實施形態加以施行或應用。 The following describes the embodiments of the present invention with specific specific implementation forms. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this description, and can also be implemented by other different specific implementation forms. Or apply.

此外,本文中的方法或流程之一些或全部操作及/或實質上相等的操作可藉由執行包括在電腦儲存媒體上的電腦可讀取指令(如本文所定義的)來執行。在描述及申請專利範圍中使用的術語「電腦可讀取指令」及「電腦可讀取指令」的變體,在本文經引申使用以包括常式、應用程式、應用模組、程式模組、程式、元件、資料結構、演算法等等。電腦可讀取指令可在各種系統組態上實施,包括單一處理器或多處理器系統、迷你電腦、大型電腦、個人電腦、掌上型計算裝置、基於微處理器的可程式化消費者電子設備或所述者的組合等等。 In addition, some or all of the operations of the methods or processes herein and / or substantially equivalent operations may be performed by executing computer-readable instructions (as defined herein) included on a computer storage medium. Variations of the terms "computer-readable instructions" and "computer-readable instructions" used in the scope of the description and patent applications are used herein to include routines, applications, application modules, program modules, Programs, components, data structures, algorithms, and more. Computer-readable instructions can be implemented on a variety of system configurations, including single-processor or multi-processor systems, mini computers, mainframe computers, personal computers, palm computing devices, programmable microprocessor-based consumer electronics devices Or a combination of those and so on.

因此,應理解,本文描述的邏輯操作經實施作為電腦實施的動作序列或計算系統上執行的程式模組及/或作為計算系統內部的互連機器邏輯電路或電路模組。實施為取決於計算系統的效能及其他要求的選擇問題。因此,本文描述的邏輯操作不同地被稱為狀態、操作、結構裝置、動作或模組。此等操作、結構裝置、動作及模組可在軟體中、在韌體中、在特殊用途數位邏輯中及所述者的任何組合中實施。 Therefore, it should be understood that the logic operations described herein are implemented as a computer-implemented sequence of actions or a program module executed on a computing system and / or as an interconnected machine logic circuit or circuit module within a computing system. Implementation is a matter of choice depending on the performance of the computing system and other requirements. Therefore, the logical operations described herein are referred to variously as states, operations, structural devices, actions, or modules. These operations, structural devices, actions, and modules can be implemented in software, in firmware, in special-purpose digital logic, and in any combination of the foregoing.

現在參閱第1圖,其圖示根據本發明之一實施例的統一聚合查詢語言文件、及文件中的各複合式資源結構。 Reference is now made to FIG. 1, which illustrates a unified aggregation query language file and various composite resource structures in the file according to an embodiment of the present invention.

本發明中的統一聚合查詢語言(Unified Composite Query Language;CQL)文件(如:CQL文件101)可用於描 述各種複合式資源結構,其中,複合式資源結構係由各種資源項目(如:主要資源項目、次要資源項目、再次要資源項目等)所組成。資源項目可描述分布在各應用程式(如:微服務式應用程式)中的各種資源。 The Unified Composite Query Language (CQL) file (such as: CQL file 101) in the present invention can be used to describe various composite resource structures. The composite resource structure is composed of various resource items (such as main resource items). , Secondary resource projects, secondary resource projects, etc.). The resource item can describe various resources distributed in various applications (eg, microservices applications).

在一實施例中,可將CQL文件101實施為基於JSON(JavaScript Object Notation)的宣告式描述語言文件。 In one embodiment, the CQL file 101 can be implemented as a JSON (JavaScript Object Notation) -based declarative description language file.

在一實施例中,可針對CQL文件101進行解析(如:針對主要資源項目等)以獲得已解析之資源結構,並呼叫與已解析之資源結構相關的應用程式以取得對應的資源。 In one embodiment, the CQL file 101 may be parsed (eg, for a main resource item, etc.) to obtain a parsed resource structure, and an application program related to the parsed resource structure may be called to obtain a corresponding resource.

爾後,可平行地(in parallel)或迭代地(iteratively)對於CQL文件101反覆進行解析(如:針對其他主要資源項目、針對次要資源項目、再次要資源項目等)以獲得已解析之資源結構,並呼叫相關應用程式來取得對應的資源,直到無法進一步解析為止。最後,便可獲得所欲的資源。 Thereafter, the CQL file 101 can be repeatedly analyzed in parallel or iteratively (for example, for other major resource items, for secondary resource items, and secondary resource items, etc.) to obtain a resolved resource structure. , And call the app to get the corresponding resource until it cannot be further parsed. Finally, you can get the resources you want.

如此一來,當使用者向伺服器(系統)請求應用程式(如:微服務式應用程式)資源時,系統可有效隱藏應用程式之API(Application Programming Interface)的呼叫細節,並讓使用者以貼近終端需求的方式(即,以複合式資源結構)來請求應用程式資源。 In this way, when the user requests an application (such as a microservice application) resource from the server (system), the system can effectively hide the call details of the application's API (Application Programming Interface) and allow the user to Request application resources in a way that is close to the needs of the terminal (ie, in a composite resource structure).

此外,藉由複合式資源結構的使用,即便應用程式之API規格有些微異動,系統亦可有效存取應用程式資源,從而在資源的存取上具備容錯機制。 In addition, through the use of a composite resource structure, even if the API specifications of the application program are slightly changed, the system can effectively access the application resource, thereby providing a fault tolerance mechanism for resource access.

現在,回到第1圖,CQL文件101可描述與訂單資源(如:在各種微服務中的訂單、顧客、信用、及產品等資源 項目)相關的資源結構。 Now, returning to FIG. 1, the CQL file 101 can describe the resource structure related to order resources (such as resource items such as orders, customers, credits, and products in various microservices).

在CQL文件101中,項目「訂單」可視為主要資源項目;項目「顧客」及「產品」可視為主要資源項目「訂單」底下的次要資源項目;而項目「信用」視為次要資源項目「顧客」下的再次要資源項目。 In CQL Document 101, the item "Order" can be considered as a major resource item; the items "Customer" and "Product" can be considered as a minor resource item under the major resource item "Order"; and the item "Credit" is considered a minor resource item The "resources" item under "Customer".

此外,若再針對各資源項目加以解析,主要依據資源結構的相似性,若是發現應用服務(應用程式)提供的訂單資源符合CQL文件描述的屬性結構,則可將CQL文件101中的項目「訂單」解析為訂單資源結構102;可將項目「顧客」解析為顧客資源結構103;可將項目「產品」解析為產品資源結構104;及可將項目「信用」解析為信用資源結構105。 In addition, if each resource item is analyzed, it is mainly based on the similarity of the resource structure. If it is found that the order resources provided by the application service (application program) conform to the attribute structure described in the CQL file, the item in the CQL file 101 "Can be resolved into the order resource structure 102; the item" customer "can be resolved into the customer resource structure 103; the item" product "can be resolved into the product resource structure 104; and the item" credit "can be resolved into the credit resource structure 105.

在訂單資源結構102中,項目「訂單」可視為訂單資源結構102中的主要資源項目,且項目「訂單」底下包含「訂單號(orderID)」、「顧客編號(custNo)」、及「產品」等次要資源項目。 In the order resource structure 102, the item "order" can be regarded as the main resource item in the order resource structure 102, and the item "order" includes "order number (orderID)", "customer number (custNo)", and "product" Grade secondary resource project.

在顧客資源結構103中,項目「顧客」可視為顧客資源結構103中的主要資源項目,且項目「顧客」底下包含「編號(no)」、「姓名(name)」、「年齡(age)」等次要資源項目。 In the customer resource structure 103, the item "customer" can be regarded as the main resource item in the customer resource structure 103, and the item "customer" includes "number (no)", "name", "age" Grade secondary resource project.

在產品資源結構104中,項目「產品」可視為產品資源結構104中的主要資源項目,且項目「產品」底下包含「類型(type)」及「價格(price)」等次要資源項目。 In the product resource structure 104, the item "product" can be regarded as the main resource item in the product resource structure 104, and the item "product" includes secondary resource items such as "type" and "price".

請參閱第2圖,其圖示根據本發明之一實施例的具條 件語句的複合式資源結構之統一聚合查詢語言文件。 Please refer to FIG. 2, which illustrates a unified aggregate query language file of a composite resource structure with conditional statements according to an embodiment of the present invention.

相較於第1圖所示之CQL文件101,第2圖所示的CQL文件106中添加了條件語句來限縮資源對應的範圍。 Compared to the CQL file 101 shown in FIG. 1, a conditional statement is added to the CQL file 106 shown in FIG. 2 to limit the range corresponding to the resource.

舉例而言,可將CQL文件106中項目「顧客」底下的項目「編號(no)」設定為項目「訂單」的「顧客編號(custNo)」。此處,可使用XML Path語法或類似語法(如:JSON Path語法)來描述此一設定。例如:使用表示式「no:$.訂單.custNo」來指定將項目「顧客」與項目「訂單」綁定的相關條件。 For example, the item "No" under the item "Customer" in the CQL file 106 can be set as the "Customer Number (custNo)" of the item "Order". Here, the XML Path syntax or similar syntax (eg, JSON Path syntax) can be used to describe this setting. For example: Use the expression "no: $. Order.custNo" to specify the relevant conditions for binding the item "Customer" to the item "Order".

在一實施例中,亦可使用JSON Path來標示某個項目的解析路徑。例如:表示式「$」表示從最上層項目(如:JSON Path結構中的根節點)開始尋找。表示式「$.訂單.custNo」表示根節點底下的訂單節點底下的custNo節點值(即,項目「顧客編號(custNo)」)。而表示式「no:$.訂單.custNo」表示項目「顧客」底下的次要項目「編號(no)」要等於項目「訂單」底下的次要項目「顧客編號(custNo)」。 In an embodiment, a JSON Path may also be used to indicate a parsing path of an item. For example: The expression "$" means to search from the top-level item (such as the root node in the JSON Path structure). The expression "$ .Order.custNo" represents the value of the custNo node under the order node under the root node (that is, the item "customer number (custNo)"). The expression "no: $ .Order.custNo" means that the secondary item "No." under the item "Customer" must be equal to the secondary item "Customer Number (custNo)" under the item "Order".

藉由前述表示法,可以輕易標明各項目(資源)間的關聯性。另一方面,我們亦可使用表示法「?」來瞭解特定項目的相關資訊。 With the aforementioned notation, the relevance between items (resources) can be easily indicated. On the other hand, we can use the notation "?" To get information about a specific item.

舉例而言,我們可以在項目「產品」底下使用表示法「price:?」。如此一來,雖然在目前項目「產品」中並未顯示項目「price」的資訊,但藉由後續的資源解析及呼叫與項目「price」有關的應用程式,便可取得項目「price」的相關資訊(資源)。 For example, we could use the notation "price :?" under the item "product". In this way, although the information of the item "price" is not displayed in the current item "product", the related information of the item "price" can be obtained through subsequent resource analysis and calling the application related to the item "price" Information (resources).

請參閱第3圖,其係根據本發明之一實施例的CQL執行環境示意圖。 Please refer to FIG. 3, which is a schematic diagram of a CQL execution environment according to an embodiment of the present invention.

CQL執行中介模組108可接收CQL文件107,以針對CQL文件107進行解析,之後再根據解析結果,向對應的微服務應用程式109、微服務應用程式110、微服務應用程式111請求相關資源。 The CQL execution intermediary module 108 may receive the CQL file 107 to parse the CQL file 107, and then request related resources from the corresponding microservice application 109, microservice application 110, and microservice application 111 according to the analysis result.

在一實施例中,向微服務應用程式109、微服務應用程式110、微服務應用程式111請求的資源係存在先後順序關係,則CQL執行中介模組108可依迭代(iteratively)方式,依序向微服務應用程式109、微服務應用程式110、微服務應用程式111請求資源。 In an embodiment, the resources requested from the microservice application 109, the microservice application 110, and the microservice application 111 have a sequential relationship, and the CQL execution intermediary module 108 may be iteratively and sequentially Request resources from the microservice application 109, the microservice application 110, and the microservice application 111.

在一實施例中,向微服務應用程式109、微服務應用程式110、微服務應用程式111請求的資源間彼此沒有順序關係,則CQL執行中介模組108可依平行(in parallel)方式,同時向微服務應用程式109、微服務應用程式110、微服務應用程式111中請求資源。 In an embodiment, the resources requested from the microservice application 109, the microservice application 110, and the microservice application 111 have no order relationship with each other, and the CQL execution intermediary module 108 may be in a parallel manner at the same time. Request resources from the microservice application 109, the microservice application 110, and the microservice application 111.

之後,CQL執行中介模組108再將從微服務應用程式109、微服務應用程式110、微服務應用程式111所獲得的組合成符合使用者所需的複合資源,以將該複合資源傳送至使用者端。 After that, the CQL execution intermediary module 108 then combines the obtained from the microservice application 109, the microservice application 110, and the microservice application 111 into a composite resource that meets the needs of the user, so as to transmit the composite resource to the use. Person side.

在一實施例中,CQL執行中介模組108可將CQL文件107、及CQL文件107的解析過程和解析結果儲存在CQL文件資料庫(未圖示)中。爾後,如果再有針對CQL文件107的解析需求,則CQL執行中介模組108可直接自CQL文 件資料庫中取得CQL文件107的解析過程和解析結果,而無需再次執行對於CQL文件107的解析,以提升系統的執行效率。 In an embodiment, the CQL execution intermediary module 108 may store the analysis process and analysis result of the CQL file 107 and the CQL file 107 in a CQL file database (not shown). Thereafter, if there is a need for analysis of the CQL file 107, the CQL execution intermediary module 108 can directly obtain the analysis process and analysis result of the CQL file 107 from the CQL file database, without performing the analysis of the CQL file 107 again. In order to improve the execution efficiency of the system.

現在,請參閱第4圖,其係為根據本發明之一實施例的產生複合式資源的流程圖。 Now, please refer to FIG. 4, which is a flowchart of generating a composite resource according to an embodiment of the present invention.

首先,在步驟S112中,接收描述複合式資源之資料結構的CQL文件107。 First, in step S112, a CQL file 107 describing the data structure of the composite resource is received.

接著,在步驟S113中,會根據資源結構,判斷CQL文件107中的複合式資源是否已解析完成(即,判斷是否曾解析過相同的資源結構)。倘若判斷結果為CQL文件107中的複合式資源結構已被解析過,則會進入步驟S117。 Next, in step S113, it is determined whether the composite resource in the CQL file 107 has been resolved (that is, whether the same resource structure has been resolved) according to the resource structure. If the determination result is that the composite resource structure in the CQL file 107 has been parsed, it proceeds to step S117.

在步驟S117中,CQL執行中介模組108會從CQL文件資料庫中取得CQL文件107中複合式資源結構的解析結果,以根據解析結果向相關的應用程式群組請求相關資源。 In step S117, the CQL execution intermediary module 108 obtains the analysis result of the composite resource structure in the CQL file 107 from the CQL file database, and requests the related resources from the related application group according to the analysis result.

之後,在步驟S118中,CQL執行中介模組108將從應用程式群組(如:由多個微服務是)所取得的相關資源組合成符合使用者要求的複合式資源,以將CQL文件107、及CQL文件107的解析過程和解析結果儲存在CQL文件資料庫。 After that, in step S118, the CQL execution intermediary module 108 combines related resources obtained from the application group (eg, multiple microservices) into a composite resource that meets the user's requirements, so as to combine the CQL file 107 The analysis process and analysis results of CQL file 107 are stored in the CQL file database.

在一實施例中,CQL文件資料庫可為一外部資料庫。或者,CQL文件資料庫亦可內建於CQL執行中介模組108而作為CQL執行中介模組108之一部分。 In one embodiment, the CQL file database may be an external database. Alternatively, the CQL document database can also be built into the CQL execution intermediation module 108 as part of the CQL execution intermediation module 108.

接著,在步驟S119中,將此複合式資源傳回給使用者端,並結束流程。 Next, in step S119, the composite resource is returned to the user terminal, and the process ends.

現在,回到步驟S113,倘若判斷結果為CQL文件107中的複合式資源結構先前並未解析過,則會進入步驟S114。 Now, return to step S113, if the determination result is that the composite resource structure in the CQL file 107 has not been parsed before, it proceeds to step S114.

在步驟S114中,CQL執行中介模組108會將CQL文件轉譯為抽象語法樹(Abstract Syntax Tree;AST)。 In step S114, the CQL execution intermediary module 108 translates the CQL file into an Abstract Syntax Tree (AST).

接著,進入步驟S115,此時CQL執行中介模組108會根據抽象語法樹內容,判斷CQL文件中是否仍存在未解析的資源(即,存在未解析完成的資源結構)。若是,則進入步驟S116,此時CQL執行中介模組108呼叫與未解析資源相關的應用程式群組來提供未解析資源,並基於提供的資源來繼續解析CQL文件。 Then, the method proceeds to step S115. At this time, the CQL execution intermediary module 108 determines whether there are unresolved resources in the CQL file (that is, there are unresolved resource structures) according to the abstract syntax tree content. If yes, go to step S116. At this time, the CQL execution intermediary module 108 calls an application group related to the unresolved resources to provide unresolved resources, and continues to parse the CQL file based on the provided resources.

在一實施例中,步驟S115中的CQL執行中介模組108可根據抽象語法樹生成方式(即,抽象語法樹的搜尋方式)來決定以何種方法判斷CQL文件107中是否仍存在未解析的資源。 In an embodiment, the CQL execution intermediary module 108 in step S115 may determine the method for determining whether there are still unparsed CQL files 107 according to the abstract syntax tree generation mode (that is, the search mode of the abstract syntax tree). Resources.

舉例而言,當抽象語法樹係以廣度優先的方式生成時,CQL執行中介模組108可平行地(in parallel)判斷是否仍存在未解析的資源。相對地,倘若抽象語法樹係以深度優先的方式生成時,CQL執行中介模組108可迭代地(iteratively)判斷是否仍存在未解析的資源 For example, when the abstract syntax tree is generated in a breadth-first manner, the CQL execution intermediary module 108 may determine in parallel whether unresolved resources still exist. In contrast, if the abstract syntax tree is generated in a depth-first manner, the CQL execution intermediary module 108 can iteratively determine whether unresolved resources still exist

在一實施例中,在步驟S116、步驟S117中的CQL執行中介模組108可使用與應用程式群組之API通訊的方式,以向應用程式群組請求相關資源。 In one embodiment, the CQL execution intermediary module 108 in steps S116 and S117 may use the API communication with the application group to request related resources from the application group.

在一實施例中,在步驟S116、步驟S117中的CQL執 行中介模組108可依迭代(iteratively)方式或平行(in parallel)方式向應用程式群組請求相關資源。 In one embodiment, the CQL execution intermediary module 108 in steps S116 and S117 may request related resources from the application group in an iterative manner or an in parallel manner.

在一實施例中,步驟S116中的CQL執行中介模組108可在每解析完CQL文件107中特定個數(如:一個、二個等)的資源後,即回到步驟S114,並重複步驟S114~步驟S116之操作,直至CQL文件107中不再存在任何未解析資源,或是存在的未解析資源無法被任何應用程式所提供(即,無法繼續解析資源)為止。 In an embodiment, the CQL execution intermediary module 108 in step S116 may return to step S114 after parsing a specific number of resources (eg, one, two, etc.) in the CQL file 107, and repeat the steps. Steps S114 to S116 are performed until there are no longer any unresolved resources in the CQL file 107, or the existing unresolved resources cannot be provided by any application (that is, the resources cannot be parsed further).

之後,在步驟S118中,CQL執行中介模組108將從應用程式群組所取得的相關資源組合成符合使用者要求的複合式資源,以將CQL文件107、及CQL文件107的解析過程和解析結果儲存在CQL文件資料庫。 After that, in step S118, the CQL execution intermediary module 108 combines the related resources obtained from the application group into a composite resource that meets the user's requirements, so as to analyze and analyze the CQL file 107 and the CQL file 107. Results are stored in a CQL file database.

最後,在步驟S119中,將此複合式資源回傳使用者端,並結束流程。 Finally, in step S119, the composite resource is transmitted back to the user terminal, and the process ends.

本領域具通常知識者應瞭解,在前述第4圖所示的產生複合式資源過程中,由於應用程式群組係在未解析資源被解析後,才會被CQL執行中介模組108呼叫,因此即便應用程式群組中部分應用程式的API版本有變動,只要資源結構沒有破壞性的改變,CQL執行中介模組108皆可對應地呼叫正確版本的應用程式API,從而具備對於應用程式資源存取的容錯機制。 Those skilled in the art should understand that in the process of generating composite resources as shown in the foregoing Figure 4, because the application group is called by the CQL execution intermediary module 108 after the unresolved resources are resolved, so Even if the API version of some applications in the application group changes, as long as the resource structure does not have a destructive change, the CQL execution intermediary module 108 can correspondingly call the correct version of the application API, so that it has access to application resources. Fault tolerance mechanism.

上述實施形態僅例示性說明本發明之原理、特點及其功效,並非用以限制本發明之可實施範疇,任何熟習此項技藝之人士均可在不違背本發明之精神及範疇下,對上述 實施形態進行修飾與改變。任何運用本發明所揭示內容而完成之等效改變及修飾,均仍應為申請專利範圍所涵蓋。因此,本發明之權利保護範圍,應如申請專利範圍所列。 The above-mentioned embodiments merely exemplify the principles, features, and effects of the present invention, and are not intended to limit the implementable scope of the present invention. Anyone who is familiar with this technology can perform the above operations without departing from the spirit and scope of the present invention. Modifications and changes to the implementation form. Any equivalent changes and modifications made by using the disclosure of the present invention should still be covered by the scope of patent application. Therefore, the scope of protection of the rights of the present invention should be as listed in the scope of patent application.

Claims (15)

一種使用統一聚合查詢語言獲取資源的方法,包含以下步驟:(1)接收一用以描述複數資源之資源結構之統一聚合查詢語言文件;(2)基於該等資源結構,判斷該統一聚合查詢語言文件中的該複數資源是否均解析完成;以及(3)若該複數資源已全部解析完成,從一CQL文件資料庫中取得一第一解析結果,以呼叫與該第一解析結果相關的一第一應用程式群組,進而提供複數第一資源,反之,若該複數資源未全部解析完成,解析該複數資源來產生一第二解析結果,以呼叫與該第二解析結果相關的一第二應用程式群組,進而提供複數第二資源。     A method for obtaining resources using a unified aggregation query language includes the following steps: (1) receiving a unified aggregation query language file describing a resource structure of a plurality of resources; (2) judging the unified aggregation query language based on the resource structure Whether the plurality of resources in the file are all parsed; and (3) if the plurality of resources are all parsed, obtain a first parse result from a CQL file database to call a first parsed result related to the first parse result An application group, and then provide a plurality of first resources, and conversely, if the plurality of resources are not completely parsed, the plurality of resources are parsed to generate a second analysis result to call a second application related to the second analysis result Program group, which in turn provides a plurality of second resources.     如申請專利範圍第1項所述之方法,更包含將該複數第一資源或該複數第二資源組合成一複合式資源。     The method described in item 1 of the patent application scope further comprises combining the plurality of first resources or the plurality of second resources into a composite resource.     如申請專利範圍第1項所述之方法,該步驟(3)更包含以下步驟:(i)轉譯該統一聚合查詢語言文件為一抽象語法樹(Abstract Syntax Tree);及(ii)根據該抽象語法樹,判斷該複數資源是否已解析完成以呼叫該第二應用程式群組,進而提供該複數第二資源。     According to the method described in item 1 of the patent application scope, step (3) further includes the following steps: (i) translating the unified aggregation query language file into an Abstract Syntax Tree; and (ii) according to the abstraction A syntax tree to determine whether the plurality of resources have been parsed to call the second application group, thereby providing the plurality of second resources.     如申請專利範圍第3項所述之方法,其中,在該步驟(ii)中,係以迭代(iteratively)方式或平行(in parallel)方式 以判斷該複數資源是否已解析完成。     The method according to item 3 of the scope of patent application, wherein in step (ii), iteratively or in parallel is used to determine whether the complex resource has been resolved.     如申請專利範圍第1-4項中任一項所述之方法,其中,使用與該第一應用程式群組之API(Application Programming Interface)通訊的方式以呼叫該第一應用程式群組;及/或使用與該第二應用程式群組之API通訊的方式以呼叫該第二應用程式群組。     The method according to any one of claims 1 to 4, wherein the first application group is called by using an API (Application Programming Interface) communication with the first application group; and / Or call the second application group by using API communication with the second application group.     如申請專利範圍第1-4項中任一項所述之方法,其中,採用迭代方式以呼叫該第一應用程式群組及/或該第二應用程式群組。     The method according to any one of claims 1 to 4, wherein the first application group and / or the second application group are called in an iterative manner.     如申請專利範圍第1-4項中任一項所述之方法,其中,採用平行方式來呼叫該第一應用程式群組及/或該第二應用程式群組。     The method according to any one of claims 1-4, wherein the first application group and / or the second application group are called in parallel.     如申請專利範圍第1-4項中任一項所述之方法,其中,該第一應用程式群組及/或該第二應用程式群組係由複數個微服務式應用程式所組成。     The method according to any one of claims 1-4, wherein the first application group and / or the second application group are composed of a plurality of micro-service-type applications.     如申請專利範圍第1-4項中任一項所述之方法,其中,該統一聚合查詢語言文件係為一基於JSON(JavaScript Object Notation)的宣告式描述語言文件。     The method according to any one of claims 1 to 4, wherein the unified aggregation query language file is a JSON (JavaScript Object Notation) -based declarative description language file.     一種使用統一聚合查詢語言獲取資源的系統,包含:一統一聚合查詢語言文件執行模組,其接收描述複數資源之資源結構的一統一聚合查詢語言文件,其中,若該統一聚合查詢語言文件執行模組曾經解析過該統一聚合查詢語言文件,該統一聚合查詢語言文件執行模組自一CQL文件資料庫中取得一第一解析結果, 以呼叫與該第一解析結果相關的一第一應用程式群組,進而提供複數第一資源,反之,若該統一聚合查詢語言文件執行模組並未解析過該統一聚合查詢語言文件,該統一聚合查詢語言文件執行模組解析該複數資源來產生一第二解析結果,以呼叫與該第二解析結果相關的一第二應用程式群組,進而提供複數第二資源。     A system for obtaining resources using a unified aggregation query language includes a unified aggregation query language file execution module that receives a unified aggregation query language file describing a resource structure of a plurality of resources, and if the unified aggregation query language file executes a module The team has parsed the unified aggregation query language file, and the unified aggregation query language file execution module obtains a first parsing result from a CQL file database to call a first application program group related to the first parsing result. Group, and then provide a plurality of first resources, otherwise, if the unified aggregation query language file execution module has not parsed the unified aggregation query language file, the unified aggregation query language file execution module parses the plurality of resources to generate a second The analysis result is used to call a second application program group related to the second analysis result, thereby providing a plurality of second resources.     如申請專利範圍第10項所述之系統,其中,該統一聚合查詢語言文件執行模組將該複數第一資源或該複數第二資源組合成一複合式資源。     The system according to item 10 of the scope of patent application, wherein the unified aggregation query language file execution module combines the plurality of first resources or the plurality of second resources into a composite resource.     如申請專利範圍第10項所述之系統,其中,該統一聚合查詢語言文件執行模組係與該第一應用程式群組之API通訊以呼叫該第一應用程式群組,且該統一聚合查詢語言文件執行模組係與該第二應用程式群組之API通訊以呼叫該第二應用程式群組。     The system according to item 10 of the scope of patent application, wherein the unified aggregation query language document execution module communicates with the API of the first application program group to call the first application program group, and the unified aggregation query The language document execution module communicates with the API of the second application program group to call the second application program group.     如申請專利範圍第10項所述之系統,其中,該統一聚合查詢語言文件執行模組係採用迭代方式或平行方式以呼叫該第一應用程式群組及/或該第二應用程式群組。     The system according to item 10 of the scope of patent application, wherein the unified aggregation query language document execution module uses an iterative method or a parallel method to call the first application group and / or the second application group.     如申請專利範圍第10項所述之系統,其中,該第一應用程式群組及/或該第二應用程式群組係由複數個微服務式應用程式所組成。     The system according to item 10 of the scope of patent application, wherein the first application program group and / or the second application program group are composed of a plurality of microservice application programs.     如申請專利範圍第10項所述之系統,其中,該統一聚合查詢語言文件係為一基於JSON的宣告式描述語言文件。     The system according to item 10 of the patent application scope, wherein the unified aggregation query language file is a JSON-based declarative description language file.    
TW107112884A 2018-04-16 2018-04-16 Method and system of obtaining resources using unified composite query language TWI707273B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW107112884A TWI707273B (en) 2018-04-16 2018-04-16 Method and system of obtaining resources using unified composite query language

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW107112884A TWI707273B (en) 2018-04-16 2018-04-16 Method and system of obtaining resources using unified composite query language

Publications (2)

Publication Number Publication Date
TW201944232A true TW201944232A (en) 2019-11-16
TWI707273B TWI707273B (en) 2020-10-11

Family

ID=69184731

Family Applications (1)

Application Number Title Priority Date Filing Date
TW107112884A TWI707273B (en) 2018-04-16 2018-04-16 Method and system of obtaining resources using unified composite query language

Country Status (1)

Country Link
TW (1) TWI707273B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI773048B (en) * 2020-05-12 2022-08-01 南韓商韓領有限公司 Systems and methods for reducing database query latency

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100534047C (en) * 2006-04-28 2009-08-26 国际商业机器公司 Method and system for attribute based index and/or query of Web service resource
US8738656B2 (en) * 2010-08-23 2014-05-27 Hewlett-Packard Development Company, L.P. Method and system for processing a group of resource identifiers
CN105183735B (en) * 2014-06-18 2019-02-19 阿里巴巴集团控股有限公司 The querying method and inquiry unit of data
US10452975B2 (en) * 2016-06-19 2019-10-22 Data.World, Inc. Platform management of integrated access of public and privately-accessible datasets utilizing federated query generation and query schema rewriting optimization
TWM547135U (en) * 2017-05-05 2017-08-11 兆豐國際商業銀行股份有限公司 File management server

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI773048B (en) * 2020-05-12 2022-08-01 南韓商韓領有限公司 Systems and methods for reducing database query latency
US11681701B2 (en) 2020-05-12 2023-06-20 Coupang Corp. Systems and methods for reducing database query latency

Also Published As

Publication number Publication date
TWI707273B (en) 2020-10-11

Similar Documents

Publication Publication Date Title
US10901961B2 (en) Systems and methods for generating schemas that represent multiple data sources
US10803029B2 (en) Generating javascript object notation (JSON) schema from JSON payloads
US11537606B2 (en) Solution for implementing computing service based on structured query language statement
US10768980B2 (en) Automated execution of a batch job workflows
US9569288B2 (en) Application pattern discovery
US9122804B2 (en) Logic validation and deployment
US10417248B2 (en) Field extension in database system
US9582553B2 (en) Systems and methods for analyzing existing data models
JP2017534996A (en) System and method for providing and executing a domain specific language for a cloud service infrastructure
US11741119B2 (en) Canonical data model for distributed data catalog and metadata exchange
US20140297679A1 (en) Analytics based on pipes programming model
US11132363B2 (en) Distributed computing framework and distributed computing method
US10417058B1 (en) Method and system for executing application programming interface (API) requests based on parent-child object relationships
US11366704B2 (en) Configurable analytics for microservices performance analysis
US20180359317A1 (en) System and method for non-intrusive context correlation across cloud services
US11693859B2 (en) Systems and methods for data retrieval from a database indexed by an external search engine
AU2017351024B2 (en) Processing application programming interface (API) queries based on variable schemas
TWI707273B (en) Method and system of obtaining resources using unified composite query language
US20230145461A1 (en) Receiving and integrating external data into a graphical user interface of an issue tracking system
US11609924B2 (en) Database query execution on multiple databases
CN115145652A (en) Method, device, equipment and medium for creating data processing task
US20230350793A1 (en) Scenario testing against production data for systems providing access management as a service
US20120078923A1 (en) Scripting using new ordering algorithm
US11704093B2 (en) Rapid prototyping of user experience components and related application functionality
US20220172111A1 (en) Data preparation for use with machine learning