CN109063210B - Resource object query method, device, equipment and storage medium of storage system - Google Patents
Resource object query method, device, equipment and storage medium of storage system Download PDFInfo
- Publication number
- CN109063210B CN109063210B CN201811114612.8A CN201811114612A CN109063210B CN 109063210 B CN109063210 B CN 109063210B CN 201811114612 A CN201811114612 A CN 201811114612A CN 109063210 B CN109063210 B CN 109063210B
- Authority
- CN
- China
- Prior art keywords
- resource object
- snapshot
- target
- resource
- instance
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 29
- 230000004044 response Effects 0.000 claims abstract description 18
- 238000013507 mapping Methods 0.000 claims abstract description 15
- 238000004590 computer program Methods 0.000 claims description 12
- 230000003993 interaction Effects 0.000 abstract description 8
- 230000000694 effects Effects 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Stored Programmes (AREA)
Abstract
Description
技术领域technical field
本发明涉及存储技术领域,特别是涉及一种存储系统的资源对象查询方法、装置、设备及存储介质。The present invention relates to the field of storage technologies, and in particular, to a resource object query method, device, device and storage medium of a storage system.
背景技术Background technique
随着计算机技术的快速发展,存储系统在各行业的应用越来越广泛。With the rapid development of computer technology, storage systems are more and more widely used in various industries.
在存储系统中,多是通过GUI(Graphical User Interface,图形用户界面)呈现资源对象、告警事件、性能指标、状态信息等大量信息。为了获取并展示这些信息,GUI需要与存储MCS(Multiple Controller System,多控制器系统)之间进行高频度的信息查询请求。针对这些信息的查询请求越多越频繁,命令交互成本越高,后端的CPU(CentralProcessing Unit,中央处理器)占用率和内存消耗越大,严重时会影响GUI的页面响应时间和用户体验。In a storage system, a large amount of information such as resource objects, alarm events, performance indicators, and status information is mostly presented through a GUI (Graphical User Interface, graphical user interface). In order to obtain and display the information, the GUI needs to perform high-frequency information query requests with the storage MCS (Multiple Controller System). The more and more frequent query requests for such information, the higher the command interaction cost, the greater the CPU (Central Processing Unit, central processing unit) occupancy rate and the memory consumption of the back-end, which will affect the GUI page response time and user experience in severe cases.
如何减少GUI与存储MCS之间的命令交互成本,是目前本领域技术人员亟需解决的技术问题。How to reduce the command interaction cost between the GUI and the storage MCS is a technical problem that those skilled in the art need to solve urgently.
发明内容SUMMARY OF THE INVENTION
本发明的目的是提供一种存储系统的资源对象查询方法、装置、设备及存储介质,以减少GUI与存储MCS之间的命令交互成本,提高前端页面的响应效率,提升用户体验。The purpose of the present invention is to provide a resource object query method, device, device and storage medium of a storage system, so as to reduce the command interaction cost between GUI and storage MCS, improve the response efficiency of front-end pages, and improve user experience.
为解决上述技术问题,本发明提供如下技术方案:In order to solve the above-mentioned technical problems, the present invention provides the following technical solutions:
一种存储系统的资源对象查询方法,包括:A resource object query method of a storage system, comprising:
在存储系统正常运行过程中,接收针对目标资源对象的查询指令;During the normal operation of the storage system, receive a query instruction for the target resource object;
获取所述目标资源对象所属的目标资源类;Obtain the target resource class to which the target resource object belongs;
在预先建立的资源类与快照类的关系映射表中查询所述目标资源类对应的目标快照类;query the target snapshot class corresponding to the target resource class in the pre-established resource class and snapshot class relationship mapping table;
以所述目标快照类为主键,从缓存池中查询目标快照实例;Using the target snapshot class as the primary key, query the target snapshot instance from the cache pool;
以所述目标资源对象的标识为主键,从所述目标快照实例的资源集合中查询目标资源对象实例;Using the identifier of the target resource object as the primary key, query the target resource object instance from the resource collection of the target snapshot instance;
进一步查询所述目标资源对象实例的所需属性。Further query the desired properties of the target resource object instance.
在本发明的一种具体实施方式中,所述进一步查询所述目标资源对象实例的所需属性,包括:In a specific embodiment of the present invention, the further querying the required attributes of the target resource object instance includes:
从所述目标资源对象的构造器中取出所述目标快照实例和索引;Take out the target snapshot instance and index from the constructor of the target resource object;
从所述目标快照实例中取出结果集;Get a result set from the target snapshot instance;
基于所述结果集的第1行,获得资源列表的属性表头;Based on the first row of the result set, obtain the attribute header of the resource list;
根据资源的索引index从卷列表中获取第index+1行,获得特定资源的属性值列表;Get the index+1 row from the volume list according to the index index of the resource, and get the attribute value list of the specific resource;
遍历所述属性值列表的表头,依次从所述属性值列表中取值,将每个属性及属性值保存到键值对数据类型中,得到所述特定资源的属性及属性值键值对;Traverse the header of the attribute value list, take values from the attribute value list in turn, save each attribute and attribute value in the key-value pair data type, and obtain the attribute and attribute-value key-value pair of the specific resource ;
根据待查询属性的属性名称,从所述属性及属性值键值对中查找对应的字符串值;According to the attribute name of the attribute to be queried, the corresponding string value is searched from the attribute and attribute value key-value pair;
将所述字符串值解码为所述待查询属性对应的数据类型。Decode the string value into a data type corresponding to the property to be queried.
在本发明的一种具体实施方式中,还包括:In a specific embodiment of the present invention, it also includes:
在所述存储系统启动时,遍历所述存储系统中所有预定义的快照类,为每个快照类创建一个快照实例;When the storage system is started, all predefined snapshot classes in the storage system are traversed, and a snapshot instance is created for each snapshot class;
以快照类为主键,以快照实例为值,存放在所述缓存池中;The snapshot class is used as the primary key, and the snapshot instance is used as the value, and is stored in the cache pool;
通过快照实例加载所述存储系统的每个资源对象。Each resource object of the storage system is loaded by a snapshot instance.
在本发明的一种具体实施方式中,所述通过快照实例加载所述存储系统的每个资源对象中,包括:In a specific embodiment of the present invention, the loading of each resource object of the storage system by using a snapshot instance includes:
针对每个资源对象,获取查询该资源对象的MCS命令;For each resource object, obtain the MCS command for querying the resource object;
向多控制器系统发送针对所述MCS命令的执行请求,并接收所述多控制器系统返回的响应结果;sending an execution request for the MCS command to the multi-controller system, and receiving a response result returned by the multi-controller system;
将所述响应结果按行保存在所述缓存池中的结果集中;saving the response result in the result set in the cache pool by row;
根据行索引遍历所述结果集中的数据行;Traverse the data rows in the result set according to the row index;
调用该资源对象的构造器,以快照实例和行索引为参数构造一个资源对象实例;Call the constructor of the resource object to construct a resource object instance with the snapshot instance and row index as parameters;
以该资源对象的标识为主键,以该资源对象实例为值,保存在快照实例的资源集合中。The identifier of the resource object is used as the primary key, and the resource object instance is used as the value, which is stored in the resource collection of the snapshot instance.
一种存储系统的资源对象查询装置,包括:A resource object query device of a storage system, comprising:
查询指令接收模块,用于在存储系统正常运行过程中,接收针对目标资源对象的查询指令;The query instruction receiving module is used to receive the query instruction for the target resource object during the normal operation of the storage system;
资源类获取模块,用于获取所述目标资源对象所属的目标资源类;a resource class obtaining module, used to obtain the target resource class to which the target resource object belongs;
快照类查询模块,用于在预先建立的资源类与快照类的关系映射表中查询所述目标资源类对应的目标快照类;A snapshot class query module, used for querying the target snapshot class corresponding to the target resource class in a pre-established relationship mapping table between resource classes and snapshot classes;
快照实例查询模块,用于以所述目标快照类为主键,从缓存池中查询目标快照实例;a snapshot instance query module, used for querying the target snapshot instance from the cache pool with the target snapshot class as the primary key;
资源对象实例查询模块,用于以所述目标资源对象的标识为主键,从所述目标快照实例的资源集合中查询目标资源对象实例;A resource object instance query module, configured to use the identifier of the target resource object as a primary key to query the target resource object instance from the resource collection of the target snapshot instance;
属性查询模块,用于进一步查询所述目标资源对象实例的所需属性。The attribute query module is used to further query the required attributes of the target resource object instance.
在本发明的一种具体实施方式中,所述属性查询模块,具体用于:In a specific embodiment of the present invention, the attribute query module is specifically used for:
从所述目标资源对象的构造器中取出所述目标快照实例和索引;Take out the target snapshot instance and index from the constructor of the target resource object;
从所述目标快照实例中取出结果集;Get a result set from the target snapshot instance;
基于所述结果集的第1行,获得资源列表的属性表头;Based on the first row of the result set, obtain the attribute header of the resource list;
根据资源的索引index从卷列表中获取第index+1行,获得特定资源的属性值列表;Get the index+1 row from the volume list according to the index index of the resource, and get the attribute value list of the specific resource;
遍历所述属性值列表的表头,依次从所述属性值列表中取值,将每个属性及属性值保存到键值对数据类型中,得到所述特定资源的属性及属性值键值对;Traverse the header of the attribute value list, take values from the attribute value list in turn, save each attribute and attribute value in the key-value pair data type, and obtain the attribute and attribute-value key-value pair of the specific resource ;
根据待查询属性的属性名称,从所述属性及属性值键值对中查找对应的字符串值;According to the attribute name of the attribute to be queried, the corresponding string value is searched from the attribute and attribute value key-value pair;
将所述字符串值解码为所述待查询属性对应的数据类型。Decode the string value into a data type corresponding to the property to be queried.
在本发明的一种具体实施方式中,还包括缓存模型构建模块,用于:In a specific embodiment of the present invention, it also includes a cache model building module for:
在所述存储系统启动时,遍历所述存储系统中所有预定义的快照类,为每个快照类创建一个快照实例;When the storage system is started, all predefined snapshot classes in the storage system are traversed, and a snapshot instance is created for each snapshot class;
以快照类为主键,以快照实例为值,存放在所述缓存池中;The snapshot class is used as the primary key, and the snapshot instance is used as the value, and is stored in the cache pool;
通过快照实例加载所述存储系统的每个资源对象。Each resource object of the storage system is loaded by a snapshot instance.
在本发明的一种具体实施方式中,所述缓存模型构建模块,具体用于:In a specific embodiment of the present invention, the cache model building module is specifically used for:
针对每个资源对象,获取查询该资源对象的MCS命令;For each resource object, obtain the MCS command for querying the resource object;
向多控制器系统发送针对所述MCS命令的执行请求,并接收所述多控制器系统返回的响应结果;sending an execution request for the MCS command to the multi-controller system, and receiving a response result returned by the multi-controller system;
将所述响应结果按行保存在所述缓存池中的结果集中;saving the response result in the result set in the cache pool by row;
根据行索引遍历所述结果集中的数据行;Traverse the data rows in the result set according to the row index;
调用该资源对象的构造器,以快照实例和行索引为参数构造一个资源对象实例;Call the constructor of the resource object to construct a resource object instance with the snapshot instance and row index as parameters;
以该资源对象的标识为主键,以该资源对象实例为值,保存在快照实例的资源集合中。The identifier of the resource object is used as the primary key, and the resource object instance is used as the value, which is stored in the resource collection of the snapshot instance.
一种存储系统的资源对象查询设备,包括:A resource object query device of a storage system, comprising:
存储器,用于存储计算机程序;memory for storing computer programs;
处理器,用于执行所述计算机程序时实现上述任一项所述存储系统的资源对象查询方法的步骤。The processor is configured to implement the steps of the resource object query method of any one of the storage systems described above when executing the computer program.
一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一项所述存储系统的资源对象查询方法的步骤。A computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, implements the steps of any one of the above-mentioned methods for querying a resource object of the storage system.
应用本发明实施例所提供的技术方案,在存储系统正常运行过程中,接收到针对目标资源对象的查询指令后,获取目标资源对象所属的目标资源类,在预先建立的资源类与快照类的关系映射表中查询目标资源类对应的目标快照类,以目标快照类为主键,从缓存池中查询目标快照实例,以目标资源对象的标识为主键,从目标快照实例的资源集合中查询目标资源对象实例,进一步查询目标资源对象实例的所需属性。通过预先将资源对象的相关信息加载到系统内存中,在查询资源对象时可以减少GUI与存储MCS之间的命令交互成本,提高前端页面的响应效率,提升用户体验。By applying the technical solution provided by the embodiment of the present invention, during the normal operation of the storage system, after receiving the query instruction for the target resource object, the target resource class to which the target resource object belongs is obtained, and the target resource class to which the target resource object belongs is obtained. Query the target snapshot class corresponding to the target resource class in the relational mapping table, use the target snapshot class as the primary key, query the target snapshot instance from the cache pool, use the identifier of the target resource object as the primary key, and query the target resource from the resource collection of the target snapshot instance object instance, and further query the required properties of the target resource object instance. By preloading the relevant information of the resource object into the system memory, the command interaction cost between the GUI and the storage MCS can be reduced when the resource object is queried, the response efficiency of the front-end page is improved, and the user experience is improved.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts.
图1为本发明实施例中一种存储系统的资源对象查询方法的实施流程图;1 is an implementation flowchart of a method for querying a resource object of a storage system in an embodiment of the present invention;
图2为本发明实施例中查询卷的命令返回结果示意图;Fig. 2 is the schematic diagram of the command return result of query volume in the embodiment of the present invention;
图3为本发明实施例中一种存储系统的资源对象查询装置的结构示意图;3 is a schematic structural diagram of a resource object query device of a storage system according to an embodiment of the present invention;
图4为本发明实施例中一种存储系统的资源对象查询设备的结构示意图。FIG. 4 is a schematic structural diagram of a resource object query device of a storage system according to an embodiment of the present invention.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本发明方案,下面结合附图和具体实施方式对本发明作进一步的详细说明。显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make those skilled in the art better understand the solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, but not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
参见图1所示,为本发明实施例所提供的一种存储系统的资源对象查询方法的实施流程图,该方法可以包括以下步骤:Referring to FIG. 1, it is an implementation flowchart of a method for querying a resource object of a storage system provided by an embodiment of the present invention. The method may include the following steps:
S110:在存储系统正常运行过程中,接收针对目标资源对象的查询指令。S110: During the normal operation of the storage system, receive a query instruction for the target resource object.
在存储系统正常运行过程中,用户可以向存储系统的GUI发送针对目标资源对象的查询指令。接收到针对目标资源对象的查询指令后,可以继续执行步骤S120的操作。During the normal operation of the storage system, the user can send a query instruction for the target resource object to the GUI of the storage system. After receiving the query instruction for the target resource object, the operation of step S120 may be continued.
存储系统中的资源对象可以是卷、池等。Resource objects in a storage system can be volumes, pools, and so on.
S120:获取目标资源对象所属的目标资源类。S120: Obtain the target resource class to which the target resource object belongs.
在本发明实施例中,可以预先为每一类资源对象定义一个资源类及一个对应的快照类,并将资源类和快照类的关系保存在一张映射表中,建立资源类与快照类的关系映射表。In the embodiment of the present invention, a resource class and a corresponding snapshot class can be defined for each type of resource object in advance, and the relationship between the resource class and the snapshot class can be saved in a mapping table, and the relationship between the resource class and the snapshot class can be established. Relationship mapping table.
其中,资源类包含构造器、所有属性的属性列表、属性的解析方法等。以资源对象为卷(VDisk)为例,属性列表中可以包含卷的标识(ID)、卷的名称、卷的容量、所属池(MDisk)名称、所属输入输出组(IO Group)名称等。属性的解析方法,即从构造参数中解析得到某一属性值的方法。Among them, the resource class includes the constructor, the attribute list of all attributes, the parsing method of the attribute, and so on. Taking the resource object as a volume (VDisk) as an example, the attribute list can include the volume identifier (ID), the volume name, the volume capacity, the name of the pool (MDisk) to which it belongs, and the name of the input and output group (IO Group) to which it belongs. The parsing method of the attribute, that is, the method of parsing the value of an attribute from the construction parameters.
快照类包含查询该类资源对象的MCS命令、查询命令返回的结果集及具体的资源对象实例集合。The snapshot class includes the MCS command to query the resource object of this type, the result set returned by the query command, and the specific resource object instance set.
根据预定义的资源类和快照类,可以获取目标资源对象所属的目标资源类。According to the predefined resource class and snapshot class, you can obtain the target resource class to which the target resource object belongs.
S130:在预先建立的资源类与快照类的关系映射表中查询目标资源类对应的目标快照类。S130: Query the target snapshot class corresponding to the target resource class in the pre-established relationship mapping table between the resource class and the snapshot class.
如前所描述的,预先为每一类资源对象定义一个资源类及一个对应的快照类,并将资源类和快照类的关系保存在一张映射表中,建立资源类与快照类的关系映射表。As described above, define a resource class and a corresponding snapshot class for each type of resource object in advance, save the relationship between the resource class and the snapshot class in a mapping table, and establish the relationship mapping between the resource class and the snapshot class surface.
获取目标资源对象所属的目标资源类后,可以在资源类与快照类的关系映射表中查询目标资源类对应的目标快照类。After obtaining the target resource class to which the target resource object belongs, you can query the target snapshot class corresponding to the target resource class in the relationship mapping table between resource classes and snapshot classes.
S140:以目标快照类为主键,从缓存池中查询目标快照实例。S140: Using the target snapshot class as the primary key, query the target snapshot instance from the cache pool.
在本发明实施例中,在存储系统启动时,可以遍历存储系统中所有预定义的快照类,为每个快照类创建一个快照实例,然后以快照类为主键,以快照实例为值,存放在缓存池中,并通过快照实例加载存储系统的每个资源对象,即触发快照实例的加载资源对象的操作。In the embodiment of the present invention, when the storage system is started, all predefined snapshot classes in the storage system can be traversed, a snapshot instance is created for each snapshot class, and then the snapshot class is used as the primary key, and the snapshot instance is used as the value, which is stored in the In the cache pool, each resource object of the storage system is loaded through the snapshot instance, that is, the operation of loading the resource object of the snapshot instance is triggered.
具体的,针对每个资源对象,可以获取查询该资源对象的MCS命令,向多控制器系统MCS发送针对MCS命令的执行请求,并接收多控制器系统返回的响应结果,图2所示即为查询卷的命令返回结果。将响应结果按行保存在缓存池的结果集中,根据行索引遍历结果集中的数据行,调用该资源对象的构造器,以快照实例和行索引为参数构造一个资源对象实例,查询该资源对象的标识,即ID,以该资源对象的标识为主键,以该资源对象实例为值,保存在快照实例的资源集合中。Specifically, for each resource object, the MCS command for querying the resource object can be obtained, the execution request for the MCS command can be sent to the multi-controller system MCS, and the response result returned by the multi-controller system can be received, as shown in FIG. 2 . Commands to query volumes return results. Save the response results in the result set of the cache pool by row, traverse the data rows in the result set according to the row index, call the constructor of the resource object, construct a resource object instance with the snapshot instance and row index as parameters, and query the resource object The identifier, that is, the ID, takes the identifier of the resource object as the primary key and the resource object instance as the value, and is stored in the resource collection of the snapshot instance.
即在存储系统每次启动时,缓存池中都预先存放了每个资源对象对应的快照类相关信息,该快照类相关信息以快照类为主键,以快照实例为值。在查询得到目标资源类对应的目标快照类后,可以以目标快照类为主键,从缓存池中查询目标快照实例。That is, each time the storage system is started, the cache pool pre-stores the snapshot class related information corresponding to each resource object. The snapshot class related information uses the snapshot class as the primary key and the snapshot instance as the value. After querying to obtain the target snapshot class corresponding to the target resource class, you can use the target snapshot class as the primary key to query the target snapshot instance from the cache pool.
S150:以目标资源对象的标识为主键,从目标快照实例的资源集合中查询目标资源对象实例。S150: Using the identifier of the target resource object as the primary key, query the target resource object instance from the resource set of the target snapshot instance.
如前所描述的,在存储系统每次启动时,快照实例的资源集合中即保存了以资源对象的标识为主键,以资源对象实例为值的相关信息。从而以目标资源对象的标识为主键,从目标快照实例的资源集合中可以查询得到目标资源对象实例。As described above, each time the storage system is started, the resource collection of the snapshot instance stores relevant information with the identifier of the resource object as the primary key and the resource object instance as the value. Therefore, with the identifier of the target resource object as the primary key, the target resource object instance can be queried from the resource set of the target snapshot instance.
S160:进一步查询目标资源对象实例的所需属性。S160: Further query the required attributes of the target resource object instance.
在本发明的一种具体实施方式中,可以通过以下步骤查询目标资源对象实例的所需属性:In a specific implementation of the present invention, the required attributes of the target resource object instance can be queried through the following steps:
步骤一:从目标资源对象的构造器中取出目标快照实例和索引;Step 1: Take out the target snapshot instance and index from the constructor of the target resource object;
步骤二:从目标快照实例中取出结果集;Step 2: Get the result set from the target snapshot instance;
步骤三:基于结果集的第1行,获得资源列表的属性表头;Step 3: Based on the first row of the result set, obtain the attribute header of the resource list;
步骤四:根据资源的索引index从卷列表中获取第index+1行,获得特定资源的属性值列表;Step 4: Obtain the index+1 row from the volume list according to the index index of the resource, and obtain the attribute value list of the specific resource;
步骤五:遍历属性值列表的表头,依次从属性值列表中取值,将每个属性及属性值保存到键值对数据类型中,得到特定资源的属性及属性值键值对;Step 5: Traverse the header of the attribute value list, take values from the attribute value list in turn, save each attribute and attribute value in the key-value pair data type, and obtain the attribute and attribute-value key-value pair of a specific resource;
步骤六:根据待查询属性的属性名称,从属性及属性值键值对中查找对应的字符串值;Step 6: According to the attribute name of the attribute to be queried, find the corresponding string value from the attribute and attribute value key-value pair;
步骤七:将字符串值解码为待查询属性对应的数据类型。Step 7: Decode the string value into the data type corresponding to the property to be queried.
为便于描述,将上述几个步骤结合起来进行说明。For the convenience of description, the above steps are combined for description.
从目标资源对象的构造器中可以取出目标快照实例和索引,从目标快照实例中取出结果集。从结果集中获取第1行,应用命令分隔符(默认为“,”)将字符串分割为子字符串列表,得到资源列表的属性表头。The target snapshot instance and index can be fetched from the constructor of the target resource object, and the result set can be fetched from the target snapshot instance. Get line 1 from the result set, apply the command delimiter ("," by default) to split the string into a list of substrings, and get the attribute header of the resource list.
根据资源的索引index从卷列表中获取第index+1行,应用命令分隔符(默认为“,”)将字符串分割为子字符串列表,得到特定资源的属性值列表。Get line index+1 from the volume list according to the resource's index index, apply the command separator ("," by default) to split the string into a list of substrings, and get a list of property values for a specific resource.
遍历属性值列表的表头,并依次从属性值列表中取值,将每个属性及属性值保存到键值对数据类型中,得到特定资源的属性及属性值键值对。Traverse the header of the attribute value list, get values from the attribute value list in turn, save each attribute and attribute value in the key-value pair data type, and obtain the attribute and attribute-value key-value pair of a specific resource.
根据想要查询的属性名称,从属性及属性值键值对中查找到对应的字符串值。将该字符串值解码为该属性对应的数据类型。According to the attribute name you want to query, find the corresponding string value from the attribute and attribute value key-value pair. Decodes the string value to the data type corresponding to the property.
在本发明实施例中,对于资源对象这样不经常发生变化的信息,将其预先加载到系统内存中,可以减少了GUI与存储MCS之间的命令交互成本,提高前端页面的加载效率,提升用户体验。在缓存中,每个资源对象之间是彼此分离的,并且每个资源对象的所有属性之间彼此分离,解耦彻底。In the embodiment of the present invention, for information that changes infrequently, such as resource objects, it is preloaded into the system memory, which can reduce the command interaction cost between the GUI and the storage MCS, improve the loading efficiency of the front-end page, and improve the user experience. experience. In the cache, each resource object is separated from each other, and all properties of each resource object are separated from each other, and the decoupling is complete.
应用本发明实施例所提供的方法,在存储系统正常运行过程中,接收到针对目标资源对象的查询指令后,获取目标资源对象所属的目标资源类,在预先建立的资源类与快照类的关系映射表中查询目标资源类对应的目标快照类,以目标快照类为主键,从缓存池中查询目标快照实例,以目标资源对象的标识为主键,从目标快照实例的资源集合中查询目标资源对象实例,进一步查询目标资源对象实例的所需属性。通过预先将资源对象的相关信息加载到系统内存中,在查询资源对象时可以减少GUI与存储MCS之间的命令交互成本,提高前端页面的响应效率,提升用户体验。By applying the method provided by the embodiment of the present invention, during the normal operation of the storage system, after receiving the query instruction for the target resource object, the target resource class to which the target resource object belongs is obtained, and the relationship between the resource class and the snapshot class established in advance is obtained. Query the target snapshot class corresponding to the target resource class in the mapping table, use the target snapshot class as the primary key, query the target snapshot instance from the cache pool, use the identifier of the target resource object as the primary key, and query the target resource object from the resource collection of the target snapshot instance instance, and further query the required properties of the target resource object instance. By preloading the relevant information of the resource object into the system memory, the command interaction cost between the GUI and the storage MCS can be reduced when the resource object is queried, the response efficiency of the front-end page is improved, and the user experience is improved.
相应于上面的方法实施例,本发明实施例还提供了一种存储系统的资源对象查询装置,下文描述的一种存储系统的资源对象查询装置与上文描述的一种存储系统的资源对象查询方法可相互对应参照。Corresponding to the above method embodiments, the embodiments of the present invention further provide a resource object query device of a storage system, a resource object query device of a storage system described below and a resource object query device of a storage system described above. The methods can refer to each other correspondingly.
参见图3所示,该装置包括:Referring to Figure 3, the device includes:
查询指令接收模块310,用于在存储系统正常运行过程中,接收针对目标资源对象的查询指令;The query
资源类获取模块320,用于获取目标资源对象所属的目标资源类;a resource
快照类查询模块330,用于在预先建立的资源类与快照类的关系映射表中查询目标资源类对应的目标快照类;The snapshot
快照实例查询模块340,用于以目标快照类为主键,从缓存池中查询目标快照实例;The snapshot
资源对象实例查询模块350,用于以目标资源对象的标识为主键,从目标快照实例的资源集合中查询目标资源对象实例;The resource object
属性查询模块360,用于进一步查询目标资源对象实例的所需属性。The
应用本发明实施例所提供的装置,在存储系统正常运行过程中,接收到针对目标资源对象的查询指令后,获取目标资源对象所属的目标资源类,在预先建立的资源类与快照类的关系映射表中查询目标资源类对应的目标快照类,以目标快照类为主键,从缓存池中查询目标快照实例,以目标资源对象的标识为主键,从目标快照实例的资源集合中查询目标资源对象实例,进一步查询目标资源对象实例的所需属性。通过预先将资源对象的相关信息加载到系统内存中,在查询资源对象时可以减少GUI与存储MCS之间的命令交互成本,提高前端页面的响应效率,提升用户体验。By applying the device provided by the embodiment of the present invention, during the normal operation of the storage system, after receiving the query instruction for the target resource object, the target resource class to which the target resource object belongs is obtained, and the relationship between the resource class and the snapshot class established in advance is Query the target snapshot class corresponding to the target resource class in the mapping table, use the target snapshot class as the primary key, query the target snapshot instance from the cache pool, use the identifier of the target resource object as the primary key, and query the target resource object from the resource collection of the target snapshot instance instance, and further query the required properties of the target resource object instance. By preloading the relevant information of the resource object into the system memory, the command interaction cost between the GUI and the storage MCS can be reduced when the resource object is queried, the response efficiency of the front-end page is improved, and the user experience is improved.
在本发明的一种具体实施方式中,属性查询模块360,具体用于:In a specific embodiment of the present invention, the
从目标资源对象的构造器中取出目标快照实例和索引;Take out the target snapshot instance and index from the constructor of the target resource object;
从目标快照实例中取出结果集;Fetch the result set from the target snapshot instance;
基于结果集的第1行,获得资源列表的属性表头;Based on the first row of the result set, get the attribute header of the resource list;
根据资源的索引index从卷列表中获取第index+1行,获得特定资源的属性值列表;Get the index+1 row from the volume list according to the index index of the resource, and get the attribute value list of the specific resource;
遍历属性值列表的表头,依次从属性值列表中取值,将每个属性及属性值保存到键值对数据类型中,得到特定资源的属性及属性值键值对;Traverse the header of the attribute value list, take values from the attribute value list in turn, save each attribute and attribute value in the key-value pair data type, and obtain the attribute and attribute-value key-value pair of a specific resource;
根据待查询属性的属性名称,从属性及属性值键值对中查找对应的字符串值;According to the attribute name of the attribute to be queried, find the corresponding string value from the attribute and attribute value key-value pair;
将字符串值解码为待查询属性对应的数据类型。Decode the string value into the data type corresponding to the property to be queried.
在本发明的一种具体实施方式中,还包括缓存模型构建模块,用于:In a specific embodiment of the present invention, it also includes a cache model building module for:
在存储系统启动时,遍历存储系统中所有预定义的快照类,为每个快照类创建一个快照实例;When the storage system starts, it traverses all the predefined snapshot classes in the storage system, and creates a snapshot instance for each snapshot class;
以快照类为主键,以快照实例为值,存放在缓存池中;The snapshot class is used as the primary key, and the snapshot instance is used as the value, which is stored in the cache pool;
通过快照实例加载存储系统的每个资源对象。Each resource object of the storage system is loaded by a snapshot instance.
在本发明的一种具体实施方式中,缓存模型构建模块,具体用于:In a specific embodiment of the present invention, the cache model building module is specifically used for:
针对每个资源对象,获取查询该资源对象的MCS命令;For each resource object, obtain the MCS command for querying the resource object;
向多控制器系统发送针对MCS命令的执行请求,并接收多控制器系统返回的响应结果;Send an execution request for the MCS command to the multi-controller system, and receive the response result returned by the multi-controller system;
将响应结果按行保存在缓存池中的结果集中;Save the response result row by row in the result set in the cache pool;
根据行索引遍历结果集中的数据行;Traverse the data rows in the result set according to the row index;
调用该资源对象的构造器,以快照实例和行索引为参数构造一个资源对象实例;Call the constructor of the resource object to construct a resource object instance with the snapshot instance and row index as parameters;
以该资源对象的标识为主键,以该资源对象实例为值,保存在快照实例的资源集合中。The identifier of the resource object is used as the primary key, and the resource object instance is used as the value, which is stored in the resource collection of the snapshot instance.
相应于上面的方法实施例,本发明实施例还提供了一种存储系统的资源对象查询设备,如图4所示,包括:Corresponding to the above method embodiments, the embodiments of the present invention further provide a resource object query device of a storage system, as shown in FIG. 4 , including:
存储器410,用于存储计算机程序;
处理器420,用于执行计算机程序时实现上述存储系统的资源对象查询方法的步骤。The
相应于上面的方法实施例,本发明实施例还提供了一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现上述存储系统的资源对象查询方法的步骤。Corresponding to the above method embodiments, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the resource object query method of the above storage system is implemented. A step of.
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts of the various embodiments may be referred to each other.
专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Professionals may further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two, in order to clearly illustrate the possibilities of hardware and software. Interchangeability, the above description has generally described the components and steps of each example in terms of function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of the present invention.
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of a method or algorithm described in connection with the embodiments disclosed herein may be directly implemented in hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in random access memory (RAM), internal memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other in the technical field. in any other known form of storage medium.
本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的技术方案及其核心思想。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以对本发明进行若干改进和修饰,这些改进和修饰也落入本发明权利要求的保护范围内。The principles and implementations of the present invention are described herein using specific examples, and the descriptions of the above embodiments are only used to help understand the technical solutions and core ideas of the present invention. It should be pointed out that for those skilled in the art, without departing from the principle of the present invention, several improvements and modifications can also be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811114612.8A CN109063210B (en) | 2018-09-25 | 2018-09-25 | Resource object query method, device, equipment and storage medium of storage system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811114612.8A CN109063210B (en) | 2018-09-25 | 2018-09-25 | Resource object query method, device, equipment and storage medium of storage system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109063210A CN109063210A (en) | 2018-12-21 |
CN109063210B true CN109063210B (en) | 2022-07-08 |
Family
ID=64762458
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811114612.8A Active CN109063210B (en) | 2018-09-25 | 2018-09-25 | Resource object query method, device, equipment and storage medium of storage system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109063210B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110231994B (en) * | 2019-06-20 | 2024-03-12 | 深圳市腾讯网域计算机网络有限公司 | Memory analysis method, memory analysis device and computer readable storage medium |
CN110515543B (en) * | 2019-08-02 | 2021-02-19 | 星辰天合(北京)数据科技有限公司 | Object storage bucket-based snapshot method, device and system |
CN114154026B (en) * | 2021-11-12 | 2024-07-02 | 北京达佳互联信息技术有限公司 | Data processing method, device, electronic equipment and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101183383A (en) * | 2007-12-17 | 2008-05-21 | 中国科学院计算技术研究所 | A kind of snapshot system and using method thereof |
US20140279992A1 (en) * | 2013-03-14 | 2014-09-18 | Bmc Software, Inc. | Storing and retrieving context senstive data in a management system |
CN107025243A (en) * | 2016-02-02 | 2017-08-08 | 北京神州泰岳软件股份有限公司 | A kind of querying method of resource data, inquiring client terminal and inquiry system |
-
2018
- 2018-09-25 CN CN201811114612.8A patent/CN109063210B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101183383A (en) * | 2007-12-17 | 2008-05-21 | 中国科学院计算技术研究所 | A kind of snapshot system and using method thereof |
US20140279992A1 (en) * | 2013-03-14 | 2014-09-18 | Bmc Software, Inc. | Storing and retrieving context senstive data in a management system |
CN107025243A (en) * | 2016-02-02 | 2017-08-08 | 北京神州泰岳软件股份有限公司 | A kind of querying method of resource data, inquiring client terminal and inquiry system |
Also Published As
Publication number | Publication date |
---|---|
CN109063210A (en) | 2018-12-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108009236B (en) | A big data query method, system, computer and storage medium | |
US9817858B2 (en) | Generating hash values | |
CN104252501B (en) | A kind of computing device and method executing database manipulation order | |
CN109063210B (en) | Resource object query method, device, equipment and storage medium of storage system | |
CN114064729B (en) | Data retrieval method, device, equipment and storage medium | |
CN107636655B (en) | System and method for providing data as a service (DaaS) in real time | |
WO2023232120A1 (en) | Data processing method, electronic device, and storage medium | |
US20190138633A1 (en) | System and method for committing and rolling back database requests | |
CN108874930A (en) | File attribute information statistical method, device, system, equipment and storage medium | |
US10366081B2 (en) | Declarative partitioning for data collection queries | |
CN109101595B (en) | Information query method, device, equipment and computer readable storage medium | |
US11514236B1 (en) | Indexing in a spreadsheet based data store using hybrid datatypes | |
CN108140022B (en) | Data query method and database system | |
CN113687920A (en) | Object strategy operation method, device and equipment of distributed system | |
US12081625B2 (en) | Session based data persistency | |
CN103500108A (en) | System memory access method, node processor and multi-processor system | |
WO2023155591A1 (en) | Progress information management and control method, micro-service apparatus, electronic device, and storage medium | |
CN112698715B (en) | Execution control method, device, embedded system, equipment and medium | |
CN106649584B (en) | Index processing method and device in master-slave database system | |
CN114238391A (en) | Data paging query method and device, electronic equipment and storage medium | |
CN110427377A (en) | Data processing method, device, equipment and storage medium | |
US11768818B1 (en) | Usage driven indexing in a spreadsheet based data store | |
CN108108422A (en) | A kind of metadata acquisition methods, device and the medium of Ceph file system | |
CN115114332A (en) | Database query method, device and equipment and readable storage medium | |
CN114281848A (en) | Report generation method, device, computer equipment, storage medium and program product |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |