一种关联信息查询方法、终端、服务器管理系统及计算机可读存储介质
Associated information query method, terminal, server management system and computer readable storage medium
技术领域Technical field
本发明涉及信息技术领域,尤其涉及一种关联信息查询方法、终端、服务器管理系统及计算机可读存储介质。The present invention relates to the field of information technology, and in particular, to a related information query method, a terminal, a server management system, and a computer readable storage medium.
背景技术Background technique
虚拟机软件(VMware)的运维人员管理虚拟机(VM)时,当服务器异常时如负载太高或硬件维护或平时运维VM的时候需要找出异常所在的地方如哪台服务器出了异常。现有技术是,运维人员通常要在虚拟机集成容器的客户端(VSphere
client)或者虚拟机集成容器的网页客户端(VSphere web
client)花大量的时间查询相关信息,然后去定位问题,在这个过程中要获取很多相关信息的表,再对这个表进行分析和关联,最终获得一张有用的表。然而在云环境中,VM的数量众多,运维人员定位问题的难度随之加大,运维的效率就自然降低了。这对于平时的运维管理和故障分析都是十分不利的。When the operation and maintenance personnel of the virtual machine software (VMware) manage the virtual machine (VM), when the server is abnormal, such as when the load is too high or the hardware is maintained or the VM is operated and operated normally, it is necessary to find out where the abnormality is, such as which server is abnormal. . In the prior art, the operation and maintenance personnel usually have to be in the client of the virtual machine integration container (VSphere).
Client) or the web client of the virtual machine integration container (VSphere web)
Client) spends a lot of time querying relevant information, then locates the problem, in the process to obtain a table of many related information, then analyze and correlate the table, and finally get a useful table. However, in the cloud environment, the number of VMs is large, and the difficulty of the operation and maintenance personnel positioning problem is increased, and the efficiency of operation and maintenance is naturally reduced. This is very unfavorable for normal operation and maintenance management and fault analysis.
发明内容Summary of the invention
本发明实施例提供了一种关联信息查询方法、终端、服务器管理系统及计算机可读存储介质,可以将定位问题中的查询对象和查询对象的所有相关联对象显示在多层关系树状图中,再根据多层关系树状图中的信息进行查询得到查询结果,节省了定位问题和故障分析的时间,提高了运维管理的效率。The embodiment of the invention provides a related information query method, a terminal, a server management system and a computer readable storage medium, which can display the query object in the positioning problem and all associated objects of the query object in a multi-layer relationship tree diagram. Then, according to the information in the multi-layer relationship tree diagram, the query result is obtained, which saves the positioning problem and the time of fault analysis, and improves the efficiency of operation and maintenance management.
第一方面,本发明实施例提供了一种关联信息查询方法,该方法包括:In a first aspect, an embodiment of the present invention provides a method for querying related information, where the method includes:
接收在vCenter中用户输入的查询对象;Receive query objects entered by users in vCenter;
根据所述查询对象在vCenter中筛选出与所述查询对象相关联的所有的对象信息;Filtering, in the vCenter, all object information associated with the query object according to the query object;
根据所述查询对象和所述对象信息创建数据表并在数据表中插入相关数据,其中每个对象所属的类对应一个数据表;Creating a data table according to the query object and the object information, and inserting related data in the data table, wherein each class to which the object belongs corresponds to one data table;
根据所述数据表和数据表中的字段生成多层关系树状图;Generating a multi-layer relationship tree according to the fields in the data table and the data table;
接收用户在多层关系树状图中选择的数据表和字段,以及用户输入的查询条件;Receiving data tables and fields selected by the user in the multi-layer relationship tree, and query conditions input by the user;
根据选择的数据表和字段,以及输入的查询条件生成结构化查询语言SQL语句;Generate a structured query language SQL statement according to the selected data table and field, and the input query condition;
执行SQL语句并返回查询执行结果。Execute the SQL statement and return the query execution result.
第二方面,本发明实施例提供了一种终端,该终端包括:In a second aspect, an embodiment of the present invention provides a terminal, where the terminal includes:
接收单元,用于接收在vCenter中用户输入的查询对象;a receiving unit, configured to receive a query object input by a user in the vCenter;
筛选单元,用于根据所述查询对象在vCenter中筛选出与所述查询对象相关联的所有的对象信息;a filtering unit, configured to filter, in the vCenter, all object information associated with the query object according to the query object;
表创建单元,用于根据所述查询对象和所述对象信息创建数据表并在数据表中插入相关数据,其中每个对象所属的类对应一个数据表;a table creation unit, configured to create a data table according to the query object and the object information, and insert related data in the data table, wherein each class to which the object belongs corresponds to one data table;
树状图生成单元,用于根据所述数据表和数据表中的字段生成多层关系树状图;a tree diagram generating unit, configured to generate a multi-layer relationship tree according to the data table and the fields in the data table;
输入单元,用于接收用户在多层关系树状图中选择的数据表和字段,以及用户输入的查询条件;An input unit, 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 the user;
查询语句生成单元,用于根据选择的数据表和字段,以及输入的查询条件生成SQL语句;a query statement generating unit, configured to generate an SQL statement according to the selected data table and the field, and the input query condition;
结果返回单元,用于执行SQL语句并返回查询执行结果。The result is returned to the unit for executing the SQL statement and returning the query execution result.
第三方面,本发明实施例提供了一种服务器管理系统,该服务器管理系统包括处理设备以及存储设备;In a third aspect, an embodiment of the present invention provides a server management system, where the server management system includes a processing device and a storage device.
所述存储设备用于存储在所述服务器管理系统中实现关联信息查询的程序及数据信息;The storage device is configured to store a program and data information for implementing related information query in the server management system;
所述处理设备用于运行所述存储设备中存储的程序,以执行上述第一方面所述的方法。The processing device is configured to execute a program stored in the storage device to perform the method described in the first aspect above.
第四方面,本发明实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者一个以上程序,所述一个或者一个以上程序可被一个或者一个以上的处理器执行,以实现上述第一方面所述的方法。In a fourth aspect, an embodiment of the present invention provides a computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors To achieve the method described in the first aspect above.
本发明实施例,可以根据查询对象和查询对象相关联的所有对象信息创建数据表并在数据表中插入相关数据,根据所述数据表生成多层关系树状图,再根据用户选择的数据表和字段,以及输入的查询条件生成SQL语句,执行SQL语句并返回查询执行结果。本发明实施例可以将定位问题中的查询对象和查询对象的相关联的所有对象显示在多层关系树状图中,再根据多层关系树状图中的信息进行查询得到查询结果,节省了定位问题和故障分析的时间,提高了运维管理的效率。In the embodiment of the present invention, a data table may be created according to all object information associated with the query object and the query object, and related data is inserted in the data table, and a multi-layer relationship tree diagram is generated according to the data table, and then according to the data table selected by the user. And the field, as well as the input query conditions to generate SQL statements, execute SQL statements and return query execution results. In the embodiment of the present invention, the query object in the positioning problem and all the objects associated with the query object are displayed in a multi-layer relationship tree diagram, and then the query result is obtained according to the information in the multi-layer relationship tree view, thereby saving the query result. The problem of positioning problems and failure analysis improves the efficiency of operation and maintenance management.
附图说明DRAWINGS
为了更清楚地说明本发明实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly described below. It is obvious that the drawings in the following description are some embodiments of the present invention. For the ordinary technicians, other drawings can be obtained based on these drawings without any creative work.
图1是本发明实施例提供的一种关联信息查询方法的示意流程图;FIG. 1 is a schematic flowchart of a method for querying related information according to an embodiment of the present invention;
图2是本发明实施例提供的一种关联信息查询方法的一个子流程示意图;2 is a schematic diagram of a sub-flow of a method for querying related information according to an embodiment of the present invention;
图3是本发明实施例提供的一种关联信息查询方法的另一个子流程示意图;FIG. 3 is a schematic diagram of another sub-flow of a method for querying related information according to an embodiment of the present invention; FIG.
图4是本发明另一实施例提供的一种关联信息查询方法的示意流程图;FIG. 4 is a schematic flowchart of a method for querying associated information according to another embodiment of the present invention; FIG.
图5是本发明又一实施例提供的一种关联信息查询方法的示意流程图;FIG. 5 is a schematic flowchart of a method for querying related information 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 related information according to another embodiment of the present invention; FIG.
图7是本发明实施例提供的一种终端的示意性框图;FIG. 7 is a schematic block diagram of a terminal according to an embodiment of the present disclosure;
图8是本发明实施例提供的表创建单元的示意性框图;FIG. 8 is a schematic block diagram of a table creation unit according to an embodiment of the present invention;
图9是本发明实施例提供的树状图生成单元的示意性框图;FIG. 9 is a schematic block diagram of a tree diagram generating unit according to an embodiment of the present invention; FIG.
图10是本发明另一实施例提供的一种终端的示意性框图;FIG. 10 is a schematic block diagram of a terminal according to another embodiment of the present invention; FIG.
图11是本发明又一实施例提供的一种终端的示意性框图;FIG. 11 is a schematic block diagram of a terminal according to another embodiment of the present invention; FIG.
图12为本发明实施例提供的显示单元的示意性框图;FIG. 12 is a schematic block diagram of a display unit according to an embodiment of the present disclosure;
图13是本发明实施例提供的一种服务器管理系统的示意性框图。FIG. 13 is a schematic block diagram of a server management system according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”和
“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It will be understood that the terms "comprise" and "the" when used in the specification and the appended claims
"Comprising" indicates the existence of the described features, integers, steps, operations, elements and/or components, but does not exclude the presence of one or more other features, integers, steps, operations, elements, components and/or combinations thereof Add to.
还应当理解,在本发明说明书和所附权利要求书中使用的术语“和/
或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should also be understood that the term "and / is used in the description of the invention and the appended claims.
Or "" refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
具体实现中,本发明实施例中描述的终端包括但不限于诸如台式计算机等非便携式通信设备。还应当理解的是,在一些实施例中,所述设备并非仅指非便携式通信设备,还可以包括移动电话、膝上型计算机或平板计算机之类的其它便携式设备。In a specific implementation, the terminal described in the embodiments of the present invention includes, but is not limited to, a non-portable communication device such as a desktop computer. It should also be understood that in some embodiments, the device is not limited to only non-portable communication devices, but may also include other portable devices such as mobile phones, laptop computers, or tablet computers.
图1为本发明实施例提供的一种关联信息查询方法的流程示意图。该方法包括S101~S107。FIG. 1 is a schematic flowchart diagram of a method for querying related information 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 the vCenter. Among them, vCenter is the virtualization management server platform VMware
vCenter
Abbreviation for Server. 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 input by the user can be a specific host according to the needs of the user. If it is not determined to be a specific host, the host component can also be used as the query object.
S102,根据该查询对象在vCenter中筛选出与该查询对象相关联的所有的对象信息。在vCenter中,将主机、虚拟机、网络、存储、集群等抽象出相对应的类,并抽象出这些类之间的相对应的关系,并将这些抽象出来的类和这些类之间的相对应的关系保存。并同时保存抽象出来的类的具体信息,如保存多个主机的具体信息,包括主机名称、主机内存大小、主机处理器、主机操作系统类型等。当接收到用户输入的查询对象后,根据保存的抽象出来的类和这些类之间的相对应的关系筛选出查询对象相关联的所有的对象信息。如用户输入的查询对象为主机,那么与该查询对象相关联的所有的对象信息包括主机名称、主机连接的存储、主机上的虚拟机、主机内存、主机运行状态、主机网络系统、主机所在的群集、主机连接状态、主机触发的告警的信息等。S102. Filter all the object information associated with the query object in the vCenter according to the query object. In vCenter, abstract hosts, virtual machines, networks, storage, clusters, etc. into corresponding classes, and abstract the corresponding relationships between these classes, and abstract these classes and the phases between these classes. The corresponding relationship is saved. At the same time, the specific information of the abstracted class is saved, such as saving specific information of multiple hosts, including host name, host memory size, host processor, host operating system type, and the like. After receiving the query object input by the user, all the object information associated with the query object is filtered according to the saved abstracted class and the corresponding relationship between the classes. If the query object input by the user is a host, all object information associated with the query object includes a host name, a storage connected to the host, a virtual machine on the host, a host memory, a host running state, a host network system, and a host. Cluster, host connection status, information triggered by the host, etc.
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 in the data table. Each class to which each object belongs corresponds to a data table. In the specific implementation, you must first create a data table, and then insert data in the data table. Specifically, as shown in FIG. 2, S103 includes S201-S202. S201. Acquire an attribute of a class to which each object belongs and a value of the attribute. Among them, the properties of the class here are understood as member variables of the class. The properties of the class to which each object belongs and the value of the property can be obtained through the Java reflection mechanism. S202, converting each class attribute into a SQL statement and executing the SQL statement to create a data table, converting each class attribute and the value of the attribute into a SQL statement and executing the SQL statement to insert in the data table data. Among them, when you convert the properties of each class into SQL statements, you need to add create
Table and other SQL syntax to create a data table; when converting the values of each class's properties and properties into SQL statements, you need to add the SQL syntax for inserting data such as insert. The created table is named according to the preset rules, such as t-class name. For example, the class to which the object whose host name is abc belongs is the host class. The attributes of the host class include the host name, host memory size, host processor, host operating system type, and so on.
The table creates the SQL syntax of the data table and executes to create the host data table. The fields of the created host data table include the host name, the host memory size, the host processor, the host operating system type, and the like. Then insert data in the host data table, you can insert one or more rows of data at a time in the host data table. Suppose you insert a row of data. The corresponding attributes and attributes 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, add insert, etc. Insert the SQL syntax of the data and execute to insert the row data in the host data table.
S104,根据数据表和数据表中的字段生成多层关系树状图。S104. Generate a multi-layer relationship tree according to the fields in the data table and the data table.
S105,接收用户在多层关系树状图中选择的数据表和字段,以及用户输入的查询条件。因为多层关系树状图中展示了要查询的数据表和相关联的数据表之间的关系以及每个数据表所对应的字段,因此用户可直接选择要显示的数据表和字段,方便查看。其中,要选择的字段可以为空,那么理解为该数据表的所有字段都要显示,同时输入的查询条件可以为空,可以理解为该数据表的所有数据都需要。S105. Receive a data table and a field selected by the user in the multi-layer relationship tree, and a query condition input by the user. Because the relationship between the data table to be queried and the associated data table and the corresponding field of each data table are displayed in the multi-level relationship tree, the user can directly select the data table and field to be displayed for convenient viewing. . Among them, the field to be selected can be empty, then it is understood that all the fields of the data table should be displayed, and the input query condition can be empty, which can be understood as all the data of the data table is needed.
S106,根据选择的数据表和字段,以及输入的查询条件生成SQL语句。S106: Generate an SQL statement according to the selected data table and field, and the input query condition.
S107,执行SQL语句并返回查询执行结果。该查询执行结果为一条条的记录,如一个或者多个具体主机的信息,一个或者多个具体虚拟机的信息等,一个或者多个具体网络的信息等。S107, executing the SQL statement and returning the query execution result. The query execution result is a record of one strip, such as information of one or more specific hosts, information of one or more specific virtual machines, information of one or more specific networks, and the like.
具体地,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. Acquire a name of a data table corresponding to the query object input by the user. Specifically, the name of the class corresponding to the query object input by the user is obtained through the java reflection mechanism. Because a class corresponds to a table, the name of the data table can be obtained by the name of the class. S302. Determine whether the name of the data table exists. If the name of the data table exists, S303 is performed; if not, the relevant data that does not exist is returned to remind the user. The name of the data table exists as the name of the data table exists in the vCenter. S303. Acquire all fields of the data table and types of the respective fields. The types to which each field belongs include a basic type, a type of another class, and the like. It should be noted that the data structure of each field should be defined first. For example, the data structure defining a field includes at least: a specific field value, a type to which the field belongs, and the like. S304, the name of the data table is taken as the root node of the tree diagram, and each field is saved as a child node of the root node. S305. For each field, determine whether other data tables are involved in the field according to the type of the field. If the type of the field is a basic type, it is determined that the field does not contain other classes, that is, no other data table is involved; if the type to which the field belongs is a type of another class, it is determined that the field includes There are other classes, that is, there are other data tables involved. If there are other data tables involved in the field, execute S306; if there is no other data table for each field, execute S309. S306. Determine whether there is a name of a corresponding data table. If the name of the corresponding data table exists, S307 is executed. If the name of the corresponding data table does not exist, the relevant data that does not exist is returned to remind the user. The name of the corresponding data table exists as the name of the corresponding data table exists in the vCenter. S307. Determine whether there is a name of the corresponding data table in the saved node. If the name of the corresponding data table is not saved in the saved node, that is, if one or more fields involve the names of other data tables, at least one of the corresponding data table names in the saved node does not exist. Or it can be understood that at least one of the corresponding data table names is not saved as a corresponding node, and S308 is performed; if the saved node has a corresponding data table name, that is, if one or more fields are related to other The name of the data table, and the name of the corresponding data table related to the one or more fields already exists in the saved node, and S309 is performed. If the node corresponding to the name of the corresponding data table is a node corresponding to the field of the other data table, it can be understood that the node corresponding to the field of the other data table is the same as the node corresponding to the name of the corresponding data table. node. 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 fields corresponding to each layer node of the tree diagram do not involve other data tables. S309. Generate a multi-level relationship tree according to all the saved nodes. Through the method shown in Figure 3, a multi-layer relationship tree diagram is obtained, which shows the relationship between the class corresponding to the query object and the class corresponding to all objects associated with the query object, wherein Also shows the properties of each class. That is, the relationship between the data table corresponding to the query object and all the data tables associated with the query object is shown, and the fields contained in each data table are also displayed. The obtained multi-level relation tree diagram shows the relationship between the data table to be queried and the associated data table and the corresponding fields of each data table at a glance, so that the user can perform further query.
上述方法实施例可以将定位问题中的查询对象所对应的类和查询对象的相关联的所有对象对应的类显示在多层关系树状图中,再根据多层关系树状图中的信息进行查询得到查询结果,节省了定位问题和故障分析的时间,提高了运维管理的效率。In the foregoing method embodiment, the class corresponding to the query object in the positioning problem and the class corresponding to all the objects of the query object are displayed in the multi-level relation tree, and then according to the information in the multi-layer relationship tree. The query obtains the query result, which saves the positioning problem and the time of fault analysis, and improves the efficiency of operation and maintenance management.
图4为本发明另一实施例提供的一种关联信息查询方法的流程示意图。该方法包括S401~S408。FIG. 4 is a schematic flowchart diagram of a method for querying related information 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 the 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 input by the user can be a specific host according to the needs of the user. If it is not determined to be a specific host, the host component can also be used as the query object.
S402,根据该查询对象在vCenter中筛选出与该查询对象相关联的所有的对象信息。在vCenter中,将主机、虚拟机、网络、存储、集群等抽象出相对应的类,并抽象出这些类之间的相对应的关系,并将这些抽象出来的类和这些类之间的相对应的关系保存。并同时保存抽象出来的类的具体信息,如保存多个主机的具体信息,包括主机名称、主机内存大小、主机处理器、主机操作系统类型等。当接收到用户输入的查询对象后,根据保存的抽象出来的类和这些类之间的相对应的关系筛选出查询对象相关联的所有的对象信息。如用户输入的查询对象为主机,那么与该查询对象相关联的所有的对象信息包括主机名称、主机连接的存储、主机上的虚拟机、主机内存、主机运行状态、主机网络系统、主机所在的群集、主机连接状态、主机触发的告警的信息等。S402. Filter all the object information associated with the query object in the vCenter according to the query object. In vCenter, abstract hosts, virtual machines, networks, storage, clusters, etc. into corresponding classes, and abstract the corresponding relationships between these classes, and abstract these classes and the phases between these classes. The corresponding relationship is saved. At the same time, the specific information of the abstracted class is saved, such as saving specific information of multiple hosts, including host name, host memory size, host processor, host operating system type, and the like. After receiving the query object input by the user, all the object information associated with the query object is filtered according to the saved abstracted class and the corresponding relationship between the classes. If the query object input by the user is a host, all object information associated with the query object includes a host name, a storage connected to the host, a virtual machine on the host, a host memory, a host running state, a host network system, and a host. Cluster, host connection status, information triggered by the host, etc.
S403,建立内存数据库,该内存数据库与vCenter相连接。优选地,采用SQLite作为内存数据库。SQLite是一种嵌入式数据库。它包括以下优点:(1)零配置。SQlite3不用安装,不用配置,不用启动、关闭或者配置数据库实例。当系统崩溃后不用做任何恢复操作,再下次使用数据库的时候自动恢复。(2)紧凑。SQLite被设计成轻量级的。一个头文件,一个lib库,就可以使用了,不用任何启动任何系统进程。(3)采用无数据类型。因为采用的是无数据类型,所以可以保存任何类型的数据,SQLite采用的是动态数据类型,会根据存入值自动判断。该内存数据库与vCenter相联接,只要程序没有因为异常而中断,就可以和vCenter一直保持通信。并且使用等待更新机制(waitforUpdate机制)更新内存数据库中的数据,因此只要vCenter中有相关数据变化就可以立刻检测到,可以理解为,获取的内存数据库中的数据就是vCenter中的实时数据。S403. Establish an in-memory database, where the in-memory database is connected to the vCenter. Preferably, SQLite is used as the in-memory database. SQLite is an embedded database. It includes the following advantages: (1) Zero configuration. SQlite3 does not need to be installed, no configuration, no need to start, shut down or configure the database instance. When the system crashes, you don't need to do any recovery operations, and then automatically restore the next time you use the database. (2) Compact. SQLite is designed to be lightweight. A header file, a lib library, can be used without any system processes being started. (3) Adopt no data type. Because no data type is used, any type of data can be saved. SQLite uses a dynamic data type, which is automatically determined based on the stored value. The in-memory database is connected to vCenter and can be kept in communication with the vCenter as long as the program is not interrupted due to an exception. And use the wait update mechanism (waitforUpdate mechanism) to update the data in the in-memory database, so as long as there is relevant data change in the vCenter, it can be detected immediately. It can be understood that the data in the acquired in-memory database is the real-time data in the vCenter.
S404,根据该查询对象和该查询对象相关联的所有对象信息在内存数据库中创建数据表并在数据表中插入相关数据。其中每个对象所属的类对应一个数据表。在具体实现中,要先创建数据表,再在数据表中插入数据。具体地,创建数据表以及在数据表中插入相关数据如图2所述,在此不再赘述。S404. Create a data table in the in-memory database according to the query object and all object information associated with the query object, and insert related data in the data table. Each class to which each object belongs corresponds to a data table. In the specific implementation, you must first create a data table, and then insert data in the data table. Specifically, the data table is created and the related data is inserted in the data table as described in FIG. 2, and details are not described herein again.
S405,根据数据表和数据表中的字段生成多层关系树状图。具体地,如图3所示,在此不再赘述。通过图3所示的方法,会得到一个多层关系树状图,该多层关系树状图展示了查询对象所对应类以及与查询对象相关联的所有对象所对应类之间的关系,其中,也展示了每个类的属性。即展示了查询对象所对应的数据表以及与查询对象相关联的所有数据表之间的关系,其中,也展示了每个数据表包含的字段。这里的类的属性,理解为类的成员变量。得到的多层关系树状图一目了然的展示了要查询的数据表和相关联的数据表之间的关系以及每个数据表所对应的字段,方便用户进行更一步的查询。S405. Generate a multi-layer relationship tree according to the fields in the data table and the data table. Specifically, as shown in FIG. 3, details are not described herein again. Through the method shown in Figure 3, a multi-layer relationship tree diagram is obtained, which shows the relationship between the class corresponding to the query object and the class corresponding to all objects associated with the query object, wherein Also shows the properties of each class. That is, the relationship between the data table corresponding to the query object and all the data tables associated with the query object is shown, and the fields contained in each data table are also displayed. The properties of the class here are understood as member variables of the class. The obtained multi-level relation tree diagram shows the relationship between the data table to be queried and the associated data table and the corresponding fields of each data table at a glance, so that the user can perform further query.
S406,接收用户在多层关系树状图中选择的数据表和字段,以及用户输入的查询条件。因为多层关系树状图中展示了要查询的数据表和相关联的数据表之间的关系以及每个数据表所对应的字段,因此用户可直接选择要显示的数据表和字段,方便查看。其中,要选择的字段可以为空,那么理解为该数据表的所有字段都要显示,同时输入的查询条件可以为空,可以理解为该数据表的所有数据都需要。S406. Receive a data table and a field selected by the user in the multi-layer relationship tree, and a query condition input by the user. Because the relationship between the data table to be queried and the associated data table and the corresponding field of each data table are displayed in the multi-level relationship tree, the user can directly select the data table and field to be displayed for convenient viewing. . Among them, the field to be selected can be empty, then it is understood that all the fields of the data table should be displayed, and the input query condition can be empty, which can be understood as all the data of the data table is needed.
S407,根据选择的数据表和字段,以及输入的查询条件生成SQL语句。S407. Generate an SQL statement according to the selected data table and the field, and the input query condition.
S408,在内存数据库中执行SQL语句并返回查询执行结果。该查询执行结果为一条条的记录,如一个或者多个具体主机的信息,一个或者多个具体虚拟机的信息等,一个或者多个具体网络的信息等。S408. Execute the SQL statement in the in-memory database and return the query execution result. The query execution result is a record of one strip, such as information of one or more specific hosts, information of one or more specific virtual machines, information of one or more specific networks, and the like.
上述方法实施例通过建立内存数据库,将查询对象相对应的数据表和该查询对象相关联的所有对象所对应的数据表都保存在内存数据库中,vCenter中的相关数据有变动时,也会实时更新到内存数据库中,再从内存数据库中取相关的数据来生成多层关系树状图,无需再重新从vCenter中获取所有需要的数据,加快了查询的速度,更一步节省了定位问题和故障分析的时间,提高了运维管理的效率。The foregoing method embodiment saves the data table corresponding to the data table corresponding to the query object and all the objects associated with the query object in the in-memory database by establishing an in-memory database, and the real-time data in the vCenter may also be changed in real time. Update to the in-memory database, and then retrieve relevant data from the in-memory database to generate a multi-layer relationship tree, eliminating the need to re-fetch all the required data from vCenter, speeding up the query, and further saving positioning problems and failures. The time of analysis improves the efficiency of operation and maintenance management.
图5为本发明另一实施例提供的一种关联信息查询方法的示意流程图。该方法包括S501-S504。FIG. 5 is a schematic flowchart of a method for querying association information according to another embodiment of the present invention. The method includes S501-S504.
S501,接收到vCenter中发出的告警信息后,创建存储容器。其中,创建的存储容器可以为一个或者多个。如接收到vCenter中发出的一个丢包率突然升高的告警信息,接受到告警信息后,创建购物车,再创建购物车的篮子。其中,创建的购物车可以有多个,一个购物车可以创建多个篮子。S501: After receiving the alarm information sent by the vCenter, create a storage container. Among them, the created storage container can be one or more. If receiving a warning message that the packet loss rate suddenly rises in the vCenter, after receiving the alarm information, create a shopping cart and create a shopping cart basket. Among them, there can be more than one shopping cart, and one shopping cart can create multiple baskets.
S502,将该告警信息所涉及到的对象的查询执行结果保存在存储容器中。如接收到一个云环境中丢包率突然升高的告警信息,那么该告警信息所涉及的对象为网络。其中,输入该告警信息所涉及的对象,根据该告警信息所涉及到的对象进行查询得到查询执行结果的具体步骤可参见图4所述的实施例,具体地,请参看图4实施例所涉及的内容,在此不再赘述。该查询执行结果为一条条的记录,即为对应的具体对象,如一个或者多个具体主机的信息,一个或者多个具体虚拟机的信息等,一个或者多个具体网络的信息等。将一次查询的查询执行结果保存在一个购物车的篮子里。将多次查询的多个查询执行结果保存在一个购物车的多个篮子里,或者保存在多个购物车的篮子里。S502. The query execution result of the object involved in the alarm information is saved in a storage container. If the alarm information in the cloud environment suddenly increases, the object involved in the alarm information is the network. For the specific steps of the object to be queried according to the object involved in the alarm information, the specific steps of the query execution result may be referred to the embodiment shown in FIG. 4, and specifically, refer to the embodiment of FIG. The content of this will not be repeated here. The result of the query execution is a record of a specific object, such as information of one or more specific hosts, information of one or more specific virtual machines, information of one or more specific networks, and the like. Save the query execution results of one query in a shopping cart basket. Save multiple query execution results from 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, the selected detection object is a plurality. Specifically, multiple objects in the query execution result of one query may be selected, or multiple objects in the query execution result of multiple queries may be selected. It will be appreciated that multiple objects may be selected in multiple baskets of one shopping cart or multiple objects in multiple baskets of multiple shopping carts.
S504,根据检测对象生成并显示该对象的性能曲线图以供查找告警信息的来源。具体地,S504包括S601-S603。S601,接收用户输入的要检测的时间段。要检测的时间可以为一天之内的某几个小时,也可以为几天,也可以为几个星期等。S602,根据检测对象获取该检测对象在该时间段内的性能数据。其中,性能数据包括CPU性能、内存性能、网络性能等中的一个。S603,根据该性能数据生成并显示检测对象的性能曲线图以供查找告警信息的来源。若有多个检测对象,那么该性能曲线图中就会有多条曲线,将多个曲线放在一起对比,很容易发现异常曲线所对应的对象。将该异常曲线所对应的对象进行进一步的排查以供查找该告警信息的来源。S504. Generate and display a performance graph of the object according to the detection object for searching for a source of the alarm information. Specifically, S504 includes S601-S603. S601. Receive a time period to be detected by the user. The time to be detected can be several hours in a day, or several days, or several weeks. S602. Acquire performance data of the detection object in the time period according to the detection object. Among them, the performance data includes one of CPU performance, memory performance, network performance, and the like. S603. Generate and display a performance graph of the detection object according to the performance data for searching for a source of the alarm information. If there are multiple detection objects, then there will be multiple curves in the performance graph. When multiple curves are put together, it is easy to find the object corresponding to the abnormal curve. The object corresponding to the abnormal curve is further checked for finding the source of the alarm information.
上述方法实施例接收到告警信息后,选择查询执行结果中的检测对象,生成并显示该对象的性能曲线图,优选是多个对象的多个曲线图,进一步方便用户查询告警信息的来源。加快了查询的速度,更一步节省了定位问题和故障分析的时间,提高了运维管理的效率。After receiving the alarm information, the foregoing method embodiment selects the detection object in the query execution result, generates and displays a performance graph of the object, preferably multiple graphs of multiple objects, to further facilitate the user to query the source of the alarm information. It speeds up the query, saves the positioning problem and the time of 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 screening unit 702, a table creating unit 703, a tree diagram 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 virtualization management server platform VMware vCenter
Abbreviation for Server. 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 input by the user can be a specific host according to the needs of the user. If it is not determined to be 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 the vCenter according to the query object. In vCenter, abstract hosts, virtual machines, networks, storage, clusters, etc. into corresponding classes, and abstract the corresponding relationships between these classes, and abstract these classes and the phases between these classes. The corresponding relationship is saved. At the same time, the specific information of the abstracted class is saved, such as saving specific information of multiple hosts, including host name, host memory size, host processor, host operating system type, and the like. After receiving the query object input by the user, all the object information associated with the query object is filtered according to the saved abstracted class and the corresponding relationship between the classes. If the query object input by the user is a host, all object information associated with the query object includes a host name, a storage connected to the host, a virtual machine on the host, a host memory, a host running state, a host network system, and a host. Cluster, host connection status, information triggered by the host, etc.
表创建单元703用于根据该查询对象和该查询对象相关联的所有对象信息创建数据表并在数据表中插入相关数据。其中每个对象所属的类对应一个数据表。在具体实现中,要先创建数据表,再在数据表中插入数据。具体地,如图8所示,表创建单元包括第一字段获取单元801、转化执行单元802。第一字段获取单元801用于获取每个对象所属类的属性和该属性的值。其中,这里的类的属性,理解为类的成员变量。可以通过Java反射机制来获取每个对象所属类的属性和该属性的值。转化执行单元802用于将每个类的属性转化为SQL语句并执行所述SQL语句以创建数据表,将每个类的属性和该属性的值转化为SQL语句并执行所述SQL语句以在数据表中插入数据。其中,将每个类的属性转化为SQL语句时,需要加入create
table等创建数据表的SQL语法;将每个类的属性和属性的值转化为SQL语句时,需要加入insert等插入数据的SQL语法。创建的表按照预设的规则命名,如t-类名等。The table creation unit 703 is configured to create a data table according to the query object and all object information associated with the query object and insert relevant data in the data table. Each class to which each object belongs corresponds to a data table. In the specific implementation, you must first create a data table, and then insert data in the data table. Specifically, as shown in FIG. 8, the table creation unit includes a first field acquisition unit 801 and a conversion execution unit 802. The first field obtaining unit 801 is configured to acquire an attribute of a class to which each object belongs and a value of the attribute. Among them, the properties of the class here are understood as member variables of the class. The properties of the class to which each object belongs and the value of the property can be obtained through the Java reflection mechanism. The conversion execution unit 802 is configured to convert the attributes of each class into SQL statements and execute the SQL statements to create a data table, convert the attributes of each class and the values of the attributes into SQL statements and execute the SQL statements to Insert data into the data table. Among them, when you convert the properties of each class into SQL statements, you need to add create
Table and other SQL syntax to create a data table; when converting the values of each class's properties and properties into SQL statements, you need to add the SQL syntax for inserting data such as insert. The created table is named according to the preset rules, such as t-class name.
树状图生成单元704用于将数据表和数据表中的字段生成多层关系树状图。The tree diagram generation unit 704 is configured to generate a multi-layer relationship tree diagram of the fields in the data table and the data table.
接收单元701还用于接收用户在多层关系树状图中选择的数据表和字段,以及用户输入的查询条件。因为多层关系树状图中展示了要查询的数据表和相关联的数据表之间的关系以及每个数据表所对应的字段,因此用户可直接选择要显示的数据表和字段,方便查看。其中,要选择的字段可以为空,那么理解为该数据表的所有字段都要显示,同时输入的查询条件可以为空,可以理解为该数据表的所有数据都需要。The receiving unit 701 is further configured to receive a data table and a field selected by the user in the multi-layer relationship tree, and a query condition input by the user. Because the relationship between the data table to be queried and the associated data table and the corresponding field of each data table are displayed in the multi-level relationship tree, the user can directly select the data table and field to be displayed for convenient viewing. . Among them, the field to be selected can be empty, then it is understood that all the fields of the data table should be displayed, and the input query condition can be empty, which can be understood as all the data of the data table is needed.
查询语句生成单元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 condition.
结果返回单元706用于执行SQL语句并返回查询执行结果。该查询执行结果为一条条的记录,如一个或者多个具体主机的信息,一个或者多个具体虚拟机的信息等,一个或者多个具体网络的信息等。The result return unit 706 is for executing the SQL statement and returning the query execution result. The query execution result is a record of one strip, such as information of one or more specific hosts, information of one or more specific virtual machines, information of one or more specific networks, and the like.
具体地,树状图生成单元包括表名称获取单元901、判断单元902、第二字段获取单元903、节点保存单元904、多层关系树状图生成单元905。表名称获取单元901用于获取用户输入的查询对象所对应的数据表的名称。具体地,通过java反射机制获取用户输入的查询对象所对应的类的名称,因为一个类对应一个表,通过该类的名称可得到该数据表的名称。判断单元902用于判断是否存在该数据表的名称。存在该数据表的名称理解为在vCenter中存在该数据表的名称。若不存在该数据表的名称,则返回不存在的相关数据以提醒用户。第二字段获取单元903用于若存在该数据表的名称,获取该数据表的所有字段及各个字段所属的类型。其中,各个字段所属的类型包括基本类型、其他类的类型等。需要注意的是,要先定义好每一个字段的数据结构,如定义一个字段的数据结构至少包括:具体的字段值,字段所属的类型等。节点保存单元904用于将该数据表的名称作为树状图的根节点,将各个字段作为该根节点的子节点进行保存。判断单元902还用于对于每一个字段,根据该字段所属的类型判断该字段中是否涉及有其他数据表。若该字段所属的类型是基本类型,则判断该字段中不包含有其他类,即不涉及有其他数据表;若该字段所属的类型是其他类的类型,则判断该字段中包含有其他类,即涉及有其他数据表。表名称获取单元901还用于若涉及有其他数据表,获取所对应的数据表的名称。若只有一个字段涉及有其他数据表,获取该一个字段涉及的所对应的数据表的名称;若有多个字段涉及有其他表,获取该多个字段涉及的所对应的数据表的名称。判断单元902还用于判断是否存在所对应的数据表的名称。若不存在对应的数据表的名称,返回不存在的相关数据以提醒用户。存在对应的数据表的名称理解为在vCenter中存在对应的数据表的名称。判断单元902还用于若存在所对应的数据表的名称,判断保存的节点中是否有所对应的数据表的名称。若保存的节点中没有保存所对应的数据表的名称,即若有一个或者多个字段涉及有其他数据表的名称,在保存的节点中只要至少有一个所对应的数据表的名称不存在,或者可理解为至少有一个所对应的数据表的名称没有保存为对应的节点;若保存的节点中有所对应的数据表的名称,即若有一个或者多个字段都涉及有其他数据表的名称,且保存的节点中已经存在有该一个或者多个字段涉及的对应的数据表的名称。节点保存单元904还用于若保存的节点中没有保存所对应的数据表的名称,将该数据表的所有字段作为当前字段所对应的节点的下一层节点进行保存,依此类推,直到树状图的每一层节点对应的字段均不涉及其他数据表。多层关系树状图生成单元905用于若保存的节点中有所对应的数据表的名称,根据保存的所有节点生成多层关系树状图;以及若对于每一个字段,都不涉及有其他数据表,根据保存的所有节点生成多层关系树状图。若所对应的数据表的名称所对应的节点为其他数据表的字段所对应的节点,可理解为其他数据表的字段所对应的节点与所对应的数据表的名称所对应的节点为同一个节点。通过图9所示的结构,会得到一个多层关系树状图,该多层关系树状图展示了查询对象所对应类以及与查询对象相关联的所有对象所对应类之间的关系,其中,也展示了每个类的属性。也即展示了查询对象所对应的数据表以及与查询对象相关联的所有数据表之间的关系,其中,也展示了每个数据表包含的字段。这里,类的属性,理解为类的所有成员变量。得到的多层关系树状图一目了然的展示了要查询的数据表和相关联的数据表之间的关系以及每个数据表所对应的字段,方便用户进行更一步的查询。Specifically, the tree diagram generation unit includes a table name acquisition unit 901, a determination unit 902, a second field acquisition unit 903, a node preservation unit 904, and a multi-layer relationship tree diagram generation unit 905. The table name obtaining unit 901 is configured to acquire the name of the data table corresponding to the query object input by the user. Specifically, the name of the class corresponding to the query object input by the user is obtained through the java reflection mechanism. Because a class corresponds to a table, the name of the data table can be obtained by the name of the class. The determining unit 902 is configured to determine whether the name of the data table exists. The name of the data table exists as the name of the data table exists in the vCenter. If the name of the data table does not exist, the relevant data that does not exist is returned to remind the user. The second field obtaining unit 903 is configured to acquire all the fields of the data table and the types to which the respective fields belong if the name of the data table exists. The types to which each field belongs include a basic type, a type of another class, and the like. It should be noted that the data structure of each field should be defined first. For example, the data structure defining a field includes at least: a specific field value, a type to which the field belongs, and the like. The node holding unit 904 is configured to use the name of the data table as the root node of the tree diagram, and store each field as a child node of the root node. The determining unit 902 is further configured to determine, for each field, whether other data tables are involved in the field according to the type to which the field belongs. 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 table is involved; if the type to which the field belongs is a type of another class, it is determined that the field contains other classes. , that is, there are other data tables involved. The table name obtaining unit 901 is further configured to acquire the name of the corresponding data table if other data tables are involved. If only one field refers to other data tables, obtain the name of the corresponding data table involved in the one field; if there are multiple fields involved in other tables, obtain the names of the corresponding data tables involved in the multiple fields. The determining unit 902 is further configured to determine whether there is a name of the corresponding data table. If the name of the corresponding data table does not exist, the relevant data that does not exist is returned to remind the user. The name of the corresponding data table exists as the name of the corresponding data table exists in the vCenter. The determining unit 902 is further configured to determine, if the name of the corresponding data table exists, whether the name of the corresponding data table exists in the saved node. If the name of the corresponding data table is not saved in the saved node, that is, if one or more fields involve the names of other data tables, at least one of the corresponding data table names in the saved node does not exist. Or it can be understood that at least one corresponding data table name is not saved as a corresponding node; if the saved node has a corresponding data table name, 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: if the saved node does not save the name of the corresponding data table, 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 tree The fields corresponding to each layer of the graph do not involve other data tables. The multi-layer relationship tree diagram generating unit 905 is configured to generate a multi-layer relationship tree diagram according to all the saved nodes if the name of the corresponding data table is saved in the saved node; and if there is no other field for each field A data table that generates a multi-level relationship tree based on all nodes saved. If the node corresponding to the name of the corresponding data table is a node corresponding to the field of the other data table, it can be understood that the node corresponding to the field of the other data table is the same as the node corresponding to the name of the corresponding data table. node. Through the structure shown in Figure 9, a multi-layer relationship tree diagram is obtained, which shows the relationship between the class corresponding to the query object and the class corresponding to all objects associated with the query object, wherein Also shows the properties of each class. That is, the relationship between the data table corresponding to the query object and all the data tables associated with the query object is shown, and the fields contained in each data table are also displayed. Here, the properties of the class are understood as all member variables of the class. The obtained multi-level relation tree diagram shows the relationship between the data table to be queried and the associated data table and the corresponding fields of each data table at a glance, so that the user can perform further query.
上述实施例可以将定位问题中的查询对象所对应的类和查询对象的相关联的所有对象对应的类显示在多层关系树状图中,再根据多层关系树状图中的信息进行查询得到查询结果,节省了定位问题和故障分析的时间,提高了运维管理的效率。In the above embodiment, the class corresponding to the query object in the positioning problem and the class corresponding to all the objects of the query object are displayed in the multi-layer relation tree, and then the query is performed according to the information in the multi-layer relationship tree. The query result is obtained, which saves the positioning problem and the time of fault analysis, and improves the efficiency of operation and maintenance management.
图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, an in-memory database establishing unit 103, a table creating unit 104, a tree diagram generating unit 105, a query sentence generating unit 106, and a result returning unit 107. The receiving unit 101, the filtering unit 102, the tree diagram generating unit 105, and the query statement generating unit 106 refer to the receiving unit 701, the filtering unit 702, the tree diagram generating unit 704, and the query statement generation 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 the in-memory database establishing unit 103 is added.
内存数据库建立单元103用于建立内存数据库,所述内存数据库与vCenter相连接。优选地,采用SQLite作为内存数据库。该内存数据库与vCenter相联接,只要程序没有因为异常而中断,就可以和vCenter一直保持通信。并且使用等待更新机制(waitforUpdate机制)更新内存数据库中的数据,因此只要vCenter中有相关数据变化就可以立刻检测到,可以理解为,获取的内存数据库中的数据就是vCenter中的实时数据。The in-memory database establishing unit 103 is configured to establish an in-memory database, which is connected to the vCenter. Preferably, SQLite is used as the in-memory database. The in-memory database is connected to vCenter and can be kept in communication with the vCenter as long as the program is not interrupted due to an exception. And use the wait update mechanism (waitforUpdate mechanism) to update the data in the in-memory database, so as long as there is relevant data change in the vCenter, it can be detected immediately. It can be understood that the data in the acquired in-memory database is the real-time data in the vCenter.
表创建单元104还用于根据该查询对象和该查询对象相关联的所有对象信息在内存数据库中创建数据表并在数据表中插入相关数据。其中每个对象所属的类对应一个数据表。在具体实现中,要先创建数据表,再在数据表中插入数据。具体地,创建数据表以及在数据表中插入相关数据如图8所述,在此不再赘述。The table creation unit 104 is further configured to create a data table in the in-memory database according to the query object and all object information associated with the query object, and insert relevant data in the data table. Each class to which each object belongs corresponds to a data table. In the specific implementation, you must first create a data table, and then insert data in the data table. Specifically, the data table is created and the related data is inserted in the data table as shown in FIG. 8 , and details are not described herein again.
结果返回单元107还用于在内存数据库中执行SQL语句并返回查询执行结果。该查询执行结果为一条条的记录,如一个或者多个具体主机的信息,一个或者多个具体虚拟机的信息等,一个或者多个具体网络的信息等。The result return unit 107 is also used to execute the SQL statement in the in-memory database and return the query execution result. The query execution result is a record of one strip, such as information of one or more specific hosts, information of one or more specific virtual machines, information of one or more specific networks, and the like.
上述实施例通过建立内存数据库,将查询对象所对应的数据表和该查询对象相关联的所有对象所对应的数据表都保存在内存数据库中,vCenter中的相关数据有变动时,也会实时更新到内存数据库中,再从内存数据库中取相关的数据来生成多层关系树状图,无需再重新从vCenter中获取所有需要的数据,加快了查询的速度,更一步节省了定位问题和故障分析的时间,提高了运维管理的效率。The foregoing embodiment saves the data table corresponding to the data table corresponding to the query object and all the objects associated with the query object in the in-memory database by establishing an in-memory database, and the real-time update is also performed when the related data in the vCenter changes. Go to the in-memory database, and then retrieve the relevant data from the in-memory database to generate a multi-layer relationship tree, eliminating the need to re-fetch all the required data from vCenter, speeding up the query, and saving positioning problems and failure analysis. Time has improved 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. 11 includes a receiving unit 111, a filtering unit 112, an in-memory database establishing unit 113, a table creating unit 114, a tree diagram generating unit 115, a query sentence generating unit 116, a result returning unit 117, a storage container creating unit 118, and a result holding unit 119. And display unit 120. The receiving unit 111, the filtering unit 112, the in-memory database establishing unit 113, the table creating unit 114, the tree diagram generating unit 115, the query sentence generating unit 116, and the result returning unit 117 refer to the contents described in the embodiment of FIG. The difference between the embodiment of FIG. 11 and the embodiment of FIG. 10 is that the storage container creating unit 118, the result holding unit 119, and the display unit 120 are added.
存储容器创建单元118用于接收到vCenter中发出的告警信息后,创建存储容器。其中,创建的存储容器可以为一个或者多个。如接收到vCenter中发出的一个丢包率突然升高的告警信息,接受到告警信息后,创建购物车,再创建购物车的篮子。其中,创建的购物车可以有多个,一个购物车可以创建多个篮子。The storage container creating unit 118 is configured to create a storage container after receiving the alarm information sent in the vCenter. Among them, the created storage container can be one or more. If receiving a warning message that the packet loss rate suddenly rises in the vCenter, after receiving the alarm information, create a shopping cart and create a shopping cart basket. Among them, there can be more than one shopping cart, 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 the alarm information in the cloud environment suddenly increases, the object involved in the alarm information is the network. According to the receiving unit 111, the filtering unit 112, the in-memory database establishing unit 113, the table creating unit 114, the tree diagram generating unit 115, the query sentence generating unit 116, and the result returning unit 117, the object related to the alarm information is input, according to the The object involved in the alarm information is queried to obtain the query execution result. Specifically, the receiving unit 111, the filtering unit 112, the in-memory database establishing unit 113, the table creating unit 114, the tree diagram generating unit 115, the query sentence generating unit 116, and the result returning unit 117 can refer to the embodiment described in FIG. Please refer to the content of the embodiment of FIG. 10, and details are not described herein again. The result of the query execution is a record of a specific object, such as information of one or more specific hosts, information of one or more specific virtual machines, information of one or more specific networks, and the like.
结果保存单元119用于将该告警信息所涉及到的对象的查询执行结果保存在存储容器中。将一次查询的查询执行结果保存在一个购物车的篮子里。将多次查询的多个查询执行结果保存在一个购物车的多个篮子里,或者保存在多个购物车的篮子里。The result saving unit 119 is configured to save the query execution result of the object involved in the alarm information in the storage container. Save the query execution results of one query in a shopping cart basket. Save multiple query execution results from 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 in the query execution result. Preferably, the selected detection object is a plurality. Specifically, multiple objects in the query execution result of one query may be selected, or multiple objects in the query execution result of multiple queries may be selected. It will be appreciated that multiple objects may be selected in multiple baskets of one shopping cart or multiple objects 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 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 acquiring unit 122, and a generating display unit 123. The time period receiving unit 121 is configured to receive a time period to be detected input by the user. The time to be detected can be several hours in a day, or several days, or several weeks. The performance data obtaining unit 122 is configured to acquire performance data of the detection object during the time period according to the detection object. Among them, the performance data includes one of CPU performance, memory performance, network performance, and the like. The generation display unit 123 is configured to generate and display a performance graph 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 graph. When multiple curves are put together, it is easy to find the object corresponding to the abnormal curve. The object corresponding to the abnormal curve is further checked for finding the source of the alarm information.
上述方法实施例接收到告警信息后,选择查询执行结果中的检测对象,生成并显示该检测对象的性能曲线图,尤其是多个检测对象的多个曲线图,进一步方便用户查询告警信息的来源。加快了查询的速度,更一步节省了定位问题和故障分析的时间,提高了运维管理的效率。After receiving the alarm information, the foregoing method embodiment selects the detection object in the query execution result, generates and displays a performance graph of the detection object, in particular, multiple graphs of the plurality of detection objects, further facilitating the user to query the source of the alarm information. . It speeds up the query, saves the positioning problem and the time of fault analysis, and improves the efficiency of operation and maintenance management.
图13为本发明实施例提供的一种服务器管理系统的示意性框图。该服务器管理系统130包括输入设备131、输出设备132、存储设备133以及处理设备134,上述输入设备131、输出设备132、存储设备133以及处理设备134相互连接。其中:FIG. 13 is a schematic block diagram of a server management system according to an embodiment of the present invention. The server management system 130 includes an input device 131, an output device 132, a storage device 133, and a processing device 134. The input device 131, the output device 132, the storage device 133, and the processing device 134 are connected to each other. among them:
输入设备131用于提供用户输入查询对象、输入要查询的数据表和字段、输入查询条件等。具体实现中,本发明实施例的输入设备131可包括键盘、鼠标、光电输入设备、声音输入设备、触摸式输入设备等。The input device 131 is configured to provide a user input query object, input a data table and field to be queried, input query conditions, and the like. In a specific implementation, the input device 131 of 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 multi-layer relationship tree, output a query execution result, a performance graph of the object to be detected, and the like. In a specific implementation, the output device 132 of the embodiment of the present invention may include a display, a display screen, a touch screen, and the like.
存储设备133用于存储在所述服务器管理系统中实现关联信息查询的程序及数据信息。其中,本发明实施例中存储设备133存储的数据信息包括用户输入的查询对象、与所述查询对象相关联的所有的对象信息、数据表和数据表中的字段、多层关系树状图、告警信息、创建的存储容器、要检测对象的性能数据等。具体实现中,本发明实施例的存储设备133与处理设备134可以在同一个终端上,也可以在不同的终端。The storage device 133 is configured to store a program and data information for implementing the related information query in the server management system. The data information stored by the storage device 133 in the embodiment of the present invention includes a query object input by the user, all object information associated with the query object, a field in the data table and the data table, a multi-layer relationship tree diagram, Alarm information, created storage container, performance data of the object to be detected, and so on. In a specific implementation, the storage device 133 and the processing device 134 of the embodiment of the present invention may be on the same terminal or different terminals.
处理设备134用于运行存储设备133中存储的程序,以执行如下操作:The processing device 134 is configured to run a program stored in the storage device 133 to perform the following operations:
接收用户输入的查询对象;根据所述查询对象在所述存储设备中筛选出与所述查询对象相关联的所有的对象信息;根据所述查询对象和所述对象信息创建数据表并在数据表中插入相关数据,其中每个对象所属的类对应一个数据表;根据所述数据表和数据表中的字段生成多层关系树状图;接收用户在多层关系树状图中选择的数据表和字段,以及用户输入的查询条件;根据选择的数据表和字段,以及输入的查询条件生成SQL语句;执行SQL语句并返回查询执行结果。Receiving a query object input by the user; filtering all object information associated with the query object in the storage device according to the query object; creating a data table according to the query object and the object information, and in the data table Inserting relevant data, wherein each object belongs to a class corresponding to a data table; generating a multi-level relation tree according to the fields in the data table and the data table; receiving a data table selected by the user in the multi-layer relationship tree And the field, and the query condition input by the user; generate a SQL statement according to the selected data table and field, and the input query condition; execute the SQL statement and return the query execution result.
处理设备134还执行如下操作:Processing device 134 also performs the following operations:
获取每个对象所属类的属性和所述属性的值;将每个类的属性转化为SQL语句并执行所述SQL语句以创建数据表,将每个类的属性和所述属性的值转化为SQL语句并执行所述SQL语句以在数据表中插入数据。Obtaining the attributes of the class to which each object belongs and the value of the attribute; converting the attributes of each class into SQL statements and executing the SQL statement to create a data table, converting the attributes of each class and the values of the attributes into The SQL statement executes the SQL statement to insert data into the data table.
处理设备134还执行如下操作:Processing device 134 also performs the following operations:
获取用户输入的查询对象所对应的数据表的名称;判断是否存在所述数据表的名称;若存在所述数据表的名称,将所述数据表的名称作为第一层节点保存;获取所述数据表的所有字段;将所述数据表的所有字段作为所述数据表的名称所对应的节点的下一层节点保存;获取每一个字段所属的类型;对于每一个字段,根据所述字段的类型判断所述字段中是否涉及有其他数据表;若涉及有其他数据表,获取所对应的数据表的名称;判断是否存在所对应的数据表的名称;若存在所述数据表的名称,判断是否保存有所述数据表的名称;若没有保存所述数据表的名称,返回获取所述数据表的所有字段的步骤;若保存有所述数据表的名称或者对于每一个字段都不涉及有其他数据表,根据保存的所有节点生成多层关系树状图。Obtaining a name of a data table corresponding to the query object input by the user; determining whether the name of the data table exists; if the name of the data table exists, saving the name of the data table as a first layer node; acquiring the All fields of the data table; all fields of the data table are saved as nodes of a node corresponding to the name of the data table; obtaining the type to which each field belongs; for each field, according to the field The type determines whether there are other data tables involved in the field; if other data tables are involved, obtain the name of the corresponding data table; determine whether there is a name of the corresponding data table; if the name of the data table exists, determine Whether the name of the data table is saved; if the name of the data table is not saved, the step of obtaining all the fields of the data table is returned; if the name of the data table is saved or not for each field Other data tables generate a multi-level relationship tree based on all saved nodes.
处理设备134还执行如下操作:Processing device 134 also performs the following operations:
建立内存数据库,所述内存数据库与所述存储设备相连接;根据所述查询对象和所述对象信息在所述内存数据库中创建数据表并在数据表中插入相关数据。Establishing an in-memory database, the in-memory database is connected to the storage device; creating a data table in the in-memory database according to the query object and the object information, and inserting related data in the data table.
处理设备134还执行如下操作:Processing device 134 also performs the following operations:
接收到vCenter中发出的告警信息后,创建存储容器;将所述告警信息所涉及到的对象的查询执行结果保存在所述存储容器中;接收用户在所述查询执行结果中选择的检测对象;根据所述检测对象生成并显示所述检测对象的性能曲线图以供查找所述告警信息的来源。After receiving the alarm information sent by the vCenter, the storage container is created; the query execution result of the object involved in the alarm information is saved in the storage container; and the detection object selected by the user in the query execution result is received; Generating and displaying a performance graph of the detected object according to the detection object for searching for a source of the alarm information.
本发明还提供一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者一个以上程序,所述一个或者一个以上程序可被一个或者一个以上的处理器执行,以实现以下步骤:The invention also provides a computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the steps of:
接收vCenter中用户输入的查询对象;根据所述查询对象在vCenter中筛选出与所述查询对象相关联的所有的对象信息;根据所述查询对象和所述对象信息创建数据表并在数据表中插入相关数据,其中每个对象所属的类对应一个数据表;根据所述数据表生成多层关系树状图;接收用户在多层关系树状图中选择的数据表和字段,以及用户输入的查询条件;根据选择的数据表和字段,以及输入的查询条件生成SQL语句;执行SQL语句并返回查询执行结果。Receiving a query object input by a user in the vCenter; filtering all object information associated with the query object in the vCenter according to the query object; creating a data table according to the query object and the object information, and in the data table Inserting related data, wherein each object belongs to a class corresponding to a data table; generating a multi-level relation tree according to the data table; receiving data tables and fields selected by the user in the multi-layer relationship tree, and user input Query conditions; generate SQL statements according to selected data tables and fields, and input query conditions; execute SQL statements and return query execution results.
优选地,所述步骤还包括:Preferably, the step further comprises:
获取每个对象所属类的属性和所述属性的值;将每个类的属性转化为SQL语句并执行所述SQL语句以创建数据表,将每个类的属性和所述属性的值转化为SQL语句并执行所述SQL语句以在数据表中插入数据。Obtaining the attributes of the class to which each object belongs and the value of the attribute; converting the attributes of each class into SQL statements and executing the SQL statement to create a data table, converting the attributes of each class and the values of the attributes into The SQL statement executes the SQL statement to insert data into the data table.
优选地,所述步骤还包括:Preferably, the step further comprises:
获取用户输入的查询对象所对应的数据表的名称;判断是否存在所述数据表的名称;若存在所述数据表的名称,将所述数据表的名称作为第一层节点保存;获取所述数据表的所有字段;将所述数据表的所有字段作为所述数据表的名称所对应的节点的下一层节点保存;获取每一个字段所属的类型;对于每一个字段,根据所述字段的类型判断所述字段中是否涉及有其他数据表;若涉及有其他数据表,获取所对应的数据表的名称;判断是否存在所对应的数据表的名称;若存在所述数据表的名称,判断是否保存有所述数据表的名称;若没有保存所述数据表的名称,返回获取所述数据表的所有字段的步骤;若保存有所述数据表的名称或者对于每一个字段都不涉及有其他数据表,根据保存的所有节点生成多层关系树状图。Obtaining a name of a data table corresponding to the query object input by the user; determining whether the name of the data table exists; if the name of the data table exists, saving the name of the data table as a first layer node; acquiring the All fields of the data table; all fields of the data table are saved as nodes of a node corresponding to the name of the data table; obtaining the type to which each field belongs; for each field, according to the field The type determines whether there are other data tables involved in the field; if other data tables are involved, obtain the name of the corresponding data table; determine whether there is a name of the corresponding data table; if the name of the data table exists, determine Whether the name of the data table is saved; if the name of the data table is not saved, the step of obtaining all the fields of the data table is returned; if the name of the data table is saved or not for each field Other data tables generate a multi-level relationship tree based on all saved nodes.
优选地,所述步骤还包括:Preferably, the step further comprises:
建立内存数据库,所述内存数据库与vCenter相连接;根据所述查询对象和所述对象信息在所述内存数据库中创建数据表并在数据表中插入相关数据。Establishing an in-memory database, where the in-memory database is connected to the vCenter; creating a data table in the in-memory database according to the query object and the object information, and inserting related data in the data table.
优选地,所述步骤还包括:Preferably, the step further comprises:
接收到vCenter中发出的告警信息后,创建存储容器;将所述告警信息所涉及到的对象的查询执行结果保存在所述存储容器中;接收用户在所述查询执行结果中选择的检测对象;根据所述检测对象生成并显示所述检测对象的性能曲线图以供查找所述告警信息的来源。After receiving the alarm information sent by the vCenter, the storage container is created; the query execution result of the object involved in the alarm information is saved in the storage container; and the detection object selected by the user in the query execution result is received; Generating and displaying a performance graph of the detected object according to the detection object for searching for a source of the alarm information.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的终端和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。A person skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working process of the terminal and the unit described above can be referred to the corresponding process in the foregoing method embodiment, and details are not described herein again. Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both, for clarity of hardware and software. Interchangeability, the composition and steps of the various examples have been generally described in terms of function in the above description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods for implementing the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
在本申请所提供的几个实施例中,应该理解到,所揭露的终端和方法,可以通过其它的方式实现。例如,以上所描述的终端实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口、装置或单元的间接耦合或通信连接,也可以是电的,机械的或其它的形式连接。In the several embodiments provided by the present application, it should be understood that the disclosed terminal and method may be implemented in other manners. For example, the terminal embodiments described above are merely illustrative. 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 Can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, or an electrical, mechanical or other form 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, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives 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 physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分,或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备
( 可以是个人计算机,服务器,或者网络设备等 ) 执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括 :U 盘、移动硬盘、只读存储器
(ROM,Read-Only Memory)、随机存取存储器 (RAM,Random Access
Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention contributes in essence or to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium. Including several instructions to make a computer device
(may be a personal computer, server, or network device, etc.) Performing all or part of the steps of the method described in various embodiments of the present invention. The foregoing storage medium includes: a USB flash drive, a mobile hard disk, and a read only memory.
(ROM, Read-Only Memory), random access memory (RAM, Random Access)
A variety of media that can store program code, such as a memory, a disk, or an optical disk.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。The above is only the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any equivalent person can be easily conceived within the technical scope of the present invention by any person skilled in the art. Modifications or substitutions are intended to be included within the scope of the invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.