TW201901491A - Related information query method, terminal and device - Google Patents

Related information query method, terminal and device Download PDF

Info

Publication number
TW201901491A
TW201901491A TW106138204A TW106138204A TW201901491A TW 201901491 A TW201901491 A TW 201901491A TW 106138204 A TW106138204 A TW 106138204A TW 106138204 A TW106138204 A TW 106138204A TW 201901491 A TW201901491 A TW 201901491A
Authority
TW
Taiwan
Prior art keywords
data table
query
data
unit
name
Prior art date
Application number
TW106138204A
Other languages
Chinese (zh)
Other versions
TWI650659B (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 平安科技(深圳)有限公司
Publication of TW201901491A publication Critical patent/TW201901491A/en
Application granted granted Critical
Publication of TWI650659B publication Critical patent/TWI650659B/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2423Interactive query statement specification based on a database schema
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2452Query translation
    • G06F16/24522Translation of natural language queries to structured queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24534Query rewriting; Transformation
    • G06F16/24549Run-time optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45591Monitoring or debugging support

Abstract

Embodiments of the present invention provide an association information querying method, a terminal, a server management system, and a computer readable storage medium. The method comprises: receiving querying objects input in vCenter by a user; screening, according to the querying objects, all object information associated with the querying objects in vCenter; creating data tables according to the querying objects and the object information and inserting related data in the data tables, the class of each object corresponding to a data table; generating a multi-layer relation tree diagram according to the data tables and fields in the data tables; receiving a data table and a field selected by the user in the multi-layer relation tree diagram, and a querying condition input by the user; generating a SQL statement according to the selected data table and field and the input querying condition; and executing the SQL statement and returning a querying execution result. The embodiments save the time for positioning and fault analysis, and improve the operation and maintenance management efficiency.

Description

一種關聯信息查詢方法、終端及設備Method, terminal and equipment for querying related information

本發明涉及信息技術領域,尤其涉及一種關聯信息查詢方法、終端及設備。The present invention relates to the field of information technology, and in particular, to a method, terminal, and device for querying related information.

虛擬機軟體(VMware)的運維人員管理虛擬機(VM)時,當服務器異常時如負載太高或硬體維護或平時運維VM的時候需要找出異常所在的地方如哪台服務器出了異常。現有技術係 ,運維人員通常要在虛擬機集成容器的客戶端(VSphere client)或者虛擬機集成容器的網頁客戶端(VSphere web client)花大量的時間查詢相關信息,然後去定位問題,在這個過程中要獲取很多相關信息的表,再對這個表進行分析和關聯,最終獲得一張有用的表。然而在雲端環境中,VM的數量衆多,運維人員定位問題的難度隨之加大,運維的效率就自然降低了。這對於平時的運維管理和故障分析都是十分不利的。When operating and maintaining personnel of the virtual machine software (VMware) manages a virtual machine (VM), when the server is abnormal, such as a high load or hardware maintenance, or when operating and maintaining the VM, it is necessary to find out where the exception is, such as which server is out abnormal. Department of Existing Technology Operation and maintenance personnel usually spend a lot of time querying related information on the client side of the virtual machine integration container (VSphere client) or the web client of the virtual machine integration container (VSphere web client), and then to locate the problem, in this process, Get a lot of related information table, then analyze and correlate this table, and finally get a useful table. However, in the cloud environment, the number of VMs is large, and the difficulty of locating the operation and maintenance personnel will increase, and the efficiency of the operation and maintenance will naturally decrease. This is very unfavorable to the usual operation and maintenance management and failure analysis.

本發明提供了一種關聯信息查詢方法和終端,可以將定位問題中的查詢對象和查詢對象的所有相關聯對象顯示在多層關係樹狀圖中,再根據多層關係樹狀圖中的信息進行查詢得到查詢結果,節省了定位問題和故障分析的時間,提高了運維管理的效率。The invention provides a method and a terminal for querying related information, which can display the query object and all related objects of the query object in a positioning problem in a multi-layer relation tree diagram, and then obtain the query based on the information in the multi-layer relation tree diagram. The query results save time in locating problems and analyzing failures, and improve the efficiency of operation and maintenance management.

本發明提供了一種關聯信息查詢方法,該方法包括:The present invention provides a method for querying related information. The method includes:

接收在vCenter中用戶輸入的查詢對象;Receive query objects entered by users in vCenter;

根據該查詢對象在vCenter中篩選出與該查詢對象相關聯的所有的對象信息;Filter out all object information associated with the query object in vCenter according to the query object;

根據該查詢對象和該對象信息創建資料表並在資料表中插入相關資料,其中每個對象所屬的類對應一個資料表;Create a data table based on the query object and the object information and insert relevant data in the data table, where the class to which each object belongs corresponds to a data table;

根據該資料表和資料表中的字段生成多層關係樹狀圖;Generate a multi-level relationship tree diagram according to the data table and the fields in the data table;

接收用戶在多層關係樹狀圖中選擇的資料表和字段,以及用戶輸入的查詢條件;Receiving the data tables and fields selected by the user in the multi-layer relationship tree and the query conditions entered by the user;

根據選擇的資料表和字段,以及輸入的查詢條件生成結構化查詢語言SQL語句;Generate a structured query language SQL statement based on the selected data tables and fields, and the query conditions entered;

執行SQL語句並返回查詢執行結果。Execute SQL statements and return query execution results.

本發明提供了一種終端,該終端包括:The present invention provides a terminal, which includes:

接收單元,用於接收在vCenter中用戶輸入的查詢對象;A receiving unit for receiving a query object input by a user in vCenter;

篩選單元,用於根據該查詢對象在vCenter中篩選出與該查詢對象相關聯的所有的對象信息;A filtering unit for filtering all object information associated with the query object in vCenter according to the query object;

表創建單元,用於根據該查詢對象和該對象信息創建資料表並在資料表中插入相關資料,其中每個對象所屬的類對應一個資料表;A table creation unit, configured to create a data table based on the query object and the object information and insert related data into the data table, wherein the class to which each object belongs corresponds to a data table;

樹狀圖生成單元,用於根據該資料表和資料表中的字段生成多層關係樹狀圖;A tree diagram generating unit, configured to generate a multi-layer relationship tree diagram according to the material table and the fields in the material table;

輸入單元,用於接收用戶在多層關係樹狀圖中選擇的資料表和字段,以及用戶輸入的查詢條件;An input unit for receiving a data table and a field selected by a user in a multi-layer relationship tree and a query condition input by the user;

查詢語句生成單元,用於根據選擇的資料表和字段,以及輸入的查詢條件生成SQL語句;Query statement generating unit, which is used to generate SQL statements according to the selected data tables and fields and the input query conditions;

結果返回單元,用於執行SQL語句並返回查詢執行結果。The result return unit is used to execute the SQL statement and return the query execution result.

本發明還提供一種設備,該設備包括處理器,以及與該處理器相連的記憶體;The present invention also provides a device, which includes a processor and a memory connected to the processor;

該記憶體,用於存儲包括包括用戶輸入的查詢對象、該查詢對象以及與該查詢對象相關聯的所有的對象信息、資料表和資料表中的字段、多層關係樹狀圖,以及其他可調用並運行的程序資料;The memory is used to store a query object including a user input, the query object and all object information associated with the query object, a data table and fields in the data table, a multi-layer relationship tree diagram, and other callable And running program information;

該處理器,用於調用該記憶體中存儲的程序資料,並執行如下步驟:The processor is used to call the program data stored in the memory and execute the following steps:

接收在vCenter中用戶輸入的查詢對象;Receive query objects entered by users in vCenter;

根據該查詢對象在vCenter中篩選出與該查詢對象相關聯的所有的對象信息;Filter out all object information associated with the query object in vCenter according to the query object;

根據該查詢對象和該對象信息創建資料表並在資料表中插入相關資料,其中每個對象所屬的類對應一個資料表;Create a data table based on the query object and the object information and insert relevant data in the data table, where the class to which each object belongs corresponds to a data table;

根據該資料表和資料表中的字段生成多層關係樹狀圖;Generate a multi-level relationship tree diagram according to the data table and the fields in the data table;

接收用戶在多層關係樹狀圖中選擇的資料表和字段,以及用戶輸入的查詢條件;Receiving the data tables and fields selected by the user in the multi-layer relationship tree and the query conditions entered by the user;

根據選擇的資料表和字段,以及輸入的查詢條件生成SQL語句;Generate SQL statements based on selected data tables and fields, and input query conditions;

執行SQL語句幷返回查詢執行結果。Execute SQL statements and return query execution results.

本發明實施例提供的方法、終端及設備,可以根據查詢對象和查詢對象相關聯的所有對象信息創建資料表並在資料表中插入相關資料,根據該資料表生成多層關係樹狀圖,再根據用戶選擇的資料表和字段,以及輸入的查詢條件生成SQL語句,執行SQL語句並返回查詢執行結果。本發明實施例可以將定位問題中的查詢對象和查詢對象的相關聯的所有對象顯示在多層關係樹狀圖中,再根據多層關係樹狀圖中的信息進行查詢得到查詢結果,節省了定位問題和故障分析的時間,提高了運維管理的效率。The method, terminal, and device provided by the embodiments of the present invention can create a data table based on the query object and all object information associated with the query object, insert relevant data into the data table, generate a multilayer relationship tree diagram according to the data table, and then The data tables and fields selected by the user and the query conditions entered generate SQL statements, execute the SQL statements and return the query execution results. In the embodiment of the present invention, the query object in the positioning problem and all objects associated with the query object can be displayed in a multi-layer relationship tree diagram, and then the query result can be obtained based on the information in the multi-layer relationship tree diagram, thereby saving the positioning problem. And fault analysis time, which improves the efficiency of operation and maintenance management.

下面將結合本發明實施例中的附圖,對本發明實施例中的技術方案進行清楚、完整地描述,顯然,所描述的實施例係本發明一部分實施例,而不是全部的實施例。基於本發明中的實施例,本領域普通技術人員在沒有做出創造性勞動前提下所獲得的所有其他實施例,都屬於本發明保護的範圍。In the following, the technical solutions in the embodiments of the present invention will be clearly and completely described with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

應當理解,當在本說明書和所附申請專利範圍中使用時,術語“包括”和 “包含”指示所描述特徵、整體、步驟、操作、元素和/或組件的存在,但並不排除一個或多個其它特徵、整體、步驟、操作、元素、組件和/或其集合的存在或添加。It should be understood that the terms "including" and "comprising" when used in the scope of this specification and the appended patent applications indicate the presence of described features, wholes, steps, operations, elements and / or components, but do not exclude one or The presence or addition of a number of other features, wholes, steps, operations, elements, components, and / or sets thereof.

還應當理解,在本發明說明書和所附申請專利範圍中使用的術語“和/ 或” 係指相關聯列出的項中的一個或多個的任何組合以及所有可能組合,並且包括這些組合。It should also be understood that the term "and / or" as used in the description of the invention and the scope of the accompanying application patents refers to and includes any combination of one or more of the associated listed items and all possible combinations.

具體實現中,本發明實施例中描述的終端包括但不限於諸如桌上型電腦等非移動式通信設備。還應當理解的是,在一些實施例中,該設備並非僅指非移動式通信設備,還可以包括移動電話、筆記型電腦或平板電腦之類的其它移動式設備。In specific implementation, the terminals described in the embodiments of the present invention include, but are not limited to, non-mobile communication devices such as desktop computers. It should also be understood that, in some embodiments, the device does not only refer to non-mobile communication devices, but may also include other mobile devices such as mobile phones, notebook computers, or tablet computers.

圖1爲本發明實施例提供的一種關聯信息查詢方法的流程示意圖。該方法包括S101~S107。FIG. 1 is a schematic flowchart of an association information query method according to an embodiment of the present invention. The method includes S101 ~ S107.

S101,接收在vCenter中用戶輸入的查詢對象。其中,vCenter係虛擬化管理服務器平臺VMware vCenter Server的簡稱。在vCenter中,涉及到的組件主要包括主機、虛擬機、網路、存儲、集群等。對於用戶而言,若用戶要查詢主機,那麽用戶輸入的查詢對象根據用戶的需求可以爲某一個具體的主機,若不能確定爲某一個具體的主機,也可以將主機組件作爲查詢對象。S101. Receive a query object input by a user in vCenter. Among them, vCenter is the abbreviation of VMware vCenter Server, a virtualization management server platform. In vCenter, the components involved mainly include hosts, virtual machines, networks, storage, clusters, and so on. For the user, if the user wants to query the host, the query object entered by the user can be a specific host according to the user's needs. If it cannot be determined as a specific host, the host component can also be used as the query object.

S102,根據該查詢對象在vCenter中篩選出與該查詢對象相關聯的所有的對象信息。在vCenter中,將主機、虛擬機、網路、存儲、集群等抽象出相對應的類,並抽象出這些類之間的相對應的關係,並將這些抽象出來的類和這些類之間的相對應的關係保存。並同時保存抽象出來的類的具體信息,如保存多個主機的具體信息,包括主機名稱、主機內存大小、主機處理器、主機操作系統類型等。當接收到用戶輸入的查詢對象後,根據保存的抽象出來的類和這些類之間的相對應的關係篩選出查詢對象相關聯的所有的對象信息。如用戶輸入的查詢對象爲主機,那麽與該查詢對象相關聯的所有的對象信息包括主機名稱、主機連接的存儲、主機上的虛擬機、主機內存、主機運行狀態、主機網路系統、主機所在的群集、主機連接狀態、主機觸發的告警的信息等。S102: Filter out all object information associated with the query object in vCenter according to the query object. In vCenter, the corresponding classes are abstracted from the host, virtual machine, network, storage, cluster, etc., and the corresponding relationships between these classes are abstracted. The abstracted classes and the relationships between these classes are abstracted. The corresponding relationship is saved. It also saves the specific information of the abstract class, such as the specific information of multiple hosts, including host name, host memory size, host processor, host operating system type, and so on. After receiving the query object input by the user, all object information associated with the query object is filtered according to the saved abstracted classes and the corresponding relationships between the classes. If the query object entered by the user is a host, all the object information associated with the query object includes the host name, the storage connected to the host, the virtual machine on the host, the host memory, the host operating status, the host network system, and the host location Information about the cluster, host connection status, and host-triggered alarms.

S103,根據該查詢對象和該查詢對象相關聯的所有對象信息創建資料表並在資料表中插入相關資料。其中每個對象所屬的類對應一個資料表。在具體實現中,要先創建資料表,再在資料表中插入資料。具體地,如圖2所示,S103包括S201-S202。S201,獲取每個對象所屬類的屬性和該屬性的值。其中,這裏的類的屬性,理解爲類的成員變量。可以通過Java反射機制來獲取每個對象所屬類的屬性和該屬性的值。S202,將每個類的屬性轉化爲SQL語句並執行該SQL語句以創建資料表,將每個類的屬性和該屬性的值轉化爲SQL語句並執行該SQL語句以在資料表中插入資料。其中,將每個類的屬性轉化爲SQL語句時,需要加入create table等創建資料表的SQL語法;將每個類的屬性和屬性的值轉化爲SQL語句時,需要加入insert等插入資料的SQL語法。創建的表按照預設的規則命名,如t-類名等。如獲取主機名稱爲abc的對象所屬的類爲主機類,該主機類的屬性包括主機名稱、主機內存大小、主機處理器、主機操作系統類型等,加入create table等創建資料表的SQL語法並執行以創建主機資料表,創建的主機資料表的字段包括主機名稱、主機內存大小、主機處理器、主機操作系統類型等。接著在主機資料表中插入資料,可以在主機資料表中一次插入一行或者多行資料。假設插入一行資料,這一行資料的對應的屬性和屬性的值分別爲:主機名稱爲xyz、主機內存大小爲4GB、主機處理器爲英特爾4GHz、主機操作系統類型爲32位操作系統,加入insert等插入資料的SQL語法並執行以在主機資料表中插入該行資料。S103. Create a data table according to the query object and all object information associated with the query object, and insert related data into the data table. Each of these objects corresponds to a table. In specific implementation, you must first create a data table, and then insert data into the data table. Specifically, as shown in FIG. 2, S103 includes S201-S202. S201. Obtain an attribute of a class to which each object belongs and a value of the attribute. Among them, the attributes of the class here are understood as the member variables of the class. You can use the Java reflection mechanism to obtain the properties of the class to which each object belongs and the value of the property. S202: Convert the attributes of each class into a SQL statement and execute the SQL statement to create a data table. Convert the attributes of each class and the value of the attribute into a SQL statement and execute the SQL statement to insert data into the data table. Among them, when transforming the attributes of each class into SQL statements, you need to add the SQL syntax for creating tables such as create table; when transforming the attributes and attribute values of each class into SQL statements, you need to add SQL such as insert to insert data grammar. The created tables are named according to preset rules, such as t-class names. For example, if the class to which the object whose host name is abc belongs belongs to the host class, the attributes of the host class include the host name, the size of the host memory, the host processor, and the type of the host operating system. To create a host profile, the fields of the created host profile include host name, host memory size, host processor, host operating system type, and so on. Then insert data into the host data table, you can insert one or more rows of data in the host data table at a time. Suppose a row of data is inserted. The corresponding attributes and attribute values of this row of data are: host name is xyz, host memory size is 4GB, host processor is Intel 4GHz, host operating system type is 32-bit operating system, insert, etc. Insert the SQL syntax of the data and execute to insert the row of data in the host data table.

S104,根據資料表和資料表中的字段生成多層關係樹狀圖。S104. Generate a multi-layer relationship tree diagram according to the data table and the fields in the data table.

S105,接收用戶在多層關係樹狀圖中選擇的資料表和字段,以及用戶輸入的查詢條件。因爲多層關係樹狀圖中展示了要查詢的資料表和相關聯的資料表之間的關係以及每個資料表所對應的字段,因此用戶可直接選擇要顯示的資料表和字段,方便查看。其中,要選擇的字段可以爲空,那麽理解爲該資料表的所有字段都要顯示,同時輸入的查詢條件可以爲空,可以理解爲該資料表的所有資料都需要。S105. Receive the data tables and fields selected by the user in the multi-layer relationship tree and the query conditions entered by the user. Because the relationship between the data table to be queried and the related data table and the fields corresponding to each data table are displayed in the multi-layer relational tree diagram, the user can directly select the data table and field to be displayed for easy viewing. Among them, the field to be selected can be empty, so it is understood that all fields of the data table must be displayed, and the query conditions entered at the same time can be empty, which can be understood as all the data of the data table are required.

S106,根據選擇的資料表和字段,以及輸入的查詢條件生成SQL語句。S106. Generate a SQL statement according to the selected data table and field, and the input query conditions.

S107,執行SQL語句並返回查詢執行結果。該查詢執行結果爲一條條的記錄,如一個或者多個具體主機的信息,一個或者多個具體虛擬機的信息等,一個或者多個具體網絡的信息等。S107. Execute the SQL statement and return the query execution result. The query execution result is a record, such as information of one or more specific hosts, information of one or more specific virtual machines, and information of one or more specific networks.

具體地,S104包括S301-S309。S301,獲取用戶輸入的查詢對象所對應的資料表的名稱。具體地,通過java反射機制獲取用戶輸入的查詢對象所對應的類的名稱,因爲一個類對應一個表,通過該類的名稱可得到該資料表的名稱。S302,判斷是否存在該資料表的名稱。若存在該資料表的名稱,執行S303;若不存在,返回不存在的相關資料以提醒用戶。存在該資料表的名稱理解爲在vCenter中存在該資料表的名稱。S303,獲取該資料表的所有字段及各個字段所屬的類型。其中,各個字段所屬的類型包括基本類型、其他類的類型等。需要注意的是,要先定義好每一個字段的資料結構,如定義一個字段的資料結構至少包括:具體的字段值,字段所屬的類型等。S304,將該資料表的名稱作爲樹狀圖的根節點,將各個字段作爲該根節點的子節點進行保存。S305,對於每一個字段,根據字段的類型判斷該字段中是否涉及有其他資料表。其中,若該字段所屬的類型是基本類型,則判斷該字段中不包含有其他類,也即不涉及有其他資料表;若該字段所屬的類型是其他類的類型,則判斷該字段中包含有其他類,也即涉及有其他資料表。若有字段涉及有其他資料表,執行S306;若對於每一個字段,都不涉及有其他資料表,執行S309。S306,判斷是否存在對應的資料表的名稱。若存在所對應的資料表的名稱,執行S307。若不存在對應的資料表的名稱,返回不存在的相關資料以提醒用戶。存在對應的資料表的名稱理解爲在vCenter中存在對應的資料表的名稱。S307,判斷保存的節點中是否有對應的資料表的名稱。若保存的節點中沒有保存所對應的資料表的名稱,即若有一個或者多個字段涉及有其他資料表的名稱,在保存的節點中只要至少有一個所對應的資料表的名稱不存在,或者可理解爲至少有一個所對應的資料表的名稱沒有保存爲對應的節點,執行S308;若保存的節點中有所對應的資料表的名稱,即若有一個或者多個字段都涉及有其他資料表的名稱,且保存的節點中已經存在有該一個或者多個字段涉及的對應的資料表的名稱,執行S309。若所對應的資料表的名稱所對應的節點爲其他資料表的字段所對應的節點,可理解爲其他資料表的字段所對應的節點與所對應的資料表的名稱所對應的節點爲同一個節點。S308,將該資料表的所有字段作爲當前字段所對應的節點的下一層節點進行保存,依此類推,直到樹狀圖的每一層節點對應的字段均不涉及其他資料表。S309,根據保存的所有節點生成多層關係樹狀圖。通過圖3所示的方法,會得到一個多層關係樹狀圖,該多層關係樹狀圖展示了查詢對象所對應類以及與查詢對象相關聯的所有對象所對應類之間的關係,其中,也展示了每個類的屬性。也即展示了查詢對象所對應的資料表以及與查詢對象相關聯的所有資料表之間的關係,其中,也展示了每個資料表包含的字段。得到的多層關係樹狀圖一目了然的展示了要查詢的資料表和相關聯的資料表之間的關係以及每個資料表所對應的字段,方便用戶進行更一步的查詢。Specifically, S104 includes S301-S309. S301. Obtain a name of a data table corresponding to a query object input by a user. Specifically, the name of the class corresponding to the query object input by the user is obtained through the java reflection mechanism, because one class corresponds to one table, and the name of the data table can be obtained by the name of the class. S302: Determine whether a name of the data table exists. If the name of the data table exists, execute S303; if it does not exist, return relevant data that does not exist to remind the user. The existence of the name of the data table is understood as the name of the data table existing in vCenter. S303. Obtain all fields of the material table and the types to which each field belongs. Among them, the types to which each field belongs include basic types, types of other classes, and the like. It should be noted that the data structure of each field must be defined first. For example, defining the data structure of a field includes at least: the specific field value and the type to which the field belongs. S304. The name of the data table is used as the root node of the tree diagram, and each field is stored as a child node of the root node. S305. For each field, it is determined whether other data tables are involved in the field according to the type of the field. Among them, if the type to which the field belongs is a basic type, it is judged that the field does not contain other classes, that is, other data tables are not involved; if the type to which the field belongs is a type of other class, it is judged that the field contains There are other categories, that is, other data sheets are involved. If there are other data tables involved in the field, execute S306; if there are no other data tables involved in each field, execute S309. S306: Determine whether there is a name of the corresponding data table. If the name of the corresponding data table exists, execute S307. If the name of the corresponding data table does not exist, relevant data that does not exist is returned to remind the user. The name of the corresponding data table is understood as the name of the corresponding data table in vCenter. S307: Determine whether there is a corresponding data table name in the saved node. If the name of the corresponding data table is not stored in the saved node, that is, if there are one or more fields related to the names of other data tables, as long as at least one of the corresponding data tables does not exist in the saved node, Or it can be understood that at least one of the corresponding data table names is not saved as the corresponding node, execute S308; if there is a corresponding data table name in the saved node, that is, if one or more fields are related to other If the name of the material table and the name of the corresponding material table related to the one or more fields already exists in the saved node, execute S309. If the node corresponding to the name of the corresponding table is the node corresponding to the field of the other table, it can be understood that the node corresponding to the field of the other table is the same as the node corresponding to the name of the corresponding table. node. S308: Save all the fields of the data table as nodes next to the node corresponding to the current field, and so on, until the fields corresponding to the nodes of each layer of the tree diagram do not involve other data tables. S309. Generate a multi-layer relational tree diagram according to all the saved nodes. Through the method shown in FIG. 3, a multi-layer relationship tree diagram is obtained. The multi-layer relationship tree diagram shows the relationship between the classes corresponding to the query object and the classes corresponding to all objects associated with the query object. The properties of each class are shown. That is, the relationship between the data table corresponding to the query object and all the data tables associated with the query object is displayed, and the fields contained in each data table are also displayed. The obtained multi-layer relational tree diagram clearly shows the relationship between the data table to be queried and the related data table and the fields corresponding to each data table, which is convenient for users to perform further query.

上述方法實施例可以將定位問題中的查詢對象所對應的類和查詢對象的相關聯的所有對象對應的類顯示在多層關係樹狀圖中,再根據多層關係樹狀圖中的信息進行查詢得到查詢結果,節省了定位問題和故障分析的時間,提高了運維管理的效率。In the above method embodiment, the classes corresponding to the query objects in the positioning problem and the classes corresponding to all the objects associated with the query objects can be displayed in a multi-layer relationship tree, and then obtained by querying based on the information in the multi-layer relationship tree. The query results save time in locating problems and analyzing failures, and improve the efficiency of operation and maintenance management.

圖4爲本發明另一實施例提供的一種關聯信息查詢方法的流程示意圖。該方法包括S401~S408。FIG. 4 is a schematic flowchart of an association information query method according to another embodiment of the present invention. The method includes S401 ~ S408.

S401,接收在vCenter中用戶輸入的查詢對象。在vCenter中,涉及到的組件主要包括主機、虛擬機、網路、存儲、集群等。對於用戶而言,若用戶要查詢主機,那麽用戶輸入的查詢對象根據用戶的需求可以爲某一個具體的主機,若不能確定爲某一個具體的主機,也可以將主機組件作爲查詢對象。S401. Receive a query object input by a user in vCenter. In vCenter, the components involved mainly include hosts, virtual machines, networks, storage, clusters, and so on. For the user, if the user wants to query the host, the query object entered by the user can be a specific host according to the user's needs. If it cannot be determined as a specific host, the host component can also be used as the query object.

S402,根據該查詢對象在vCenter中篩選出與該查詢對象相關聯的所有的對象信息。在vCenter中,將主機、虛擬機、網路、存儲、集群等抽象出相對應的類,並抽象出這些類之間的相對應的關係,並將這些抽象出來的類和這些類之間的相對應的關係保存。幷同時保存抽象出來的類的具體信息,如保存多個主機的具體信息,包括主機名稱、主機內存大小、主機處理器、主機操作系統類型等。當接收到用戶輸入的查詢對象後,根據保存的抽象出來的類和這些類之間的相對應的關係篩選出查詢對象相關聯的所有的對象信息。如用戶輸入的查詢對象爲主機,那麽與該查詢對象相關聯的所有的對象信息包括主機名稱、主機連接的存儲、主機上的虛擬機、主機內存、主機運行狀態、主機網絡系統、主機所在的群集、主機連接狀態、主機觸發的告警的信息等。S402: Filter out all object information associated with the query object in vCenter according to the query object. In vCenter, the corresponding classes are abstracted from the host, virtual machine, network, storage, cluster, etc., and the corresponding relationships between these classes are abstracted. The abstracted classes and the relationships between these classes are abstracted. The corresponding relationship is saved.幷 Save the specific information of the abstract class at the same time, such as the specific information of multiple hosts, including host name, host memory size, host processor, host operating system type, etc. After receiving the query object input by the user, all object information associated with the query object is filtered according to the saved abstracted classes and the corresponding relationships between the classes. If the query object entered by the user is a host, all the object information associated with the query object includes the host name, the storage connected to the host, the virtual machine on the host, the host memory, the host operating status, the host network system, and the host's location. Cluster, host connection status, host triggered alarm information, etc.

S403,建立內存資料庫,該內存資料庫與vCenter相連接。優選地,採用SQLite作爲內存資料庫。SQLite係一種嵌入式資料庫。它包括以下優點:(1)零配置。SQlite3不用安裝,不用配置,不用啓動、關閉或者配置資料庫實例。當系統崩潰後不用做任何恢復操作,再下次使用資料庫的時候自動恢復。(2)緊凑。SQLite被設計成輕量級的。一個頭文件,一個lib庫,就可以使用了,不用任何啓動任何系統進程。(3)採用無資料類型。因爲採用的係無資料類型,所以可以保存任何類型的資料,SQLite採用的係動態資料類型,會根據存入值自動判斷。該內存資料庫與vCenter相聯接,只要程序沒有因爲異常而中斷,就可以和vCenter一直保持通信。並且使用等待更新機制(waitforUpdate機制)更新內存資料庫中的資料,因此只要vCenter中有相關資料變化就可以立刻檢測到,可以理解爲,獲取的內存資料庫中的資料就是vCenter中的實時資料。S403. A memory database is established, and the memory database is connected to the vCenter. Preferably, SQLite is used as the memory database. SQLite is an embedded database. It includes the following advantages: (1) Zero configuration. SQlite3 does not need to be installed, configured, or started, shut down, or configured database instances. When the system crashes, there is no need to do any recovery operation, and the next time you use the database, it will automatically recover. (2) Compact. SQLite is designed to be lightweight. A header file and a lib library can be used without starting any system processes. (3) Use the dataless type. Because the data type is used, any type of data can be saved. The dynamic data type used by SQLite is automatically determined based on the stored value. This memory database is connected to vCenter, and as long as the program is not interrupted due to an abnormality, it can always maintain communication with vCenter. And use the wait for update mechanism (waitforUpdate mechanism) to update the data in the memory database, so as long as there are changes in the relevant data in vCenter can be detected immediately, it can be understood that the obtained data in the memory database is the real-time data in vCenter.

S404,根據該查詢對象和該查詢對象相關聯的所有對象信息在內存資料庫中創建資料表並在數據表中插入相關資料。其中每個對象所屬的類對應一個資料表。在具體實現中,要先創建資料表,再在資料表中插入資料。具體地,創建資料表以及在資料表中插入相關資料如圖2該,在此不再贅述。S404. Create a data table in the memory database according to the query object and all object information associated with the query object, and insert related data into the data table. Each of these objects corresponds to a table. In specific implementation, you must first create a data table, and then insert data into the data table. Specifically, creating a data table and inserting related data into the data table are as shown in FIG. 2, which will not be repeated here.

S405,根據資料表和資料表中的字段生成多層關係樹狀圖。具體地,如圖3所示,在此不再贅述。通過圖3所示的方法,會得到一個多層關係樹狀圖,該多層關係樹狀圖展示了查詢對象所對應類以及與查詢對象相關聯的所有對象所對應類之間的關係,其中,也展示了每個類的屬性。即展示了查詢對象所對應的資料表以及與查詢對象相關聯的所有資料表之間的關係,其中,也展示了每個資料表包含的字段。這裏的類的屬性,理解爲類的成員變量。得到的多層關係樹狀圖一目了然的展示了要查詢的資料表和相關聯的資料表之間的關係以及每個資料表所對應的字段,方便用戶進行更一步的查詢。S405. Generate a multi-layer relationship tree diagram according to the data table and the fields in the data table. Specifically, as shown in FIG. 3, details are not described herein again. Through the method shown in FIG. 3, a multi-layer relationship tree diagram is obtained. The multi-layer relationship tree diagram shows the relationship between the classes corresponding to the query object and the classes corresponding to all the objects associated with the query object. The properties of each class are shown. That is, the relationship between the data table corresponding to the query object and all the data tables associated with the query object is displayed, and the fields contained in each data table are also displayed. The properties of a class here are understood as member variables of the class. The obtained multi-layer relational tree diagram clearly shows the relationship between the data table to be queried and the related data table and the fields corresponding to each data table, which is convenient for users to perform further query.

S406,接收用戶在多層關係樹狀圖中選擇的資料表和字段,以及用戶輸入的查詢條件。因爲多層關係樹狀圖中展示了要查詢的資料表和相關聯的資料表之間的關係以及每個資料表所對應的字段,因此用戶可直接選擇要顯示的資料表和字段,方便查看。其中,要選擇的字段可以爲空,那麽理解爲該資料表的所有字段都要顯示,同時輸入的查詢條件可以爲空,可以理解爲該資料表的所有資料都需要。S406. Receive the data tables and fields selected by the user in the multi-layer relationship tree and the query conditions entered by the user. Because the relationship between the data table to be queried and the related data table and the fields corresponding to each data table are displayed in the multi-layer relational tree diagram, the user can directly select the data table and field to be displayed for easy viewing. Among them, the field to be selected can be empty, so it is understood that all fields of the data table must be displayed, and the query conditions entered at the same time can be empty, which can be understood as all the data of the data table are required.

S407,根據選擇的資料表和字段,以及輸入的查詢條件生成SQL語句。S407. Generate a SQL statement according to the selected data table and field, and the input query conditions.

S408,在內存資料庫中執行SQL語句並返回查詢執行結果。該查詢執行結果爲一條條的記錄,如一個或者多個具體主機的信息,一個或者多個具體虛擬機的信息等,一個或者多個具體網路的信息等。S408: Execute the SQL statement in the memory database and return the query execution result. The query execution result is records, such as information of one or more specific hosts, information of one or more specific virtual machines, and information of one or more specific networks.

上述方法實施例通過建立內存資料庫,將查詢對象相對應的資料表和該查詢對象相關聯的所有對象所對應的資料表都保存在內存資料庫中,vCenter中的相關資料有變動時,也會實時更新到內存資料庫中,再從內存資料庫中取相關的資料來生成多層關係樹狀圖,無需再重新從vCenter中獲取所有需要的資料,加快了查詢的速度,更一步節省了定位問題和故障分析的時間,提高了運維管理的效率。In the above method embodiment, by establishing a memory database, the data table corresponding to the query object and the data tables corresponding to all objects associated with the query object are stored in the memory database. When the related data in vCenter is changed, It will be updated to the memory database in real time, and then the relevant data is taken from the memory database to generate a multi-layered relational tree diagram. There is no need to re-acquire all the required data from vCenter, which speeds up the query speed and saves positioning Time for problem and failure analysis improves the efficiency of operation and maintenance management.

圖5爲本發明另一實施例提供的一種關聯信息查詢方法的示意流程圖。該方法包括S501-S504。FIG. 5 is a schematic flowchart of an association information query method according to another embodiment of the present invention. The method includes S501-S504.

S501,接收到vCenter中發出的告警信息後,創建存儲容器。其中,創建的存儲容器可以爲一個或者多個。如接收到vCenter中發出的一個封包率突然升高的告警信息,接受到告警信息後,創建購物車,再創建購物車的籃子。其中,創建的購物車可以有多個,一個購物車可以創建多個籃子。S501. After receiving the alarm information sent from the vCenter, a storage container is created. Among them, one or more storage containers can be created. For example, if you receive a warning message that the packet rate suddenly rises in vCenter, after receiving the warning message, create a shopping cart, and then create a shopping basket. Among them, there can be multiple shopping carts created, and one shopping cart can create multiple baskets.

S502,將該告警信息所涉及到的對象的查詢執行結果保存在存儲容器中。如接收到一個雲端環境中封包率突然升高的告警信息,那麽該告警信息所涉及的對象爲網路。其中,輸入該告警信息所涉及的對象,根據該告警信息所涉及到的對象進行查詢得到查詢執行結果的具體步驟可參見圖4該的實施例,具體地,請參看圖4實施例所涉及的內容,在此不再贅述。該查詢執行結果爲一條條的記錄,即爲對應的具體對象,如一個或者多個具體主機的信息,一個或者多個具體虛擬機的信息等,一個或者多個具體網路的信息等。將一次查詢的查詢執行結果保存在一個購物車的籃子裏。將多次查詢的多個查詢執行結果保存在一個購物車的多個籃子裏,或者保存在多個購物車的籃子裏。S502. Save the query execution result of the object related to the alarm information in a storage container. If a warning message that the packet rate suddenly rises in a cloud environment is received, the object of the warning message is the network. The specific steps for inputting the objects involved in the alarm information, and obtaining the query execution results according to the objects involved in the alarm information can be found in the embodiment of FIG. 4. Specifically, please refer to the embodiment of FIG. 4. The content is not repeated here. The query execution result is a record, which is a corresponding specific object, such as information of one or more specific hosts, information of one or more specific virtual machines, and information of one or more specific networks. Store the query execution results of a query in the basket of a shopping cart. Save multiple query execution results of multiple queries in multiple baskets of a shopping cart, or in multiple shopping cart baskets.

S503,接收用戶在該查詢執行結果中選擇的檢測對象。優選地,選擇的檢測對象爲多個。具體地,可以選擇一次查詢的查詢執行結果中的多個對象,也可以選擇多個查詢的查詢執行結果中的多個對象。可以理解地,如可以在一個購物車的多個籃子裏選擇多個對象,或者在多個購物車的多個籃子裏選擇多個對象。S503. Receive a detection object selected by the user in the query execution result. Preferably, a plurality of detection objects are selected. Specifically, multiple objects in a query execution result of a query may be selected, and multiple objects in a query execution result of multiple queries may also be selected. Understandably, for example, multiple objects can be selected in multiple baskets of a shopping cart, or multiple objects can be selected in multiple baskets of multiple shopping carts.

S504,根據檢測對象生成並顯示該對象的性能曲線圖以供查找告警信息的來源。具體地,S504包括S601-S603。S601,接收用戶輸入的要檢測的時間段。要檢測的時間可以爲一天之內的某幾個小時,也可以爲幾天,也可以爲幾個星期等。S602,根據檢測對象獲取該檢測對象在該時間段內的性能資料。其中,性能資料包括CPU性能、內存性能、網路性能等中的一個。S603,根據該性能資料生成並顯示檢測對象的性能曲線圖以供查找告警信息的來源。若有多個檢測對象,那麽該性能曲線圖中就會有多條曲線,將多個曲線放在一起對比,很容易發現異常曲線所對應的對象。將該異常曲線所對應的對象進行進一步的排查以供查找該告警信息的來源。S504: Generate and display the performance curve of the object according to the detection object for searching for the source of the alarm information. Specifically, S504 includes S601-S603. S601. Receive a time period to be detected input by a user. The time to be detected can be a few hours in a day, a few days, a few weeks, etc. S602: Acquire performance data of the detection object within the time period according to the detection object. Among them, the performance data includes one of CPU performance, memory performance, and network performance. S603: Generate and display the performance curve of the detection object according to the performance data for searching for the source of the alarm information. If there are multiple detection objects, then there will be multiple curves in the performance curve graph. When multiple curves are put together and compared, it is easy to find the object corresponding to the abnormal curve. Further investigate the object corresponding to the abnormal curve to find the source of the alarm information.

上述方法實施例接收到告警信息後,選擇查詢執行結果中的檢測對象,生成並顯示該對象的性能曲線圖,優選是多個對象的多個曲線圖,進一步方便用戶查詢告警信息的來源。加快了查詢的速度,更一步節省了定位問題和故障分析的時間,提高了運維管理的效率。After receiving the alarm information, the foregoing method embodiment selects the detection object in the query execution result, and generates and displays the performance curve graph of the object, preferably multiple graphs of multiple objects, further facilitating users to query the source of the alarm information. It speeds up the query, saves time for problem location and fault analysis, and improves the efficiency of operation and maintenance management.

圖7爲本發明實施例提供的一種終端的示意性框圖。該終端70包括接收單元701、篩選單元702、表創建單元703、樹狀圖生成單元704、查詢語句生成單元705、結果返回單元706。FIG. 7 is a schematic block diagram of a terminal according to an embodiment of the present invention. The terminal 70 includes a receiving unit 701, a filtering unit 702, a table creating unit 703, a tree map generating unit 704, a query sentence generating unit 705, and a result returning unit 706.

接收單元701,用於接收在vCenter中用戶輸入的查詢對象。其中,vCenter係虛擬化管理服務器平臺VMware vCenter Server的簡稱。在vCenter中,涉及到的組件主要包括主機、虛擬機、網路、存儲、集群等。對於用戶而言,若用戶要查詢主機,那麽用戶輸入的查詢對象根據用戶的需求可以爲某一個具體的主機,若不能確定爲某一個具體的主機,也可以將主機組件作爲查詢對象。The receiving unit 701 is configured to receive a query object input by a user in the vCenter. Among them, vCenter is the abbreviation of VMware vCenter Server, a virtualization management server platform. In vCenter, the components involved mainly include hosts, virtual machines, networks, storage, clusters, and so on. For the user, if the user wants to query the host, the query object entered by the user can be a specific host according to the user's needs. If it cannot be determined as a specific host, the host component can also be used as the query object.

篩選單元702,根據該查詢對象在vCenter中篩選出與該查詢對象相關聯的所有的對象信息。在vCenter中,將主機、虛擬機、網路、存儲、集群等抽象出相對應的類,並抽象出這些類之間的相對應的關係,並將這些抽象出來的類和這些類之間的相對應的關係保存。並同時保存抽象出來的類的具體信息,如保存多個主機的具體信息,包括主機名稱、主機內存大小、主機處理器、主機操作系統類型等。當接收到用戶輸入的查詢對象後,根據保存的抽象出來的類和這些類之間的相對應的關係篩選出查詢對象相關聯的所有的對象信息。如用戶輸入的查詢對象爲主機,那麽與該查詢對象相關聯的所有的對象信息包括主機名稱、主機連接的存儲、主機上的虛擬機、主機內存、主機運行狀態、主機網絡系統、主機所在的群集、主機連接狀態、主機觸發的告警的信息等。The filtering unit 702 filters out all the object information associated with the query object in vCenter according to the query object. In vCenter, the corresponding classes are abstracted from the host, virtual machine, network, storage, cluster, etc., and the corresponding relationships between these classes are abstracted. The abstracted classes and the relationships between these classes are abstracted. The corresponding relationship is saved. It also saves the specific information of the abstract class, such as the specific information of multiple hosts, including host name, host memory size, host processor, host operating system type, and so on. After receiving the query object input by the user, all object information associated with the query object is filtered according to the saved abstracted classes and the corresponding relationships between the classes. If the query object entered by the user is a host, all the object information associated with the query object includes the host name, the storage connected to the host, the virtual machine on the host, the host memory, the host operating status, the host network system, and the host's location. Cluster, host connection status, host triggered alarm information, etc.

表創建單元703,用于根據該查詢對象和該查詢對象相關聯的所有對象信息創建資料表並在資料表中插入相關資料。其中每個對象所屬的類對應一個資料表。在具體實現中,要先創建資料表,再在資料表中插入資料。具體地,如圖8所示,表創建單元包括第一字段獲取單元801、轉化執行單元802。第一字段獲取單元801,獲取每個對象所屬類的屬性和該屬性的值。其中,這裏的類的屬性,理解爲類的成員變量。可以通過Java反射機制來獲取每個對象所屬類的屬性和該屬性的值。轉化執行單元802,將每個類的屬性轉化爲SQL語句並執行該SQL語句以創建資料表,將每個類的屬性和該屬性的值轉化爲SQL語句並執行該SQL語句以在資料表中插入資料。其中,將每個類的屬性轉化爲SQL語句時,需要加入create table等創建資料表的SQL語法;將每個類的屬性和屬性的值轉化爲SQL語句時,需要加入insert等插入資料的SQL語法。創建的表按照預設的規則命名,如t-類名等。The table creating unit 703 is configured to create a material table according to the query object and all object information associated with the query object, and insert related materials in the material table. Each of these objects corresponds to a table. In specific implementation, you must first create a data table, and then insert data into the data table. Specifically, as shown in FIG. 8, the table creation unit includes a first field acquisition unit 801 and a transformation execution unit 802. The first field obtaining unit 801 obtains an attribute of a class to which each object belongs and a value of the attribute. Among them, the attributes of the class here are understood as the member variables of the class. You can use the Java reflection mechanism to obtain the properties of the class to which each object belongs and the value of the property. The conversion execution unit 802 converts the attributes of each class into a SQL statement and executes the SQL statement to create a data table, converts the attributes of each class and the value of the attribute into a SQL statement and executes the SQL statement to be included in the data table Insert data. Among them, when transforming the attributes of each class into SQL statements, you need to add the SQL syntax for creating tables such as create table; when transforming the attributes and attribute values of each class into SQL statements, you need to add SQL such as insert to insert data grammar. The created tables are named according to preset rules, such as t-class names.

樹狀圖生成單元704,用於將資料表和資料表中的字段生成多層關係樹狀圖。A tree diagram generating unit 704 is configured to generate a multi-layer relational tree diagram of the data table and the fields in the data table.

接收單元701,還用於接收用戶在多層關係樹狀圖中選擇的資料表和字段,以及用戶輸入的查詢條件。因爲多層關係樹狀圖中展示了要查詢的資料表和相關聯的資料表之間的關係以及每個資料表所對應的字段,因此用戶可直接選擇要顯示的資料表和字段,方便查看。其中,要選擇的字段可以爲空,那麽理解爲該資料表的所有字段都要顯示,同時輸入的查詢條件可以爲空,可以理解爲該資料表的所有資料都需要。The receiving unit 701 is further configured to receive a data table and a field selected by a user in a multi-layer relationship tree, and a query condition input by a user. Because the relationship between the data table to be queried and the related data table and the fields corresponding to each data table are displayed in the multi-layer relational tree diagram, the user can directly select the data table and field to be displayed for easy viewing. Among them, the field to be selected can be empty, so it is understood that all fields of the data table must be displayed, and the query conditions entered at the same time can be empty, which can be understood as all the data of the data table are required.

查詢語句生成單元705,用於根據選擇的資料表和字段,以及輸入的查詢條件生成SQL語句。The query statement generating unit 705 is configured to generate an SQL statement according to the selected data table and field, and the input query conditions.

結果返回單元706,用於執行SQL語句並返回查詢執行結果。該查詢執行結果爲一條條的記錄,如一個或者多個具體主機的信息,一個或者多個具體虛擬機的信息等,一個或者多個具體網路的信息等。A result return unit 706 is configured to execute a SQL statement and return a query execution result. The query execution result is records, such as information of one or more specific hosts, information of one or more specific virtual machines, and information of one or more specific networks.

具體地,樹狀圖生成單元包括表名稱獲取單元901、判斷單元902、第二字段獲取單元903、節點保存單元904、多層關係樹狀圖生成單元905。表名稱獲取單元901,用於獲取用戶輸入的查詢對象所對應的資料表的名稱。具體地,通過java反射機制獲取用戶輸入的查詢對象所對應的類的名稱,因爲一個類對應一個表,通過該類的名稱可得到該資料表的名稱。判斷單元902,用於判斷是否存在該資料表的名稱。存在該資料表的名稱理解爲在vCenter中存在該資料表的名稱。若不存在該資料表的名稱,則返回不存在的相關資料以提醒用戶。第二字段獲取單元903,用於若存在該資料表的名稱,獲取該資料表的所有字段及各個字段所屬的類型。其中,各個字段所屬的類型包括基本類型、其他類的類型等。需要注意的是,要先定義好每一個字段的資料結構,如定義一個字段的資料結構至少包括:具體的字段值,字段所屬的類型等。節點保存單元904,用於將該資料表的名稱作爲樹狀圖的根節點,將各個字段作爲該根節點的子節點進行保存。判斷單元902,還用於對於每一個字段,根據該字段所屬的類型判斷該字段中是否涉及有其他資料表。若該字段所屬的類型是基本類型,則判斷該字段中不包含有其他類,即不涉及有其他資料表;若該字段所屬的類型係其他類的類型,則判斷該字段中包含有其他類,即涉及有其他資料表。表名稱獲取單元901,還用於若涉及有其他資料表,獲取所對應的資料表的名稱。若只有一個字段涉及有其他資料表,獲取該一個字段涉及的所對應的資料表的名稱;若有多個字段涉及有其他表,獲取該多個字段涉及的所對應的資料表的名稱。判斷單元902,還用於判斷是否存在所對應的資料表的名稱。若不存在對應的資料表的名稱,返回不存在的相關資料以提醒用戶。存在對應的資料表的名稱理解爲在vCenter中存在對應的資料表的名稱。判斷單元902,還用於若存在所對應的資料表的名稱,判斷保存的節點中是否有所對應的資料表的名稱。若保存的節點中沒有保存所對應的資料表的名稱,即若有一個或者多個字段涉及有其他資料表的名稱,在保存的節點中只要至少有一個所對應的資料表的名稱不存在,或者可理解爲至少有一個所對應的資料表的名稱沒有保存爲對應的節點;若保存的節點中有所對應的資料表的名稱,即若有一個或者多個字段都涉及有其他資料表的名稱,且保存的節點中已經存在有該一個或者多個字段涉及的對應的資料表的名稱。節點保存單元904,還用於若保存的節點中沒有保存所對應的資料表的名稱,將該資料表的所有字段作爲當前字段所對應的節點的下一層節點進行保存,依此類推,直到樹狀圖的每一層節點對應的字段均不涉及其他資料表。多層關係樹狀圖生成單元905,用於若保存的節點中有所對應的資料表的名稱,根據保存的所有節點生成多層關係樹狀圖;以及若對於每一個字段,都不涉及有其他資料表,根據保存的所有節點生成多層關係樹狀圖。若所對應的資料表的名稱所對應的節點爲其他資料表的字段所對應的節點,可理解爲其他資料表的字段所對應的節點與所對應的資料表的名稱所對應的節點爲同一個節點。通過圖9所示的結構,會得到一個多層關係樹狀圖,該多層關係樹狀圖展示了查詢對象所對應類以及與查詢對象相關聯的所有對象所對應類之間的關係,其中,也展示了每個類的屬性。也即展示了查詢對象所對應的資料表以及與查詢對象相關聯的所有資料表之間的關係,其中,也展示了每個資料表包含的字段。這裏,類的屬性,理解爲類的所有成員變量。得到的多層關係樹狀圖一目了然的展示了要查詢的資料表和相關聯的資料表之間的關係以及每個資料表所對應的字段,方便用戶進行更一步的查詢。Specifically, the tree diagram generating unit includes a table name obtaining unit 901, a judging unit 902, a second field obtaining unit 903, a node saving unit 904, and a multi-layer relationship tree diagram generating unit 905. The table name obtaining unit 901 is configured to obtain a name of a data table corresponding to a query object input by a user. Specifically, the name of the class corresponding to the query object input by the user is obtained through the java reflection mechanism, because one class corresponds to one table, and the name of the data table can be obtained by the name of the class. The determining unit 902 is configured to determine whether a name of the data table exists. The existence of the name of the data table is understood as the name of the data table existing in vCenter. If the name of the table does not exist, relevant information that does not exist is returned to remind the user. A second field obtaining unit 903 is configured to obtain, if a name of the material table exists, all fields of the material table and a type to which each field belongs. Among them, the types to which each field belongs include basic types, types of other classes, and the like. It should be noted that the data structure of each field must be defined first. For example, defining the data structure of a field includes at least: the specific field value and the type to which the field belongs. The node saving unit 904 is configured to save the name of the data table as the root node of the tree diagram, and save each field as a child node of the root node. The judging unit 902 is further configured to determine, for each field, according to a type to which the field belongs, whether other data tables are involved in the field. If the type to which the field belongs is a basic type, it is determined that the field does not contain other classes, that is, no other data tables are involved; if the type to which the field belongs is a type of other class, it is determined that the field contains other classes , Which involves other data sheets. The table name obtaining unit 901 is further configured to obtain a name of a corresponding data table if other data tables are involved. If there is only one field related to other data tables, get the name of the corresponding data table related to that one field; if there are multiple fields related to other tables, get the name of the corresponding data table related to the multiple fields. The determining unit 902 is further configured to determine whether a name of a corresponding data table exists. If the name of the corresponding data table does not exist, relevant data that does not exist is returned to remind the user. The name of the corresponding data table is understood as the name of the corresponding data table in vCenter. The judging unit 902 is further configured to judge whether there is a corresponding data table name in the stored node if the corresponding data table name exists. If the name of the corresponding data table is not stored in the saved node, that is, if there are one or more fields related to the names of other data tables, as long as at least one of the corresponding data tables does not exist in the saved node, Or it can be understood that the name of at least one corresponding data table is not saved as the corresponding node; if there is a corresponding data table name in the saved node, that is, if one or more fields are related to other data tables Name, and the name of the corresponding data table involved in the one or more fields already exists in the saved node. The node saving unit 904 is further configured to save all the fields of the data table as nodes of the next layer of the node corresponding to the current field if the name of the corresponding data table is not stored in the saved node, and so on, until the tree The field corresponding to each layer node of the graph does not involve other data tables. A multi-layer relational tree diagram generating unit 905 is configured to generate a multi-layer relational tree diagram based on all the nodes saved if there is a corresponding table name in the saved node; and if there is no other data involved for each field Table, generates a multi-layer relational tree diagram based on all nodes saved. If the node corresponding to the name of the corresponding table is the node corresponding to the field of the other table, it can be understood that the node corresponding to the field of the other table is the same as the node corresponding to the name of the corresponding table. node. Through the structure shown in FIG. 9, a multi-layer relational tree diagram is obtained. The multi-layer relational tree diagram shows the relationship between the classes corresponding to the query object and the classes corresponding to all the objects associated with the query object. The properties of each class are shown. That is, the relationship between the data table corresponding to the query object and all the data tables associated with the query object is displayed, and the fields contained in each data table are also displayed. Here, the attributes of a class are understood as all member variables of the class. The obtained multi-layer relational tree diagram clearly shows the relationship between the data table to be queried and the related data table and the fields corresponding to each data table, which is convenient for users to perform further query.

上述實施例可以將定位問題中的查詢對象所對應的類和查詢對象的相關聯的所有對象對應的類顯示在多層關係樹狀圖中,再根據多層關係樹狀圖中的信息進行查詢得到查詢結果,節省了定位問題和故障分析的時間,提高了運維管理的效率。In the above embodiment, the classes corresponding to the query objects in the positioning problem and the classes corresponding to all the objects associated with the query objects can be displayed in a multi-layer relationship tree, and then a query can be obtained based on the information in the multi-layer relationship tree. As a result, time for locating problems and failure analysis is saved, and the efficiency of operation and maintenance management is improved.

圖10爲本發明另一實施例提供的一種終端的示意性框圖。該終端100包括接收單元101、篩選單元102、內存資料庫建立單元103、表創建單元104、樹狀圖生成單元105、查詢語句生成單元106、結果返回單元107。其中,接收單元101、篩選單元102、樹狀圖生成單元105、查詢語句生成單元106請參看圖7所示實施例中的接收單元701、篩選單元702、樹狀圖生成單元704、查詢語句生成單元705。圖10所示實施例與圖7所示實施例的區別在於:增加了內存資料庫建立單元103。FIG. 10 is a schematic block diagram of a terminal according to another embodiment of the present invention. The terminal 100 includes a receiving unit 101, a screening unit 102, a memory database establishment unit 103, a table creation unit 104, a tree map generation unit 105, a query sentence generation unit 106, and a result return unit 107. Among them, the receiving unit 101, the filtering unit 102, the dendrogram generating unit 105, and the query sentence generating unit 106 refer to the receiving unit 701, the filtering unit 702, the dendrogram generating unit 704, and the query sentence generating in the embodiment shown in FIG. Unit 705. The difference between the embodiment shown in FIG. 10 and the embodiment shown in FIG. 7 is that a memory database establishment unit 103 is added.

內存資料庫建立單元103,用於建立內存資料庫,該內存資料庫與vCenter相連接。優選地,採用SQLite作爲內存資料庫。該內存資料庫與vCenter相聯接,只要程序沒有因爲異常而中斷,就可以和vCenter一直保持通信。並且使用等待更新機制(waitforUpdate機制)更新內存資料庫中的資料,因此只要vCenter中有相關資料變化就可以立刻檢測到,可以理解爲,獲取的內存資料庫中的資料就是vCenter中的實時資料。The memory database establishing unit 103 is configured to establish a memory database, and the memory database is connected to the vCenter. Preferably, SQLite is used as the memory database. This memory database is connected to vCenter, and as long as the program is not interrupted due to an abnormality, it can always maintain communication with vCenter. And use the wait for update mechanism (waitforUpdate mechanism) to update the data in the memory database, so as long as there are changes in the relevant data in vCenter can be detected immediately, it can be understood that the obtained data in the memory database is the real-time data in vCenter.

表創建單元104,用於根據該查詢對象和該查詢對象相關聯的所有對象信息在內存資料庫中創建資料表並在資料表中插入相關資料。其中每個對象所屬的類對應一個資料表。在具體實現中,要先創建資料表,再在資料表中插入資料。具體地,創建資料表以及在資料表中插入相關資料如圖8該,在此不再贅述。The table creation unit 104 is configured to create a material table in the memory database and insert related materials into the material table according to the query object and all object information associated with the query object. Each of these objects corresponds to a table. In specific implementation, you must first create a data table, and then insert data into the data table. Specifically, creating a data table and inserting related data into the data table are as shown in FIG. 8, which will not be repeated here.

結果返回單元107,用於在內存資料庫中執行SQL語句並返回查詢執行結果。該查詢執行結果爲一條條的記錄,如一個或者多個具體主機的信息,一個或者多個具體虛擬機的信息等,一個或者多個具體網路的信息等。A result return unit 107 is configured to execute a SQL statement in a memory database and return a query execution result. The query execution result is records, such as information of one or more specific hosts, information of one or more specific virtual machines, and information of one or more specific networks.

上述實施例通過建立內存資料庫,將查詢對象所對應的資料表和該查詢對象相關聯的所有對象所對應的資料表都保存在內存資料庫中,vCenter中的相關資料有變動時,也會實時更新到內存資料庫中,再從內存資料庫中取相關的資料來生成多層關係樹狀圖,無需再重新從vCenter中獲取所有需要的資料,加快了查詢的速度,更一步節省了定位問題和故障分析的時間,提高了運維管理的效率。In the above embodiment, by establishing a memory database, the data tables corresponding to the query object and the data tables corresponding to all objects associated with the query object are stored in the memory database. When the related data in vCenter is changed, it will also Real-time update to the memory database, and then take the relevant data from the memory database to generate a multi-layer relational tree diagram, eliminating the need to re-acquire all the required data from vCenter, speeding up the query speed, and further saving the positioning problem And fault analysis time, which improves the efficiency of operation and maintenance management.

圖11爲本發明又一實施例提供的一種終端的示意性框圖。圖11包括接收單元111、篩選單元112、內存資料庫建立單元113、表創建單元114、樹狀圖生成單元115、查詢語句生成單元116、結果返回單元117、存儲容器創建單元118、結果保存單元119、顯示單元120。其中,接收單元111、篩選單元112、內存資料庫建立單元113、表創建單元114、樹狀圖生成單元115、查詢語句生成單元116、結果返回單元117請參看圖10實施例所描述的內容。圖11實施例與圖10實施例的區別在於:增加了存儲容器創建單元118、結果保存單元119、顯示單元120。FIG. 11 is a schematic block diagram of a terminal according to another embodiment of the present invention. FIG. 11 includes a receiving unit 111, a filtering unit 112, a memory database establishment unit 113, a table creation unit 114, a tree map generation unit 115, a query statement generation unit 116, a result return unit 117, a storage container creation unit 118, and a result storage unit. 119. Display unit 120. Among them, the receiving unit 111, the filtering unit 112, the memory database establishing unit 113, the table creating unit 114, the tree map generating unit 115, the query sentence generating unit 116, and the result returning unit 117 refer to the content described in the embodiment of FIG. The embodiment in FIG. 11 is different from the embodiment in FIG. 10 in that a storage container creation unit 118, a result storage unit 119, and a display unit 120 are added.

存儲容器創建單元118,用於接收到vCenter中發出的告警信息後,創建存儲容器。其中,創建的存儲容器可以爲一個或者多個。如接收到vCenter中發出的一個封包率突然升高的告警信息,接受到告警信息後,創建購物車,再創建購物車的籃子。其中,創建的購物車可以有多個,一個購物車可以創建多個籃子。The storage container creation unit 118 is configured to create a storage container after receiving the alarm information sent from the vCenter. Among them, one or more storage containers can be created. For example, if you receive a warning message that the packet rate suddenly rises in vCenter, after receiving the warning message, create a shopping cart, and then create a shopping basket. Among them, there can be multiple shopping carts created, and one shopping cart can create multiple baskets.

如接收到一個雲端環境中封包率突然升高的告警信息,那麽該告警信息所涉及的對象爲網路。根據接收單元111、篩選單元112、內存資料庫建立單元113、表創建單元114、樹狀圖生成單元115、查詢語句生成單元116、結果返回單元117,以輸入該告警信息所涉及的對象,根據該告警信息所涉及到的對象進行查詢得到查詢執行結果。具體地,接收單元111、篩選單元112、內存資料庫建立單元113、表創建單元114、樹狀圖生成單元115、查詢語句生成單元116、結果返回單元117可參見圖10該的實施例,具體地,請參看圖10實施例所涉及的內容,在此不再贅述。該查詢執行結果爲一條條的記錄,即爲對應的具體對象,如一個或者多個具體主機的信息,一個或者多個具體虛擬機的信息等,一個或者多個具體網路的信息等。If a warning message that the packet rate suddenly rises in a cloud environment is received, the object of the warning message is the network. According to the receiving unit 111, the filtering unit 112, the memory database establishing unit 113, the table creating unit 114, the tree map generating unit 115, the query sentence generating unit 116, and the result returning unit 117, to input the objects involved in the alarm information, according to Query the object involved in the alarm information to get the query execution result. Specifically, the receiving unit 111, the filtering unit 112, the memory database establishing unit 113, the table creating unit 114, the tree map generating unit 115, the query generating unit 116, and the result returning unit 117 can refer to the embodiment shown in FIG. For details, please refer to the content involved in the embodiment of FIG. 10, and details are not described herein again. The query execution result is a record, which is a corresponding specific object, such as information of one or more specific hosts, information of one or more specific virtual machines, and information of one or more specific networks.

結果保存單元119,用於將該告警信息所涉及到的對象的查詢執行結果保存在存儲容器中。將一次查詢的查詢執行結果保存在一個購物車的籃子裏。將多次查詢的多個查詢執行結果保存在一個購物車的多個籃子裏,或者保存在多個購物車的籃子裏。The result saving unit 119 is configured to save a query execution result of the object involved in the alarm information in a storage container. Store the query execution results of a query in the basket of a shopping cart. Save multiple query execution results of multiple queries in multiple baskets of a shopping cart, or in multiple shopping cart baskets.

接收單元111,還用於接收用戶在該查詢執行結果中選擇的檢測對象。優選地,選擇的檢測對象爲多個。具體地,可以選擇一次查詢的查詢執行結果中的多個對象,也可以選擇多個查詢的查詢執行結果中的多個對象。可以理解地,如可以在一個購物車的多個籃子裏選擇多個對象,或者在多個購物車的多個籃子裏選擇多個對象。The receiving unit 111 is further configured to receive a detection object selected by the user from the query execution result. Preferably, a plurality of detection objects are selected. Specifically, multiple objects in a query execution result of a query may be selected, and multiple objects in a query execution result of multiple queries may also be selected. Understandably, for example, multiple objects can be selected in multiple baskets of a shopping cart, or multiple objects can be selected in multiple baskets of multiple shopping carts.

顯示單元120,用於根據檢測對象生成並顯示該對象的性能曲線圖以供查找告警信息的來源。具體地,如圖12所示,顯示單元包括時間段接收單元121、性能資料獲取單元122、生成顯示單元123。時間段接收單元121,用於接收用戶輸入的要檢測的時間段。要檢測的時間可以爲一天之內的某幾個小時,也可以爲幾天,也可以爲幾個星期等。性能資料獲取單元122,用於根據檢測對象獲取該檢測對象在該時間段內的性能資料。其中,性能資料包括CPU性能、內存性能、網路性能等中的一個。生成顯示單元123,用於根據該性能資料生成並顯示檢測對象的性能曲線圖以供查找告警信息的來源。若有多個檢測對象,那麽該性能曲線圖中就會有多條曲線,將多個曲線放在一起對比,很容易發現異常曲線所對應的對象。將該異常曲線所對應的對象進行進一步的排查以供查找該告警信息的來源。The display unit 120 is configured to generate and display a performance curve graph of the object according to the detection object for searching for the source of the alarm information. Specifically, as shown in FIG. 12, the display unit includes a time period receiving unit 121, a performance data acquisition unit 122, and a generation display unit 123. The time period receiving unit 121 is configured to receive a time period to be detected input by a user. The time to be detected can be a few hours in a day, a few days, a few weeks, etc. The performance data obtaining unit 122 is configured to obtain performance data of the detection object within the time period according to the detection object. Among them, the performance data includes one of CPU performance, memory performance, and network performance. The generating and displaying unit 123 is configured to generate and display the performance curve of the detection object according to the performance data for searching for the source of the alarm information. If there are multiple detection objects, then there will be multiple curves in the performance curve graph. When multiple curves are put together and compared, it is easy to find the object corresponding to the abnormal curve. Further investigate the object corresponding to the abnormal curve to find the source of the alarm information.

上述方法實施例接收到告警信息後,選擇查詢執行結果中的檢測對象,生成並顯示該檢測對象的性能曲線圖,尤其是多個檢測對象的多個曲線圖,進一步方便用戶查詢告警信息的來源。加快了查詢的速度,更一步節省了定位問題和故障分析的時間,提高了運維管理的效率。After receiving the alarm information, the foregoing method embodiment selects the detection object in the query execution result, and generates and displays the performance curve graph of the detection object, especially the multiple graphs of multiple detection objects, further facilitating users to query the source of the alarm information . It speeds up the query, saves time for problem location and fault analysis, and improves the efficiency of operation and maintenance management.

圖13爲本發明實施例提供的一種設備的示意性框圖。該設備130包括輸入裝置131、輸出裝置132、記憶體133以及處理器134,上述輸入裝置131、輸出裝置132、記憶體133以及處理器134通過總線135連接。其中:FIG. 13 is a schematic block diagram of a device according to an embodiment of the present invention. The device 130 includes an input device 131, an output device 132, a memory 133, and a processor 134. The input device 131, the output device 132, the memory 133, and the processor 134 are connected through a bus 135. among them:

輸入裝置131,用於提供用戶輸入查詢對象、輸入要查詢的資料表和字段、輸入查詢條件等。具體實現中,本發明實施例的輸入裝置131可包括鍵盤、鼠標、光電輸入裝置、聲音輸入裝置、觸摸式輸入裝置等。The input device 131 is used for providing a user to input a query object, a data table and a field to be queried, and a query condition. In specific implementation, the input device 131 in the embodiment of the present invention may include a keyboard, a mouse, a photoelectric input device, a sound input device, a touch input device, and the like.

輸出裝置132,用於輸出多層關係樹狀圖、輸出查詢執行結果、要檢測對象的性能曲線圖等。具體實現中,本發明實施例的輸出裝置132可包括顯示器、顯示螢幕、觸碰螢幕等。The output device 132 is configured to output a multilayer relational tree diagram, output a query execution result, and a performance curve graph of an object to be detected. In specific implementation, the output device 132 according to the embodiment of the present invention may include a display, a display screen, a touch screen, and the like.

記憶體133,用於存儲帶有各種功能的程序資料。本發明實施例中記憶體133存儲的資料包括用戶輸入的查詢對象、用戶查詢對象以及與該查詢對象相關聯的所有的對象信息、資料表和資料表中的字段、多層關係樹狀圖、告警信息、創建的存儲容器、要檢測對象的性能資料等,以及其他可調用並運行的程序資料。具體實現中,本發明實施例的記憶體133可以是系統記憶體,比如,揮發性的(諸如RAM),非易失性的(諸如ROM,閃存等),或者兩者的結合。具體實現中,本發明實施例的記憶體133還可以是系統之外的外部記憶體,比如,磁碟、光碟、磁帶等。The memory 133 is used for storing program data with various functions. The data stored in the memory 133 in the embodiment of the present invention includes a query object input by a user, a user query object and all object information associated with the query object, a data table and fields in the data table, a multi-layer relationship tree diagram, and an alarm. Information, the storage container created, performance data of the object to be detected, etc., and other program data that can be called and run. In specific implementation, the memory 133 in the embodiment of the present invention may be a system memory, for example, volatile (such as RAM), non-volatile (such as ROM, flash memory, etc.), or a combination of the two. In specific implementation, the memory 133 in the embodiment of the present invention may also be external memory outside the system, such as a magnetic disk, an optical disk, a magnetic tape, and the like.

處理器134,用於調用記憶體133中存儲的程序資料,並執行如下操作:The processor 134 is configured to call the program data stored in the memory 133 and perform the following operations:

接收vCenter中用戶輸入的查詢對象;根據該查詢對象在vCenter中篩選出與該查詢對象相關聯的所有的對象信息;根據該查詢對象和該對象信息創建資料表並在資料表中插入相關資料,其中每個對象所屬的類對應一個資料表;根據該資料表和資料表中的字段生成多層關係樹狀圖;接收用戶在多層關係樹狀圖中選擇的資料表和字段,以及用戶輸入的查詢條件;根據選擇的資料表和字段,以及輸入的查詢條件生成SQL語句;執行SQL語句幷返回查詢執行結果。Receiving a query object input by a user in vCenter; filtering out all object information associated with the query object in vCenter according to the query object; creating a data table based on the query object and the object information and inserting relevant data in the data table, Each class corresponds to a data table; generates a multi-level relationship tree diagram according to the data table and the fields in the data table; receives the data tables and fields selected by the user in the multi-level relationship tree, and the query entered by the user Conditions; Generate SQL statements based on selected data tables and fields, and entered query conditions; execute SQL statements and return query execution results.

處理器134,還執行如下操作:The processor 134 further performs the following operations:

獲取每個對象所屬類的屬性和該屬性的值;將每個類的屬性轉化爲SQL語句並執行該SQL語句以創建資料表,將每個類的屬性和該屬性的值轉化爲SQL語句並執行該SQL語句以在資料表中插入資料。Get the attribute of the class to which each object belongs and the value of the attribute; convert the attribute of each class into a SQL statement and execute the SQL statement to create a data table, convert the attribute of each class and the value of the attribute into a SQL statement and Execute the SQL statement to insert data into the table.

處理器134,還執行如下操作:The processor 134 further performs the following operations:

獲取用戶輸入的查詢對象所對應的資料表的名稱;判斷是否存在該資料表的名稱;若存在該資料表的名稱,將該資料表的名稱作爲第一層節點保存;獲取該資料表的所有字段;將該資料表的所有字段作爲該資料表的名稱所對應的節點的下一層節點保存;獲取每一個字段所屬的類型;對於每一個字段,根據該字段的類型判斷該字段中是否涉及有其他資料表;若涉及有其他資料表,獲取所對應的資料表的名稱;判斷是否存在所對應的資料表的名稱;若存在該資料表的名稱,判斷是否保存有該資料表的名稱;若沒有保存該資料表的名稱,返回獲取該資料表的所有字段的步驟;若保存有該資料表的名稱或者對於每一個字段都不涉及有其他資料表,根據保存的所有節點生成多層關係樹狀圖。Get the name of the data table corresponding to the query object entered by the user; determine whether the name of the data table exists; if the name of the data table exists, save the name of the data table as a first-level node; get all of the data table Field; save all the fields of this table as the node below the node corresponding to the name of this table; get the type of each field; for each field, determine whether the field is involved according to the type of the field Other data tables; if there are other data tables, get the name of the corresponding data table; determine whether the name of the corresponding data table exists; if the name of the data table exists, determine whether the name of the data table is saved; if Without saving the name of the material table, return to the step of obtaining all the fields of the material table; if the name of the material table is saved or there is no other material table for each field, a multi-layer relationship tree is generated according to all the nodes saved Illustration.

處理器134,還執行如下操作:The processor 134 further performs the following operations:

建立內存資料庫,該內存資料庫與vCenter相連接;根據該查詢對象和該對象信息在該內存資料庫中創建資料表並在資料表中插入相關資料。A memory database is established, and the memory database is connected to vCenter; a data table is created in the memory database according to the query object and the object information, and relevant data is inserted in the data table.

處理器134,還執行如下操作:The processor 134 further performs the following operations:

接收到vCenter中發出的告警信息後,創建存儲容器;將該告警信息所涉及到的對象的查詢執行結果保存在該存儲容器中;接收用戶在該查詢執行結果中選擇的檢測對象;根據該檢測對象生成並顯示該檢測對象的性能曲線圖以供查找該告警信息的來源。After receiving the alarm information sent from vCenter, create a storage container; save the query execution results of the objects involved in the alarm information in the storage container; receive the detection objects selected by the user in the query execution results; according to the detection The object generates and displays the performance curve graph of the detection object for finding the source of the alarm information.

本發明還提供一種電腦可讀存儲介質,該電腦可讀存儲介質存儲有一個或者一個以上程序,該一個或者一個以上程序可被一個或者一個以上的處理器執行,以實現以下步驟:The present invention also provides a computer-readable storage medium. The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the following steps:

接收vCenter中用戶輸入的查詢對象;根據該查詢對象在vCenter中篩選出與該查詢對象相關聯的所有的對象信息;根據該查詢對象和該對象信息創建資料表並在資料表中插入相關資料,其中每個對象所屬的類對應一個資料表;根據該資料表生成多層關係樹狀圖;接收用戶在多層關係樹狀圖中選擇的資料表和字段,以及用戶輸入的查詢條件;根據選擇的資料表和字段,以及輸入的查詢條件生成SQL語句;執行SQL語句幷返回查詢執行結果。Receiving a query object input by a user in vCenter; filtering out all object information associated with the query object in vCenter according to the query object; creating a data table based on the query object and the object information and inserting relevant data in the data table, Each class corresponds to a data table; a multi-layer relational tree diagram is generated according to the data table; receiving the data tables and fields selected by the user in the multi-level relation tree tree and the query conditions entered by the user; Tables and fields, and input query conditions generate SQL statements; execute SQL statements and return query execution results.

優選地,該步驟還包括:Preferably, this step further includes:

獲取每個對象所屬類的屬性和該屬性的值;將每個類的屬性轉化爲SQL語句幷執行該SQL語句以創建資料表,將每個類的屬性和該屬性的值轉化爲SQL語句並執行該SQL語句以在資料表中插入資料。Get the attribute of the class to which each object belongs and the value of the attribute; convert the attribute of each class into a SQL statement; execute the SQL statement to create a data table, convert the attribute of each class and the value of the attribute into a SQL statement and Execute the SQL statement to insert data into the table.

優選地,該步驟還包括:Preferably, this step further includes:

獲取用戶輸入的查詢對象所對應的資料表的名稱;判斷是否存在該資料表的名稱;若存在該資料表的名稱,將該資料表的名稱作爲第一層節點保存;獲取該資料表的所有字段;將該資料表的所有字段作爲該資料表的名稱所對應的節點的下一層節點保存;獲取每一個字段所屬的類型;對於每一個字段,根據該字段的類型判斷該字段中是否涉及有其他資料表;若涉及有其他資料表,獲取所對應的資料表的名稱;判斷是否存在所對應的資料表的名稱;若存在該資料表的名稱,判斷是否保存有該資料表的名稱;若沒有保存該資料表的名稱,返回獲取該資料表的所有字段的步驟;若保存有該資料表的名稱或者對於每一個字段都不涉及有其他資料表,根據保存的所有節點生成多層關係樹狀圖。Get the name of the data table corresponding to the query object entered by the user; determine whether the name of the data table exists; if the name of the data table exists, save the name of the data table as a first-level node; get all of the data table Field; save all the fields of this table as the node below the node corresponding to the name of this table; get the type of each field; for each field, determine whether the field is involved according to the type of the field Other data tables; if there are other data tables, get the name of the corresponding data table; determine whether the name of the corresponding data table exists; if the name of the data table exists, determine whether the name of the data table is saved; if Without saving the name of the material table, return to the step of obtaining all the fields of the material table; if the name of the material table is saved or there is no other material table for each field, a multi-layer relationship tree is generated according to all the nodes saved Illustration.

優選地,該步驟還包括:Preferably, this step further includes:

建立內存資料庫,該內存資料庫與vCenter相連接;根據該查詢對象和該對象信息在該內存資料庫中創建資料表並在資料表中插入相關資料。A memory database is established, and the memory database is connected to vCenter; a data table is created in the memory database according to the query object and the object information, and relevant data is inserted in the data table.

優選地,該步驟還包括:Preferably, this step further includes:

接收到vCenter中發出的告警信息後,創建存儲容器;將該告警信息所涉及到的對象的查詢執行結果保存在該存儲容器中;接收用戶在該查詢執行結果中選擇的檢測對象;根據該檢測對象生成並顯示該檢測對象的性能曲線圖以供查找該告警信息的來源。After receiving the alarm information sent from vCenter, create a storage container; save the query execution results of the objects involved in the alarm information in the storage container; receive the detection objects selected by the user in the query execution results; according to the detection The object generates and displays the performance curve graph of the detection object for finding the source of the alarm information.

所屬領域的技術人員可以清楚地瞭解到,爲了描述的方便和簡潔,上述描述的終端和單元的具體工作過程,可以參考前述方法實施例中的對應過程,在此不再贅述。本領域普通技術人員可以意識到,結合本文中所公開的實施例描述的各示例的單元及算法步驟,能够以電子硬體、電腦軟體或者二者的結合來實現,爲了清楚地說明硬體和軟體的可互換性,在上述說明中已經按照功能一般性地描述了各示例的組成及步驟。這些功能究竟以硬件還是軟體方式來執行取決於技術方案的特定應用和設計約束條件。專業技術人員可以對每個特定的應用來使用不同方法來實現所描述的功能,但是這種實現不應認爲超出本發明的範圍。Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working processes of the terminals and units described above can refer to the corresponding processes in the foregoing method embodiments, and are not repeated here. Those of ordinary skill in the art may realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the hardware and The interchangeability of software. In the above description, the composition and steps of each example have been described generally in terms of functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

在本申請所提供的幾個實施例中,應該理解到,所揭露的終端和方法,可以通過其它的方式實現。例如,以上所描述的裝置實施例僅僅係是示意性的,例如,該單元的劃分,僅僅爲一種邏輯功能劃分,實際實現時可以有另外的劃分方式,例如多個單元或組件可以結合或者可以集成到另一個系統,或一些特徵可以忽略,或不執行。另外,所顯示或討論的相互之間的耦合或直接耦合或通信連接可以是通過一些介面、裝置或單元的間接耦合或通信連接,也可以是電的,機械的或其它的形式連接。In the several embodiments provided in this application, it should be understood that the disclosed terminals and methods may be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner. For example, multiple units or components may be combined or may be combined. Integration into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices, or units, or may be electrical, mechanical, or other forms of connection.

該作爲分離部件說明的單元可以是或者也可以不是物理上分開的,作爲單元顯示的部件可以是或者也可以不是物理單元,即可以位於一個地方,或者也可以分布到多個網路單元上。可以根據實際的需要選擇其中的部分或者全部單元來實現本發明實施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments of the present invention.

另外,在本發明各個實施例中的各功能單元可以集成在一個處理單元中,也可以是各個單元單獨物理存在,也可以是兩個或兩個以上單元集成在一個單元中。上述集成的單元既可以採用硬體的形式實現,也可以採用軟體功能單元的形式實現。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist separately physically, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional unit.

該集成的單元如果以軟體功能單元的形式實現並作爲獨立的産品銷售或使用時,可以存儲在一個電腦可讀取存儲介質中。基於這樣的理解,本發明的技術方案本質上或者說對現有技術做出貢獻的部分,或者該技術方案的全部或部分可以以軟體産品的形式體現出來,該電腦軟體産品存儲在一個存儲介質中,包括若干指令用以使得一台電腦設備 ( 可以是個人電腦,服務器,或者網路設備等 ) 執行本發明各個實施例該方法的全部或部分步驟。而前述的存儲介質包括 :USD隨身碟、移動硬碟、只讀記憶體 (ROM,Read-Only Memory)、隨機存取記憶體 (RAM,Random Access Memory)、磁碟或者光碟等各種可以存儲程序代碼的介質。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially a part that contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium. , Including a plurality of instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method in each embodiment of the present invention. The aforementioned storage medium includes: various kinds of programs that can be stored, such as a USD flash drive, a removable hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk, or an optical disk. The medium of the code.

以上該,僅爲本發明的具體實施方式,但本發明的保護範圍並不侷限於此,任何熟悉本技術領域的技術人員在本發明揭露的技術範圍內,可輕易想到各種等效的修改或替換,這些修改或替換都應涵蓋在本發明的保護範圍之內。因此,本發明的保護範圍應以權利要求的保護範圍爲准。The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited to this. Any person skilled in the art can easily think of various equivalent modifications or within the technical scope disclosed by the present invention. Instead, these modifications or replacements should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

100‧‧‧終端100‧‧‧Terminal

101‧‧‧接收單元101‧‧‧Receiving unit

102‧‧‧篩選單元102‧‧‧ Screening Unit

103‧‧‧內存資料庫建立單元103‧‧‧Memory database creation unit

104‧‧‧表創建單元104‧‧‧Table creation unit

105‧‧‧樹狀圖生成單元105‧‧‧Tree Map Generation Unit

106‧‧‧查詢語句生成單元106‧‧‧Query unit

107‧‧‧結果返回單元107‧‧‧Result return unit

111‧‧‧接收單元111‧‧‧Receiving unit

112‧‧‧篩選單元112‧‧‧Screening Unit

113‧‧‧內存資料庫建立單元113‧‧‧Memory database creation unit

114‧‧‧表創建單元114‧‧‧Table creation unit

115‧‧‧樹狀圖生成單元115‧‧‧Tree Map Generation Unit

116‧‧‧查詢語句生成單元116‧‧‧Query unit

117‧‧‧結果返回單元117‧‧‧Result return unit

118‧‧‧存儲容器創建單元118‧‧‧Storage Container Creation Unit

119‧‧‧結果保存單元119‧‧‧Result storage unit

120‧‧‧顯示單元120‧‧‧display unit

121‧‧‧時間段接收單元121‧‧‧Time period receiving unit

122‧‧‧性能資料獲取單元122‧‧‧Performance data acquisition unit

123‧‧‧生成顯示單元123‧‧‧ Generate display unit

130‧‧‧設備130‧‧‧ Equipment

131‧‧‧輸入裝置131‧‧‧ input device

132‧‧‧輸出裝置132‧‧‧Output device

133‧‧‧記憶體133‧‧‧Memory

134‧‧‧處理器134‧‧‧Processor

135‧‧‧總線135‧‧‧Bus

70‧‧‧終端70‧‧‧ terminal

701‧‧‧接收單元701‧‧‧Receiving unit

702‧‧‧篩選單元702‧‧‧Screening Unit

703‧‧‧表創建單元703‧‧‧Table creation unit

704‧‧‧樹狀圖生成單元704‧‧‧Tree Map Generation Unit

705‧‧‧查詢語句生成單元705‧‧‧Query unit generation unit

706‧‧‧結果返回單元706‧‧‧Result return unit

801‧‧‧第一字段獲取單元801‧‧‧First field acquisition unit

802‧‧‧轉化執行單元802‧‧‧ Transformation Execution Unit

901‧‧‧表名稱獲取單元901‧‧‧ table name acquisition unit

902‧‧‧判斷單元902‧‧‧judgment unit

903‧‧‧第二字段獲取單元903‧‧‧Second field acquisition unit

904‧‧‧節點保存單元904‧‧‧node preservation unit

905‧‧‧多層關係樹狀圖生成單元905‧‧‧multi-layer relation tree diagram generating unit

S101‧‧‧接收在vCenter中用戶輸入的查詢對象S101‧‧‧ receives the query object input by the user in vCenter

S102‧‧‧根據該查詢對象在vCenter中篩選出與該查詢對象相關聯的所有的對象信息S102‧‧‧ Filter out all object information associated with the query object in vCenter according to the query object

S103‧‧‧根據該查詢對象和該查詢對象相關聯的所有對象信息創建資料表並在資料表中插入相關資料S103‧‧‧ creates a data table based on the query object and all object information associated with the query object and inserts related data in the data table

S104‧‧‧根據資料表和資料表中的字段生成多層關係樹狀圖S104‧‧‧ Generate multi-layer relationship tree diagram based on the data table and the fields in the data table

S105‧‧‧接收用戶在多層關係樹狀圖中選擇的資料表和字段,以及用戶輸入的查詢條件S105‧‧‧ Receives the data tables and fields selected by the user in the multi-layer relationship tree and the query conditions entered by the user

S106‧‧‧根據選擇的資料表和字段,以及輸入的查詢條件生成SQL語句S106‧‧‧ Generate SQL statements according to the selected data table and field and the input query conditions

S107‧‧‧執行SQL語句幷返回查詢執行結果S107‧‧‧Execute SQL statement and return query execution result

S301‧‧‧獲取用戶輸入的查詢對象所對應的資料表的名稱S301‧‧‧Get the name of the data table corresponding to the query object entered by the user

S302‧‧‧判斷是否存在該資料表的名稱S302‧‧‧Judging whether the name of the data table exists

S303‧‧‧獲取該資料表的所有字段及各個字段所屬的類型S303‧‧‧Get all fields of the data sheet and the type of each field

S304‧‧‧將該資料表的名稱作爲樹狀圖的根節點,將各個字段作爲該根節點的子節點進行保存S304‧‧‧ Use the name of the data table as the root node of the treemap, and save each field as a child node of the root node

S305‧‧‧對於每一個字段,根據字段的類型判斷該字段中是否涉及有其他資料表S305‧‧‧ For each field, determine whether there are other data tables in the field according to the type of field

S306‧‧‧判斷是否存在對應的資料表的名稱S306‧‧‧ Judging whether the name of the corresponding data table exists

S307‧‧‧判斷保存的節點中是否有對應的資料表的名稱S307‧‧‧ judge whether the corresponding data table name exists in the saved node

S308‧‧‧將該資料表的所有字段作爲當前字段所對應的節點的下一層節點進行保存,依此類推,直到樹狀圖的每一層節點對應的字段均不涉及其他資料表S308‧‧‧ Save all the fields of the data table as the next layer node of the node corresponding to the current field, and so on, until the field corresponding to each layer node of the tree diagram does not involve other data tables

S309‧‧‧根據保存的所有節點生成多層關係樹狀圖S309‧‧‧ Generates a multi-layer relational tree diagram based on all saved nodes

S401‧‧‧接收在vCenter中用戶輸入的查詢對象S401‧‧‧ receives query objects input by the user in vCenter

S402‧‧‧根據該查詢對象在vCenter中篩選出與該查詢對象相關聯的所有的對象信息S402 ‧‧‧ Filter out all object information associated with the query object in vCenter according to the query object

S403‧‧‧建立內存資料庫,該內存資料庫與vCenter相連接S403‧‧‧ Establish a memory database, which is connected to vCenter

S404‧‧‧根據該查詢對象和該查詢對象相關聯的所有對象信息在內存資料庫中創建資料表並在數據表中插入相關資料S404‧‧‧ creates a data table in the memory database according to the query object and all object information associated with the query object and inserts related data in the data table

S405‧‧‧根據資料表和資料表中的字段生成多層關係樹狀圖S405‧‧‧ Generate multi-layer relationship tree diagram based on the data table and the fields in the data table

S406‧‧‧接收用戶在多層關係樹狀圖中選擇的資料表和字段,以及用戶輸入的查詢條件S406‧‧‧ Receives the data tables and fields selected by the user in the multi-layer relationship tree and the query conditions entered by the user

S407‧‧‧根據選擇的資料表和字段,以及輸入的查詢條件生成SQL語句S407‧‧‧ generates SQL statements according to the selected data table and field and the input query conditions

S408‧‧‧在內存資料庫中執行SQL語句並返回查詢執行結果。該查詢執行結果爲一條條的記錄,如一個或者多個具體主機的信息,一個或者多個具體虛擬機的信息等,一個或者多個具體網路的信息等S408‧‧‧ executes the SQL statement in the memory database and returns the query execution result. The query execution result is a record, such as one or more specific host information, one or more specific virtual machine information, etc., one or more specific network information, etc.

S501‧‧‧接收到vCenter中發出的告警信息後,創建存儲容器。其中,創建的存儲容器可以爲一個或者多個S501‧‧‧ creates a storage container after receiving the alarm information sent from the vCenter. Among them, one or more storage containers can be created

S502‧‧‧將該告警信息所涉及到的對象的查詢執行結果保存在存儲容器中S502‧‧‧ saves the query execution result of the object involved in the alarm information in a storage container

S503‧‧‧接收用戶在該查詢執行結果中選擇的檢測對象S503‧‧‧ receives the detection object selected by the user in the query execution result

S504‧‧‧根據檢測對象生成並顯示該對象的性能曲線圖以供查找告警信息的來源S504‧‧‧ Generates and displays the performance curve of the object according to the detection object for finding the source of the alarm information

[圖1] 係本發明實施例提供的一種關聯信息查詢方法的示意流程圖。 [圖2] 係本發明實施例提供的一種關聯信息查詢方法的一個子流程示意圖。 [圖3] 係本發明實施例提供的一種關聯信息查詢方法的另一個子流程示意圖。 [圖4] 係本發明另一實施例提供的一種關聯信息查詢方法的示意流程圖。 [圖5] 係本發明又一實施例提供的一種關聯信息查詢方法的示意流程圖。 [圖6] 係本發明又一實施例提供的一種關聯信息查詢方法的一個子流程示意圖。 [圖7] 係本發明實施例提供的一種終端的示意性框圖。 [圖8] 係本發明實施例提供的表創建單元的示意性框圖。 [圖9] 係本發明實施例提供的樹狀圖生成單元的示意性框圖。 [圖10] 係本發明另一實施例提供的一種終端的示意性框圖。 [圖11] 係本發明又一實施例提供的一種終端的示意性框圖。 [圖12] 爲本發明實施例提供的顯示單元的示意性框圖。 [圖13] 係本發明實施例提供的一種設備的示意性框圖。[FIG. 1] It is a schematic flowchart of an association information query method according to an embodiment of the present invention. [FIG. 2] It is a schematic diagram of a sub-flow of a method for querying association information according to an embodiment of the present invention. 3 is a schematic diagram of another sub-flow of a method for querying related information according to an embodiment of the present invention. 4 is a schematic flowchart of an association information query method according to another embodiment of the present invention. 5 is a schematic flowchart of an association information query method according to another embodiment of the present invention. [Fig. 6] Fig. 6 is a schematic diagram of a sub-flow of a method for querying association information according to another embodiment of the present invention. 7 is a schematic block diagram of a terminal according to an embodiment of the present invention. 8 is a schematic block diagram of a table creation unit provided by an embodiment of the present invention. [FIG. 9] A schematic block diagram of a tree map generating unit according to an embodiment of the present invention. [FIG. 10] A schematic block diagram of a terminal according to another embodiment of the present invention. [FIG. 11] A schematic block diagram of a terminal according to another embodiment of the present invention. 12 is a schematic block diagram of a display unit according to an embodiment of the present invention. 13 is a schematic block diagram of a device according to an embodiment of the present invention.

Claims (10)

一種關聯信息查詢方法,其中,該方法包括:   接收在虛擬化管理服務器平臺(VMware vCenter Server,簡稱vCenter)中用戶輸入的查詢對象;   根據該查詢對象在vCenter中篩選出與該查詢對象相關聯的所有的對象信息;   根據該查詢對象和該對象信息創建資料表並在資料表中插入相關資料,其中每個對象所屬的類對應一個資料表;   根據該資料表和資料表中的字段生成多層關係樹狀圖;   接收用戶在多層關係樹狀圖中選擇的資料表和字段,以及用戶輸入的查詢條件;   根據選擇的資料表和字段,以及輸入的查詢條件生成結構化查詢語言 (Structured Query Language,SQL)語句;   執行SQL語句幷返回查詢執行結果。A related information query method, wherein the method includes: receiving a query object input by a user in a virtualized management server platform (VMware vCenter Server, vCenter for short); 筛选 filtering in vCenter based on the query object that is associated with the query object All the object information; 创建 create a data table based on the query object and the object information and insert relevant data in the data table, where each object belongs to a data table; 生成 generate a multi-level relationship based on the data table and the fields in the data table Treemap; Receive the data tables and fields selected by the user in the multi-layer relational treemap and the query conditions entered by the user; 生成 Generate a Structured Query Language (Structured Query Language, based on the selected data tables and fields and the entered query conditions) SQL) statement; Execute SQL statement and return query execution results. 如申請專利範圍第1項該的方法,其中,根據該查詢對象和該對象信息創建資料表並在資料表中插入相關資料,包括:   獲取每個對象所屬類的屬性和該屬性的值;   將每個類的屬性轉化爲SQL語句並執行該SQL語句以創建資料表,將每個類的屬性和該屬性的值轉化爲SQL語句並執行該SQL語句以在資料表中插入資料。For example, the method according to item 1 of the scope of patent application, in which a data table is created according to the query object and the object information and relevant data is inserted in the data table, including: obtaining the attribute of each class to which the object belongs and the value of the attribute; Attributes of each class are converted into SQL statements and the SQL statements are executed to create a data table. Attributes of each class and values of the attributes are converted into SQL statements and the SQL statements are executed to insert data into the data table. 如申請專利範圍第1項該的方法,其中,根據該資料表和資料表中的字段生成多層關係樹狀圖,包括:   獲取用戶輸入的查詢對象所對應的資料表的名稱;   判斷是否存在該資料表的名稱;   若存在該資料表的名稱,則獲取該資料表的所有字段及各個字段所屬的類型;   將該資料表的名稱作爲該樹狀圖的根節點,將該各個字段作爲該根節點的子節點進行保存;   根據該字段的類型判斷該字段中是否涉及有其他資料表;   若涉及有其他資料表,則判斷是否存在對應的資料表的名稱;若存在該資料表的名稱,判斷保存的節點中是否有該資料表的名稱;   若保存的節點中沒有該資料表的名稱,則將該資料表的所有字段作爲當前字段所對應的節點的下一層節點進行保存,依此類推,直到該樹狀圖的每一層節點對應的字段均不涉及其他資料表;   根據保存的所有節點生成多層關係樹狀圖。For example, the method according to item 1 of the scope of patent application, wherein the multi-layer relationship tree diagram is generated according to the data table and the fields in the data table, including: obtaining the name of the data table corresponding to the query object entered by the user; determining whether the data table exists The name of the data table; If the name of the data table exists, get all the fields of the data table and the type of each field; Use the name of the data table as the root node of the treemap, and use each field as the root The child nodes of the node are saved; 判断 judge whether there are other data tables in the field according to the type of the field; if there are other data tables, determine whether the name of the corresponding data table exists; if the name of the data table exists, determine Whether the saved table has the name of the table; If the saved node does not have the name of the table, all fields of the table are saved as the next-level node of the node corresponding to the current field, and so on, Until the field corresponding to each layer node of the treemap does not involve other resources Table; multi-layer tree is generated according to the relationship between all the nodes stored. 如申請專利範圍第1-3項中任一項該的方法,其中,在根據該查詢對象和該對象信息創建資料表並在資料表中插入相關資料的步驟之前,該方法還包括:   建立內存資料庫,該內存資料庫與vCenter相連接;   根據該查詢對象和該對象信息創建資料表並在資料表中插入相關資料,包括:根據該查詢對象和該對象信息在該內存資料庫中創建資料表並在資料表中插入相關資料;   執行SQL語句幷返回查詢執行結果,包括:在內存資料庫中執行SQL語句並返回查詢執行結果。The method according to any one of claims 1 to 3, wherein before the step of creating a data table based on the query object and the object information and inserting related data in the data table, the method further includes: establishing a memory Database, the memory database is connected to vCenter; 创建 create a data table based on the query object and the object information and insert relevant data in the data table, including: creating data in the memory database according to the query object and the object information Table and insert relevant information in the data table; execute SQL statements 幷 return query execution results, including: execute SQL statements in the memory database and return query execution results. 如申請專利範圍第4項該的方法,其中,該方法還包括:   接收到vCenter中發出的告警信息後,創建存儲容器;   將該告警信息所涉及到的對象的查詢執行結果保存在該存儲容器中;   接收用戶在該查詢執行結果中選擇的檢測對象;   根據該檢測對象生成並顯示該檢測對象的性能曲線圖以供查找該告警信息的來源。For example, the method of claim 4 in the scope of patent application, wherein the method further includes: 创建 creating a storage container after receiving the alarm information sent from the vCenter; 保存 saving the query execution result of the object involved in the alarm information in the storage container Medium; receiving the detection object selected by the user in the query execution result; 生成 generating and displaying a performance curve of the detection object according to the detection object for finding the source of the alarm information. 一種終端,其中,該終端包括:   接收單元,用於接收在vCenter中用戶輸入的查詢對象;   篩選單元,用於根據該查詢對象在vCenter中篩選出與該查詢對象相關聯的所有的對象信息;   表創建單元,用於根據該查詢對象和該對象信息創建資料表並在資料表中插入相關資料,其中每個對象所屬的類對應一個資料表;   樹狀圖生成單元,用於根據該資料表和資料表中的字段生成多層關係樹狀圖;   該接收單元,還用於接收用戶在多層關係樹狀圖中選擇的資料表和字段,以及用戶輸入的查詢條件;   查詢語句生成單元,用於根據選擇的資料表和字段,以及輸入的查詢條件生成SQL語句;   結果返回單元,用于執行SQL語句並返回查詢執行結果。A terminal, wherein the terminal includes: a receiving unit for receiving a query object input by a user in vCenter; a filtering unit for filtering all the object information associated with the query object in vCenter according to the query object; A table creation unit is used to create a data table based on the query object and the object information and insert related data into the data table, wherein each object belongs to a class corresponding to a data table; Generate a multi-level relational tree diagram with fields in the data table; The receiving unit is also used to receive the data tables and fields selected by the user in the multi-level relational tree diagram, as well as the query conditions entered by the user; A query statement generating unit, which is used for Generate SQL statements based on selected data tables and fields, and input query conditions; ; Result return unit, used to execute SQL statements and return query execution results. 如申請專利範圍第6項該的終端,其中,該表創建單元包括第一字段獲取單元、轉化執行單元;其中,   該第一字段獲取單元,用於獲取每個對象所屬類的屬性和該屬性的值;   該轉化執行單元,用於將每個類的屬性轉化爲SQL語句並執行該SQL語句以創建資料表,將每個類的屬性和該屬性的值轉化爲SQL語句並執行該SQL語句以在資料表中插入資料。For example, the terminal according to item 6 of the scope of patent application, wherein the table creation unit includes a first field acquisition unit and a transformation execution unit; wherein, the first field acquisition unit is used to acquire the attributes of the class to which each object belongs and the attributes The conversion execution unit is used to convert the attributes of each class into a SQL statement and execute the SQL statement to create a data table, convert the attributes of each class and the value of the attribute into a SQL statement and execute the SQL statement To insert data into the table. 如申請專利範圍第6項該的終端,其中,該樹狀圖生成單元包括表名稱獲取單元、判斷單元、第二字段獲取單元、節點保存單元、多層關係樹狀圖生成單元;其中,   該表名稱獲取單元,用於獲取用戶輸入的查詢對象所對應的資料表的名稱;     該判斷單元,用於判斷是否存在該資料表的名稱;   該第二字段獲取單元,用於若存在該資料表的名稱,則獲取該數資料表的所有字段及各個字段所屬的類型;   該節點保存單元,用於將該資料表的名稱作爲該樹狀圖的根節點,將該各個字段作爲該根節點的子節點進行保存;   該判斷單元,還用於根據該字段的類型判斷該字段中是否涉及有其他資料表;若涉及有其他資料表,則判斷是否存在對應的資料表的名稱;以及若存在該資料表的名稱,判斷保存的節點中是否有該資料表的名稱;   該節點保存單元,還用於若保存的節點中沒有該資料表的名稱,則將該資料表的所有字段作爲當前字段所對應的節點的下一層節點進行保存,依此類推,直到該樹狀圖的每一層節點對應的字段均不涉及其他資料表;   該多層關係樹狀圖生成單元,用於根據保存的所有節點生成多層關係樹狀圖。For example, the terminal according to item 6 of the scope of patent application, wherein the tree diagram generating unit includes a table name obtaining unit, a judgment unit, a second field obtaining unit, a node saving unit, and a multi-layer relationship tree diagram generating unit; wherein, the table A name obtaining unit is used to obtain the name of the data table corresponding to the query object entered by the user; 判断 the judgment unit is used to determine whether the name of the data table exists; the second field obtaining unit is used to Name, get all the fields of the data table and the type of each field; 节点 The node save unit is used to use the name of the data table as the root node of the treemap, and use each field as a child of the root node Node to save; the judgment unit is also used to determine whether there are other data tables in the field according to the type of the field; if other data tables are involved, determine whether the name of the corresponding data table exists; and if the data exists The name of the table, to determine whether the saved table has the name of the table; The node saving unit is also used to save all the fields of the data table as the node next to the node corresponding to the current field if the saved node does not have the name of the data table, and so on until the tree diagram The field corresponding to each layer of nodes does not involve other data tables; The multi-layer relationship tree diagram generating unit is used to generate a multi-layer relationship tree diagram according to all the nodes saved. 如申請專利範圍第6-8項中任一項該的終端,其中,該終端還包括存儲容器創建單元、結果保存單元、顯示單元;其中,   該存儲容器創建單元,用於接收到vCenter中發出的告警信息後,創建存儲容器;   該結果保存單元,用於將該告警信息所涉及到的對象的查詢執行結果保存在該存儲容器中;   該接收單元,還用於接收用戶在該查詢執行結果中選擇的檢測對象;   該顯示單元,用於根據該檢測對象生成並顯示該檢測對象的性能曲線圖以供查找該告警信息的來源。For example, the terminal according to any one of claims 6-8 of the scope of patent application, wherein the terminal further includes a storage container creation unit, a result storage unit, and a display unit; wherein, the storage container creation unit is configured to receive a message sent from vCenter Create a storage container after the alarm information is generated; The result storage unit is used to save the query execution result of the object involved in the alarm information in the storage container; The receiving unit is also used to receive the user's query execution result The detection object selected in the method; The display unit is configured to generate and display the performance curve of the detection object according to the detection object for finding the source of the alarm information. 一種設備,其中,該設備包括處理器,以及與該處理器相連的記憶體;   該記憶體,用於存儲包括包括用戶輸入的查詢對象、該查詢對象以及與該查詢對象相關聯的所有的對象信息、資料表和資料表中的字段、多層關係樹狀圖,以及其他可調用並運行的程序資料;   該處理器,用於調用該記憶體中存儲的程序資料,並執行如下步驟:   接收在vCenter中用戶輸入的查詢對象;   根據該查詢對象在vCenter中篩選出與該查詢對象相關聯的所有的對象信息;   根據該查詢對象和該對象信息創建資料表並在資料表中插入相關資料,其中每個對象所屬的類對應一個資料表;   根據該資料表和資料表中的字段生成多層關係樹狀圖;   接收用戶在多層關係樹狀圖中選擇的資料表和字段,以及用戶輸入的查詢條件;   根據選擇的資料表和字段,以及輸入的查詢條件生成SQL語句;   執行SQL語句並返回查詢執行結果。A device, wherein the device includes a processor and a memory connected to the processor; the memory is used to store a query object including a user input, the query object, and all objects associated with the query object Information, data tables and fields in the data tables, multi-layer relationship tree diagram, and other program data that can be called and run; 运行 The processor is used to call the program data stored in the memory, and execute the following steps: Receive the Query objects entered by users in vCenter; 筛选 Filter out all object information associated with the query object in vCenter according to the query object; 创建 create a data table based on the query object and the object information and insert relevant data in the data table, where The class to which each object belongs corresponds to a data table; 生成 Generate a multi-level relational tree diagram according to the data table and the fields in the data table; Receive the data tables and fields selected by the user in the multi-level relation tree and the query conditions entered by the user ; According to the selected data sheet and field, And input query conditions to generate SQL statements; Execute SQL statements and return query execution results.
TW106138204A 2017-05-10 2017-11-03 Related information query method, terminal and device TWI650659B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
??201710326709.4 2017-05-10
CN201710326709.4A CN107665228B (en) 2017-05-10 2017-05-10 Associated information query method, terminal and equipment

Publications (2)

Publication Number Publication Date
TW201901491A true TW201901491A (en) 2019-01-01
TWI650659B TWI650659B (en) 2019-02-11

Family

ID=61122524

Family Applications (1)

Application Number Title Priority Date Filing Date
TW106138204A TWI650659B (en) 2017-05-10 2017-11-03 Related information query method, terminal and device

Country Status (3)

Country Link
CN (1) CN107665228B (en)
TW (1) TWI650659B (en)
WO (1) WO2018205376A1 (en)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108363785A (en) * 2018-02-12 2018-08-03 平安科技(深圳)有限公司 Data relationship methods of exhibiting, device, computer equipment and storage medium
CN108389079A (en) * 2018-02-13 2018-08-10 腾讯科技(深圳)有限公司 The formulation of charging policy and querying method, device, terminal and readable storage medium storing program for executing
CN109144997A (en) * 2018-06-11 2019-01-04 玖富金科控股集团有限责任公司 Data correlation method, device and storage medium
CN109840257B (en) * 2018-12-15 2023-11-21 中国平安人寿保险股份有限公司 Database query method, database query device, computer device and readable storage medium
CN109918394B (en) * 2019-01-23 2023-11-28 中国平安人寿保险股份有限公司 Data query method, system, computer device and computer readable storage medium
CN109933602B (en) * 2019-02-28 2021-05-04 武汉大学 Method and device for converting natural language and structured query language
CN111723245B (en) * 2019-03-18 2024-04-26 阿里巴巴集团控股有限公司 Method for establishing association relation of different types of storage objects in data storage system
CN112559538A (en) * 2020-11-11 2021-03-26 中广核工程有限公司 Incidence relation generation method and device, computer equipment and storage medium
CN112597171A (en) * 2020-12-31 2021-04-02 平安银行股份有限公司 Table relation visualization method and device, electronic equipment and storage medium
CN112818007B (en) * 2021-02-03 2021-10-19 中科驭数(北京)科技有限公司 Data processing method and device and readable storage medium
CN113392105B (en) * 2021-05-24 2023-03-24 国网河北省电力有限公司衡水供电分公司 Service data processing method and terminal equipment
CN113468003B (en) * 2021-06-18 2023-06-02 上海芷锐电子科技有限公司 Tree-shaped display and operation system and method for chip test data
CN113297255B (en) * 2021-06-23 2023-01-24 建信金融科技有限责任公司 Data processing method and device
CN113407548B (en) * 2021-08-18 2021-11-19 南京网觉软件有限公司 Big data query method, system and medium based on ClickHouse dictionary table
CN114116866A (en) * 2021-11-22 2022-03-01 广州新科佳都科技有限公司 Data acquisition method and device, terminal equipment and storage medium
CN115757400B (en) * 2022-11-07 2023-06-13 北京国电通网络技术有限公司 Data table processing method, device, electronic equipment and computer readable medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU5755300A (en) * 1999-06-22 2001-01-09 Internet Dynamics, Inc. Query interface to policy server
US6950823B2 (en) * 2002-12-23 2005-09-27 International Business Machines Corporation Transparent edge-of-network data cache
US7844608B2 (en) * 2006-12-15 2010-11-30 Yahoo! Inc. Clustered query support for a database query engine
CN100568244C (en) * 2007-10-31 2009-12-09 金蝶软件(中国)有限公司 A kind of method and system of data base dynamic inquiry
US8392473B2 (en) * 2010-09-07 2013-03-05 Microgen Aptitude Limited Fast hierarchical enrichment
CN102646111A (en) * 2012-02-16 2012-08-22 中国测绘科学研究院 Knowledge base-based fast construction method of common correlation information query tree
CN104615602B (en) * 2013-11-05 2019-09-20 深圳力维智联技术有限公司 Query interface automatically generates realization device and its method
JP6307169B2 (en) * 2014-03-10 2018-04-04 インターナ, インコーポレイテッドInterana, Inc. System and method for rapid data analysis

Also Published As

Publication number Publication date
TWI650659B (en) 2019-02-11
WO2018205376A1 (en) 2018-11-15
CN107665228A (en) 2018-02-06
CN107665228B (en) 2019-12-20

Similar Documents

Publication Publication Date Title
TWI650659B (en) Related information query method, terminal and device
US11797618B2 (en) Data fabric service system deployment
US11893703B1 (en) Precise manipulation of virtual object position in an extended reality environment
US11645471B1 (en) Determining a relationship recommendation for a natural language request
US11410403B1 (en) Precise scaling of virtual objects in an extended reality environment
US20140012988A1 (en) Provisioning computer resources on a network
US11699268B1 (en) Techniques for placement of extended reality objects relative to physical objects in an extended reality environment
CN112181704A (en) Big data task processing method and device, electronic equipment and storage medium
US10187264B1 (en) Gateway path variable detection for metric collection
US8694918B2 (en) Conveying hierarchical elements of a user interface
US11276236B1 (en) Techniques for placement of extended reality objects relative to other extended reality objects in an extended reality environment
US11775584B1 (en) Dynamically scaling query plan operations for query processing
CN117827835A (en) Database management method, device, equipment and medium