Tree data loading method, device and storage medium based on CIM object classification
By classifying and merging objects in the initial tree structure according to CIM types, CIS interface calls are reduced, the problem of low query efficiency and repeated queries caused by the large amount of object data in the tree hierarchy is solved, and more efficient data loading and Query.
Patent Information
- Application Number
- CN202011622091.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-30
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2040-12-30
AI Technical Summary
In the existing technology, the amount of object data in the tree hierarchy is large, and the objects are queried independently of each other, resulting in a large number of CIS interface calls, wasting call time and bandwidth, and increasing the load on the server and the amount of memory data.
By obtaining the initial tree structure, classifying it according to CIM type, merging objects of the same type and using the CIS interface to query data for objects at the next level, determining the correspondence between objects based on the query results, and constructing the final tree structure. Reduce the number of CIS interface calls and repeated queries.
It improves object query efficiency, reduces network bandwidth usage and memory space, and reduces server load.
Smart Images

Figure CN112650892B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric power engineering, and in particular to a tree data loading method, device, storage medium and computer equipment based on CIM object classification. Background Art
[0002] The IEC61970 series of standards proposes the CIM model and CIS interface, which are important standards in the field of power system management and information exchange. The CIM model defines the semantics of information exchange, and the CIS interface clarifies the syntax of information exchange. With the maturity of the IEC61970 series of standards and the widespread application of the CIM model, more and more systems use the CIS interface and access data based on the CIM model, such as power systems.
[0003] With the development of power business, the data managed in the power system is becoming more and more numerous and complex, and the relationship between the data is becoming closer and closer, gradually forming a mesh data structure. In actual application, when all the equipment under a substation and their associated data are needed, you only need to define a tree structure and load the data in the tree structure, and you can sort out the tree hierarchical structure data that meets the business needs from the mesh data.
[0004] The traditional tree loading method is to load object data hierarchically according to the tree hierarchy and call the CIS interface method to query the detailed information of the object one by one. This method has some problems in actual use: (1) The amount of object data in the tree hierarchy is large. Querying each object one by one causes a large number of CIS interface calls, which wastes a lot of call time and network bandwidth and increases the load on the server; (2) When querying objects, they are queried independently, and there are often redundant objects in the tree structure, resulting in repeated queries, which not only increases the number of queries, but also increases the amount of data in memory. Summary of the invention
[0005] The purpose of the present invention is to solve at least one of the above-mentioned technical defects, especially the technical defects that the amount of object data in the tree hierarchy structure in the prior art is large, and the objects are queried independently from each other, resulting in a large number of CIS interface calls, wasting a lot of call time and network bandwidth, and increasing the load on the server and the amount of data in the memory.
[0006] The present invention provides a tree data loading method based on CIM object classification, comprising:
[0007] Acquire an initial tree structure, and classify objects at each level in the initial tree structure according to CIM types to obtain objects of multiple types;
[0008] After merging objects of the same type, use the CIS interface to query the data of the next-level objects, and determine the corresponding relationship between the next-level objects and the current-level objects according to the returned query results;
[0009] The corresponding relationship and the query result are used to construct a final tree structure, and corresponding tree data are obtained according to the tree structure.
[0010] Optionally, the object type of each level in the initial tree structure is a common parent type;
[0011] The step of classifying the objects at each level in the initial tree structure according to the CIM type to obtain objects of multiple types includes:
[0012] The objects of the common parent type in the initial tree structure are classified according to the CIM type to obtain a plurality of objects of descendant types.
[0013] Optionally, the step of merging objects of the same type and then using the CIS interface to query data of objects at the next level includes:
[0014] Merge objects of the same category at the same level to obtain objects of multiple categories corresponding to the current level;
[0015] The CIS interface is used to sequentially query data of objects at the next level for objects of multiple categories at the current level.
[0016] Optionally, the step of using the CIS interface to sequentially query data of objects at the next level for objects of multiple categories at the current level includes:
[0017] Use the CIS interface to query the next-level object for the object of the current category, obtain the identification information of the next-level object, and determine the CIM type of the next-level object according to the identification information;
[0018] Continue to use the CIS interface to query the next level of objects for the next category until all categories of objects at the current level are queried.
[0019] Optionally, after the step of merging objects of the same type and using the CIS interface to query data of objects at the next level, the method further includes:
[0020] Save the query results to the object information library;
[0021] Before using the CIS interface to query data on an object different from the current level, a search is performed in the object information library according to the category of the object.
[0022] Optionally, after the step of searching in the object information library according to the category of the object, the method further includes:
[0023] If a next-level object corresponding to the category of the object is searched in the object information library, the superior-subordinate relationship between the next-level object and the current-level object is determined according to the search result.
[0024] Optionally, the step of constructing a final tree structure using the corresponding relationship and the query result includes:
[0025] Read the object information of the next-level object stored in the object information library, build the superior-subordinate relationship between the next-level object and the current-level object through Substation.Bays association, and load the object information at the corresponding position of the initial tree structure to form the final tree structure.
[0026] The present invention also provides a tree data loading device based on CIM object classification, comprising:
[0027] An object classification unit, used to obtain an initial tree structure, classify objects at each level in the initial tree structure according to CIM types, and obtain objects of multiple types;
[0028] A data query unit, used to merge objects of the same type and use the CIS interface to query the data of the next-level objects, and determine the corresponding relationship between the next-level objects and the current-level objects according to the returned query results;
[0029] The data acquisition unit is used to construct a final tree structure using the corresponding relationship and the query result, and acquire corresponding tree data according to the tree structure.
[0030] The present invention also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the tree data loading method based on CIM object classification as described in any of the above embodiments.
[0031] The present invention also provides a computer device storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the tree data loading method based on CIM object classification as described in any of the above embodiments.
[0032] It can be seen from the above technical solutions that the embodiments of the present invention have the following advantages:
[0033] The tree data loading method, device and storage medium based on CIM object classification provided by the present invention include: obtaining an initial tree structure, classifying objects of each level in the initial tree structure according to CIM types to obtain objects of multiple types; merging objects of the same type and using a CIS interface to query data of objects of the next level, and determining the corresponding relationship between the objects of the next level and objects of the current level according to the returned query results; constructing a final tree structure using the corresponding relationship and the query results, and obtaining corresponding tree data according to the tree structure.
[0034] Compared with the prior art, the present invention classifies the objects in the initial tree structure according to the CIM type, performs batch object query according to the CIM type, and then constructs the final tree structure according to the query results; through this scheme, it is not necessary to call the CIS interface once for each object to query the data, but to query the same type of objects in batches according to the type of the object, so as to make full use of the characteristics of the CIS interface, reduce the number of calls to the CIS interface, and improve the efficiency of object query; and, the objects of the same type in the tree structure are merged, so as to avoid repeated queries of objects in the same level, reduce the occupation of network bandwidth, and reduce the occupied space of memory. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0036] Figure 1 A flowchart of a tree data loading method based on CIM object classification provided by an embodiment of the present invention;
[0037] Figure 2 A schematic diagram of the initial tree structure corresponding to all devices in a substation and their associated data provided by an embodiment of the present invention;
[0038] Figure 3 A structural diagram of a tree data loading method based on CIM object classification provided by an embodiment of the present invention;
[0039] Figure 4 A schematic diagram of the internal structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] Those skilled in the art will appreciate that, unless otherwise stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0042] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meaning as the general understanding of those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and will not be interpreted with an idealized or overly formal meaning unless specifically defined as in the embodiments of this application.
[0043] See also Figure 1 , Figure 1 The present invention provides a flow chart of a tree data loading method based on CIM object classification, which specifically includes the following steps:
[0044] S110: Acquire an initial tree structure, and classify objects at each level in the initial tree structure according to CIM types to obtain objects of multiple types.
[0045] In this step, before using CIM types to classify objects, it is necessary to obtain an initial tree structure containing all objects. The initial tree structure contains multiple levels, and each level has a corresponding device type.
[0046] Indicatively, Figure 2 As shown, Figure 2 A schematic diagram of the initial tree structure corresponding to all equipment under the substation and their associated data provided in an embodiment of the present invention. In the figure, there are multiple levels corresponding to the substation, and each level contains at least one object, but the object types in the initial tree structure are relatively rough, generally a common parent type, and its corresponding descendant type is unclear.
[0047] Therefore, after obtaining the initial tree structure, the present application classifies the objects at each level in the initial tree structure according to the CIM type, so as to obtain objects of multiple types.
[0048] It should be noted that the IEC61970 series of standards proposed the CIM model and CIS interface. As an important standard in the field of power system management and its information exchange, the CIM model defines the semantics of information exchange, and the CIS interface clarifies the syntax of information exchange. Therefore, using CIM types to classify objects in the initial tree structure can better perform data queries.
[0049] It is understandable that the objects here refer to all objects, including all devices and their associated data in the initial tree structure.
[0050] S120: After merging objects of the same type, use the CIS interface to query data of objects at the next level, and determine the corresponding relationship between the objects at the next level and objects at the current level according to the returned query results.
[0051] In this step, objects at each level in the initial tree structure are classified according to CIM types through step S110. After obtaining objects of multiple types, objects of the same type can be merged, and then the CIS interface is used to query the data of objects at the next level. In this way, there is no need to call the CIS interface once for each object to query the data. Instead, batch queries can be performed according to the type of the object, making full use of the characteristics of the CIS interface, reducing the number of calls to the CIS interface, and improving the efficiency of object queries; and, objects of the same type in the tree are merged to avoid repeated queries of objects at the same level, reduce the occupancy of network bandwidth, and reduce the memory space occupied.
[0052] Among them, when batch query is performed by object type, such as Figure 2 As shown, when querying substation->interval->transformer, all substations are queried in batches, the intervals under the substations are also queried in batches, and the transformers under the intervals are also queried in batches. Each level uses batch queries to improve query efficiency.
[0053] In addition, since the objects at this level are queried through the objects at the previous level, and the hierarchical relationship is established through its tree association, after using the CIS interface to query the data of the objects at the next level, the corresponding relationship between the objects at the next level and the objects at this level can be determined based on the returned query results, thus forming a mesh tree structure.
[0054] S130: construct a final tree structure using the corresponding relationship and the query result, and obtain corresponding tree data according to the tree structure.
[0055] In this step, after querying the object information of the next-level object and the correspondence between the next-level object and the current-level object in step S120, the final tree structure can be constructed according to the object information and the correspondence, and the corresponding tree data can be obtained through the tree structure.
[0056] Compared with the prior art, this embodiment classifies the objects in the initial tree structure by CIM type, performs batch object query by CIM type, and then constructs the final tree structure according to the query results; through this solution, it is not necessary to call the CIS interface once for each object to query data, but to query the same type of objects in batches according to the type of the object, making full use of the characteristics of the CIS interface, reducing the number of calls to the CIS interface, and improving the efficiency of object query; and, objects of the same type in the tree structure are merged to avoid repeated queries of objects at the same level, reducing the occupancy of network bandwidth, and reducing the memory space occupied.
[0057] In one embodiment, the object type of each level in the initial tree structure is a common parent type; the step of classifying the objects of each level in the initial tree structure according to the CIM type to obtain multiple types of objects in step S110 may include: classifying the objects of the common parent type in the initial tree structure according to the CIM type to obtain multiple descendant types of objects.
[0058] In this embodiment, the object type of each level will be defined in the initial tree structure, but it is only a common parent type, not a specific descendant type. For example, the next level of the bay is the equipment contained in the bay. The equipment has many descendant types, such as circuit breakers, disconnectors, ground disconnectors, and busbar sections. The initial tree structure can only generally describe the common parent type equipment of these specific types. The rough type can be determined based on the tree. However, when it comes to a specific object, the CIM type is required to divide its clear descendant types.
[0059] In one embodiment, the step of merging objects of the same type and then querying data of the next-level objects using the CIS interface in step S120 may include:
[0060] S121: merging objects of the same category at the same level to obtain objects of multiple categories corresponding to the current level;
[0061] S122: Using the CIS interface, query the data of the objects at the next level in turn for the objects of the multiple categories at the current level.
[0062] In this embodiment, when performing batch data query on objects of different types, it is first necessary to merge objects of the same type grouping, and merge the same objects into the same object. Since objects at the same level may be repeated, such as the type of device (PSRType), the same type of devices will be associated with the same device type object, and objects at this level are merged to reduce repeated queries.
[0063] After merging objects of different types, the CIS interface is used to query the batch data of the objects of the next level in turn for the objects of multiple categories at the current level, so as to obtain the object information of the next level.
[0064] In one embodiment, the step of using the CIS interface to sequentially query the data of the objects of the next level for the objects of the multiple categories of the current level in step S122 may include:
[0065] S221: Use the CIS interface to query the next-level object for the object of the current category, obtain the identification information of the next-level object, and determine the CIM type of the next-level object according to the identification information;
[0066] S222: Continue to use the CIS interface to query the next-level objects for the next category until all categories of objects at the current level are queried.
[0067] In this embodiment, when querying the next level object, the first thing obtained is only the identification information of the object. The specific type of the next level object can be further determined through the identification information, such as Breaker, Disconnector, GroundDisconnector, BusbarSection, which are all subtypes of the Equipment type.
[0068] When all categories of objects at this level have been queried, the data loading operation for the next level can be performed.
[0069] In one embodiment, after the step of merging objects of the same type and using the CIS interface to query data of objects at the next level in step S120, the following may also be included:
[0070] S140: Save the query result to the object information library;
[0071] S150: Before using the CIS interface to query data on an object different from the current level, searching in the object information library according to the category of the object.
[0072] In this embodiment, since the data is a network structure, when a tree structure is formed, there will inevitably be objects of the same type appearing at different levels. Therefore, after querying objects of different categories, the query results need to be saved in the object information library for subsequent use in querying objects of the same type at different levels.
[0073] Specifically, since the same type of object may appear in different levels, for example, through two levels: substation->bay->switch->equipment type, substation->voltage level area->bay->switch->equipment type, since the last end is the equipment type of the switch object being queried, the equipment types must be the same (all switches). Therefore, before using the CIS interface to query data for objects different from the current level, it is necessary to search in the object information library according to the category of the current object to detect whether the object has been queried. If it has been queried in the previous hierarchical structure, it will not be queried again.
[0074] It can be understood that the object information library contains detailed information on batch query objects by type. The results of all queried objects are placed in the object information library to facilitate detection of whether the object has been queried, prevent repeated queries of the same objects at different levels, and improve the efficiency of tree data loading.
[0075] In one embodiment, after the step of searching the object information library according to the category of the object in step S150, the following may also be included:
[0076] S160: If a next-level object corresponding to the category of the object is found in the object information library, a superior-subordinate relationship between the next-level object and the current-level object is determined according to the search result.
[0077] In this step, the object information library contains detailed information on batch query objects by type. The results of all queried objects are placed in the object information library. Therefore, before using the CIS interface to query data for objects different from the current level, if the next-level object corresponding to the category of the object is searched in the object information library, it means that the object has been queried in the previous hierarchical structure. Therefore, the previous query results, that is, the current search results, can be directly called in the object information library.
[0078] After the search results are obtained, the hierarchical relationship between the next-level object and the current-level object can be determined based on the search results, and then the final tree structure can be constructed.
[0079] In one embodiment, the step of constructing a final tree structure using the corresponding relationship and the query result in step S130 may include:
[0080] Read the object information of the next-level object stored in the object information library, build the superior-subordinate relationship between the next-level object and the current-level object through Substation.Bays association, and load the object information at the corresponding position of the initial tree structure to form the final tree structure.
[0081] In this embodiment, since the objects at this level are all queried through the objects at the previous level, the hierarchical relationship is established through their tree association. For example, substation->bay, the association Substation.Bays between the substation and the bay is queried, and the hierarchical relationship between the bay object and the upper substation object is established through the Substation.Bays association.
[0082] Therefore, before establishing the hierarchical relationship between the current level and the next level objects, it is necessary to read all the object information in this level from the object information library, such as substation->bay, through the Substation.Bays association, and build the hierarchical relationship between the bay object and the substation object through this association.
[0083] Then query the information of the next level object, and repeat this method to build the superior-subordinate relationship with the current level object, so as to load the complete tree data.
[0084] In one embodiment, Figure 3 As shown, Figure 3 A structural diagram of a tree data loading device based on CIM object classification provided by an embodiment of the present invention; the present invention also provides a tree data loading device based on CIM object classification, including an object classification unit 110, a data query unit 120, and a data acquisition unit 130, which specifically includes the following:
[0085] The object classification unit 110 is used to obtain an initial tree structure, classify objects at each level in the initial tree structure according to CIM types, and obtain objects of multiple types;
[0086] The data query unit 120 is used to merge objects of the same type and use the CIS interface to query the data of the next-level objects, and determine the corresponding relationship between the next-level objects and the current-level objects according to the returned query results;
[0087] The data acquisition unit 130 is used to construct a final tree structure using the corresponding relationship and the query result, and acquire corresponding tree data according to the tree structure.
[0088] Compared with the prior art, this embodiment classifies the objects in the initial tree structure by CIM type, performs batch object query by CIM type, and then constructs the final tree structure according to the query results; through this solution, it is not necessary to call the CIS interface once for each object to query data, but to query the same type of objects in batches according to the type of the object, making full use of the characteristics of the CIS interface, reducing the number of calls to the CIS interface, and improving the efficiency of object query; and, objects of the same type in the tree structure are merged to avoid repeated queries of objects at the same level, reducing the occupancy of network bandwidth, and reducing the memory space occupied.
[0089] In one embodiment, the present invention also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the tree data loading method based on CIM object classification as described in any of the above embodiments.
[0090] In one embodiment, the present invention also provides a computer device storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the tree data loading method based on CIM object classification as described in any of the above embodiments.
[0091] Indicatively, Figure 4 As shown, Figure 4 The internal structure diagram of a computer device provided by an embodiment of the present invention is shown in FIG. 200 . The computer device 200 may be provided as a server. Figure 4 The computer device 200 includes a processing component 202, which further includes one or more processors, and a memory resource represented by a memory 201, for storing instructions executable by the processing component 202, such as an application. The application stored in the memory 201 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 202 is configured to execute instructions to perform the tree data loading method based on CIM object classification according to any of the above embodiments.
[0092] The computer device 200 may further include a power supply component 203 configured to perform power management of the computer device 200, a wired or wireless network interface 204 configured to connect the computer device 200 to a network, and an input / output (I / O) interface 205. The computer device 200 may operate based on an operating system stored in the memory 201, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, Free BSD TM, or the like.
[0093] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0094] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A tree data loading method based on CIM object classification, It is characterized in that include: Acquire an initial tree structure, and classify objects at each level in the initial tree structure according to CIM types to obtain objects of multiple types; After merging objects of the same type, use the CIS interface to query the data of the next-level objects, and determine the corresponding relationship between the next-level objects and the current-level objects according to the returned query results; Save the query results to the object information library; Before using the CIS interface to query data on an object different from the current level, searching the object information library according to the category of the object; If a next-level object corresponding to the category of the object is searched in the object information library, the superior-subordinate relationship between the next-level object and the current-level object is determined according to the search result; Constructing a final tree structure using the corresponding relationship and the query result, and acquiring corresponding tree data according to the tree structure; The step of merging objects of the same type and then using the CIS interface to query data of objects at the next level includes: Merge objects of the same category at the same level to obtain objects of multiple categories corresponding to the current level; Use the CIS interface to query the next-level object for the object of the current category, obtain the identification information of the next-level object, and determine the CIM type of the next-level object according to the identification information; Continue to use the CIS interface to query the next level of objects for the next category until all categories of objects at the current level are queried.
2. A tree data loading method based on CIM object classification according to claim 1, It is characterized in that The object type of each level in the initial tree structure is a common parent type; The step of classifying the objects at each level in the initial tree structure according to the CIM type to obtain objects of multiple types includes: The objects of the common parent type in the initial tree structure are classified according to the CIM type to obtain a plurality of objects of descendant types.
3. A tree data loading method based on CIM object classification according to claim 1, It is characterized in that The step of constructing a final tree structure using the corresponding relationship and the query result includes: Read the object information of the next-level object stored in the object information library, build the superior-subordinate relationship between the next-level object and the current-level object through Substation.Bays association, and load the object information at the corresponding position of the initial tree structure to form the final tree structure.
4. A tree data loading device based on CIM object classification, It is characterized in that include: An object classification unit, used to obtain an initial tree structure, classify objects at each level in the initial tree structure according to CIM types, and obtain objects of multiple types; A data query unit, used to merge objects of the same type and use the CIS interface to query the data of the next-level objects, and determine the corresponding relationship between the next-level objects and the current-level objects according to the returned query results; Save the query results to the object information library; Before using the CIS interface to query data on an object different from the current level, searching the object information library according to the category of the object; If a next-level object corresponding to the category of the object is searched in the object information library, the superior-subordinate relationship between the next-level object and the current-level object is determined according to the search result; A data acquisition unit, used to construct a final tree structure using the corresponding relationship and the query result, and acquire corresponding tree data according to the tree structure; The step of merging objects of the same type in the data query unit and then using the CIS interface to query data of objects at the next level includes: Merge objects of the same category at the same level to obtain objects of multiple categories corresponding to the current level; Use the CIS interface to query the next-level object for the object of the current category, obtain the identification information of the next-level object, and determine the CIM type of the next-level object according to the identification information; Continue to use the CIS interface to query the next level of objects for the next category until all categories of objects at the current level are queried.
5. A storage medium, Features: The storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the tree data loading method based on CIM object classification as described in any one of claims 1 to 3.
6. A computer device, Features: The computer device stores computer-readable instructions, which, when executed by one or more processors, enable the one or more processors to execute the steps of the tree data loading method based on CIM object classification as claimed in any one of claims 1 to 3.
